diff --git a/examples/src/main/java/example/ServerOperations.java b/examples/src/main/java/example/ServerOperations.java index c4ce7287e8c..5d978867a0a 100644 --- a/examples/src/main/java/example/ServerOperations.java +++ b/examples/src/main/java/example/ServerOperations.java @@ -36,9 +36,12 @@ public class ServerOperations { public void manualInputAndOutput(HttpServletRequest theServletRequest, HttpServletResponse theServletResponse) throws IOException { String contentType = theServletRequest.getContentType(); byte[] bytes = IOUtils.toByteArray(theServletRequest.getInputStream()); - ourLog.info("Received call with content type {} and {} bytes", contentType, bytes.length); + // In a real example we might do something more interesting with the received bytes, + // here we'll just replace them with hardcoded ones + bytes = new byte[] { 0, 1, 2, 3 }; + theServletResponse.setContentType(contentType); theServletResponse.getOutputStream().write(bytes); theServletResponse.getOutputStream().close(); diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java index e6f793f95e2..a87800dfc91 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/XmlUtil.java @@ -31,6 +31,8 @@ import org.apache.commons.text.StringEscapeUtils; import org.codehaus.stax2.XMLOutputFactory2; import org.codehaus.stax2.io.EscapingWriterFactory; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; import javax.xml.stream.*; import javax.xml.stream.events.XMLEvent; import java.io.*; @@ -40,7 +42,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank; /** * Utility methods for working with the StAX API. - * + *

* This class contains code adapted from the Apache Axiom project. */ public class XmlUtil { @@ -1503,10 +1505,77 @@ public class XmlUtil { validEntityNames.put("zscr", 0x1D4CF); validEntityNames.put("zwj", 0x0200D); validEntityNames.put("zwnj", 0x0200C); - + VALID_ENTITY_NAMES = Collections.unmodifiableMap(validEntityNames); } + /** Non-instantiable */ + private XmlUtil() {} + + private static final class ExtendedEntityReplacingXmlResolver implements XMLResolver { + @Override + public Object resolveEntity(String thePublicID, String theSystemID, String theBaseURI, String theNamespace) { + if (thePublicID == null && theSystemID == null) { + if (theNamespace != null && VALID_ENTITY_NAMES.containsKey(theNamespace)) { + return new String(Character.toChars(VALID_ENTITY_NAMES.get(theNamespace))); + } + } + + return null; + } + } + + public static class MyEscaper implements EscapingWriterFactory { + + @Override + public Writer createEscapingWriterFor(OutputStream theOut, String theEnc) throws UnsupportedEncodingException { + return createEscapingWriterFor(new OutputStreamWriter(theOut, theEnc), theEnc); + } + + @Override + public Writer createEscapingWriterFor(final Writer theW, String theEnc) { + return new Writer() { + + @Override + public void close() throws IOException { + theW.close(); + } + + @Override + public void flush() throws IOException { + theW.flush(); + } + + @Override + public void write(char[] theCbuf, int theOff, int theLen) throws IOException { + boolean hasEscapable = false; + for (int i = 0; i < theLen && !hasEscapable; i++) { + char nextChar = theCbuf[i + theOff]; + switch (nextChar) { + case '<': + case '>': + case '"': + case '&': + hasEscapable = true; + break; + default: + break; + } + } + + if (!hasEscapable) { + theW.write(theCbuf, theOff, theLen); + return; + } + + String escaped = StringEscapeUtils.escapeXml10(new String(theCbuf, theOff, theLen)); + theW.write(escaped.toCharArray()); + } + }; + } + + } + private static XMLOutputFactory createOutputFactory() throws FactoryConfigurationError { try { // Detect if we're running with the Android lib, and force repackaged Woodstox to be used @@ -1637,15 +1706,11 @@ public class XmlUtil { try { Class.forName("com.ctc.wstx.stax.WstxInputFactory"); boolean isWoodstox = inputFactory instanceof com.ctc.wstx.stax.WstxInputFactory; - if ( !isWoodstox ) - { + if (!isWoodstox) { // Check if implementation is woodstox by property since instanceof check does not work if running in JBoss - try - { - isWoodstox = inputFactory.getProperty( "org.codehaus.stax2.implVersion" ) != null; - } - catch ( Exception e ) - { + try { + isWoodstox = inputFactory.getProperty("org.codehaus.stax2.implVersion") != null; + } catch (Exception e) { // ignore } } @@ -1673,7 +1738,6 @@ public class XmlUtil { return ourOutputFactory; } - private static void logStaxImplementation(Class theClass) { IDependencyLog logger = DependencyLogFactory.createJarLogger(); if (logger != null) { @@ -1682,7 +1746,6 @@ public class XmlUtil { ourHaveLoggedStaxImplementation = true; } - static XMLInputFactory newInputFactory() throws FactoryConfigurationError { XMLInputFactory inputFactory; try { @@ -1761,74 +1824,29 @@ public class XmlUtil { private static void throwUnitTestExceptionIfConfiguredToDoSo() throws FactoryConfigurationError, XMLStreamException { if (ourNextException != null) { if (ourNextException instanceof javax.xml.stream.FactoryConfigurationError) { - throw ((javax.xml.stream.FactoryConfigurationError)ourNextException); + throw ((javax.xml.stream.FactoryConfigurationError) ourNextException); } - throw (XMLStreamException)ourNextException; + throw (XMLStreamException) ourNextException; } } - private static final class ExtendedEntityReplacingXmlResolver implements XMLResolver { - @Override - public Object resolveEntity(String thePublicID, String theSystemID, String theBaseURI, String theNamespace) { - if (thePublicID == null && theSystemID == null) { - if (theNamespace != null && VALID_ENTITY_NAMES.containsKey(theNamespace)) { - return new String(Character.toChars(VALID_ENTITY_NAMES.get(theNamespace))); - } - } - - return null; - } - } - - public static class MyEscaper implements EscapingWriterFactory { - - @Override - public Writer createEscapingWriterFor(OutputStream theOut, String theEnc) throws UnsupportedEncodingException { - return createEscapingWriterFor(new OutputStreamWriter(theOut, theEnc), theEnc); - } - - @Override - public Writer createEscapingWriterFor(final Writer theW, String theEnc) { - return new Writer() { - - @Override - public void close() throws IOException { - theW.close(); - } - - @Override - public void flush() throws IOException { - theW.flush(); - } - - @Override - public void write(char[] theCbuf, int theOff, int theLen) throws IOException { - boolean hasEscapable = false; - for (int i = 0; i < theLen && !hasEscapable; i++) { - char nextChar = theCbuf[i + theOff]; - switch (nextChar) { - case '<': - case '>': - case '"': - case '&': - hasEscapable = true; - break; - default: - break; - } - } - - if (!hasEscapable) { - theW.write(theCbuf, theOff, theLen); - return; - } - - String escaped = StringEscapeUtils.escapeXml10(new String(theCbuf, theOff, theLen)); - theW.write(escaped.toCharArray()); - } - }; + public static DocumentBuilderFactory newDocumentBuilderFactory() { + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); + docBuilderFactory.setNamespaceAware(true); + docBuilderFactory.setXIncludeAware(false); + docBuilderFactory.setExpandEntityReferences(false); + try { + docBuilderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + docBuilderFactory.setFeature("http://xml.org/sax/features/external-general-entities", false); + docBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-dtd-grammar", false); + docBuilderFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + docBuilderFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + throwUnitTestExceptionIfConfiguredToDoSo(); + } catch (Exception e) { + ourLog.warn("Failed to set feature on XML parser: " + e.toString()); } + return docBuilderFactory; } } diff --git a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/validation/FhirInstanceValidator.java b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/validation/FhirInstanceValidator.java index b14596caf18..7933bf542bf 100644 --- a/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/validation/FhirInstanceValidator.java +++ b/hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/hapi/validation/FhirInstanceValidator.java @@ -6,6 +6,7 @@ import java.util.*; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import ca.uhn.fhir.util.XmlUtil; import org.apache.commons.lang3.Validate; import org.hl7.fhir.dstu2016may.model.OperationOutcome.IssueSeverity; import org.hl7.fhir.dstu2016may.model.StructureDefinition; @@ -48,8 +49,7 @@ public class FhirInstanceValidator extends BaseValidatorBridge implements IValid * The validation support */ public FhirInstanceValidator(IValidationSupport theValidationSupport) { - myDocBuilderFactory = DocumentBuilderFactory.newInstance(); - myDocBuilderFactory.setNamespaceAware(true); + myDocBuilderFactory = XmlUtil.newDocumentBuilderFactory(); myValidationSupport = theValidationSupport; } diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/FormatUtilities.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/FormatUtilities.java deleted file mode 100644 index 773dce2d82f..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/FormatUtilities.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.hl7.fhir.dstu2016may.formats; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -import java.math.BigDecimal; -import java.net.URI; - -import org.apache.commons.codec.binary.Base64; - -public abstract class FormatUtilities { - public static final String ID_REGEX = "[A-Za-z0-9\\-\\.]{1,64}"; - public static final String FHIR_NS = "http://hl7.org/fhir"; - public static final String XHTML_NS = "http://www.w3.org/1999/xhtml"; - public static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance"; - - protected String toString(String value) { - return value; - } - - protected String toString(int value) { - return java.lang.Integer.toString(value); - } - - protected String toString(boolean value) { - return java.lang.Boolean.toString(value); - } - - protected String toString(BigDecimal value) { - return value.toString(); - } - - protected String toString(URI value) { - return value.toString(); - } - - public static String toString(byte[] value) { - byte[] encodeBase64 = Base64.encodeBase64(value); - return new String(encodeBase64); - } - - public static boolean isValidId(String tail) { - return tail.matches(ID_REGEX); - } - - public static String makeId(String candidate) { - StringBuilder b = new StringBuilder(); - for (char c : candidate.toCharArray()) - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '.' || c == '-') - b.append(c); - return b.toString(); - } - - - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/IParser.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/IParser.java deleted file mode 100644 index 41864a89818..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/IParser.java +++ /dev/null @@ -1,221 +0,0 @@ -package org.hl7.fhir.dstu2016may.formats; - - -import java.io.IOException; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - - -import java.io.InputStream; -import java.io.OutputStream; -import java.io.UnsupportedEncodingException; - -import org.hl7.fhir.dstu2016may.model.Resource; -import org.hl7.fhir.dstu2016may.model.Type; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.xmlpull.v1.XmlPullParserException; - - -/** - * General interface - either an XML or JSON parser: read or write instances - * - * Defined to allow a factory to create a parser of the right type - */ -public interface IParser { - - /** - * check what kind of parser this is - * - * @return what kind of parser this is - */ - public ParserType getType(); - - // -- Parser Configuration ---------------------------------- - /** - * Whether to parse or ignore comments - either reading or writing - */ - public boolean getHandleComments(); - public IParser setHandleComments(boolean value); - - /** - * @param allowUnknownContent Whether to throw an exception if unknown content is found (or just skip it) when parsing - */ - public boolean isAllowUnknownContent(); - public IParser setAllowUnknownContent(boolean value); - - - public enum OutputStyle { - /** - * Produce normal output - no whitespace, except in HTML where whitespace is untouched - */ - NORMAL, - - /** - * Produce pretty output - human readable whitespace, HTML whitespace untouched - */ - PRETTY, - - /** - * Produce canonical output - no comments, no whitspace, HTML whitespace normlised, JSON attributes sorted alphabetically (slightly slower) - */ - CANONICAL, - } - - /** - * Writing: - */ - public OutputStyle getOutputStyle(); - public IParser setOutputStyle(OutputStyle value); - - /** - * This method is used by the publication tooling to stop the xhrtml narrative being generated. - * It is not valid to use in production use. The tooling uses it to generate json/xml representations in html that are not cluttered by escaped html representations of the html representation - */ - public IParser setSuppressXhtml(String message); - - // -- Reading methods ---------------------------------------- - - /** - * parse content that is known to be a resource - * @throws XmlPullParserException - * @throws FHIRFormatError - * @throws IOException - */ - public Resource parse(InputStream input) throws IOException, FHIRFormatError; - - /** - * parse content that is known to be a resource - * @throws UnsupportedEncodingException - * @throws IOException - * @throws FHIRFormatError - */ - public Resource parse(String input) throws UnsupportedEncodingException, FHIRFormatError, IOException; - - /** - * parse content that is known to be a resource - * @throws IOException - * @throws FHIRFormatError - */ - public Resource parse(byte[] bytes) throws FHIRFormatError, IOException; - - /** - * This is used to parse a type - a fragment of a resource. - * There's no reason to use this in production - it's used - * in the build tools - * - * Not supported by all implementations - * - * @param input - * @param knownType. if this is blank, the parser may try to infer the type (xml only) - * @return - * @throws XmlPullParserException - * @throws FHIRFormatError - * @throws IOException - */ - public Type parseType(InputStream input, String knownType) throws IOException, FHIRFormatError; - /** - * This is used to parse a type - a fragment of a resource. - * There's no reason to use this in production - it's used - * in the build tools - * - * Not supported by all implementations - * - * @param input - * @param knownType. if this is blank, the parser may try to infer the type (xml only) - * @return - * @throws UnsupportedEncodingException - * @throws IOException - * @throws FHIRFormatError - */ - public Type parseType(String input, String knownType) throws UnsupportedEncodingException, FHIRFormatError, IOException; - /** - * This is used to parse a type - a fragment of a resource. - * There's no reason to use this in production - it's used - * in the build tools - * - * Not supported by all implementations - * - * @param input - * @param knownType. if this is blank, the parser may try to infer the type (xml only) - * @return - * @throws IOException - * @throws FHIRFormatError - */ - public Type parseType(byte[] bytes, String knownType) throws FHIRFormatError, IOException; - - // -- Writing methods ---------------------------------------- - - /** - * Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) - * @throws IOException - */ - public void compose(OutputStream stream, Resource resource) throws IOException; - - /** - * Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) - * @throws IOException - */ - public String composeString(Resource resource) throws IOException; - - /** - * Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) - * @throws IOException - */ - public byte[] composeBytes(Resource resource) throws IOException; - - - /** - * Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) - * - * Not supported by all implementations. rootName is ignored in the JSON format - * @throws XmlPullParserException - * @throws FHIRFormatError - * @throws IOException - */ - public void compose(OutputStream stream, Type type, String rootName) throws IOException; - - /** - * Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) - * - * Not supported by all implementations. rootName is ignored in the JSON format - * @throws IOException - */ - public String composeString(Type type, String rootName) throws IOException; - - /** - * Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) - * - * Not supported by all implementations. rootName is ignored in the JSON format - * @throws IOException - */ - public byte[] composeBytes(Type type, String rootName) throws IOException; - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreator.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreator.java deleted file mode 100644 index 11131380bd1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreator.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.hl7.fhir.dstu2016may.formats; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Facade to GSON writer, or something that imposes property ordering first - * - * @author Grahame - * - */ -public interface JsonCreator { - - void setIndent(String string); - - void beginObject() throws IOException; - - void endObject() throws IOException; - - void nullValue() throws IOException; - - void name(String name) throws IOException; - - void value(String value) throws IOException; - - void value(Boolean value) throws IOException; - - void value(BigDecimal value) throws IOException; - - void value(Integer value) throws IOException; - - void beginArray() throws IOException; - - void endArray() throws IOException; - - void finish() throws IOException; - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreatorCanonical.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreatorCanonical.java deleted file mode 100644 index 427af2f91f8..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreatorCanonical.java +++ /dev/null @@ -1,227 +0,0 @@ -package org.hl7.fhir.dstu2016may.formats; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Stack; - -import com.google.gson.stream.JsonWriter; - -public class JsonCreatorCanonical implements JsonCreator { - - public class JsonCanValue { - String name; - private JsonCanValue(String name) { - this.name = name; - } - } - - private class JsonCanNumberValue extends JsonCanValue { - private BigDecimal value; - private JsonCanNumberValue(String name, BigDecimal value) { - super(name); - this.value = value; - } - } - - private class JsonCanIntegerValue extends JsonCanValue { - private Integer value; - private JsonCanIntegerValue(String name, Integer value) { - super(name); - this.value = value; - } - } - - private class JsonCanBooleanValue extends JsonCanValue { - private Boolean value; - private JsonCanBooleanValue(String name, Boolean value) { - super(name); - this.value = value; - } - } - - private class JsonCanStringValue extends JsonCanValue { - private String value; - private JsonCanStringValue(String name, String value) { - super(name); - this.value = value; - } - } - - private class JsonCanNullValue extends JsonCanValue { - private JsonCanNullValue(String name) { - super(name); - } - } - - public class JsonCanObject extends JsonCanValue { - - boolean array; - List children = new ArrayList(); - - public JsonCanObject(String name, boolean array) { - super(name); - this.array = array; - } - - public void addProp(JsonCanValue obj) { - children.add(obj); - } - } - - Stack stack; - JsonCanObject root; - JsonWriter gson; - String name; - - public JsonCreatorCanonical(OutputStreamWriter osw) { - stack = new Stack(); - gson = new JsonWriter(osw); - name = null; - } - - private String takeName() { - String res = name; - name = null; - return res; - } - - @Override - public void setIndent(String indent) { - if (!indent.equals("")) - throw new Error("do not use pretty when canonical is set"); - gson.setIndent(indent); - } - - @Override - public void beginObject() throws IOException { - JsonCanObject obj = new JsonCanObject(takeName(), false); - if (stack.isEmpty()) - root = obj; - else - stack.peek().addProp(obj); - stack.push(obj); - } - - @Override - public void endObject() throws IOException { - stack.pop(); - } - - @Override - public void nullValue() throws IOException { - stack.peek().addProp(new JsonCanNullValue(takeName())); - } - - @Override - public void name(String name) throws IOException { - this.name = name; - } - - @Override - public void value(String value) throws IOException { - stack.peek().addProp(new JsonCanStringValue(takeName(), value)); - } - - @Override - public void value(Boolean value) throws IOException { - stack.peek().addProp(new JsonCanBooleanValue(takeName(), value)); - } - - @Override - public void value(BigDecimal value) throws IOException { - stack.peek().addProp(new JsonCanNumberValue(takeName(), value)); - } - - @Override - public void value(Integer value) throws IOException { - stack.peek().addProp(new JsonCanIntegerValue(takeName(), value)); - } - - @Override - public void beginArray() throws IOException { - JsonCanObject obj = new JsonCanObject(takeName(), true); - if (!stack.isEmpty()) - stack.peek().addProp(obj); - stack.push(obj); - - } - - @Override - public void endArray() throws IOException { - stack.pop(); - } - - @Override - public void finish() throws IOException { - writeObject(root); - } - - private void writeObject(JsonCanObject obj) throws IOException { - gson.beginObject(); - List names = new ArrayList(); - for (JsonCanValue v : obj.children) - names.add(v.name); - Collections.sort(names); - for (String n : names) { - gson.name(n); - JsonCanValue v = getPropForName(n, obj.children); - if (v instanceof JsonCanNumberValue) - gson.value(((JsonCanNumberValue) v).value); - else if (v instanceof JsonCanIntegerValue) - gson.value(((JsonCanIntegerValue) v).value); - else if (v instanceof JsonCanBooleanValue) - gson.value(((JsonCanBooleanValue) v).value); - else if (v instanceof JsonCanStringValue) - gson.value(((JsonCanStringValue) v).value); - else if (v instanceof JsonCanNullValue) - gson.nullValue(); - else if (v instanceof JsonCanObject) { - JsonCanObject o = (JsonCanObject) v; - if (o.array) - writeArray(o); - else - writeObject(o); - } else - throw new Error("not possible"); - } - gson.endObject(); - } - - private JsonCanValue getPropForName(String name, List children) { - for (JsonCanValue child : children) - if (child.name.equals(name)) - return child; - return null; - } - - private void writeArray(JsonCanObject arr) throws IOException { - gson.beginArray(); - for (JsonCanValue v : arr.children) { - if (v instanceof JsonCanNumberValue) - gson.value(((JsonCanNumberValue) v).value); - else if (v instanceof JsonCanIntegerValue) - gson.value(((JsonCanIntegerValue) v).value); - else if (v instanceof JsonCanBooleanValue) - gson.value(((JsonCanBooleanValue) v).value); - else if (v instanceof JsonCanStringValue) - gson.value(((JsonCanStringValue) v).value); - else if (v instanceof JsonCanNullValue) - gson.nullValue(); - else if (v instanceof JsonCanObject) { - JsonCanObject o = (JsonCanObject) v; - if (o.array) - writeArray(o); - else - writeObject(o); - } else - throw new Error("not possible"); - } - gson.endArray(); - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreatorGson.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreatorGson.java deleted file mode 100644 index 8594b82860e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/JsonCreatorGson.java +++ /dev/null @@ -1,78 +0,0 @@ -package org.hl7.fhir.dstu2016may.formats; - -import java.io.IOException; -import java.io.OutputStreamWriter; -import java.math.BigDecimal; - -import com.google.gson.stream.JsonWriter; - -public class JsonCreatorGson implements JsonCreator { - - JsonWriter gson; - - public JsonCreatorGson(OutputStreamWriter osw) { - gson = new JsonWriter(osw); - } - - @Override - public void setIndent(String indent) { - gson.setIndent(indent); - } - - @Override - public void beginObject() throws IOException { - gson.beginObject(); - } - - @Override - public void endObject() throws IOException { - gson.endObject(); - } - - @Override - public void nullValue() throws IOException { - gson.nullValue(); - } - - @Override - public void name(String name) throws IOException { - gson.name(name); - } - - @Override - public void value(String value) throws IOException { - gson.value(value); - } - - @Override - public void value(Boolean value) throws IOException { - gson.value(value); - } - - @Override - public void value(BigDecimal value) throws IOException { - gson.value(value); - } - - @Override - public void value(Integer value) throws IOException { - gson.value(value); - } - - @Override - public void beginArray() throws IOException { - gson.beginArray(); - } - - @Override - public void endArray() throws IOException { - gson.endArray(); - } - - @Override - public void finish() { - // nothing to do here - - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/ParserType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/ParserType.java deleted file mode 100644 index 353508b64b6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/formats/ParserType.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.hl7.fhir.dstu2016may.formats; - -/** - * Used in factory methods for parsers, for requesting a parser of a particular type - * (see IWorkerContext) - * - * @author Grahame - * - */ -public enum ParserType { - /** - * XML as specified in specification - */ - XML, - - /** - * JSON as specified in the specification - */ - JSON, - - /** - * XHTML - write narrative (generate if necessary). No read - */ - XHTML, - - /** - * RDF is not supported yet - */ - RDF_TURTLE -} \ No newline at end of file diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Element.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Element.java deleted file mode 100644 index f65e3b64fd6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Element.java +++ /dev/null @@ -1,304 +0,0 @@ -package org.hl7.fhir.dstu2016may.metamodel; - -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Base; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; - -/** - * This class represents the reference model of FHIR - * - * A resource is nothing but a set of elements, where every element has a - * name, maybe a stated type, maybe an id, and either a value or child elements - * (one or the other, or both (but not neither if it's null) - * - * @author Grahame Grieve - * - */ -public class Element extends Base { - - public enum SpecialElement { - CONTAINED, BUNDLE_ENTRY; - } - - private List comments;// not relevant for production, but useful in documentation - private String name; - private String type; - private String value; - private int index = -1; - private List children; - private Property property; - private int line; - private int col; - private SpecialElement special; - private XhtmlNode xhtml; // if this is populated, then value will also hold the string representation - - public Element(String name) { - super(); - this.name = name; - } - - public Element(String name, Property property) { - super(); - this.name = name; - this.property = property; - } - - public Element(String name, Property property, String type, String value) { - super(); - this.name = name; - this.property = property; - this.type = type; - this.value = value; - } - - public void updateProperty(Property property, SpecialElement special) { - this.property = property; - this.special = special; - } - - public SpecialElement getSpecial() { - return special; - } - - public String getName() { - return name; - } - - public String getType() { - if (type == null) - return property.getType(name); - else - return type; - } - - public String getValue() { - return value; - } - - public boolean hasChildren() { - return !(children == null || children.isEmpty()); - } - - public List getChildren() { - if (children == null) - children = new ArrayList(); - return children; - } - - public boolean hasComments() { - return !(comments == null || comments.isEmpty()); - } - - public List getComments() { - if (comments == null) - comments = new ArrayList(); - return comments; - } - - public Property getProperty() { - return property; - } - - public void setValue(String value) { - this.value = value; - } - - public void setType(String type) { - this.type = type; - - } - - public boolean hasValue() { - return value != null; - } - - public List getChildrenByName(String name) { - List res = new ArrayList(); - if (hasChildren()) { - for (Element child : children) - if (name.equals(child.getName())) - res.add(child); - } - return res; - } - - public void numberChildren() { - if (children == null) - return; - - String last = ""; - int index = 0; - for (Element child : children) { - if (child.getProperty().isList()) { - if (last.equals(child.getName())) { - index++; - } else { - last = child.getName(); - index = 0; - } - child.index = index; - } else { - child.index = -1; - } - child.numberChildren(); - } - } - - public int getIndex() { - return index; - } - - public boolean hasIndex() { - return index > -1; - } - - public void setIndex(int index) { - this.index = index; - } - - public String getChildValue(String name) { - if (children == null) - return null; - for (Element child : children) { - if (name.equals(child.getName())) - return child.getValue(); - } - return null; - } - - public List getChildren(String name) { - List res = new ArrayList(); - for (Element child : children) { - if (name.equals(child.getName())) - res.add(child); - } - return res; - } - - public boolean hasType() { - if (type == null) - return property.hasType(name); - else - return true; - } - - @Override - public String fhirType() { - return getType(); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - if (isPrimitive() && (hash == "value".hashCode()) && !Utilities.noString(value)) { - String tn = getType(); - throw new Error("not done yet"); - } - - List result = new ArrayList(); - for (Element child : children) { - if (child.getName().equals(name)) - result.add(child); - if (child.getName().startsWith(name) && child.getProperty().isChoice() && child.getProperty().getName().equals(name+"[x]")) - result.add(child); - } - if (result.isEmpty() && checkValid) { -// throw new FHIRException("not determined yet"); - } - return result.toArray(new Base[result.size()]); - } - - @Override - protected void listChildren( - List result) { - // TODO Auto-generated method stub - - } - - @Override - public boolean isPrimitive() { - return type != null ? ParserBase.isPrimitive(type) : property.isPrimitive(name); - } - - @Override - public boolean hasPrimitiveValue() { - return property.isPrimitive(name) || property.IsLogicalAndHasPrimitiveValue(name); - } - - - @Override - public String primitiveValue() { - if (isPrimitive()) - return value; - else { - if (hasPrimitiveValue()) { - for (Element c : children) { - if (c.getName().equals("value")) - return c.primitiveValue(); - } - } - return null; - } - } - - // for the validator - public int line() { - return line; - } - - public int col() { - return col; - } - - public Element markLocation(int line, int col) { - this.line = line; - this.col = col; - return this; - } - - public Element getNamedChild(String name) { - if (children == null) - return null; - Element result = null; - for (Element child : children) { - if (child.getName().equals(name)) { - if (result == null) - result = child; - else - throw new Error("Attempt to read a single element when there is more than one present ("+name+")"); - } - } - return result; - } - - public void getNamedChildren(String name, List list) { - if (children != null) - for (Element child : children) - if (child.getName().equals(name)) - list.add(child); - } - - public String getNamedChildValue(String name) { - Element child = getNamedChild(name); - return child == null ? null : child.value; - } - - public void getNamedChildrenWithWildcard(String string, List values) { - throw new Error("not done yet"); - } - - - public XhtmlNode getXhtml() { - return xhtml; - } - - public Element setXhtml(XhtmlNode xhtml) { - this.xhtml = xhtml; - return this; - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/JsonParser.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/JsonParser.java deleted file mode 100644 index 95c58553047..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/JsonParser.java +++ /dev/null @@ -1,421 +0,0 @@ -package org.hl7.fhir.dstu2016may.metamodel; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; - -import org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle; -import org.hl7.fhir.dstu2016may.formats.JsonCreator; -import org.hl7.fhir.dstu2016may.formats.JsonCreatorCanonical; -import org.hl7.fhir.dstu2016may.formats.JsonCreatorGson; -import org.hl7.fhir.dstu2016may.metamodel.Element.SpecialElement; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent; -import org.hl7.fhir.dstu2016may.model.StructureDefinition; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; -import org.hl7.fhir.dstu2016may.utils.JsonTrackingParser; -import org.hl7.fhir.dstu2016may.utils.JsonTrackingParser.LocationData; -import org.hl7.fhir.exceptions.DefinitionException; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.utilities.TextFile; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; -import org.hl7.fhir.utilities.xhtml.XhtmlParser; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonNull; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -public class JsonParser extends ParserBase { - - private JsonCreator json; - private Map map; - - public JsonParser(IWorkerContext context) { - super(context); - } - - @Override - public Element parse(InputStream stream) throws Exception { - // if we're parsing at this point, then we're going to use the custom parser - map = new HashMap(); - String source = TextFile.streamToString(stream); - if (policy == ValidationPolicy.EVERYTHING) { - JsonObject obj = null; - try { - obj = JsonTrackingParser.parse(source, map); - } catch (Exception e) { - logError(-1, -1, "(document)", IssueType.INVALID, "Error parsing JSON: "+e.getMessage(), IssueSeverity.FATAL); - return null; - } - assert (map.containsKey(obj)); - return parse(obj); - } else { - JsonObject obj = (JsonObject) new com.google.gson.JsonParser().parse(source); - assert (map.containsKey(obj)); - return parse(obj); - } - } - - public Element parse(JsonObject object, Map map) throws Exception { - this.map = map; - return parse(object); - } - - public Element parse(JsonObject object) throws Exception { - JsonElement rt = object.get("resourceType"); - if (rt == null) { - logError(line(object), col(object), "$", IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL); - return null; - } else { - String name = rt.getAsString(); - String path = "/"+name; - - StructureDefinition sd = getDefinition(line(object), col(object), name); - if (sd == null) - return null; - - Element result = new Element(name, new Property(context, sd.getSnapshot().getElement().get(0), sd)); - checkObject(object, path); - result.markLocation(line(object), col(object)); - result.setType(name); - parseChildren(path, object, result, true); - result.numberChildren(); - return result; - } - } - - private void checkObject(JsonObject object, String path) throws FHIRFormatError { - if (policy == ValidationPolicy.EVERYTHING) { - boolean found = false; - for (Entry e : object.entrySet()) { - // if (!e.getKey().equals("fhir_comments")) { - found = true; - break; - // } - } - if (!found) - logError(line(object), col(object), path, IssueType.INVALID, "Object must have some content", IssueSeverity.ERROR); - } - } - - private void parseChildren(String path, JsonObject object, Element context, boolean hasResourceType) throws DefinitionException, FHIRFormatError { - reapComments(object, context); - List properties = getChildProperties(context.getProperty(), context.getName(), null); - Set processed = new HashSet(); - if (hasResourceType) - processed.add("resourceType"); - processed.add("fhir_comments"); - - // note that we do not trouble ourselves to maintain the wire format order here - we don't even know what it was anyway - // first pass: process the properties - for (Property property : properties) { - if (property.isChoice()) { - for (TypeRefComponent type : property.getDefinition().getType()) { - String eName = property.getName().substring(0, property.getName().length()-3) + Utilities.capitalize(type.getCode()); - if (!ParserBase.isPrimitive(type.getCode()) && object.has(eName)) { - parseChildComplex(path, object, context, processed, property, eName); - break; - } else if (ParserBase.isPrimitive(type.getCode()) && (object.has(eName) || object.has("_"+eName))) { - parseChildPrimitive(object, context, processed, property, path, eName); - break; - } - } - } else if (property.isPrimitive(null)) { - parseChildPrimitive(object, context, processed, property, path, property.getName()); - } else if (object.has(property.getName())) { - parseChildComplex(path, object, context, processed, property, property.getName()); - } - } - - // second pass: check for things not processed - if (policy != ValidationPolicy.NONE) { - for (Entry e : object.entrySet()) { - if (!processed.contains(e.getKey())) { - logError(line(e.getValue()), col(e.getValue()), path, IssueType.STRUCTURE, "Unrecognised property '@"+e.getKey()+"'", IssueSeverity.ERROR); - } - } - } - } - - private void parseChildComplex(String path, JsonObject object, Element context, Set processed, Property property, String name) throws FHIRFormatError, DefinitionException { - processed.add(name); - String npath = path+"/"+property.getName(); - JsonElement e = object.get(name); - if (property.isList() && (e instanceof JsonArray)) { - JsonArray arr = (JsonArray) e; - for (JsonElement am : arr) { - parseChildComplexInstance(npath, object, context, property, name, am); - } - } else { - parseChildComplexInstance(npath, object, context, property, name, e); - } - } - - private void parseChildComplexInstance(String npath, JsonObject object, Element context, Property property, String name, JsonElement e) throws FHIRFormatError, DefinitionException { - if (e instanceof JsonObject) { - JsonObject child = (JsonObject) e; - Element n = new Element(name, property).markLocation(line(child), col(child)); - checkObject(child, npath); - context.getChildren().add(n); - if (property.isResource()) - parseResource(npath, child, n); - else - parseChildren(npath, child, n, false); - } else - logError(line(e), col(e), npath, IssueType.INVALID, "This property must be "+(property.isList() ? "an Array" : "an Object")+", not a "+e.getClass().getName(), IssueSeverity.ERROR); - } - - private void parseChildPrimitive(JsonObject object, Element context, Set processed, Property property, String path, String name) throws FHIRFormatError, DefinitionException { - String npath = path+"/"+property.getName(); - processed.add(name); - processed.add("_"+name); - JsonElement main = object.has(name) ? object.get(name) : null; - JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null; - if (main != null || fork != null) { - if (property.isList() && ((main == null) || (main instanceof JsonArray)) &&((fork == null) || (fork instanceof JsonArray)) ) { - JsonArray arr1 = (JsonArray) main; - JsonArray arr2 = (JsonArray) fork; - for (int i = 0; i < Math.max(arrC(arr1), arrC(arr2)); i++) { - JsonElement m = arrI(arr1, i); - JsonElement f = arrI(arr2, i); - parseChildPrimitiveInstance(context, property, name, npath, m, f); - } - } else - parseChildPrimitiveInstance(context, property, name, npath, main, fork); - } - } - - private JsonElement arrI(JsonArray arr, int i) { - return arr == null || i >= arr.size() || arr.get(i) instanceof JsonNull ? null : arr.get(i); - } - - private int arrC(JsonArray arr) { - return arr == null ? 0 : arr.size(); - } - - private void parseChildPrimitiveInstance(Element context, Property property, String name, String npath, - JsonElement main, JsonElement fork) throws FHIRFormatError, DefinitionException { - if (main != null && !(main instanceof JsonPrimitive)) - logError(line(main), col(main), npath, IssueType.INVALID, "This property must be an simple value, not a "+main.getClass().getName(), IssueSeverity.ERROR); - else if (fork != null && !(fork instanceof JsonObject)) - logError(line(fork), col(fork), npath, IssueType.INVALID, "This property must be an object, not a "+fork.getClass().getName(), IssueSeverity.ERROR); - else { - Element n = new Element(name, property).markLocation(line(main != null ? main : fork), col(main != null ? main : fork)); - context.getChildren().add(n); - if (main != null) { - JsonPrimitive p = (JsonPrimitive) main; - n.setValue(p.getAsString()); - if (!n.getProperty().isChoice() && n.getType().equals("xhtml")) { - try { - n.setXhtml(new XhtmlParser().setValidatorMode(policy == ValidationPolicy.EVERYTHING).parse(n.getValue(), null).getDocumentElement()); - } catch (Exception e) { - logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing XHTML: "+e.getMessage(), IssueSeverity.ERROR); - } - } - if (policy == ValidationPolicy.EVERYTHING) { - // now we cross-check the primitive format against the stated type - if (Utilities.existsInList(n.getType(), "boolean")) { - if (!p.isBoolean()) - logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a boolean", IssueSeverity.ERROR); - } else if (Utilities.existsInList(n.getType(), "integer", "unsignedInt", "positiveInt", "decimal")) { - if (!p.isNumber()) - logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a number", IssueSeverity.ERROR); - } else if (!p.isString()) - logError(line(main), col(main), npath, IssueType.INVALID, "Error parsing JSON: the primitive value must be a string", IssueSeverity.ERROR); - } - } - if (fork != null) { - JsonObject child = (JsonObject) fork; - checkObject(child, npath); - parseChildren(npath, child, n, false); - } - } - } - - - private void parseResource(String npath, JsonObject res, Element parent) throws DefinitionException, FHIRFormatError { - JsonElement rt = res.get("resourceType"); - if (rt == null) { - logError(line(res), col(res), npath, IssueType.INVALID, "Unable to find resourceType property", IssueSeverity.FATAL); - } else { - String name = rt.getAsString(); - StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+name); - if (sd == null) - throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+name+"')"); - parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), parent.getProperty().getName().equals("contained") ? SpecialElement.CONTAINED : SpecialElement.BUNDLE_ENTRY); - parent.setType(name); - parseChildren(npath, res, parent, true); - } - } - - private void reapComments(JsonObject object, Element context) { - if (object.has("fhir_comments")) { - JsonArray arr = object.getAsJsonArray("fhir_comments"); - for (JsonElement e : arr) { - context.getComments().add(e.getAsString()); - } - } - } - - private int line(JsonElement e) { - if (map == null|| !map.containsKey(e)) - return -1; - else - return map.get(e).getLine(); - } - - private int col(JsonElement e) { - if (map == null|| !map.containsKey(e)) - return -1; - else - return map.get(e).getCol(); - } - - - protected void prop(String name, String value) throws IOException { - if (name != null) - json.name(name); - json.value(value); - } - - protected void open(String name) throws IOException { - if (name != null) - json.name(name); - json.beginObject(); - } - - protected void close() throws IOException { - json.endObject(); - } - - protected void openArray(String name) throws IOException { - if (name != null) - json.name(name); - json.beginArray(); - } - - protected void closeArray() throws IOException { - json.endArray(); - } - - - @Override - public void compose(Element e, OutputStream stream, OutputStyle style, String identity) throws Exception { - OutputStreamWriter osw = new OutputStreamWriter(stream, "UTF-8"); - if (style == OutputStyle.CANONICAL) - json = new JsonCreatorCanonical(osw); - else - json = new JsonCreatorGson(osw); - json.setIndent(style == OutputStyle.PRETTY ? " " : ""); - json.beginObject(); - prop("resourceType", e.getType()); - Set done = new HashSet(); - for (Element child : e.getChildren()) { - compose(e.getName(), e, done, child); - } - json.endObject(); - json.finish(); - osw.flush(); - } - - private void compose(String path, Element e, Set done, Element child) throws IOException { - if (child.getSpecial() == SpecialElement.BUNDLE_ENTRY || !child.getProperty().isList()) {// for specials, ignore the cardinality of the stated type - compose(path, child); - } else if (!done.contains(child.getName())) { - done.add(child.getName()); - List list = e.getChildrenByName(child.getName()); - composeList(path, list); - } - } - - private void composeList(String path, List list) throws IOException { - // there will be at least one element - String name = list.get(0).getName(); - boolean complex = true; - if (list.get(0).isPrimitive()) { - boolean prim = false; - complex = false; - for (Element item : list) { - if (item.hasValue()) - prim = true; - if (item.hasChildren()) - complex = true; - } - if (prim) { - openArray(name); - for (Element item : list) { - if (item.hasValue()) - primitiveValue(null, item); - else - json.nullValue(); - } - closeArray(); - } - name = "_"+name; - } - if (complex) { - openArray(name); - for (Element item : list) { - if (item.hasChildren()) { - open(null); - if (item.getProperty().isResource()) { - prop("resourceType", item.getType()); - } - Set done = new HashSet(); - for (Element child : item.getChildren()) { - compose(path+"."+name+"[]", item, done, child); - } - close(); - } else - json.nullValue(); - } - closeArray(); - } - } - - private void primitiveValue(String name, Element item) throws IOException { - if (name != null) - json.name(name); - String type = item.getType(); - if (Utilities.existsInList(type, "boolean")) - json.value(item.getValue().trim().equals("true") ? new Boolean(true) : new Boolean(false)); - else if (Utilities.existsInList(type, "integer", "unsignedInt", "positiveInt")) - json.value(new Integer(item.getValue())); - else if (Utilities.existsInList(type, "decimal")) - json.value(new BigDecimal(item.getValue())); - else - json.value(item.getValue()); - } - - private void compose(String path, Element element) throws IOException { - String name = element.getName(); - if (element.isPrimitive() || ParserBase.isPrimitive(element.getType())) { - if (element.hasValue()) - primitiveValue(name, element); - name = "_"+name; - } - if (element.hasChildren()) { - open(name); - if (element.getProperty().isResource()) { - prop("resourceType", element.getType()); - } - Set done = new HashSet(); - for (Element child : element.getChildren()) { - compose(path+"."+element.getName(), element, done, child); - } - close(); - } - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Manager.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Manager.java deleted file mode 100644 index bd6a5c036fb..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Manager.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.hl7.fhir.dstu2016may.metamodel; - -import java.io.InputStream; -import java.io.OutputStream; - -import org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; - -public class Manager { - - public enum FhirFormat { XML, JSON, JSONLD, TURTLE } - - public static Element parse(IWorkerContext context, InputStream source, FhirFormat inputFormat) throws Exception { - return makeParser(context, inputFormat).parse(source); - } - - public static void compose(IWorkerContext context, Element e, OutputStream destination, FhirFormat outputFormat, OutputStyle style, String base) throws Exception { - makeParser(context, outputFormat).compose(e, destination, style, base); - } - - public static ParserBase makeParser(IWorkerContext context, FhirFormat format) { - switch (format) { - case JSON : return new JsonParser(context); - case XML : return new XmlParser(context); - default: - throw new IllegalArgumentException("Unknown type: " + format); - } - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/ParserBase.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/ParserBase.java deleted file mode 100644 index 65d16b5579a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/ParserBase.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.hl7.fhir.dstu2016may.metamodel; - -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.dstu2016may.formats.FormatUtilities; -import org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle; -import org.hl7.fhir.dstu2016may.model.ElementDefinition; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent; -import org.hl7.fhir.dstu2016may.model.StructureDefinition; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; -import org.hl7.fhir.dstu2016may.utils.ProfileUtilities; -import org.hl7.fhir.dstu2016may.utils.ToolingExtensions; -import org.hl7.fhir.utilities.validation.ValidationMessage; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; -import org.hl7.fhir.utilities.validation.ValidationMessage.Source; -import org.hl7.fhir.exceptions.DefinitionException; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.utilities.Utilities; - -public abstract class ParserBase { - - protected IWorkerContext context; - protected ValidationPolicy policy; - protected List errors; - - public ParserBase(IWorkerContext context) { - super(); - this.context = context; - policy = ValidationPolicy.NONE; - } - - public abstract void compose(Element e, OutputStream destination, OutputStyle style, String base) throws Exception; - - protected List getChildProperties(Property property, String elementName, String statedType) throws DefinitionException { - ElementDefinition ed = property.getDefinition(); - StructureDefinition sd = property.getStructure(); - List children = ProfileUtilities.getChildMap(sd, ed); - if (children.isEmpty()) { - // ok, find the right definitions - String t = null; - if (ed.getType().size() == 1) - t = ed.getType().get(0).getCode(); - else if (ed.getType().size() == 0) - throw new Error("types == 0, and no children found"); - else { - t = ed.getType().get(0).getCode(); - boolean all = true; - for (TypeRefComponent tr : ed.getType()) { - if (!tr.getCode().equals(t)) { - all = false; - break; - } - } - if (!all) { - // ok, it's polymorphic - if (ed.hasRepresentation(PropertyRepresentation.TYPEATTR)) { - t = statedType; - if (t == null && ToolingExtensions.hasExtension(ed, "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaultype")) - t = ToolingExtensions.readStringExtension(ed, "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaultype"); - boolean ok = false; - for (TypeRefComponent tr : ed.getType()) - if (tr.getCode().equals(t)) - ok = true; - if (!ok) - throw new DefinitionException("Type '"+t+"' is not an acceptable type for '"+elementName+"' on property "+property.getDefinition().getPath()); - - } else { - t = elementName.substring(tail(ed.getPath()).length() - 3); - if (isPrimitive(lowFirst(t))) - t = lowFirst(t); - } - } - } - if (!"xhtml".equals(t)) { - sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+t); - if (sd == null) - throw new DefinitionException("Unable to find class '"+t+"' for name '"+elementName+"' on property "+property.getDefinition().getPath()); - children = ProfileUtilities.getChildMap(sd, sd.getSnapshot().getElement().get(0)); - } - } - List properties = new ArrayList(); - for (ElementDefinition child : children) { - properties.add(new Property(context, child, sd)); - } - return properties; - } - - protected StructureDefinition getDefinition(int line, int col, String name) throws FHIRFormatError { - if (name == null) { - logError(line, col, name, IssueType.STRUCTURE, "This cannot be parsed as a FHIR object (no name)", IssueSeverity.FATAL); - return null; - } - for (StructureDefinition sd : context.allStructures()) { - if (name.equals(sd.getIdElement().getIdPart())) { - return sd; - } - } - logError(line, col, name, IssueType.STRUCTURE, "This does not appear to be a FHIR resource (unknown name '"+name+"')", IssueSeverity.FATAL); - return null; - } - - protected StructureDefinition getDefinition(int line, int col, String ns, String name) throws FHIRFormatError { - if (ns == null) { - logError(line, col, name, IssueType.STRUCTURE, "This cannot be parsed as a FHIR object (no namespace)", IssueSeverity.FATAL); - return null; - } - if (name == null) { - logError(line, col, name, IssueType.STRUCTURE, "This cannot be parsed as a FHIR object (no name)", IssueSeverity.FATAL); - return null; - } - for (StructureDefinition sd : context.allStructures()) { - if (name.equals(sd.getIdElement().getIdPart())) { - if((ns == null || ns.equals(FormatUtilities.FHIR_NS)) && !ToolingExtensions.hasExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) - return sd; - String sns = ToolingExtensions.readStringExtension(sd, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); - if (ns != null && ns.equals(sns)) - return sd; - } - } - logError(line, col, name, IssueType.STRUCTURE, "This does not appear to be a FHIR resource (unknown namespace/name '"+ns+"::"+name+"')", IssueSeverity.FATAL); - return null; - } - - public void logError(int line, int col, String path, IssueType type, String message, IssueSeverity level) throws FHIRFormatError { - if (policy == ValidationPolicy.EVERYTHING) { - ValidationMessage msg = new ValidationMessage(Source.InstanceValidator, type, line, col, path, message, level); - errors.add(msg); - } else if (level == IssueSeverity.FATAL || (level == IssueSeverity.ERROR && policy == ValidationPolicy.QUICK)) - throw new FHIRFormatError(message+String.format(" at line %d col %d", line, col)); - } - - private String lowFirst(String t) { - return t.substring(0, 1).toLowerCase()+t.substring(1); - } - - public abstract Element parse(InputStream stream) throws Exception; - - public void setupValidation(ValidationPolicy policy, List errors) { - this.policy = policy; - this.errors = errors; - } - - private String tail(String path) { - return path.contains(".") ? path.substring(path.lastIndexOf(".")+1) : path; - } - - public static boolean isPrimitive(String code) { - return Utilities.existsInList(code, - "xhtml", "boolean", "integer", "string", "decimal", "uri", "base64Binary", "instant", "date", "dateTime", - "time", "code", "oid", "id", "markdown", "unsignedInt", "positiveInt", "xhtml", "base64Binary"); - } - - interface IErrorNotifier { - - } - - public enum ValidationPolicy { NONE, QUICK, EVERYTHING } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Property.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Property.java deleted file mode 100644 index e71ec09af22..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/Property.java +++ /dev/null @@ -1,157 +0,0 @@ -package org.hl7.fhir.dstu2016may.metamodel; - -import org.hl7.fhir.dstu2016may.formats.FormatUtilities; -import org.hl7.fhir.dstu2016may.model.ElementDefinition; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent; -import org.hl7.fhir.dstu2016may.model.StructureDefinition; -import org.hl7.fhir.dstu2016may.model.StructureDefinition.StructureDefinitionKind; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; -import org.hl7.fhir.dstu2016may.utils.ToolingExtensions; - -public class Property { - - private IWorkerContext context; - private ElementDefinition definition; - private StructureDefinition structure; - private Boolean canBePrimitive; - - public Property(IWorkerContext context, ElementDefinition definition, StructureDefinition structure) { - this.context = context; - this.definition = definition; - this.structure = structure; - } - - public String getName() { - return definition.getPath().substring(definition.getPath().lastIndexOf(".")+1); - } - - public ElementDefinition getDefinition() { - return definition; - } - - public String getType() { - if (definition.getType().size() == 0) - return null; - else if (definition.getType().size() > 1) { - String tn = definition.getType().get(0).getCode(); - for (int i = 1; i < definition.getType().size(); i++) { - if (!tn.equals(definition.getType().get(i).getCode())) - throw new Error("logic error, gettype when types > 1"); - } - return tn; - } else - return definition.getType().get(0).getCode(); - } - - public String getType(String elementName) { - if (definition.getType().size() == 0) - return null; - else if (definition.getType().size() > 1) { - String t = definition.getType().get(0).getCode(); - boolean all = true; - for (TypeRefComponent tr : definition.getType()) { - if (!t.equals(tr.getCode())) - all = false; - } - if (all) - return t; - String tail = definition.getPath().substring(definition.getPath().lastIndexOf(".")+1); - if (tail.endsWith("[x]") && elementName != null && elementName.startsWith(tail.substring(0, tail.length()-3))) { - String name = elementName.substring(tail.length()-3); - return ParserBase.isPrimitive(lowFirst(name)) ? lowFirst(name) : name; - } else - throw new Error("logic error, gettype when types > 1, name mismatch for "+elementName+" on at "+definition.getPath()); - } else if (definition.getType().get(0).getCode() == null) { - return structure.getId(); - } else - return definition.getType().get(0).getCode(); - } - - public boolean hasType(String elementName) { - if (definition.getType().size() == 0) - return false; - else if (definition.getType().size() > 1) { - String t = definition.getType().get(0).getCode(); - boolean all = true; - for (TypeRefComponent tr : definition.getType()) { - if (!t.equals(tr.getCode())) - all = false; - } - if (all) - return true; - String tail = definition.getPath().substring(definition.getPath().lastIndexOf(".")+1); - if (tail.endsWith("[x]") && elementName.startsWith(tail.substring(0, tail.length()-3))) { - String name = elementName.substring(tail.length()-3); - return true; - } else - return false; - } else - return true; - } - - public StructureDefinition getStructure() { - return structure; - } - - public boolean isPrimitive(String name) { - return ParserBase.isPrimitive(getType(name)); - } - - private String lowFirst(String t) { - return t.substring(0, 1).toLowerCase()+t.substring(1); - } - - public boolean isResource() { - return definition.getType().size() == 1 && ("Resource".equals(definition.getType().get(0).getCode()) || "DomainResource".equals(definition.getType().get(0).getCode())); - } - - public boolean isList() { - return !definition.getMax().equals("1"); - } - - public String getScopedPropertyName() { - return definition.getBase().getPath(); - } - - public String getNamespace() { - if (ToolingExtensions.hasExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) - return ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); - if (ToolingExtensions.hasExtension(structure, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) - return ToolingExtensions.readStringExtension(structure, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); - return FormatUtilities.FHIR_NS; - } - - public boolean IsLogicalAndHasPrimitiveValue(String name) { - if (canBePrimitive!= null) - return canBePrimitive; - - canBePrimitive = false; - if (structure.getKind() != StructureDefinitionKind.LOGICAL) - return false; - if (!hasType(name)) - return false; - StructureDefinition sd = context.fetchResource(StructureDefinition.class, structure.getUrl().substring(0, structure.getUrl().lastIndexOf("/")+1)+getType(name)); - if (sd == null || sd.getKind() != StructureDefinitionKind.LOGICAL) - return false; - for (ElementDefinition ed : sd.getSnapshot().getElement()) { - if (ed.getPath().equals(sd.getId()+".value") && ed.getType().size() == 1 && ParserBase.isPrimitive(ed.getType().get(0).getCode())) { - canBePrimitive = true; - return true; - } - } - return false; - } - - public boolean isChoice() { - if (definition.getType().size() <= 1) - return false; - String tn = definition.getType().get(0).getCode(); - for (int i = 1; i < definition.getType().size(); i++) - if (!definition.getType().get(i).getCode().equals(tn)) - return true; - return false; - } - - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/XmlParser.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/XmlParser.java deleted file mode 100644 index 5e0bed7e194..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/metamodel/XmlParser.java +++ /dev/null @@ -1,412 +0,0 @@ -package org.hl7.fhir.dstu2016may.metamodel; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.List; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; -import javax.xml.transform.Transformer; -import javax.xml.transform.TransformerFactory; -import javax.xml.transform.dom.DOMResult; -import javax.xml.transform.sax.SAXSource; - -import org.hl7.fhir.dstu2016may.formats.FormatUtilities; -import org.hl7.fhir.dstu2016may.formats.IParser.OutputStyle; -import org.hl7.fhir.dstu2016may.metamodel.Element.SpecialElement; -import org.hl7.fhir.dstu2016may.model.DateTimeType; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation; -import org.hl7.fhir.dstu2016may.model.Enumeration; -import org.hl7.fhir.dstu2016may.model.StructureDefinition; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; -import org.hl7.fhir.dstu2016may.utils.ToolingExtensions; -import org.hl7.fhir.dstu2016may.utils.XmlLocationAnnotator; -import org.hl7.fhir.dstu2016may.utils.XmlLocationData; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; -import org.hl7.fhir.utilities.xhtml.XhtmlComposer; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; -import org.hl7.fhir.utilities.xhtml.XhtmlParser; -import org.hl7.fhir.utilities.xml.XMLUtil; -import org.hl7.fhir.utilities.xml.XMLWriter; -import org.w3c.dom.Document; -import org.w3c.dom.Node; -import org.xml.sax.InputSource; -import org.xml.sax.XMLReader; - -public class XmlParser extends ParserBase { - public XmlParser(IWorkerContext context) { - super(context); - } - - public Element parse(InputStream stream) throws Exception { - Document doc = null; - try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - // xxe protection - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - factory.setFeature("http://xml.org/sax/features/external-general-entities", false); - factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); - factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); - factory.setXIncludeAware(false); - factory.setExpandEntityReferences(false); - - factory.setNamespaceAware(true); - if (policy == ValidationPolicy.EVERYTHING) { - // use a slower parser that keeps location data - TransformerFactory transformerFactory = TransformerFactory.newInstance(); - Transformer nullTransformer = transformerFactory.newTransformer(); - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - doc = docBuilder.newDocument(); - DOMResult domResult = new DOMResult(doc); - SAXParserFactory spf = SAXParserFactory.newInstance(); - spf.setNamespaceAware(true); - spf.setValidating(false); - SAXParser saxParser = spf.newSAXParser(); - XMLReader xmlReader = saxParser.getXMLReader(); - // xxe protection - spf.setFeature("http://xml.org/sax/features/external-general-entities", false); - spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - xmlReader.setFeature("http://xml.org/sax/features/external-general-entities", false); - xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - - XmlLocationAnnotator locationAnnotator = new XmlLocationAnnotator(xmlReader, doc); - InputSource inputSource = new InputSource(stream); - SAXSource saxSource = new SAXSource(locationAnnotator, inputSource); - nullTransformer.transform(saxSource, domResult); - } else { - DocumentBuilder builder = factory.newDocumentBuilder(); - doc = builder.parse(stream); - } - } catch (Exception e) { - logError(0, 0, "(syntax)", IssueType.INVALID, e.getMessage(), IssueSeverity.FATAL); - doc = null; - } - if (doc == null) - return null; - else - return parse(doc); - } - - private void checkForProcessingInstruction(Document document) throws FHIRFormatError { - if (policy == ValidationPolicy.EVERYTHING) { - Node node = document.getFirstChild(); - while (node != null) { - if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) - logError(line(document), col(document), "(document)", IssueType.INVALID, "No processing instructions allowed in resources", IssueSeverity.ERROR); - node = node.getNextSibling(); - } - } - } - - - private int line(Node node) { - XmlLocationData loc = (XmlLocationData) node.getUserData(XmlLocationData.LOCATION_DATA_KEY); - return loc == null ? 0 : loc.getStartLine(); - } - - private int col(Node node) { - XmlLocationData loc = (XmlLocationData) node.getUserData(XmlLocationData.LOCATION_DATA_KEY); - return loc == null ? 0 : loc.getStartColumn(); - } - - public Element parse(Document doc) throws Exception { - checkForProcessingInstruction(doc); - org.w3c.dom.Element element = doc.getDocumentElement(); - return parse(element); - } - - public Element parse(org.w3c.dom.Element element) throws Exception { - String ns = element.getNamespaceURI(); - String name = element.getLocalName(); - String path = "/"+pathPrefix(ns)+name; - - StructureDefinition sd = getDefinition(line(element), col(element), ns, name); - if (sd == null) - return null; - - Element result = new Element(element.getLocalName(), new Property(context, sd.getSnapshot().getElement().get(0), sd)); - checkElement(element, path, result.getProperty()); - result.markLocation(line(element), col(element)); - result.setType(element.getLocalName()); - parseChildren(path, element, result); - result.numberChildren(); - return result; - } - - private String pathPrefix(String ns) { - if (Utilities.noString(ns)) - return ""; - if (ns.equals(FormatUtilities.FHIR_NS)) - return "f:"; - if (ns.equals(FormatUtilities.XHTML_NS)) - return "h:"; - if (ns.equals("urn:hl7-org:v3")) - return "v3:"; - return "?:"; - } - - private boolean empty(org.w3c.dom.Element element) { - for (int i = 0; i < element.getAttributes().getLength(); i++) { - String n = element.getAttributes().item(i).getNodeName(); - if (!n.equals("xmlns") && !n.startsWith("xmlns:")) - return false; - } - if (!Utilities.noString(element.getTextContent().trim())) - return false; - - Node n = element.getFirstChild(); - while (n != null) { - if (n.getNodeType() == Node.ELEMENT_NODE) - return false; - n = n.getNextSibling(); - } - return true; - } - - private void checkElement(org.w3c.dom.Element element, String path, Property prop) throws FHIRFormatError { - if (policy == ValidationPolicy.EVERYTHING) { - if (empty(element)) - logError(line(element), col(element), path, IssueType.INVALID, "Element must have some content", IssueSeverity.ERROR); - String ns = FormatUtilities.FHIR_NS; - if (ToolingExtensions.hasExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) - ns = ToolingExtensions.readStringExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); - else if (ToolingExtensions.hasExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) - ns = ToolingExtensions.readStringExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"); - if (!element.getNamespaceURI().equals(ns)) - logError(line(element), col(element), path, IssueType.INVALID, "Wrong namespace - expected '"+ns+"'", IssueSeverity.ERROR); - } - } - - public Element parse(org.w3c.dom.Element base, String type) throws Exception { - StructureDefinition sd = getDefinition(0, 0, FormatUtilities.FHIR_NS, type); - Element result = new Element(base.getLocalName(), new Property(context, sd.getSnapshot().getElement().get(0), sd)); - String path = "/"+pathPrefix(base.getNamespaceURI())+base.getLocalName(); - checkElement(base, path, result.getProperty()); - result.setType(base.getLocalName()); - parseChildren(path, base, result); - result.numberChildren(); - return result; - } - - private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws Exception { - // this parsing routine retains the original order in a the XML file, to support validation - reapComments(node, context); - List properties = getChildProperties(context.getProperty(), context.getName(), XMLUtil.getXsiType(node)); - - String text = XMLUtil.getDirectText(node).trim(); - if (!Utilities.noString(text)) { - Property property = getTextProp(properties); - if (property != null) { - context.getChildren().add(new Element(property.getName(), property, property.getType(), text).markLocation(line(node), col(node))); - } else { - logError(line(node), col(node), path, IssueType.STRUCTURE, "Text should not be present", IssueSeverity.ERROR); - } - } - - for (int i = 0; i < node.getAttributes().getLength(); i++) { - Node attr = node.getAttributes().item(i); - if (!(attr.getNodeName().equals("xmlns") || attr.getNodeName().startsWith("xmlns:"))) { - Property property = getAttrProp(properties, attr.getNodeName()); - if (property != null) { - String av = attr.getNodeValue(); - if (ToolingExtensions.hasExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat")) - av = convertForDateFormat(ToolingExtensions.readStringExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"), av); - if (property.getName().equals("value") && context.isPrimitive()) - context.setValue(av); - else - context.getChildren().add(new Element(property.getName(), property, property.getType(), av).markLocation(line(node), col(node))); - } else { - logError(line(node), col(node), path, IssueType.STRUCTURE, "Undefined attribute '@"+attr.getNodeName()+"'", IssueSeverity.ERROR); - } - } - } - - Node child = node.getFirstChild(); - while (child != null) { - if (child.getNodeType() == Node.ELEMENT_NODE) { - Property property = getElementProp(properties, child.getLocalName()); - if (property != null) { - if (!property.isChoice() && "xhtml".equals(property.getType())) { - XhtmlNode xhtml = new XhtmlParser().setValidatorMode(true).parseHtmlNode((org.w3c.dom.Element) child); - context.getChildren().add(new Element("div", property, "xhtml", new XhtmlComposer(true, false).compose(xhtml)).setXhtml(xhtml).markLocation(line(child), col(child))); - } else { - String npath = path+"/"+pathPrefix(child.getNamespaceURI())+child.getLocalName(); - Element n = new Element(child.getLocalName(), property).markLocation(line(child), col(child)); - checkElement((org.w3c.dom.Element) child, npath, n.getProperty()); - boolean ok = true; - if (property.isChoice()) { - if (property.getDefinition().hasRepresentation(PropertyRepresentation.TYPEATTR)) { - String xsiType = ((org.w3c.dom.Element) child).getAttributeNS(FormatUtilities.NS_XSI, "type"); - if (xsiType == null) { - logError(line(child), col(child), path, IssueType.STRUCTURE, "No type found on '"+child.getLocalName()+'"', IssueSeverity.ERROR); - ok = false; - } else { - if (xsiType.contains(":")) - xsiType = xsiType.substring(xsiType.indexOf(":")+1); - n.setType(xsiType); - } - } else - n.setType(n.getType()); - } - context.getChildren().add(n); - if (ok) { - if (property.isResource()) - parseResource(npath, (org.w3c.dom.Element) child, n); - else - parseChildren(npath, (org.w3c.dom.Element) child, n); - } - } - } else - logError(line(child), col(child), path, IssueType.STRUCTURE, "Undefined element '"+child.getLocalName()+"'", IssueSeverity.ERROR); - } else if (child.getNodeType() == Node.CDATA_SECTION_NODE){ - logError(line(child), col(child), path, IssueType.STRUCTURE, "CDATA is not allowed", IssueSeverity.ERROR); - } else if (!Utilities.existsInList(child.getNodeType(), 3, 8)) { - logError(line(child), col(child), path, IssueType.STRUCTURE, "Node type "+Integer.toString(child.getNodeType())+" is not allowed", IssueSeverity.ERROR); - } - child = child.getNextSibling(); - } - } - - private Property getElementProp(List properties, String nodeName) { - for (Property p : properties) - if (!p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR) && !p.getDefinition().hasRepresentation(PropertyRepresentation.XMLTEXT)) { - if (p.getName().equals(nodeName)) - return p; - if (p.getName().endsWith("[x]") && nodeName.length() > p.getName().length()-3 && p.getName().substring(0, p.getName().length()-3).equals(nodeName.substring(0, p.getName().length()-3))) - return p; - } - return null; - } - - private Property getAttrProp(List properties, String nodeName) { - for (Property p : properties) - if (p.getName().equals(nodeName) && p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR)) - return p; - return null; - } - - private Property getTextProp(List properties) { - for (Property p : properties) - if (p.getDefinition().hasRepresentation(PropertyRepresentation.XMLTEXT)) - return p; - return null; - } - - private String convertForDateFormat(String fmt, String av) throws FHIRException { - if ("v3".equals(fmt)) { - DateTimeType d = DateTimeType.parseV3(av); - return d.asStringValue(); - } else - throw new FHIRException("Unknown Data format '"+fmt+"'"); - } - - private void parseResource(String string, org.w3c.dom.Element container, Element parent) throws Exception { - org.w3c.dom.Element res = XMLUtil.getFirstChild(container); - String name = res.getLocalName(); - StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+name); - if (sd == null) - throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+res.getLocalName()+"')"); - parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), parent.getProperty().getName().equals("contained") ? SpecialElement.CONTAINED : SpecialElement.BUNDLE_ENTRY); - parent.setType(name); - parseChildren(res.getLocalName(), res, parent); - } - - private void reapComments(org.w3c.dom.Element element, Element context) { - Node node = element.getPreviousSibling(); - while (node != null && node.getNodeType() != Node.ELEMENT_NODE) { - if (node.getNodeType() == Node.COMMENT_NODE) - context.getComments().add(0, node.getTextContent()); - node = node.getPreviousSibling(); - } - node = element.getLastChild(); - while (node != null && node.getNodeType() != Node.ELEMENT_NODE) { - node = node.getPreviousSibling(); - } - while (node != null) { - if (node.getNodeType() == Node.COMMENT_NODE) - context.getComments().add(node.getTextContent()); - node = node.getNextSibling(); - } - } - - private boolean isAttr(Property property) { - for (Enumeration r : property.getDefinition().getRepresentation()) { - if (r.getValue() == PropertyRepresentation.XMLATTR) { - return true; - } - } - return false; - } - - private boolean isText(Property property) { - for (Enumeration r : property.getDefinition().getRepresentation()) { - if (r.getValue() == PropertyRepresentation.XMLTEXT) { - return true; - } - } - return false; - } - - @Override - public void compose(Element e, OutputStream stream, OutputStyle style, String base) throws Exception { - XMLWriter xml = new XMLWriter(stream, "UTF-8"); - xml.setPretty(style == OutputStyle.PRETTY); - xml.start(); - xml.setDefaultNamespace(e.getProperty().getNamespace()); - composeElement(xml, e, e.getType()); - xml.end(); - - } - - private void composeElement(XMLWriter xml, Element element, String elementName) throws IOException { - for (String s : element.getComments()) { - xml.comment(s, true); - } - if (isText(element.getProperty())) { - xml.enter(elementName); - xml.text(element.getValue()); - xml.exit(elementName); - } else if (element.isPrimitive() || (element.hasType() && ParserBase.isPrimitive(element.getType()))) { - if (element.getType().equals("xhtml")) { - xml.escapedText(element.getValue()); - } else if (isText(element.getProperty())) { - xml.text(element.getValue()); - } else { - if (element.hasValue()) - xml.attribute("value", element.getValue()); - if (element.hasChildren()) { - xml.enter(elementName); - for (Element child : element.getChildren()) - composeElement(xml, child, child.getName()); - xml.exit(elementName); - } else - xml.element(elementName); - } - } else { - for (Element child : element.getChildren()) { - if (isAttr(child.getProperty())) - xml.attribute(child.getName(), child.getValue()); - } - xml.enter(elementName); - if (element.getSpecial() != null) - xml.enter(element.getType()); - for (Element child : element.getChildren()) { - if (isText(child.getProperty())) - xml.text(child.getValue()); - else if (!isAttr(child.getProperty())) - composeElement(xml, child, child.getName()); - } - if (element.getSpecial() != null) - xml.exit(element.getType()); - xml.exit(elementName); - } - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Account.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Account.java deleted file mode 100644 index 89c176048ff..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Account.java +++ /dev/null @@ -1,1058 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. - */ -@ResourceDef(name="Account", profile="http://hl7.org/fhir/Profile/Account") -public class Account extends DomainResource { - - public enum AccountStatus { - /** - * This account is active and may be used. - */ - ACTIVE, - /** - * This account is inactive and should not be used to track financial information. - */ - INACTIVE, - /** - * added to help the parsers - */ - NULL; - public static AccountStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("inactive".equals(codeString)) - return INACTIVE; - throw new FHIRException("Unknown AccountStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return "http://hl7.org/fhir/account-status"; - case INACTIVE: return "http://hl7.org/fhir/account-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "This account is active and may be used."; - case INACTIVE: return "This account is inactive and should not be used to track financial information."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case INACTIVE: return "Inactive"; - default: return "?"; - } - } - } - - public static class AccountStatusEnumFactory implements EnumFactory { - public AccountStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return AccountStatus.ACTIVE; - if ("inactive".equals(codeString)) - return AccountStatus.INACTIVE; - throw new IllegalArgumentException("Unknown AccountStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return new Enumeration(this, AccountStatus.ACTIVE); - if ("inactive".equals(codeString)) - return new Enumeration(this, AccountStatus.INACTIVE); - throw new FHIRException("Unknown AccountStatus code '"+codeString+"'"); - } - public String toCode(AccountStatus code) { - if (code == AccountStatus.ACTIVE) - return "active"; - if (code == AccountStatus.INACTIVE) - return "inactive"; - return "?"; - } - public String toSystem(AccountStatus code) { - return code.getSystem(); - } - } - - /** - * Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Account number", formalDefinition="Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number)." ) - protected List identifier; - - /** - * Name used for the account when displaying it to humans in reports, etc. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human-readable label", formalDefinition="Name used for the account when displaying it to humans in reports, etc." ) - protected StringType name; - - /** - * Categorizes the account for reporting and searching purposes. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="E.g. patient, expense, depreciation", formalDefinition="Categorizes the account for reporting and searching purposes." ) - protected CodeableConcept type; - - /** - * Indicates whether the account is presently used/useable or not. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | inactive", formalDefinition="Indicates whether the account is presently used/useable or not." ) - protected Enumeration status; - - /** - * Indicates the period of time over which the account is allowed. - */ - @Child(name = "activePeriod", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Valid from..to", formalDefinition="Indicates the period of time over which the account is allowed." ) - protected Period activePeriod; - - /** - * Identifies the currency to which transactions must be converted when crediting or debiting the account. - */ - @Child(name = "currency", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Base currency in which balance is tracked", formalDefinition="Identifies the currency to which transactions must be converted when crediting or debiting the account." ) - protected Coding currency; - - /** - * Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative. - */ - @Child(name = "balance", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How much is in account?", formalDefinition="Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative." ) - protected Money balance; - - /** - * Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc. - */ - @Child(name = "coveragePeriod", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Transaction window", formalDefinition="Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc." ) - protected Period coveragePeriod; - - /** - * Identifies the patient, device, practitioner, location or other object the account is associated with. - */ - @Child(name = "subject", type = {Patient.class, Device.class, Practitioner.class, Location.class, HealthcareService.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="What is account tied to?", formalDefinition="Identifies the patient, device, practitioner, location or other object the account is associated with." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient, device, practitioner, location or other object the account is associated with.) - */ - protected Resource subjectTarget; - - /** - * Indicates the organization, department, etc. with responsibility for the account. - */ - @Child(name = "owner", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who is responsible?", formalDefinition="Indicates the organization, department, etc. with responsibility for the account." ) - protected Reference owner; - - /** - * The actual object that is the target of the reference (Indicates the organization, department, etc. with responsibility for the account.) - */ - protected Organization ownerTarget; - - /** - * Provides additional information about what the account tracks and how it is used. - */ - @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Explanation of purpose/use", formalDefinition="Provides additional information about what the account tracks and how it is used." ) - protected StringType description; - - private static final long serialVersionUID = -1926153194L; - - /** - * Constructor - */ - public Account() { - super(); - } - - /** - * @return {@link #identifier} (Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Account addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (Name used for the account when displaying it to humans in reports, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name used for the account when displaying it to humans in reports, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Account setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name used for the account when displaying it to humans in reports, etc. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name used for the account when displaying it to humans in reports, etc. - */ - public Account setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Categorizes the account for reporting and searching purposes.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Categorizes the account for reporting and searching purposes.) - */ - public Account setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #status} (Indicates whether the account is presently used/useable or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new AccountStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the account is presently used/useable or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Account setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the account is presently used/useable or not. - */ - public AccountStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the account is presently used/useable or not. - */ - public Account setStatus(AccountStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new AccountStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #activePeriod} (Indicates the period of time over which the account is allowed.) - */ - public Period getActivePeriod() { - if (this.activePeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.activePeriod"); - else if (Configuration.doAutoCreate()) - this.activePeriod = new Period(); // cc - return this.activePeriod; - } - - public boolean hasActivePeriod() { - return this.activePeriod != null && !this.activePeriod.isEmpty(); - } - - /** - * @param value {@link #activePeriod} (Indicates the period of time over which the account is allowed.) - */ - public Account setActivePeriod(Period value) { - this.activePeriod = value; - return this; - } - - /** - * @return {@link #currency} (Identifies the currency to which transactions must be converted when crediting or debiting the account.) - */ - public Coding getCurrency() { - if (this.currency == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.currency"); - else if (Configuration.doAutoCreate()) - this.currency = new Coding(); // cc - return this.currency; - } - - public boolean hasCurrency() { - return this.currency != null && !this.currency.isEmpty(); - } - - /** - * @param value {@link #currency} (Identifies the currency to which transactions must be converted when crediting or debiting the account.) - */ - public Account setCurrency(Coding value) { - this.currency = value; - return this; - } - - /** - * @return {@link #balance} (Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative.) - */ - public Money getBalance() { - if (this.balance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.balance"); - else if (Configuration.doAutoCreate()) - this.balance = new Money(); // cc - return this.balance; - } - - public boolean hasBalance() { - return this.balance != null && !this.balance.isEmpty(); - } - - /** - * @param value {@link #balance} (Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative.) - */ - public Account setBalance(Money value) { - this.balance = value; - return this; - } - - /** - * @return {@link #coveragePeriod} (Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.) - */ - public Period getCoveragePeriod() { - if (this.coveragePeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.coveragePeriod"); - else if (Configuration.doAutoCreate()) - this.coveragePeriod = new Period(); // cc - return this.coveragePeriod; - } - - public boolean hasCoveragePeriod() { - return this.coveragePeriod != null && !this.coveragePeriod.isEmpty(); - } - - /** - * @param value {@link #coveragePeriod} (Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.) - */ - public Account setCoveragePeriod(Period value) { - this.coveragePeriod = value; - return this; - } - - /** - * @return {@link #subject} (Identifies the patient, device, practitioner, location or other object the account is associated with.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Identifies the patient, device, practitioner, location or other object the account is associated with.) - */ - public Account setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient, device, practitioner, location or other object the account is associated with.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient, device, practitioner, location or other object the account is associated with.) - */ - public Account setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #owner} (Indicates the organization, department, etc. with responsibility for the account.) - */ - public Reference getOwner() { - if (this.owner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.owner"); - else if (Configuration.doAutoCreate()) - this.owner = new Reference(); // cc - return this.owner; - } - - public boolean hasOwner() { - return this.owner != null && !this.owner.isEmpty(); - } - - /** - * @param value {@link #owner} (Indicates the organization, department, etc. with responsibility for the account.) - */ - public Account setOwner(Reference value) { - this.owner = value; - return this; - } - - /** - * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the organization, department, etc. with responsibility for the account.) - */ - public Organization getOwnerTarget() { - if (this.ownerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.owner"); - else if (Configuration.doAutoCreate()) - this.ownerTarget = new Organization(); // aa - return this.ownerTarget; - } - - /** - * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the organization, department, etc. with responsibility for the account.) - */ - public Account setOwnerTarget(Organization value) { - this.ownerTarget = value; - return this; - } - - /** - * @return {@link #description} (Provides additional information about what the account tracks and how it is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Account.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Provides additional information about what the account tracks and how it is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Account setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Provides additional information about what the account tracks and how it is used. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Provides additional information about what the account tracks and how it is used. - */ - public Account setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier used to reference the account. May or may not be intended for human use (e.g. credit card number).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "Name used for the account when displaying it to humans in reports, etc.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("type", "CodeableConcept", "Categorizes the account for reporting and searching purposes.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("status", "code", "Indicates whether the account is presently used/useable or not.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("activePeriod", "Period", "Indicates the period of time over which the account is allowed.", 0, java.lang.Integer.MAX_VALUE, activePeriod)); - childrenList.add(new Property("currency", "Coding", "Identifies the currency to which transactions must be converted when crediting or debiting the account.", 0, java.lang.Integer.MAX_VALUE, currency)); - childrenList.add(new Property("balance", "Money", "Represents the sum of all credits less all debits associated with the account. Might be positive, zero or negative.", 0, java.lang.Integer.MAX_VALUE, balance)); - childrenList.add(new Property("coveragePeriod", "Period", "Identifies the period of time the account applies to; e.g. accounts created per fiscal year, quarter, etc.", 0, java.lang.Integer.MAX_VALUE, coveragePeriod)); - childrenList.add(new Property("subject", "Reference(Patient|Device|Practitioner|Location|HealthcareService|Organization)", "Identifies the patient, device, practitioner, location or other object the account is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("owner", "Reference(Organization)", "Indicates the organization, department, etc. with responsibility for the account.", 0, java.lang.Integer.MAX_VALUE, owner)); - childrenList.add(new Property("description", "string", "Provides additional information about what the account tracks and how it is used.", 0, java.lang.Integer.MAX_VALUE, description)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1325532263: /*activePeriod*/ return this.activePeriod == null ? new Base[0] : new Base[] {this.activePeriod}; // Period - case 575402001: /*currency*/ return this.currency == null ? new Base[0] : new Base[] {this.currency}; // Coding - case -339185956: /*balance*/ return this.balance == null ? new Base[0] : new Base[] {this.balance}; // Money - case 1024117193: /*coveragePeriod*/ return this.coveragePeriod == null ? new Base[0] : new Base[] {this.coveragePeriod}; // Period - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -892481550: // status - this.status = new AccountStatusEnumFactory().fromType(value); // Enumeration - break; - case 1325532263: // activePeriod - this.activePeriod = castToPeriod(value); // Period - break; - case 575402001: // currency - this.currency = castToCoding(value); // Coding - break; - case -339185956: // balance - this.balance = castToMoney(value); // Money - break; - case 1024117193: // coveragePeriod - this.coveragePeriod = castToPeriod(value); // Period - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 106164915: // owner - this.owner = castToReference(value); // Reference - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("status")) - this.status = new AccountStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("activePeriod")) - this.activePeriod = castToPeriod(value); // Period - else if (name.equals("currency")) - this.currency = castToCoding(value); // Coding - else if (name.equals("balance")) - this.balance = castToMoney(value); // Money - else if (name.equals("coveragePeriod")) - this.coveragePeriod = castToPeriod(value); // Period - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("owner")) - this.owner = castToReference(value); // Reference - else if (name.equals("description")) - this.description = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 3575610: return getType(); // CodeableConcept - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1325532263: return getActivePeriod(); // Period - case 575402001: return getCurrency(); // Coding - case -339185956: return getBalance(); // Money - case 1024117193: return getCoveragePeriod(); // Period - case -1867885268: return getSubject(); // Reference - case 106164915: return getOwner(); // Reference - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Account.name"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Account.status"); - } - else if (name.equals("activePeriod")) { - this.activePeriod = new Period(); - return this.activePeriod; - } - else if (name.equals("currency")) { - this.currency = new Coding(); - return this.currency; - } - else if (name.equals("balance")) { - this.balance = new Money(); - return this.balance; - } - else if (name.equals("coveragePeriod")) { - this.coveragePeriod = new Period(); - return this.coveragePeriod; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("owner")) { - this.owner = new Reference(); - return this.owner; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Account.description"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Account"; - - } - - public Account copy() { - Account dst = new Account(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.type = type == null ? null : type.copy(); - dst.status = status == null ? null : status.copy(); - dst.activePeriod = activePeriod == null ? null : activePeriod.copy(); - dst.currency = currency == null ? null : currency.copy(); - dst.balance = balance == null ? null : balance.copy(); - dst.coveragePeriod = coveragePeriod == null ? null : coveragePeriod.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.owner = owner == null ? null : owner.copy(); - dst.description = description == null ? null : description.copy(); - return dst; - } - - protected Account typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Account)) - return false; - Account o = (Account) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(type, o.type, true) - && compareDeep(status, o.status, true) && compareDeep(activePeriod, o.activePeriod, true) && compareDeep(currency, o.currency, true) - && compareDeep(balance, o.balance, true) && compareDeep(coveragePeriod, o.coveragePeriod, true) - && compareDeep(subject, o.subject, true) && compareDeep(owner, o.owner, true) && compareDeep(description, o.description, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Account)) - return false; - Account o = (Account) other; - return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (type == null || type.isEmpty()) && (status == null || status.isEmpty()) && (activePeriod == null || activePeriod.isEmpty()) - && (currency == null || currency.isEmpty()) && (balance == null || balance.isEmpty()) && (coveragePeriod == null || coveragePeriod.isEmpty()) - && (subject == null || subject.isEmpty()) && (owner == null || owner.isEmpty()) && (description == null || description.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Account; - } - - /** - * Search parameter: balance - *

- * Description: How much is in account?
- * Type: quantity
- * Path: Account.balance
- *

- */ - @SearchParamDefinition(name="balance", path="Account.balance", description="How much is in account?", type="quantity" ) - public static final String SP_BALANCE = "balance"; - /** - * Fluent Client search parameter constant for balance - *

- * Description: How much is in account?
- * Type: quantity
- * Path: Account.balance
- *

- */ - public static final ca.uhn.fhir.rest.gclient.QuantityClientParam BALANCE = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_BALANCE); - - /** - * Search parameter: patient - *

- * Description: What is account tied to?
- * Type: reference
- * Path: Account.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Account.subject", description="What is account tied to?", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: What is account tied to?
- * Type: reference
- * Path: Account.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Account:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Account:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: active | inactive
- * Type: token
- * Path: Account.status
- *

- */ - @SearchParamDefinition(name="status", path="Account.status", description="active | inactive", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: active | inactive
- * Type: token
- * Path: Account.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: What is account tied to?
- * Type: reference
- * Path: Account.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Account.subject", description="What is account tied to?", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: What is account tied to?
- * Type: reference
- * Path: Account.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Account:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Account:subject").toLocked(); - - /** - * Search parameter: name - *

- * Description: Human-readable label
- * Type: string
- * Path: Account.name
- *

- */ - @SearchParamDefinition(name="name", path="Account.name", description="Human-readable label", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Human-readable label
- * Type: string
- * Path: Account.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: owner - *

- * Description: Who is responsible?
- * Type: reference
- * Path: Account.owner
- *

- */ - @SearchParamDefinition(name="owner", path="Account.owner", description="Who is responsible?", type="reference" ) - public static final String SP_OWNER = "owner"; - /** - * Fluent Client search parameter constant for owner - *

- * Description: Who is responsible?
- * Type: reference
- * Path: Account.owner
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Account:owner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Account:owner").toLocked(); - - /** - * Search parameter: period - *

- * Description: Transaction window
- * Type: date
- * Path: Account.coveragePeriod
- *

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

- * Description: Transaction window
- * Type: date
- * Path: Account.coveragePeriod
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); - - /** - * Search parameter: type - *

- * Description: E.g. patient, expense, depreciation
- * Type: token
- * Path: Account.type
- *

- */ - @SearchParamDefinition(name="type", path="Account.type", description="E.g. patient, expense, depreciation", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: E.g. patient, expense, depreciation
- * Type: token
- * Path: Account.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: Account number
- * Type: token
- * Path: Account.identifier
- *

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

- * Description: Account number
- * Type: token
- * Path: Account.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ActionDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ActionDefinition.java deleted file mode 100644 index cc235196326..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ActionDefinition.java +++ /dev/null @@ -1,2254 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. - */ -@DatatypeDef(name="ActionDefinition") -public class ActionDefinition extends Type implements ICompositeType { - - public enum ActionRelationshipType { - /** - * The action must be performed before the related action - */ - BEFORE, - /** - * The action must be performed after the related action - */ - AFTER, - /** - * added to help the parsers - */ - NULL; - public static ActionRelationshipType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("before".equals(codeString)) - return BEFORE; - if ("after".equals(codeString)) - return AFTER; - throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case BEFORE: return "before"; - case AFTER: return "after"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BEFORE: return "http://hl7.org/fhir/action-relationship-type"; - case AFTER: return "http://hl7.org/fhir/action-relationship-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BEFORE: return "The action must be performed before the related action"; - case AFTER: return "The action must be performed after the related action"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BEFORE: return "Before"; - case AFTER: return "After"; - default: return "?"; - } - } - } - - public static class ActionRelationshipTypeEnumFactory implements EnumFactory { - public ActionRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("before".equals(codeString)) - return ActionRelationshipType.BEFORE; - if ("after".equals(codeString)) - return ActionRelationshipType.AFTER; - throw new IllegalArgumentException("Unknown ActionRelationshipType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("before".equals(codeString)) - return new Enumeration(this, ActionRelationshipType.BEFORE); - if ("after".equals(codeString)) - return new Enumeration(this, ActionRelationshipType.AFTER); - throw new FHIRException("Unknown ActionRelationshipType code '"+codeString+"'"); - } - public String toCode(ActionRelationshipType code) { - if (code == ActionRelationshipType.BEFORE) - return "before"; - if (code == ActionRelationshipType.AFTER) - return "after"; - return "?"; - } - public String toSystem(ActionRelationshipType code) { - return code.getSystem(); - } - } - - public enum ActionRelationshipAnchor { - /** - * The action relationship is anchored to the start of the related action - */ - START, - /** - * The action relationship is anchored to the end of the related action - */ - END, - /** - * added to help the parsers - */ - NULL; - public static ActionRelationshipAnchor fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("start".equals(codeString)) - return START; - if ("end".equals(codeString)) - return END; - throw new FHIRException("Unknown ActionRelationshipAnchor code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case START: return "start"; - case END: return "end"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case START: return "http://hl7.org/fhir/action-relationship-anchor"; - case END: return "http://hl7.org/fhir/action-relationship-anchor"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case START: return "The action relationship is anchored to the start of the related action"; - case END: return "The action relationship is anchored to the end of the related action"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case START: return "Start"; - case END: return "End"; - default: return "?"; - } - } - } - - public static class ActionRelationshipAnchorEnumFactory implements EnumFactory { - public ActionRelationshipAnchor fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("start".equals(codeString)) - return ActionRelationshipAnchor.START; - if ("end".equals(codeString)) - return ActionRelationshipAnchor.END; - throw new IllegalArgumentException("Unknown ActionRelationshipAnchor code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("start".equals(codeString)) - return new Enumeration(this, ActionRelationshipAnchor.START); - if ("end".equals(codeString)) - return new Enumeration(this, ActionRelationshipAnchor.END); - throw new FHIRException("Unknown ActionRelationshipAnchor code '"+codeString+"'"); - } - public String toCode(ActionRelationshipAnchor code) { - if (code == ActionRelationshipAnchor.START) - return "start"; - if (code == ActionRelationshipAnchor.END) - return "end"; - return "?"; - } - public String toSystem(ActionRelationshipAnchor code) { - return code.getSystem(); - } - } - - public enum ParticipantType { - /** - * The participant is the patient under evaluation - */ - PATIENT, - /** - * The participant is a practitioner involved in the patient's care - */ - PRACTITIONER, - /** - * The participant is a person related to the patient - */ - RELATEDPERSON, - /** - * added to help the parsers - */ - NULL; - public static ParticipantType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("patient".equals(codeString)) - return PATIENT; - if ("practitioner".equals(codeString)) - return PRACTITIONER; - if ("related-person".equals(codeString)) - return RELATEDPERSON; - throw new FHIRException("Unknown ParticipantType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PATIENT: return "patient"; - case PRACTITIONER: return "practitioner"; - case RELATEDPERSON: return "related-person"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PATIENT: return "http://hl7.org/fhir/action-participant-type"; - case PRACTITIONER: return "http://hl7.org/fhir/action-participant-type"; - case RELATEDPERSON: return "http://hl7.org/fhir/action-participant-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PATIENT: return "The participant is the patient under evaluation"; - case PRACTITIONER: return "The participant is a practitioner involved in the patient's care"; - case RELATEDPERSON: return "The participant is a person related to the patient"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PATIENT: return "Patient"; - case PRACTITIONER: return "Practitioner"; - case RELATEDPERSON: return "Related Person"; - default: return "?"; - } - } - } - - public static class ParticipantTypeEnumFactory implements EnumFactory { - public ParticipantType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("patient".equals(codeString)) - return ParticipantType.PATIENT; - if ("practitioner".equals(codeString)) - return ParticipantType.PRACTITIONER; - if ("related-person".equals(codeString)) - return ParticipantType.RELATEDPERSON; - throw new IllegalArgumentException("Unknown ParticipantType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("patient".equals(codeString)) - return new Enumeration(this, ParticipantType.PATIENT); - if ("practitioner".equals(codeString)) - return new Enumeration(this, ParticipantType.PRACTITIONER); - if ("related-person".equals(codeString)) - return new Enumeration(this, ParticipantType.RELATEDPERSON); - throw new FHIRException("Unknown ParticipantType code '"+codeString+"'"); - } - public String toCode(ParticipantType code) { - if (code == ParticipantType.PATIENT) - return "patient"; - if (code == ParticipantType.PRACTITIONER) - return "practitioner"; - if (code == ParticipantType.RELATEDPERSON) - return "related-person"; - return "?"; - } - public String toSystem(ParticipantType code) { - return code.getSystem(); - } - } - - public enum ActionType { - /** - * The action is to create a new resource - */ - CREATE, - /** - * The action is to update an existing resource - */ - UPDATE, - /** - * The action is to remove an existing resource - */ - REMOVE, - /** - * The action is to fire a specific event - */ - FIREEVENT, - /** - * added to help the parsers - */ - NULL; - public static ActionType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return CREATE; - if ("update".equals(codeString)) - return UPDATE; - if ("remove".equals(codeString)) - return REMOVE; - if ("fire-event".equals(codeString)) - return FIREEVENT; - throw new FHIRException("Unknown ActionType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CREATE: return "create"; - case UPDATE: return "update"; - case REMOVE: return "remove"; - case FIREEVENT: return "fire-event"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CREATE: return "http://hl7.org/fhir/action-type"; - case UPDATE: return "http://hl7.org/fhir/action-type"; - case REMOVE: return "http://hl7.org/fhir/action-type"; - case FIREEVENT: return "http://hl7.org/fhir/action-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CREATE: return "The action is to create a new resource"; - case UPDATE: return "The action is to update an existing resource"; - case REMOVE: return "The action is to remove an existing resource"; - case FIREEVENT: return "The action is to fire a specific event"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CREATE: return "Create"; - case UPDATE: return "Update"; - case REMOVE: return "Remove"; - case FIREEVENT: return "Fire Event"; - default: return "?"; - } - } - } - - public static class ActionTypeEnumFactory implements EnumFactory { - public ActionType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return ActionType.CREATE; - if ("update".equals(codeString)) - return ActionType.UPDATE; - if ("remove".equals(codeString)) - return ActionType.REMOVE; - if ("fire-event".equals(codeString)) - return ActionType.FIREEVENT; - throw new IllegalArgumentException("Unknown ActionType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return new Enumeration(this, ActionType.CREATE); - if ("update".equals(codeString)) - return new Enumeration(this, ActionType.UPDATE); - if ("remove".equals(codeString)) - return new Enumeration(this, ActionType.REMOVE); - if ("fire-event".equals(codeString)) - return new Enumeration(this, ActionType.FIREEVENT); - throw new FHIRException("Unknown ActionType code '"+codeString+"'"); - } - public String toCode(ActionType code) { - if (code == ActionType.CREATE) - return "create"; - if (code == ActionType.UPDATE) - return "update"; - if (code == ActionType.REMOVE) - return "remove"; - if (code == ActionType.FIREEVENT) - return "fire-event"; - return "?"; - } - public String toSystem(ActionType code) { - return code.getSystem(); - } - } - - @Block() - public static class ActionDefinitionRelatedActionComponent extends Element implements IBaseDatatypeElement { - /** - * The unique identifier of the related action. - */ - @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of the related action", formalDefinition="The unique identifier of the related action." ) - protected Identifier actionIdentifier; - - /** - * The relationship of this action to the related action. - */ - @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="before | after", formalDefinition="The relationship of this action to the related action." ) - protected Enumeration relationship; - - /** - * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. - */ - @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time offset for the relationship", formalDefinition="A duration or range of durations to apply to the relationship. For example, 30-60 minutes before." ) - protected Type offset; - - /** - * An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. - */ - @Child(name = "anchor", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="start | end", formalDefinition="An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action." ) - protected Enumeration anchor; - - private static final long serialVersionUID = 451097227L; - - /** - * Constructor - */ - public ActionDefinitionRelatedActionComponent() { - super(); - } - - /** - * Constructor - */ - public ActionDefinitionRelatedActionComponent(Identifier actionIdentifier, Enumeration relationship) { - super(); - this.actionIdentifier = actionIdentifier; - this.relationship = relationship; - } - - /** - * @return {@link #actionIdentifier} (The unique identifier of the related action.) - */ - public Identifier getActionIdentifier() { - if (this.actionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionRelatedActionComponent.actionIdentifier"); - else if (Configuration.doAutoCreate()) - this.actionIdentifier = new Identifier(); // cc - return this.actionIdentifier; - } - - public boolean hasActionIdentifier() { - return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); - } - - /** - * @param value {@link #actionIdentifier} (The unique identifier of the related action.) - */ - public ActionDefinitionRelatedActionComponent setActionIdentifier(Identifier value) { - this.actionIdentifier = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value - */ - public Enumeration getRelationshipElement() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionRelatedActionComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Enumeration(new ActionRelationshipTypeEnumFactory()); // bb - return this.relationship; - } - - public boolean hasRelationshipElement() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value - */ - public ActionDefinitionRelatedActionComponent setRelationshipElement(Enumeration value) { - this.relationship = value; - return this; - } - - /** - * @return The relationship of this action to the related action. - */ - public ActionRelationshipType getRelationship() { - return this.relationship == null ? null : this.relationship.getValue(); - } - - /** - * @param value The relationship of this action to the related action. - */ - public ActionDefinitionRelatedActionComponent setRelationship(ActionRelationshipType value) { - if (this.relationship == null) - this.relationship = new Enumeration(new ActionRelationshipTypeEnumFactory()); - this.relationship.setValue(value); - return this; - } - - /** - * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public Type getOffset() { - return this.offset; - } - - /** - * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public Duration getOffsetDuration() throws FHIRException { - if (!(this.offset instanceof Duration)) - throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered"); - return (Duration) this.offset; - } - - public boolean hasOffsetDuration() { - return this.offset instanceof Duration; - } - - /** - * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public Range getOffsetRange() throws FHIRException { - if (!(this.offset instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered"); - return (Range) this.offset; - } - - public boolean hasOffsetRange() { - return this.offset instanceof Range; - } - - public boolean hasOffset() { - return this.offset != null && !this.offset.isEmpty(); - } - - /** - * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public ActionDefinitionRelatedActionComponent setOffset(Type value) { - this.offset = value; - return this; - } - - /** - * @return {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value - */ - public Enumeration getAnchorElement() { - if (this.anchor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionRelatedActionComponent.anchor"); - else if (Configuration.doAutoCreate()) - this.anchor = new Enumeration(new ActionRelationshipAnchorEnumFactory()); // bb - return this.anchor; - } - - public boolean hasAnchorElement() { - return this.anchor != null && !this.anchor.isEmpty(); - } - - public boolean hasAnchor() { - return this.anchor != null && !this.anchor.isEmpty(); - } - - /** - * @param value {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value - */ - public ActionDefinitionRelatedActionComponent setAnchorElement(Enumeration value) { - this.anchor = value; - return this; - } - - /** - * @return An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. - */ - public ActionRelationshipAnchor getAnchor() { - return this.anchor == null ? null : this.anchor.getValue(); - } - - /** - * @param value An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. - */ - public ActionDefinitionRelatedActionComponent setAnchor(ActionRelationshipAnchor value) { - if (value == null) - this.anchor = null; - else { - if (this.anchor == null) - this.anchor = new Enumeration(new ActionRelationshipAnchorEnumFactory()); - this.anchor.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actionIdentifier", "Identifier", "The unique identifier of the related action.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); - childrenList.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("offset[x]", "Duration|Range", "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, java.lang.Integer.MAX_VALUE, offset)); - childrenList.add(new Property("anchor", "code", "An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action.", 0, java.lang.Integer.MAX_VALUE, anchor)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Enumeration - case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // Type - case -1413299531: /*anchor*/ return this.anchor == null ? new Base[0] : new Base[] {this.anchor}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -889046145: // actionIdentifier - this.actionIdentifier = castToIdentifier(value); // Identifier - break; - case -261851592: // relationship - this.relationship = new ActionRelationshipTypeEnumFactory().fromType(value); // Enumeration - break; - case -1019779949: // offset - this.offset = (Type) value; // Type - break; - case -1413299531: // anchor - this.anchor = new ActionRelationshipAnchorEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actionIdentifier")) - this.actionIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("relationship")) - this.relationship = new ActionRelationshipTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("offset[x]")) - this.offset = (Type) value; // Type - else if (name.equals("anchor")) - this.anchor = new ActionRelationshipAnchorEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -889046145: return getActionIdentifier(); // Identifier - case -261851592: throw new FHIRException("Cannot make property relationship as it is not a complex type"); // Enumeration - case -1960684787: return getOffset(); // Type - case -1413299531: throw new FHIRException("Cannot make property anchor as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actionIdentifier")) { - this.actionIdentifier = new Identifier(); - return this.actionIdentifier; - } - else if (name.equals("relationship")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.relationship"); - } - else if (name.equals("offsetDuration")) { - this.offset = new Duration(); - return this.offset; - } - else if (name.equals("offsetRange")) { - this.offset = new Range(); - return this.offset; - } - else if (name.equals("anchor")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.anchor"); - } - else - return super.addChild(name); - } - - public ActionDefinitionRelatedActionComponent copy() { - ActionDefinitionRelatedActionComponent dst = new ActionDefinitionRelatedActionComponent(); - copyValues(dst); - dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.offset = offset == null ? null : offset.copy(); - dst.anchor = anchor == null ? null : anchor.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ActionDefinitionRelatedActionComponent)) - return false; - ActionDefinitionRelatedActionComponent o = (ActionDefinitionRelatedActionComponent) other; - return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(offset, o.offset, true) && compareDeep(anchor, o.anchor, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ActionDefinitionRelatedActionComponent)) - return false; - ActionDefinitionRelatedActionComponent o = (ActionDefinitionRelatedActionComponent) other; - return compareValues(relationship, o.relationship, true) && compareValues(anchor, o.anchor, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (offset == null || offset.isEmpty()) && (anchor == null || anchor.isEmpty()); - } - - public String fhirType() { - return "ActionDefinition.relatedAction"; - - } - - } - - @Block() - public static class ActionDefinitionBehaviorComponent extends Element implements IBaseDatatypeElement { - /** - * The type of the behavior to be described, such as grouping, visual, or selection behaviors. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The type of behavior (grouping, precheck, selection, cardinality, etc)", formalDefinition="The type of the behavior to be described, such as grouping, visual, or selection behaviors." ) - protected Coding type; - - /** - * The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset. - */ - @Child(name = "value", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific behavior (e.g. required, at-most-one, single, etc)", formalDefinition="The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset." ) - protected Coding value; - - private static final long serialVersionUID = -1054119695L; - - /** - * Constructor - */ - public ActionDefinitionBehaviorComponent() { - super(); - } - - /** - * Constructor - */ - public ActionDefinitionBehaviorComponent(Coding type, Coding value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionBehaviorComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) - */ - public ActionDefinitionBehaviorComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) - */ - public Coding getValue() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionBehaviorComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new Coding(); // cc - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) - */ - public ActionDefinitionBehaviorComponent setValue(Coding value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The type of the behavior to be described, such as grouping, visual, or selection behaviors.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "Coding", "The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 111972721: // value - this.value = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("value")) - this.value = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 111972721: return getValue(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("value")) { - this.value = new Coding(); - return this.value; - } - else - return super.addChild(name); - } - - public ActionDefinitionBehaviorComponent copy() { - ActionDefinitionBehaviorComponent dst = new ActionDefinitionBehaviorComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ActionDefinitionBehaviorComponent)) - return false; - ActionDefinitionBehaviorComponent o = (ActionDefinitionBehaviorComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ActionDefinitionBehaviorComponent)) - return false; - ActionDefinitionBehaviorComponent o = (ActionDefinitionBehaviorComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "ActionDefinition.behavior"; - - } - - } - - @Block() - public static class ActionDefinitionCustomizationComponent extends Element implements IBaseDatatypeElement { - /** - * The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. - */ - @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The path to the element to be set dynamically", formalDefinition="The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression." ) - protected StringType path; - - /** - * An expression specifying the value of the customized element. - */ - @Child(name = "expression", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="An expression that provides the dynamic value for the customization", formalDefinition="An expression specifying the value of the customized element." ) - protected StringType expression; - - private static final long serialVersionUID = -252690483L; - - /** - * Constructor - */ - public ActionDefinitionCustomizationComponent() { - super(); - } - - /** - * Constructor - */ - public ActionDefinitionCustomizationComponent(StringType path, StringType expression) { - super(); - this.path = path; - this.expression = expression; - } - - /** - * @return {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionCustomizationComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ActionDefinitionCustomizationComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression. - */ - public ActionDefinitionCustomizationComponent setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #expression} (An expression specifying the value of the customized element.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value - */ - public StringType getExpressionElement() { - if (this.expression == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinitionCustomizationComponent.expression"); - else if (Configuration.doAutoCreate()) - this.expression = new StringType(); // bb - return this.expression; - } - - public boolean hasExpressionElement() { - return this.expression != null && !this.expression.isEmpty(); - } - - public boolean hasExpression() { - return this.expression != null && !this.expression.isEmpty(); - } - - /** - * @param value {@link #expression} (An expression specifying the value of the customized element.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value - */ - public ActionDefinitionCustomizationComponent setExpressionElement(StringType value) { - this.expression = value; - return this; - } - - /** - * @return An expression specifying the value of the customized element. - */ - public String getExpression() { - return this.expression == null ? null : this.expression.getValue(); - } - - /** - * @param value An expression specifying the value of the customized element. - */ - public ActionDefinitionCustomizationComponent setExpression(String value) { - if (this.expression == null) - this.expression = new StringType(); - this.expression.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The path to the element to be customized. This is the path on the resource that will hold the result of the calculation defined by the expression.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("expression", "string", "An expression specifying the value of the customized element.", 0, java.lang.Integer.MAX_VALUE, expression)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case -1795452264: // expression - this.expression = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("expression")) - this.expression = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.path"); - } - else if (name.equals("expression")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.expression"); - } - else - return super.addChild(name); - } - - public ActionDefinitionCustomizationComponent copy() { - ActionDefinitionCustomizationComponent dst = new ActionDefinitionCustomizationComponent(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - dst.expression = expression == null ? null : expression.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ActionDefinitionCustomizationComponent)) - return false; - ActionDefinitionCustomizationComponent o = (ActionDefinitionCustomizationComponent) other; - return compareDeep(path, o.path, true) && compareDeep(expression, o.expression, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ActionDefinitionCustomizationComponent)) - return false; - ActionDefinitionCustomizationComponent o = (ActionDefinitionCustomizationComponent) other; - return compareValues(path, o.path, true) && compareValues(expression, o.expression, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (expression == null || expression.isEmpty()) - ; - } - - public String fhirType() { - return "ActionDefinition.customization"; - - } - - } - - /** - * A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique. - */ - @Child(name = "actionIdentifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique." ) - protected Identifier actionIdentifier; - - /** - * A user-visible label for the action. - */ - @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="User-visible label for the action (e.g. 1. or A.)", formalDefinition="A user-visible label for the action." ) - protected StringType label; - - /** - * The title of the action displayed to a user. - */ - @Child(name = "title", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="User-visible title", formalDefinition="The title of the action displayed to a user." ) - protected StringType title; - - /** - * A short description of the action used to provide a summary to display to the user. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Short description of the action", formalDefinition="A short description of the action used to provide a summary to display to the user." ) - protected StringType description; - - /** - * A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. - */ - @Child(name = "textEquivalent", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system", formalDefinition="A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically." ) - protected StringType textEquivalent; - - /** - * The concept represented by this action or its sub-actions. - */ - @Child(name = "concept", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The meaning of the action or its sub-actions", formalDefinition="The concept represented by this action or its sub-actions." ) - protected List concept; - - /** - * The evidence grade and the sources of evidence for this action. - */ - @Child(name = "supportingEvidence", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Evidence that supports taking the action", formalDefinition="The evidence grade and the sources of evidence for this action." ) - protected List supportingEvidence; - - /** - * Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. - */ - @Child(name = "documentation", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Supporting documentation for the intended performer of the action", formalDefinition="Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources." ) - protected List documentation; - - /** - * A relationship to another action such as "before" or "30-60 minutes after start of". - */ - @Child(name = "relatedAction", type = {}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) - protected ActionDefinitionRelatedActionComponent relatedAction; - - /** - * The type of participant in the action. - */ - @Child(name = "participantType", type = {CodeType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="patient | practitioner | related-person", formalDefinition="The type of participant in the action." ) - protected List> participantType; - - /** - * The type of action to perform (create, update, remove). - */ - @Child(name = "type", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) - protected Enumeration type; - - /** - * A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment. - */ - @Child(name = "behavior", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Defines behaviors such as selection and grouping", formalDefinition="A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment." ) - protected List behavior; - - /** - * The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition). - */ - @Child(name = "resource", type = {}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Static portion of the action definition", formalDefinition="The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition)." ) - protected Reference resource; - - /** - * The actual object that is the target of the reference (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) - */ - protected Resource resourceTarget; - - /** - * Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result. - */ - @Child(name = "customization", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Dynamic aspects of the definition", formalDefinition="Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result." ) - protected List customization; - - /** - * Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition. - */ - @Child(name = "action", type = {ActionDefinition.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A sub-action", formalDefinition="Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition." ) - protected List action; - - private static final long serialVersionUID = -1659761573L; - - /** - * Constructor - */ - public ActionDefinition() { - super(); - } - - /** - * @return {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) - */ - public Identifier getActionIdentifier() { - if (this.actionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.actionIdentifier"); - else if (Configuration.doAutoCreate()) - this.actionIdentifier = new Identifier(); // cc - return this.actionIdentifier; - } - - public boolean hasActionIdentifier() { - return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); - } - - /** - * @param value {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) - */ - public ActionDefinition setActionIdentifier(Identifier value) { - this.actionIdentifier = value; - return this; - } - - /** - * @return {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); // bb - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public ActionDefinition setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return A user-visible label for the action. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value A user-visible label for the action. - */ - public ActionDefinition setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public ActionDefinition setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The title of the action displayed to a user. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The title of the action displayed to a user. - */ - public ActionDefinition setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ActionDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A short description of the action used to provide a summary to display to the user. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A short description of the action used to provide a summary to display to the user. - */ - public ActionDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value - */ - public StringType getTextEquivalentElement() { - if (this.textEquivalent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.textEquivalent"); - else if (Configuration.doAutoCreate()) - this.textEquivalent = new StringType(); // bb - return this.textEquivalent; - } - - public boolean hasTextEquivalentElement() { - return this.textEquivalent != null && !this.textEquivalent.isEmpty(); - } - - public boolean hasTextEquivalent() { - return this.textEquivalent != null && !this.textEquivalent.isEmpty(); - } - - /** - * @param value {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value - */ - public ActionDefinition setTextEquivalentElement(StringType value) { - this.textEquivalent = value; - return this; - } - - /** - * @return A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. - */ - public String getTextEquivalent() { - return this.textEquivalent == null ? null : this.textEquivalent.getValue(); - } - - /** - * @param value A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. - */ - public ActionDefinition setTextEquivalent(String value) { - if (Utilities.noString(value)) - this.textEquivalent = null; - else { - if (this.textEquivalent == null) - this.textEquivalent = new StringType(); - this.textEquivalent.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (The concept represented by this action or its sub-actions.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (CodeableConcept item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (The concept represented by this action or its sub-actions.) - */ - // syntactic sugar - public CodeableConcept addConcept() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public ActionDefinition addConcept(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) - */ - public List getSupportingEvidence() { - if (this.supportingEvidence == null) - this.supportingEvidence = new ArrayList(); - return this.supportingEvidence; - } - - public boolean hasSupportingEvidence() { - if (this.supportingEvidence == null) - return false; - for (Attachment item : this.supportingEvidence) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) - */ - // syntactic sugar - public Attachment addSupportingEvidence() { //3 - Attachment t = new Attachment(); - if (this.supportingEvidence == null) - this.supportingEvidence = new ArrayList(); - this.supportingEvidence.add(t); - return t; - } - - // syntactic sugar - public ActionDefinition addSupportingEvidence(Attachment t) { //3 - if (t == null) - return this; - if (this.supportingEvidence == null) - this.supportingEvidence = new ArrayList(); - this.supportingEvidence.add(t); - return this; - } - - /** - * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) - */ - public List getDocumentation() { - if (this.documentation == null) - this.documentation = new ArrayList(); - return this.documentation; - } - - public boolean hasDocumentation() { - if (this.documentation == null) - return false; - for (Attachment item : this.documentation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) - */ - // syntactic sugar - public Attachment addDocumentation() { //3 - Attachment t = new Attachment(); - if (this.documentation == null) - this.documentation = new ArrayList(); - this.documentation.add(t); - return t; - } - - // syntactic sugar - public ActionDefinition addDocumentation(Attachment t) { //3 - if (t == null) - return this; - if (this.documentation == null) - this.documentation = new ArrayList(); - this.documentation.add(t); - return this; - } - - /** - * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) - */ - public ActionDefinitionRelatedActionComponent getRelatedAction() { - if (this.relatedAction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.relatedAction"); - else if (Configuration.doAutoCreate()) - this.relatedAction = new ActionDefinitionRelatedActionComponent(); // cc - return this.relatedAction; - } - - public boolean hasRelatedAction() { - return this.relatedAction != null && !this.relatedAction.isEmpty(); - } - - /** - * @param value {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) - */ - public ActionDefinition setRelatedAction(ActionDefinitionRelatedActionComponent value) { - this.relatedAction = value; - return this; - } - - /** - * @return {@link #participantType} (The type of participant in the action.) - */ - public List> getParticipantType() { - if (this.participantType == null) - this.participantType = new ArrayList>(); - return this.participantType; - } - - public boolean hasParticipantType() { - if (this.participantType == null) - return false; - for (Enumeration item : this.participantType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participantType} (The type of participant in the action.) - */ - // syntactic sugar - public Enumeration addParticipantTypeElement() {//2 - Enumeration t = new Enumeration(new ParticipantTypeEnumFactory()); - if (this.participantType == null) - this.participantType = new ArrayList>(); - this.participantType.add(t); - return t; - } - - /** - * @param value {@link #participantType} (The type of participant in the action.) - */ - public ActionDefinition addParticipantType(ParticipantType value) { //1 - Enumeration t = new Enumeration(new ParticipantTypeEnumFactory()); - t.setValue(value); - if (this.participantType == null) - this.participantType = new ArrayList>(); - this.participantType.add(t); - return this; - } - - /** - * @param value {@link #participantType} (The type of participant in the action.) - */ - public boolean hasParticipantType(ParticipantType value) { - if (this.participantType == null) - return false; - for (Enumeration v : this.participantType) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #type} (The type of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ActionTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ActionDefinition setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of action to perform (create, update, remove). - */ - public ActionType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of action to perform (create, update, remove). - */ - public ActionDefinition setType(ActionType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new ActionTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) - */ - public List getBehavior() { - if (this.behavior == null) - this.behavior = new ArrayList(); - return this.behavior; - } - - public boolean hasBehavior() { - if (this.behavior == null) - return false; - for (ActionDefinitionBehaviorComponent item : this.behavior) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) - */ - // syntactic sugar - public ActionDefinitionBehaviorComponent addBehavior() { //3 - ActionDefinitionBehaviorComponent t = new ActionDefinitionBehaviorComponent(); - if (this.behavior == null) - this.behavior = new ArrayList(); - this.behavior.add(t); - return t; - } - - // syntactic sugar - public ActionDefinition addBehavior(ActionDefinitionBehaviorComponent t) { //3 - if (t == null) - return this; - if (this.behavior == null) - this.behavior = new ArrayList(); - this.behavior.add(t); - return this; - } - - /** - * @return {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ActionDefinition.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) - */ - public ActionDefinition setResource(Reference value) { - this.resource = value; - return this; - } - - /** - * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) - */ - public Resource getResourceTarget() { - return this.resourceTarget; - } - - /** - * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).) - */ - public ActionDefinition setResourceTarget(Resource value) { - this.resourceTarget = value; - return this; - } - - /** - * @return {@link #customization} (Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.) - */ - public List getCustomization() { - if (this.customization == null) - this.customization = new ArrayList(); - return this.customization; - } - - public boolean hasCustomization() { - if (this.customization == null) - return false; - for (ActionDefinitionCustomizationComponent item : this.customization) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #customization} (Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.) - */ - // syntactic sugar - public ActionDefinitionCustomizationComponent addCustomization() { //3 - ActionDefinitionCustomizationComponent t = new ActionDefinitionCustomizationComponent(); - if (this.customization == null) - this.customization = new ArrayList(); - this.customization.add(t); - return t; - } - - // syntactic sugar - public ActionDefinition addCustomization(ActionDefinitionCustomizationComponent t) { //3 - if (t == null) - return this; - if (this.customization == null) - this.customization = new ArrayList(); - this.customization.add(t); - return this; - } - - /** - * @return {@link #action} (Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (ActionDefinition item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.) - */ - // syntactic sugar - public ActionDefinition addAction() { //3 - ActionDefinition t = new ActionDefinition(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public ActionDefinition addAction(ActionDefinition t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actionIdentifier", "Identifier", "A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); - childrenList.add(new Property("label", "string", "A user-visible label for the action.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("title", "string", "The title of the action displayed to a user.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("description", "string", "A short description of the action used to provide a summary to display to the user.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("textEquivalent", "string", "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.", 0, java.lang.Integer.MAX_VALUE, textEquivalent)); - childrenList.add(new Property("concept", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("supportingEvidence", "Attachment", "The evidence grade and the sources of evidence for this action.", 0, java.lang.Integer.MAX_VALUE, supportingEvidence)); - childrenList.add(new Property("documentation", "Attachment", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); - childrenList.add(new Property("participantType", "code", "The type of participant in the action.", 0, java.lang.Integer.MAX_VALUE, participantType)); - childrenList.add(new Property("type", "code", "The type of action to perform (create, update, remove).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("behavior", "", "A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.", 0, java.lang.Integer.MAX_VALUE, behavior)); - childrenList.add(new Property("resource", "Reference(Any)", "The resource that is the target of the action (e.g. CommunicationRequest). The resource described here defines any aspects of the action that can be specified statically (i.e. are known at the time of definition).", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("customization", "", "Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication must be computed based on the patient's weight, a customization would be used to specify an expression that calculated the weight, and the path on the resource that would contain the result.", 0, java.lang.Integer.MAX_VALUE, customization)); - childrenList.add(new Property("action", "ActionDefinition", "Sub actions that are contained within the action. The behavior of this action determines the functionality of the sub-actions. For example, a selection behavior of at-most-one indicates that of the sub-actions, at most one may be chosen as part of realizing the action definition.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier - case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // CodeableConcept - case -1735429846: /*supportingEvidence*/ return this.supportingEvidence == null ? new Base[0] : this.supportingEvidence.toArray(new Base[this.supportingEvidence.size()]); // Attachment - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // Attachment - case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : new Base[] {this.relatedAction}; // ActionDefinitionRelatedActionComponent - case 841294093: /*participantType*/ return this.participantType == null ? new Base[0] : this.participantType.toArray(new Base[this.participantType.size()]); // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 1510912594: /*behavior*/ return this.behavior == null ? new Base[0] : this.behavior.toArray(new Base[this.behavior.size()]); // ActionDefinitionBehaviorComponent - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - case 1637263315: /*customization*/ return this.customization == null ? new Base[0] : this.customization.toArray(new Base[this.customization.size()]); // ActionDefinitionCustomizationComponent - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionDefinition - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -889046145: // actionIdentifier - this.actionIdentifier = castToIdentifier(value); // Identifier - break; - case 102727412: // label - this.label = castToString(value); // StringType - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -900391049: // textEquivalent - this.textEquivalent = castToString(value); // StringType - break; - case 951024232: // concept - this.getConcept().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1735429846: // supportingEvidence - this.getSupportingEvidence().add(castToAttachment(value)); // Attachment - break; - case 1587405498: // documentation - this.getDocumentation().add(castToAttachment(value)); // Attachment - break; - case -384107967: // relatedAction - this.relatedAction = (ActionDefinitionRelatedActionComponent) value; // ActionDefinitionRelatedActionComponent - break; - case 841294093: // participantType - this.getParticipantType().add(new ParticipantTypeEnumFactory().fromType(value)); // Enumeration - break; - case 3575610: // type - this.type = new ActionTypeEnumFactory().fromType(value); // Enumeration - break; - case 1510912594: // behavior - this.getBehavior().add((ActionDefinitionBehaviorComponent) value); // ActionDefinitionBehaviorComponent - break; - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - case 1637263315: // customization - this.getCustomization().add((ActionDefinitionCustomizationComponent) value); // ActionDefinitionCustomizationComponent - break; - case -1422950858: // action - this.getAction().add(castToActionDefinition(value)); // ActionDefinition - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actionIdentifier")) - this.actionIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("label")) - this.label = castToString(value); // StringType - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("textEquivalent")) - this.textEquivalent = castToString(value); // StringType - else if (name.equals("concept")) - this.getConcept().add(castToCodeableConcept(value)); - else if (name.equals("supportingEvidence")) - this.getSupportingEvidence().add(castToAttachment(value)); - else if (name.equals("documentation")) - this.getDocumentation().add(castToAttachment(value)); - else if (name.equals("relatedAction")) - this.relatedAction = (ActionDefinitionRelatedActionComponent) value; // ActionDefinitionRelatedActionComponent - else if (name.equals("participantType")) - this.getParticipantType().add(new ParticipantTypeEnumFactory().fromType(value)); - else if (name.equals("type")) - this.type = new ActionTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("behavior")) - this.getBehavior().add((ActionDefinitionBehaviorComponent) value); - else if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else if (name.equals("customization")) - this.getCustomization().add((ActionDefinitionCustomizationComponent) value); - else if (name.equals("action")) - this.getAction().add(castToActionDefinition(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -889046145: return getActionIdentifier(); // Identifier - case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -900391049: throw new FHIRException("Cannot make property textEquivalent as it is not a complex type"); // StringType - case 951024232: return addConcept(); // CodeableConcept - case -1735429846: return addSupportingEvidence(); // Attachment - case 1587405498: return addDocumentation(); // Attachment - case -384107967: return getRelatedAction(); // ActionDefinitionRelatedActionComponent - case 841294093: throw new FHIRException("Cannot make property participantType as it is not a complex type"); // Enumeration - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 1510912594: return addBehavior(); // ActionDefinitionBehaviorComponent - case -341064690: return getResource(); // Reference - case 1637263315: return addCustomization(); // ActionDefinitionCustomizationComponent - case -1422950858: return addAction(); // ActionDefinition - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actionIdentifier")) { - this.actionIdentifier = new Identifier(); - return this.actionIdentifier; - } - else if (name.equals("label")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.label"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.title"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.description"); - } - else if (name.equals("textEquivalent")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.textEquivalent"); - } - else if (name.equals("concept")) { - return addConcept(); - } - else if (name.equals("supportingEvidence")) { - return addSupportingEvidence(); - } - else if (name.equals("documentation")) { - return addDocumentation(); - } - else if (name.equals("relatedAction")) { - this.relatedAction = new ActionDefinitionRelatedActionComponent(); - return this.relatedAction; - } - else if (name.equals("participantType")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.participantType"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ActionDefinition.type"); - } - else if (name.equals("behavior")) { - return addBehavior(); - } - else if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else if (name.equals("customization")) { - return addCustomization(); - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ActionDefinition"; - - } - - public ActionDefinition copy() { - ActionDefinition dst = new ActionDefinition(); - copyValues(dst); - dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); - dst.label = label == null ? null : label.copy(); - dst.title = title == null ? null : title.copy(); - dst.description = description == null ? null : description.copy(); - dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (CodeableConcept i : concept) - dst.concept.add(i.copy()); - }; - if (supportingEvidence != null) { - dst.supportingEvidence = new ArrayList(); - for (Attachment i : supportingEvidence) - dst.supportingEvidence.add(i.copy()); - }; - if (documentation != null) { - dst.documentation = new ArrayList(); - for (Attachment i : documentation) - dst.documentation.add(i.copy()); - }; - dst.relatedAction = relatedAction == null ? null : relatedAction.copy(); - if (participantType != null) { - dst.participantType = new ArrayList>(); - for (Enumeration i : participantType) - dst.participantType.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (behavior != null) { - dst.behavior = new ArrayList(); - for (ActionDefinitionBehaviorComponent i : behavior) - dst.behavior.add(i.copy()); - }; - dst.resource = resource == null ? null : resource.copy(); - if (customization != null) { - dst.customization = new ArrayList(); - for (ActionDefinitionCustomizationComponent i : customization) - dst.customization.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (ActionDefinition i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - protected ActionDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ActionDefinition)) - return false; - ActionDefinition o = (ActionDefinition) other; - return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) - && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) - && compareDeep(concept, o.concept, true) && compareDeep(supportingEvidence, o.supportingEvidence, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(relatedAction, o.relatedAction, true) - && compareDeep(participantType, o.participantType, true) && compareDeep(type, o.type, true) && compareDeep(behavior, o.behavior, true) - && compareDeep(resource, o.resource, true) && compareDeep(customization, o.customization, true) - && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ActionDefinition)) - return false; - ActionDefinition o = (ActionDefinition) other; - return compareValues(label, o.label, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true) - && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(participantType, o.participantType, true) - && compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (label == null || label.isEmpty()) - && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (textEquivalent == null || textEquivalent.isEmpty()) - && (concept == null || concept.isEmpty()) && (supportingEvidence == null || supportingEvidence.isEmpty()) - && (documentation == null || documentation.isEmpty()) && (relatedAction == null || relatedAction.isEmpty()) - && (participantType == null || participantType.isEmpty()) && (type == null || type.isEmpty()) - && (behavior == null || behavior.isEmpty()) && (resource == null || resource.isEmpty()) && (customization == null || customization.isEmpty()) - && (action == null || action.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Address.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Address.java deleted file mode 100644 index a611fd7a37c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Address.java +++ /dev/null @@ -1,1035 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. - */ -@DatatypeDef(name="Address") -public class Address extends Type implements ICompositeType { - - public enum AddressUse { - /** - * A communication address at a home. - */ - HOME, - /** - * An office address. First choice for business related contacts during business hours. - */ - WORK, - /** - * A temporary address. The period can provide more detailed information. - */ - TEMP, - /** - * This address is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * added to help the parsers - */ - NULL; - public static AddressUse fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return HOME; - if ("work".equals(codeString)) - return WORK; - if ("temp".equals(codeString)) - return TEMP; - if ("old".equals(codeString)) - return OLD; - throw new FHIRException("Unknown AddressUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HOME: return "http://hl7.org/fhir/address-use"; - case WORK: return "http://hl7.org/fhir/address-use"; - case TEMP: return "http://hl7.org/fhir/address-use"; - case OLD: return "http://hl7.org/fhir/address-use"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HOME: return "A communication address at a home."; - case WORK: return "An office address. First choice for business related contacts during business hours."; - case TEMP: return "A temporary address. The period can provide more detailed information."; - case OLD: return "This address is no longer in use (or was never correct, but retained for records)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HOME: return "Home"; - case WORK: return "Work"; - case TEMP: return "Temporary"; - case OLD: return "Old / Incorrect"; - default: return "?"; - } - } - } - - public static class AddressUseEnumFactory implements EnumFactory { - public AddressUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return AddressUse.HOME; - if ("work".equals(codeString)) - return AddressUse.WORK; - if ("temp".equals(codeString)) - return AddressUse.TEMP; - if ("old".equals(codeString)) - return AddressUse.OLD; - throw new IllegalArgumentException("Unknown AddressUse code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return new Enumeration(this, AddressUse.HOME); - if ("work".equals(codeString)) - return new Enumeration(this, AddressUse.WORK); - if ("temp".equals(codeString)) - return new Enumeration(this, AddressUse.TEMP); - if ("old".equals(codeString)) - return new Enumeration(this, AddressUse.OLD); - throw new FHIRException("Unknown AddressUse code '"+codeString+"'"); - } - public String toCode(AddressUse code) { - if (code == AddressUse.HOME) - return "home"; - if (code == AddressUse.WORK) - return "work"; - if (code == AddressUse.TEMP) - return "temp"; - if (code == AddressUse.OLD) - return "old"; - return "?"; - } - public String toSystem(AddressUse code) { - return code.getSystem(); - } - } - - public enum AddressType { - /** - * Mailing addresses - PO Boxes and care-of addresses. - */ - POSTAL, - /** - * A physical address that can be visited. - */ - PHYSICAL, - /** - * An address that is both physical and postal. - */ - BOTH, - /** - * added to help the parsers - */ - NULL; - public static AddressType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("postal".equals(codeString)) - return POSTAL; - if ("physical".equals(codeString)) - return PHYSICAL; - if ("both".equals(codeString)) - return BOTH; - throw new FHIRException("Unknown AddressType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case POSTAL: return "postal"; - case PHYSICAL: return "physical"; - case BOTH: return "both"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case POSTAL: return "http://hl7.org/fhir/address-type"; - case PHYSICAL: return "http://hl7.org/fhir/address-type"; - case BOTH: return "http://hl7.org/fhir/address-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case POSTAL: return "Mailing addresses - PO Boxes and care-of addresses."; - case PHYSICAL: return "A physical address that can be visited."; - case BOTH: return "An address that is both physical and postal."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case POSTAL: return "Postal"; - case PHYSICAL: return "Physical"; - case BOTH: return "Postal & Physical"; - default: return "?"; - } - } - } - - public static class AddressTypeEnumFactory implements EnumFactory { - public AddressType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("postal".equals(codeString)) - return AddressType.POSTAL; - if ("physical".equals(codeString)) - return AddressType.PHYSICAL; - if ("both".equals(codeString)) - return AddressType.BOTH; - throw new IllegalArgumentException("Unknown AddressType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("postal".equals(codeString)) - return new Enumeration(this, AddressType.POSTAL); - if ("physical".equals(codeString)) - return new Enumeration(this, AddressType.PHYSICAL); - if ("both".equals(codeString)) - return new Enumeration(this, AddressType.BOTH); - throw new FHIRException("Unknown AddressType code '"+codeString+"'"); - } - public String toCode(AddressType code) { - if (code == AddressType.POSTAL) - return "postal"; - if (code == AddressType.PHYSICAL) - return "physical"; - if (code == AddressType.BOTH) - return "both"; - return "?"; - } - public String toSystem(AddressType code) { - return code.getSystem(); - } - } - - /** - * The purpose of this address. - */ - @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="home | work | temp | old - purpose of this address", formalDefinition="The purpose of this address." ) - protected Enumeration use; - - /** - * Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="postal | physical | both", formalDefinition="Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both." ) - protected Enumeration type; - - /** - * A full text representation of the address. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Text representation of the address", formalDefinition="A full text representation of the address." ) - protected StringType text; - - /** - * This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information. - */ - @Child(name = "line", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Street name, number, direction & P.O. Box etc.", formalDefinition="This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information." ) - protected List line; - - /** - * The name of the city, town, village or other community or delivery center. - */ - @Child(name = "city", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of city, town etc.", formalDefinition="The name of the city, town, village or other community or delivery center." ) - protected StringType city; - - /** - * The name of the administrative area (county). - */ - @Child(name = "district", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="District name (aka county)", formalDefinition="The name of the administrative area (county)." ) - protected StringType district; - - /** - * Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - @Child(name = "state", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Sub-unit of country (abbreviations ok)", formalDefinition="Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes)." ) - protected StringType state; - - /** - * A postal code designating a region defined by the postal service. - */ - @Child(name = "postalCode", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Postal code for area", formalDefinition="A postal code designating a region defined by the postal service." ) - protected StringType postalCode; - - /** - * Country - a nation as commonly understood or generally accepted. - */ - @Child(name = "country", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Country (can be ISO 3166 3 letter code)", formalDefinition="Country - a nation as commonly understood or generally accepted." ) - protected StringType country; - - /** - * Time period when address was/is in use. - */ - @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period when address was/is in use", formalDefinition="Time period when address was/is in use." ) - protected Period period; - - private static final long serialVersionUID = 561490318L; - - /** - * Constructor - */ - public Address() { - super(); - } - - /** - * @return {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new AddressUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (The purpose of this address.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Address setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return The purpose of this address. - */ - public AddressUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value The purpose of this address. - */ - public Address setUse(AddressUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new AddressUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new AddressTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Address setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. - */ - public AddressType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both. - */ - public Address setType(AddressType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new AddressTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A full text representation of the address.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public Address setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A full text representation of the address. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A full text representation of the address. - */ - public Address setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) - */ - public List getLine() { - if (this.line == null) - this.line = new ArrayList(); - return this.line; - } - - public boolean hasLine() { - if (this.line == null) - return false; - for (StringType item : this.line) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) - */ - // syntactic sugar - public StringType addLineElement() {//2 - StringType t = new StringType(); - if (this.line == null) - this.line = new ArrayList(); - this.line.add(t); - return t; - } - - /** - * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) - */ - public Address addLine(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.line == null) - this.line = new ArrayList(); - this.line.add(t); - return this; - } - - /** - * @param value {@link #line} (This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.) - */ - public boolean hasLine(String value) { - if (this.line == null) - return false; - for (StringType v : this.line) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value - */ - public StringType getCityElement() { - if (this.city == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.city"); - else if (Configuration.doAutoCreate()) - this.city = new StringType(); // bb - return this.city; - } - - public boolean hasCityElement() { - return this.city != null && !this.city.isEmpty(); - } - - public boolean hasCity() { - return this.city != null && !this.city.isEmpty(); - } - - /** - * @param value {@link #city} (The name of the city, town, village or other community or delivery center.). This is the underlying object with id, value and extensions. The accessor "getCity" gives direct access to the value - */ - public Address setCityElement(StringType value) { - this.city = value; - return this; - } - - /** - * @return The name of the city, town, village or other community or delivery center. - */ - public String getCity() { - return this.city == null ? null : this.city.getValue(); - } - - /** - * @param value The name of the city, town, village or other community or delivery center. - */ - public Address setCity(String value) { - if (Utilities.noString(value)) - this.city = null; - else { - if (this.city == null) - this.city = new StringType(); - this.city.setValue(value); - } - return this; - } - - /** - * @return {@link #district} (The name of the administrative area (county).). This is the underlying object with id, value and extensions. The accessor "getDistrict" gives direct access to the value - */ - public StringType getDistrictElement() { - if (this.district == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.district"); - else if (Configuration.doAutoCreate()) - this.district = new StringType(); // bb - return this.district; - } - - public boolean hasDistrictElement() { - return this.district != null && !this.district.isEmpty(); - } - - public boolean hasDistrict() { - return this.district != null && !this.district.isEmpty(); - } - - /** - * @param value {@link #district} (The name of the administrative area (county).). This is the underlying object with id, value and extensions. The accessor "getDistrict" gives direct access to the value - */ - public Address setDistrictElement(StringType value) { - this.district = value; - return this; - } - - /** - * @return The name of the administrative area (county). - */ - public String getDistrict() { - return this.district == null ? null : this.district.getValue(); - } - - /** - * @param value The name of the administrative area (county). - */ - public Address setDistrict(String value) { - if (Utilities.noString(value)) - this.district = null; - else { - if (this.district == null) - this.district = new StringType(); - this.district.setValue(value); - } - return this; - } - - /** - * @return {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public StringType getStateElement() { - if (this.state == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.state"); - else if (Configuration.doAutoCreate()) - this.state = new StringType(); // bb - return this.state; - } - - public boolean hasStateElement() { - return this.state != null && !this.state.isEmpty(); - } - - public boolean hasState() { - return this.state != null && !this.state.isEmpty(); - } - - /** - * @param value {@link #state} (Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public Address setStateElement(StringType value) { - this.state = value; - return this; - } - - /** - * @return Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - public String getState() { - return this.state == null ? null : this.state.getValue(); - } - - /** - * @param value Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes). - */ - public Address setState(String value) { - if (Utilities.noString(value)) - this.state = null; - else { - if (this.state == null) - this.state = new StringType(); - this.state.setValue(value); - } - return this; - } - - /** - * @return {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value - */ - public StringType getPostalCodeElement() { - if (this.postalCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.postalCode"); - else if (Configuration.doAutoCreate()) - this.postalCode = new StringType(); // bb - return this.postalCode; - } - - public boolean hasPostalCodeElement() { - return this.postalCode != null && !this.postalCode.isEmpty(); - } - - public boolean hasPostalCode() { - return this.postalCode != null && !this.postalCode.isEmpty(); - } - - /** - * @param value {@link #postalCode} (A postal code designating a region defined by the postal service.). This is the underlying object with id, value and extensions. The accessor "getPostalCode" gives direct access to the value - */ - public Address setPostalCodeElement(StringType value) { - this.postalCode = value; - return this; - } - - /** - * @return A postal code designating a region defined by the postal service. - */ - public String getPostalCode() { - return this.postalCode == null ? null : this.postalCode.getValue(); - } - - /** - * @param value A postal code designating a region defined by the postal service. - */ - public Address setPostalCode(String value) { - if (Utilities.noString(value)) - this.postalCode = null; - else { - if (this.postalCode == null) - this.postalCode = new StringType(); - this.postalCode.setValue(value); - } - return this; - } - - /** - * @return {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public StringType getCountryElement() { - if (this.country == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.country"); - else if (Configuration.doAutoCreate()) - this.country = new StringType(); // bb - return this.country; - } - - public boolean hasCountryElement() { - return this.country != null && !this.country.isEmpty(); - } - - public boolean hasCountry() { - return this.country != null && !this.country.isEmpty(); - } - - /** - * @param value {@link #country} (Country - a nation as commonly understood or generally accepted.). This is the underlying object with id, value and extensions. The accessor "getCountry" gives direct access to the value - */ - public Address setCountryElement(StringType value) { - this.country = value; - return this; - } - - /** - * @return Country - a nation as commonly understood or generally accepted. - */ - public String getCountry() { - return this.country == null ? null : this.country.getValue(); - } - - /** - * @param value Country - a nation as commonly understood or generally accepted. - */ - public Address setCountry(String value) { - if (Utilities.noString(value)) - this.country = null; - else { - if (this.country == null) - this.country = new StringType(); - this.country.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period when address was/is in use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Address.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period when address was/is in use.) - */ - public Address setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "The purpose of this address.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("type", "code", "Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "A full text representation of the address.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("line", "string", "This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.", 0, java.lang.Integer.MAX_VALUE, line)); - childrenList.add(new Property("city", "string", "The name of the city, town, village or other community or delivery center.", 0, java.lang.Integer.MAX_VALUE, city)); - childrenList.add(new Property("district", "string", "The name of the administrative area (county).", 0, java.lang.Integer.MAX_VALUE, district)); - childrenList.add(new Property("state", "string", "Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (i.e. US 2 letter state codes).", 0, java.lang.Integer.MAX_VALUE, state)); - childrenList.add(new Property("postalCode", "string", "A postal code designating a region defined by the postal service.", 0, java.lang.Integer.MAX_VALUE, postalCode)); - childrenList.add(new Property("country", "string", "Country - a nation as commonly understood or generally accepted.", 0, java.lang.Integer.MAX_VALUE, country)); - childrenList.add(new Property("period", "Period", "Time period when address was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case 3321844: /*line*/ return this.line == null ? new Base[0] : this.line.toArray(new Base[this.line.size()]); // StringType - case 3053931: /*city*/ return this.city == null ? new Base[0] : new Base[] {this.city}; // StringType - case 288961422: /*district*/ return this.district == null ? new Base[0] : new Base[] {this.district}; // StringType - case 109757585: /*state*/ return this.state == null ? new Base[0] : new Base[] {this.state}; // StringType - case 2011152728: /*postalCode*/ return this.postalCode == null ? new Base[0] : new Base[] {this.postalCode}; // StringType - case 957831062: /*country*/ return this.country == null ? new Base[0] : new Base[] {this.country}; // StringType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116103: // use - this.use = new AddressUseEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = new AddressTypeEnumFactory().fromType(value); // Enumeration - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - case 3321844: // line - this.getLine().add(castToString(value)); // StringType - break; - case 3053931: // city - this.city = castToString(value); // StringType - break; - case 288961422: // district - this.district = castToString(value); // StringType - break; - case 109757585: // state - this.state = castToString(value); // StringType - break; - case 2011152728: // postalCode - this.postalCode = castToString(value); // StringType - break; - case 957831062: // country - this.country = castToString(value); // StringType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("use")) - this.use = new AddressUseEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = new AddressTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("line")) - this.getLine().add(castToString(value)); - else if (name.equals("city")) - this.city = castToString(value); // StringType - else if (name.equals("district")) - this.district = castToString(value); // StringType - else if (name.equals("state")) - this.state = castToString(value); // StringType - else if (name.equals("postalCode")) - this.postalCode = castToString(value); // StringType - else if (name.equals("country")) - this.country = castToString(value); // StringType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case 3321844: throw new FHIRException("Cannot make property line as it is not a complex type"); // StringType - case 3053931: throw new FHIRException("Cannot make property city as it is not a complex type"); // StringType - case 288961422: throw new FHIRException("Cannot make property district as it is not a complex type"); // StringType - case 109757585: throw new FHIRException("Cannot make property state as it is not a complex type"); // StringType - case 2011152728: throw new FHIRException("Cannot make property postalCode as it is not a complex type"); // StringType - case 957831062: throw new FHIRException("Cannot make property country as it is not a complex type"); // StringType - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.use"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.type"); - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.text"); - } - else if (name.equals("line")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.line"); - } - else if (name.equals("city")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.city"); - } - else if (name.equals("district")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.district"); - } - else if (name.equals("state")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.state"); - } - else if (name.equals("postalCode")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.postalCode"); - } - else if (name.equals("country")) { - throw new FHIRException("Cannot call addChild on a primitive type Address.country"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Address"; - - } - - public Address copy() { - Address dst = new Address(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - if (line != null) { - dst.line = new ArrayList(); - for (StringType i : line) - dst.line.add(i.copy()); - }; - dst.city = city == null ? null : city.copy(); - dst.district = district == null ? null : district.copy(); - dst.state = state == null ? null : state.copy(); - dst.postalCode = postalCode == null ? null : postalCode.copy(); - dst.country = country == null ? null : country.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected Address typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Address)) - return false; - Address o = (Address) other; - return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) - && compareDeep(line, o.line, true) && compareDeep(city, o.city, true) && compareDeep(district, o.district, true) - && compareDeep(state, o.state, true) && compareDeep(postalCode, o.postalCode, true) && compareDeep(country, o.country, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Address)) - return false; - Address o = (Address) other; - return compareValues(use, o.use, true) && compareValues(type, o.type, true) && compareValues(text, o.text, true) - && compareValues(line, o.line, true) && compareValues(city, o.city, true) && compareValues(district, o.district, true) - && compareValues(state, o.state, true) && compareValues(postalCode, o.postalCode, true) && compareValues(country, o.country, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (type == null || type.isEmpty()) - && (text == null || text.isEmpty()) && (line == null || line.isEmpty()) && (city == null || city.isEmpty()) - && (district == null || district.isEmpty()) && (state == null || state.isEmpty()) && (postalCode == null || postalCode.isEmpty()) - && (country == null || country.isEmpty()) && (period == null || period.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Age.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Age.java deleted file mode 100644 index daa51239c46..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Age.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Age", profileOf=Quantity.class) -public class Age extends Quantity { - - private static final long serialVersionUID = 1069574054L; - - public Age copy() { - Age dst = new Age(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Age typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Age)) - return false; - Age o = (Age) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Age)) - return false; - Age o = (Age) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java deleted file mode 100644 index 9d2ea13b801..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AllergyIntolerance.java +++ /dev/null @@ -1,2653 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. - */ -@ResourceDef(name="AllergyIntolerance", profile="http://hl7.org/fhir/Profile/AllergyIntolerance") -public class AllergyIntolerance extends DomainResource { - - public enum AllergyIntoleranceStatus { - /** - * An active record of a reaction to the identified Substance. - */ - ACTIVE, - /** - * A low level of certainty about the propensity for a reaction to the identified Substance. - */ - UNCONFIRMED, - /** - * A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge. - */ - CONFIRMED, - /** - * An inactive record of a reaction to the identified Substance. - */ - INACTIVE, - /** - * A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved. - */ - RESOLVED, - /** - * A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted. - */ - REFUTED, - /** - * The statement was entered in error and is not valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("unconfirmed".equals(codeString)) - return UNCONFIRMED; - if ("confirmed".equals(codeString)) - return CONFIRMED; - if ("inactive".equals(codeString)) - return INACTIVE; - if ("resolved".equals(codeString)) - return RESOLVED; - if ("refuted".equals(codeString)) - return REFUTED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case UNCONFIRMED: return "unconfirmed"; - case CONFIRMED: return "confirmed"; - case INACTIVE: return "inactive"; - case RESOLVED: return "resolved"; - case REFUTED: return "refuted"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return "http://hl7.org/fhir/allergy-intolerance-status"; - case UNCONFIRMED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case CONFIRMED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case INACTIVE: return "http://hl7.org/fhir/allergy-intolerance-status"; - case RESOLVED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case REFUTED: return "http://hl7.org/fhir/allergy-intolerance-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/allergy-intolerance-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "An active record of a reaction to the identified Substance."; - case UNCONFIRMED: return "A low level of certainty about the propensity for a reaction to the identified Substance."; - case CONFIRMED: return "A high level of certainty about the propensity for a reaction to the identified Substance, which may include clinical evidence by testing or rechallenge."; - case INACTIVE: return "An inactive record of a reaction to the identified Substance."; - case RESOLVED: return "A reaction to the identified Substance has been clinically reassessed by testing or rechallenge and considered to be resolved."; - case REFUTED: return "A propensity for a reaction to the identified Substance has been disproven with a high level of clinical certainty, which may include testing or rechallenge, and is refuted."; - case ENTEREDINERROR: return "The statement was entered in error and is not valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case UNCONFIRMED: return "Unconfirmed"; - case CONFIRMED: return "Confirmed"; - case INACTIVE: return "Inactive"; - case RESOLVED: return "Resolved"; - case REFUTED: return "Refuted"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceStatusEnumFactory implements EnumFactory { - public AllergyIntoleranceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return AllergyIntoleranceStatus.ACTIVE; - if ("unconfirmed".equals(codeString)) - return AllergyIntoleranceStatus.UNCONFIRMED; - if ("confirmed".equals(codeString)) - return AllergyIntoleranceStatus.CONFIRMED; - if ("inactive".equals(codeString)) - return AllergyIntoleranceStatus.INACTIVE; - if ("resolved".equals(codeString)) - return AllergyIntoleranceStatus.RESOLVED; - if ("refuted".equals(codeString)) - return AllergyIntoleranceStatus.REFUTED; - if ("entered-in-error".equals(codeString)) - return AllergyIntoleranceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.ACTIVE); - if ("unconfirmed".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.UNCONFIRMED); - if ("confirmed".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.CONFIRMED); - if ("inactive".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.INACTIVE); - if ("resolved".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.RESOLVED); - if ("refuted".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.REFUTED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceStatus.ENTEREDINERROR); - throw new FHIRException("Unknown AllergyIntoleranceStatus code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceStatus code) { - if (code == AllergyIntoleranceStatus.ACTIVE) - return "active"; - if (code == AllergyIntoleranceStatus.UNCONFIRMED) - return "unconfirmed"; - if (code == AllergyIntoleranceStatus.CONFIRMED) - return "confirmed"; - if (code == AllergyIntoleranceStatus.INACTIVE) - return "inactive"; - if (code == AllergyIntoleranceStatus.RESOLVED) - return "resolved"; - if (code == AllergyIntoleranceStatus.REFUTED) - return "refuted"; - if (code == AllergyIntoleranceStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(AllergyIntoleranceStatus code) { - return code.getSystem(); - } - } - - public enum AllergyIntoleranceType { - /** - * A propensity for hypersensitivity reaction(s) to a substance. These reactions are most typically type I hypersensitivity, plus other "allergy-like" reactions, including pseudoallergy. - */ - ALLERGY, - /** - * A propensity for adverse reactions to a substance that is not judged to be allergic or "allergy-like". These reactions are typically (but not necessarily) non-immune. They are to some degree idiosyncratic and/or individually specific (i.e. are not a reaction that is expected to occur with most or all patients given similar circumstances). - */ - INTOLERANCE, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("allergy".equals(codeString)) - return ALLERGY; - if ("intolerance".equals(codeString)) - return INTOLERANCE; - throw new FHIRException("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ALLERGY: return "allergy"; - case INTOLERANCE: return "intolerance"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ALLERGY: return "http://hl7.org/fhir/allergy-intolerance-type"; - case INTOLERANCE: return "http://hl7.org/fhir/allergy-intolerance-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ALLERGY: return "A propensity for hypersensitivity reaction(s) to a substance. These reactions are most typically type I hypersensitivity, plus other \"allergy-like\" reactions, including pseudoallergy."; - case INTOLERANCE: return "A propensity for adverse reactions to a substance that is not judged to be allergic or \"allergy-like\". These reactions are typically (but not necessarily) non-immune. They are to some degree idiosyncratic and/or individually specific (i.e. are not a reaction that is expected to occur with most or all patients given similar circumstances)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ALLERGY: return "Allergy"; - case INTOLERANCE: return "Intolerance"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceTypeEnumFactory implements EnumFactory { - public AllergyIntoleranceType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("allergy".equals(codeString)) - return AllergyIntoleranceType.ALLERGY; - if ("intolerance".equals(codeString)) - return AllergyIntoleranceType.INTOLERANCE; - throw new IllegalArgumentException("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("allergy".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceType.ALLERGY); - if ("intolerance".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceType.INTOLERANCE); - throw new FHIRException("Unknown AllergyIntoleranceType code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceType code) { - if (code == AllergyIntoleranceType.ALLERGY) - return "allergy"; - if (code == AllergyIntoleranceType.INTOLERANCE) - return "intolerance"; - return "?"; - } - public String toSystem(AllergyIntoleranceType code) { - return code.getSystem(); - } - } - - public enum AllergyIntoleranceCategory { - /** - * Any substance consumed to provide nutritional support for the body. - */ - FOOD, - /** - * Substances administered to achieve a physiological effect. - */ - MEDICATION, - /** - * Substances that are encountered in the environment. - */ - ENVIRONMENT, - /** - * Other substances that are not covered by any other category. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceCategory fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("food".equals(codeString)) - return FOOD; - if ("medication".equals(codeString)) - return MEDICATION; - if ("environment".equals(codeString)) - return ENVIRONMENT; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case FOOD: return "food"; - case MEDICATION: return "medication"; - case ENVIRONMENT: return "environment"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FOOD: return "http://hl7.org/fhir/allergy-intolerance-category"; - case MEDICATION: return "http://hl7.org/fhir/allergy-intolerance-category"; - case ENVIRONMENT: return "http://hl7.org/fhir/allergy-intolerance-category"; - case OTHER: return "http://hl7.org/fhir/allergy-intolerance-category"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FOOD: return "Any substance consumed to provide nutritional support for the body."; - case MEDICATION: return "Substances administered to achieve a physiological effect."; - case ENVIRONMENT: return "Substances that are encountered in the environment."; - case OTHER: return "Other substances that are not covered by any other category."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FOOD: return "Food"; - case MEDICATION: return "Medication"; - case ENVIRONMENT: return "Environment"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceCategoryEnumFactory implements EnumFactory { - public AllergyIntoleranceCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("food".equals(codeString)) - return AllergyIntoleranceCategory.FOOD; - if ("medication".equals(codeString)) - return AllergyIntoleranceCategory.MEDICATION; - if ("environment".equals(codeString)) - return AllergyIntoleranceCategory.ENVIRONMENT; - if ("other".equals(codeString)) - return AllergyIntoleranceCategory.OTHER; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("food".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCategory.FOOD); - if ("medication".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCategory.MEDICATION); - if ("environment".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCategory.ENVIRONMENT); - if ("other".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCategory.OTHER); - throw new FHIRException("Unknown AllergyIntoleranceCategory code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceCategory code) { - if (code == AllergyIntoleranceCategory.FOOD) - return "food"; - if (code == AllergyIntoleranceCategory.MEDICATION) - return "medication"; - if (code == AllergyIntoleranceCategory.ENVIRONMENT) - return "environment"; - if (code == AllergyIntoleranceCategory.OTHER) - return "other"; - return "?"; - } - public String toSystem(AllergyIntoleranceCategory code) { - return code.getSystem(); - } - } - - public enum AllergyIntoleranceCriticality { - /** - * Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ system failure. - */ - LOW, - /** - * Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ system failure. - */ - HIGH, - /** - * Unable to assess the worst case result of a future exposure. - */ - UNABLETOASSESS, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceCriticality fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return LOW; - if ("high".equals(codeString)) - return HIGH; - if ("unable-to-assess".equals(codeString)) - return UNABLETOASSESS; - throw new FHIRException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LOW: return "low"; - case HIGH: return "high"; - case UNABLETOASSESS: return "unable-to-assess"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LOW: return "http://hl7.org/fhir/allergy-intolerance-criticality"; - case HIGH: return "http://hl7.org/fhir/allergy-intolerance-criticality"; - case UNABLETOASSESS: return "http://hl7.org/fhir/allergy-intolerance-criticality"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LOW: return "Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ system failure."; - case HIGH: return "Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ system failure."; - case UNABLETOASSESS: return "Unable to assess the worst case result of a future exposure."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LOW: return "Low Risk"; - case HIGH: return "High Risk"; - case UNABLETOASSESS: return "Unable to Assess Risk"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceCriticalityEnumFactory implements EnumFactory { - public AllergyIntoleranceCriticality fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return AllergyIntoleranceCriticality.LOW; - if ("high".equals(codeString)) - return AllergyIntoleranceCriticality.HIGH; - if ("unable-to-assess".equals(codeString)) - return AllergyIntoleranceCriticality.UNABLETOASSESS; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCriticality.LOW); - if ("high".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCriticality.HIGH); - if ("unable-to-assess".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCriticality.UNABLETOASSESS); - throw new FHIRException("Unknown AllergyIntoleranceCriticality code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceCriticality code) { - if (code == AllergyIntoleranceCriticality.LOW) - return "low"; - if (code == AllergyIntoleranceCriticality.HIGH) - return "high"; - if (code == AllergyIntoleranceCriticality.UNABLETOASSESS) - return "unable-to-assess"; - return "?"; - } - public String toSystem(AllergyIntoleranceCriticality code) { - return code.getSystem(); - } - } - - public enum AllergyIntoleranceCertainty { - /** - * There is a low level of clinical certainty that the reaction was caused by the identified Substance. - */ - UNLIKELY, - /** - * There is a high level of clinical certainty that the reaction was caused by the identified Substance. - */ - LIKELY, - /** - * There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge. - */ - CONFIRMED, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceCertainty fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("unlikely".equals(codeString)) - return UNLIKELY; - if ("likely".equals(codeString)) - return LIKELY; - if ("confirmed".equals(codeString)) - return CONFIRMED; - throw new FHIRException("Unknown AllergyIntoleranceCertainty code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UNLIKELY: return "unlikely"; - case LIKELY: return "likely"; - case CONFIRMED: return "confirmed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNLIKELY: return "http://hl7.org/fhir/reaction-event-certainty"; - case LIKELY: return "http://hl7.org/fhir/reaction-event-certainty"; - case CONFIRMED: return "http://hl7.org/fhir/reaction-event-certainty"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNLIKELY: return "There is a low level of clinical certainty that the reaction was caused by the identified Substance."; - case LIKELY: return "There is a high level of clinical certainty that the reaction was caused by the identified Substance."; - case CONFIRMED: return "There is a very high level of clinical certainty that the reaction was due to the identified Substance, which may include clinical evidence by testing or rechallenge."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNLIKELY: return "Unlikely"; - case LIKELY: return "Likely"; - case CONFIRMED: return "Confirmed"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceCertaintyEnumFactory implements EnumFactory { - public AllergyIntoleranceCertainty fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unlikely".equals(codeString)) - return AllergyIntoleranceCertainty.UNLIKELY; - if ("likely".equals(codeString)) - return AllergyIntoleranceCertainty.LIKELY; - if ("confirmed".equals(codeString)) - return AllergyIntoleranceCertainty.CONFIRMED; - throw new IllegalArgumentException("Unknown AllergyIntoleranceCertainty code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("unlikely".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCertainty.UNLIKELY); - if ("likely".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCertainty.LIKELY); - if ("confirmed".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceCertainty.CONFIRMED); - throw new FHIRException("Unknown AllergyIntoleranceCertainty code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceCertainty code) { - if (code == AllergyIntoleranceCertainty.UNLIKELY) - return "unlikely"; - if (code == AllergyIntoleranceCertainty.LIKELY) - return "likely"; - if (code == AllergyIntoleranceCertainty.CONFIRMED) - return "confirmed"; - return "?"; - } - public String toSystem(AllergyIntoleranceCertainty code) { - return code.getSystem(); - } - } - - public enum AllergyIntoleranceSeverity { - /** - * Causes mild physiological effects. - */ - MILD, - /** - * Causes moderate physiological effects. - */ - MODERATE, - /** - * Causes severe physiological effects. - */ - SEVERE, - /** - * added to help the parsers - */ - NULL; - public static AllergyIntoleranceSeverity fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("mild".equals(codeString)) - return MILD; - if ("moderate".equals(codeString)) - return MODERATE; - if ("severe".equals(codeString)) - return SEVERE; - throw new FHIRException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MILD: return "mild"; - case MODERATE: return "moderate"; - case SEVERE: return "severe"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MILD: return "http://hl7.org/fhir/reaction-event-severity"; - case MODERATE: return "http://hl7.org/fhir/reaction-event-severity"; - case SEVERE: return "http://hl7.org/fhir/reaction-event-severity"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MILD: return "Causes mild physiological effects."; - case MODERATE: return "Causes moderate physiological effects."; - case SEVERE: return "Causes severe physiological effects."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MILD: return "Mild"; - case MODERATE: return "Moderate"; - case SEVERE: return "Severe"; - default: return "?"; - } - } - } - - public static class AllergyIntoleranceSeverityEnumFactory implements EnumFactory { - public AllergyIntoleranceSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("mild".equals(codeString)) - return AllergyIntoleranceSeverity.MILD; - if ("moderate".equals(codeString)) - return AllergyIntoleranceSeverity.MODERATE; - if ("severe".equals(codeString)) - return AllergyIntoleranceSeverity.SEVERE; - throw new IllegalArgumentException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("mild".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceSeverity.MILD); - if ("moderate".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceSeverity.MODERATE); - if ("severe".equals(codeString)) - return new Enumeration(this, AllergyIntoleranceSeverity.SEVERE); - throw new FHIRException("Unknown AllergyIntoleranceSeverity code '"+codeString+"'"); - } - public String toCode(AllergyIntoleranceSeverity code) { - if (code == AllergyIntoleranceSeverity.MILD) - return "mild"; - if (code == AllergyIntoleranceSeverity.MODERATE) - return "moderate"; - if (code == AllergyIntoleranceSeverity.SEVERE) - return "severe"; - return "?"; - } - public String toSystem(AllergyIntoleranceSeverity code) { - return code.getSystem(); - } - } - - @Block() - public static class AllergyIntoleranceReactionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance. - */ - @Child(name = "substance", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific substance considered to be responsible for event", formalDefinition="Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance." ) - protected CodeableConcept substance; - - /** - * Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event. - */ - @Child(name = "certainty", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="unlikely | likely | confirmed - clinical certainty about the specific substance", formalDefinition="Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event." ) - protected Enumeration certainty; - - /** - * Clinical symptoms and/or signs that are observed or associated with the adverse reaction event. - */ - @Child(name = "manifestation", type = {CodeableConcept.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Clinical symptoms/signs associated with the Event", formalDefinition="Clinical symptoms and/or signs that are observed or associated with the adverse reaction event." ) - protected List manifestation; - - /** - * Text description about the reaction as a whole, including details of the manifestation if required. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description of the event as a whole", formalDefinition="Text description about the reaction as a whole, including details of the manifestation if required." ) - protected StringType description; - - /** - * Record of the date and/or time of the onset of the Reaction. - */ - @Child(name = "onset", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Reaction." ) - protected DateTimeType onset; - - /** - * Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - @Child(name = "severity", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="mild | moderate | severe (of event as a whole)", formalDefinition="Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations." ) - protected Enumeration severity; - - /** - * Identification of the route by which the subject was exposed to the substance. - */ - @Child(name = "exposureRoute", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How the subject was exposed to the substance", formalDefinition="Identification of the route by which the subject was exposed to the substance." ) - protected CodeableConcept exposureRoute; - - /** - * Additional text about the adverse reaction event not captured in other fields. - */ - @Child(name = "note", type = {Annotation.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Text about event not captured in other fields", formalDefinition="Additional text about the adverse reaction event not captured in other fields." ) - protected List note; - - private static final long serialVersionUID = -31700461L; - - /** - * Constructor - */ - public AllergyIntoleranceReactionComponent() { - super(); - } - - /** - * @return {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) - */ - public CodeableConcept getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new CodeableConcept(); // cc - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.) - */ - public AllergyIntoleranceReactionComponent setSubstance(CodeableConcept value) { - this.substance = value; - return this; - } - - /** - * @return {@link #certainty} (Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value - */ - public Enumeration getCertaintyElement() { - if (this.certainty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.certainty"); - else if (Configuration.doAutoCreate()) - this.certainty = new Enumeration(new AllergyIntoleranceCertaintyEnumFactory()); // bb - return this.certainty; - } - - public boolean hasCertaintyElement() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - public boolean hasCertainty() { - return this.certainty != null && !this.certainty.isEmpty(); - } - - /** - * @param value {@link #certainty} (Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event.). This is the underlying object with id, value and extensions. The accessor "getCertainty" gives direct access to the value - */ - public AllergyIntoleranceReactionComponent setCertaintyElement(Enumeration value) { - this.certainty = value; - return this; - } - - /** - * @return Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event. - */ - public AllergyIntoleranceCertainty getCertainty() { - return this.certainty == null ? null : this.certainty.getValue(); - } - - /** - * @param value Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event. - */ - public AllergyIntoleranceReactionComponent setCertainty(AllergyIntoleranceCertainty value) { - if (value == null) - this.certainty = null; - else { - if (this.certainty == null) - this.certainty = new Enumeration(new AllergyIntoleranceCertaintyEnumFactory()); - this.certainty.setValue(value); - } - return this; - } - - /** - * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.) - */ - public List getManifestation() { - if (this.manifestation == null) - this.manifestation = new ArrayList(); - return this.manifestation; - } - - public boolean hasManifestation() { - if (this.manifestation == null) - return false; - for (CodeableConcept item : this.manifestation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #manifestation} (Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.) - */ - // syntactic sugar - public CodeableConcept addManifestation() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.manifestation == null) - this.manifestation = new ArrayList(); - this.manifestation.add(t); - return t; - } - - // syntactic sugar - public AllergyIntoleranceReactionComponent addManifestation(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.manifestation == null) - this.manifestation = new ArrayList(); - this.manifestation.add(t); - return this; - } - - /** - * @return {@link #description} (Text description about the reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text description about the reaction as a whole, including details of the manifestation if required.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public AllergyIntoleranceReactionComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description about the reaction as a whole, including details of the manifestation if required. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description about the reaction as a whole, including details of the manifestation if required. - */ - public AllergyIntoleranceReactionComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public DateTimeType getOnsetElement() { - if (this.onset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.onset"); - else if (Configuration.doAutoCreate()) - this.onset = new DateTimeType(); // bb - return this.onset; - } - - public boolean hasOnsetElement() { - return this.onset != null && !this.onset.isEmpty(); - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Record of the date and/or time of the onset of the Reaction.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public AllergyIntoleranceReactionComponent setOnsetElement(DateTimeType value) { - this.onset = value; - return this; - } - - /** - * @return Record of the date and/or time of the onset of the Reaction. - */ - public Date getOnset() { - return this.onset == null ? null : this.onset.getValue(); - } - - /** - * @param value Record of the date and/or time of the onset of the Reaction. - */ - public AllergyIntoleranceReactionComponent setOnset(Date value) { - if (value == null) - this.onset = null; - else { - if (this.onset == null) - this.onset = new DateTimeType(); - this.onset.setValue(value); - } - return this; - } - - /** - * @return {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new AllergyIntoleranceSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public AllergyIntoleranceReactionComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - public AllergyIntoleranceSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations. - */ - public AllergyIntoleranceReactionComponent setSeverity(AllergyIntoleranceSeverity value) { - if (value == null) - this.severity = null; - else { - if (this.severity == null) - this.severity = new Enumeration(new AllergyIntoleranceSeverityEnumFactory()); - this.severity.setValue(value); - } - return this; - } - - /** - * @return {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) - */ - public CodeableConcept getExposureRoute() { - if (this.exposureRoute == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntoleranceReactionComponent.exposureRoute"); - else if (Configuration.doAutoCreate()) - this.exposureRoute = new CodeableConcept(); // cc - return this.exposureRoute; - } - - public boolean hasExposureRoute() { - return this.exposureRoute != null && !this.exposureRoute.isEmpty(); - } - - /** - * @param value {@link #exposureRoute} (Identification of the route by which the subject was exposed to the substance.) - */ - public AllergyIntoleranceReactionComponent setExposureRoute(CodeableConcept value) { - this.exposureRoute = value; - return this; - } - - /** - * @return {@link #note} (Additional text about the adverse reaction event not captured in other fields.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Additional text about the adverse reaction event not captured in other fields.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public AllergyIntoleranceReactionComponent addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("substance", "CodeableConcept", "Identification of the specific substance considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different to the substance identified as the cause of the risk, but must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite substance that includes the identified substance. It must be clinically safe to only process the AllergyIntolerance.substance and ignore the AllergyIntolerance.event.substance.", 0, java.lang.Integer.MAX_VALUE, substance)); - childrenList.add(new Property("certainty", "code", "Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation in this reaction event.", 0, java.lang.Integer.MAX_VALUE, certainty)); - childrenList.add(new Property("manifestation", "CodeableConcept", "Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.", 0, java.lang.Integer.MAX_VALUE, manifestation)); - childrenList.add(new Property("description", "string", "Text description about the reaction as a whole, including details of the manifestation if required.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Reaction.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("severity", "code", "Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("exposureRoute", "CodeableConcept", "Identification of the route by which the subject was exposed to the substance.", 0, java.lang.Integer.MAX_VALUE, exposureRoute)); - childrenList.add(new Property("note", "Annotation", "Additional text about the adverse reaction event not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept - case -1404142937: /*certainty*/ return this.certainty == null ? new Base[0] : new Base[] {this.certainty}; // Enumeration - case 1115984422: /*manifestation*/ return this.manifestation == null ? new Base[0] : this.manifestation.toArray(new Base[this.manifestation.size()]); // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DateTimeType - case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration - case 421286274: /*exposureRoute*/ return this.exposureRoute == null ? new Base[0] : new Base[] {this.exposureRoute}; // CodeableConcept - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 530040176: // substance - this.substance = castToCodeableConcept(value); // CodeableConcept - break; - case -1404142937: // certainty - this.certainty = new AllergyIntoleranceCertaintyEnumFactory().fromType(value); // Enumeration - break; - case 1115984422: // manifestation - this.getManifestation().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 105901603: // onset - this.onset = castToDateTime(value); // DateTimeType - break; - case 1478300413: // severity - this.severity = new AllergyIntoleranceSeverityEnumFactory().fromType(value); // Enumeration - break; - case 421286274: // exposureRoute - this.exposureRoute = castToCodeableConcept(value); // CodeableConcept - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("substance")) - this.substance = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("certainty")) - this.certainty = new AllergyIntoleranceCertaintyEnumFactory().fromType(value); // Enumeration - else if (name.equals("manifestation")) - this.getManifestation().add(castToCodeableConcept(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("onset")) - this.onset = castToDateTime(value); // DateTimeType - else if (name.equals("severity")) - this.severity = new AllergyIntoleranceSeverityEnumFactory().fromType(value); // Enumeration - else if (name.equals("exposureRoute")) - this.exposureRoute = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 530040176: return getSubstance(); // CodeableConcept - case -1404142937: throw new FHIRException("Cannot make property certainty as it is not a complex type"); // Enumeration - case 1115984422: return addManifestation(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 105901603: throw new FHIRException("Cannot make property onset as it is not a complex type"); // DateTimeType - case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration - case 421286274: return getExposureRoute(); // CodeableConcept - case 3387378: return addNote(); // Annotation - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("substance")) { - this.substance = new CodeableConcept(); - return this.substance; - } - else if (name.equals("certainty")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.certainty"); - } - else if (name.equals("manifestation")) { - return addManifestation(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.description"); - } - else if (name.equals("onset")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.onset"); - } - else if (name.equals("severity")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.severity"); - } - else if (name.equals("exposureRoute")) { - this.exposureRoute = new CodeableConcept(); - return this.exposureRoute; - } - else if (name.equals("note")) { - return addNote(); - } - else - return super.addChild(name); - } - - public AllergyIntoleranceReactionComponent copy() { - AllergyIntoleranceReactionComponent dst = new AllergyIntoleranceReactionComponent(); - copyValues(dst); - dst.substance = substance == null ? null : substance.copy(); - dst.certainty = certainty == null ? null : certainty.copy(); - if (manifestation != null) { - dst.manifestation = new ArrayList(); - for (CodeableConcept i : manifestation) - dst.manifestation.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.exposureRoute = exposureRoute == null ? null : exposureRoute.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AllergyIntoleranceReactionComponent)) - return false; - AllergyIntoleranceReactionComponent o = (AllergyIntoleranceReactionComponent) other; - return compareDeep(substance, o.substance, true) && compareDeep(certainty, o.certainty, true) && compareDeep(manifestation, o.manifestation, true) - && compareDeep(description, o.description, true) && compareDeep(onset, o.onset, true) && compareDeep(severity, o.severity, true) - && compareDeep(exposureRoute, o.exposureRoute, true) && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AllergyIntoleranceReactionComponent)) - return false; - AllergyIntoleranceReactionComponent o = (AllergyIntoleranceReactionComponent) other; - return compareValues(certainty, o.certainty, true) && compareValues(description, o.description, true) - && compareValues(onset, o.onset, true) && compareValues(severity, o.severity, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (substance == null || substance.isEmpty()) && (certainty == null || certainty.isEmpty()) - && (manifestation == null || manifestation.isEmpty()) && (description == null || description.isEmpty()) - && (onset == null || onset.isEmpty()) && (severity == null || severity.isEmpty()) && (exposureRoute == null || exposureRoute.isEmpty()) - && (note == null || note.isEmpty()); - } - - public String fhirType() { - return "AllergyIntolerance.reaction"; - - } - - } - - /** - * This records identifiers associated with this allergy/intolerance concern 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External ids for this item", formalDefinition="This records identifiers associated with this allergy/intolerance concern 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)." ) - protected List identifier; - - /** - * Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error", formalDefinition="Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance." ) - protected Enumeration status; - - /** - * Identification of the underlying physiological mechanism for the reaction risk. - */ - @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="allergy | intolerance - Underlying mechanism (if known)", formalDefinition="Identification of the underlying physiological mechanism for the reaction risk." ) - protected Enumeration type; - - /** - * Category of the identified Substance. - */ - @Child(name = "category", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="food | medication | environment | other - Category of Substance", formalDefinition="Category of the identified Substance." ) - protected Enumeration category; - - /** - * Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - @Child(name = "criticality", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="low | high | unable-to-assess", formalDefinition="Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance." ) - protected Enumeration criticality; - - /** - * Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk. - */ - @Child(name = "substance", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Substance, (or class) considered to be responsible for risk", formalDefinition="Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk." ) - protected CodeableConcept substance; - - /** - * The patient who has the allergy or intolerance. - */ - @Child(name = "patient", type = {Patient.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who the sensitivity is for", formalDefinition="The patient who has the allergy or intolerance." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who has the allergy or intolerance.) - */ - protected Patient patientTarget; - - /** - * Date when the sensitivity was recorded. - */ - @Child(name = "recordedDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When recorded", formalDefinition="Date when the sensitivity was recorded." ) - protected DateTimeType recordedDate; - - /** - * Individual who recorded the record and takes responsibility for its content. - */ - @Child(name = "recorder", type = {Practitioner.class, Patient.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who recorded the sensitivity", formalDefinition="Individual who recorded the record and takes responsibility for its content." ) - protected Reference recorder; - - /** - * The actual object that is the target of the reference (Individual who recorded the record and takes responsibility for its content.) - */ - protected Resource recorderTarget; - - /** - * The source of the information about the allergy that is recorded. - */ - @Child(name = "reporter", type = {Patient.class, RelatedPerson.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Source of the information about the allergy", formalDefinition="The source of the information about the allergy that is recorded." ) - protected Reference reporter; - - /** - * The actual object that is the target of the reference (The source of the information about the allergy that is recorded.) - */ - protected Resource reporterTarget; - - /** - * Record of the date and/or time of the onset of the Allergy or Intolerance. - */ - @Child(name = "onset", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date(/time) when manifestations showed", formalDefinition="Record of the date and/or time of the onset of the Allergy or Intolerance." ) - protected DateTimeType onset; - - /** - * Represents the date and/or time of the last known occurrence of a reaction event. - */ - @Child(name = "lastOccurence", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date(/time) of last known occurrence of a reaction", formalDefinition="Represents the date and/or time of the last known occurrence of a reaction event." ) - protected DateTimeType lastOccurence; - - /** - * Additional narrative about the propensity for the Adverse Reaction, not captured in other fields. - */ - @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional text not captured in other fields", formalDefinition="Additional narrative about the propensity for the Adverse Reaction, not captured in other fields." ) - protected List note; - - /** - * Details about each adverse reaction event linked to exposure to the identified Substance. - */ - @Child(name = "reaction", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Adverse Reaction Events linked to exposure to substance", formalDefinition="Details about each adverse reaction event linked to exposure to the identified Substance." ) - protected List reaction; - - private static final long serialVersionUID = 278089117L; - - /** - * Constructor - */ - public AllergyIntolerance() { - super(); - } - - /** - * Constructor - */ - public AllergyIntolerance(CodeableConcept substance, Reference patient) { - super(); - this.substance = substance; - this.patient = patient; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this allergy/intolerance concern 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public AllergyIntolerance addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public AllergyIntolerance setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - public AllergyIntoleranceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance. - */ - public AllergyIntolerance setStatus(AllergyIntoleranceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new AllergyIntoleranceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Identification of the underlying physiological mechanism for the reaction risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identification of the underlying physiological mechanism for the reaction risk.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AllergyIntolerance setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identification of the underlying physiological mechanism for the reaction risk. - */ - public AllergyIntoleranceType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identification of the underlying physiological mechanism for the reaction risk. - */ - public AllergyIntolerance setType(AllergyIntoleranceType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new AllergyIntoleranceTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Category of the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public AllergyIntolerance setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Category of the identified Substance. - */ - public AllergyIntoleranceCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Category of the identified Substance. - */ - public AllergyIntolerance setCategory(AllergyIntoleranceCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(new AllergyIntoleranceCategoryEnumFactory()); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value - */ - public Enumeration getCriticalityElement() { - if (this.criticality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.criticality"); - else if (Configuration.doAutoCreate()) - this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); // bb - return this.criticality; - } - - public boolean hasCriticalityElement() { - return this.criticality != null && !this.criticality.isEmpty(); - } - - public boolean hasCriticality() { - return this.criticality != null && !this.criticality.isEmpty(); - } - - /** - * @param value {@link #criticality} (Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.). This is the underlying object with id, value and extensions. The accessor "getCriticality" gives direct access to the value - */ - public AllergyIntolerance setCriticalityElement(Enumeration value) { - this.criticality = value; - return this; - } - - /** - * @return Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - public AllergyIntoleranceCriticality getCriticality() { - return this.criticality == null ? null : this.criticality.getValue(); - } - - /** - * @param value Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance. - */ - public AllergyIntolerance setCriticality(AllergyIntoleranceCriticality value) { - if (value == null) - this.criticality = null; - else { - if (this.criticality == null) - this.criticality = new Enumeration(new AllergyIntoleranceCriticalityEnumFactory()); - this.criticality.setValue(value); - } - return this; - } - - /** - * @return {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk.) - */ - public CodeableConcept getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new CodeableConcept(); // cc - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk.) - */ - public AllergyIntolerance setSubstance(CodeableConcept value) { - this.substance = value; - return this; - } - - /** - * @return {@link #patient} (The patient who has the allergy or intolerance.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient who has the allergy or intolerance.) - */ - public AllergyIntolerance setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who has the allergy or intolerance.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who has the allergy or intolerance.) - */ - public AllergyIntolerance setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value - */ - public DateTimeType getRecordedDateElement() { - if (this.recordedDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.recordedDate"); - else if (Configuration.doAutoCreate()) - this.recordedDate = new DateTimeType(); // bb - return this.recordedDate; - } - - public boolean hasRecordedDateElement() { - return this.recordedDate != null && !this.recordedDate.isEmpty(); - } - - public boolean hasRecordedDate() { - return this.recordedDate != null && !this.recordedDate.isEmpty(); - } - - /** - * @param value {@link #recordedDate} (Date when the sensitivity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedDate" gives direct access to the value - */ - public AllergyIntolerance setRecordedDateElement(DateTimeType value) { - this.recordedDate = value; - return this; - } - - /** - * @return Date when the sensitivity was recorded. - */ - public Date getRecordedDate() { - return this.recordedDate == null ? null : this.recordedDate.getValue(); - } - - /** - * @param value Date when the sensitivity was recorded. - */ - public AllergyIntolerance setRecordedDate(Date value) { - if (value == null) - this.recordedDate = null; - else { - if (this.recordedDate == null) - this.recordedDate = new DateTimeType(); - this.recordedDate.setValue(value); - } - return this; - } - - /** - * @return {@link #recorder} (Individual who recorded the record and takes responsibility for its content.) - */ - public Reference getRecorder() { - if (this.recorder == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.recorder"); - else if (Configuration.doAutoCreate()) - this.recorder = new Reference(); // cc - return this.recorder; - } - - public boolean hasRecorder() { - return this.recorder != null && !this.recorder.isEmpty(); - } - - /** - * @param value {@link #recorder} (Individual who recorded the record and takes responsibility for its content.) - */ - public AllergyIntolerance setRecorder(Reference value) { - this.recorder = value; - return this; - } - - /** - * @return {@link #recorder} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its content.) - */ - public Resource getRecorderTarget() { - return this.recorderTarget; - } - - /** - * @param value {@link #recorder} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual who recorded the record and takes responsibility for its content.) - */ - public AllergyIntolerance setRecorderTarget(Resource value) { - this.recorderTarget = value; - return this; - } - - /** - * @return {@link #reporter} (The source of the information about the allergy that is recorded.) - */ - public Reference getReporter() { - if (this.reporter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.reporter"); - else if (Configuration.doAutoCreate()) - this.reporter = new Reference(); // cc - return this.reporter; - } - - public boolean hasReporter() { - return this.reporter != null && !this.reporter.isEmpty(); - } - - /** - * @param value {@link #reporter} (The source of the information about the allergy that is recorded.) - */ - public AllergyIntolerance setReporter(Reference value) { - this.reporter = value; - return this; - } - - /** - * @return {@link #reporter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The source of the information about the allergy that is recorded.) - */ - public Resource getReporterTarget() { - return this.reporterTarget; - } - - /** - * @param value {@link #reporter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The source of the information about the allergy that is recorded.) - */ - public AllergyIntolerance setReporterTarget(Resource value) { - this.reporterTarget = value; - return this; - } - - /** - * @return {@link #onset} (Record of the date and/or time of the onset of the Allergy or Intolerance.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public DateTimeType getOnsetElement() { - if (this.onset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.onset"); - else if (Configuration.doAutoCreate()) - this.onset = new DateTimeType(); // bb - return this.onset; - } - - public boolean hasOnsetElement() { - return this.onset != null && !this.onset.isEmpty(); - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Record of the date and/or time of the onset of the Allergy or Intolerance.). This is the underlying object with id, value and extensions. The accessor "getOnset" gives direct access to the value - */ - public AllergyIntolerance setOnsetElement(DateTimeType value) { - this.onset = value; - return this; - } - - /** - * @return Record of the date and/or time of the onset of the Allergy or Intolerance. - */ - public Date getOnset() { - return this.onset == null ? null : this.onset.getValue(); - } - - /** - * @param value Record of the date and/or time of the onset of the Allergy or Intolerance. - */ - public AllergyIntolerance setOnset(Date value) { - if (value == null) - this.onset = null; - else { - if (this.onset == null) - this.onset = new DateTimeType(); - this.onset.setValue(value); - } - return this; - } - - /** - * @return {@link #lastOccurence} (Represents the date and/or time of the last known occurrence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value - */ - public DateTimeType getLastOccurenceElement() { - if (this.lastOccurence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AllergyIntolerance.lastOccurence"); - else if (Configuration.doAutoCreate()) - this.lastOccurence = new DateTimeType(); // bb - return this.lastOccurence; - } - - public boolean hasLastOccurenceElement() { - return this.lastOccurence != null && !this.lastOccurence.isEmpty(); - } - - public boolean hasLastOccurence() { - return this.lastOccurence != null && !this.lastOccurence.isEmpty(); - } - - /** - * @param value {@link #lastOccurence} (Represents the date and/or time of the last known occurrence of a reaction event.). This is the underlying object with id, value and extensions. The accessor "getLastOccurence" gives direct access to the value - */ - public AllergyIntolerance setLastOccurenceElement(DateTimeType value) { - this.lastOccurence = value; - return this; - } - - /** - * @return Represents the date and/or time of the last known occurrence of a reaction event. - */ - public Date getLastOccurence() { - return this.lastOccurence == null ? null : this.lastOccurence.getValue(); - } - - /** - * @param value Represents the date and/or time of the last known occurrence of a reaction event. - */ - public AllergyIntolerance setLastOccurence(Date value) { - if (value == null) - this.lastOccurence = null; - else { - if (this.lastOccurence == null) - this.lastOccurence = new DateTimeType(); - this.lastOccurence.setValue(value); - } - return this; - } - - /** - * @return {@link #note} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public AllergyIntolerance addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #reaction} (Details about each adverse reaction event linked to exposure to the identified Substance.) - */ - public List getReaction() { - if (this.reaction == null) - this.reaction = new ArrayList(); - return this.reaction; - } - - public boolean hasReaction() { - if (this.reaction == null) - return false; - for (AllergyIntoleranceReactionComponent item : this.reaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reaction} (Details about each adverse reaction event linked to exposure to the identified Substance.) - */ - // syntactic sugar - public AllergyIntoleranceReactionComponent addReaction() { //3 - AllergyIntoleranceReactionComponent t = new AllergyIntoleranceReactionComponent(); - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return t; - } - - // syntactic sugar - public AllergyIntolerance addReaction(AllergyIntoleranceReactionComponent t) { //3 - if (t == null) - return this; - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this allergy/intolerance concern 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "code", "Identification of the underlying physiological mechanism for the reaction risk.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("category", "code", "Category of the identified Substance.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("criticality", "code", "Estimate of the potential clinical harm, or seriousness, of the reaction to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, criticality)); - childrenList.add(new Property("substance", "CodeableConcept", "Identification of a substance, or a class of substances, that is considered to be responsible for the adverse reaction risk.", 0, java.lang.Integer.MAX_VALUE, substance)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who has the allergy or intolerance.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("recordedDate", "dateTime", "Date when the sensitivity was recorded.", 0, java.lang.Integer.MAX_VALUE, recordedDate)); - childrenList.add(new Property("recorder", "Reference(Practitioner|Patient)", "Individual who recorded the record and takes responsibility for its content.", 0, java.lang.Integer.MAX_VALUE, recorder)); - childrenList.add(new Property("reporter", "Reference(Patient|RelatedPerson|Practitioner)", "The source of the information about the allergy that is recorded.", 0, java.lang.Integer.MAX_VALUE, reporter)); - childrenList.add(new Property("onset", "dateTime", "Record of the date and/or time of the onset of the Allergy or Intolerance.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("lastOccurence", "dateTime", "Represents the date and/or time of the last known occurrence of a reaction event.", 0, java.lang.Integer.MAX_VALUE, lastOccurence)); - childrenList.add(new Property("note", "Annotation", "Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("reaction", "", "Details about each adverse reaction event linked to exposure to the identified Substance.", 0, java.lang.Integer.MAX_VALUE, reaction)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration - case -1608054609: /*criticality*/ return this.criticality == null ? new Base[0] : new Base[] {this.criticality}; // Enumeration - case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // CodeableConcept - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1952893826: /*recordedDate*/ return this.recordedDate == null ? new Base[0] : new Base[] {this.recordedDate}; // DateTimeType - case -799233858: /*recorder*/ return this.recorder == null ? new Base[0] : new Base[] {this.recorder}; // Reference - case -427039519: /*reporter*/ return this.reporter == null ? new Base[0] : new Base[] {this.reporter}; // Reference - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // DateTimeType - case 1307739841: /*lastOccurence*/ return this.lastOccurence == null ? new Base[0] : new Base[] {this.lastOccurence}; // DateTimeType - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // AllergyIntoleranceReactionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new AllergyIntoleranceStatusEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = new AllergyIntoleranceTypeEnumFactory().fromType(value); // Enumeration - break; - case 50511102: // category - this.category = new AllergyIntoleranceCategoryEnumFactory().fromType(value); // Enumeration - break; - case -1608054609: // criticality - this.criticality = new AllergyIntoleranceCriticalityEnumFactory().fromType(value); // Enumeration - break; - case 530040176: // substance - this.substance = castToCodeableConcept(value); // CodeableConcept - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1952893826: // recordedDate - this.recordedDate = castToDateTime(value); // DateTimeType - break; - case -799233858: // recorder - this.recorder = castToReference(value); // Reference - break; - case -427039519: // reporter - this.reporter = castToReference(value); // Reference - break; - case 105901603: // onset - this.onset = castToDateTime(value); // DateTimeType - break; - case 1307739841: // lastOccurence - this.lastOccurence = castToDateTime(value); // DateTimeType - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -867509719: // reaction - this.getReaction().add((AllergyIntoleranceReactionComponent) value); // AllergyIntoleranceReactionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new AllergyIntoleranceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = new AllergyIntoleranceTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("category")) - this.category = new AllergyIntoleranceCategoryEnumFactory().fromType(value); // Enumeration - else if (name.equals("criticality")) - this.criticality = new AllergyIntoleranceCriticalityEnumFactory().fromType(value); // Enumeration - else if (name.equals("substance")) - this.substance = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("recordedDate")) - this.recordedDate = castToDateTime(value); // DateTimeType - else if (name.equals("recorder")) - this.recorder = castToReference(value); // Reference - else if (name.equals("reporter")) - this.reporter = castToReference(value); // Reference - else if (name.equals("onset")) - this.onset = castToDateTime(value); // DateTimeType - else if (name.equals("lastOccurence")) - this.lastOccurence = castToDateTime(value); // DateTimeType - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("reaction")) - this.getReaction().add((AllergyIntoleranceReactionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration - case -1608054609: throw new FHIRException("Cannot make property criticality as it is not a complex type"); // Enumeration - case 530040176: return getSubstance(); // CodeableConcept - case -791418107: return getPatient(); // Reference - case -1952893826: throw new FHIRException("Cannot make property recordedDate as it is not a complex type"); // DateTimeType - case -799233858: return getRecorder(); // Reference - case -427039519: return getReporter(); // Reference - case 105901603: throw new FHIRException("Cannot make property onset as it is not a complex type"); // DateTimeType - case 1307739841: throw new FHIRException("Cannot make property lastOccurence as it is not a complex type"); // DateTimeType - case 3387378: return addNote(); // Annotation - case -867509719: return addReaction(); // AllergyIntoleranceReactionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.status"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.type"); - } - else if (name.equals("category")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.category"); - } - else if (name.equals("criticality")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.criticality"); - } - else if (name.equals("substance")) { - this.substance = new CodeableConcept(); - return this.substance; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("recordedDate")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.recordedDate"); - } - else if (name.equals("recorder")) { - this.recorder = new Reference(); - return this.recorder; - } - else if (name.equals("reporter")) { - this.reporter = new Reference(); - return this.reporter; - } - else if (name.equals("onset")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.onset"); - } - else if (name.equals("lastOccurence")) { - throw new FHIRException("Cannot call addChild on a primitive type AllergyIntolerance.lastOccurence"); - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("reaction")) { - return addReaction(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "AllergyIntolerance"; - - } - - public AllergyIntolerance copy() { - AllergyIntolerance dst = new AllergyIntolerance(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.category = category == null ? null : category.copy(); - dst.criticality = criticality == null ? null : criticality.copy(); - dst.substance = substance == null ? null : substance.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.recordedDate = recordedDate == null ? null : recordedDate.copy(); - dst.recorder = recorder == null ? null : recorder.copy(); - dst.reporter = reporter == null ? null : reporter.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.lastOccurence = lastOccurence == null ? null : lastOccurence.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - if (reaction != null) { - dst.reaction = new ArrayList(); - for (AllergyIntoleranceReactionComponent i : reaction) - dst.reaction.add(i.copy()); - }; - return dst; - } - - protected AllergyIntolerance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AllergyIntolerance)) - return false; - AllergyIntolerance o = (AllergyIntolerance) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) - && compareDeep(category, o.category, true) && compareDeep(criticality, o.criticality, true) && compareDeep(substance, o.substance, true) - && compareDeep(patient, o.patient, true) && compareDeep(recordedDate, o.recordedDate, true) && compareDeep(recorder, o.recorder, true) - && compareDeep(reporter, o.reporter, true) && compareDeep(onset, o.onset, true) && compareDeep(lastOccurence, o.lastOccurence, true) - && compareDeep(note, o.note, true) && compareDeep(reaction, o.reaction, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AllergyIntolerance)) - return false; - AllergyIntolerance o = (AllergyIntolerance) other; - return compareValues(status, o.status, true) && compareValues(type, o.type, true) && compareValues(category, o.category, true) - && compareValues(criticality, o.criticality, true) && compareValues(recordedDate, o.recordedDate, true) - && compareValues(onset, o.onset, true) && compareValues(lastOccurence, o.lastOccurence, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (type == null || type.isEmpty()) && (category == null || category.isEmpty()) && (criticality == null || criticality.isEmpty()) - && (substance == null || substance.isEmpty()) && (patient == null || patient.isEmpty()) && (recordedDate == null || recordedDate.isEmpty()) - && (recorder == null || recorder.isEmpty()) && (reporter == null || reporter.isEmpty()) && (onset == null || onset.isEmpty()) - && (lastOccurence == null || lastOccurence.isEmpty()) && (note == null || note.isEmpty()) - && (reaction == null || reaction.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AllergyIntolerance; - } - - /** - * Search parameter: status - *

- * Description: active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error
- * Type: token
- * Path: AllergyIntolerance.status
- *

- */ - @SearchParamDefinition(name="status", path="AllergyIntolerance.status", description="active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: active | unconfirmed | confirmed | inactive | resolved | refuted | entered-in-error
- * Type: token
- * Path: AllergyIntolerance.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: onset - *

- * Description: Date(/time) when manifestations showed
- * Type: date
- * Path: AllergyIntolerance.reaction.onset
- *

- */ - @SearchParamDefinition(name="onset", path="AllergyIntolerance.reaction.onset", description="Date(/time) when manifestations showed", type="date" ) - public static final String SP_ONSET = "onset"; - /** - * Fluent Client search parameter constant for onset - *

- * Description: Date(/time) when manifestations showed
- * Type: date
- * Path: AllergyIntolerance.reaction.onset
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam ONSET = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ONSET); - - /** - * Search parameter: last-date - *

- * Description: Date(/time) of last known occurrence of a reaction
- * Type: date
- * Path: AllergyIntolerance.lastOccurence
- *

- */ - @SearchParamDefinition(name="last-date", path="AllergyIntolerance.lastOccurence", description="Date(/time) of last known occurrence of a reaction", type="date" ) - public static final String SP_LAST_DATE = "last-date"; - /** - * Fluent Client search parameter constant for last-date - *

- * Description: Date(/time) of last known occurrence of a reaction
- * Type: date
- * Path: AllergyIntolerance.lastOccurence
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam LAST_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_LAST_DATE); - - /** - * Search parameter: severity - *

- * Description: mild | moderate | severe (of event as a whole)
- * Type: token
- * Path: AllergyIntolerance.reaction.severity
- *

- */ - @SearchParamDefinition(name="severity", path="AllergyIntolerance.reaction.severity", description="mild | moderate | severe (of event as a whole)", type="token" ) - public static final String SP_SEVERITY = "severity"; - /** - * Fluent Client search parameter constant for severity - *

- * Description: mild | moderate | severe (of event as a whole)
- * Type: token
- * Path: AllergyIntolerance.reaction.severity
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SEVERITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEVERITY); - - /** - * Search parameter: type - *

- * Description: allergy | intolerance - Underlying mechanism (if known)
- * Type: token
- * Path: AllergyIntolerance.type
- *

- */ - @SearchParamDefinition(name="type", path="AllergyIntolerance.type", description="allergy | intolerance - Underlying mechanism (if known)", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: allergy | intolerance - Underlying mechanism (if known)
- * Type: token
- * Path: AllergyIntolerance.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: When recorded
- * Type: date
- * Path: AllergyIntolerance.recordedDate
- *

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

- * Description: When recorded
- * Type: date
- * Path: AllergyIntolerance.recordedDate
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: reporter - *

- * Description: Source of the information about the allergy
- * Type: reference
- * Path: AllergyIntolerance.reporter
- *

- */ - @SearchParamDefinition(name="reporter", path="AllergyIntolerance.reporter", description="Source of the information about the allergy", type="reference" ) - public static final String SP_REPORTER = "reporter"; - /** - * Fluent Client search parameter constant for reporter - *

- * Description: Source of the information about the allergy
- * Type: reference
- * Path: AllergyIntolerance.reporter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPORTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPORTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance:reporter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REPORTER = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:reporter").toLocked(); - - /** - * Search parameter: substance - *

- * Description: Substance, (or class) considered to be responsible for risk
- * Type: token
- * Path: AllergyIntolerance.substance, AllergyIntolerance.reaction.substance
- *

- */ - @SearchParamDefinition(name="substance", path="AllergyIntolerance.substance | AllergyIntolerance.reaction.substance", description="Substance, (or class) considered to be responsible for risk", type="token" ) - public static final String SP_SUBSTANCE = "substance"; - /** - * Fluent Client search parameter constant for substance - *

- * Description: Substance, (or class) considered to be responsible for risk
- * Type: token
- * Path: AllergyIntolerance.substance, AllergyIntolerance.reaction.substance
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBSTANCE); - - /** - * Search parameter: criticality - *

- * Description: low | high | unable-to-assess
- * Type: token
- * Path: AllergyIntolerance.criticality
- *

- */ - @SearchParamDefinition(name="criticality", path="AllergyIntolerance.criticality", description="low | high | unable-to-assess", type="token" ) - public static final String SP_CRITICALITY = "criticality"; - /** - * Fluent Client search parameter constant for criticality - *

- * Description: low | high | unable-to-assess
- * Type: token
- * Path: AllergyIntolerance.criticality
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CRITICALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CRITICALITY); - - /** - * Search parameter: category - *

- * Description: food | medication | environment | other - Category of Substance
- * Type: token
- * Path: AllergyIntolerance.category
- *

- */ - @SearchParamDefinition(name="category", path="AllergyIntolerance.category", description="food | medication | environment | other - Category of Substance", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: food | medication | environment | other - Category of Substance
- * Type: token
- * Path: AllergyIntolerance.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: patient - *

- * Description: Who the sensitivity is for
- * Type: reference
- * Path: AllergyIntolerance.patient
- *

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

- * Description: Who the sensitivity is for
- * Type: reference
- * Path: AllergyIntolerance.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:patient").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam RECORDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECORDER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AllergyIntolerance:recorder". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECORDER = new ca.uhn.fhir.model.api.Include("AllergyIntolerance:recorder").toLocked(); - - /** - * Search parameter: route - *

- * Description: How the subject was exposed to the substance
- * Type: token
- * Path: AllergyIntolerance.reaction.exposureRoute
- *

- */ - @SearchParamDefinition(name="route", path="AllergyIntolerance.reaction.exposureRoute", description="How the subject was exposed to the substance", type="token" ) - public static final String SP_ROUTE = "route"; - /** - * Fluent Client search parameter constant for route - *

- * Description: How the subject was exposed to the substance
- * Type: token
- * Path: AllergyIntolerance.reaction.exposureRoute
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROUTE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROUTE); - - /** - * Search parameter: identifier - *

- * Description: External ids for this item
- * Type: token
- * Path: AllergyIntolerance.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="AllergyIntolerance.identifier", description="External ids for this item", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: External ids for this item
- * Type: token
- * Path: AllergyIntolerance.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: manifestation - *

- * Description: Clinical symptoms/signs associated with the Event
- * Type: token
- * Path: AllergyIntolerance.reaction.manifestation
- *

- */ - @SearchParamDefinition(name="manifestation", path="AllergyIntolerance.reaction.manifestation", description="Clinical symptoms/signs associated with the Event", type="token" ) - public static final String SP_MANIFESTATION = "manifestation"; - /** - * Fluent Client search parameter constant for manifestation - *

- * Description: Clinical symptoms/signs associated with the Event
- * Type: token
- * Path: AllergyIntolerance.reaction.manifestation
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam MANIFESTATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MANIFESTATION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Annotation.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Annotation.java deleted file mode 100644 index bfe8ab60d24..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Annotation.java +++ /dev/null @@ -1,349 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A text note which also contains information about who made the statement and when. - */ -@DatatypeDef(name="Annotation") -public class Annotation extends Type implements ICompositeType { - - /** - * The individual responsible for making the annotation. - */ - @Child(name = "author", type = {Practitioner.class, Patient.class, RelatedPerson.class, StringType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Individual responsible for the annotation", formalDefinition="The individual responsible for making the annotation." ) - protected Type author; - - /** - * Indicates when this particular annotation was made. - */ - @Child(name = "time", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the annotation was made", formalDefinition="Indicates when this particular annotation was made." ) - protected DateTimeType time; - - /** - * The text of the annotation. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The annotation - text content", formalDefinition="The text of the annotation." ) - protected StringType text; - - private static final long serialVersionUID = -575590381L; - - /** - * Constructor - */ - public Annotation() { - super(); - } - - /** - * Constructor - */ - public Annotation(StringType text) { - super(); - this.text = text; - } - - /** - * @return {@link #author} (The individual responsible for making the annotation.) - */ - public Type getAuthor() { - return this.author; - } - - /** - * @return {@link #author} (The individual responsible for making the annotation.) - */ - public Reference getAuthorReference() throws FHIRException { - if (!(this.author instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.author.getClass().getName()+" was encountered"); - return (Reference) this.author; - } - - public boolean hasAuthorReference() { - return this.author instanceof Reference; - } - - /** - * @return {@link #author} (The individual responsible for making the annotation.) - */ - public StringType getAuthorStringType() throws FHIRException { - if (!(this.author instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.author.getClass().getName()+" was encountered"); - return (StringType) this.author; - } - - public boolean hasAuthorStringType() { - return this.author instanceof StringType; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The individual responsible for making the annotation.) - */ - public Annotation setAuthor(Type value) { - this.author = value; - return this; - } - - /** - * @return {@link #time} (Indicates when this particular annotation was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DateTimeType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Annotation.time"); - else if (Configuration.doAutoCreate()) - this.time = new DateTimeType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (Indicates when this particular annotation was made.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public Annotation setTimeElement(DateTimeType value) { - this.time = value; - return this; - } - - /** - * @return Indicates when this particular annotation was made. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value Indicates when this particular annotation was made. - */ - public Annotation setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new DateTimeType(); - this.time.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (The text of the annotation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Annotation.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The text of the annotation.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public Annotation setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The text of the annotation. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The text of the annotation. - */ - public Annotation setText(String value) { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("author[x]", "Reference(Practitioner|Patient|RelatedPerson)|string", "The individual responsible for making the annotation.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("time", "dateTime", "Indicates when this particular annotation was made.", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("text", "string", "The text of the annotation.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Type - case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1406328437: // author - this.author = (Type) value; // Type - break; - case 3560141: // time - this.time = castToDateTime(value); // DateTimeType - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("author[x]")) - this.author = (Type) value; // Type - else if (name.equals("time")) - this.time = castToDateTime(value); // DateTimeType - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1475597077: return getAuthor(); // Type - case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // DateTimeType - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("authorReference")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("authorString")) { - this.author = new StringType(); - return this.author; - } - else if (name.equals("time")) { - throw new FHIRException("Cannot call addChild on a primitive type Annotation.time"); - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type Annotation.text"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Annotation"; - - } - - public Annotation copy() { - Annotation dst = new Annotation(); - copyValues(dst); - dst.author = author == null ? null : author.copy(); - dst.time = time == null ? null : time.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - protected Annotation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Annotation)) - return false; - Annotation o = (Annotation) other; - return compareDeep(author, o.author, true) && compareDeep(time, o.time, true) && compareDeep(text, o.text, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Annotation)) - return false; - Annotation o = (Annotation) other; - return compareValues(time, o.time, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (author == null || author.isEmpty()) && (time == null || time.isEmpty()) - && (text == null || text.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Appointment.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Appointment.java deleted file mode 100644 index 21000c92c80..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Appointment.java +++ /dev/null @@ -1,2143 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). - */ -@ResourceDef(name="Appointment", profile="http://hl7.org/fhir/Profile/Appointment") -public class Appointment extends DomainResource { - - public enum AppointmentStatus { - /** - * None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time may not be set yet. - */ - PROPOSED, - /** - * Some or all of the participant(s) have not finalized their acceptance of the appointment request. - */ - PENDING, - /** - * All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified. - */ - BOOKED, - /** - * Some of the patients have arrived. - */ - ARRIVED, - /** - * This appointment has completed and may have resulted in an encounter. - */ - FULFILLED, - /** - * The appointment has been cancelled. - */ - CANCELLED, - /** - * Some or all of the participant(s) have not/did not appear for the appointment (usually the patient). - */ - NOSHOW, - /** - * added to help the parsers - */ - NULL; - public static AppointmentStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("pending".equals(codeString)) - return PENDING; - if ("booked".equals(codeString)) - return BOOKED; - if ("arrived".equals(codeString)) - return ARRIVED; - if ("fulfilled".equals(codeString)) - return FULFILLED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("noshow".equals(codeString)) - return NOSHOW; - throw new FHIRException("Unknown AppointmentStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PENDING: return "pending"; - case BOOKED: return "booked"; - case ARRIVED: return "arrived"; - case FULFILLED: return "fulfilled"; - case CANCELLED: return "cancelled"; - case NOSHOW: return "noshow"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/appointmentstatus"; - case PENDING: return "http://hl7.org/fhir/appointmentstatus"; - case BOOKED: return "http://hl7.org/fhir/appointmentstatus"; - case ARRIVED: return "http://hl7.org/fhir/appointmentstatus"; - case FULFILLED: return "http://hl7.org/fhir/appointmentstatus"; - case CANCELLED: return "http://hl7.org/fhir/appointmentstatus"; - case NOSHOW: return "http://hl7.org/fhir/appointmentstatus"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time may not be set yet."; - case PENDING: return "Some or all of the participant(s) have not finalized their acceptance of the appointment request."; - case BOOKED: return "All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times specified."; - case ARRIVED: return "Some of the patients have arrived."; - case FULFILLED: return "This appointment has completed and may have resulted in an encounter."; - case CANCELLED: return "The appointment has been cancelled."; - case NOSHOW: return "Some or all of the participant(s) have not/did not appear for the appointment (usually the patient)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PENDING: return "Pending"; - case BOOKED: return "Booked"; - case ARRIVED: return "Arrived"; - case FULFILLED: return "Fulfilled"; - case CANCELLED: return "Cancelled"; - case NOSHOW: return "No Show"; - default: return "?"; - } - } - } - - public static class AppointmentStatusEnumFactory implements EnumFactory { - public AppointmentStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return AppointmentStatus.PROPOSED; - if ("pending".equals(codeString)) - return AppointmentStatus.PENDING; - if ("booked".equals(codeString)) - return AppointmentStatus.BOOKED; - if ("arrived".equals(codeString)) - return AppointmentStatus.ARRIVED; - if ("fulfilled".equals(codeString)) - return AppointmentStatus.FULFILLED; - if ("cancelled".equals(codeString)) - return AppointmentStatus.CANCELLED; - if ("noshow".equals(codeString)) - return AppointmentStatus.NOSHOW; - throw new IllegalArgumentException("Unknown AppointmentStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, AppointmentStatus.PROPOSED); - if ("pending".equals(codeString)) - return new Enumeration(this, AppointmentStatus.PENDING); - if ("booked".equals(codeString)) - return new Enumeration(this, AppointmentStatus.BOOKED); - if ("arrived".equals(codeString)) - return new Enumeration(this, AppointmentStatus.ARRIVED); - if ("fulfilled".equals(codeString)) - return new Enumeration(this, AppointmentStatus.FULFILLED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, AppointmentStatus.CANCELLED); - if ("noshow".equals(codeString)) - return new Enumeration(this, AppointmentStatus.NOSHOW); - throw new FHIRException("Unknown AppointmentStatus code '"+codeString+"'"); - } - public String toCode(AppointmentStatus code) { - if (code == AppointmentStatus.PROPOSED) - return "proposed"; - if (code == AppointmentStatus.PENDING) - return "pending"; - if (code == AppointmentStatus.BOOKED) - return "booked"; - if (code == AppointmentStatus.ARRIVED) - return "arrived"; - if (code == AppointmentStatus.FULFILLED) - return "fulfilled"; - if (code == AppointmentStatus.CANCELLED) - return "cancelled"; - if (code == AppointmentStatus.NOSHOW) - return "noshow"; - return "?"; - } - public String toSystem(AppointmentStatus code) { - return code.getSystem(); - } - } - - public enum ParticipantRequired { - /** - * The participant is required to attend the appointment. - */ - REQUIRED, - /** - * The participant may optionally attend the appointment. - */ - OPTIONAL, - /** - * The participant is excluded from the appointment, and may not be informed of the appointment taking place. (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test). - */ - INFORMATIONONLY, - /** - * added to help the parsers - */ - NULL; - public static ParticipantRequired fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return REQUIRED; - if ("optional".equals(codeString)) - return OPTIONAL; - if ("information-only".equals(codeString)) - return INFORMATIONONLY; - throw new FHIRException("Unknown ParticipantRequired code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case OPTIONAL: return "optional"; - case INFORMATIONONLY: return "information-only"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return "http://hl7.org/fhir/participantrequired"; - case OPTIONAL: return "http://hl7.org/fhir/participantrequired"; - case INFORMATIONONLY: return "http://hl7.org/fhir/participantrequired"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "The participant is required to attend the appointment."; - case OPTIONAL: return "The participant may optionally attend the appointment."; - case INFORMATIONONLY: return "The participant is excluded from the appointment, and may not be informed of the appointment taking place. (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "Required"; - case OPTIONAL: return "Optional"; - case INFORMATIONONLY: return "Information Only"; - default: return "?"; - } - } - } - - public static class ParticipantRequiredEnumFactory implements EnumFactory { - public ParticipantRequired fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return ParticipantRequired.REQUIRED; - if ("optional".equals(codeString)) - return ParticipantRequired.OPTIONAL; - if ("information-only".equals(codeString)) - return ParticipantRequired.INFORMATIONONLY; - throw new IllegalArgumentException("Unknown ParticipantRequired code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return new Enumeration(this, ParticipantRequired.REQUIRED); - if ("optional".equals(codeString)) - return new Enumeration(this, ParticipantRequired.OPTIONAL); - if ("information-only".equals(codeString)) - return new Enumeration(this, ParticipantRequired.INFORMATIONONLY); - throw new FHIRException("Unknown ParticipantRequired code '"+codeString+"'"); - } - public String toCode(ParticipantRequired code) { - if (code == ParticipantRequired.REQUIRED) - return "required"; - if (code == ParticipantRequired.OPTIONAL) - return "optional"; - if (code == ParticipantRequired.INFORMATIONONLY) - return "information-only"; - return "?"; - } - public String toSystem(ParticipantRequired code) { - return code.getSystem(); - } - } - - public enum ParticipationStatus { - /** - * The participant has accepted the appointment. - */ - ACCEPTED, - /** - * The participant has declined the appointment and will not participate in the appointment. - */ - DECLINED, - /** - * The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur. - */ - TENTATIVE, - /** - * The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses. - */ - NEEDSACTION, - /** - * added to help the parsers - */ - NULL; - public static ParticipationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("declined".equals(codeString)) - return DECLINED; - if ("tentative".equals(codeString)) - return TENTATIVE; - if ("needs-action".equals(codeString)) - return NEEDSACTION; - throw new FHIRException("Unknown ParticipationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACCEPTED: return "accepted"; - case DECLINED: return "declined"; - case TENTATIVE: return "tentative"; - case NEEDSACTION: return "needs-action"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACCEPTED: return "http://hl7.org/fhir/participationstatus"; - case DECLINED: return "http://hl7.org/fhir/participationstatus"; - case TENTATIVE: return "http://hl7.org/fhir/participationstatus"; - case NEEDSACTION: return "http://hl7.org/fhir/participationstatus"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACCEPTED: return "The participant has accepted the appointment."; - case DECLINED: return "The participant has declined the appointment and will not participate in the appointment."; - case TENTATIVE: return "The participant has tentatively accepted the appointment. This could be automatically created by a system and requires further processing before it can be accepted. There is no commitment that attendance will occur."; - case NEEDSACTION: return "The participant needs to indicate if they accept the appointment by changing this status to one of the other statuses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACCEPTED: return "Accepted"; - case DECLINED: return "Declined"; - case TENTATIVE: return "Tentative"; - case NEEDSACTION: return "Needs Action"; - default: return "?"; - } - } - } - - public static class ParticipationStatusEnumFactory implements EnumFactory { - public ParticipationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return ParticipationStatus.ACCEPTED; - if ("declined".equals(codeString)) - return ParticipationStatus.DECLINED; - if ("tentative".equals(codeString)) - return ParticipationStatus.TENTATIVE; - if ("needs-action".equals(codeString)) - return ParticipationStatus.NEEDSACTION; - throw new IllegalArgumentException("Unknown ParticipationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("accepted".equals(codeString)) - return new Enumeration(this, ParticipationStatus.ACCEPTED); - if ("declined".equals(codeString)) - return new Enumeration(this, ParticipationStatus.DECLINED); - if ("tentative".equals(codeString)) - return new Enumeration(this, ParticipationStatus.TENTATIVE); - if ("needs-action".equals(codeString)) - return new Enumeration(this, ParticipationStatus.NEEDSACTION); - throw new FHIRException("Unknown ParticipationStatus code '"+codeString+"'"); - } - public String toCode(ParticipationStatus code) { - if (code == ParticipationStatus.ACCEPTED) - return "accepted"; - if (code == ParticipationStatus.DECLINED) - return "declined"; - if (code == ParticipationStatus.TENTATIVE) - return "tentative"; - if (code == ParticipationStatus.NEEDSACTION) - return "needs-action"; - return "?"; - } - public String toSystem(ParticipationStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class AppointmentParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Role of participant in the appointment. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) - protected List type; - - /** - * A Person, Location/HealthcareService or Device that is participating in the appointment. - */ - @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Person, Location/HealthcareService or Device", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - protected Resource actorTarget; - - /** - * 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. - */ - @Child(name = "required", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Enumeration required; - - /** - * Participation status of the Patient. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="accepted | declined | tentative | needs-action", formalDefinition="Participation status of the Patient." ) - protected Enumeration status; - - private static final long serialVersionUID = -1620552507L; - - /** - * Constructor - */ - public AppointmentParticipantComponent() { - super(); - } - - /** - * Constructor - */ - public AppointmentParticipantComponent(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #type} (Role of participant in the appointment.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Role of participant in the appointment.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public AppointmentParticipantComponent addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentParticipantComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentParticipantComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #required} (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.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public Enumeration getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new Enumeration(new ParticipantRequiredEnumFactory()); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (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.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public AppointmentParticipantComponent setRequiredElement(Enumeration value) { - this.required = value; - return this; - } - - /** - * @return 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 ParticipantRequired getRequired() { - return this.required == null ? null : this.required.getValue(); - } - - /** - * @param value 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 AppointmentParticipantComponent setRequired(ParticipantRequired value) { - if (value == null) - this.required = null; - else { - if (this.required == null) - this.required = new Enumeration(new ParticipantRequiredEnumFactory()); - this.required.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentParticipantComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ParticipationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Participation status of the Patient.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public AppointmentParticipantComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Participation status of the Patient. - */ - public ParticipationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Participation status of the Patient. - */ - public AppointmentParticipantComponent setStatus(ParticipationStatus value) { - if (this.status == null) - this.status = new Enumeration(new ParticipationStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("required", "code", "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.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("status", "code", "Participation status of the Patient.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // Enumeration - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.getType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case -393139297: // required - this.required = new ParticipantRequiredEnumFactory().fromType(value); // Enumeration - break; - case -892481550: // status - this.status = new ParticipationStatusEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.getType().add(castToCodeableConcept(value)); - else if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("required")) - this.required = new ParticipantRequiredEnumFactory().fromType(value); // Enumeration - else if (name.equals("status")) - this.status = new ParticipationStatusEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return addType(); // CodeableConcept - case 92645877: return getActor(); // Reference - case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // Enumeration - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - return addType(); - } - else if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("required")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.required"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.status"); - } - else - return super.addChild(name); - } - - public AppointmentParticipantComponent copy() { - AppointmentParticipantComponent dst = new AppointmentParticipantComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.required = required == null ? null : required.copy(); - dst.status = status == null ? null : status.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AppointmentParticipantComponent)) - return false; - AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; - return compareDeep(type, o.type, true) && compareDeep(actor, o.actor, true) && compareDeep(required, o.required, true) - && compareDeep(status, o.status, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AppointmentParticipantComponent)) - return false; - AppointmentParticipantComponent o = (AppointmentParticipantComponent) other; - return compareValues(required, o.required, true) && compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (actor == null || actor.isEmpty()) - && (required == null || required.isEmpty()) && (status == null || status.isEmpty()); - } - - public String fhirType() { - return "Appointment.participant"; - - } - - } - - /** - * This records identifiers associated with this appointment concern 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment concern 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)." ) - protected List identifier; - - /** - * The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | pending | booked | arrived | fulfilled | cancelled | noshow", formalDefinition="The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status." ) - protected Enumeration status; - - /** - * A broad categorisation of the service that is to be performed during this appointment. - */ - @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." ) - protected CodeableConcept serviceCategory; - - /** - * The specific service that is to be performed during this appointment. - */ - @Child(name = "serviceType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The specific service that is to be performed during this appointment", formalDefinition="The specific service that is to be performed during this appointment." ) - protected List serviceType; - - /** - * The specialty of a practitioner that would be required to perform the service requested in this appointment. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." ) - protected List specialty; - - /** - * The style of appointment or patient that has been booked in the slot (not service type). - */ - @Child(name = "appointmentType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The style of appointment or patient that has been booked in the slot (not service type)", formalDefinition="The style of appointment or patient that has been booked in the slot (not service type)." ) - protected CodeableConcept appointmentType; - - /** - * The reason that this appointment is being scheduled. This is more clinical than administrative. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason this appointment is scheduled", formalDefinition="The reason that this appointment is being scheduled. This is more clinical than administrative." ) - protected CodeableConcept reason; - - /** - * 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). - */ - @Child(name = "priority", type = {UnsignedIntType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Used to make informed decisions if needing to re-prioritize", formalDefinition="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)." ) - protected UnsignedIntType priority; - - /** - * 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. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Shown on a subject line in a meeting request, or appointment list", formalDefinition="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." ) - protected StringType description; - - /** - * Date/Time that the appointment is to take place. - */ - @Child(name = "start", type = {InstantType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When appointment is to take place", formalDefinition="Date/Time that the appointment is to take place." ) - protected InstantType start; - - /** - * Date/Time that the appointment is to conclude. - */ - @Child(name = "end", type = {InstantType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When appointment is to conclude", formalDefinition="Date/Time that the appointment is to conclude." ) - protected InstantType end; - - /** - * Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request). - */ - @Child(name = "minutesDuration", type = {PositiveIntType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Can be less than start/end (e.g. estimate)", formalDefinition="Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request)." ) - protected PositiveIntType minutesDuration; - - /** - * 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. - */ - @Child(name = "slot", type = {Slot.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="If provided, then no schedule and start/end values MUST match slot", formalDefinition="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." ) - protected List slot; - /** - * The actual objects that are the target of the reference (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.) - */ - protected List slotTarget; - - - /** - * The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. - */ - @Child(name = "created", type = {DateTimeType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The date that this appointment was initially created", formalDefinition="The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment." ) - protected DateTimeType created; - - /** - * Additional comments about the appointment. - */ - @Child(name = "comment", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional comments", formalDefinition="Additional comments about the appointment." ) - protected StringType comment; - - /** - * List of participants involved in the appointment. - */ - @Child(name = "participant", type = {}, order=15, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Participants involved in appointment", formalDefinition="List of participants involved in the appointment." ) - protected List participant; - - private static final long serialVersionUID = 552749730L; - - /** - * Constructor - */ - public Appointment() { - super(); - } - - /** - * Constructor - */ - public Appointment(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment concern 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment concern 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Appointment addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new AppointmentStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Appointment setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status. - */ - public AppointmentStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The overall status of the Appointment. 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(AppointmentStatus value) { - if (this.status == null) - this.status = new Enumeration(new AppointmentStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); // cc - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) - */ - public Appointment setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) - */ - public List getServiceType() { - if (this.serviceType == null) - this.serviceType = new ArrayList(); - return this.serviceType; - } - - public boolean hasServiceType() { - if (this.serviceType == null) - return false; - for (CodeableConcept item : this.serviceType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) - */ - // syntactic sugar - public CodeableConcept addServiceType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return t; - } - - // syntactic sugar - public Appointment addServiceType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return this; - } - - /** - * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public Appointment addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) - */ - public CodeableConcept getAppointmentType() { - if (this.appointmentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.appointmentType"); - else if (Configuration.doAutoCreate()) - this.appointmentType = new CodeableConcept(); // cc - return this.appointmentType; - } - - public boolean hasAppointmentType() { - return this.appointmentType != null && !this.appointmentType.isEmpty(); - } - - /** - * @param value {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) - */ - public Appointment setAppointmentType(CodeableConcept value) { - this.appointmentType = value; - return this; - } - - /** - * @return {@link #reason} (The reason that this appointment is being scheduled. This is more clinical than administrative.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (The reason that this appointment is being scheduled. This is more clinical than administrative.) - */ - public Appointment setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #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).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public UnsignedIntType getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new UnsignedIntType(); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #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).). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Appointment setPriorityElement(UnsignedIntType value) { - this.priority = value; - return this; - } - - /** - * @return 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). - */ - public int getPriority() { - return this.priority == null || this.priority.isEmpty() ? 0 : this.priority.getValue(); - } - - /** - * @param value 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). - */ - public Appointment setPriority(int value) { - if (this.priority == null) - this.priority = new UnsignedIntType(); - this.priority.setValue(value); - return this; - } - - /** - * @return {@link #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.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #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.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Appointment setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return 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. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value 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. - */ - public Appointment setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the appointment is to take place.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Appointment setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the appointment is to take place. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value Date/Time that the appointment is to take place. - */ - public Appointment setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the appointment is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Appointment setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the appointment is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the appointment is to conclude. - */ - public Appointment setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - /** - * @return {@link #minutesDuration} (Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).). This is the underlying object with id, value and extensions. The accessor "getMinutesDuration" gives direct access to the value - */ - public PositiveIntType getMinutesDurationElement() { - if (this.minutesDuration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.minutesDuration"); - else if (Configuration.doAutoCreate()) - this.minutesDuration = new PositiveIntType(); // bb - return this.minutesDuration; - } - - public boolean hasMinutesDurationElement() { - return this.minutesDuration != null && !this.minutesDuration.isEmpty(); - } - - public boolean hasMinutesDuration() { - return this.minutesDuration != null && !this.minutesDuration.isEmpty(); - } - - /** - * @param value {@link #minutesDuration} (Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).). This is the underlying object with id, value and extensions. The accessor "getMinutesDuration" gives direct access to the value - */ - public Appointment setMinutesDurationElement(PositiveIntType value) { - this.minutesDuration = value; - return this; - } - - /** - * @return Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request). - */ - public int getMinutesDuration() { - return this.minutesDuration == null || this.minutesDuration.isEmpty() ? 0 : this.minutesDuration.getValue(); - } - - /** - * @param value Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request). - */ - public Appointment setMinutesDuration(int value) { - if (this.minutesDuration == null) - this.minutesDuration = new PositiveIntType(); - this.minutesDuration.setValue(value); - return this; - } - - /** - * @return {@link #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.) - */ - public List getSlot() { - if (this.slot == null) - this.slot = new ArrayList(); - return this.slot; - } - - public boolean hasSlot() { - if (this.slot == null) - return false; - for (Reference item : this.slot) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #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.) - */ - // syntactic sugar - public Reference addSlot() { //3 - Reference t = new Reference(); - if (this.slot == null) - this.slot = new ArrayList(); - this.slot.add(t); - return t; - } - - // syntactic sugar - public Appointment addSlot(Reference t) { //3 - if (t == null) - return this; - if (this.slot == null) - this.slot = new ArrayList(); - this.slot.add(t); - return this; - } - - /** - * @return {@link #slot} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. 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.) - */ - public List getSlotTarget() { - if (this.slotTarget == null) - this.slotTarget = new ArrayList(); - return this.slotTarget; - } - - // syntactic sugar - /** - * @return {@link #slot} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. 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.) - */ - public Slot addSlotTarget() { - Slot r = new Slot(); - if (this.slotTarget == null) - this.slotTarget = new ArrayList(); - this.slotTarget.add(r); - return r; - } - - /** - * @return {@link #created} (The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Appointment setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment. - */ - public Appointment setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Appointment.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Appointment setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional comments about the appointment. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional comments about the appointment. - */ - public Appointment setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #participant} (List of participants involved in the appointment.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (AppointmentParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (List of participants involved in the appointment.) - */ - // syntactic sugar - public AppointmentParticipantComponent addParticipant() { //3 - AppointmentParticipantComponent t = new AppointmentParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public Appointment addParticipant(AppointmentParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment concern 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "The overall status of the Appointment. Each of the participants has their own participation status which indicates their involvement in the process, however this status indicates the shared status.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("serviceType", "CodeableConcept", "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceType)); - childrenList.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("appointmentType", "CodeableConcept", "The style of appointment or patient that has been booked in the slot (not service type).", 0, java.lang.Integer.MAX_VALUE, appointmentType)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason that this appointment is being scheduled. This is more clinical than administrative.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("priority", "unsignedInt", "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).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("description", "string", "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.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the appointment is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("minutesDuration", "positiveInt", "Number of minutes that the appointment is to take. This can be less than the duration between the start and end times (where actual time of appointment is only an estimate or is a planned appointment request).", 0, java.lang.Integer.MAX_VALUE, minutesDuration)); - childrenList.add(new Property("slot", "Reference(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.", 0, java.lang.Integer.MAX_VALUE, slot)); - childrenList.add(new Property("created", "dateTime", "The date that this appointment was initially created. This could be different to the meta.lastModified value on the initial entry, as this could have been before the resource was created on the FHIR server, and should remain unchanged over the lifespan of the appointment.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("participant", "", "List of participants involved in the appointment.", 0, java.lang.Integer.MAX_VALUE, participant)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept - case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept - case -1596426375: /*appointmentType*/ return this.appointmentType == null ? new Base[0] : new Base[] {this.appointmentType}; // CodeableConcept - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // UnsignedIntType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType - case -413630573: /*minutesDuration*/ return this.minutesDuration == null ? new Base[0] : new Base[] {this.minutesDuration}; // PositiveIntType - case 3533310: /*slot*/ return this.slot == null ? new Base[0] : this.slot.toArray(new Base[this.slot.size()]); // Reference - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // AppointmentParticipantComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new AppointmentStatusEnumFactory().fromType(value); // Enumeration - break; - case 1281188563: // serviceCategory - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - break; - case -1928370289: // serviceType - this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1694759682: // specialty - this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1596426375: // appointmentType - this.appointmentType = castToCodeableConcept(value); // CodeableConcept - break; - case -934964668: // reason - this.reason = castToCodeableConcept(value); // CodeableConcept - break; - case -1165461084: // priority - this.priority = castToUnsignedInt(value); // UnsignedIntType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 109757538: // start - this.start = castToInstant(value); // InstantType - break; - case 100571: // end - this.end = castToInstant(value); // InstantType - break; - case -413630573: // minutesDuration - this.minutesDuration = castToPositiveInt(value); // PositiveIntType - break; - case 3533310: // slot - this.getSlot().add(castToReference(value)); // Reference - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - case 767422259: // participant - this.getParticipant().add((AppointmentParticipantComponent) value); // AppointmentParticipantComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new AppointmentStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("serviceCategory")) - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("serviceType")) - this.getServiceType().add(castToCodeableConcept(value)); - else if (name.equals("specialty")) - this.getSpecialty().add(castToCodeableConcept(value)); - else if (name.equals("appointmentType")) - this.appointmentType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("reason")) - this.reason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("priority")) - this.priority = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("start")) - this.start = castToInstant(value); // InstantType - else if (name.equals("end")) - this.end = castToInstant(value); // InstantType - else if (name.equals("minutesDuration")) - this.minutesDuration = castToPositiveInt(value); // PositiveIntType - else if (name.equals("slot")) - this.getSlot().add(castToReference(value)); - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else if (name.equals("participant")) - this.getParticipant().add((AppointmentParticipantComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1281188563: return getServiceCategory(); // CodeableConcept - case -1928370289: return addServiceType(); // CodeableConcept - case -1694759682: return addSpecialty(); // CodeableConcept - case -1596426375: return getAppointmentType(); // CodeableConcept - case -934964668: return getReason(); // CodeableConcept - case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // UnsignedIntType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType - case -413630573: throw new FHIRException("Cannot make property minutesDuration as it is not a complex type"); // PositiveIntType - case 3533310: return addSlot(); // Reference - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - case 767422259: return addParticipant(); // AppointmentParticipantComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.status"); - } - else if (name.equals("serviceCategory")) { - this.serviceCategory = new CodeableConcept(); - return this.serviceCategory; - } - else if (name.equals("serviceType")) { - return addServiceType(); - } - else if (name.equals("specialty")) { - return addSpecialty(); - } - else if (name.equals("appointmentType")) { - this.appointmentType = new CodeableConcept(); - return this.appointmentType; - } - else if (name.equals("reason")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("priority")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.priority"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.description"); - } - else if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.end"); - } - else if (name.equals("minutesDuration")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.minutesDuration"); - } - else if (name.equals("slot")) { - return addSlot(); - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.created"); - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type Appointment.comment"); - } - else if (name.equals("participant")) { - return addParticipant(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Appointment"; - - } - - public Appointment copy() { - Appointment dst = new Appointment(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - if (serviceType != null) { - dst.serviceType = new ArrayList(); - for (CodeableConcept i : serviceType) - dst.serviceType.add(i.copy()); - }; - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - dst.appointmentType = appointmentType == null ? null : appointmentType.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.description = description == null ? null : description.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.minutesDuration = minutesDuration == null ? null : minutesDuration.copy(); - if (slot != null) { - dst.slot = new ArrayList(); - for (Reference i : slot) - dst.slot.add(i.copy()); - }; - dst.created = created == null ? null : created.copy(); - dst.comment = comment == null ? null : comment.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (AppointmentParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - return dst; - } - - protected Appointment typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Appointment)) - return false; - Appointment o = (Appointment) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(serviceCategory, o.serviceCategory, true) - && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(appointmentType, o.appointmentType, true) - && compareDeep(reason, o.reason, true) && compareDeep(priority, o.priority, true) && compareDeep(description, o.description, true) - && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(minutesDuration, o.minutesDuration, true) - && compareDeep(slot, o.slot, true) && compareDeep(created, o.created, true) && compareDeep(comment, o.comment, true) - && compareDeep(participant, o.participant, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Appointment)) - return false; - Appointment o = (Appointment) other; - return compareValues(status, o.status, true) && compareValues(priority, o.priority, true) && compareValues(description, o.description, true) - && compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(minutesDuration, o.minutesDuration, true) - && compareValues(created, o.created, true) && compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (serviceCategory == null || serviceCategory.isEmpty()) && (serviceType == null || serviceType.isEmpty()) - && (specialty == null || specialty.isEmpty()) && (appointmentType == null || appointmentType.isEmpty()) - && (reason == null || reason.isEmpty()) && (priority == null || priority.isEmpty()) && (description == null || description.isEmpty()) - && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (minutesDuration == null || minutesDuration.isEmpty()) - && (slot == null || slot.isEmpty()) && (created == null || created.isEmpty()) && (comment == null || comment.isEmpty()) - && (participant == null || participant.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Appointment; - } - - /** - * Search parameter: patient - *

- * Description: One of the individuals of the appointment is this patient
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - @SearchParamDefinition(name="patient", path="Appointment.participant.actor", description="One of the individuals of the appointment is this patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: One of the individuals of the appointment is this patient
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Appointment:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Appointment:patient").toLocked(); - - /** - * Search parameter: service-type - *

- * Description: The specific service that is to be performed during this appointment
- * Type: token
- * Path: Appointment.serviceType
- *

- */ - @SearchParamDefinition(name="service-type", path="Appointment.serviceType", description="The specific service that is to be performed during this appointment", type="token" ) - public static final String SP_SERVICE_TYPE = "service-type"; - /** - * Fluent Client search parameter constant for service-type - *

- * Description: The specific service that is to be performed during this appointment
- * Type: token
- * Path: Appointment.serviceType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICE_TYPE); - - /** - * Search parameter: practitioner - *

- * Description: One of the individuals of the appointment is this practitioner
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - @SearchParamDefinition(name="practitioner", path="Appointment.participant.actor", description="One of the individuals of the appointment is this practitioner", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - /** - * Fluent Client search parameter constant for practitioner - *

- * Description: One of the individuals of the appointment is this practitioner
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Appointment:practitioner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Appointment:practitioner").toLocked(); - - /** - * Search parameter: location - *

- * Description: This location is listed in the participants of the appointment
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - @SearchParamDefinition(name="location", path="Appointment.participant.actor", description="This location is listed in the participants of the appointment", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: This location is listed in the participants of the appointment
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Appointment:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Appointment:location").toLocked(); - - /** - * Search parameter: status - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: appointment-type - *

- * Description: The style of appointment or patient that has been booked in the slot (not service type)
- * Type: token
- * Path: Appointment.appointmentType
- *

- */ - @SearchParamDefinition(name="appointment-type", path="Appointment.appointmentType", description="The style of appointment or patient that has been booked in the slot (not service type)", type="token" ) - public static final String SP_APPOINTMENT_TYPE = "appointment-type"; - /** - * Fluent Client search parameter constant for appointment-type - *

- * Description: The style of appointment or patient that has been booked in the slot (not service type)
- * Type: token
- * Path: Appointment.appointmentType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam APPOINTMENT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_APPOINTMENT_TYPE); - - /** - * Search parameter: part-status - *

- * Description: The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.
- * Type: token
- * Path: Appointment.participant.status
- *

- */ - @SearchParamDefinition(name="part-status", path="Appointment.participant.status", description="The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.", type="token" ) - public static final String SP_PART_STATUS = "part-status"; - /** - * Fluent Client search parameter constant for part-status - *

- * Description: The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests.
- * Type: token
- * Path: Appointment.participant.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PART_STATUS); - - /** - * Search parameter: actor - *

- * Description: Any one of the individuals participating in the appointment
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - @SearchParamDefinition(name="actor", path="Appointment.participant.actor", description="Any one of the individuals participating in the appointment", type="reference" ) - public static final String SP_ACTOR = "actor"; - /** - * Fluent Client search parameter constant for actor - *

- * Description: Any one of the individuals participating in the appointment
- * Type: reference
- * Path: Appointment.participant.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Appointment:actor". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Appointment:actor").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: An Identifier of the Appointment
- * Type: token
- * Path: Appointment.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Appointment.identifier", description="An Identifier of the Appointment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: An Identifier of the Appointment
- * Type: token
- * Path: Appointment.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java deleted file mode 100644 index ca23c36a88a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AppointmentResponse.java +++ /dev/null @@ -1,858 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ -@ResourceDef(name="AppointmentResponse", profile="http://hl7.org/fhir/Profile/AppointmentResponse") -public class AppointmentResponse extends DomainResource { - - /** - * This records identifiers associated with this appointment response concern 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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this item", formalDefinition="This records identifiers associated with this appointment response concern 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." ) - protected List identifier; - - /** - * Appointment that this response is replying to. - */ - @Child(name = "appointment", type = {Appointment.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Appointment this response relates to", formalDefinition="Appointment that this response is replying to." ) - protected Reference appointment; - - /** - * The actual object that is the target of the reference (Appointment that this response is replying to.) - */ - protected Appointment appointmentTarget; - - /** - * Date/Time that the appointment is to take place, or requested new start time. - */ - @Child(name = "start", type = {InstantType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Time from appointment, or requested new start time", formalDefinition="Date/Time that the appointment is to take place, or requested new start time." ) - protected InstantType start; - - /** - * This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. - */ - @Child(name = "end", type = {InstantType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Time from appointment, or requested new end time", formalDefinition="This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time." ) - protected InstantType end; - - /** - * Role of participant in the appointment. - */ - @Child(name = "participantType", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Role of participant in the appointment", formalDefinition="Role of participant in the appointment." ) - protected List participantType; - - /** - * A Person, Location/HealthcareService or Device that is participating in the appointment. - */ - @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Person, Location/HealthcareService or Device", formalDefinition="A Person, Location/HealthcareService or Device that is participating in the appointment." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - protected Resource actorTarget; - - /** - * Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. - */ - @Child(name = "participantStatus", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="accepted | declined | tentative | in-process | completed | needs-action", formalDefinition="Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty." ) - protected CodeType participantStatus; - - /** - * Additional comments about the appointment. - */ - @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional comments", formalDefinition="Additional comments about the appointment." ) - protected StringType comment; - - private static final long serialVersionUID = -1645343660L; - - /** - * Constructor - */ - public AppointmentResponse() { - super(); - } - - /** - * Constructor - */ - public AppointmentResponse(Reference appointment, CodeType participantStatus) { - super(); - this.appointment = appointment; - this.participantStatus = participantStatus; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment response concern 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.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this appointment response concern 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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public AppointmentResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #appointment} (Appointment that this response is replying to.) - */ - public Reference getAppointment() { - if (this.appointment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.appointment"); - else if (Configuration.doAutoCreate()) - this.appointment = new Reference(); // cc - return this.appointment; - } - - public boolean hasAppointment() { - return this.appointment != null && !this.appointment.isEmpty(); - } - - /** - * @param value {@link #appointment} (Appointment that this response is replying to.) - */ - public AppointmentResponse setAppointment(Reference value) { - this.appointment = value; - return this; - } - - /** - * @return {@link #appointment} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Appointment that this response is replying to.) - */ - public Appointment getAppointmentTarget() { - if (this.appointmentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.appointment"); - else if (Configuration.doAutoCreate()) - this.appointmentTarget = new Appointment(); // aa - return this.appointmentTarget; - } - - /** - * @param value {@link #appointment} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Appointment that this response is replying to.) - */ - public AppointmentResponse setAppointmentTarget(Appointment value) { - this.appointmentTarget = value; - return this; - } - - /** - * @return {@link #start} (Date/Time that the appointment is to take place, or requested new start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the appointment is to take place, or requested new start time.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public AppointmentResponse setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the appointment is to take place, or requested new start time. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value Date/Time that the appointment is to take place, or requested new start time. - */ - public AppointmentResponse setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public AppointmentResponse setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time. - */ - public AppointmentResponse setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - /** - * @return {@link #participantType} (Role of participant in the appointment.) - */ - public List getParticipantType() { - if (this.participantType == null) - this.participantType = new ArrayList(); - return this.participantType; - } - - public boolean hasParticipantType() { - if (this.participantType == null) - return false; - for (CodeableConcept item : this.participantType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participantType} (Role of participant in the appointment.) - */ - // syntactic sugar - public CodeableConcept addParticipantType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.participantType == null) - this.participantType = new ArrayList(); - this.participantType.add(t); - return t; - } - - // syntactic sugar - public AppointmentResponse addParticipantType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.participantType == null) - this.participantType = new ArrayList(); - this.participantType.add(t); - return this; - } - - /** - * @return {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentResponse setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Person, Location/HealthcareService or Device that is participating in the appointment.) - */ - public AppointmentResponse setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #participantStatus} (Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value - */ - public CodeType getParticipantStatusElement() { - if (this.participantStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.participantStatus"); - else if (Configuration.doAutoCreate()) - this.participantStatus = new CodeType(); // bb - return this.participantStatus; - } - - public boolean hasParticipantStatusElement() { - return this.participantStatus != null && !this.participantStatus.isEmpty(); - } - - public boolean hasParticipantStatus() { - return this.participantStatus != null && !this.participantStatus.isEmpty(); - } - - /** - * @param value {@link #participantStatus} (Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.). This is the underlying object with id, value and extensions. The accessor "getParticipantStatus" gives direct access to the value - */ - public AppointmentResponse setParticipantStatusElement(CodeType value) { - this.participantStatus = value; - return this; - } - - /** - * @return Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. - */ - public String getParticipantStatus() { - return this.participantStatus == null ? null : this.participantStatus.getValue(); - } - - /** - * @param value Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty. - */ - public AppointmentResponse setParticipantStatus(String value) { - if (this.participantStatus == null) - this.participantStatus = new CodeType(); - this.participantStatus.setValue(value); - return this; - } - - /** - * @return {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AppointmentResponse.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional comments about the appointment.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public AppointmentResponse setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional comments about the appointment. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional comments about the appointment. - */ - public AppointmentResponse setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this appointment response concern 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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("appointment", "Reference(Appointment)", "Appointment that this response is replying to.", 0, java.lang.Integer.MAX_VALUE, appointment)); - childrenList.add(new Property("start", "instant", "Date/Time that the appointment is to take place, or requested new start time.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "This may be either the same as the appointment request to confirm the details of the appointment, or alternately a new time to request a re-negotiation of the end time.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("participantType", "CodeableConcept", "Role of participant in the appointment.", 0, java.lang.Integer.MAX_VALUE, participantType)); - childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "A Person, Location/HealthcareService or Device that is participating in the appointment.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("participantStatus", "code", "Participation status of the participant. When the status is declined or tentative if the start/end times are different to the appointment, then these times should be interpreted as a requested time change. When the status is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be empty.", 0, java.lang.Integer.MAX_VALUE, participantStatus)); - childrenList.add(new Property("comment", "string", "Additional comments about the appointment.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1474995297: /*appointment*/ return this.appointment == null ? new Base[0] : new Base[] {this.appointment}; // Reference - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType - case 841294093: /*participantType*/ return this.participantType == null ? new Base[0] : this.participantType.toArray(new Base[this.participantType.size()]); // CodeableConcept - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case 996096261: /*participantStatus*/ return this.participantStatus == null ? new Base[0] : new Base[] {this.participantStatus}; // CodeType - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1474995297: // appointment - this.appointment = castToReference(value); // Reference - break; - case 109757538: // start - this.start = castToInstant(value); // InstantType - break; - case 100571: // end - this.end = castToInstant(value); // InstantType - break; - case 841294093: // participantType - this.getParticipantType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case 996096261: // participantStatus - this.participantStatus = castToCode(value); // CodeType - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("appointment")) - this.appointment = castToReference(value); // Reference - else if (name.equals("start")) - this.start = castToInstant(value); // InstantType - else if (name.equals("end")) - this.end = castToInstant(value); // InstantType - else if (name.equals("participantType")) - this.getParticipantType().add(castToCodeableConcept(value)); - else if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("participantStatus")) - this.participantStatus = castToCode(value); // CodeType - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1474995297: return getAppointment(); // Reference - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType - case 841294093: return addParticipantType(); // CodeableConcept - case 92645877: return getActor(); // Reference - case 996096261: throw new FHIRException("Cannot make property participantStatus as it is not a complex type"); // CodeType - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("appointment")) { - this.appointment = new Reference(); - return this.appointment; - } - else if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.end"); - } - else if (name.equals("participantType")) { - return addParticipantType(); - } - else if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("participantStatus")) { - throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.participantStatus"); - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type AppointmentResponse.comment"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "AppointmentResponse"; - - } - - public AppointmentResponse copy() { - AppointmentResponse dst = new AppointmentResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.appointment = appointment == null ? null : appointment.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - if (participantType != null) { - dst.participantType = new ArrayList(); - for (CodeableConcept i : participantType) - dst.participantType.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.participantStatus = participantStatus == null ? null : participantStatus.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - protected AppointmentResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AppointmentResponse)) - return false; - AppointmentResponse o = (AppointmentResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(appointment, o.appointment, true) - && compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(participantType, o.participantType, true) - && compareDeep(actor, o.actor, true) && compareDeep(participantStatus, o.participantStatus, true) - && compareDeep(comment, o.comment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AppointmentResponse)) - return false; - AppointmentResponse o = (AppointmentResponse) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(participantStatus, o.participantStatus, true) - && compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (appointment == null || appointment.isEmpty()) - && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) && (participantType == null || participantType.isEmpty()) - && (actor == null || actor.isEmpty()) && (participantStatus == null || participantStatus.isEmpty()) - && (comment == null || comment.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AppointmentResponse; - } - - /** - * Search parameter: patient - *

- * Description: This Response is for this Patient
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - @SearchParamDefinition(name="patient", path="AppointmentResponse.actor", description="This Response is for this Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: This Response is for this Patient
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AppointmentResponse:patient").toLocked(); - - /** - * Search parameter: practitioner - *

- * Description: This Response is for this Practitioner
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - @SearchParamDefinition(name="practitioner", path="AppointmentResponse.actor", description="This Response is for this Practitioner", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - /** - * Fluent Client search parameter constant for practitioner - *

- * Description: This Response is for this Practitioner
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse:practitioner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("AppointmentResponse:practitioner").toLocked(); - - /** - * Search parameter: location - *

- * Description: This Response is for this Location
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - @SearchParamDefinition(name="location", path="AppointmentResponse.actor", description="This Response is for this Location", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: This Response is for this Location
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("AppointmentResponse:location").toLocked(); - - /** - * Search parameter: part-status - *

- * Description: The participants acceptance status for this appointment
- * Type: token
- * Path: AppointmentResponse.participantStatus
- *

- */ - @SearchParamDefinition(name="part-status", path="AppointmentResponse.participantStatus", description="The participants acceptance status for this appointment", type="token" ) - public static final String SP_PART_STATUS = "part-status"; - /** - * Fluent Client search parameter constant for part-status - *

- * Description: The participants acceptance status for this appointment
- * Type: token
- * Path: AppointmentResponse.participantStatus
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PART_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PART_STATUS); - - /** - * Search parameter: actor - *

- * Description: The Person, Location/HealthcareService or Device that this appointment response replies for
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - @SearchParamDefinition(name="actor", path="AppointmentResponse.actor", description="The Person, Location/HealthcareService or Device that this appointment response replies for", type="reference" ) - public static final String SP_ACTOR = "actor"; - /** - * Fluent Client search parameter constant for actor - *

- * Description: The Person, Location/HealthcareService or Device that this appointment response replies for
- * Type: reference
- * Path: AppointmentResponse.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse:actor". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("AppointmentResponse:actor").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: An Identifier in this appointment response
- * Type: token
- * Path: AppointmentResponse.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="AppointmentResponse.identifier", description="An Identifier in this appointment response", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: An Identifier in this appointment response
- * Type: token
- * Path: AppointmentResponse.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam APPOINTMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_APPOINTMENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AppointmentResponse:appointment". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_APPOINTMENT = new ca.uhn.fhir.model.api.Include("AppointmentResponse:appointment").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Attachment.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Attachment.java deleted file mode 100644 index 4158482e5dd..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Attachment.java +++ /dev/null @@ -1,688 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * For referring to data content defined in other formats. - */ -@DatatypeDef(name="Attachment") -public class Attachment extends Type implements ICompositeType { - - /** - * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - @Child(name = "contentType", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) - protected CodeType contentType; - - /** - * The human language of the content. The value can be any valid value according to BCP 47. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human language of the content (BCP-47)", formalDefinition="The human language of the content. The value can be any valid value according to BCP 47." ) - protected CodeType language; - - /** - * The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - @Child(name = "data", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Data inline, base64ed", formalDefinition="The actual data of the attachment - a sequence of bytes. In XML, represented using base64." ) - protected Base64BinaryType data; - - /** - * An alternative location where the data can be accessed. - */ - @Child(name = "url", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Uri where the data can be found", formalDefinition="An alternative location where the data can be accessed." ) - protected UriType url; - - /** - * The number of bytes of data that make up this attachment. - */ - @Child(name = "size", type = {UnsignedIntType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) - protected UnsignedIntType size; - - /** - * The calculated hash of the data using SHA-1. Represented using base64. - */ - @Child(name = "hash", type = {Base64BinaryType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Hash of the data (sha-1, base64ed)", formalDefinition="The calculated hash of the data using SHA-1. Represented using base64." ) - protected Base64BinaryType hash; - - /** - * A label or set of text to display in place of the data. - */ - @Child(name = "title", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) - protected StringType title; - - /** - * The date that the attachment was first created. - */ - @Child(name = "creation", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date attachment was first created", formalDefinition="The date that the attachment was first created." ) - protected DateTimeType creation; - - private static final long serialVersionUID = 581007080L; - - /** - * Constructor - */ - public Attachment() { - super(); - } - - /** - * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Attachment setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public Attachment setContentType(String value) { - if (Utilities.noString(value)) - this.contentType = null; - else { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - } - return this; - } - - /** - * @return {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The human language of the content. The value can be any valid value according to BCP 47.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public Attachment setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The human language of the content. The value can be any valid value according to BCP 47. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The human language of the content. The value can be any valid value according to BCP 47. - */ - public Attachment setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public Base64BinaryType getDataElement() { - if (this.data == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.data"); - else if (Configuration.doAutoCreate()) - this.data = new Base64BinaryType(); // bb - return this.data; - } - - public boolean hasDataElement() { - return this.data != null && !this.data.isEmpty(); - } - - public boolean hasData() { - return this.data != null && !this.data.isEmpty(); - } - - /** - * @param value {@link #data} (The actual data of the attachment - a sequence of bytes. In XML, represented using base64.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public Attachment setDataElement(Base64BinaryType value) { - this.data = value; - return this; - } - - /** - * @return The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - public byte[] getData() { - return this.data == null ? null : this.data.getValue(); - } - - /** - * @param value The actual data of the attachment - a sequence of bytes. In XML, represented using base64. - */ - public Attachment setData(byte[] value) { - if (value == null) - this.data = null; - else { - if (this.data == null) - this.data = new Base64BinaryType(); - this.data.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An alternative location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Attachment setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An alternative location where the data can be accessed. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An alternative location where the data can be accessed. - */ - public Attachment setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public UnsignedIntType getSizeElement() { - if (this.size == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.size"); - else if (Configuration.doAutoCreate()) - this.size = new UnsignedIntType(); // bb - return this.size; - } - - public boolean hasSizeElement() { - return this.size != null && !this.size.isEmpty(); - } - - public boolean hasSize() { - return this.size != null && !this.size.isEmpty(); - } - - /** - * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public Attachment setSizeElement(UnsignedIntType value) { - this.size = value; - return this; - } - - /** - * @return The number of bytes of data that make up this attachment. - */ - public int getSize() { - return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); - } - - /** - * @param value The number of bytes of data that make up this attachment. - */ - public Attachment setSize(int value) { - if (this.size == null) - this.size = new UnsignedIntType(); - this.size.setValue(value); - return this; - } - - /** - * @return {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Base64BinaryType getHashElement() { - if (this.hash == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.hash"); - else if (Configuration.doAutoCreate()) - this.hash = new Base64BinaryType(); // bb - return this.hash; - } - - public boolean hasHashElement() { - return this.hash != null && !this.hash.isEmpty(); - } - - public boolean hasHash() { - return this.hash != null && !this.hash.isEmpty(); - } - - /** - * @param value {@link #hash} (The calculated hash of the data using SHA-1. Represented using base64.). This is the underlying object with id, value and extensions. The accessor "getHash" gives direct access to the value - */ - public Attachment setHashElement(Base64BinaryType value) { - this.hash = value; - return this; - } - - /** - * @return The calculated hash of the data using SHA-1. Represented using base64. - */ - public byte[] getHash() { - return this.hash == null ? null : this.hash.getValue(); - } - - /** - * @param value The calculated hash of the data using SHA-1. Represented using base64. - */ - public Attachment setHash(byte[] value) { - if (value == null) - this.hash = null; - else { - if (this.hash == null) - this.hash = new Base64BinaryType(); - this.hash.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Attachment setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A label or set of text to display in place of the data. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A label or set of text to display in place of the data. - */ - public Attachment setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value - */ - public DateTimeType getCreationElement() { - if (this.creation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Attachment.creation"); - else if (Configuration.doAutoCreate()) - this.creation = new DateTimeType(); // bb - return this.creation; - } - - public boolean hasCreationElement() { - return this.creation != null && !this.creation.isEmpty(); - } - - public boolean hasCreation() { - return this.creation != null && !this.creation.isEmpty(); - } - - /** - * @param value {@link #creation} (The date that the attachment was first created.). This is the underlying object with id, value and extensions. The accessor "getCreation" gives direct access to the value - */ - public Attachment setCreationElement(DateTimeType value) { - this.creation = value; - return this; - } - - /** - * @return The date that the attachment was first created. - */ - public Date getCreation() { - return this.creation == null ? null : this.creation.getValue(); - } - - /** - * @param value The date that the attachment was first created. - */ - public Attachment setCreation(Date value) { - if (value == null) - this.creation = null; - else { - if (this.creation == null) - this.creation = new DateTimeType(); - this.creation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("language", "code", "The human language of the content. The value can be any valid value according to BCP 47.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("data", "base64Binary", "The actual data of the attachment - a sequence of bytes. In XML, represented using base64.", 0, java.lang.Integer.MAX_VALUE, data)); - childrenList.add(new Property("url", "uri", "An alternative location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); - childrenList.add(new Property("hash", "base64Binary", "The calculated hash of the data using SHA-1. Represented using base64.", 0, java.lang.Integer.MAX_VALUE, hash)); - childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("creation", "dateTime", "The date that the attachment was first created.", 0, java.lang.Integer.MAX_VALUE, creation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // Base64BinaryType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // UnsignedIntType - case 3195150: /*hash*/ return this.hash == null ? new Base[0] : new Base[] {this.hash}; // Base64BinaryType - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 1820421855: /*creation*/ return this.creation == null ? new Base[0] : new Base[] {this.creation}; // DateTimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -389131437: // contentType - this.contentType = castToCode(value); // CodeType - break; - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - case 3076010: // data - this.data = castToBase64Binary(value); // Base64BinaryType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 3530753: // size - this.size = castToUnsignedInt(value); // UnsignedIntType - break; - case 3195150: // hash - this.hash = castToBase64Binary(value); // Base64BinaryType - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 1820421855: // creation - this.creation = castToDateTime(value); // DateTimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("contentType")) - this.contentType = castToCode(value); // CodeType - else if (name.equals("language")) - this.language = castToCode(value); // CodeType - else if (name.equals("data")) - this.data = castToBase64Binary(value); // Base64BinaryType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("size")) - this.size = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("hash")) - this.hash = castToBase64Binary(value); // Base64BinaryType - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("creation")) - this.creation = castToDateTime(value); // DateTimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - case 3076010: throw new FHIRException("Cannot make property data as it is not a complex type"); // Base64BinaryType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 3530753: throw new FHIRException("Cannot make property size as it is not a complex type"); // UnsignedIntType - case 3195150: throw new FHIRException("Cannot make property hash as it is not a complex type"); // Base64BinaryType - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 1820421855: throw new FHIRException("Cannot make property creation as it is not a complex type"); // DateTimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentType")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.contentType"); - } - else if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.language"); - } - else if (name.equals("data")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.data"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.url"); - } - else if (name.equals("size")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.size"); - } - else if (name.equals("hash")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.hash"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.title"); - } - else if (name.equals("creation")) { - throw new FHIRException("Cannot call addChild on a primitive type Attachment.creation"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Attachment"; - - } - - public Attachment copy() { - Attachment dst = new Attachment(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.language = language == null ? null : language.copy(); - dst.data = data == null ? null : data.copy(); - dst.url = url == null ? null : url.copy(); - dst.size = size == null ? null : size.copy(); - dst.hash = hash == null ? null : hash.copy(); - dst.title = title == null ? null : title.copy(); - dst.creation = creation == null ? null : creation.copy(); - return dst; - } - - protected Attachment typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Attachment)) - return false; - Attachment o = (Attachment) other; - return compareDeep(contentType, o.contentType, true) && compareDeep(language, o.language, true) - && compareDeep(data, o.data, true) && compareDeep(url, o.url, true) && compareDeep(size, o.size, true) - && compareDeep(hash, o.hash, true) && compareDeep(title, o.title, true) && compareDeep(creation, o.creation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Attachment)) - return false; - Attachment o = (Attachment) other; - return compareValues(contentType, o.contentType, true) && compareValues(language, o.language, true) - && compareValues(data, o.data, true) && compareValues(url, o.url, true) && compareValues(size, o.size, true) - && compareValues(hash, o.hash, true) && compareValues(title, o.title, true) && compareValues(creation, o.creation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (language == null || language.isEmpty()) - && (data == null || data.isEmpty()) && (url == null || url.isEmpty()) && (size == null || size.isEmpty()) - && (hash == null || hash.isEmpty()) && (title == null || title.isEmpty()) && (creation == null || creation.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AuditEvent.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AuditEvent.java deleted file mode 100644 index af9112b5e20..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/AuditEvent.java +++ /dev/null @@ -1,3682 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * 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. - */ -@ResourceDef(name="AuditEvent", profile="http://hl7.org/fhir/Profile/AuditEvent") -public class AuditEvent extends DomainResource { - - public enum AuditEventAction { - /** - * Create a new database object, such as placing an order. - */ - C, - /** - * Display or print data, such as a doctor census. - */ - R, - /** - * Update data, such as revise patient information. - */ - U, - /** - * Delete items, such as a doctor master file record. - */ - D, - /** - * Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation. - */ - E, - /** - * added to help the parsers - */ - NULL; - public static AuditEventAction fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return C; - if ("R".equals(codeString)) - return R; - if ("U".equals(codeString)) - return U; - if ("D".equals(codeString)) - return D; - if ("E".equals(codeString)) - return E; - throw new FHIRException("Unknown AuditEventAction code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case C: return "C"; - case R: return "R"; - case U: return "U"; - case D: return "D"; - case E: return "E"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case C: return "http://hl7.org/fhir/audit-event-action"; - case R: return "http://hl7.org/fhir/audit-event-action"; - case U: return "http://hl7.org/fhir/audit-event-action"; - case D: return "http://hl7.org/fhir/audit-event-action"; - case E: return "http://hl7.org/fhir/audit-event-action"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case C: return "Create a new database object, such as placing an order."; - case R: return "Display or print data, such as a doctor census."; - case U: return "Update data, such as revise patient information."; - case D: return "Delete items, such as a doctor master file record."; - case E: return "Perform a system or application function such as log-on, program execution or use of an object's method, or perform a query/search operation."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case C: return "Create"; - case R: return "Read/View/Print"; - case U: return "Update"; - case D: return "Delete"; - case E: return "Execute"; - default: return "?"; - } - } - } - - public static class AuditEventActionEnumFactory implements EnumFactory { - public AuditEventAction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return AuditEventAction.C; - if ("R".equals(codeString)) - return AuditEventAction.R; - if ("U".equals(codeString)) - return AuditEventAction.U; - if ("D".equals(codeString)) - return AuditEventAction.D; - if ("E".equals(codeString)) - return AuditEventAction.E; - throw new IllegalArgumentException("Unknown AuditEventAction code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("C".equals(codeString)) - return new Enumeration(this, AuditEventAction.C); - if ("R".equals(codeString)) - return new Enumeration(this, AuditEventAction.R); - if ("U".equals(codeString)) - return new Enumeration(this, AuditEventAction.U); - if ("D".equals(codeString)) - return new Enumeration(this, AuditEventAction.D); - if ("E".equals(codeString)) - return new Enumeration(this, AuditEventAction.E); - throw new FHIRException("Unknown AuditEventAction code '"+codeString+"'"); - } - public String toCode(AuditEventAction code) { - if (code == AuditEventAction.C) - return "C"; - if (code == AuditEventAction.R) - return "R"; - if (code == AuditEventAction.U) - return "U"; - if (code == AuditEventAction.D) - return "D"; - if (code == AuditEventAction.E) - return "E"; - return "?"; - } - public String toSystem(AuditEventAction code) { - return code.getSystem(); - } - } - - public enum AuditEventOutcome { - /** - * The operation completed successfully (whether with warnings or not). - */ - _0, - /** - * The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response). - */ - _4, - /** - * The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response). - */ - _8, - /** - * An error of such magnitude occurred that the system is no longer available for use (i.e. the system died). - */ - _12, - /** - * added to help the parsers - */ - NULL; - public static AuditEventOutcome fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return _0; - if ("4".equals(codeString)) - return _4; - if ("8".equals(codeString)) - return _8; - if ("12".equals(codeString)) - return _12; - throw new FHIRException("Unknown AuditEventOutcome code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _0: return "0"; - case _4: return "4"; - case _8: return "8"; - case _12: return "12"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _0: return "http://hl7.org/fhir/audit-event-outcome"; - case _4: return "http://hl7.org/fhir/audit-event-outcome"; - case _8: return "http://hl7.org/fhir/audit-event-outcome"; - case _12: return "http://hl7.org/fhir/audit-event-outcome"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _0: return "The operation completed successfully (whether with warnings or not)."; - case _4: return "The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response)."; - case _8: return "The action was not successful due to some kind of unexpected error (often equivalent to an HTTP 500 response)."; - case _12: return "An error of such magnitude occurred that the system is no longer available for use (i.e. the system died)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _0: return "Success"; - case _4: return "Minor failure"; - case _8: return "Serious failure"; - case _12: return "Major failure"; - default: return "?"; - } - } - } - - public static class AuditEventOutcomeEnumFactory implements EnumFactory { - public AuditEventOutcome fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return AuditEventOutcome._0; - if ("4".equals(codeString)) - return AuditEventOutcome._4; - if ("8".equals(codeString)) - return AuditEventOutcome._8; - if ("12".equals(codeString)) - return AuditEventOutcome._12; - throw new IllegalArgumentException("Unknown AuditEventOutcome code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("0".equals(codeString)) - return new Enumeration(this, AuditEventOutcome._0); - if ("4".equals(codeString)) - return new Enumeration(this, AuditEventOutcome._4); - if ("8".equals(codeString)) - return new Enumeration(this, AuditEventOutcome._8); - if ("12".equals(codeString)) - return new Enumeration(this, AuditEventOutcome._12); - throw new FHIRException("Unknown AuditEventOutcome code '"+codeString+"'"); - } - public String toCode(AuditEventOutcome code) { - if (code == AuditEventOutcome._0) - return "0"; - if (code == AuditEventOutcome._4) - return "4"; - if (code == AuditEventOutcome._8) - return "8"; - if (code == AuditEventOutcome._12) - return "12"; - return "?"; - } - public String toSystem(AuditEventOutcome code) { - return code.getSystem(); - } - } - - public enum AuditEventParticipantNetworkType { - /** - * The machine name, including DNS name. - */ - _1, - /** - * The assigned Internet Protocol (IP) address. - */ - _2, - /** - * The assigned telephone number. - */ - _3, - /** - * The assigned email address. - */ - _4, - /** - * URI (User directory, HTTP-PUT, ftp, etc.). - */ - _5, - /** - * added to help the parsers - */ - NULL; - public static AuditEventParticipantNetworkType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return _1; - if ("2".equals(codeString)) - return _2; - if ("3".equals(codeString)) - return _3; - if ("4".equals(codeString)) - return _4; - if ("5".equals(codeString)) - return _5; - throw new FHIRException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case _1: return "1"; - case _2: return "2"; - case _3: return "3"; - case _4: return "4"; - case _5: return "5"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case _1: return "http://hl7.org/fhir/network-type"; - case _2: return "http://hl7.org/fhir/network-type"; - case _3: return "http://hl7.org/fhir/network-type"; - case _4: return "http://hl7.org/fhir/network-type"; - case _5: return "http://hl7.org/fhir/network-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case _1: return "The machine name, including DNS name."; - case _2: return "The assigned Internet Protocol (IP) address."; - case _3: return "The assigned telephone number."; - case _4: return "The assigned email address."; - case _5: return "URI (User directory, HTTP-PUT, ftp, etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case _1: return "Machine Name"; - case _2: return "IP Address"; - case _3: return "Telephone Number"; - case _4: return "Email address"; - case _5: return "URI"; - default: return "?"; - } - } - } - - public static class AuditEventParticipantNetworkTypeEnumFactory implements EnumFactory { - public AuditEventParticipantNetworkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return AuditEventParticipantNetworkType._1; - if ("2".equals(codeString)) - return AuditEventParticipantNetworkType._2; - if ("3".equals(codeString)) - return AuditEventParticipantNetworkType._3; - if ("4".equals(codeString)) - return AuditEventParticipantNetworkType._4; - if ("5".equals(codeString)) - return AuditEventParticipantNetworkType._5; - throw new IllegalArgumentException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("1".equals(codeString)) - return new Enumeration(this, AuditEventParticipantNetworkType._1); - if ("2".equals(codeString)) - return new Enumeration(this, AuditEventParticipantNetworkType._2); - if ("3".equals(codeString)) - return new Enumeration(this, AuditEventParticipantNetworkType._3); - if ("4".equals(codeString)) - return new Enumeration(this, AuditEventParticipantNetworkType._4); - if ("5".equals(codeString)) - return new Enumeration(this, AuditEventParticipantNetworkType._5); - throw new FHIRException("Unknown AuditEventParticipantNetworkType code '"+codeString+"'"); - } - public String toCode(AuditEventParticipantNetworkType code) { - if (code == AuditEventParticipantNetworkType._1) - return "1"; - if (code == AuditEventParticipantNetworkType._2) - return "2"; - if (code == AuditEventParticipantNetworkType._3) - return "3"; - if (code == AuditEventParticipantNetworkType._4) - return "4"; - if (code == AuditEventParticipantNetworkType._5) - return "5"; - return "?"; - } - public String toSystem(AuditEventParticipantNetworkType code) { - return code.getSystem(); - } - } - - @Block() - public static class AuditEventAgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 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 access control security system (e.g. RBAC, ABAC) used in the local context. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Agent role in the event", 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 access control security system (e.g. RBAC, ABAC) used in the local context." ) - protected List role; - - /** - * Direct reference to a resource that identifies the agent. - */ - @Child(name = "reference", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the agent." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (Direct reference to a resource that identifies the agent.) - */ - protected Resource referenceTarget; - - /** - * Unique identifier for the user actively participating in the event. - */ - @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." ) - protected Identifier userId; - - /** - * Alternative agent 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. - */ - @Child(name = "altId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative agent 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." ) - protected StringType altId; - - /** - * Human-meaningful name for the agent. - */ - @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Human-meaningful name for the agent", formalDefinition="Human-meaningful name for the agent." ) - protected StringType name; - - /** - * Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - @Child(name = "requestor", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether user is initiator", formalDefinition="Indicator that the user is or is not the requestor, or initiator, for the event being audited." ) - protected BooleanType requestor; - - /** - * Where the event occurred. - */ - @Child(name = "location", type = {Location.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Where", formalDefinition="Where the event occurred." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Where the event occurred.) - */ - protected Location locationTarget; - - /** - * The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used. - */ - @Child(name = "policy", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Policy that authorized event", formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used." ) - protected List policy; - - /** - * Type of media involved. Used when the event is about exporting/importing onto media. - */ - @Child(name = "media", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." ) - protected Coding media; - - /** - * Logical network location for application activity, if the activity has a network location. - */ - @Child(name = "network", type = {}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." ) - protected AuditEventAgentNetworkComponent network; - - /** - * The reason (purpose of use), specific to this agent, that was used during the event being recorded. - */ - @Child(name = "purposeOfUse", type = {Coding.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Reason given for this user", formalDefinition="The reason (purpose of use), specific to this agent, that was used during the event being recorded." ) - protected List purposeOfUse; - - private static final long serialVersionUID = 1802747339L; - - /** - * Constructor - */ - public AuditEventAgentComponent() { - super(); - } - - /** - * Constructor - */ - public AuditEventAgentComponent(BooleanType requestor) { - super(); - this.requestor = requestor; - } - - /** - * @return {@link #role} (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 access control security system (e.g. RBAC, ABAC) used in the local context.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (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 access control security system (e.g. RBAC, ABAC) used in the local context.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public AuditEventAgentComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - /** - * @return {@link #reference} (Direct reference to a resource that identifies the agent.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Direct reference to a resource that identifies the agent.) - */ - public AuditEventAgentComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the agent.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Direct reference to a resource that identifies the agent.) - */ - public AuditEventAgentComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #userId} (Unique identifier for the user actively participating in the event.) - */ - public Identifier getUserId() { - if (this.userId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.userId"); - else if (Configuration.doAutoCreate()) - this.userId = new Identifier(); // cc - return this.userId; - } - - public boolean hasUserId() { - return this.userId != null && !this.userId.isEmpty(); - } - - /** - * @param value {@link #userId} (Unique identifier for the user actively participating in the event.) - */ - public AuditEventAgentComponent setUserId(Identifier value) { - this.userId = value; - return this; - } - - /** - * @return {@link #altId} (Alternative agent 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.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value - */ - public StringType getAltIdElement() { - if (this.altId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.altId"); - else if (Configuration.doAutoCreate()) - this.altId = new StringType(); // bb - return this.altId; - } - - public boolean hasAltIdElement() { - return this.altId != null && !this.altId.isEmpty(); - } - - public boolean hasAltId() { - return this.altId != null && !this.altId.isEmpty(); - } - - /** - * @param value {@link #altId} (Alternative agent 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.). This is the underlying object with id, value and extensions. The accessor "getAltId" gives direct access to the value - */ - public AuditEventAgentComponent setAltIdElement(StringType value) { - this.altId = value; - return this; - } - - /** - * @return Alternative agent 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 String getAltId() { - return this.altId == null ? null : this.altId.getValue(); - } - - /** - * @param value Alternative agent 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 AuditEventAgentComponent setAltId(String value) { - if (Utilities.noString(value)) - this.altId = null; - else { - if (this.altId == null) - this.altId = new StringType(); - this.altId.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (Human-meaningful name for the agent.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Human-meaningful name for the agent.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public AuditEventAgentComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-meaningful name for the agent. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-meaningful name for the agent. - */ - public AuditEventAgentComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value - */ - public BooleanType getRequestorElement() { - if (this.requestor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.requestor"); - else if (Configuration.doAutoCreate()) - this.requestor = new BooleanType(); // bb - return this.requestor; - } - - public boolean hasRequestorElement() { - return this.requestor != null && !this.requestor.isEmpty(); - } - - public boolean hasRequestor() { - return this.requestor != null && !this.requestor.isEmpty(); - } - - /** - * @param value {@link #requestor} (Indicator that the user is or is not the requestor, or initiator, for the event being audited.). This is the underlying object with id, value and extensions. The accessor "getRequestor" gives direct access to the value - */ - public AuditEventAgentComponent setRequestorElement(BooleanType value) { - this.requestor = value; - return this; - } - - /** - * @return Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - public boolean getRequestor() { - return this.requestor == null || this.requestor.isEmpty() ? false : this.requestor.getValue(); - } - - /** - * @param value Indicator that the user is or is not the requestor, or initiator, for the event being audited. - */ - public AuditEventAgentComponent setRequestor(boolean value) { - if (this.requestor == null) - this.requestor = new BooleanType(); - this.requestor.setValue(value); - return this; - } - - /** - * @return {@link #location} (Where the event occurred.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Where the event occurred.) - */ - public AuditEventAgentComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the event occurred.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the event occurred.) - */ - public AuditEventAgentComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - public List getPolicy() { - if (this.policy == null) - this.policy = new ArrayList(); - return this.policy; - } - - public boolean hasPolicy() { - if (this.policy == null) - return false; - for (UriType item : this.policy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - // syntactic sugar - public UriType addPolicyElement() {//2 - UriType t = new UriType(); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return t; - } - - /** - * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - public AuditEventAgentComponent addPolicy(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return this; - } - - /** - * @param value {@link #policy} (The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.) - */ - public boolean hasPolicy(String value) { - if (this.policy == null) - return false; - for (UriType v : this.policy) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) - */ - public Coding getMedia() { - if (this.media == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.media"); - else if (Configuration.doAutoCreate()) - this.media = new Coding(); // cc - return this.media; - } - - public boolean hasMedia() { - return this.media != null && !this.media.isEmpty(); - } - - /** - * @param value {@link #media} (Type of media involved. Used when the event is about exporting/importing onto media.) - */ - public AuditEventAgentComponent setMedia(Coding value) { - this.media = value; - return this; - } - - /** - * @return {@link #network} (Logical network location for application activity, if the activity has a network location.) - */ - public AuditEventAgentNetworkComponent getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentComponent.network"); - else if (Configuration.doAutoCreate()) - this.network = new AuditEventAgentNetworkComponent(); // cc - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (Logical network location for application activity, if the activity has a network location.) - */ - public AuditEventAgentComponent setNetwork(AuditEventAgentNetworkComponent value) { - this.network = value; - return this; - } - - /** - * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.) - */ - public List getPurposeOfUse() { - if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); - return this.purposeOfUse; - } - - public boolean hasPurposeOfUse() { - if (this.purposeOfUse == null) - return false; - for (Coding item : this.purposeOfUse) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #purposeOfUse} (The reason (purpose of use), specific to this agent, that was used during the event being recorded.) - */ - // syntactic sugar - public Coding addPurposeOfUse() { //3 - Coding t = new Coding(); - if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); - this.purposeOfUse.add(t); - return t; - } - - // syntactic sugar - public AuditEventAgentComponent addPurposeOfUse(Coding t) { //3 - if (t == null) - return this; - if (this.purposeOfUse == null) - this.purposeOfUse = new ArrayList(); - this.purposeOfUse.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "CodeableConcept", "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 access control security system (e.g. RBAC, ABAC) used in the local context.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("userId", "Identifier", "Unique identifier for the user actively participating in the event.", 0, java.lang.Integer.MAX_VALUE, userId)); - childrenList.add(new Property("altId", "string", "Alternative agent 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.", 0, java.lang.Integer.MAX_VALUE, altId)); - childrenList.add(new Property("name", "string", "Human-meaningful name for the agent.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("requestor", "boolean", "Indicator that the user is or is not the requestor, or initiator, for the event being audited.", 0, java.lang.Integer.MAX_VALUE, requestor)); - childrenList.add(new Property("location", "Reference(Location)", "Where the event occurred.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("policy", "uri", "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.", 0, java.lang.Integer.MAX_VALUE, policy)); - childrenList.add(new Property("media", "Coding", "Type of media involved. Used when the event is about exporting/importing onto media.", 0, java.lang.Integer.MAX_VALUE, media)); - childrenList.add(new Property("network", "", "Logical network location for application activity, if the activity has a network location.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("purposeOfUse", "Coding", "The reason (purpose of use), specific to this agent, that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfUse)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference - case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier - case 92912804: /*altId*/ return this.altId == null ? new Base[0] : new Base[] {this.altId}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 693934258: /*requestor*/ return this.requestor == null ? new Base[0] : new Base[] {this.requestor}; // BooleanType - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType - case 103772132: /*media*/ return this.media == null ? new Base[0] : new Base[] {this.media}; // Coding - case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // AuditEventAgentNetworkComponent - case -1881902670: /*purposeOfUse*/ return this.purposeOfUse == null ? new Base[0] : this.purposeOfUse.toArray(new Base[this.purposeOfUse.size()]); // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3506294: // role - this.getRole().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -925155509: // reference - this.reference = castToReference(value); // Reference - break; - case -836030906: // userId - this.userId = castToIdentifier(value); // Identifier - break; - case 92912804: // altId - this.altId = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 693934258: // requestor - this.requestor = castToBoolean(value); // BooleanType - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case -982670030: // policy - this.getPolicy().add(castToUri(value)); // UriType - break; - case 103772132: // media - this.media = castToCoding(value); // Coding - break; - case 1843485230: // network - this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent - break; - case -1881902670: // purposeOfUse - this.getPurposeOfUse().add(castToCoding(value)); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("role")) - this.getRole().add(castToCodeableConcept(value)); - else if (name.equals("reference")) - this.reference = castToReference(value); // Reference - else if (name.equals("userId")) - this.userId = castToIdentifier(value); // Identifier - else if (name.equals("altId")) - this.altId = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("requestor")) - this.requestor = castToBoolean(value); // BooleanType - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("policy")) - this.getPolicy().add(castToUri(value)); - else if (name.equals("media")) - this.media = castToCoding(value); // Coding - else if (name.equals("network")) - this.network = (AuditEventAgentNetworkComponent) value; // AuditEventAgentNetworkComponent - else if (name.equals("purposeOfUse")) - this.getPurposeOfUse().add(castToCoding(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3506294: return addRole(); // CodeableConcept - case -925155509: return getReference(); // Reference - case -836030906: return getUserId(); // Identifier - case 92912804: throw new FHIRException("Cannot make property altId as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 693934258: throw new FHIRException("Cannot make property requestor as it is not a complex type"); // BooleanType - case 1901043637: return getLocation(); // Reference - case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType - case 103772132: return getMedia(); // Coding - case 1843485230: return getNetwork(); // AuditEventAgentNetworkComponent - case -1881902670: return addPurposeOfUse(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("role")) { - return addRole(); - } - else if (name.equals("reference")) { - this.reference = new Reference(); - return this.reference; - } - else if (name.equals("userId")) { - this.userId = new Identifier(); - return this.userId; - } - else if (name.equals("altId")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.altId"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.name"); - } - else if (name.equals("requestor")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.requestor"); - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("policy")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.policy"); - } - else if (name.equals("media")) { - this.media = new Coding(); - return this.media; - } - else if (name.equals("network")) { - this.network = new AuditEventAgentNetworkComponent(); - return this.network; - } - else if (name.equals("purposeOfUse")) { - return addPurposeOfUse(); - } - else - return super.addChild(name); - } - - public AuditEventAgentComponent copy() { - AuditEventAgentComponent dst = new AuditEventAgentComponent(); - copyValues(dst); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - dst.reference = reference == null ? null : reference.copy(); - dst.userId = userId == null ? null : userId.copy(); - dst.altId = altId == null ? null : altId.copy(); - dst.name = name == null ? null : name.copy(); - dst.requestor = requestor == null ? null : requestor.copy(); - dst.location = location == null ? null : location.copy(); - if (policy != null) { - dst.policy = new ArrayList(); - for (UriType i : policy) - dst.policy.add(i.copy()); - }; - dst.media = media == null ? null : media.copy(); - dst.network = network == null ? null : network.copy(); - if (purposeOfUse != null) { - dst.purposeOfUse = new ArrayList(); - for (Coding i : purposeOfUse) - dst.purposeOfUse.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventAgentComponent)) - return false; - AuditEventAgentComponent o = (AuditEventAgentComponent) other; - return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(userId, o.userId, true) - && compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true) && compareDeep(requestor, o.requestor, true) - && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) && compareDeep(media, o.media, true) - && compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventAgentComponent)) - return false; - AuditEventAgentComponent o = (AuditEventAgentComponent) other; - return compareValues(altId, o.altId, true) && compareValues(name, o.name, true) && compareValues(requestor, o.requestor, true) - && compareValues(policy, o.policy, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (reference == null || reference.isEmpty()) - && (userId == null || userId.isEmpty()) && (altId == null || altId.isEmpty()) && (name == null || name.isEmpty()) - && (requestor == null || requestor.isEmpty()) && (location == null || location.isEmpty()) - && (policy == null || policy.isEmpty()) && (media == null || media.isEmpty()) && (network == null || network.isEmpty()) - && (purposeOfUse == null || purposeOfUse.isEmpty()); - } - - public String fhirType() { - return "AuditEvent.agent"; - - } - - } - - @Block() - public static class AuditEventAgentNetworkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier for the network access point of the user device for the audit event. - */ - @Child(name = "address", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @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." ) - protected StringType address; - - /** - * An identifier for the type of network access point that originated the audit event. - */ - @Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The type of network access point", formalDefinition="An identifier for the type of network access point that originated the audit event." ) - protected Enumeration type; - - private static final long serialVersionUID = -1355220390L; - - /** - * Constructor - */ - public AuditEventAgentNetworkComponent() { - super(); - } - - /** - * @return {@link #address} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value - */ - public StringType getAddressElement() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentNetworkComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new StringType(); // bb - return this.address; - } - - public boolean hasAddressElement() { - return this.address != null && !this.address.isEmpty(); - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (An identifier for the network access point of the user device for the audit event.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value - */ - public AuditEventAgentNetworkComponent setAddressElement(StringType value) { - this.address = value; - return this; - } - - /** - * @return An identifier for the network access point of the user device for the audit event. - */ - public String getAddress() { - return this.address == null ? null : this.address.getValue(); - } - - /** - * @param value An identifier for the network access point of the user device for the audit event. - */ - public AuditEventAgentNetworkComponent setAddress(String value) { - if (Utilities.noString(value)) - this.address = null; - else { - if (this.address == null) - this.address = new StringType(); - this.address.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventAgentNetworkComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new AuditEventParticipantNetworkTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (An identifier for the type of network access point that originated the audit event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AuditEventAgentNetworkComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return An identifier for the type of network access point that originated the audit event. - */ - public AuditEventParticipantNetworkType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value An identifier for the type of network access point that originated the audit event. - */ - public AuditEventAgentNetworkComponent setType(AuditEventParticipantNetworkType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new AuditEventParticipantNetworkTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("address", "string", "An identifier for the network access point of the user device for the audit event.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("type", "code", "An identifier for the type of network access point that originated the audit event.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1147692044: // address - this.address = castToString(value); // StringType - break; - case 3575610: // type - this.type = new AuditEventParticipantNetworkTypeEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("address")) - this.address = castToString(value); // StringType - else if (name.equals("type")) - this.type = new AuditEventParticipantNetworkTypeEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1147692044: throw new FHIRException("Cannot make property address as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("address")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.address"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type"); - } - else - return super.addChild(name); - } - - public AuditEventAgentNetworkComponent copy() { - AuditEventAgentNetworkComponent dst = new AuditEventAgentNetworkComponent(); - copyValues(dst); - dst.address = address == null ? null : address.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventAgentNetworkComponent)) - return false; - AuditEventAgentNetworkComponent o = (AuditEventAgentNetworkComponent) other; - return compareDeep(address, o.address, true) && compareDeep(type, o.type, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventAgentNetworkComponent)) - return false; - AuditEventAgentNetworkComponent o = (AuditEventAgentNetworkComponent) other; - return compareValues(address, o.address, true) && compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (address == null || address.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - public String fhirType() { - return "AuditEvent.agent.network"; - - } - - } - - @Block() - public static class AuditEventSourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. - */ - @Child(name = "site", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Logical source location within the enterprise", formalDefinition="Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group." ) - protected StringType site; - - /** - * Identifier of the source where the event was detected. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The identity of source detecting the event", formalDefinition="Identifier of the source where the event was detected." ) - protected Identifier identifier; - - /** - * Code specifying the type of source where event originated. - */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The type of source where event originated", formalDefinition="Code specifying the type of source where event originated." ) - protected List type; - - private static final long serialVersionUID = -1562673890L; - - /** - * Constructor - */ - public AuditEventSourceComponent() { - super(); - } - - /** - * Constructor - */ - public AuditEventSourceComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #site} (Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value - */ - public StringType getSiteElement() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventSourceComponent.site"); - else if (Configuration.doAutoCreate()) - this.site = new StringType(); // bb - return this.site; - } - - public boolean hasSiteElement() { - return this.site != null && !this.site.isEmpty(); - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group.). This is the underlying object with id, value and extensions. The accessor "getSite" gives direct access to the value - */ - public AuditEventSourceComponent setSiteElement(StringType value) { - this.site = value; - return this; - } - - /** - * @return Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. - */ - public String getSite() { - return this.site == null ? null : this.site.getValue(); - } - - /** - * @param value Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group. - */ - public AuditEventSourceComponent setSite(String value) { - if (Utilities.noString(value)) - this.site = null; - else { - if (this.site == null) - this.site = new StringType(); - this.site.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Identifier of the source where the event was detected.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventSourceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier of the source where the event was detected.) - */ - public AuditEventSourceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #type} (Code specifying the type of source where event originated.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Coding item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Code specifying the type of source where event originated.) - */ - // syntactic sugar - public Coding addType() { //3 - Coding t = new Coding(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public AuditEventSourceComponent addType(Coding t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("site", "string", "Logical source location within the healthcare enterprise network. For example, a hospital or other provider location within a multi-entity provider group.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("identifier", "Identifier", "Identifier of the source where the event was detected.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "Coding", "Code specifying the type of source where event originated.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3530567: // site - this.site = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 3575610: // type - this.getType().add(castToCoding(value)); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("site")) - this.site = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("type")) - this.getType().add(castToCoding(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3530567: throw new FHIRException("Cannot make property site as it is not a complex type"); // StringType - case -1618432855: return getIdentifier(); // Identifier - case 3575610: return addType(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("site")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.site"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("type")) { - return addType(); - } - else - return super.addChild(name); - } - - public AuditEventSourceComponent copy() { - AuditEventSourceComponent dst = new AuditEventSourceComponent(); - copyValues(dst); - dst.site = site == null ? null : site.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) - dst.type.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventSourceComponent)) - return false; - AuditEventSourceComponent o = (AuditEventSourceComponent) other; - return compareDeep(site, o.site, true) && compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventSourceComponent)) - return false; - AuditEventSourceComponent o = (AuditEventSourceComponent) other; - return compareValues(site, o.site, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (site == null || site.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (type == null || type.isEmpty()); - } - - public String fhirType() { - return "AuditEvent.source"; - - } - - } - - @Block() - public static class AuditEventEntityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies a specific instance of the entity. The reference should always be version specific. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific instance of object (e.g. versioned)", formalDefinition="Identifies a specific instance of the entity. The reference should always be version specific." ) - protected Identifier identifier; - - /** - * Identifies a specific instance of the entity. The reference should always be version specific. - */ - @Child(name = "reference", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific instance of resource (e.g. versioned)", formalDefinition="Identifies a specific instance of the entity. The reference should always be version specific." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - protected Resource referenceTarget; - - /** - * The type of the object that was involved in this audit event. - */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type of object involved", formalDefinition="The type of the object that was involved in this audit event." ) - protected Coding type; - - /** - * Code representing the role the entity played in the event being audited. - */ - @Child(name = "role", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="What role the entity played", formalDefinition="Code representing the role the entity played in the event being audited." ) - protected Coding role; - - /** - * Identifier for the data life-cycle stage for the entity. - */ - @Child(name = "lifecycle", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Life-cycle stage for the object", formalDefinition="Identifier for the data life-cycle stage for the entity." ) - protected Coding lifecycle; - - /** - * Denotes security labels for the identified entity. - */ - @Child(name = "securityLabel", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Security labels applied to the object", formalDefinition="Denotes security labels for the identified entity." ) - protected List securityLabel; - - /** - * A name of the entity in the audit event. - */ - @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Descriptor for entity", formalDefinition="A name of the entity in the audit event." ) - protected StringType name; - - /** - * Text that describes the entity in more detail. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Descriptive text", formalDefinition="Text that describes the entity in more detail." ) - protected StringType description; - - /** - * The query parameters for a query-type entities. - */ - @Child(name = "query", type = {Base64BinaryType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Query parameters", formalDefinition="The query parameters for a query-type entities." ) - protected Base64BinaryType query; - - /** - * Additional Information about the entity. - */ - @Child(name = "detail", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional Information about the entity", formalDefinition="Additional Information about the entity." ) - protected List detail; - - private static final long serialVersionUID = -1393424632L; - - /** - * Constructor - */ - public AuditEventEntityComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - public AuditEventEntityComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #reference} (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - public AuditEventEntityComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies a specific instance of the entity. The reference should always be version specific.) - */ - public AuditEventEntityComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #type} (The type of the object that was involved in this audit event.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the object that was involved in this audit event.) - */ - public AuditEventEntityComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #role} (Code representing the role the entity played in the event being audited.) - */ - public Coding getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Coding(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Code representing the role the entity played in the event being audited.) - */ - public AuditEventEntityComponent setRole(Coding value) { - this.role = value; - return this; - } - - /** - * @return {@link #lifecycle} (Identifier for the data life-cycle stage for the entity.) - */ - public Coding getLifecycle() { - if (this.lifecycle == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.lifecycle"); - else if (Configuration.doAutoCreate()) - this.lifecycle = new Coding(); // cc - return this.lifecycle; - } - - public boolean hasLifecycle() { - return this.lifecycle != null && !this.lifecycle.isEmpty(); - } - - /** - * @param value {@link #lifecycle} (Identifier for the data life-cycle stage for the entity.) - */ - public AuditEventEntityComponent setLifecycle(Coding value) { - this.lifecycle = value; - return this; - } - - /** - * @return {@link #securityLabel} (Denotes security labels for the identified entity.) - */ - public List getSecurityLabel() { - if (this.securityLabel == null) - this.securityLabel = new ArrayList(); - return this.securityLabel; - } - - public boolean hasSecurityLabel() { - if (this.securityLabel == null) - return false; - for (Coding item : this.securityLabel) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #securityLabel} (Denotes security labels for the identified entity.) - */ - // syntactic sugar - public Coding addSecurityLabel() { //3 - Coding t = new Coding(); - if (this.securityLabel == null) - this.securityLabel = new ArrayList(); - this.securityLabel.add(t); - return t; - } - - // syntactic sugar - public AuditEventEntityComponent addSecurityLabel(Coding t) { //3 - if (t == null) - return this; - if (this.securityLabel == null) - this.securityLabel = new ArrayList(); - this.securityLabel.add(t); - return this; - } - - /** - * @return {@link #name} (A name of the entity in the audit event.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name of the entity in the audit event.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public AuditEventEntityComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name of the entity in the audit event. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name of the entity in the audit event. - */ - public AuditEventEntityComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Text that describes the entity in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text that describes the entity in more detail.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public AuditEventEntityComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text that describes the entity in more detail. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text that describes the entity in more detail. - */ - public AuditEventEntityComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #query} (The query parameters for a query-type entities.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value - */ - public Base64BinaryType getQueryElement() { - if (this.query == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityComponent.query"); - else if (Configuration.doAutoCreate()) - this.query = new Base64BinaryType(); // bb - return this.query; - } - - public boolean hasQueryElement() { - return this.query != null && !this.query.isEmpty(); - } - - public boolean hasQuery() { - return this.query != null && !this.query.isEmpty(); - } - - /** - * @param value {@link #query} (The query parameters for a query-type entities.). This is the underlying object with id, value and extensions. The accessor "getQuery" gives direct access to the value - */ - public AuditEventEntityComponent setQueryElement(Base64BinaryType value) { - this.query = value; - return this; - } - - /** - * @return The query parameters for a query-type entities. - */ - public byte[] getQuery() { - return this.query == null ? null : this.query.getValue(); - } - - /** - * @param value The query parameters for a query-type entities. - */ - public AuditEventEntityComponent setQuery(byte[] value) { - if (value == null) - this.query = null; - else { - if (this.query == null) - this.query = new Base64BinaryType(); - this.query.setValue(value); - } - return this; - } - - /** - * @return {@link #detail} (Additional Information about the entity.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (AuditEventEntityDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Additional Information about the entity.) - */ - // syntactic sugar - public AuditEventEntityDetailComponent addDetail() { //3 - AuditEventEntityDetailComponent t = new AuditEventEntityDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public AuditEventEntityComponent addDetail(AuditEventEntityDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifies a specific instance of the entity. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("reference", "Reference(Any)", "Identifies a specific instance of the entity. The reference should always be version specific.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("type", "Coding", "The type of the object that was involved in this audit event.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("role", "Coding", "Code representing the role the entity played in the event being audited.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("lifecycle", "Coding", "Identifier for the data life-cycle stage for the entity.", 0, java.lang.Integer.MAX_VALUE, lifecycle)); - childrenList.add(new Property("securityLabel", "Coding", "Denotes security labels for the identified entity.", 0, java.lang.Integer.MAX_VALUE, securityLabel)); - childrenList.add(new Property("name", "string", "A name of the entity in the audit event.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Text that describes the entity in more detail.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("query", "base64Binary", "The query parameters for a query-type entities.", 0, java.lang.Integer.MAX_VALUE, query)); - childrenList.add(new Property("detail", "", "Additional Information about the entity.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding - case -302323862: /*lifecycle*/ return this.lifecycle == null ? new Base[0] : new Base[] {this.lifecycle}; // Coding - case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // Coding - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 107944136: /*query*/ return this.query == null ? new Base[0] : new Base[] {this.query}; // Base64BinaryType - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AuditEventEntityDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -925155509: // reference - this.reference = castToReference(value); // Reference - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 3506294: // role - this.role = castToCoding(value); // Coding - break; - case -302323862: // lifecycle - this.lifecycle = castToCoding(value); // Coding - break; - case -722296940: // securityLabel - this.getSecurityLabel().add(castToCoding(value)); // Coding - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 107944136: // query - this.query = castToBase64Binary(value); // Base64BinaryType - break; - case -1335224239: // detail - this.getDetail().add((AuditEventEntityDetailComponent) value); // AuditEventEntityDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("reference")) - this.reference = castToReference(value); // Reference - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("role")) - this.role = castToCoding(value); // Coding - else if (name.equals("lifecycle")) - this.lifecycle = castToCoding(value); // Coding - else if (name.equals("securityLabel")) - this.getSecurityLabel().add(castToCoding(value)); - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("query")) - this.query = castToBase64Binary(value); // Base64BinaryType - else if (name.equals("detail")) - this.getDetail().add((AuditEventEntityDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -925155509: return getReference(); // Reference - case 3575610: return getType(); // Coding - case 3506294: return getRole(); // Coding - case -302323862: return getLifecycle(); // Coding - case -722296940: return addSecurityLabel(); // Coding - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 107944136: throw new FHIRException("Cannot make property query as it is not a complex type"); // Base64BinaryType - case -1335224239: return addDetail(); // AuditEventEntityDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("reference")) { - this.reference = new Reference(); - return this.reference; - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("role")) { - this.role = new Coding(); - return this.role; - } - else if (name.equals("lifecycle")) { - this.lifecycle = new Coding(); - return this.lifecycle; - } - else if (name.equals("securityLabel")) { - return addSecurityLabel(); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.description"); - } - else if (name.equals("query")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.query"); - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public AuditEventEntityComponent copy() { - AuditEventEntityComponent dst = new AuditEventEntityComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.type = type == null ? null : type.copy(); - dst.role = role == null ? null : role.copy(); - dst.lifecycle = lifecycle == null ? null : lifecycle.copy(); - if (securityLabel != null) { - dst.securityLabel = new ArrayList(); - for (Coding i : securityLabel) - dst.securityLabel.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.query = query == null ? null : query.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (AuditEventEntityDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventEntityComponent)) - return false; - AuditEventEntityComponent o = (AuditEventEntityComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) - && compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(lifecycle, o.lifecycle, true) - && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) - && compareDeep(query, o.query, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventEntityComponent)) - return false; - AuditEventEntityComponent o = (AuditEventEntityComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(query, o.query, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) - && (type == null || type.isEmpty()) && (role == null || role.isEmpty()) && (lifecycle == null || lifecycle.isEmpty()) - && (securityLabel == null || securityLabel.isEmpty()) && (name == null || name.isEmpty()) - && (description == null || description.isEmpty()) && (query == null || query.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - public String fhirType() { - return "AuditEvent.entity"; - - } - - } - - @Block() - public static class AuditEventEntityDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name of the property. - */ - @Child(name = "type", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of the property", formalDefinition="Name of the property." ) - protected StringType type; - - /** - * Property value. - */ - @Child(name = "value", type = {Base64BinaryType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Property value", formalDefinition="Property value." ) - protected Base64BinaryType value; - - private static final long serialVersionUID = 11139504L; - - /** - * Constructor - */ - public AuditEventEntityDetailComponent() { - super(); - } - - /** - * Constructor - */ - public AuditEventEntityDetailComponent(StringType type, Base64BinaryType value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Name of the property.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public AuditEventEntityDetailComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return Name of the property. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Name of the property. - */ - public AuditEventEntityDetailComponent setType(String value) { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Base64BinaryType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new Base64BinaryType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AuditEventEntityDetailComponent setValueElement(Base64BinaryType value) { - this.value = value; - return this; - } - - /** - * @return Property value. - */ - public byte[] getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value Property value. - */ - public AuditEventEntityDetailComponent setValue(byte[] value) { - if (this.value == null) - this.value = new Base64BinaryType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "string", "Name of the property.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "base64Binary", "Property value.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Base64BinaryType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToString(value); // StringType - break; - case 111972721: // value - this.value = castToBase64Binary(value); // Base64BinaryType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToString(value); // StringType - else if (name.equals("value")) - this.value = castToBase64Binary(value); // Base64BinaryType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // Base64BinaryType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.value"); - } - else - return super.addChild(name); - } - - public AuditEventEntityDetailComponent copy() { - AuditEventEntityDetailComponent dst = new AuditEventEntityDetailComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEventEntityDetailComponent)) - return false; - AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEventEntityDetailComponent)) - return false; - AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other; - return compareValues(type, o.type, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "AuditEvent.entity.detail"; - - } - - } - - /** - * Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function. - */ - @Child(name = "type", type = {Coding.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type/identifier of event", formalDefinition="Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function." ) - protected Coding type; - - /** - * Identifier for the category of event. - */ - @Child(name = "subtype", type = {Coding.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="More specific type/id for the event", formalDefinition="Identifier for the category of event." ) - protected List subtype; - - /** - * Indicator for type of action performed during the event that generated the audit. - */ - @Child(name = "action", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of action performed during the event", formalDefinition="Indicator for type of action performed during the event that generated the audit." ) - protected Enumeration action; - - /** - * The time when the event occurred on the source. - */ - @Child(name = "recorded", type = {InstantType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." ) - protected InstantType recorded; - - /** - * Indicates whether the event succeeded or failed. - */ - @Child(name = "outcome", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." ) - protected Enumeration outcome; - - /** - * A free text description of the outcome of the event. - */ - @Child(name = "outcomeDesc", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." ) - protected StringType outcomeDesc; - - /** - * The purposeOfUse (reason) that was used during the event being recorded. - */ - @Child(name = "purposeOfEvent", type = {Coding.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." ) - protected List purposeOfEvent; - - /** - * An actor taking an active role in the event or activity that is logged. - */ - @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Actor involved in the event", formalDefinition="An actor taking an active role in the event or activity that is logged." ) - protected List agent; - - /** - * Application systems and processes. - */ - @Child(name = "source", type = {}, order=8, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Application systems and processes", formalDefinition="Application systems and processes." ) - protected AuditEventSourceComponent source; - - /** - * Specific instances of data or objects that have been accessed. - */ - @Child(name = "entity", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Specific instances of data or objects that have been accessed", formalDefinition="Specific instances of data or objects that have been accessed." ) - protected List entity; - - private static final long serialVersionUID = 945153702L; - - /** - * Constructor - */ - public AuditEvent() { - super(); - } - - /** - * Constructor - */ - public AuditEvent(Coding type, InstantType recorded, AuditEventSourceComponent source) { - super(); - this.type = type; - this.recorded = recorded; - this.source = source; - } - - /** - * @return {@link #type} (Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.) - */ - public AuditEvent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #subtype} (Identifier for the category of event.) - */ - public List getSubtype() { - if (this.subtype == null) - this.subtype = new ArrayList(); - return this.subtype; - } - - public boolean hasSubtype() { - if (this.subtype == null) - return false; - for (Coding item : this.subtype) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subtype} (Identifier for the category of event.) - */ - // syntactic sugar - public Coding addSubtype() { //3 - Coding t = new Coding(); - if (this.subtype == null) - this.subtype = new ArrayList(); - this.subtype.add(t); - return t; - } - - // syntactic sugar - public AuditEvent addSubtype(Coding t) { //3 - if (t == null) - return this; - if (this.subtype == null) - this.subtype = new ArrayList(); - this.subtype.add(t); - return this; - } - - /** - * @return {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public Enumeration getActionElement() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.action"); - else if (Configuration.doAutoCreate()) - this.action = new Enumeration(new AuditEventActionEnumFactory()); // bb - return this.action; - } - - public boolean hasActionElement() { - return this.action != null && !this.action.isEmpty(); - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (Indicator for type of action performed during the event that generated the audit.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public AuditEvent setActionElement(Enumeration value) { - this.action = value; - return this; - } - - /** - * @return Indicator for type of action performed during the event that generated the audit. - */ - public AuditEventAction getAction() { - return this.action == null ? null : this.action.getValue(); - } - - /** - * @param value Indicator for type of action performed during the event that generated the audit. - */ - public AuditEvent setAction(AuditEventAction value) { - if (value == null) - this.action = null; - else { - if (this.action == null) - this.action = new Enumeration(new AuditEventActionEnumFactory()); - this.action.setValue(value); - } - return this; - } - - /** - * @return {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public InstantType getRecordedElement() { - if (this.recorded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.recorded"); - else if (Configuration.doAutoCreate()) - this.recorded = new InstantType(); // bb - return this.recorded; - } - - public boolean hasRecordedElement() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - public boolean hasRecorded() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - /** - * @param value {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public AuditEvent setRecordedElement(InstantType value) { - this.recorded = value; - return this; - } - - /** - * @return The time when the event occurred on the source. - */ - public Date getRecorded() { - return this.recorded == null ? null : this.recorded.getValue(); - } - - /** - * @param value The time when the event occurred on the source. - */ - public AuditEvent setRecorded(Date value) { - if (this.recorded == null) - this.recorded = new InstantType(); - this.recorded.setValue(value); - return this; - } - - /** - * @return {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Indicates whether the event succeeded or failed.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public AuditEvent setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Indicates whether the event succeeded or failed. - */ - public AuditEventOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Indicates whether the event succeeded or failed. - */ - public AuditEvent setOutcome(AuditEventOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new AuditEventOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value - */ - public StringType getOutcomeDescElement() { - if (this.outcomeDesc == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.outcomeDesc"); - else if (Configuration.doAutoCreate()) - this.outcomeDesc = new StringType(); // bb - return this.outcomeDesc; - } - - public boolean hasOutcomeDescElement() { - return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); - } - - public boolean hasOutcomeDesc() { - return this.outcomeDesc != null && !this.outcomeDesc.isEmpty(); - } - - /** - * @param value {@link #outcomeDesc} (A free text description of the outcome of the event.). This is the underlying object with id, value and extensions. The accessor "getOutcomeDesc" gives direct access to the value - */ - public AuditEvent setOutcomeDescElement(StringType value) { - this.outcomeDesc = value; - return this; - } - - /** - * @return A free text description of the outcome of the event. - */ - public String getOutcomeDesc() { - return this.outcomeDesc == null ? null : this.outcomeDesc.getValue(); - } - - /** - * @param value A free text description of the outcome of the event. - */ - public AuditEvent setOutcomeDesc(String value) { - if (Utilities.noString(value)) - this.outcomeDesc = null; - else { - if (this.outcomeDesc == null) - this.outcomeDesc = new StringType(); - this.outcomeDesc.setValue(value); - } - return this; - } - - /** - * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) - */ - public List getPurposeOfEvent() { - if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); - return this.purposeOfEvent; - } - - public boolean hasPurposeOfEvent() { - if (this.purposeOfEvent == null) - return false; - for (Coding item : this.purposeOfEvent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #purposeOfEvent} (The purposeOfUse (reason) that was used during the event being recorded.) - */ - // syntactic sugar - public Coding addPurposeOfEvent() { //3 - Coding t = new Coding(); - if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); - this.purposeOfEvent.add(t); - return t; - } - - // syntactic sugar - public AuditEvent addPurposeOfEvent(Coding t) { //3 - if (t == null) - return this; - if (this.purposeOfEvent == null) - this.purposeOfEvent = new ArrayList(); - this.purposeOfEvent.add(t); - return this; - } - - /** - * @return {@link #agent} (An actor taking an active role in the event or activity that is logged.) - */ - public List getAgent() { - if (this.agent == null) - this.agent = new ArrayList(); - return this.agent; - } - - public boolean hasAgent() { - if (this.agent == null) - return false; - for (AuditEventAgentComponent item : this.agent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #agent} (An actor taking an active role in the event or activity that is logged.) - */ - // syntactic sugar - public AuditEventAgentComponent addAgent() { //3 - AuditEventAgentComponent t = new AuditEventAgentComponent(); - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return t; - } - - // syntactic sugar - public AuditEvent addAgent(AuditEventAgentComponent t) { //3 - if (t == null) - return this; - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return this; - } - - /** - * @return {@link #source} (Application systems and processes.) - */ - public AuditEventSourceComponent getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AuditEvent.source"); - else if (Configuration.doAutoCreate()) - this.source = new AuditEventSourceComponent(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Application systems and processes.) - */ - public AuditEvent setSource(AuditEventSourceComponent value) { - this.source = value; - return this; - } - - /** - * @return {@link #entity} (Specific instances of data or objects that have been accessed.) - */ - public List getEntity() { - if (this.entity == null) - this.entity = new ArrayList(); - return this.entity; - } - - public boolean hasEntity() { - if (this.entity == null) - return false; - for (AuditEventEntityComponent item : this.entity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entity} (Specific instances of data or objects that have been accessed.) - */ - // syntactic sugar - public AuditEventEntityComponent addEntity() { //3 - AuditEventEntityComponent t = new AuditEventEntityComponent(); - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return t; - } - - // syntactic sugar - public AuditEvent addEntity(AuditEventEntityComponent t) { //3 - if (t == null) - return this; - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "Coding", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("recorded", "instant", "The time when the event occurred on the source.", 0, java.lang.Integer.MAX_VALUE, recorded)); - childrenList.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, java.lang.Integer.MAX_VALUE, outcomeDesc)); - childrenList.add(new Property("purposeOfEvent", "Coding", "The purposeOfUse (reason) that was used during the event being recorded.", 0, java.lang.Integer.MAX_VALUE, purposeOfEvent)); - childrenList.add(new Property("agent", "", "An actor taking an active role in the event or activity that is logged.", 0, java.lang.Integer.MAX_VALUE, agent)); - childrenList.add(new Property("source", "", "Application systems and processes.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("entity", "", "Specific instances of data or objects that have been accessed.", 0, java.lang.Integer.MAX_VALUE, entity)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : this.subtype.toArray(new Base[this.subtype.size()]); // Coding - case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration - case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 1062502659: /*outcomeDesc*/ return this.outcomeDesc == null ? new Base[0] : new Base[] {this.outcomeDesc}; // StringType - case -341917691: /*purposeOfEvent*/ return this.purposeOfEvent == null ? new Base[0] : this.purposeOfEvent.toArray(new Base[this.purposeOfEvent.size()]); // Coding - case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AuditEventAgentComponent - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // AuditEventSourceComponent - case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // AuditEventEntityComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -1867567750: // subtype - this.getSubtype().add(castToCoding(value)); // Coding - break; - case -1422950858: // action - this.action = new AuditEventActionEnumFactory().fromType(value); // Enumeration - break; - case -799233872: // recorded - this.recorded = castToInstant(value); // InstantType - break; - case -1106507950: // outcome - this.outcome = new AuditEventOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 1062502659: // outcomeDesc - this.outcomeDesc = castToString(value); // StringType - break; - case -341917691: // purposeOfEvent - this.getPurposeOfEvent().add(castToCoding(value)); // Coding - break; - case 92750597: // agent - this.getAgent().add((AuditEventAgentComponent) value); // AuditEventAgentComponent - break; - case -896505829: // source - this.source = (AuditEventSourceComponent) value; // AuditEventSourceComponent - break; - case -1298275357: // entity - this.getEntity().add((AuditEventEntityComponent) value); // AuditEventEntityComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("subtype")) - this.getSubtype().add(castToCoding(value)); - else if (name.equals("action")) - this.action = new AuditEventActionEnumFactory().fromType(value); // Enumeration - else if (name.equals("recorded")) - this.recorded = castToInstant(value); // InstantType - else if (name.equals("outcome")) - this.outcome = new AuditEventOutcomeEnumFactory().fromType(value); // Enumeration - else if (name.equals("outcomeDesc")) - this.outcomeDesc = castToString(value); // StringType - else if (name.equals("purposeOfEvent")) - this.getPurposeOfEvent().add(castToCoding(value)); - else if (name.equals("agent")) - this.getAgent().add((AuditEventAgentComponent) value); - else if (name.equals("source")) - this.source = (AuditEventSourceComponent) value; // AuditEventSourceComponent - else if (name.equals("entity")) - this.getEntity().add((AuditEventEntityComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case -1867567750: return addSubtype(); // Coding - case -1422950858: throw new FHIRException("Cannot make property action as it is not a complex type"); // Enumeration - case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 1062502659: throw new FHIRException("Cannot make property outcomeDesc as it is not a complex type"); // StringType - case -341917691: return addPurposeOfEvent(); // Coding - case 92750597: return addAgent(); // AuditEventAgentComponent - case -896505829: return getSource(); // AuditEventSourceComponent - case -1298275357: return addEntity(); // AuditEventEntityComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("subtype")) { - return addSubtype(); - } - else if (name.equals("action")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.action"); - } - else if (name.equals("recorded")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.recorded"); - } - else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.outcome"); - } - else if (name.equals("outcomeDesc")) { - throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.outcomeDesc"); - } - else if (name.equals("purposeOfEvent")) { - return addPurposeOfEvent(); - } - else if (name.equals("agent")) { - return addAgent(); - } - else if (name.equals("source")) { - this.source = new AuditEventSourceComponent(); - return this.source; - } - else if (name.equals("entity")) { - return addEntity(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "AuditEvent"; - - } - - public AuditEvent copy() { - AuditEvent dst = new AuditEvent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (subtype != null) { - dst.subtype = new ArrayList(); - for (Coding i : subtype) - dst.subtype.add(i.copy()); - }; - dst.action = action == null ? null : action.copy(); - dst.recorded = recorded == null ? null : recorded.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy(); - if (purposeOfEvent != null) { - dst.purposeOfEvent = new ArrayList(); - for (Coding i : purposeOfEvent) - dst.purposeOfEvent.add(i.copy()); - }; - if (agent != null) { - dst.agent = new ArrayList(); - for (AuditEventAgentComponent i : agent) - dst.agent.add(i.copy()); - }; - dst.source = source == null ? null : source.copy(); - if (entity != null) { - dst.entity = new ArrayList(); - for (AuditEventEntityComponent i : entity) - dst.entity.add(i.copy()); - }; - return dst; - } - - protected AuditEvent typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AuditEvent)) - return false; - AuditEvent o = (AuditEvent) other; - return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(action, o.action, true) - && compareDeep(recorded, o.recorded, true) && compareDeep(outcome, o.outcome, true) && compareDeep(outcomeDesc, o.outcomeDesc, true) - && compareDeep(purposeOfEvent, o.purposeOfEvent, true) && compareDeep(agent, o.agent, true) && compareDeep(source, o.source, true) - && compareDeep(entity, o.entity, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AuditEvent)) - return false; - AuditEvent o = (AuditEvent) other; - return compareValues(action, o.action, true) && compareValues(recorded, o.recorded, true) && compareValues(outcome, o.outcome, true) - && compareValues(outcomeDesc, o.outcomeDesc, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (subtype == null || subtype.isEmpty()) - && (action == null || action.isEmpty()) && (recorded == null || recorded.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (outcomeDesc == null || outcomeDesc.isEmpty()) && (purposeOfEvent == null || purposeOfEvent.isEmpty()) - && (agent == null || agent.isEmpty()) && (source == null || source.isEmpty()) && (entity == null || entity.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.AuditEvent; - } - - /** - * Search parameter: site - *

- * Description: Logical source location within the enterprise
- * Type: token
- * Path: AuditEvent.source.site
- *

- */ - @SearchParamDefinition(name="site", path="AuditEvent.source.site", description="Logical source location within the enterprise", type="token" ) - public static final String SP_SITE = "site"; - /** - * Fluent Client search parameter constant for site - *

- * Description: Logical source location within the enterprise
- * Type: token
- * Path: AuditEvent.source.site
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SITE); - - /** - * Search parameter: entity - *

- * Description: Specific instance of resource (e.g. versioned)
- * Type: reference
- * Path: AuditEvent.entity.reference
- *

- */ - @SearchParamDefinition(name="entity", path="AuditEvent.entity.reference", description="Specific instance of resource (e.g. versioned)", type="reference" ) - public static final String SP_ENTITY = "entity"; - /** - * Fluent Client search parameter constant for entity - *

- * Description: Specific instance of resource (e.g. versioned)
- * Type: reference
- * Path: AuditEvent.entity.reference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTITY); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AuditEvent:entity". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTITY = new ca.uhn.fhir.model.api.Include("AuditEvent:entity").toLocked(); - - /** - * Search parameter: entity-type - *

- * Description: Type of object involved
- * Type: token
- * Path: AuditEvent.entity.type
- *

- */ - @SearchParamDefinition(name="entity-type", path="AuditEvent.entity.type", description="Type of object involved", type="token" ) - public static final String SP_ENTITY_TYPE = "entity-type"; - /** - * Fluent Client search parameter constant for entity-type - *

- * Description: Type of object involved
- * Type: token
- * Path: AuditEvent.entity.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE); - - /** - * Search parameter: type - *

- * Description: Type/identifier of event
- * Type: token
- * Path: AuditEvent.type
- *

- */ - @SearchParamDefinition(name="type", path="AuditEvent.type", description="Type/identifier of event", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Type/identifier of event
- * Type: token
- * Path: AuditEvent.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: Time when the event occurred on source
- * Type: date
- * Path: AuditEvent.recorded
- *

- */ - @SearchParamDefinition(name="date", path="AuditEvent.recorded", description="Time when the event occurred on source", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: Time when the event occurred on source
- * Type: date
- * Path: AuditEvent.recorded
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: agent - *

- * Description: Direct reference to resource
- * Type: reference
- * Path: AuditEvent.agent.reference
- *

- */ - @SearchParamDefinition(name="agent", path="AuditEvent.agent.reference", description="Direct reference to resource", type="reference" ) - public static final String SP_AGENT = "agent"; - /** - * Fluent Client search parameter constant for agent - *

- * Description: Direct reference to resource
- * Type: reference
- * Path: AuditEvent.agent.reference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AuditEvent:agent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("AuditEvent:agent").toLocked(); - - /** - * Search parameter: agent-name - *

- * Description: Human-meaningful name for the agent
- * Type: string
- * Path: AuditEvent.agent.name
- *

- */ - @SearchParamDefinition(name="agent-name", path="AuditEvent.agent.name", description="Human-meaningful name for the agent", type="string" ) - public static final String SP_AGENT_NAME = "agent-name"; - /** - * Fluent Client search parameter constant for agent-name - *

- * Description: Human-meaningful name for the agent
- * Type: string
- * Path: AuditEvent.agent.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam AGENT_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_AGENT_NAME); - - /** - * Search parameter: entity-id - *

- * Description: Specific instance of object (e.g. versioned)
- * Type: token
- * Path: AuditEvent.entity.identifier
- *

- */ - @SearchParamDefinition(name="entity-id", path="AuditEvent.entity.identifier", description="Specific instance of object (e.g. versioned)", type="token" ) - public static final String SP_ENTITY_ID = "entity-id"; - /** - * Fluent Client search parameter constant for entity-id - *

- * Description: Specific instance of object (e.g. versioned)
- * Type: token
- * Path: AuditEvent.entity.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_ID); - - /** - * Search parameter: patient - *

- * Description: Direct reference to resource
- * Type: reference
- * Path: AuditEvent.agent.reference, AuditEvent.entity.reference
- *

- */ - @SearchParamDefinition(name="patient", path="AuditEvent.agent.reference | AuditEvent.entity.reference", description="Direct reference to resource", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Direct reference to resource
- * Type: reference
- * Path: AuditEvent.agent.reference, AuditEvent.entity.reference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "AuditEvent:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("AuditEvent:patient").toLocked(); - - /** - * Search parameter: source - *

- * Description: The identity of source detecting the event
- * Type: token
- * Path: AuditEvent.source.identifier
- *

- */ - @SearchParamDefinition(name="source", path="AuditEvent.source.identifier", description="The identity of source detecting the event", type="token" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: The identity of source detecting the event
- * Type: token
- * Path: AuditEvent.source.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SOURCE); - - /** - * Search parameter: altid - *

- * Description: Alternative User id e.g. authentication
- * Type: token
- * Path: AuditEvent.agent.altId
- *

- */ - @SearchParamDefinition(name="altid", path="AuditEvent.agent.altId", description="Alternative User id e.g. authentication", type="token" ) - public static final String SP_ALTID = "altid"; - /** - * Fluent Client search parameter constant for altid - *

- * Description: Alternative User id e.g. authentication
- * Type: token
- * Path: AuditEvent.agent.altId
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ALTID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ALTID); - - /** - * Search parameter: address - *

- * Description: Identifier for the network access point of the user device
- * Type: token
- * Path: AuditEvent.agent.network.address
- *

- */ - @SearchParamDefinition(name="address", path="AuditEvent.agent.network.address", description="Identifier for the network access point of the user device", type="token" ) - public static final String SP_ADDRESS = "address"; - /** - * Fluent Client search parameter constant for address - *

- * Description: Identifier for the network access point of the user device
- * Type: token
- * Path: AuditEvent.agent.network.address
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS); - - /** - * Search parameter: subtype - *

- * Description: More specific type/id for the event
- * Type: token
- * Path: AuditEvent.subtype
- *

- */ - @SearchParamDefinition(name="subtype", path="AuditEvent.subtype", description="More specific type/id for the event", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - /** - * Fluent Client search parameter constant for subtype - *

- * Description: More specific type/id for the event
- * Type: token
- * Path: AuditEvent.subtype
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBTYPE); - - /** - * Search parameter: action - *

- * Description: Type of action performed during the event
- * Type: token
- * Path: AuditEvent.action
- *

- */ - @SearchParamDefinition(name="action", path="AuditEvent.action", description="Type of action performed during the event", type="token" ) - public static final String SP_ACTION = "action"; - /** - * Fluent Client search parameter constant for action - *

- * Description: Type of action performed during the event
- * Type: token
- * Path: AuditEvent.action
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION); - - /** - * Search parameter: policy - *

- * Description: Policy that authorized event
- * Type: uri
- * Path: AuditEvent.agent.policy
- *

- */ - @SearchParamDefinition(name="policy", path="AuditEvent.agent.policy", description="Policy that authorized event", type="uri" ) - public static final String SP_POLICY = "policy"; - /** - * Fluent Client search parameter constant for policy - *

- * Description: Policy that authorized event
- * Type: uri
- * Path: AuditEvent.agent.policy
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam POLICY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_POLICY); - - /** - * Search parameter: user - *

- * Description: Unique identifier for the user
- * Type: token
- * Path: AuditEvent.agent.userId
- *

- */ - @SearchParamDefinition(name="user", path="AuditEvent.agent.userId", description="Unique identifier for the user", type="token" ) - public static final String SP_USER = "user"; - /** - * Fluent Client search parameter constant for user - *

- * Description: Unique identifier for the user
- * Type: token
- * Path: AuditEvent.agent.userId
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam USER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USER); - - /** - * Search parameter: entity-name - *

- * Description: Descriptor for entity
- * Type: string
- * Path: AuditEvent.entity.name
- *

- */ - @SearchParamDefinition(name="entity-name", path="AuditEvent.entity.name", description="Descriptor for entity", type="string" ) - public static final String SP_ENTITY_NAME = "entity-name"; - /** - * Fluent Client search parameter constant for entity-name - *

- * Description: Descriptor for entity
- * Type: string
- * Path: AuditEvent.entity.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ENTITY_NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ENTITY_NAME); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BackboneElement.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BackboneElement.java deleted file mode 100644 index 45c47692d64..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BackboneElement.java +++ /dev/null @@ -1,196 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ -@DatatypeDef(name="BackboneElement") -public abstract class BackboneElement extends Element implements IBaseBackboneElement { - - /** - * May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. - */ - @Child(name = "modifierExtension", type = {Extension.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) - @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) - protected List modifierExtension; - - private static final long serialVersionUID = -1431673179L; - - /** - * Constructor - */ - public BackboneElement() { - super(); - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - public List getModifierExtension() { - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - return this.modifierExtension; - } - - public boolean hasModifierExtension() { - if (this.modifierExtension == null) - return false; - for (Extension item : this.modifierExtension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - // syntactic sugar - public Extension addModifierExtension() { //3 - Extension t = new Extension(); - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return t; - } - - // syntactic sugar - public BackboneElement addModifierExtension(Extension t) { //3 - if (t == null) - return this; - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -298878168: /*modifierExtension*/ return this.modifierExtension == null ? new Base[0] : this.modifierExtension.toArray(new Base[this.modifierExtension.size()]); // Extension - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -298878168: // modifierExtension - this.getModifierExtension().add(castToExtension(value)); // Extension - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("modifierExtension")) - this.getModifierExtension().add(castToExtension(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -298878168: return addModifierExtension(); // Extension - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("modifierExtension")) { - return addModifierExtension(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "BackboneElement"; - - } - - public abstract BackboneElement copy(); - - public void copyValues(BackboneElement dst) { - super.copyValues(dst); - if (modifierExtension != null) { - dst.modifierExtension = new ArrayList(); - for (Extension i : modifierExtension) - dst.modifierExtension.add(i.copy()); - }; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BackboneElement)) - return false; - BackboneElement o = (BackboneElement) other; - return compareDeep(modifierExtension, o.modifierExtension, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BackboneElement)) - return false; - BackboneElement o = (BackboneElement) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifierExtension == null || modifierExtension.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Base.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Base.java deleted file mode 100644 index b8927f58887..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Base.java +++ /dev/null @@ -1,609 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBase; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; - -import ca.uhn.fhir.model.api.IElement; - -public abstract class Base implements Serializable, IBase, IElement { - - /** - * User appended data items - allow users to add extra information to the class - */ -private Map userData; - - /** - * Round tracking xml comments for testing convenience - */ - private List formatCommentsPre; - - /** - * Round tracking xml comments for testing convenience - */ - private List formatCommentsPost; - - - public Object getUserData(String name) { - if (userData == null) - return null; - return userData.get(name); - } - - public void setUserData(String name, Object value) { - if (userData == null) - userData = new HashMap(); - userData.put(name, value); - } - - public void setUserDataINN(String name, Object value) { - if (value == null) - return; - - if (userData == null) - userData = new HashMap(); - userData.put(name, value); - } - - public boolean hasUserData(String name) { - if (userData == null) - return false; - else - return userData.containsKey(name); - } - - public String getUserString(String name) { - return (String) getUserData(name); - } - - public int getUserInt(String name) { - if (!hasUserData(name)) - return 0; - return (Integer) getUserData(name); - } - - public boolean hasFormatComment() { - return (formatCommentsPre != null && !formatCommentsPre.isEmpty()) || (formatCommentsPost != null && !formatCommentsPost.isEmpty()); - } - - public List getFormatCommentsPre() { - if (formatCommentsPre == null) - formatCommentsPre = new ArrayList(); - return formatCommentsPre; - } - - public List getFormatCommentsPost() { - if (formatCommentsPost == null) - formatCommentsPost = new ArrayList(); - return formatCommentsPost; - } - - // these 3 allow evaluation engines to get access to primitive values - public boolean isPrimitive() { - return false; - } - - public boolean hasPrimitiveValue() { - return isPrimitive(); - } - - public String primitiveValue() { - return null; - } - - public abstract String fhirType() ; - - public boolean hasType(String... name) { - String t = fhirType(); - for (String n : name) - if (n.equals(t)) - return true; - return false; - } - - protected abstract void listChildren(List result) ; - - public void setProperty(String name, Base value) throws FHIRException { - throw new FHIRException("Attempt to set unknown property "+name); - } - - public Base addChild(String name) throws FHIRException { - throw new FHIRException("Attempt to add child with unknown name "+name); - } - - /** - * Supports iterating the children elements in some generic processor or browser - * All defined children will be listed, even if they have no value on this instance - * - * Note that the actual content of primitive or xhtml elements is not iterated explicitly. - * To find these, the processing code must recognise the element as a primitive, typecast - * the value to a {@link Type}, and examine the value - * - * @return a list of all the children defined for this element - */ - public List children() { - List result = new ArrayList(); - listChildren(result); - return result; - } - - public Property getChildByName(String name) { - List children = new ArrayList(); - listChildren(children); - for (Property c : children) - if (c.getName().equals(name)) - return c; - return null; - } - - public List listChildrenByName(String name) throws FHIRException { - List result = new ArrayList(); - for (Base b : listChildrenByName(name, true)) - if (b != null) - result.add(b); - return result; - } - - public Base[] listChildrenByName(String name, boolean checkValid) throws FHIRException { - if (name.equals("*")) { - List children = new ArrayList(); - listChildren(children); - List result = new ArrayList(); - for (Property c : children) - if (name.equals("*") || c.getName().equals(name) || (c.getName().endsWith("[x]") && c.getName().startsWith(name))) - result.addAll(c.getValues()); - return result.toArray(new Base[result.size()]); - } - else - return getProperty(name.hashCode(), name, checkValid); - } - - public boolean isEmpty() { - return true; // userData does not count - } - - public boolean equalsDeep(Base other) { - return other == this; - } - - public boolean equalsShallow(Base other) { - return other == this; - } - - public static boolean compareDeep(List e1, List e2, boolean allowNull) { - if (noList(e1) && noList(e2) && allowNull) - return true; - if (noList(e1) || noList(e2)) - return false; - if (e1.size() != e2.size()) - return false; - for (int i = 0; i < e1.size(); i++) { - if (!compareDeep(e1.get(i), e2.get(i), allowNull)) - return false; - } - return true; - } - - private static boolean noList(List list) { - return list == null || list.isEmpty(); - } - - public static boolean compareDeep(Base e1, Base e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - if (e2.isMetadataBased() && !e1.isMetadataBased()) // respect existing order for debugging consistency; outcome must be the same either way - return e2.equalsDeep(e1); - else - return e1.equalsDeep(e2); - } - - public static boolean compareDeep(XhtmlNode div1, XhtmlNode div2, boolean allowNull) { - if (div1 == null && div2 == null && allowNull) - return true; - if (div1 == null || div2 == null) - return false; - return div1.equalsDeep(div2); - } - - - public static boolean compareValues(List e1, List e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - if (e1.size() != e2.size()) - return false; - for (int i = 0; i < e1.size(); i++) { - if (!compareValues(e1.get(i), e2.get(i), allowNull)) - return false; - } - return true; - } - - public static boolean compareValues(PrimitiveType e1, PrimitiveType e2, boolean allowNull) { - if (e1 == null && e2 == null && allowNull) - return true; - if (e1 == null || e2 == null) - return false; - return e1.equalsShallow(e2); - } - - // -- converters for property setters - - - public BooleanType castToBoolean(Base b) throws FHIRException { - if (b instanceof BooleanType) - return (BooleanType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Boolean"); - } - - public IntegerType castToInteger(Base b) throws FHIRException { - if (b instanceof IntegerType) - return (IntegerType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Integer"); - } - - public DecimalType castToDecimal(Base b) throws FHIRException { - if (b instanceof DecimalType) - return (DecimalType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Decimal"); - } - - public Base64BinaryType castToBase64Binary(Base b) throws FHIRException { - if (b instanceof Base64BinaryType) - return (Base64BinaryType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Base64Binary"); - } - - public InstantType castToInstant(Base b) throws FHIRException { - if (b instanceof InstantType) - return (InstantType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Instant"); - } - - public StringType castToString(Base b) throws FHIRException { - if (b instanceof StringType) - return (StringType) b; - else if (b.hasPrimitiveValue()) - return new StringType(b.primitiveValue()); - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a String"); - } - - public UriType castToUri(Base b) throws FHIRException { - if (b instanceof UriType) - return (UriType) b; - else if (b.hasPrimitiveValue()) - return new UriType(b.primitiveValue()); - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Uri"); - } - - public DateType castToDate(Base b) throws FHIRException { - if (b instanceof DateType) - return (DateType) b; - else if (b.hasPrimitiveValue()) - return new DateType(b.primitiveValue()); - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Date"); - } - - public DateTimeType castToDateTime(Base b) throws FHIRException { - if (b instanceof DateTimeType) - return (DateTimeType) b; - else if (b.fhirType().equals("dateTime")) - return new DateTimeType(b.primitiveValue()); - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a DateTime"); - } - - public TimeType castToTime(Base b) throws FHIRException { - if (b instanceof TimeType) - return (TimeType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Time"); - } - - public CodeType castToCode(Base b) throws FHIRException { - if (b instanceof CodeType) - return (CodeType) b; - else if (b.isPrimitive()) - return new CodeType(b.primitiveValue()); - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Code"); - } - - public OidType castToOid(Base b) throws FHIRException { - if (b instanceof OidType) - return (OidType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Oid"); - } - - public IdType castToId(Base b) throws FHIRException { - if (b instanceof IdType) - return (IdType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Id"); - } - - public UnsignedIntType castToUnsignedInt(Base b) throws FHIRException { - if (b instanceof UnsignedIntType) - return (UnsignedIntType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a UnsignedInt"); - } - - public PositiveIntType castToPositiveInt(Base b) throws FHIRException { - if (b instanceof PositiveIntType) - return (PositiveIntType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a PositiveInt"); - } - - public MarkdownType castToMarkdown(Base b) throws FHIRException { - if (b instanceof MarkdownType) - return (MarkdownType) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Markdown"); - } - - public Annotation castToAnnotation(Base b) throws FHIRException { - if (b instanceof Annotation) - return (Annotation) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Annotation"); - } - - public Attachment castToAttachment(Base b) throws FHIRException { - if (b instanceof Attachment) - return (Attachment) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Attachment"); - } - - public Identifier castToIdentifier(Base b) throws FHIRException { - if (b instanceof Identifier) - return (Identifier) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Identifier"); - } - - public CodeableConcept castToCodeableConcept(Base b) throws FHIRException { - if (b instanceof CodeableConcept) - return (CodeableConcept) b; - else if (b instanceof CodeType) { - CodeableConcept cc = new CodeableConcept(); - cc.addCoding().setCode(((CodeType) b).asStringValue()); - return cc; - } else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a CodeableConcept"); - } - - public Coding castToCoding(Base b) throws FHIRException { - if (b instanceof Coding) - return (Coding) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Coding"); - } - - public Quantity castToQuantity(Base b) throws FHIRException { - if (b instanceof Quantity) - return (Quantity) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Quantity"); - } - - public Money castToMoney(Base b) throws FHIRException { - if (b instanceof Money) - return (Money) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Money"); - } - - public Duration castToDuration(Base b) throws FHIRException { - if (b instanceof Duration) - return (Duration) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an Duration"); - } - - public SimpleQuantity castToSimpleQuantity(Base b) throws FHIRException { - if (b instanceof SimpleQuantity) - return (SimpleQuantity) b; - else if (b instanceof Quantity) { - Quantity q = (Quantity) b; - SimpleQuantity sq = new SimpleQuantity(); - sq.setValueElement(q.getValueElement()); - sq.setComparatorElement(q.getComparatorElement()); - sq.setUnitElement(q.getUnitElement()); - sq.setSystemElement(q.getSystemElement()); - sq.setCodeElement(q.getCodeElement()); - return sq; - } else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to an SimpleQuantity"); - } - - public Range castToRange(Base b) throws FHIRException { - if (b instanceof Range) - return (Range) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Range"); - } - - public Period castToPeriod(Base b) throws FHIRException { - if (b instanceof Period) - return (Period) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Period"); - } - - public Ratio castToRatio(Base b) throws FHIRException { - if (b instanceof Ratio) - return (Ratio) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Ratio"); - } - - public SampledData castToSampledData(Base b) throws FHIRException { - if (b instanceof SampledData) - return (SampledData) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a SampledData"); - } - - public Signature castToSignature(Base b) throws FHIRException { - if (b instanceof Signature) - return (Signature) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Signature"); - } - - public HumanName castToHumanName(Base b) throws FHIRException { - if (b instanceof HumanName) - return (HumanName) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a HumanName"); - } - - public Address castToAddress(Base b) throws FHIRException { - if (b instanceof Address) - return (Address) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Address"); - } - - public ContactPoint castToContactPoint(Base b) throws FHIRException { - if (b instanceof ContactPoint) - return (ContactPoint) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ContactPoint"); - } - - public Timing castToTiming(Base b) throws FHIRException { - if (b instanceof Timing) - return (Timing) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Timing"); - } - - public Reference castToReference(Base b) throws FHIRException { - if (b instanceof Reference) - return (Reference) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Reference"); - } - - public Meta castToMeta(Base b) throws FHIRException { - if (b instanceof Meta) - return (Meta) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Meta"); - } - - public Extension castToExtension(Base b) throws FHIRException { - if (b instanceof Extension) - return (Extension) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Extension"); - } - - public Resource castToResource(Base b) throws FHIRException { - if (b instanceof Resource) - return (Resource) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Resource"); - } - - public Narrative castToNarrative(Base b) throws FHIRException { - if (b instanceof Narrative) - return (Narrative) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a Narrative"); - } - - - public ElementDefinition castToElementDefinition(Base b) throws FHIRException { - if (b instanceof ElementDefinition) - return (ElementDefinition) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ElementDefinition"); - } - - public ModuleMetadata castToModuleMetadata(Base b) throws FHIRException { - if (b instanceof ModuleMetadata) - return (ModuleMetadata) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ModuleMetadata"); - } - - public ActionDefinition castToActionDefinition(Base b) throws FHIRException { - if (b instanceof ActionDefinition) - return (ActionDefinition) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ActionDefinition"); - } - - public DataRequirement castToDataRequirement(Base b) throws FHIRException { - if (b instanceof DataRequirement) - return (DataRequirement) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a DataRequirement"); - } - - public ParameterDefinition castToParameterDefinition(Base b) throws FHIRException { - if (b instanceof ParameterDefinition) - return (ParameterDefinition) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a ParameterDefinition"); - } - - public TriggerDefinition castToTriggerDefinition(Base b) throws FHIRException { - if (b instanceof TriggerDefinition) - return (TriggerDefinition) b; - else - throw new FHIRException("Unable to convert a "+b.getClass().getName()+" to a TriggerDefinition"); - } - - protected boolean isMetadataBased() { - return false; - } - - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - if (checkValid) - throw new FHIRException("Attempt to read invalid property '"+name+"' on type "+fhirType()); - return null; - } - - public void setProperty(int hash, String name, Base value) throws FHIRException { - throw new FHIRException("Attempt to write to invalid property '"+name+"' on type "+fhirType()); - } - - public Base makeProperty(int hash, String name) throws FHIRException { - throw new FHIRException("Attempt to make an invalid property '"+name+"' on type "+fhirType()); - } - - public static boolean equals(String v1, String v2) { - if (v1 == null && v2 == null) - return true; - else if (v1 == null || v2 == null) - return false; - else - return v1.equals(v2); - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java deleted file mode 100644 index 71c954446ce..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Base64BinaryType.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -package org.hl7.fhir.dstu2016may.model; - -import org.apache.commons.codec.binary.Base64; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "base64Binary" in FHIR: a sequence of bytes represented in base64 - */ -@DatatypeDef(name="base64binary") -public class Base64BinaryType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public Base64BinaryType() { - super(); - } - - public Base64BinaryType(byte[] theBytes) { - super(); - setValue(theBytes); - } - - public Base64BinaryType(String theValue) { - super(); - setValueAsString(theValue); - } - - protected byte[] parse(String theValue) { - return Base64.decodeBase64(theValue); - } - - protected String encode(byte[] theValue) { - return Base64.encodeBase64String(theValue); - } - - @Override - public Base64BinaryType copy() { - return new Base64BinaryType(getValue()); - } - - public String fhirType() { - return "base64Binary"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseBinary.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseBinary.java deleted file mode 100644 index b5bb8d44364..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseBinary.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IBaseBinary; - -public abstract class BaseBinary extends Resource implements IBaseBinary { - - private static final long serialVersionUID = 1L; - - @Override - public String getContentAsBase64() { - return getContentElement().getValueAsString(); - } - - @Override - public BaseBinary setContentAsBase64(String theContent) { - if (theContent != null) { - getContentElement().setValueAsString(theContent); - } else { - setContent(null); - } - return this; - } - - abstract Base64BinaryType getContentElement(); - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java deleted file mode 100644 index 838d583d8f1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseDateTimeType.java +++ /dev/null @@ -1,743 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import static org.apache.commons.lang3.StringUtils.isBlank; - -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.time.DateUtils; -import org.apache.commons.lang3.time.FastDateFormat; - -import ca.uhn.fhir.parser.DataFormatException; - -public abstract class BaseDateTimeType extends PrimitiveType { - - private static final long serialVersionUID = 1L; - - static final long NANOS_PER_MILLIS = 1000000L; - static final long NANOS_PER_SECOND = 1000000000L; - - private static final FastDateFormat ourHumanDateFormat = FastDateFormat.getDateInstance(FastDateFormat.MEDIUM); - private static final FastDateFormat ourHumanDateTimeFormat = FastDateFormat.getDateTimeInstance(FastDateFormat.MEDIUM, FastDateFormat.MEDIUM); - - private String myFractionalSeconds; - private TemporalPrecisionEnum myPrecision = null; - private TimeZone myTimeZone; - private boolean myTimeZoneZulu = false; - - /** - * Constructor - */ - public BaseDateTimeType() { - // nothing - } - - /** - * Constructor - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { - setValue(theDate, thePrecision); - if (isPrecisionAllowed(thePrecision) == false) { - throw new DataFormatException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + thePrecision + " precision): " + theDate); - } - } - - /** - * Constructor - */ - public BaseDateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimeZone) { - this(theDate, thePrecision); - setTimeZone(theTimeZone); - } - - /** - * Constructor - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public BaseDateTimeType(String theString) { - setValueAsString(theString); - if (isPrecisionAllowed(getPrecision()) == false) { - throw new DataFormatException("Invalid date/time string (datatype " + getClass().getSimpleName() + " does not support " + getPrecision() + " precision): " + theString); - } - } - - private void clearTimeZone() { - myTimeZone = null; - myTimeZoneZulu = false; - } - - @Override - protected String encode(Date theValue) { - if (theValue == null) { - return null; - } else { - GregorianCalendar cal; - if (myTimeZoneZulu) { - cal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); - } else if (myTimeZone != null) { - cal = new GregorianCalendar(myTimeZone); - } else { - cal = new GregorianCalendar(); - } - cal.setTime(theValue); - - StringBuilder b = new StringBuilder(); - leftPadWithZeros(cal.get(Calendar.YEAR), 4, b); - if (myPrecision.ordinal() > TemporalPrecisionEnum.YEAR.ordinal()) { - b.append('-'); - leftPadWithZeros(cal.get(Calendar.MONTH) + 1, 2, b); - if (myPrecision.ordinal() > TemporalPrecisionEnum.MONTH.ordinal()) { - b.append('-'); - leftPadWithZeros(cal.get(Calendar.DATE), 2, b); - if (myPrecision.ordinal() > TemporalPrecisionEnum.DAY.ordinal()) { - b.append('T'); - leftPadWithZeros(cal.get(Calendar.HOUR_OF_DAY), 2, b); - b.append(':'); - leftPadWithZeros(cal.get(Calendar.MINUTE), 2, b); - if (myPrecision.ordinal() > TemporalPrecisionEnum.MINUTE.ordinal()) { - b.append(':'); - leftPadWithZeros(cal.get(Calendar.SECOND), 2, b); - if (myPrecision.ordinal() > TemporalPrecisionEnum.SECOND.ordinal()) { - b.append('.'); - b.append(myFractionalSeconds); - for (int i = myFractionalSeconds.length(); i < 3; i++) { - b.append('0'); - } - } - } - - if (myTimeZoneZulu) { - b.append('Z'); - } else if (myTimeZone != null) { - int offset = myTimeZone.getOffset(theValue.getTime()); - if (offset >= 0) { - b.append('+'); - } else { - b.append('-'); - offset = Math.abs(offset); - } - - int hoursOffset = (int) (offset / DateUtils.MILLIS_PER_HOUR); - leftPadWithZeros(hoursOffset, 2, b); - b.append(':'); - int minutesOffset = (int) (offset % DateUtils.MILLIS_PER_HOUR); - minutesOffset = (int) (minutesOffset / DateUtils.MILLIS_PER_MINUTE); - leftPadWithZeros(minutesOffset, 2, b); - } - } - } - } - return b.toString(); - } - } - - /** - * Returns the default precision for the given datatype - */ - protected abstract TemporalPrecisionEnum getDefaultPrecisionForDatatype(); - - private int getOffsetIndex(String theValueString) { - int plusIndex = theValueString.indexOf('+', 16); - int minusIndex = theValueString.indexOf('-', 16); - int zIndex = theValueString.indexOf('Z', 16); - int retVal = Math.max(Math.max(plusIndex, minusIndex), zIndex); - if (retVal == -1) { - return -1; - } - if ((retVal - 2) != (plusIndex + minusIndex + zIndex)) { - throwBadDateFormat(theValueString); - } - return retVal; - } - - /** - * Gets the precision for this datatype (using the default for the given type if not set) - * - * @see #setPrecision(TemporalPrecisionEnum) - */ - public TemporalPrecisionEnum getPrecision() { - if (myPrecision == null) { - return getDefaultPrecisionForDatatype(); - } - return myPrecision; - } - - /** - * Returns the TimeZone associated with this dateTime's value. May return null if no timezone was - * supplied. - */ - public TimeZone getTimeZone() { - if (myTimeZoneZulu) { - return TimeZone.getTimeZone("GMT"); - } - return myTimeZone; - } - - /** - * Returns the value of this object as a {@link GregorianCalendar} - */ - public GregorianCalendar getValueAsCalendar() { - if (getValue() == null) { - return null; - } - GregorianCalendar cal; - if (getTimeZone() != null) { - cal = new GregorianCalendar(getTimeZone()); - } else { - cal = new GregorianCalendar(); - } - cal.setTime(getValue()); - return cal; - } - - /** - * To be implemented by subclasses to indicate whether the given precision is allowed by this type - */ - abstract boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision); - - /** - * Returns true if the timezone is set to GMT-0:00 (Z) - */ - public boolean isTimeZoneZulu() { - return myTimeZoneZulu; - } - - /** - * Returns true if this object represents a date that is today's date - * - * @throws NullPointerException - * if {@link #getValue()} returns null - */ - public boolean isToday() { - Validate.notNull(getValue(), getClass().getSimpleName() + " contains null value"); - return DateUtils.isSameDay(new Date(), getValue()); - } - - private void leftPadWithZeros(int theInteger, int theLength, StringBuilder theTarget) { - String string = Integer.toString(theInteger); - for (int i = string.length(); i < theLength; i++) { - theTarget.append('0'); - } - theTarget.append(string); - } - - @Override - protected Date parse(String theValue) throws DataFormatException { - Calendar cal = new GregorianCalendar(0, 0, 0); - cal.setTimeZone(TimeZone.getDefault()); - String value = theValue; - boolean fractionalSecondsSet = false; - - if (value.length() > 0 && (value.charAt(0) == ' ' || value.charAt(value.length() - 1) == ' ')) { - value = value.trim(); - } - - int length = value.length(); - if (length == 0) { - return null; - } - - if (length < 4) { - throwBadDateFormat(value); - } - - TemporalPrecisionEnum precision = null; - cal.set(Calendar.YEAR, parseInt(value, value.substring(0, 4), 0, 9999)); - precision = TemporalPrecisionEnum.YEAR; - if (length > 4) { - validateCharAtIndexIs(value, 4, '-'); - validateLengthIsAtLeast(value, 7); - int monthVal = parseInt(value, value.substring(5, 7), 1, 12) - 1; - cal.set(Calendar.MONTH, monthVal); - precision = TemporalPrecisionEnum.MONTH; - if (length > 7) { - validateCharAtIndexIs(value, 7, '-'); - validateLengthIsAtLeast(value, 10); - cal.set(Calendar.DATE, 1); // for some reason getActualMaximum works incorrectly if date isn't set - int actualMaximum = cal.getActualMaximum(Calendar.DAY_OF_MONTH); - cal.set(Calendar.DAY_OF_MONTH, parseInt(value, value.substring(8, 10), 1, actualMaximum)); - precision = TemporalPrecisionEnum.DAY; - if (length > 10) { - validateLengthIsAtLeast(value, 17); - validateCharAtIndexIs(value, 10, 'T'); // yyyy-mm-ddThh:mm:ss - int offsetIdx = getOffsetIndex(value); - String time; - if (offsetIdx == -1) { - //throwBadDateFormat(theValue); - // No offset - should this be an error? - time = value.substring(11); - } else { - time = value.substring(11, offsetIdx); - String offsetString = value.substring(offsetIdx); - setTimeZone(value, offsetString); - cal.setTimeZone(getTimeZone()); - } - int timeLength = time.length(); - - validateCharAtIndexIs(value, 13, ':'); - cal.set(Calendar.HOUR_OF_DAY, parseInt(value, value.substring(11, 13), 0, 23)); - cal.set(Calendar.MINUTE, parseInt(value, value.substring(14, 16), 0, 59)); - precision = TemporalPrecisionEnum.MINUTE; - if (timeLength > 5) { - validateLengthIsAtLeast(value, 19); - validateCharAtIndexIs(value, 16, ':'); // yyyy-mm-ddThh:mm:ss - cal.set(Calendar.SECOND, parseInt(value, value.substring(17, 19), 0, 59)); - precision = TemporalPrecisionEnum.SECOND; - if (timeLength > 8) { - validateCharAtIndexIs(value, 19, '.'); // yyyy-mm-ddThh:mm:ss.SSSS - validateLengthIsAtLeast(value, 20); - int endIndex = getOffsetIndex(value); - if (endIndex == -1) { - endIndex = value.length(); - } - int millis; - String millisString; - if (endIndex > 23) { - myFractionalSeconds = value.substring(20, endIndex); - fractionalSecondsSet = true; - endIndex = 23; - millisString = value.substring(20, endIndex); - millis = parseInt(value, millisString, 0, 999); - } else { - millisString = value.substring(20, endIndex); - millis = parseInt(value, millisString, 0, 999); - myFractionalSeconds = millisString; - fractionalSecondsSet = true; - } - if (millisString.length() == 1) { - millis = millis * 100; - } else if (millisString.length() == 2) { - millis = millis * 10; - } - cal.set(Calendar.MILLISECOND, millis); - precision = TemporalPrecisionEnum.MILLI; - } - } - } - } else { - cal.set(Calendar.DATE, 1); - } - } else { - cal.set(Calendar.DATE, 1); - } - - if (fractionalSecondsSet == false) { - myFractionalSeconds = ""; - } - - myPrecision = precision; - return cal.getTime(); - - } - - private int parseInt(String theValue, String theSubstring, int theLowerBound, int theUpperBound) { - int retVal = 0; - try { - retVal = Integer.parseInt(theSubstring); - } catch (NumberFormatException e) { - throwBadDateFormat(theValue); - } - - if (retVal < theLowerBound || retVal > theUpperBound) { - throwBadDateFormat(theValue); - } - - return retVal; - } - - /** - * Sets the precision for this datatype - * - * @throws DataFormatException - */ - public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException { - if (thePrecision == null) { - throw new NullPointerException("Precision may not be null"); - } - myPrecision = thePrecision; - updateStringValue(); - } - - private BaseDateTimeType setTimeZone(String theWholeValue, String theValue) { - - if (isBlank(theValue)) { - throwBadDateFormat(theWholeValue); - } else if (theValue.charAt(0) == 'Z') { - myTimeZone = null; - myTimeZoneZulu = true; - } else if (theValue.length() != 6) { - throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); - } else if (theValue.charAt(3) != ':' || !(theValue.charAt(0) == '+' || theValue.charAt(0) == '-')) { - throwBadDateFormat(theWholeValue, "Timezone offset must be in the form \"Z\", \"-HH:mm\", or \"+HH:mm\""); - } else { - parseInt(theWholeValue, theValue.substring(1, 3), 0, 23); - parseInt(theWholeValue, theValue.substring(4, 6), 0, 59); - myTimeZoneZulu = false; - myTimeZone = TimeZone.getTimeZone("GMT" + theValue); - } - - return this; - } - - public BaseDateTimeType setTimeZone(TimeZone theTimeZone) { - myTimeZone = theTimeZone; - myTimeZoneZulu = false; - updateStringValue(); - return this; - } - - public BaseDateTimeType setTimeZoneZulu(boolean theTimeZoneZulu) { - myTimeZoneZulu = theTimeZoneZulu; - myTimeZone = null; - updateStringValue(); - return this; - } - - /** - * Sets the value for this type using the given Java Date object as the time, and using the default precision for - * this datatype (unless the precision is already set), as well as the local timezone as determined by the local operating - * system. Both of these properties may be modified in subsequent calls if neccesary. - */ - @Override - public BaseDateTimeType setValue(Date theValue) { - setValue(theValue, getPrecision()); - return this; - } - - /** - * Sets the value for this type using the given Java Date object as the time, and using the specified precision, as - * well as the local timezone as determined by the local operating system. Both of - * these properties may be modified in subsequent calls if neccesary. - * - * @param theValue - * The date value - * @param thePrecision - * The precision - * @throws DataFormatException - */ - public void setValue(Date theValue, TemporalPrecisionEnum thePrecision) throws DataFormatException { - if (getTimeZone() == null) { - setTimeZone(TimeZone.getDefault()); - } - myPrecision = thePrecision; - myFractionalSeconds = ""; - if (theValue != null) { - long millis = theValue.getTime() % 1000; - if (millis < 0) { - // This is for times before 1970 (see bug #444) - millis = 1000 + millis; - } - String fractionalSeconds = Integer.toString((int) millis); - myFractionalSeconds = StringUtils.leftPad(fractionalSeconds, 3, '0'); - } - super.setValue(theValue); - } - - @Override - public void setValueAsString(String theValue) throws DataFormatException { - clearTimeZone(); - super.setValueAsString(theValue); - } - - private void throwBadDateFormat(String theValue) { - throw new DataFormatException("Invalid date/time format: \"" + theValue + "\""); - } - - private void throwBadDateFormat(String theValue, String theMesssage) { - throw new DataFormatException("Invalid date/time format: \"" + theValue + "\": " + theMesssage); - } - - /** - * Returns a human readable version of this date/time using the system local format. - *

- * Note on time zones: This method renders the value using the time zone that is contained within the value. - * For example, if this date object contains the value "2012-01-05T12:00:00-08:00", - * the human display will be rendered as "12:00:00" even if the application is being executed on a system in a - * different time zone. If this behaviour is not what you want, use - * {@link #toHumanDisplayLocalTimezone()} instead. - *

- */ - public String toHumanDisplay() { - TimeZone tz = getTimeZone(); - Calendar value = tz != null ? Calendar.getInstance(tz) : Calendar.getInstance(); - value.setTime(getValue()); - - switch (getPrecision()) { - case YEAR: - case MONTH: - case DAY: - return ourHumanDateFormat.format(value); - case MILLI: - case SECOND: - default: - return ourHumanDateTimeFormat.format(value); - } - } - - /** - * Returns a human readable version of this date/time using the system local format, converted to the local timezone - * if neccesary. - * - * @see #toHumanDisplay() for a method which does not convert the time to the local timezone before rendering it. - */ - public String toHumanDisplayLocalTimezone() { - switch (getPrecision()) { - case YEAR: - case MONTH: - case DAY: - return ourHumanDateFormat.format(getValue()); - case MILLI: - case SECOND: - default: - return ourHumanDateTimeFormat.format(getValue()); - } - } - - private void validateCharAtIndexIs(String theValue, int theIndex, char theChar) { - if (theValue.charAt(theIndex) != theChar) { - throwBadDateFormat(theValue, "Expected character '" + theChar + "' at index " + theIndex + " but found " + theValue.charAt(theIndex)); - } - } - - private void validateLengthIsAtLeast(String theValue, int theLength) { - if (theValue.length() < theLength) { - throwBadDateFormat(theValue); - } - } - - /** - * Returns the year, e.g. 2015 - */ - public Integer getYear() { - return getFieldValue(Calendar.YEAR); - } - - /** - * Returns the month with 0-index, e.g. 0=January - */ - public Integer getMonth() { - return getFieldValue(Calendar.MONTH); - } - - /** - * Returns the month with 1-index, e.g. 1=the first day of the month - */ - public Integer getDay() { - return getFieldValue(Calendar.DAY_OF_MONTH); - } - - /** - * Returns the hour of the day in a 24h clock, e.g. 13=1pm - */ - public Integer getHour() { - return getFieldValue(Calendar.HOUR_OF_DAY); - } - - /** - * Returns the minute of the hour in the range 0-59 - */ - public Integer getMinute() { - return getFieldValue(Calendar.MINUTE); - } - - /** - * Returns the second of the minute in the range 0-59 - */ - public Integer getSecond() { - return getFieldValue(Calendar.SECOND); - } - - /** - * Returns the milliseconds within the current second. - *

- * Note that this method returns the - * same value as {@link #getNanos()} but with less precision. - *

- */ - public Integer getMillis() { - return getFieldValue(Calendar.MILLISECOND); - } - - /** - * Returns the nanoseconds within the current second - *

- * Note that this method returns the - * same value as {@link #getMillis()} but with more precision. - *

- */ - public Long getNanos() { - if (isBlank(myFractionalSeconds)) { - return null; - } - String retVal = StringUtils.rightPad(myFractionalSeconds, 9, '0'); - retVal = retVal.substring(0, 9); - return Long.parseLong(retVal); - } - - /** - * Sets the year, e.g. 2015 - */ - public BaseDateTimeType setYear(int theYear) { - setFieldValue(Calendar.YEAR, theYear, null, 0, 9999); - return this; - } - - /** - * Sets the month with 0-index, e.g. 0=January - */ - public BaseDateTimeType setMonth(int theMonth) { - setFieldValue(Calendar.MONTH, theMonth, null, 0, 11); - return this; - } - - /** - * Sets the month with 1-index, e.g. 1=the first day of the month - */ - public BaseDateTimeType setDay(int theDay) { - setFieldValue(Calendar.DAY_OF_MONTH, theDay, null, 0, 31); - return this; - } - - /** - * Sets the hour of the day in a 24h clock, e.g. 13=1pm - */ - public BaseDateTimeType setHour(int theHour) { - setFieldValue(Calendar.HOUR_OF_DAY, theHour, null, 0, 23); - return this; - } - - /** - * Sets the minute of the hour in the range 0-59 - */ - public BaseDateTimeType setMinute(int theMinute) { - setFieldValue(Calendar.MINUTE, theMinute, null, 0, 59); - return this; - } - - /** - * Sets the second of the minute in the range 0-59 - */ - public BaseDateTimeType setSecond(int theSecond) { - setFieldValue(Calendar.SECOND, theSecond, null, 0, 59); - return this; - } - - /** - * Sets the milliseconds within the current second. - *

- * Note that this method sets the - * same value as {@link #setNanos(long)} but with less precision. - *

- */ - public BaseDateTimeType setMillis(int theMillis) { - setFieldValue(Calendar.MILLISECOND, theMillis, null, 0, 999); - return this; - } - - /** - * Sets the nanoseconds within the current second - *

- * Note that this method sets the - * same value as {@link #setMillis(int)} but with more precision. - *

- */ - public BaseDateTimeType setNanos(long theNanos) { - validateValueInRange(theNanos, 0, NANOS_PER_SECOND-1); - String fractionalSeconds = StringUtils.leftPad(Long.toString(theNanos), 9, '0'); - - // Strip trailing 0s - for (int i = fractionalSeconds.length(); i > 0; i--) { - if (fractionalSeconds.charAt(i-1) != '0') { - fractionalSeconds = fractionalSeconds.substring(0, i); - break; - } - } - int millis = (int)(theNanos / NANOS_PER_MILLIS); - setFieldValue(Calendar.MILLISECOND, millis, fractionalSeconds, 0, 999); - return this; - } - - private void setFieldValue(int theField, int theValue, String theFractionalSeconds, int theMinimum, int theMaximum) { - validateValueInRange(theValue, theMinimum, theMaximum); - Calendar cal; - if (getValue() == null) { - cal = new GregorianCalendar(0, 0, 0); - } else { - cal = getValueAsCalendar(); - } - if (theField != -1) { - cal.set(theField, theValue); - } - if (theFractionalSeconds != null) { - myFractionalSeconds = theFractionalSeconds; - } else if (theField == Calendar.MILLISECOND) { - myFractionalSeconds = StringUtils.leftPad(Integer.toString(theValue), 3, '0'); - } - super.setValue(cal.getTime()); - } - - private void validateValueInRange(long theValue, long theMinimum, long theMaximum) { - if (theValue < theMinimum || theValue > theMaximum) { - throw new IllegalArgumentException("Value " + theValue + " is not between allowable range: " + theMinimum + " - " + theMaximum); - } - } - - private Integer getFieldValue(int theField) { - if (getValue() == null) { - return null; - } - Calendar cal = getValueAsCalendar(); - return cal.get(theField); - } - - protected void setValueAsV3String(String theV3String) { - if (StringUtils.isBlank(theV3String)) { - setValue(null); - } else { - StringBuilder b = new StringBuilder(); - String timeZone = null; - for (int i = 0; i < theV3String.length(); i++) { - char nextChar = theV3String.charAt(i); - if (nextChar == '+' || nextChar == '-' || nextChar == 'Z') { - timeZone = (theV3String.substring(i)); - break; - } - - // assertEquals("2013-02-02T20:13:03-05:00", DateAndTime.parseV3("20130202201303-0500").toString()); - if (i == 4 || i == 6) { - b.append('-'); - } else if (i == 8) { - b.append('T'); - } else if (i == 10 || i == 12) { - b.append(':'); - } - - b.append(nextChar); - } - - if (b.length() == 16) - b.append(":00"); // schema rule, must have seconds - if (timeZone != null && b.length() > 10) { - if (timeZone.length() ==5) { - b.append(timeZone.substring(0, 3)); - b.append(':'); - b.append(timeZone.substring(3)); - }else { - b.append(timeZone); - } - } - - setValueAsString(b.toString()); - } - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseExtension.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseExtension.java deleted file mode 100644 index e0ef3df9f87..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseExtension.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IBaseDatatype; -import org.hl7.fhir.instance.model.api.IBaseExtension; -import org.hl7.fhir.instance.model.api.IBaseHasExtensions; - -public abstract class BaseExtension extends Type implements IBaseExtension, IBaseHasExtensions { - - @Override - public Extension setValue(IBaseDatatype theValue) { - setValue((Type)theValue); - return (Extension) this; - } - - public abstract Extension setValue(Type theValue); - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseNarrative.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseNarrative.java deleted file mode 100644 index e8ca75ac774..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseNarrative.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.instance.model.api.INarrative; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; - -public abstract class BaseNarrative extends Type implements INarrative { - - /** - * Sets the value of - * - * @param theString - * @throws Exception - */ - public void setDivAsString(String theString) { - XhtmlNode div; - if (StringUtils.isNotBlank(theString)) { - div = new XhtmlNode(); - div.setValueAsString(theString); - } else { - div = null; - } - setDiv(div); - } - - protected abstract BaseNarrative setDiv(XhtmlNode theDiv); - - public String getDivAsString() { - XhtmlNode div = getDiv(); - if (div != null && !div.isEmpty()) { - return div.getValueAsString(); - } else { - return null; - } - } - - protected abstract XhtmlNode getDiv(); - - public abstract Enumeration getStatusElement(); - - public INarrative setStatusAsString(String theString) { - getStatusElement().setValueAsString(theString); - return this; - } - - public String getStatusAsString() { - return getStatusElement().getValueAsString(); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseReference.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseReference.java deleted file mode 100644 index 5fbebfa84d8..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseReference.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IAnyResource; -import org.hl7.fhir.instance.model.api.IBaseReference; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.instance.model.api.IIdType; - -public abstract class BaseReference extends Type implements IBaseReference, ICompositeType { - - /** - * This is not a part of the "wire format" resource, but can be changed/accessed by parsers - */ - private transient IBaseResource resource; - - public BaseReference(String theReference) { - setReference(theReference); - } - - public BaseReference(IIdType theReference) { - if (theReference != null) { - setReference(theReference.getValue()); - } else { - setReference(null); - } - } - - public BaseReference(IAnyResource theResource) { - resource = theResource; - } - - public BaseReference() { - } - - /** - * Retrieves the actual resource referenced by this reference. Note that the resource itself is not - * a part of the FHIR "wire format" and is never transmitted or receieved inline, but this property - * may be changed/accessed by parsers. - */ - @Override - public IBaseResource getResource() { - return resource; - } - - @Override - public IIdType getReferenceElement() { - return new IdType(getReference()); - } - - abstract String getReference(); - - /** - * Sets the actual resource referenced by this reference. Note that the resource itself is not - * a part of the FHIR "wire format" and is never transmitted or receieved inline, but this property - * may be changed/accessed by parsers. - */ - @Override - public BaseReference setResource(IBaseResource theResource) { - resource = theResource; - return null; - } - - @Override - public boolean isEmpty() { - return resource == null && super.isEmpty(); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseResource.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseResource.java deleted file mode 100644 index a132c8e689a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BaseResource.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IAnyResource; -import org.hl7.fhir.instance.model.api.IIdType; - -import ca.uhn.fhir.context.FhirVersionEnum; -import ca.uhn.fhir.model.api.IElement; - -public abstract class BaseResource extends Base implements IAnyResource, IElement { - - private static final long serialVersionUID = 1L; - - /** - * @param value The logical id of the resource, as used in the url for the resoure. Once assigned, this value never changes. - */ - @Override - public BaseResource setId(IIdType value) { - if (value == null) { - setIdElement((IdType)null); - } else if (value instanceof IdType) { - setIdElement((IdType) value); - } else { - setIdElement(new IdType(value.getValue())); - } - return this; - } - - public abstract BaseResource setIdElement(IdType theIdType); - - @Override - public FhirVersionEnum getStructureFhirVersionEnum() { - return FhirVersionEnum.DSTU2_1; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Basic.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Basic.java deleted file mode 100644 index 4de8152c277..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Basic.java +++ /dev/null @@ -1,596 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ -@ResourceDef(name="Basic", profile="http://hl7.org/fhir/Profile/Basic") -public class Basic extends DomainResource { - - /** - * Identifier assigned to the resource for business purposes, outside the context of FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the resource for business purposes, outside the context of FHIR." ) - protected List identifier; - - /** - * Identifies the 'type' of resource - equivalent to the resource name for other resources. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="Kind of Resource", formalDefinition="Identifies the 'type' of resource - equivalent to the resource name for other resources." ) - protected CodeableConcept code; - - /** - * Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource. - */ - @Child(name = "subject", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifies the focus of this resource", formalDefinition="Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resource." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) - */ - protected Resource subjectTarget; - - /** - * Identifies when the resource was first created. - */ - @Child(name = "created", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When created", formalDefinition="Identifies when the resource was first created." ) - protected DateType created; - - /** - * Indicates who was responsible for creating the resource instance. - */ - @Child(name = "author", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who created", formalDefinition="Indicates who was responsible for creating the resource instance." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Indicates who was responsible for creating the resource instance.) - */ - protected Resource authorTarget; - - private static final long serialVersionUID = 650756402L; - - /** - * Constructor - */ - public Basic() { - super(); - } - - /** - * Constructor - */ - public Basic(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier assigned to the resource for business purposes, outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Basic addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identifies the 'type' of resource - equivalent to the resource name for other resources.) - */ - public Basic setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) - */ - public Basic setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient, practitioner, device or any other resource that is the "focus" of this resource.) - */ - public Basic setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (Identifies when the resource was first created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Basic setCreatedElement(DateType value) { - this.created = value; - return this; - } - - /** - * @return Identifies when the resource was first created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value Identifies when the resource was first created. - */ - public Basic setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Basic.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Indicates who was responsible for creating the resource instance.) - */ - public Basic setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates who was responsible for creating the resource instance.) - */ - public Basic setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the resource for business purposes, outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Identifies the 'type' of resource - equivalent to the resource name for other resources.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Any)", "Identifies the patient, practitioner, device or any other resource that is the \"focus\" of this resource.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("created", "date", "Identifies when the resource was first created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("author", "Reference(Practitioner|Patient|RelatedPerson)", "Indicates who was responsible for creating the resource instance.", 0, java.lang.Integer.MAX_VALUE, author)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateType - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 1028554472: // created - this.created = castToDate(value); // DateType - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("created")) - this.created = castToDate(value); // DateType - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3059181: return getCode(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateType - case -1406328437: return getAuthor(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type Basic.created"); - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Basic"; - - } - - public Basic copy() { - Basic dst = new Basic(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.created = created == null ? null : created.copy(); - dst.author = author == null ? null : author.copy(); - return dst; - } - - protected Basic typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Basic)) - return false; - Basic o = (Basic) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) - && compareDeep(created, o.created, true) && compareDeep(author, o.author, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Basic)) - return false; - Basic o = (Basic) other; - return compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (subject == null || subject.isEmpty()) && (created == null || created.isEmpty()) && (author == null || author.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Basic; - } - - /** - * Search parameter: author - *

- * Description: Who created
- * Type: reference
- * Path: Basic.author
- *

- */ - @SearchParamDefinition(name="author", path="Basic.author", description="Who created", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Who created
- * Type: reference
- * Path: Basic.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Basic:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Basic:author").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Identifies the focus of this resource
- * Type: reference
- * Path: Basic.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Basic.subject", description="Identifies the focus of this resource", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Identifies the focus of this resource
- * Type: reference
- * Path: Basic.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Basic:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Basic:patient").toLocked(); - - /** - * Search parameter: created - *

- * Description: When created
- * Type: date
- * Path: Basic.created
- *

- */ - @SearchParamDefinition(name="created", path="Basic.created", description="When created", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: When created
- * Type: date
- * Path: Basic.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: subject - *

- * Description: Identifies the focus of this resource
- * Type: reference
- * Path: Basic.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Basic.subject", description="Identifies the focus of this resource", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Identifies the focus of this resource
- * Type: reference
- * Path: Basic.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Basic:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Basic:subject").toLocked(); - - /** - * Search parameter: code - *

- * Description: Kind of Resource
- * Type: token
- * Path: Basic.code
- *

- */ - @SearchParamDefinition(name="code", path="Basic.code", description="Kind of Resource", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Kind of Resource
- * Type: token
- * Path: Basic.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: identifier - *

- * Description: Business identifier
- * Type: token
- * Path: Basic.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Basic.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Business identifier
- * Type: token
- * Path: Basic.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Binary.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Binary.java deleted file mode 100644 index f6161f92f09..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Binary.java +++ /dev/null @@ -1,301 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBinary; - -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; -/** - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ -@ResourceDef(name="Binary", profile="http://hl7.org/fhir/Profile/Binary") -public class Binary extends BaseBinary implements IBaseBinary { - - /** - * MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - @Child(name = "contentType", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="MimeType of the binary content", formalDefinition="MimeType of the binary content represented as a standard MimeType (BCP 13)." ) - protected CodeType contentType; - - /** - * The actual content, base64 encoded. - */ - @Child(name = "content", type = {Base64BinaryType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The actual content", formalDefinition="The actual content, base64 encoded." ) - protected Base64BinaryType content; - - private static final long serialVersionUID = 974764407L; - - /** - * Constructor - */ - public Binary() { - super(); - } - - /** - * Constructor - */ - public Binary(CodeType contentType, Base64BinaryType content) { - super(); - this.contentType = contentType; - this.content = content; - } - - /** - * @return {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Binary.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (MimeType of the binary content represented as a standard MimeType (BCP 13).). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Binary setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value MimeType of the binary content represented as a standard MimeType (BCP 13). - */ - public Binary setContentType(String value) { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - return this; - } - - /** - * @return {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Base64BinaryType getContentElement() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Binary.content"); - else if (Configuration.doAutoCreate()) - this.content = new Base64BinaryType(); // bb - return this.content; - } - - public boolean hasContentElement() { - return this.content != null && !this.content.isEmpty(); - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The actual content, base64 encoded.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Binary setContentElement(Base64BinaryType value) { - this.content = value; - return this; - } - - /** - * @return The actual content, base64 encoded. - */ - public byte[] getContent() { - return this.content == null ? null : this.content.getValue(); - } - - /** - * @param value The actual content, base64 encoded. - */ - public Binary setContent(byte[] value) { - if (this.content == null) - this.content = new Base64BinaryType(); - this.content.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "MimeType of the binary content represented as a standard MimeType (BCP 13).", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("content", "base64Binary", "The actual content, base64 encoded.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Base64BinaryType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -389131437: // contentType - this.contentType = castToCode(value); // CodeType - break; - case 951530617: // content - this.content = castToBase64Binary(value); // Base64BinaryType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("contentType")) - this.contentType = castToCode(value); // CodeType - else if (name.equals("content")) - this.content = castToBase64Binary(value); // Base64BinaryType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType - case 951530617: throw new FHIRException("Cannot make property content as it is not a complex type"); // Base64BinaryType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentType")) { - throw new FHIRException("Cannot call addChild on a primitive type Binary.contentType"); - } - else if (name.equals("content")) { - throw new FHIRException("Cannot call addChild on a primitive type Binary.content"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Binary"; - - } - - public Binary copy() { - Binary dst = new Binary(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.content = content == null ? null : content.copy(); - return dst; - } - - protected Binary typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Binary)) - return false; - Binary o = (Binary) other; - return compareDeep(contentType, o.contentType, true) && compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Binary)) - return false; - Binary o = (Binary) other; - return compareValues(contentType, o.contentType, true) && compareValues(content, o.content, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Binary; - } - - /** - * Search parameter: contenttype - *

- * Description: MimeType of the binary content
- * Type: token
- * Path: Binary.contentType
- *

- */ - @SearchParamDefinition(name="contenttype", path="Binary.contentType", description="MimeType of the binary content", type="token" ) - public static final String SP_CONTENTTYPE = "contenttype"; - /** - * Fluent Client search parameter constant for contenttype - *

- * Description: MimeType of the binary content
- * Type: token
- * Path: Binary.contentType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENTTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTENTTYPE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BodySite.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BodySite.java deleted file mode 100644 index 608c81c22fc..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BodySite.java +++ /dev/null @@ -1,592 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. - */ -@ResourceDef(name="BodySite", profile="http://hl7.org/fhir/Profile/BodySite") -public class BodySite extends DomainResource { - - /** - * The person to which the body site belongs. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient", formalDefinition="The person to which the body site belongs." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person to which the body site belongs.) - */ - protected Patient patientTarget; - - /** - * Identifier for this instance of the anatomical location. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Bodysite identifier", formalDefinition="Identifier for this instance of the anatomical location." ) - protected List identifier; - - /** - * Named anatomical location - ideally coded where possible. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Named anatomical location", formalDefinition="Named anatomical location - ideally coded where possible." ) - protected CodeableConcept code; - - /** - * Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane. - */ - @Child(name = "modifier", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Modification to location code", formalDefinition="Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane." ) - protected List modifier; - - /** - * Description of anatomical location. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The Description of anatomical location", formalDefinition="Description of anatomical location." ) - protected StringType description; - - /** - * Image or images used to identify a location. - */ - @Child(name = "image", type = {Attachment.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Attached images", formalDefinition="Image or images used to identify a location." ) - protected List image; - - private static final long serialVersionUID = 1568109920L; - - /** - * Constructor - */ - public BodySite() { - super(); - } - - /** - * Constructor - */ - public BodySite(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #patient} (The person to which the body site belongs.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person to which the body site belongs.) - */ - public BodySite setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person to which the body site belongs.) - */ - public BodySite setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifier for this instance of the anatomical location.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for this instance of the anatomical location.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public BodySite addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #code} (Named anatomical location - ideally coded where possible.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Named anatomical location - ideally coded where possible.) - */ - public BodySite setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (CodeableConcept item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.) - */ - // syntactic sugar - public CodeableConcept addModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - // syntactic sugar - public BodySite addModifier(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return this; - } - - /** - * @return {@link #description} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BodySite.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Description of anatomical location.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public BodySite setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of anatomical location. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of anatomical location. - */ - public BodySite setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #image} (Image or images used to identify a location.) - */ - public List getImage() { - if (this.image == null) - this.image = new ArrayList(); - return this.image; - } - - public boolean hasImage() { - if (this.image == null) - return false; - for (Attachment item : this.image) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #image} (Image or images used to identify a location.) - */ - // syntactic sugar - public Attachment addImage() { //3 - Attachment t = new Attachment(); - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return t; - } - - // syntactic sugar - public BodySite addImage(Attachment t) { //3 - if (t == null) - return this; - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "The person to which the body site belongs.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("identifier", "Identifier", "Identifier for this instance of the anatomical location.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Named anatomical location - ideally coded where possible.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("modifier", "CodeableConcept", "Modifier to refine the anatomical location. These include modifiers for laterality, relative location, directionality, number, and plane.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("description", "string", "Description of anatomical location.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("image", "Attachment", "Image or images used to identify a location.", 0, java.lang.Integer.MAX_VALUE, image)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // Attachment - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -615513385: // modifier - this.getModifier().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 100313435: // image - this.getImage().add(castToAttachment(value)); // Attachment - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("modifier")) - this.getModifier().add(castToCodeableConcept(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("image")) - this.getImage().add(castToAttachment(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -791418107: return getPatient(); // Reference - case -1618432855: return addIdentifier(); // Identifier - case 3059181: return getCode(); // CodeableConcept - case -615513385: return addModifier(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 100313435: return addImage(); // Attachment - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("modifier")) { - return addModifier(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type BodySite.description"); - } - else if (name.equals("image")) { - return addImage(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "BodySite"; - - } - - public BodySite copy() { - BodySite dst = new BodySite(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - if (modifier != null) { - dst.modifier = new ArrayList(); - for (CodeableConcept i : modifier) - dst.modifier.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (image != null) { - dst.image = new ArrayList(); - for (Attachment i : image) - dst.image.add(i.copy()); - }; - return dst; - } - - protected BodySite typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BodySite)) - return false; - BodySite o = (BodySite) other; - return compareDeep(patient, o.patient, true) && compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) - && compareDeep(modifier, o.modifier, true) && compareDeep(description, o.description, true) && compareDeep(image, o.image, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BodySite)) - return false; - BodySite o = (BodySite) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (code == null || code.isEmpty()) && (modifier == null || modifier.isEmpty()) && (description == null || description.isEmpty()) - && (image == null || image.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.BodySite; - } - - /** - * Search parameter: patient - *

- * Description: Patient to whom bodysite belongs
- * Type: reference
- * Path: BodySite.patient
- *

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

- * Description: Patient to whom bodysite belongs
- * Type: reference
- * Path: BodySite.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "BodySite:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("BodySite:patient").toLocked(); - - /** - * Search parameter: code - *

- * Description: Named anatomical location
- * Type: token
- * Path: BodySite.code
- *

- */ - @SearchParamDefinition(name="code", path="BodySite.code", description="Named anatomical location", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Named anatomical location
- * Type: token
- * Path: BodySite.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: identifier - *

- * Description: Identifier for this instance of the anatomical location
- * Type: token
- * Path: BodySite.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="BodySite.identifier", description="Identifier for this instance of the anatomical location", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Identifier for this instance of the anatomical location
- * Type: token
- * Path: BodySite.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BooleanType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BooleanType.java deleted file mode 100644 index 422789ff384..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/BooleanType.java +++ /dev/null @@ -1,102 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -/** - * - */ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IBaseBooleanDatatype; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "boolean" in FHIR "true" or "false" - */ -@DatatypeDef(name = "boolean") -public class BooleanType extends PrimitiveType implements IBaseBooleanDatatype { - - private static final long serialVersionUID = 3L; - - public BooleanType() { - super(); - } - - public BooleanType(boolean theBoolean) { - super(); - setValue(theBoolean); - } - - public BooleanType(Boolean theBoolean) { - super(); - setValue(theBoolean); - } - - public BooleanType(String value) { - super(); - setValueAsString(value); - } - - /** - * Returns the value of this type as a primitive boolean. - * - * @return Returns the value of this type as a primitive boolean. - * @throws NullPointerException - * If the value is not set - */ - public boolean booleanValue() { - return getValue().booleanValue(); - } - - public BooleanType copy() { - return new BooleanType(getValue()); - } - - protected String encode(Boolean theValue) { - if (Boolean.TRUE.equals(theValue)) { - return "true"; - } else { - return "false"; - } - } - - public String fhirType() { - return "boolean"; - } - - protected Boolean parse(String theValue) { - String value = theValue.trim(); - if ("true".equals(value)) { - return Boolean.TRUE; - } else if ("false".equals(value)) { - return Boolean.FALSE; - } else { - throw new IllegalArgumentException("Invalid boolean string: '" + theValue + "'"); - } - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Bundle.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Bundle.java deleted file mode 100644 index 16ea314faed..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Bundle.java +++ /dev/null @@ -1,2789 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.instance.model.api.IBaseBundle; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A container for a collection of resources. - */ -@ResourceDef(name="Bundle", profile="http://hl7.org/fhir/Profile/Bundle") -public class Bundle extends Resource implements IBaseBundle { - - public enum BundleType { - /** - * The bundle is a document. The first resource is a Composition. - */ - DOCUMENT, - /** - * The bundle is a message. The first resource is a MessageHeader. - */ - MESSAGE, - /** - * The bundle is a transaction - intended to be processed by a server as an atomic commit. - */ - TRANSACTION, - /** - * The bundle is a transaction response. Because the response is a transaction response, the transactionhas succeeded, and all responses are error free. - */ - TRANSACTIONRESPONSE, - /** - * The bundle is a transaction - intended to be processed by a server as a group of actions. - */ - BATCH, - /** - * The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success. - */ - BATCHRESPONSE, - /** - * The bundle is a list of resources from a history interaction on a server. - */ - HISTORY, - /** - * The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. - */ - SEARCHSET, - /** - * The bundle is a set of resources collected into a single document for ease of distribution. - */ - COLLECTION, - /** - * added to help the parsers - */ - NULL; - public static BundleType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("document".equals(codeString)) - return DOCUMENT; - if ("message".equals(codeString)) - return MESSAGE; - if ("transaction".equals(codeString)) - return TRANSACTION; - if ("transaction-response".equals(codeString)) - return TRANSACTIONRESPONSE; - if ("batch".equals(codeString)) - return BATCH; - if ("batch-response".equals(codeString)) - return BATCHRESPONSE; - if ("history".equals(codeString)) - return HISTORY; - if ("searchset".equals(codeString)) - return SEARCHSET; - if ("collection".equals(codeString)) - return COLLECTION; - throw new FHIRException("Unknown BundleType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DOCUMENT: return "document"; - case MESSAGE: return "message"; - case TRANSACTION: return "transaction"; - case TRANSACTIONRESPONSE: return "transaction-response"; - case BATCH: return "batch"; - case BATCHRESPONSE: return "batch-response"; - case HISTORY: return "history"; - case SEARCHSET: return "searchset"; - case COLLECTION: return "collection"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DOCUMENT: return "http://hl7.org/fhir/bundle-type"; - case MESSAGE: return "http://hl7.org/fhir/bundle-type"; - case TRANSACTION: return "http://hl7.org/fhir/bundle-type"; - case TRANSACTIONRESPONSE: return "http://hl7.org/fhir/bundle-type"; - case BATCH: return "http://hl7.org/fhir/bundle-type"; - case BATCHRESPONSE: return "http://hl7.org/fhir/bundle-type"; - case HISTORY: return "http://hl7.org/fhir/bundle-type"; - case SEARCHSET: return "http://hl7.org/fhir/bundle-type"; - case COLLECTION: return "http://hl7.org/fhir/bundle-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DOCUMENT: return "The bundle is a document. The first resource is a Composition."; - case MESSAGE: return "The bundle is a message. The first resource is a MessageHeader."; - case TRANSACTION: return "The bundle is a transaction - intended to be processed by a server as an atomic commit."; - case TRANSACTIONRESPONSE: return "The bundle is a transaction response. Because the response is a transaction response, the transactionhas succeeded, and all responses are error free."; - case BATCH: return "The bundle is a transaction - intended to be processed by a server as a group of actions."; - case BATCHRESPONSE: return "The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success."; - case HISTORY: return "The bundle is a list of resources from a history interaction on a server."; - case SEARCHSET: return "The bundle is a list of resources returned as a result of a search/query interaction, operation, or message."; - case COLLECTION: return "The bundle is a set of resources collected into a single document for ease of distribution."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DOCUMENT: return "Document"; - case MESSAGE: return "Message"; - case TRANSACTION: return "Transaction"; - case TRANSACTIONRESPONSE: return "Transaction Response"; - case BATCH: return "Batch"; - case BATCHRESPONSE: return "Batch Response"; - case HISTORY: return "History List"; - case SEARCHSET: return "Search Results"; - case COLLECTION: return "Collection"; - default: return "?"; - } - } - } - - public static class BundleTypeEnumFactory implements EnumFactory { - public BundleType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("document".equals(codeString)) - return BundleType.DOCUMENT; - if ("message".equals(codeString)) - return BundleType.MESSAGE; - if ("transaction".equals(codeString)) - return BundleType.TRANSACTION; - if ("transaction-response".equals(codeString)) - return BundleType.TRANSACTIONRESPONSE; - if ("batch".equals(codeString)) - return BundleType.BATCH; - if ("batch-response".equals(codeString)) - return BundleType.BATCHRESPONSE; - if ("history".equals(codeString)) - return BundleType.HISTORY; - if ("searchset".equals(codeString)) - return BundleType.SEARCHSET; - if ("collection".equals(codeString)) - return BundleType.COLLECTION; - throw new IllegalArgumentException("Unknown BundleType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("document".equals(codeString)) - return new Enumeration(this, BundleType.DOCUMENT); - if ("message".equals(codeString)) - return new Enumeration(this, BundleType.MESSAGE); - if ("transaction".equals(codeString)) - return new Enumeration(this, BundleType.TRANSACTION); - if ("transaction-response".equals(codeString)) - return new Enumeration(this, BundleType.TRANSACTIONRESPONSE); - if ("batch".equals(codeString)) - return new Enumeration(this, BundleType.BATCH); - if ("batch-response".equals(codeString)) - return new Enumeration(this, BundleType.BATCHRESPONSE); - if ("history".equals(codeString)) - return new Enumeration(this, BundleType.HISTORY); - if ("searchset".equals(codeString)) - return new Enumeration(this, BundleType.SEARCHSET); - if ("collection".equals(codeString)) - return new Enumeration(this, BundleType.COLLECTION); - throw new FHIRException("Unknown BundleType code '"+codeString+"'"); - } - public String toCode(BundleType code) { - if (code == BundleType.DOCUMENT) - return "document"; - if (code == BundleType.MESSAGE) - return "message"; - if (code == BundleType.TRANSACTION) - return "transaction"; - if (code == BundleType.TRANSACTIONRESPONSE) - return "transaction-response"; - if (code == BundleType.BATCH) - return "batch"; - if (code == BundleType.BATCHRESPONSE) - return "batch-response"; - if (code == BundleType.HISTORY) - return "history"; - if (code == BundleType.SEARCHSET) - return "searchset"; - if (code == BundleType.COLLECTION) - return "collection"; - return "?"; - } - public String toSystem(BundleType code) { - return code.getSystem(); - } - } - - public enum SearchEntryMode { - /** - * This resource matched the search specification. - */ - MATCH, - /** - * This resource is returned because it is referred to from another resource in the search set. - */ - INCLUDE, - /** - * An OperationOutcome that provides additional information about the processing of a search. - */ - OUTCOME, - /** - * added to help the parsers - */ - NULL; - public static SearchEntryMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("match".equals(codeString)) - return MATCH; - if ("include".equals(codeString)) - return INCLUDE; - if ("outcome".equals(codeString)) - return OUTCOME; - throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MATCH: return "match"; - case INCLUDE: return "include"; - case OUTCOME: return "outcome"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MATCH: return "http://hl7.org/fhir/search-entry-mode"; - case INCLUDE: return "http://hl7.org/fhir/search-entry-mode"; - case OUTCOME: return "http://hl7.org/fhir/search-entry-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MATCH: return "This resource matched the search specification."; - case INCLUDE: return "This resource is returned because it is referred to from another resource in the search set."; - case OUTCOME: return "An OperationOutcome that provides additional information about the processing of a search."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MATCH: return "Match"; - case INCLUDE: return "Include"; - case OUTCOME: return "Outcome"; - default: return "?"; - } - } - } - - public static class SearchEntryModeEnumFactory implements EnumFactory { - public SearchEntryMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("match".equals(codeString)) - return SearchEntryMode.MATCH; - if ("include".equals(codeString)) - return SearchEntryMode.INCLUDE; - if ("outcome".equals(codeString)) - return SearchEntryMode.OUTCOME; - throw new IllegalArgumentException("Unknown SearchEntryMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("match".equals(codeString)) - return new Enumeration(this, SearchEntryMode.MATCH); - if ("include".equals(codeString)) - return new Enumeration(this, SearchEntryMode.INCLUDE); - if ("outcome".equals(codeString)) - return new Enumeration(this, SearchEntryMode.OUTCOME); - throw new FHIRException("Unknown SearchEntryMode code '"+codeString+"'"); - } - public String toCode(SearchEntryMode code) { - if (code == SearchEntryMode.MATCH) - return "match"; - if (code == SearchEntryMode.INCLUDE) - return "include"; - if (code == SearchEntryMode.OUTCOME) - return "outcome"; - return "?"; - } - public String toSystem(SearchEntryMode code) { - return code.getSystem(); - } - } - - public enum HTTPVerb { - /** - * HTTP GET - */ - GET, - /** - * HTTP POST - */ - POST, - /** - * HTTP PUT - */ - PUT, - /** - * HTTP DELETE - */ - DELETE, - /** - * added to help the parsers - */ - NULL; - public static HTTPVerb fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("GET".equals(codeString)) - return GET; - if ("POST".equals(codeString)) - return POST; - if ("PUT".equals(codeString)) - return PUT; - if ("DELETE".equals(codeString)) - return DELETE; - throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case GET: return "GET"; - case POST: return "POST"; - case PUT: return "PUT"; - case DELETE: return "DELETE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case GET: return "http://hl7.org/fhir/http-verb"; - case POST: return "http://hl7.org/fhir/http-verb"; - case PUT: return "http://hl7.org/fhir/http-verb"; - case DELETE: return "http://hl7.org/fhir/http-verb"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case GET: return "HTTP GET"; - case POST: return "HTTP POST"; - case PUT: return "HTTP PUT"; - case DELETE: return "HTTP DELETE"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case GET: return "GET"; - case POST: return "POST"; - case PUT: return "PUT"; - case DELETE: return "DELETE"; - default: return "?"; - } - } - } - - public static class HTTPVerbEnumFactory implements EnumFactory { - public HTTPVerb fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("GET".equals(codeString)) - return HTTPVerb.GET; - if ("POST".equals(codeString)) - return HTTPVerb.POST; - if ("PUT".equals(codeString)) - return HTTPVerb.PUT; - if ("DELETE".equals(codeString)) - return HTTPVerb.DELETE; - throw new IllegalArgumentException("Unknown HTTPVerb code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("GET".equals(codeString)) - return new Enumeration(this, HTTPVerb.GET); - if ("POST".equals(codeString)) - return new Enumeration(this, HTTPVerb.POST); - if ("PUT".equals(codeString)) - return new Enumeration(this, HTTPVerb.PUT); - if ("DELETE".equals(codeString)) - return new Enumeration(this, HTTPVerb.DELETE); - throw new FHIRException("Unknown HTTPVerb code '"+codeString+"'"); - } - public String toCode(HTTPVerb code) { - if (code == HTTPVerb.GET) - return "GET"; - if (code == HTTPVerb.POST) - return "POST"; - if (code == HTTPVerb.PUT) - return "PUT"; - if (code == HTTPVerb.DELETE) - return "DELETE"; - return "?"; - } - public String toSystem(HTTPVerb code) { - return code.getSystem(); - } - } - - @Block() - public static class BundleLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - @Child(name = "relation", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="http://www.iana.org/assignments/link-relations/link-relations.xhtml", formalDefinition="A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]." ) - protected StringType relation; - - /** - * The reference details for the link. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference details for the link", formalDefinition="The reference details for the link." ) - protected UriType url; - - private static final long serialVersionUID = -1010386066L; - - /** - * Constructor - */ - public BundleLinkComponent() { - super(); - } - - /** - * Constructor - */ - public BundleLinkComponent(StringType relation, UriType url) { - super(); - this.relation = relation; - this.url = url; - } - - /** - * @return {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value - */ - public StringType getRelationElement() { - if (this.relation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleLinkComponent.relation"); - else if (Configuration.doAutoCreate()) - this.relation = new StringType(); // bb - return this.relation; - } - - public boolean hasRelationElement() { - return this.relation != null && !this.relation.isEmpty(); - } - - public boolean hasRelation() { - return this.relation != null && !this.relation.isEmpty(); - } - - /** - * @param value {@link #relation} (A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].). This is the underlying object with id, value and extensions. The accessor "getRelation" gives direct access to the value - */ - public BundleLinkComponent setRelationElement(StringType value) { - this.relation = value; - return this; - } - - /** - * @return A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - public String getRelation() { - return this.relation == null ? null : this.relation.getValue(); - } - - /** - * @param value A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]]. - */ - public BundleLinkComponent setRelation(String value) { - if (this.relation == null) - this.relation = new StringType(); - this.relation.setValue(value); - return this; - } - - /** - * @return {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleLinkComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The reference details for the link.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public BundleLinkComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The reference details for the link. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The reference details for the link. - */ - public BundleLinkComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relation", "string", "A name which details the functional use for this link - see [[http://www.iana.org/assignments/link-relations/link-relations.xhtml]].", 0, java.lang.Integer.MAX_VALUE, relation)); - childrenList.add(new Property("url", "uri", "The reference details for the link.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -554436100: /*relation*/ return this.relation == null ? new Base[0] : new Base[] {this.relation}; // StringType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -554436100: // relation - this.relation = castToString(value); // StringType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("relation")) - this.relation = castToString(value); // StringType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -554436100: throw new FHIRException("Cannot make property relation as it is not a complex type"); // StringType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("relation")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.relation"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.url"); - } - else - return super.addChild(name); - } - - public BundleLinkComponent copy() { - BundleLinkComponent dst = new BundleLinkComponent(); - copyValues(dst); - dst.relation = relation == null ? null : relation.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleLinkComponent)) - return false; - BundleLinkComponent o = (BundleLinkComponent) other; - return compareDeep(relation, o.relation, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleLinkComponent)) - return false; - BundleLinkComponent o = (BundleLinkComponent) other; - return compareValues(relation, o.relation, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (relation == null || relation.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "Bundle.link"; - - } - - } - - @Block() - public static class BundleEntryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A series of links that provide context to this entry. - */ - @Child(name = "link", type = {BundleLinkComponent.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Links related to this entry", formalDefinition="A series of links that provide context to this entry." ) - protected List link; - - /** - * The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: -* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) -* Results from operations might involve resources that are not identified. - */ - @Child(name = "fullUrl", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL for resource (server address, or UUID/OID)", formalDefinition="The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified." ) - protected UriType fullUrl; - - /** - * The Resources for the entry. - */ - @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A resource in the bundle", formalDefinition="The Resources for the entry." ) - protected Resource resource; - - /** - * Information about the search process that lead to the creation of this entry. - */ - @Child(name = "search", type = {}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Search related information", formalDefinition="Information about the search process that lead to the creation of this entry." ) - protected BundleEntrySearchComponent search; - - /** - * Additional information about how this entry should be processed as part of a transaction. - */ - @Child(name = "request", type = {}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) - protected BundleEntryRequestComponent request; - - /** - * Additional information about how this entry should be processed as part of a transaction. - */ - @Child(name = "response", type = {}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Transaction Related Information", formalDefinition="Additional information about how this entry should be processed as part of a transaction." ) - protected BundleEntryResponseComponent response; - - private static final long serialVersionUID = 517783054L; - - /** - * Constructor - */ - public BundleEntryComponent() { - super(); - } - - /** - * @return {@link #link} (A series of links that provide context to this entry.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (BundleLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (A series of links that provide context to this entry.) - */ - // syntactic sugar - public BundleLinkComponent addLink() { //3 - BundleLinkComponent t = new BundleLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public BundleEntryComponent addLink(BundleLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @return {@link #fullUrl} (The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: -* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) -* Results from operations might involve resources that are not identified.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value - */ - public UriType getFullUrlElement() { - if (this.fullUrl == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.fullUrl"); - else if (Configuration.doAutoCreate()) - this.fullUrl = new UriType(); // bb - return this.fullUrl; - } - - public boolean hasFullUrlElement() { - return this.fullUrl != null && !this.fullUrl.isEmpty(); - } - - public boolean hasFullUrl() { - return this.fullUrl != null && !this.fullUrl.isEmpty(); - } - - /** - * @param value {@link #fullUrl} (The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: -* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) -* Results from operations might involve resources that are not identified.). This is the underlying object with id, value and extensions. The accessor "getFullUrl" gives direct access to the value - */ - public BundleEntryComponent setFullUrlElement(UriType value) { - this.fullUrl = value; - return this; - } - - /** - * @return The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: -* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) -* Results from operations might involve resources that are not identified. - */ - public String getFullUrl() { - return this.fullUrl == null ? null : this.fullUrl.getValue(); - } - - /** - * @param value The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: -* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle) -* Results from operations might involve resources that are not identified. - */ - public BundleEntryComponent setFullUrl(String value) { - if (Utilities.noString(value)) - this.fullUrl = null; - else { - if (this.fullUrl == null) - this.fullUrl = new UriType(); - this.fullUrl.setValue(value); - } - return this; - } - - /** - * @return {@link #resource} (The Resources for the entry.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The Resources for the entry.) - */ - public BundleEntryComponent setResource(Resource value) { - this.resource = value; - return this; - } - - /** - * @return {@link #search} (Information about the search process that lead to the creation of this entry.) - */ - public BundleEntrySearchComponent getSearch() { - if (this.search == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.search"); - else if (Configuration.doAutoCreate()) - this.search = new BundleEntrySearchComponent(); // cc - return this.search; - } - - public boolean hasSearch() { - return this.search != null && !this.search.isEmpty(); - } - - /** - * @param value {@link #search} (Information about the search process that lead to the creation of this entry.) - */ - public BundleEntryComponent setSearch(BundleEntrySearchComponent value) { - this.search = value; - return this; - } - - /** - * @return {@link #request} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryRequestComponent getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.request"); - else if (Configuration.doAutoCreate()) - this.request = new BundleEntryRequestComponent(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryComponent setRequest(BundleEntryRequestComponent value) { - this.request = value; - return this; - } - - /** - * @return {@link #response} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryResponseComponent getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryComponent.response"); - else if (Configuration.doAutoCreate()) - this.response = new BundleEntryResponseComponent(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Additional information about how this entry should be processed as part of a transaction.) - */ - public BundleEntryComponent setResponse(BundleEntryResponseComponent value) { - this.response = value; - return this; - } - - /** - * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. - * If no link is found which matches the given relation, returns null. If more than one - * link is found which matches the given relation, returns the first matching BundleLinkComponent. - * - * @param theRelation - * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. - * @return Returns a matching BundleLinkComponent, or null - * @see IBaseBundle#LINK_NEXT - * @see IBaseBundle#LINK_PREV - * @see IBaseBundle#LINK_SELF - */ - public BundleLinkComponent getLink(String theRelation) { - org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); - for (BundleLinkComponent next : getLink()) { - if (theRelation.equals(next.getRelation())) { - return next; - } - } - return null; - } - - /** - * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. - * If no link is found which matches the given relation, creates a new BundleLinkComponent with the - * given relation and adds it to this Bundle. If more than one - * link is found which matches the given relation, returns the first matching BundleLinkComponent. - * - * @param theRelation - * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. - * @return Returns a matching BundleLinkComponent, or null - * @see IBaseBundle#LINK_NEXT - * @see IBaseBundle#LINK_PREV - * @see IBaseBundle#LINK_SELF - */ - public BundleLinkComponent getLinkOrCreate(String theRelation) { - org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); - for (BundleLinkComponent next : getLink()) { - if (theRelation.equals(next.getRelation())) { - return next; - } - } - BundleLinkComponent retVal = new BundleLinkComponent(); - retVal.setRelation(theRelation); - getLink().add(retVal); - return retVal; - } - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("link", "@Bundle.link", "A series of links that provide context to this entry.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("fullUrl", "uri", "The Absolute URL for the resource. The fullUrl SHALL not disagree with the id in the resource. The fullUrl is a version independent reference to the resource. The fullUrl element SHALL have a value except that: \n* fullUrl can be empty on a POST (although it does not need to when specifying a temporary id for reference in the bundle)\n* Results from operations might involve resources that are not identified.", 0, java.lang.Integer.MAX_VALUE, fullUrl)); - childrenList.add(new Property("resource", "Resource", "The Resources for the entry.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("search", "", "Information about the search process that lead to the creation of this entry.", 0, java.lang.Integer.MAX_VALUE, search)); - childrenList.add(new Property("request", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "", "Additional information about how this entry should be processed as part of a transaction.", 0, java.lang.Integer.MAX_VALUE, response)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent - case -511251360: /*fullUrl*/ return this.fullUrl == null ? new Base[0] : new Base[] {this.fullUrl}; // UriType - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource - case -906336856: /*search*/ return this.search == null ? new Base[0] : new Base[] {this.search}; // BundleEntrySearchComponent - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // BundleEntryRequestComponent - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // BundleEntryResponseComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3321850: // link - this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent - break; - case -511251360: // fullUrl - this.fullUrl = castToUri(value); // UriType - break; - case -341064690: // resource - this.resource = castToResource(value); // Resource - break; - case -906336856: // search - this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent - break; - case 1095692943: // request - this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent - break; - case -340323263: // response - this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("link")) - this.getLink().add((BundleLinkComponent) value); - else if (name.equals("fullUrl")) - this.fullUrl = castToUri(value); // UriType - else if (name.equals("resource")) - this.resource = castToResource(value); // Resource - else if (name.equals("search")) - this.search = (BundleEntrySearchComponent) value; // BundleEntrySearchComponent - else if (name.equals("request")) - this.request = (BundleEntryRequestComponent) value; // BundleEntryRequestComponent - else if (name.equals("response")) - this.response = (BundleEntryResponseComponent) value; // BundleEntryResponseComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3321850: return addLink(); // BundleLinkComponent - case -511251360: throw new FHIRException("Cannot make property fullUrl as it is not a complex type"); // UriType - case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource - case -906336856: return getSearch(); // BundleEntrySearchComponent - case 1095692943: return getRequest(); // BundleEntryRequestComponent - case -340323263: return getResponse(); // BundleEntryResponseComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("link")) { - return addLink(); - } - else if (name.equals("fullUrl")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.fullUrl"); - } - else if (name.equals("resource")) { - throw new FHIRException("Cannot call addChild on an abstract type Bundle.resource"); - } - else if (name.equals("search")) { - this.search = new BundleEntrySearchComponent(); - return this.search; - } - else if (name.equals("request")) { - this.request = new BundleEntryRequestComponent(); - return this.request; - } - else if (name.equals("response")) { - this.response = new BundleEntryResponseComponent(); - return this.response; - } - else - return super.addChild(name); - } - - public BundleEntryComponent copy() { - BundleEntryComponent dst = new BundleEntryComponent(); - copyValues(dst); - if (link != null) { - dst.link = new ArrayList(); - for (BundleLinkComponent i : link) - dst.link.add(i.copy()); - }; - dst.fullUrl = fullUrl == null ? null : fullUrl.copy(); - dst.resource = resource == null ? null : resource.copy(); - dst.search = search == null ? null : search.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntryComponent)) - return false; - BundleEntryComponent o = (BundleEntryComponent) other; - return compareDeep(link, o.link, true) && compareDeep(fullUrl, o.fullUrl, true) && compareDeep(resource, o.resource, true) - && compareDeep(search, o.search, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntryComponent)) - return false; - BundleEntryComponent o = (BundleEntryComponent) other; - return compareValues(fullUrl, o.fullUrl, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (link == null || link.isEmpty()) && (fullUrl == null || fullUrl.isEmpty()) - && (resource == null || resource.isEmpty()) && (search == null || search.isEmpty()) && (request == null || request.isEmpty()) - && (response == null || response.isEmpty()); - } - - public String fhirType() { - return "Bundle.entry"; - - } - - } - - @Block() - public static class BundleEntrySearchComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Why this entry is in the result set - whether it's included as a match or because of an _include requirement. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="match | include | outcome - why this is in the result set", formalDefinition="Why this entry is in the result set - whether it's included as a match or because of an _include requirement." ) - protected Enumeration mode; - - /** - * When searching, the server's search ranking score for the entry. - */ - @Child(name = "score", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Search ranking (between 0 and 1)", formalDefinition="When searching, the server's search ranking score for the entry." ) - protected DecimalType score; - - private static final long serialVersionUID = 837739866L; - - /** - * Constructor - */ - public BundleEntrySearchComponent() { - super(); - } - - /** - * @return {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntrySearchComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new SearchEntryModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Why this entry is in the result set - whether it's included as a match or because of an _include requirement.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public BundleEntrySearchComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Why this entry is in the result set - whether it's included as a match or because of an _include requirement. - */ - public SearchEntryMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Why this entry is in the result set - whether it's included as a match or because of an _include requirement. - */ - public BundleEntrySearchComponent setMode(SearchEntryMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(new SearchEntryModeEnumFactory()); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value - */ - public DecimalType getScoreElement() { - if (this.score == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntrySearchComponent.score"); - else if (Configuration.doAutoCreate()) - this.score = new DecimalType(); // bb - return this.score; - } - - public boolean hasScoreElement() { - return this.score != null && !this.score.isEmpty(); - } - - public boolean hasScore() { - return this.score != null && !this.score.isEmpty(); - } - - /** - * @param value {@link #score} (When searching, the server's search ranking score for the entry.). This is the underlying object with id, value and extensions. The accessor "getScore" gives direct access to the value - */ - public BundleEntrySearchComponent setScoreElement(DecimalType value) { - this.score = value; - return this; - } - - /** - * @return When searching, the server's search ranking score for the entry. - */ - public BigDecimal getScore() { - return this.score == null ? null : this.score.getValue(); - } - - /** - * @param value When searching, the server's search ranking score for the entry. - */ - public BundleEntrySearchComponent setScore(BigDecimal value) { - if (value == null) - this.score = null; - else { - if (this.score == null) - this.score = new DecimalType(); - this.score.setValue(value); - } - return this; - } - - /** - * @param value When searching, the server's search ranking score for the entry. - */ - public BundleEntrySearchComponent setScore(long value) { - this.score = new DecimalType(); - this.score.setValue(value); - return this; - } - - /** - * @param value When searching, the server's search ranking score for the entry. - */ - public BundleEntrySearchComponent setScore(double value) { - this.score = new DecimalType(); - this.score.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Why this entry is in the result set - whether it's included as a match or because of an _include requirement.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("score", "decimal", "When searching, the server's search ranking score for the entry.", 0, java.lang.Integer.MAX_VALUE, score)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3357091: // mode - this.mode = new SearchEntryModeEnumFactory().fromType(value); // Enumeration - break; - case 109264530: // score - this.score = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("mode")) - this.mode = new SearchEntryModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("score")) - this.score = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 109264530: throw new FHIRException("Cannot make property score as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.mode"); - } - else if (name.equals("score")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.score"); - } - else - return super.addChild(name); - } - - public BundleEntrySearchComponent copy() { - BundleEntrySearchComponent dst = new BundleEntrySearchComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.score = score == null ? null : score.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntrySearchComponent)) - return false; - BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(score, o.score, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntrySearchComponent)) - return false; - BundleEntrySearchComponent o = (BundleEntrySearchComponent) other; - return compareValues(mode, o.mode, true) && compareValues(score, o.score, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (score == null || score.isEmpty()) - ; - } - - public String fhirType() { - return "Bundle.entry.search"; - - } - - } - - @Block() - public static class BundleEntryRequestComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The HTTP verb for this entry in either a change history, or a transaction/ transaction response. - */ - @Child(name = "method", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="GET | POST | PUT | DELETE", formalDefinition="The HTTP verb for this entry in either a change history, or a transaction/ transaction response." ) - protected Enumeration method; - - /** - * The URL for this entry, relative to the root (the address to which the request is posted). - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="URL for HTTP equivalent of this entry", formalDefinition="The URL for this entry, relative to the root (the address to which the request is posted)." ) - protected UriType url; - - /** - * If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). - */ - @Child(name = "ifNoneMatch", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For managing cache currency", formalDefinition="If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread)." ) - protected StringType ifNoneMatch; - - /** - * Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). - */ - @Child(name = "ifModifiedSince", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread)." ) - protected InstantType ifModifiedSince; - - /** - * Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). - */ - @Child(name = "ifMatch", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For managing update contention", formalDefinition="Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency)." ) - protected StringType ifMatch; - - /** - * Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). - */ - @Child(name = "ifNoneExist", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For conditional creates", formalDefinition="Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\")." ) - protected StringType ifNoneExist; - - private static final long serialVersionUID = -1349769744L; - - /** - * Constructor - */ - public BundleEntryRequestComponent() { - super(); - } - - /** - * Constructor - */ - public BundleEntryRequestComponent(Enumeration method, UriType url) { - super(); - this.method = method; - this.url = url; - } - - /** - * @return {@link #method} (The HTTP verb for this entry in either a change history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value - */ - public Enumeration getMethodElement() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryRequestComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new Enumeration(new HTTPVerbEnumFactory()); // bb - return this.method; - } - - public boolean hasMethodElement() { - return this.method != null && !this.method.isEmpty(); - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (The HTTP verb for this entry in either a change history, or a transaction/ transaction response.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value - */ - public BundleEntryRequestComponent setMethodElement(Enumeration value) { - this.method = value; - return this; - } - - /** - * @return The HTTP verb for this entry in either a change history, or a transaction/ transaction response. - */ - public HTTPVerb getMethod() { - return this.method == null ? null : this.method.getValue(); - } - - /** - * @param value The HTTP verb for this entry in either a change history, or a transaction/ transaction response. - */ - public BundleEntryRequestComponent setMethod(HTTPVerb value) { - if (this.method == null) - this.method = new Enumeration(new HTTPVerbEnumFactory()); - this.method.setValue(value); - return this; - } - - /** - * @return {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryRequestComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The URL for this entry, relative to the root (the address to which the request is posted).). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public BundleEntryRequestComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The URL for this entry, relative to the root (the address to which the request is posted). - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The URL for this entry, relative to the root (the address to which the request is posted). - */ - public BundleEntryRequestComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value - */ - public StringType getIfNoneMatchElement() { - if (this.ifNoneMatch == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneMatch"); - else if (Configuration.doAutoCreate()) - this.ifNoneMatch = new StringType(); // bb - return this.ifNoneMatch; - } - - public boolean hasIfNoneMatchElement() { - return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); - } - - public boolean hasIfNoneMatch() { - return this.ifNoneMatch != null && !this.ifNoneMatch.isEmpty(); - } - - /** - * @param value {@link #ifNoneMatch} (If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfNoneMatch" gives direct access to the value - */ - public BundleEntryRequestComponent setIfNoneMatchElement(StringType value) { - this.ifNoneMatch = value; - return this; - } - - /** - * @return If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). - */ - public String getIfNoneMatch() { - return this.ifNoneMatch == null ? null : this.ifNoneMatch.getValue(); - } - - /** - * @param value If the ETag values match, return a 304 Not modified status. See the API documentation for ["Conditional Read"](http.html#cread). - */ - public BundleEntryRequestComponent setIfNoneMatch(String value) { - if (Utilities.noString(value)) - this.ifNoneMatch = null; - else { - if (this.ifNoneMatch == null) - this.ifNoneMatch = new StringType(); - this.ifNoneMatch.setValue(value); - } - return this; - } - - /** - * @return {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value - */ - public InstantType getIfModifiedSinceElement() { - if (this.ifModifiedSince == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifModifiedSince"); - else if (Configuration.doAutoCreate()) - this.ifModifiedSince = new InstantType(); // bb - return this.ifModifiedSince; - } - - public boolean hasIfModifiedSinceElement() { - return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); - } - - public boolean hasIfModifiedSince() { - return this.ifModifiedSince != null && !this.ifModifiedSince.isEmpty(); - } - - /** - * @param value {@link #ifModifiedSince} (Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread).). This is the underlying object with id, value and extensions. The accessor "getIfModifiedSince" gives direct access to the value - */ - public BundleEntryRequestComponent setIfModifiedSinceElement(InstantType value) { - this.ifModifiedSince = value; - return this; - } - - /** - * @return Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). - */ - public Date getIfModifiedSince() { - return this.ifModifiedSince == null ? null : this.ifModifiedSince.getValue(); - } - - /** - * @param value Only perform the operation if the last updated date matches. See the API documentation for ["Conditional Read"](http.html#cread). - */ - public BundleEntryRequestComponent setIfModifiedSince(Date value) { - if (value == null) - this.ifModifiedSince = null; - else { - if (this.ifModifiedSince == null) - this.ifModifiedSince = new InstantType(); - this.ifModifiedSince.setValue(value); - } - return this; - } - - /** - * @return {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value - */ - public StringType getIfMatchElement() { - if (this.ifMatch == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifMatch"); - else if (Configuration.doAutoCreate()) - this.ifMatch = new StringType(); // bb - return this.ifMatch; - } - - public boolean hasIfMatchElement() { - return this.ifMatch != null && !this.ifMatch.isEmpty(); - } - - public boolean hasIfMatch() { - return this.ifMatch != null && !this.ifMatch.isEmpty(); - } - - /** - * @param value {@link #ifMatch} (Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency).). This is the underlying object with id, value and extensions. The accessor "getIfMatch" gives direct access to the value - */ - public BundleEntryRequestComponent setIfMatchElement(StringType value) { - this.ifMatch = value; - return this; - } - - /** - * @return Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). - */ - public String getIfMatch() { - return this.ifMatch == null ? null : this.ifMatch.getValue(); - } - - /** - * @param value Only perform the operation if the Etag value matches. For more information, see the API section ["Managing Resource Contention"](http.html#concurrency). - */ - public BundleEntryRequestComponent setIfMatch(String value) { - if (Utilities.noString(value)) - this.ifMatch = null; - else { - if (this.ifMatch == null) - this.ifMatch = new StringType(); - this.ifMatch.setValue(value); - } - return this; - } - - /** - * @return {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value - */ - public StringType getIfNoneExistElement() { - if (this.ifNoneExist == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryRequestComponent.ifNoneExist"); - else if (Configuration.doAutoCreate()) - this.ifNoneExist = new StringType(); // bb - return this.ifNoneExist; - } - - public boolean hasIfNoneExistElement() { - return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); - } - - public boolean hasIfNoneExist() { - return this.ifNoneExist != null && !this.ifNoneExist.isEmpty(); - } - - /** - * @param value {@link #ifNoneExist} (Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?").). This is the underlying object with id, value and extensions. The accessor "getIfNoneExist" gives direct access to the value - */ - public BundleEntryRequestComponent setIfNoneExistElement(StringType value) { - this.ifNoneExist = value; - return this; - } - - /** - * @return Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). - */ - public String getIfNoneExist() { - return this.ifNoneExist == null ? null : this.ifNoneExist.getValue(); - } - - /** - * @param value Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for ["Conditional Create"](http.html#ccreate). This is just the query portion of the URL - what follows the "?" (not including the "?"). - */ - public BundleEntryRequestComponent setIfNoneExist(String value) { - if (Utilities.noString(value)) - this.ifNoneExist = null; - else { - if (this.ifNoneExist == null) - this.ifNoneExist = new StringType(); - this.ifNoneExist.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("method", "code", "The HTTP verb for this entry in either a change history, or a transaction/ transaction response.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("url", "uri", "The URL for this entry, relative to the root (the address to which the request is posted).", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("ifNoneMatch", "string", "If the ETag values match, return a 304 Not modified status. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifNoneMatch)); - childrenList.add(new Property("ifModifiedSince", "instant", "Only perform the operation if the last updated date matches. See the API documentation for [\"Conditional Read\"](http.html#cread).", 0, java.lang.Integer.MAX_VALUE, ifModifiedSince)); - childrenList.add(new Property("ifMatch", "string", "Only perform the operation if the Etag value matches. For more information, see the API section [\"Managing Resource Contention\"](http.html#concurrency).", 0, java.lang.Integer.MAX_VALUE, ifMatch)); - childrenList.add(new Property("ifNoneExist", "string", "Instruct the server not to perform the create if a specified resource already exists. For further information, see the API documentation for [\"Conditional Create\"](http.html#ccreate). This is just the query portion of the URL - what follows the \"?\" (not including the \"?\").", 0, java.lang.Integer.MAX_VALUE, ifNoneExist)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // Enumeration - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 171868368: /*ifNoneMatch*/ return this.ifNoneMatch == null ? new Base[0] : new Base[] {this.ifNoneMatch}; // StringType - case -2061602860: /*ifModifiedSince*/ return this.ifModifiedSince == null ? new Base[0] : new Base[] {this.ifModifiedSince}; // InstantType - case 1692894888: /*ifMatch*/ return this.ifMatch == null ? new Base[0] : new Base[] {this.ifMatch}; // StringType - case 165155330: /*ifNoneExist*/ return this.ifNoneExist == null ? new Base[0] : new Base[] {this.ifNoneExist}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1077554975: // method - this.method = new HTTPVerbEnumFactory().fromType(value); // Enumeration - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 171868368: // ifNoneMatch - this.ifNoneMatch = castToString(value); // StringType - break; - case -2061602860: // ifModifiedSince - this.ifModifiedSince = castToInstant(value); // InstantType - break; - case 1692894888: // ifMatch - this.ifMatch = castToString(value); // StringType - break; - case 165155330: // ifNoneExist - this.ifNoneExist = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("method")) - this.method = new HTTPVerbEnumFactory().fromType(value); // Enumeration - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("ifNoneMatch")) - this.ifNoneMatch = castToString(value); // StringType - else if (name.equals("ifModifiedSince")) - this.ifModifiedSince = castToInstant(value); // InstantType - else if (name.equals("ifMatch")) - this.ifMatch = castToString(value); // StringType - else if (name.equals("ifNoneExist")) - this.ifNoneExist = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1077554975: throw new FHIRException("Cannot make property method as it is not a complex type"); // Enumeration - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 171868368: throw new FHIRException("Cannot make property ifNoneMatch as it is not a complex type"); // StringType - case -2061602860: throw new FHIRException("Cannot make property ifModifiedSince as it is not a complex type"); // InstantType - case 1692894888: throw new FHIRException("Cannot make property ifMatch as it is not a complex type"); // StringType - case 165155330: throw new FHIRException("Cannot make property ifNoneExist as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("method")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.method"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.url"); - } - else if (name.equals("ifNoneMatch")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneMatch"); - } - else if (name.equals("ifModifiedSince")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifModifiedSince"); - } - else if (name.equals("ifMatch")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifMatch"); - } - else if (name.equals("ifNoneExist")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.ifNoneExist"); - } - else - return super.addChild(name); - } - - public BundleEntryRequestComponent copy() { - BundleEntryRequestComponent dst = new BundleEntryRequestComponent(); - copyValues(dst); - dst.method = method == null ? null : method.copy(); - dst.url = url == null ? null : url.copy(); - dst.ifNoneMatch = ifNoneMatch == null ? null : ifNoneMatch.copy(); - dst.ifModifiedSince = ifModifiedSince == null ? null : ifModifiedSince.copy(); - dst.ifMatch = ifMatch == null ? null : ifMatch.copy(); - dst.ifNoneExist = ifNoneExist == null ? null : ifNoneExist.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntryRequestComponent)) - return false; - BundleEntryRequestComponent o = (BundleEntryRequestComponent) other; - return compareDeep(method, o.method, true) && compareDeep(url, o.url, true) && compareDeep(ifNoneMatch, o.ifNoneMatch, true) - && compareDeep(ifModifiedSince, o.ifModifiedSince, true) && compareDeep(ifMatch, o.ifMatch, true) - && compareDeep(ifNoneExist, o.ifNoneExist, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntryRequestComponent)) - return false; - BundleEntryRequestComponent o = (BundleEntryRequestComponent) other; - return compareValues(method, o.method, true) && compareValues(url, o.url, true) && compareValues(ifNoneMatch, o.ifNoneMatch, true) - && compareValues(ifModifiedSince, o.ifModifiedSince, true) && compareValues(ifMatch, o.ifMatch, true) - && compareValues(ifNoneExist, o.ifNoneExist, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (method == null || method.isEmpty()) && (url == null || url.isEmpty()) - && (ifNoneMatch == null || ifNoneMatch.isEmpty()) && (ifModifiedSince == null || ifModifiedSince.isEmpty()) - && (ifMatch == null || ifMatch.isEmpty()) && (ifNoneExist == null || ifNoneExist.isEmpty()) - ; - } - - public String fhirType() { - return "Bundle.entry.request"; - - } - - } - - @Block() - public static class BundleEntryResponseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. - */ - @Child(name = "status", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Status response code (text optional)", formalDefinition="The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code." ) - protected StringType status; - - /** - * The location header created by processing this operation. - */ - @Child(name = "location", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The location, if the operation returns a location", formalDefinition="The location header created by processing this operation." ) - protected UriType location; - - /** - * The etag for the resource, it the operation for the entry produced a versioned resource. - */ - @Child(name = "etag", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The etag for the resource (if relevant)", formalDefinition="The etag for the resource, it the operation for the entry produced a versioned resource." ) - protected StringType etag; - - /** - * The date/time that the resource was modified on the server. - */ - @Child(name = "lastModified", type = {InstantType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Server's date time modified", formalDefinition="The date/time that the resource was modified on the server." ) - protected InstantType lastModified; - - private static final long serialVersionUID = -1526413234L; - - /** - * Constructor - */ - public BundleEntryResponseComponent() { - super(); - } - - /** - * Constructor - */ - public BundleEntryResponseComponent(StringType status) { - super(); - this.status = status; - } - - /** - * @return {@link #status} (The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public StringType getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryResponseComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new StringType(); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public BundleEntryResponseComponent setStatusElement(StringType value) { - this.status = value; - return this; - } - - /** - * @return The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. - */ - public String getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code. - */ - public BundleEntryResponseComponent setStatus(String value) { - if (this.status == null) - this.status = new StringType(); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value - */ - public UriType getLocationElement() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryResponseComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new UriType(); // bb - return this.location; - } - - public boolean hasLocationElement() { - return this.location != null && !this.location.isEmpty(); - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location header created by processing this operation.). This is the underlying object with id, value and extensions. The accessor "getLocation" gives direct access to the value - */ - public BundleEntryResponseComponent setLocationElement(UriType value) { - this.location = value; - return this; - } - - /** - * @return The location header created by processing this operation. - */ - public String getLocation() { - return this.location == null ? null : this.location.getValue(); - } - - /** - * @param value The location header created by processing this operation. - */ - public BundleEntryResponseComponent setLocation(String value) { - if (Utilities.noString(value)) - this.location = null; - else { - if (this.location == null) - this.location = new UriType(); - this.location.setValue(value); - } - return this; - } - - /** - * @return {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value - */ - public StringType getEtagElement() { - if (this.etag == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryResponseComponent.etag"); - else if (Configuration.doAutoCreate()) - this.etag = new StringType(); // bb - return this.etag; - } - - public boolean hasEtagElement() { - return this.etag != null && !this.etag.isEmpty(); - } - - public boolean hasEtag() { - return this.etag != null && !this.etag.isEmpty(); - } - - /** - * @param value {@link #etag} (The etag for the resource, it the operation for the entry produced a versioned resource.). This is the underlying object with id, value and extensions. The accessor "getEtag" gives direct access to the value - */ - public BundleEntryResponseComponent setEtagElement(StringType value) { - this.etag = value; - return this; - } - - /** - * @return The etag for the resource, it the operation for the entry produced a versioned resource. - */ - public String getEtag() { - return this.etag == null ? null : this.etag.getValue(); - } - - /** - * @param value The etag for the resource, it the operation for the entry produced a versioned resource. - */ - public BundleEntryResponseComponent setEtag(String value) { - if (Utilities.noString(value)) - this.etag = null; - else { - if (this.etag == null) - this.etag = new StringType(); - this.etag.setValue(value); - } - return this; - } - - /** - * @return {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public InstantType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BundleEntryResponseComponent.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new InstantType(); // bb - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (The date/time that the resource was modified on the server.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public BundleEntryResponseComponent setLastModifiedElement(InstantType value) { - this.lastModified = value; - return this; - } - - /** - * @return The date/time that the resource was modified on the server. - */ - public Date getLastModified() { - return this.lastModified == null ? null : this.lastModified.getValue(); - } - - /** - * @param value The date/time that the resource was modified on the server. - */ - public BundleEntryResponseComponent setLastModified(Date value) { - if (value == null) - this.lastModified = null; - else { - if (this.lastModified == null) - this.lastModified = new InstantType(); - this.lastModified.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "string", "The status code returned by processing this entry. The status SHALL start with a 3 digit HTTP code (e.g. 404) and may contain the standard HTTP description associated with the status code.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("location", "uri", "The location header created by processing this operation.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("etag", "string", "The etag for the resource, it the operation for the entry produced a versioned resource.", 0, java.lang.Integer.MAX_VALUE, etag)); - childrenList.add(new Property("lastModified", "instant", "The date/time that the resource was modified on the server.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // StringType - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // UriType - case 3123477: /*etag*/ return this.etag == null ? new Base[0] : new Base[] {this.etag}; // StringType - case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // InstantType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -892481550: // status - this.status = castToString(value); // StringType - break; - case 1901043637: // location - this.location = castToUri(value); // UriType - break; - case 3123477: // etag - this.etag = castToString(value); // StringType - break; - case 1959003007: // lastModified - this.lastModified = castToInstant(value); // InstantType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("status")) - this.status = castToString(value); // StringType - else if (name.equals("location")) - this.location = castToUri(value); // UriType - else if (name.equals("etag")) - this.etag = castToString(value); // StringType - else if (name.equals("lastModified")) - this.lastModified = castToInstant(value); // InstantType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // StringType - case 1901043637: throw new FHIRException("Cannot make property location as it is not a complex type"); // UriType - case 3123477: throw new FHIRException("Cannot make property etag as it is not a complex type"); // StringType - case 1959003007: throw new FHIRException("Cannot make property lastModified as it is not a complex type"); // InstantType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.status"); - } - else if (name.equals("location")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.location"); - } - else if (name.equals("etag")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.etag"); - } - else if (name.equals("lastModified")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.lastModified"); - } - else - return super.addChild(name); - } - - public BundleEntryResponseComponent copy() { - BundleEntryResponseComponent dst = new BundleEntryResponseComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.location = location == null ? null : location.copy(); - dst.etag = etag == null ? null : etag.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BundleEntryResponseComponent)) - return false; - BundleEntryResponseComponent o = (BundleEntryResponseComponent) other; - return compareDeep(status, o.status, true) && compareDeep(location, o.location, true) && compareDeep(etag, o.etag, true) - && compareDeep(lastModified, o.lastModified, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BundleEntryResponseComponent)) - return false; - BundleEntryResponseComponent o = (BundleEntryResponseComponent) other; - return compareValues(status, o.status, true) && compareValues(location, o.location, true) && compareValues(etag, o.etag, true) - && compareValues(lastModified, o.lastModified, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (location == null || location.isEmpty()) - && (etag == null || etag.isEmpty()) && (lastModified == null || lastModified.isEmpty()); - } - - public String fhirType() { - return "Bundle.entry.response"; - - } - - } - - /** - * Indicates the purpose of this bundle- how it was intended to be used. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", formalDefinition="Indicates the purpose of this bundle- how it was intended to be used." ) - protected Enumeration type; - - /** - * If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - @Child(name = "total", type = {UnsignedIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If search, the total number of matches", formalDefinition="If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle)." ) - protected UnsignedIntType total; - - /** - * A series of links that provide context to this bundle. - */ - @Child(name = "link", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Links related to this Bundle", formalDefinition="A series of links that provide context to this bundle." ) - protected List link; - - /** - * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only). - */ - @Child(name = "entry", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Entry in the bundle - will have a resource, or information", formalDefinition="An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only)." ) - protected List entry; - - /** - * Digital Signature - base64 encoded. XML DigSIg or a JWT. - */ - @Child(name = "signature", type = {Signature.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Digital Signature", formalDefinition="Digital Signature - base64 encoded. XML DigSIg or a JWT." ) - protected Signature signature; - - private static final long serialVersionUID = -2041954721L; - - /** - * Constructor - */ - public Bundle() { - super(); - } - - /** - * Constructor - */ - public Bundle(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new BundleTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the purpose of this bundle- how it was intended to be used.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Bundle setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Indicates the purpose of this bundle- how it was intended to be used. - */ - public BundleType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Indicates the purpose of this bundle- how it was intended to be used. - */ - public Bundle setType(BundleType value) { - if (this.type == null) - this.type = new Enumeration(new BundleTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public UnsignedIntType getTotalElement() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.total"); - else if (Configuration.doAutoCreate()) - this.total = new UnsignedIntType(); // bb - return this.total; - } - - public boolean hasTotalElement() { - return this.total != null && !this.total.isEmpty(); - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public Bundle setTotalElement(UnsignedIntType value) { - this.total = value; - return this; - } - - /** - * @return If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - public int getTotal() { - return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); - } - - /** - * @param value If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle). - */ - public Bundle setTotal(int value) { - if (this.total == null) - this.total = new UnsignedIntType(); - this.total.setValue(value); - return this; - } - - /** - * @return {@link #link} (A series of links that provide context to this bundle.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (BundleLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (A series of links that provide context to this bundle.) - */ - // syntactic sugar - public BundleLinkComponent addLink() { //3 - BundleLinkComponent t = new BundleLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public Bundle addLink(BundleLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (BundleEntryComponent item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).) - */ - // syntactic sugar - public BundleEntryComponent addEntry() { //3 - BundleEntryComponent t = new BundleEntryComponent(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - // syntactic sugar - public Bundle addEntry(BundleEntryComponent t) { //3 - if (t == null) - return this; - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return this; - } - - /** - * @return {@link #signature} (Digital Signature - base64 encoded. XML DigSIg or a JWT.) - */ - public Signature getSignature() { - if (this.signature == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Bundle.signature"); - else if (Configuration.doAutoCreate()) - this.signature = new Signature(); // cc - return this.signature; - } - - public boolean hasSignature() { - return this.signature != null && !this.signature.isEmpty(); - } - - /** - * @param value {@link #signature} (Digital Signature - base64 encoded. XML DigSIg or a JWT.) - */ - public Bundle setSignature(Signature value) { - this.signature = value; - return this; - } - - /** - * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. - * If no link is found which matches the given relation, returns null. If more than one - * link is found which matches the given relation, returns the first matching BundleLinkComponent. - * - * @param theRelation - * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. - * @return Returns a matching BundleLinkComponent, or null - * @see IBaseBundle#LINK_NEXT - * @see IBaseBundle#LINK_PREV - * @see IBaseBundle#LINK_SELF - */ - public BundleLinkComponent getLink(String theRelation) { - org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); - for (BundleLinkComponent next : getLink()) { - if (theRelation.equals(next.getRelation())) { - return next; - } - } - return null; - } - - /** - * Returns the {@link #getLink() link} which matches a given {@link BundleLinkComponent#getRelation() relation}. - * If no link is found which matches the given relation, creates a new BundleLinkComponent with the - * given relation and adds it to this Bundle. If more than one - * link is found which matches the given relation, returns the first matching BundleLinkComponent. - * - * @param theRelation - * The relation, such as "next", or "self. See the constants such as {@link IBaseBundle#LINK_SELF} and {@link IBaseBundle#LINK_NEXT}. - * @return Returns a matching BundleLinkComponent, or null - * @see IBaseBundle#LINK_NEXT - * @see IBaseBundle#LINK_PREV - * @see IBaseBundle#LINK_SELF - */ - public BundleLinkComponent getLinkOrCreate(String theRelation) { - org.apache.commons.lang3.Validate.notBlank(theRelation, "theRelation may not be null or empty"); - for (BundleLinkComponent next : getLink()) { - if (theRelation.equals(next.getRelation())) { - return next; - } - } - BundleLinkComponent retVal = new BundleLinkComponent(); - retVal.setRelation(theRelation); - getLink().add(retVal); - return retVal; - } - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Indicates the purpose of this bundle- how it was intended to be used.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("total", "unsignedInt", "If a set of search matches, this is the total number of matches for the search (as opposed to the number of results in this bundle).", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("link", "", "A series of links that provide context to this bundle.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("entry", "", "An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and history only).", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("signature", "Signature", "Digital Signature - base64 encoded. XML DigSIg or a JWT.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // UnsignedIntType - case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // BundleLinkComponent - case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // BundleEntryComponent - case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : new Base[] {this.signature}; // Signature - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration - break; - case 110549828: // total - this.total = castToUnsignedInt(value); // UnsignedIntType - break; - case 3321850: // link - this.getLink().add((BundleLinkComponent) value); // BundleLinkComponent - break; - case 96667762: // entry - this.getEntry().add((BundleEntryComponent) value); // BundleEntryComponent - break; - case 1073584312: // signature - this.signature = castToSignature(value); // Signature - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new BundleTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("total")) - this.total = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("link")) - this.getLink().add((BundleLinkComponent) value); - else if (name.equals("entry")) - this.getEntry().add((BundleEntryComponent) value); - else if (name.equals("signature")) - this.signature = castToSignature(value); // Signature - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 110549828: throw new FHIRException("Cannot make property total as it is not a complex type"); // UnsignedIntType - case 3321850: return addLink(); // BundleLinkComponent - case 96667762: return addEntry(); // BundleEntryComponent - case 1073584312: return getSignature(); // Signature - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.type"); - } - else if (name.equals("total")) { - throw new FHIRException("Cannot call addChild on a primitive type Bundle.total"); - } - else if (name.equals("link")) { - return addLink(); - } - else if (name.equals("entry")) { - return addEntry(); - } - else if (name.equals("signature")) { - this.signature = new Signature(); - return this.signature; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Bundle"; - - } - - public Bundle copy() { - Bundle dst = new Bundle(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.total = total == null ? null : total.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (BundleLinkComponent i : link) - dst.link.add(i.copy()); - }; - if (entry != null) { - dst.entry = new ArrayList(); - for (BundleEntryComponent i : entry) - dst.entry.add(i.copy()); - }; - dst.signature = signature == null ? null : signature.copy(); - return dst; - } - - protected Bundle typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Bundle)) - return false; - Bundle o = (Bundle) other; - return compareDeep(type, o.type, true) && compareDeep(total, o.total, true) && compareDeep(link, o.link, true) - && compareDeep(entry, o.entry, true) && compareDeep(signature, o.signature, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Bundle)) - return false; - Bundle o = (Bundle) other; - return compareValues(type, o.type, true) && compareValues(total, o.total, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (total == null || total.isEmpty()) - && (link == null || link.isEmpty()) && (entry == null || entry.isEmpty()) && (signature == null || signature.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Bundle; - } - - /** - * Search parameter: message - *

- * Description: The first resource in the bundle, if the bundle type is "message" - this is a message header, and this parameter provides access to search its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *

- */ - @SearchParamDefinition(name="message", path="Bundle.entry.resource[0]", description="The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents", type="reference" ) - public static final String SP_MESSAGE = "message"; - /** - * Fluent Client search parameter constant for message - *

- * Description: The first resource in the bundle, if the bundle type is "message" - this is a message header, and this parameter provides access to search its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MESSAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MESSAGE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Bundle:message". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MESSAGE = new ca.uhn.fhir.model.api.Include("Bundle:message").toLocked(); - - /** - * Search parameter: composition - *

- * Description: The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to searches its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *

- */ - @SearchParamDefinition(name="composition", path="Bundle.entry.resource[0]", description="The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents", type="reference" ) - public static final String SP_COMPOSITION = "composition"; - /** - * Fluent Client search parameter constant for composition - *

- * Description: The first resource in the bundle, if the bundle type is "document" - this is a composition, and this parameter provides access to searches its contents
- * Type: reference
- * Path: Bundle.entry.resource(0)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COMPOSITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COMPOSITION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Bundle:composition". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_COMPOSITION = new ca.uhn.fhir.model.api.Include("Bundle:composition").toLocked(); - - /** - * Search parameter: type - *

- * Description: document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
- * Type: token
- * Path: Bundle.type
- *

- */ - @SearchParamDefinition(name="type", path="Bundle.type", description="document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection
- * Type: token
- * Path: Bundle.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CarePlan.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CarePlan.java deleted file mode 100644 index d00e09c3702..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CarePlan.java +++ /dev/null @@ -1,3767 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. - */ -@ResourceDef(name="CarePlan", profile="http://hl7.org/fhir/Profile/CarePlan") -public class CarePlan extends DomainResource { - - public enum CarePlanStatus { - /** - * The plan has been suggested but no commitment to it has yet been made. - */ - PROPOSED, - /** - * The plan is in development or awaiting use but is not yet intended to be acted upon. - */ - DRAFT, - /** - * The plan is intended to be followed and used as part of patient care. - */ - ACTIVE, - /** - * The plan is no longer in use and is not expected to be followed or used in patient care. - */ - COMPLETED, - /** - * The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan). - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static CarePlanStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new FHIRException("Unknown CarePlanStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/care-plan-status"; - case DRAFT: return "http://hl7.org/fhir/care-plan-status"; - case ACTIVE: return "http://hl7.org/fhir/care-plan-status"; - case COMPLETED: return "http://hl7.org/fhir/care-plan-status"; - case CANCELLED: return "http://hl7.org/fhir/care-plan-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The plan has been suggested but no commitment to it has yet been made."; - case DRAFT: return "The plan is in development or awaiting use but is not yet intended to be acted upon."; - case ACTIVE: return "The plan is intended to be followed and used as part of patient care."; - case COMPLETED: return "The plan is no longer in use and is not expected to be followed or used in patient care."; - case CANCELLED: return "The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Pending"; - case ACTIVE: return "Active"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class CarePlanStatusEnumFactory implements EnumFactory { - public CarePlanStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return CarePlanStatus.PROPOSED; - if ("draft".equals(codeString)) - return CarePlanStatus.DRAFT; - if ("active".equals(codeString)) - return CarePlanStatus.ACTIVE; - if ("completed".equals(codeString)) - return CarePlanStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return CarePlanStatus.CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, CarePlanStatus.PROPOSED); - if ("draft".equals(codeString)) - return new Enumeration(this, CarePlanStatus.DRAFT); - if ("active".equals(codeString)) - return new Enumeration(this, CarePlanStatus.ACTIVE); - if ("completed".equals(codeString)) - return new Enumeration(this, CarePlanStatus.COMPLETED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, CarePlanStatus.CANCELLED); - throw new FHIRException("Unknown CarePlanStatus code '"+codeString+"'"); - } - public String toCode(CarePlanStatus code) { - if (code == CarePlanStatus.PROPOSED) - return "proposed"; - if (code == CarePlanStatus.DRAFT) - return "draft"; - if (code == CarePlanStatus.ACTIVE) - return "active"; - if (code == CarePlanStatus.COMPLETED) - return "completed"; - if (code == CarePlanStatus.CANCELLED) - return "cancelled"; - return "?"; - } - public String toSystem(CarePlanStatus code) { - return code.getSystem(); - } - } - - public enum CarePlanRelationship { - /** - * The referenced plan is considered to be part of this plan. - */ - INCLUDES, - /** - * This plan takes the places of the referenced plan. - */ - REPLACES, - /** - * This plan provides details about how to perform activities defined at a higher level by the referenced plan. - */ - FULFILLS, - /** - * added to help the parsers - */ - NULL; - public static CarePlanRelationship fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("includes".equals(codeString)) - return INCLUDES; - if ("replaces".equals(codeString)) - return REPLACES; - if ("fulfills".equals(codeString)) - return FULFILLS; - throw new FHIRException("Unknown CarePlanRelationship code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INCLUDES: return "includes"; - case REPLACES: return "replaces"; - case FULFILLS: return "fulfills"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INCLUDES: return "http://hl7.org/fhir/care-plan-relationship"; - case REPLACES: return "http://hl7.org/fhir/care-plan-relationship"; - case FULFILLS: return "http://hl7.org/fhir/care-plan-relationship"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INCLUDES: return "The referenced plan is considered to be part of this plan."; - case REPLACES: return "This plan takes the places of the referenced plan."; - case FULFILLS: return "This plan provides details about how to perform activities defined at a higher level by the referenced plan."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INCLUDES: return "Includes"; - case REPLACES: return "Replaces"; - case FULFILLS: return "Fulfills"; - default: return "?"; - } - } - } - - public static class CarePlanRelationshipEnumFactory implements EnumFactory { - public CarePlanRelationship fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("includes".equals(codeString)) - return CarePlanRelationship.INCLUDES; - if ("replaces".equals(codeString)) - return CarePlanRelationship.REPLACES; - if ("fulfills".equals(codeString)) - return CarePlanRelationship.FULFILLS; - throw new IllegalArgumentException("Unknown CarePlanRelationship code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("includes".equals(codeString)) - return new Enumeration(this, CarePlanRelationship.INCLUDES); - if ("replaces".equals(codeString)) - return new Enumeration(this, CarePlanRelationship.REPLACES); - if ("fulfills".equals(codeString)) - return new Enumeration(this, CarePlanRelationship.FULFILLS); - throw new FHIRException("Unknown CarePlanRelationship code '"+codeString+"'"); - } - public String toCode(CarePlanRelationship code) { - if (code == CarePlanRelationship.INCLUDES) - return "includes"; - if (code == CarePlanRelationship.REPLACES) - return "replaces"; - if (code == CarePlanRelationship.FULFILLS) - return "fulfills"; - return "?"; - } - public String toSystem(CarePlanRelationship code) { - return code.getSystem(); - } - } - - public enum CarePlanActivityStatus { - /** - * Activity is planned but no action has yet been taken. - */ - NOTSTARTED, - /** - * Appointment or other booking has occurred but activity has not yet begun. - */ - SCHEDULED, - /** - * Activity has been started but is not yet complete. - */ - INPROGRESS, - /** - * Activity was started but has temporarily ceased with an expectation of resumption at a future time. - */ - ONHOLD, - /** - * The activities have been completed (more or less) as planned. - */ - COMPLETED, - /** - * The activities have been ended prior to completion (perhaps even before they were started). - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static CarePlanActivityStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-started".equals(codeString)) - return NOTSTARTED; - if ("scheduled".equals(codeString)) - return SCHEDULED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new FHIRException("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTSTARTED: return "not-started"; - case SCHEDULED: return "scheduled"; - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTSTARTED: return "http://hl7.org/fhir/care-plan-activity-status"; - case SCHEDULED: return "http://hl7.org/fhir/care-plan-activity-status"; - case INPROGRESS: return "http://hl7.org/fhir/care-plan-activity-status"; - case ONHOLD: return "http://hl7.org/fhir/care-plan-activity-status"; - case COMPLETED: return "http://hl7.org/fhir/care-plan-activity-status"; - case CANCELLED: return "http://hl7.org/fhir/care-plan-activity-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTSTARTED: return "Activity is planned but no action has yet been taken."; - case SCHEDULED: return "Appointment or other booking has occurred but activity has not yet begun."; - case INPROGRESS: return "Activity has been started but is not yet complete."; - case ONHOLD: return "Activity was started but has temporarily ceased with an expectation of resumption at a future time."; - case COMPLETED: return "The activities have been completed (more or less) as planned."; - case CANCELLED: return "The activities have been ended prior to completion (perhaps even before they were started)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTSTARTED: return "Not Started"; - case SCHEDULED: return "Scheduled"; - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class CarePlanActivityStatusEnumFactory implements EnumFactory { - public CarePlanActivityStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-started".equals(codeString)) - return CarePlanActivityStatus.NOTSTARTED; - if ("scheduled".equals(codeString)) - return CarePlanActivityStatus.SCHEDULED; - if ("in-progress".equals(codeString)) - return CarePlanActivityStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return CarePlanActivityStatus.ONHOLD; - if ("completed".equals(codeString)) - return CarePlanActivityStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return CarePlanActivityStatus.CANCELLED; - throw new IllegalArgumentException("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("not-started".equals(codeString)) - return new Enumeration(this, CarePlanActivityStatus.NOTSTARTED); - if ("scheduled".equals(codeString)) - return new Enumeration(this, CarePlanActivityStatus.SCHEDULED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, CarePlanActivityStatus.INPROGRESS); - if ("on-hold".equals(codeString)) - return new Enumeration(this, CarePlanActivityStatus.ONHOLD); - if ("completed".equals(codeString)) - return new Enumeration(this, CarePlanActivityStatus.COMPLETED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, CarePlanActivityStatus.CANCELLED); - throw new FHIRException("Unknown CarePlanActivityStatus code '"+codeString+"'"); - } - public String toCode(CarePlanActivityStatus code) { - if (code == CarePlanActivityStatus.NOTSTARTED) - return "not-started"; - if (code == CarePlanActivityStatus.SCHEDULED) - return "scheduled"; - if (code == CarePlanActivityStatus.INPROGRESS) - return "in-progress"; - if (code == CarePlanActivityStatus.ONHOLD) - return "on-hold"; - if (code == CarePlanActivityStatus.COMPLETED) - return "completed"; - if (code == CarePlanActivityStatus.CANCELLED) - return "cancelled"; - return "?"; - } - public String toSystem(CarePlanActivityStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class CarePlanRelatedPlanComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the type of relationship this plan has to the target plan. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="includes | replaces | fulfills", formalDefinition="Identifies the type of relationship this plan has to the target plan." ) - protected Enumeration code; - - /** - * A reference to the plan to which a relationship is asserted. - */ - @Child(name = "plan", type = {CarePlan.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Plan relationship exists with", formalDefinition="A reference to the plan to which a relationship is asserted." ) - protected Reference plan; - - /** - * The actual object that is the target of the reference (A reference to the plan to which a relationship is asserted.) - */ - protected CarePlan planTarget; - - private static final long serialVersionUID = 1875598050L; - - /** - * Constructor - */ - public CarePlanRelatedPlanComponent() { - super(); - } - - /** - * Constructor - */ - public CarePlanRelatedPlanComponent(Reference plan) { - super(); - this.plan = plan; - } - - /** - * @return {@link #code} (Identifies the type of relationship this plan has to the target plan.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanRelatedPlanComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new CarePlanRelationshipEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identifies the type of relationship this plan has to the target plan.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CarePlanRelatedPlanComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Identifies the type of relationship this plan has to the target plan. - */ - public CarePlanRelationship getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identifies the type of relationship this plan has to the target plan. - */ - public CarePlanRelatedPlanComponent setCode(CarePlanRelationship value) { - if (value == null) - this.code = null; - else { - if (this.code == null) - this.code = new Enumeration(new CarePlanRelationshipEnumFactory()); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (A reference to the plan to which a relationship is asserted.) - */ - public Reference getPlan() { - if (this.plan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanRelatedPlanComponent.plan"); - else if (Configuration.doAutoCreate()) - this.plan = new Reference(); // cc - return this.plan; - } - - public boolean hasPlan() { - return this.plan != null && !this.plan.isEmpty(); - } - - /** - * @param value {@link #plan} (A reference to the plan to which a relationship is asserted.) - */ - public CarePlanRelatedPlanComponent setPlan(Reference value) { - this.plan = value; - return this; - } - - /** - * @return {@link #plan} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the plan to which a relationship is asserted.) - */ - public CarePlan getPlanTarget() { - if (this.planTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanRelatedPlanComponent.plan"); - else if (Configuration.doAutoCreate()) - this.planTarget = new CarePlan(); // aa - return this.planTarget; - } - - /** - * @param value {@link #plan} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the plan to which a relationship is asserted.) - */ - public CarePlanRelatedPlanComponent setPlanTarget(CarePlan value) { - this.planTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Identifies the type of relationship this plan has to the target plan.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("plan", "Reference(CarePlan)", "A reference to the plan to which a relationship is asserted.", 0, java.lang.Integer.MAX_VALUE, plan)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case 3443497: /*plan*/ return this.plan == null ? new Base[0] : new Base[] {this.plan}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = new CarePlanRelationshipEnumFactory().fromType(value); // Enumeration - break; - case 3443497: // plan - this.plan = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = new CarePlanRelationshipEnumFactory().fromType(value); // Enumeration - else if (name.equals("plan")) - this.plan = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case 3443497: return getPlan(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.code"); - } - else if (name.equals("plan")) { - this.plan = new Reference(); - return this.plan; - } - else - return super.addChild(name); - } - - public CarePlanRelatedPlanComponent copy() { - CarePlanRelatedPlanComponent dst = new CarePlanRelatedPlanComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.plan = plan == null ? null : plan.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanRelatedPlanComponent)) - return false; - CarePlanRelatedPlanComponent o = (CarePlanRelatedPlanComponent) other; - return compareDeep(code, o.code, true) && compareDeep(plan, o.plan, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanRelatedPlanComponent)) - return false; - CarePlanRelatedPlanComponent o = (CarePlanRelatedPlanComponent) other; - return compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (plan == null || plan.isEmpty()) - ; - } - - public String fhirType() { - return "CarePlan.relatedPlan"; - - } - - } - - @Block() - public static class CarePlanParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates specific responsibility of an individual within the care plan; e.g. "Primary physician", "Team coordinator", "Caregiver", etc. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care plan; e.g. \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc." ) - protected CodeableConcept role; - - /** - * The specific person or organization who is participating/expected to participate in the care plan. - */ - @Child(name = "member", type = {Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care plan." ) - protected Reference member; - - /** - * The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care plan.) - */ - protected Resource memberTarget; - - private static final long serialVersionUID = -466811117L; - - /** - * Constructor - */ - public CarePlanParticipantComponent() { - super(); - } - - /** - * @return {@link #role} (Indicates specific responsibility of an individual within the care plan; e.g. "Primary physician", "Team coordinator", "Caregiver", etc.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanParticipantComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Indicates specific responsibility of an individual within the care plan; e.g. "Primary physician", "Team coordinator", "Caregiver", etc.) - */ - public CarePlanParticipantComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - /** - * @return {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public Reference getMember() { - if (this.member == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanParticipantComponent.member"); - else if (Configuration.doAutoCreate()) - this.member = new Reference(); // cc - return this.member; - } - - public boolean hasMember() { - return this.member != null && !this.member.isEmpty(); - } - - /** - * @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public CarePlanParticipantComponent setMember(Reference value) { - this.member = value; - return this; - } - - /** - * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public Resource getMemberTarget() { - return this.memberTarget; - } - - /** - * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care plan.) - */ - public CarePlanParticipantComponent setMemberTarget(Resource value) { - this.memberTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care plan; e.g. \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("member", "Reference(Practitioner|RelatedPerson|Patient|Organization)", "The specific person or organization who is participating/expected to participate in the care plan.", 0, java.lang.Integer.MAX_VALUE, member)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept - case -1077769574: /*member*/ return this.member == null ? new Base[0] : new Base[] {this.member}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3506294: // role - this.role = castToCodeableConcept(value); // CodeableConcept - break; - case -1077769574: // member - this.member = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("role")) - this.role = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("member")) - this.member = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3506294: return getRole(); // CodeableConcept - case -1077769574: return getMember(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("role")) { - this.role = new CodeableConcept(); - return this.role; - } - else if (name.equals("member")) { - this.member = new Reference(); - return this.member; - } - else - return super.addChild(name); - } - - public CarePlanParticipantComponent copy() { - CarePlanParticipantComponent dst = new CarePlanParticipantComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.member = member == null ? null : member.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanParticipantComponent)) - return false; - CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; - return compareDeep(role, o.role, true) && compareDeep(member, o.member, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanParticipantComponent)) - return false; - CarePlanParticipantComponent o = (CarePlanParticipantComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) - ; - } - - public String fhirType() { - return "CarePlan.participant"; - - } - - } - - @Block() - public static class CarePlanActivityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc. - */ - @Child(name = "actionResulting", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Appointments, orders, etc.", formalDefinition="Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc." ) - protected List actionResulting; - /** - * The actual objects that are the target of the reference (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - protected List actionResultingTarget; - - - /** - * Notes about the adherence/status/progress of the activity. - */ - @Child(name = "progress", type = {Annotation.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Comments about the activity status/progress", formalDefinition="Notes about the adherence/status/progress of the activity." ) - protected List progress; - - /** - * The details of the proposed activity represented in a specific resource. - */ - @Child(name = "reference", type = {Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationOrder.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, SupplyRequest.class, VisionPrescription.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Activity details defined in specific resource", formalDefinition="The details of the proposed activity represented in a specific resource." ) - protected Reference reference; - - /** - * The actual object that is the target of the reference (The details of the proposed activity represented in a specific resource.) - */ - protected Resource referenceTarget; - - /** - * A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc. - */ - @Child(name = "detail", type = {}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="In-line definition of activity", formalDefinition="A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc." ) - protected CarePlanActivityDetailComponent detail; - - private static final long serialVersionUID = 40181608L; - - /** - * Constructor - */ - public CarePlanActivityComponent() { - super(); - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResulting() { - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - return this.actionResulting; - } - - public boolean hasActionResulting() { - if (this.actionResulting == null) - return false; - for (Reference item : this.actionResulting) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionResulting} (Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - // syntactic sugar - public Reference addActionResulting() { //3 - Reference t = new Reference(); - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - this.actionResulting.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityComponent addActionResulting(Reference t) { //3 - if (t == null) - return this; - if (this.actionResulting == null) - this.actionResulting = new ArrayList(); - this.actionResulting.add(t); - return this; - } - - /** - * @return {@link #actionResulting} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.) - */ - public List getActionResultingTarget() { - if (this.actionResultingTarget == null) - this.actionResultingTarget = new ArrayList(); - return this.actionResultingTarget; - } - - /** - * @return {@link #progress} (Notes about the adherence/status/progress of the activity.) - */ - public List getProgress() { - if (this.progress == null) - this.progress = new ArrayList(); - return this.progress; - } - - public boolean hasProgress() { - if (this.progress == null) - return false; - for (Annotation item : this.progress) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #progress} (Notes about the adherence/status/progress of the activity.) - */ - // syntactic sugar - public Annotation addProgress() { //3 - Annotation t = new Annotation(); - if (this.progress == null) - this.progress = new ArrayList(); - this.progress.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityComponent addProgress(Annotation t) { //3 - if (t == null) - return this; - if (this.progress == null) - this.progress = new ArrayList(); - this.progress.add(t); - return this; - } - - /** - * @return {@link #reference} (The details of the proposed activity represented in a specific resource.) - */ - public Reference getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Reference(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (The details of the proposed activity represented in a specific resource.) - */ - public CarePlanActivityComponent setReference(Reference value) { - this.reference = value; - return this; - } - - /** - * @return {@link #reference} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) - */ - public Resource getReferenceTarget() { - return this.referenceTarget; - } - - /** - * @param value {@link #reference} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the proposed activity represented in a specific resource.) - */ - public CarePlanActivityComponent setReferenceTarget(Resource value) { - this.referenceTarget = value; - return this; - } - - /** - * @return {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CarePlanActivityDetailComponent getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new CarePlanActivityDetailComponent(); // cc - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.) - */ - public CarePlanActivityComponent setDetail(CarePlanActivityDetailComponent value) { - this.detail = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actionResulting", "Reference(Any)", "Resources that describe follow-on actions resulting from the plan, such as drug prescriptions, encounter records, appointments, etc.", 0, java.lang.Integer.MAX_VALUE, actionResulting)); - childrenList.add(new Property("progress", "Annotation", "Notes about the adherence/status/progress of the activity.", 0, java.lang.Integer.MAX_VALUE, progress)); - childrenList.add(new Property("reference", "Reference(Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationOrder|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|SupplyRequest|VisionPrescription)", "The details of the proposed activity represented in a specific resource.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("detail", "", "A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 836386063: /*actionResulting*/ return this.actionResulting == null ? new Base[0] : this.actionResulting.toArray(new Base[this.actionResulting.size()]); // Reference - case -1001078227: /*progress*/ return this.progress == null ? new Base[0] : this.progress.toArray(new Base[this.progress.size()]); // Annotation - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // CarePlanActivityDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 836386063: // actionResulting - this.getActionResulting().add(castToReference(value)); // Reference - break; - case -1001078227: // progress - this.getProgress().add(castToAnnotation(value)); // Annotation - break; - case -925155509: // reference - this.reference = castToReference(value); // Reference - break; - case -1335224239: // detail - this.detail = (CarePlanActivityDetailComponent) value; // CarePlanActivityDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actionResulting")) - this.getActionResulting().add(castToReference(value)); - else if (name.equals("progress")) - this.getProgress().add(castToAnnotation(value)); - else if (name.equals("reference")) - this.reference = castToReference(value); // Reference - else if (name.equals("detail")) - this.detail = (CarePlanActivityDetailComponent) value; // CarePlanActivityDetailComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 836386063: return addActionResulting(); // Reference - case -1001078227: return addProgress(); // Annotation - case -925155509: return getReference(); // Reference - case -1335224239: return getDetail(); // CarePlanActivityDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actionResulting")) { - return addActionResulting(); - } - else if (name.equals("progress")) { - return addProgress(); - } - else if (name.equals("reference")) { - this.reference = new Reference(); - return this.reference; - } - else if (name.equals("detail")) { - this.detail = new CarePlanActivityDetailComponent(); - return this.detail; - } - else - return super.addChild(name); - } - - public CarePlanActivityComponent copy() { - CarePlanActivityComponent dst = new CarePlanActivityComponent(); - copyValues(dst); - if (actionResulting != null) { - dst.actionResulting = new ArrayList(); - for (Reference i : actionResulting) - dst.actionResulting.add(i.copy()); - }; - if (progress != null) { - dst.progress = new ArrayList(); - for (Annotation i : progress) - dst.progress.add(i.copy()); - }; - dst.reference = reference == null ? null : reference.copy(); - dst.detail = detail == null ? null : detail.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanActivityComponent)) - return false; - CarePlanActivityComponent o = (CarePlanActivityComponent) other; - return compareDeep(actionResulting, o.actionResulting, true) && compareDeep(progress, o.progress, true) - && compareDeep(reference, o.reference, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanActivityComponent)) - return false; - CarePlanActivityComponent o = (CarePlanActivityComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (actionResulting == null || actionResulting.isEmpty()) && (progress == null || progress.isEmpty()) - && (reference == null || reference.isEmpty()) && (detail == null || detail.isEmpty()); - } - - public String fhirType() { - return "CarePlan.activity"; - - } - - } - - @Block() - public static class CarePlanActivityDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * High-level categorization of the type of activity in a care plan. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." ) - protected CodeableConcept category; - - /** - * Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Detail type of activity", formalDefinition="Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter." ) - protected CodeableConcept code; - - /** - * Provides the rationale that drove the inclusion of this particular activity as part of the plan. - */ - @Child(name = "reasonCode", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Why activity should be done", formalDefinition="Provides the rationale that drove the inclusion of this particular activity as part of the plan." ) - protected List reasonCode; - - /** - * Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan. - */ - @Child(name = "reasonReference", type = {Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Condition triggering need for activity", formalDefinition="Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan." ) - protected List reasonReference; - /** - * The actual objects that are the target of the reference (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) - */ - protected List reasonReferenceTarget; - - - /** - * Internal reference that identifies the goals that this activity is intended to contribute towards meeting. - */ - @Child(name = "goal", type = {Goal.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Goals this activity relates to", formalDefinition="Internal reference that identifies the goals that this activity is intended to contribute towards meeting." ) - protected List goal; - /** - * The actual objects that are the target of the reference (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - protected List goalTarget; - - - /** - * Identifies what progress is being made for the specific activity. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=false) - @Description(shortDefinition="not-started | scheduled | in-progress | on-hold | completed | cancelled", formalDefinition="Identifies what progress is being made for the specific activity." ) - protected Enumeration status; - - /** - * Provides reason why the activity isn't yet started, is on hold, was cancelled, etc. - */ - @Child(name = "statusReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reason for current status", formalDefinition="Provides reason why the activity isn't yet started, is on hold, was cancelled, etc." ) - protected CodeableConcept statusReason; - - /** - * If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - @Child(name = "prohibited", type = {BooleanType.class}, order=8, min=1, max=1, modifier=true, summary=false) - @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." ) - protected BooleanType prohibited; - - /** - * The period, timing or frequency upon which the described activity is to occur. - */ - @Child(name = "scheduled", type = {Timing.class, Period.class, StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) - protected Type scheduled; - - /** - * Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc. - */ - @Child(name = "location", type = {Location.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - protected Location locationTarget; - - /** - * Identifies who's expected to be involved in the activity. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Who will be responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) - */ - protected List performerTarget; - - - /** - * Identifies the food, drug or other product to be consumed or supplied in the activity. - */ - @Child(name = "product", type = {CodeableConcept.class, Medication.class, Substance.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="What is to be administered/supplied", formalDefinition="Identifies the food, drug or other product to be consumed or supplied in the activity." ) - protected Type product; - - /** - * Identifies the quantity expected to be consumed in a given day. - */ - @Child(name = "dailyAmount", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How to consume/day?", formalDefinition="Identifies the quantity expected to be consumed in a given day." ) - protected SimpleQuantity dailyAmount; - - /** - * Identifies the quantity expected to be supplied, administered or consumed by the subject. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How much to administer/supply/consume", formalDefinition="Identifies the quantity expected to be supplied, administered or consumed by the subject." ) - protected SimpleQuantity quantity; - - /** - * This provides a textual description of constraints on the intended 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. - */ - @Child(name = "description", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Extra info describing activity to perform", formalDefinition="This provides a textual description of constraints on the intended 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." ) - protected StringType description; - - private static final long serialVersionUID = -1763965702L; - - /** - * Constructor - */ - public CarePlanActivityDetailComponent() { - super(); - } - - /** - * Constructor - */ - public CarePlanActivityDetailComponent(BooleanType prohibited) { - super(); - this.prohibited = prohibited; - } - - /** - * @return {@link #category} (High-level categorization of the type of activity in a care plan.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (High-level categorization of the type of activity in a care plan.) - */ - public CarePlanActivityDetailComponent setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #code} (Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.) - */ - public CarePlanActivityDetailComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #reasonCode} (Provides the rationale that drove the inclusion of this particular activity as part of the plan.) - */ - public List getReasonCode() { - if (this.reasonCode == null) - this.reasonCode = new ArrayList(); - return this.reasonCode; - } - - public boolean hasReasonCode() { - if (this.reasonCode == null) - return false; - for (CodeableConcept item : this.reasonCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonCode} (Provides the rationale that drove the inclusion of this particular activity as part of the plan.) - */ - // syntactic sugar - public CodeableConcept addReasonCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonCode == null) - this.reasonCode = new ArrayList(); - this.reasonCode.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityDetailComponent addReasonCode(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonCode == null) - this.reasonCode = new ArrayList(); - this.reasonCode.add(t); - return this; - } - - /** - * @return {@link #reasonReference} (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) - */ - public List getReasonReference() { - if (this.reasonReference == null) - this.reasonReference = new ArrayList(); - return this.reasonReference; - } - - public boolean hasReasonReference() { - if (this.reasonReference == null) - return false; - for (Reference item : this.reasonReference) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonReference} (Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) - */ - // syntactic sugar - public Reference addReasonReference() { //3 - Reference t = new Reference(); - if (this.reasonReference == null) - this.reasonReference = new ArrayList(); - this.reasonReference.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityDetailComponent addReasonReference(Reference t) { //3 - if (t == null) - return this; - if (this.reasonReference == null) - this.reasonReference = new ArrayList(); - this.reasonReference.add(t); - return this; - } - - /** - * @return {@link #reasonReference} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) - */ - public List getReasonReferenceTarget() { - if (this.reasonReferenceTarget == null) - this.reasonReferenceTarget = new ArrayList(); - return this.reasonReferenceTarget; - } - - // syntactic sugar - /** - * @return {@link #reasonReference} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.) - */ - public Condition addReasonReferenceTarget() { - Condition r = new Condition(); - if (this.reasonReferenceTarget == null) - this.reasonReferenceTarget = new ArrayList(); - this.reasonReferenceTarget.add(r); - return r; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - return this.goal; - } - - public boolean hasGoal() { - if (this.goal == null) - return false; - for (Reference item : this.goal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #goal} (Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - // syntactic sugar - public Reference addGoal() { //3 - Reference t = new Reference(); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityDetailComponent addGoal(Reference t) { //3 - if (t == null) - return this; - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return this; - } - - /** - * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public List getGoalTarget() { - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - return this.goalTarget; - } - - // syntactic sugar - /** - * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Internal reference that identifies the goals that this activity is intended to contribute towards meeting.) - */ - public Goal addGoalTarget() { - Goal r = new Goal(); - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - this.goalTarget.add(r); - return r; - } - - /** - * @return {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Identifies what progress is being made for the specific activity.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CarePlanActivityDetailComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Identifies what progress is being made for the specific activity. - */ - public CarePlanActivityStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Identifies what progress is being made for the specific activity. - */ - public CarePlanActivityDetailComponent setStatus(CarePlanActivityStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new CarePlanActivityStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) - */ - public CodeableConcept getStatusReason() { - if (this.statusReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.statusReason"); - else if (Configuration.doAutoCreate()) - this.statusReason = new CodeableConcept(); // cc - return this.statusReason; - } - - public boolean hasStatusReason() { - return this.statusReason != null && !this.statusReason.isEmpty(); - } - - /** - * @param value {@link #statusReason} (Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.) - */ - public CarePlanActivityDetailComponent setStatusReason(CodeableConcept value) { - this.statusReason = value; - return this; - } - - /** - * @return {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public BooleanType getProhibitedElement() { - if (this.prohibited == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.prohibited"); - else if (Configuration.doAutoCreate()) - this.prohibited = new BooleanType(); // bb - return this.prohibited; - } - - public boolean hasProhibitedElement() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - public boolean hasProhibited() { - return this.prohibited != null && !this.prohibited.isEmpty(); - } - - /** - * @param value {@link #prohibited} (If true, indicates that the described activity is one that must NOT be engaged in when following the plan.). This is the underlying object with id, value and extensions. The accessor "getProhibited" gives direct access to the value - */ - public CarePlanActivityDetailComponent setProhibitedElement(BooleanType value) { - this.prohibited = value; - return this; - } - - /** - * @return If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public boolean getProhibited() { - return this.prohibited == null || this.prohibited.isEmpty() ? false : this.prohibited.getValue(); - } - - /** - * @param value If true, indicates that the described activity is one that must NOT be engaged in when following the plan. - */ - public CarePlanActivityDetailComponent setProhibited(boolean value) { - if (this.prohibited == null) - this.prohibited = new BooleanType(); - this.prohibited.setValue(value); - return this; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Timing getScheduledTiming() throws FHIRException { - if (!(this.scheduled instanceof Timing)) - throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - public boolean hasScheduledTiming() { - return this.scheduled instanceof Timing; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Period getScheduledPeriod() throws FHIRException { - if (!(this.scheduled instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - public boolean hasScheduledPeriod() { - return this.scheduled instanceof Period; - } - - /** - * @return {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public StringType getScheduledStringType() throws FHIRException { - if (!(this.scheduled instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (StringType) this.scheduled; - } - - public boolean hasScheduledStringType() { - return this.scheduled instanceof StringType; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The period, timing or frequency upon which the described activity is to occur.) - */ - public CarePlanActivityDetailComponent setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public CarePlanActivityDetailComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public CarePlanActivityDetailComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public CarePlanActivityDetailComponent addPerformer(Reference t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who's expected to be involved in the activity.) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public Type getProduct() { - return this.product; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public CodeableConcept getProductCodeableConcept() throws FHIRException { - if (!(this.product instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.product.getClass().getName()+" was encountered"); - return (CodeableConcept) this.product; - } - - public boolean hasProductCodeableConcept() { - return this.product instanceof CodeableConcept; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public Reference getProductReference() throws FHIRException { - if (!(this.product instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.product.getClass().getName()+" was encountered"); - return (Reference) this.product; - } - - public boolean hasProductReference() { - return this.product instanceof Reference; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the food, drug or other product to be consumed or supplied in the activity.) - */ - public CarePlanActivityDetailComponent setProduct(Type value) { - this.product = value; - return this; - } - - /** - * @return {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public SimpleQuantity getDailyAmount() { - if (this.dailyAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.dailyAmount"); - else if (Configuration.doAutoCreate()) - this.dailyAmount = new SimpleQuantity(); // cc - return this.dailyAmount; - } - - public boolean hasDailyAmount() { - return this.dailyAmount != null && !this.dailyAmount.isEmpty(); - } - - /** - * @param value {@link #dailyAmount} (Identifies the quantity expected to be consumed in a given day.) - */ - public CarePlanActivityDetailComponent setDailyAmount(SimpleQuantity value) { - this.dailyAmount = value; - return this; - } - - /** - * @return {@link #quantity} (Identifies the quantity expected to be supplied, administered or consumed by the subject.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Identifies the quantity expected to be supplied, administered or consumed by the subject.) - */ - public CarePlanActivityDetailComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #description} (This provides a textual description of constraints on the intended 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.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (This provides a textual description of constraints on the intended 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.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public CarePlanActivityDetailComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return This provides a textual description of constraints on the intended 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 String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value This provides a textual description of constraints on the intended 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 CarePlanActivityDetailComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "CodeableConcept", "High-level categorization of the type of activity in a care plan.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("reasonCode", "CodeableConcept", "Provides the rationale that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reasonCode)); - childrenList.add(new Property("reasonReference", "Reference(Condition)", "Provides the health condition(s) that drove the inclusion of this particular activity as part of the plan.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); - childrenList.add(new Property("goal", "Reference(Goal)", "Internal reference that identifies the goals that this activity is intended to contribute towards meeting.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("status", "code", "Identifies what progress is being made for the specific activity.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusReason", "CodeableConcept", "Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusReason)); - childrenList.add(new Property("prohibited", "boolean", "If true, indicates that the described activity is one that must NOT be engaged in when following the plan.", 0, java.lang.Integer.MAX_VALUE, prohibited)); - childrenList.add(new Property("scheduled[x]", "Timing|Period|string", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("product[x]", "CodeableConcept|Reference(Medication|Substance)", "Identifies the food, drug or other product to be consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("dailyAmount", "SimpleQuantity", "Identifies the quantity expected to be consumed in a given day.", 0, java.lang.Integer.MAX_VALUE, dailyAmount)); - childrenList.add(new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be supplied, administered or consumed by the subject.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("description", "string", "This provides a textual description of constraints on the intended 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.", 0, java.lang.Integer.MAX_VALUE, description)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept - case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference - case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept - case 663275198: /*prohibited*/ return this.prohibited == null ? new Base[0] : new Base[] {this.prohibited}; // BooleanType - case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference - case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Type - case -768908335: /*dailyAmount*/ return this.dailyAmount == null ? new Base[0] : new Base[] {this.dailyAmount}; // SimpleQuantity - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 722137681: // reasonCode - this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1146218137: // reasonReference - this.getReasonReference().add(castToReference(value)); // Reference - break; - case 3178259: // goal - this.getGoal().add(castToReference(value)); // Reference - break; - case -892481550: // status - this.status = new CarePlanActivityStatusEnumFactory().fromType(value); // Enumeration - break; - case 2051346646: // statusReason - this.statusReason = castToCodeableConcept(value); // CodeableConcept - break; - case 663275198: // prohibited - this.prohibited = castToBoolean(value); // BooleanType - break; - case -160710483: // scheduled - this.scheduled = (Type) value; // Type - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case 481140686: // performer - this.getPerformer().add(castToReference(value)); // Reference - break; - case -309474065: // product - this.product = (Type) value; // Type - break; - case -768908335: // dailyAmount - this.dailyAmount = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("reasonCode")) - this.getReasonCode().add(castToCodeableConcept(value)); - else if (name.equals("reasonReference")) - this.getReasonReference().add(castToReference(value)); - else if (name.equals("goal")) - this.getGoal().add(castToReference(value)); - else if (name.equals("status")) - this.status = new CarePlanActivityStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("statusReason")) - this.statusReason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("prohibited")) - this.prohibited = castToBoolean(value); // BooleanType - else if (name.equals("scheduled[x]")) - this.scheduled = (Type) value; // Type - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("performer")) - this.getPerformer().add(castToReference(value)); - else if (name.equals("product[x]")) - this.product = (Type) value; // Type - else if (name.equals("dailyAmount")) - this.dailyAmount = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("description")) - this.description = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // CodeableConcept - case 3059181: return getCode(); // CodeableConcept - case 722137681: return addReasonCode(); // CodeableConcept - case -1146218137: return addReasonReference(); // Reference - case 3178259: return addGoal(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 2051346646: return getStatusReason(); // CodeableConcept - case 663275198: throw new FHIRException("Cannot make property prohibited as it is not a complex type"); // BooleanType - case 1162627251: return getScheduled(); // Type - case 1901043637: return getLocation(); // Reference - case 481140686: return addPerformer(); // Reference - case 1753005361: return getProduct(); // Type - case -768908335: return getDailyAmount(); // SimpleQuantity - case -1285004149: return getQuantity(); // SimpleQuantity - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("reasonCode")) { - return addReasonCode(); - } - else if (name.equals("reasonReference")) { - return addReasonReference(); - } - else if (name.equals("goal")) { - return addGoal(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.status"); - } - else if (name.equals("statusReason")) { - this.statusReason = new CodeableConcept(); - return this.statusReason; - } - else if (name.equals("prohibited")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.prohibited"); - } - else if (name.equals("scheduledTiming")) { - this.scheduled = new Timing(); - return this.scheduled; - } - else if (name.equals("scheduledPeriod")) { - this.scheduled = new Period(); - return this.scheduled; - } - else if (name.equals("scheduledString")) { - this.scheduled = new StringType(); - return this.scheduled; - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("performer")) { - return addPerformer(); - } - else if (name.equals("productCodeableConcept")) { - this.product = new CodeableConcept(); - return this.product; - } - else if (name.equals("productReference")) { - this.product = new Reference(); - return this.product; - } - else if (name.equals("dailyAmount")) { - this.dailyAmount = new SimpleQuantity(); - return this.dailyAmount; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.description"); - } - else - return super.addChild(name); - } - - public CarePlanActivityDetailComponent copy() { - CarePlanActivityDetailComponent dst = new CarePlanActivityDetailComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - if (reasonCode != null) { - dst.reasonCode = new ArrayList(); - for (CodeableConcept i : reasonCode) - dst.reasonCode.add(i.copy()); - }; - if (reasonReference != null) { - dst.reasonReference = new ArrayList(); - for (Reference i : reasonReference) - dst.reasonReference.add(i.copy()); - }; - if (goal != null) { - dst.goal = new ArrayList(); - for (Reference i : goal) - dst.goal.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.statusReason = statusReason == null ? null : statusReason.copy(); - dst.prohibited = prohibited == null ? null : prohibited.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.location = location == null ? null : location.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.product = product == null ? null : product.copy(); - dst.dailyAmount = dailyAmount == null ? null : dailyAmount.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.description = description == null ? null : description.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlanActivityDetailComponent)) - return false; - CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; - return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(reasonCode, o.reasonCode, true) - && compareDeep(reasonReference, o.reasonReference, true) && compareDeep(goal, o.goal, true) && compareDeep(status, o.status, true) - && compareDeep(statusReason, o.statusReason, true) && compareDeep(prohibited, o.prohibited, true) - && compareDeep(scheduled, o.scheduled, true) && compareDeep(location, o.location, true) && compareDeep(performer, o.performer, true) - && compareDeep(product, o.product, true) && compareDeep(dailyAmount, o.dailyAmount, true) && compareDeep(quantity, o.quantity, true) - && compareDeep(description, o.description, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlanActivityDetailComponent)) - return false; - CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other; - return compareValues(status, o.status, true) && compareValues(prohibited, o.prohibited, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) - && (reasonCode == null || reasonCode.isEmpty()) && (reasonReference == null || reasonReference.isEmpty()) - && (goal == null || goal.isEmpty()) && (status == null || status.isEmpty()) && (statusReason == null || statusReason.isEmpty()) - && (prohibited == null || prohibited.isEmpty()) && (scheduled == null || scheduled.isEmpty()) - && (location == null || location.isEmpty()) && (performer == null || performer.isEmpty()) - && (product == null || product.isEmpty()) && (dailyAmount == null || dailyAmount.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (description == null || description.isEmpty()) - ; - } - - public String fhirType() { - return "CarePlan.activity.detail"; - - } - - } - - /** - * This records identifiers associated with this care plan 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this plan", formalDefinition="This records identifiers associated with this care plan 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)." ) - protected List identifier; - - /** - * Identifies the patient or group whose intended care is described by the plan. - */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who care plan is for", formalDefinition="Identifies the patient or group whose intended care is described by the plan." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient or group whose intended care is described by the plan.) - */ - protected Resource subjectTarget; - - /** - * Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | draft | active | completed | cancelled", formalDefinition="Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record." ) - protected Enumeration status; - - /** - * Identifies the context in which this particular CarePlan is defined. - */ - @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Created in context of", formalDefinition="Identifies the context in which this particular CarePlan is defined." ) - protected Reference context; - - /** - * The actual object that is the target of the reference (Identifies the context in which this particular CarePlan is defined.) - */ - protected Resource contextTarget; - - /** - * Indicates when the plan did (or is intended to) come into effect and end. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period plan covers", formalDefinition="Indicates when the plan did (or is intended to) come into effect and end." ) - protected Period period; - - /** - * Identifies the individual(s) or ogranization who is responsible for the content of the care plan. - */ - @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who is responsible for contents of the plan", formalDefinition="Identifies the individual(s) or ogranization who is responsible for the content of the care plan." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - protected List authorTarget; - - - /** - * Identifies the most recent date on which the plan has been revised. - */ - @Child(name = "modified", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When last updated", formalDefinition="Identifies the most recent date on which the plan has been revised." ) - protected DateTimeType modified; - - /** - * Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Type of plan", formalDefinition="Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc." ) - protected List category; - - /** - * A description of the scope and nature of the plan. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Summary of nature of plan", formalDefinition="A description of the scope and nature of the plan." ) - protected StringType description; - - /** - * Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan. - */ - @Child(name = "addresses", type = {Condition.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List addresses; - /** - * The actual objects that are the target of the reference (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - protected List addressesTarget; - - - /** - * Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc. - */ - @Child(name = "support", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Information considered as part of plan", formalDefinition="Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc." ) - protected List support; - /** - * The actual objects that are the target of the reference (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - protected List supportTarget; - - - /** - * Identifies CarePlans with some sort of formal relationship to the current plan. - */ - @Child(name = "relatedPlan", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Plans related to this one", formalDefinition="Identifies CarePlans with some sort of formal relationship to the current plan." ) - protected List relatedPlan; - - /** - * Identifies all people and organizations who are expected to be involved in the care envisioned by this plan. - */ - @Child(name = "participant", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List participant; - - /** - * Describes the intended objective(s) of carrying out the care plan. - */ - @Child(name = "goal", type = {Goal.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Desired outcome of plan", formalDefinition="Describes the intended objective(s) of carrying out the care plan." ) - protected List goal; - /** - * The actual objects that are the target of the reference (Describes the intended objective(s) of carrying out the care plan.) - */ - protected List goalTarget; - - - /** - * 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. - */ - @Child(name = "activity", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List activity; - - /** - * General notes about the care plan not covered elsewhere. - */ - @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Comments about the plan", formalDefinition="General notes about the care plan not covered elsewhere." ) - protected Annotation note; - - private static final long serialVersionUID = -307500543L; - - /** - * Constructor - */ - public CarePlan() { - super(); - } - - /** - * Constructor - */ - public CarePlan(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public CarePlan addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (Identifies the patient or group whose intended care is described by the plan.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Identifies the patient or group whose intended care is described by the plan.) - */ - public CarePlan setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is described by the plan.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is described by the plan.) - */ - public CarePlan setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CarePlanStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CarePlan setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. - */ - public CarePlanStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. - */ - public CarePlan setStatus(CarePlanStatus value) { - if (this.status == null) - this.status = new Enumeration(new CarePlanStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #context} (Identifies the context in which this particular CarePlan is defined.) - */ - public Reference getContext() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.context"); - else if (Configuration.doAutoCreate()) - this.context = new Reference(); // cc - return this.context; - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (Identifies the context in which this particular CarePlan is defined.) - */ - public CarePlan setContext(Reference value) { - this.context = value; - return this; - } - - /** - * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the context in which this particular CarePlan is defined.) - */ - public Resource getContextTarget() { - return this.contextTarget; - } - - /** - * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the context in which this particular CarePlan is defined.) - */ - public CarePlan setContextTarget(Resource value) { - this.contextTarget = value; - return this; - } - - /** - * @return {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates when the plan did (or is intended to) come into effect and end.) - */ - public CarePlan setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public CarePlan addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the individual(s) or ogranization who is responsible for the content of the care plan.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value - */ - public DateTimeType getModifiedElement() { - if (this.modified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.modified"); - else if (Configuration.doAutoCreate()) - this.modified = new DateTimeType(); // bb - return this.modified; - } - - public boolean hasModifiedElement() { - return this.modified != null && !this.modified.isEmpty(); - } - - public boolean hasModified() { - return this.modified != null && !this.modified.isEmpty(); - } - - /** - * @param value {@link #modified} (Identifies the most recent date on which the plan has been revised.). This is the underlying object with id, value and extensions. The accessor "getModified" gives direct access to the value - */ - public CarePlan setModifiedElement(DateTimeType value) { - this.modified = value; - return this; - } - - /** - * @return Identifies the most recent date on which the plan has been revised. - */ - public Date getModified() { - return this.modified == null ? null : this.modified.getValue(); - } - - /** - * @param value Identifies the most recent date on which the plan has been revised. - */ - public CarePlan setModified(Date value) { - if (value == null) - this.modified = null; - else { - if (this.modified == null) - this.modified = new DateTimeType(); - this.modified.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.) - */ - public List getCategory() { - if (this.category == null) - this.category = new ArrayList(); - return this.category; - } - - public boolean hasCategory() { - if (this.category == null) - return false; - for (CodeableConcept item : this.category) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #category} (Identifies what "kind" of plan this is to support differentiation between multiple co-existing plans; e.g. "Home health", "psychiatric", "asthma", "disease management", "wellness plan", etc.) - */ - // syntactic sugar - public CodeableConcept addCategory() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return t; - } - - // syntactic sugar - public CarePlan addCategory(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return this; - } - - /** - * @return {@link #description} (A description of the scope and nature of the plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the scope and nature of the plan.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public CarePlan setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the scope and nature of the plan. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the scope and nature of the plan. - */ - public CarePlan setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #addresses} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - public List getAddresses() { - if (this.addresses == null) - this.addresses = new ArrayList(); - return this.addresses; - } - - public boolean hasAddresses() { - if (this.addresses == null) - return false; - for (Reference item : this.addresses) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #addresses} (Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - // syntactic sugar - public Reference addAddresses() { //3 - Reference t = new Reference(); - if (this.addresses == null) - this.addresses = new ArrayList(); - this.addresses.add(t); - return t; - } - - // syntactic sugar - public CarePlan addAddresses(Reference t) { //3 - if (t == null) - return this; - if (this.addresses == null) - this.addresses = new ArrayList(); - this.addresses.add(t); - return this; - } - - /** - * @return {@link #addresses} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - public List getAddressesTarget() { - if (this.addressesTarget == null) - this.addressesTarget = new ArrayList(); - return this.addressesTarget; - } - - // syntactic sugar - /** - * @return {@link #addresses} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.) - */ - public Condition addAddressesTarget() { - Condition r = new Condition(); - if (this.addressesTarget == null) - this.addressesTarget = new ArrayList(); - this.addressesTarget.add(r); - return r; - } - - /** - * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - public List getSupport() { - if (this.support == null) - this.support = new ArrayList(); - return this.support; - } - - public boolean hasSupport() { - if (this.support == null) - return false; - for (Reference item : this.support) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #support} (Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - // syntactic sugar - public Reference addSupport() { //3 - Reference t = new Reference(); - if (this.support == null) - this.support = new ArrayList(); - this.support.add(t); - return t; - } - - // syntactic sugar - public CarePlan addSupport(Reference t) { //3 - if (t == null) - return this; - if (this.support == null) - this.support = new ArrayList(); - this.support.add(t); - return this; - } - - /** - * @return {@link #support} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.) - */ - public List getSupportTarget() { - if (this.supportTarget == null) - this.supportTarget = new ArrayList(); - return this.supportTarget; - } - - /** - * @return {@link #relatedPlan} (Identifies CarePlans with some sort of formal relationship to the current plan.) - */ - public List getRelatedPlan() { - if (this.relatedPlan == null) - this.relatedPlan = new ArrayList(); - return this.relatedPlan; - } - - public boolean hasRelatedPlan() { - if (this.relatedPlan == null) - return false; - for (CarePlanRelatedPlanComponent item : this.relatedPlan) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatedPlan} (Identifies CarePlans with some sort of formal relationship to the current plan.) - */ - // syntactic sugar - public CarePlanRelatedPlanComponent addRelatedPlan() { //3 - CarePlanRelatedPlanComponent t = new CarePlanRelatedPlanComponent(); - if (this.relatedPlan == null) - this.relatedPlan = new ArrayList(); - this.relatedPlan.add(t); - return t; - } - - // syntactic sugar - public CarePlan addRelatedPlan(CarePlanRelatedPlanComponent t) { //3 - if (t == null) - return this; - if (this.relatedPlan == null) - this.relatedPlan = new ArrayList(); - this.relatedPlan.add(t); - return this; - } - - /** - * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (CarePlanParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.) - */ - // syntactic sugar - public CarePlanParticipantComponent addParticipant() { //3 - CarePlanParticipantComponent t = new CarePlanParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public CarePlan addParticipant(CarePlanParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #goal} (Describes the intended objective(s) of carrying out the care plan.) - */ - public List getGoal() { - if (this.goal == null) - this.goal = new ArrayList(); - return this.goal; - } - - public boolean hasGoal() { - if (this.goal == null) - return false; - for (Reference item : this.goal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #goal} (Describes the intended objective(s) of carrying out the care plan.) - */ - // syntactic sugar - public Reference addGoal() { //3 - Reference t = new Reference(); - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return t; - } - - // syntactic sugar - public CarePlan addGoal(Reference t) { //3 - if (t == null) - return this; - if (this.goal == null) - this.goal = new ArrayList(); - this.goal.add(t); - return this; - } - - /** - * @return {@link #goal} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the care plan.) - */ - public List getGoalTarget() { - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - return this.goalTarget; - } - - // syntactic sugar - /** - * @return {@link #goal} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Describes the intended objective(s) of carrying out the care plan.) - */ - public Goal addGoalTarget() { - Goal r = new Goal(); - if (this.goalTarget == null) - this.goalTarget = new ArrayList(); - this.goalTarget.add(r); - return r; - } - - /** - * @return {@link #activity} (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 List getActivity() { - if (this.activity == null) - this.activity = new ArrayList(); - return this.activity; - } - - public boolean hasActivity() { - if (this.activity == null) - return false; - for (CarePlanActivityComponent item : this.activity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #activity} (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.) - */ - // syntactic sugar - public CarePlanActivityComponent addActivity() { //3 - CarePlanActivityComponent t = new CarePlanActivityComponent(); - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.add(t); - return t; - } - - // syntactic sugar - public CarePlan addActivity(CarePlanActivityComponent t) { //3 - if (t == null) - return this; - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.add(t); - return this; - } - - /** - * @return {@link #note} (General notes about the care plan not covered elsewhere.) - */ - public Annotation getNote() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CarePlan.note"); - else if (Configuration.doAutoCreate()) - this.note = new Annotation(); // cc - return this.note; - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (General notes about the care plan not covered elsewhere.) - */ - public CarePlan setNote(Annotation value) { - this.note = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is described by the plan.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("status", "code", "Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "Identifies the context in which this particular CarePlan is defined.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("period", "Period", "Indicates when the plan did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "Identifies the individual(s) or ogranization who is responsible for the content of the care plan.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("modified", "dateTime", "Identifies the most recent date on which the plan has been revised.", 0, java.lang.Integer.MAX_VALUE, modified)); - childrenList.add(new Property("category", "CodeableConcept", "Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("description", "string", "A description of the scope and nature of the plan.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("addresses", "Reference(Condition)", "Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.", 0, java.lang.Integer.MAX_VALUE, addresses)); - childrenList.add(new Property("support", "Reference(Any)", "Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include co-morbidities, recent procedures, limitations, recent assessments, etc.", 0, java.lang.Integer.MAX_VALUE, support)); - childrenList.add(new Property("relatedPlan", "", "Identifies CarePlans with some sort of formal relationship to the current plan.", 0, java.lang.Integer.MAX_VALUE, relatedPlan)); - childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("goal", "Reference(Goal)", "Describes the intended objective(s) of carrying out the care plan.", 0, java.lang.Integer.MAX_VALUE, goal)); - childrenList.add(new Property("activity", "", "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.", 0, java.lang.Integer.MAX_VALUE, activity)); - childrenList.add(new Property("note", "Annotation", "General notes about the care plan not covered elsewhere.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference - case -615513399: /*modified*/ return this.modified == null ? new Base[0] : new Base[] {this.modified}; // DateTimeType - case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // Reference - case -1854767153: /*support*/ return this.support == null ? new Base[0] : this.support.toArray(new Base[this.support.size()]); // Reference - case 1112903156: /*relatedPlan*/ return this.relatedPlan == null ? new Base[0] : this.relatedPlan.toArray(new Base[this.relatedPlan.size()]); // CarePlanRelatedPlanComponent - case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // CarePlanParticipantComponent - case 3178259: /*goal*/ return this.goal == null ? new Base[0] : this.goal.toArray(new Base[this.goal.size()]); // Reference - case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : this.activity.toArray(new Base[this.activity.size()]); // CarePlanActivityComponent - case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // Annotation - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new CarePlanStatusEnumFactory().fromType(value); // Enumeration - break; - case 951530927: // context - this.context = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -1406328437: // author - this.getAuthor().add(castToReference(value)); // Reference - break; - case -615513399: // modified - this.modified = castToDateTime(value); // DateTimeType - break; - case 50511102: // category - this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 874544034: // addresses - this.getAddresses().add(castToReference(value)); // Reference - break; - case -1854767153: // support - this.getSupport().add(castToReference(value)); // Reference - break; - case 1112903156: // relatedPlan - this.getRelatedPlan().add((CarePlanRelatedPlanComponent) value); // CarePlanRelatedPlanComponent - break; - case 767422259: // participant - this.getParticipant().add((CarePlanParticipantComponent) value); // CarePlanParticipantComponent - break; - case 3178259: // goal - this.getGoal().add(castToReference(value)); // Reference - break; - case -1655966961: // activity - this.getActivity().add((CarePlanActivityComponent) value); // CarePlanActivityComponent - break; - case 3387378: // note - this.note = castToAnnotation(value); // Annotation - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new CarePlanStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("context")) - this.context = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("author")) - this.getAuthor().add(castToReference(value)); - else if (name.equals("modified")) - this.modified = castToDateTime(value); // DateTimeType - else if (name.equals("category")) - this.getCategory().add(castToCodeableConcept(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("addresses")) - this.getAddresses().add(castToReference(value)); - else if (name.equals("support")) - this.getSupport().add(castToReference(value)); - else if (name.equals("relatedPlan")) - this.getRelatedPlan().add((CarePlanRelatedPlanComponent) value); - else if (name.equals("participant")) - this.getParticipant().add((CarePlanParticipantComponent) value); - else if (name.equals("goal")) - this.getGoal().add(castToReference(value)); - else if (name.equals("activity")) - this.getActivity().add((CarePlanActivityComponent) value); - else if (name.equals("note")) - this.note = castToAnnotation(value); // Annotation - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1867885268: return getSubject(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 951530927: return getContext(); // Reference - case -991726143: return getPeriod(); // Period - case -1406328437: return addAuthor(); // Reference - case -615513399: throw new FHIRException("Cannot make property modified as it is not a complex type"); // DateTimeType - case 50511102: return addCategory(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 874544034: return addAddresses(); // Reference - case -1854767153: return addSupport(); // Reference - case 1112903156: return addRelatedPlan(); // CarePlanRelatedPlanComponent - case 767422259: return addParticipant(); // CarePlanParticipantComponent - case 3178259: return addGoal(); // Reference - case -1655966961: return addActivity(); // CarePlanActivityComponent - case 3387378: return getNote(); // Annotation - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.status"); - } - else if (name.equals("context")) { - this.context = new Reference(); - return this.context; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("author")) { - return addAuthor(); - } - else if (name.equals("modified")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.modified"); - } - else if (name.equals("category")) { - return addCategory(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type CarePlan.description"); - } - else if (name.equals("addresses")) { - return addAddresses(); - } - else if (name.equals("support")) { - return addSupport(); - } - else if (name.equals("relatedPlan")) { - return addRelatedPlan(); - } - else if (name.equals("participant")) { - return addParticipant(); - } - else if (name.equals("goal")) { - return addGoal(); - } - else if (name.equals("activity")) { - return addActivity(); - } - else if (name.equals("note")) { - this.note = new Annotation(); - return this.note; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "CarePlan"; - - } - - public CarePlan copy() { - CarePlan dst = new CarePlan(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.status = status == null ? null : status.copy(); - dst.context = context == null ? null : context.copy(); - dst.period = period == null ? null : period.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.modified = modified == null ? null : modified.copy(); - if (category != null) { - dst.category = new ArrayList(); - for (CodeableConcept i : category) - dst.category.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (addresses != null) { - dst.addresses = new ArrayList(); - for (Reference i : addresses) - dst.addresses.add(i.copy()); - }; - if (support != null) { - dst.support = new ArrayList(); - for (Reference i : support) - dst.support.add(i.copy()); - }; - if (relatedPlan != null) { - dst.relatedPlan = new ArrayList(); - for (CarePlanRelatedPlanComponent i : relatedPlan) - dst.relatedPlan.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (CarePlanParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - if (goal != null) { - dst.goal = new ArrayList(); - for (Reference i : goal) - dst.goal.add(i.copy()); - }; - if (activity != null) { - dst.activity = new ArrayList(); - for (CarePlanActivityComponent i : activity) - dst.activity.add(i.copy()); - }; - dst.note = note == null ? null : note.copy(); - return dst; - } - - protected CarePlan typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CarePlan)) - return false; - CarePlan o = (CarePlan) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(status, o.status, true) - && compareDeep(context, o.context, true) && compareDeep(period, o.period, true) && compareDeep(author, o.author, true) - && compareDeep(modified, o.modified, true) && compareDeep(category, o.category, true) && compareDeep(description, o.description, true) - && compareDeep(addresses, o.addresses, true) && compareDeep(support, o.support, true) && compareDeep(relatedPlan, o.relatedPlan, true) - && compareDeep(participant, o.participant, true) && compareDeep(goal, o.goal, true) && compareDeep(activity, o.activity, true) - && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CarePlan)) - return false; - CarePlan o = (CarePlan) other; - return compareValues(status, o.status, true) && compareValues(modified, o.modified, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (status == null || status.isEmpty()) && (context == null || context.isEmpty()) && (period == null || period.isEmpty()) - && (author == null || author.isEmpty()) && (modified == null || modified.isEmpty()) && (category == null || category.isEmpty()) - && (description == null || description.isEmpty()) && (addresses == null || addresses.isEmpty()) - && (support == null || support.isEmpty()) && (relatedPlan == null || relatedPlan.isEmpty()) - && (participant == null || participant.isEmpty()) && (goal == null || goal.isEmpty()) && (activity == null || activity.isEmpty()) - && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CarePlan; - } - - /** - * Search parameter: activitycode - *

- * Description: Detail type of activity
- * Type: token
- * Path: CarePlan.activity.detail.code
- *

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

- * Description: Detail type of activity
- * Type: token
- * Path: CarePlan.activity.detail.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVITYCODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVITYCODE); - - /** - * Search parameter: condition - *

- * Description: Health issues this plan addresses
- * Type: reference
- * Path: CarePlan.addresses
- *

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

- * Description: Health issues this plan addresses
- * Type: reference
- * Path: CarePlan.addresses
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:condition". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("CarePlan:condition").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Who care plan is for
- * Type: reference
- * Path: CarePlan.subject
- *

- */ - @SearchParamDefinition(name="subject", path="CarePlan.subject", description="Who care plan is for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who care plan is for
- * Type: reference
- * Path: CarePlan.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CarePlan:subject").toLocked(); - - /** - * Search parameter: activitydate - *

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

- */ - @SearchParamDefinition(name="activitydate", path="CarePlan.activity.detail.scheduled", 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.detail.scheduled[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam ACTIVITYDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ACTIVITYDATE); - - /** - * Search parameter: date - *

- * Description: Time period plan covers
- * Type: date
- * Path: CarePlan.period
- *

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

- * Description: Time period plan covers
- * Type: date
- * Path: CarePlan.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: goal - *

- * Description: Desired outcome of plan
- * Type: reference
- * Path: CarePlan.goal
- *

- */ - @SearchParamDefinition(name="goal", path="CarePlan.goal", description="Desired outcome of plan", type="reference" ) - public static final String SP_GOAL = "goal"; - /** - * Fluent Client search parameter constant for goal - *

- * Description: Desired outcome of plan
- * Type: reference
- * Path: CarePlan.goal
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam GOAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_GOAL); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:goal". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_GOAL = new ca.uhn.fhir.model.api.Include("CarePlan:goal").toLocked(); - - /** - * Search parameter: related - *

- * Description: A combination of the type of relationship and the related plan
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="related", path="", description="A combination of the type of relationship and the related plan", type="composite", compositeOf={"relatedcode", "relatedplan"} ) - public static final String SP_RELATED = "related"; - /** - * Fluent Client search parameter constant for related - *

- * Description: A combination of the type of relationship and the related plan
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATED = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATED); - - /** - * Search parameter: relatedcode - *

- * Description: includes | replaces | fulfills
- * Type: token
- * Path: CarePlan.relatedPlan.code
- *

- */ - @SearchParamDefinition(name="relatedcode", path="CarePlan.relatedPlan.code", description="includes | replaces | fulfills", type="token" ) - public static final String SP_RELATEDCODE = "relatedcode"; - /** - * Fluent Client search parameter constant for relatedcode - *

- * Description: includes | replaces | fulfills
- * Type: token
- * Path: CarePlan.relatedPlan.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATEDCODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATEDCODE); - - /** - * Search parameter: patient - *

- * Description: Who care plan is for
- * Type: reference
- * Path: CarePlan.subject
- *

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

- * Description: Who care plan is for
- * Type: reference
- * Path: CarePlan.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CarePlan:patient").toLocked(); - - /** - * Search parameter: participant - *

- * Description: Who is involved
- * Type: reference
- * Path: CarePlan.participant.member
- *

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

- * Description: Who is involved
- * Type: reference
- * Path: CarePlan.participant.member
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:participant". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("CarePlan:participant").toLocked(); - - /** - * Search parameter: performer - *

- * Description: Matches if the practitioner is listed as a performer in any of the "simple" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)
- * Type: reference
- * Path: CarePlan.activity.detail.performer
- *

- */ - @SearchParamDefinition(name="performer", path="CarePlan.activity.detail.performer", description="Matches if the practitioner is listed as a performer in any of the \"simple\" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)", type="reference" ) - public static final String SP_PERFORMER = "performer"; - /** - * Fluent Client search parameter constant for performer - *

- * Description: Matches if the practitioner is listed as a performer in any of the "simple" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)
- * Type: reference
- * Path: CarePlan.activity.detail.performer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("CarePlan:performer").toLocked(); - - /** - * Search parameter: activityreference - *

- * Description: Activity details defined in specific resource
- * Type: reference
- * Path: CarePlan.activity.reference
- *

- */ - @SearchParamDefinition(name="activityreference", path="CarePlan.activity.reference", description="Activity details defined in specific resource", type="reference" ) - public static final String SP_ACTIVITYREFERENCE = "activityreference"; - /** - * Fluent Client search parameter constant for activityreference - *

- * Description: Activity details defined in specific resource
- * Type: reference
- * Path: CarePlan.activity.reference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTIVITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTIVITYREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:activityreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTIVITYREFERENCE = new ca.uhn.fhir.model.api.Include("CarePlan:activityreference").toLocked(); - - /** - * Search parameter: relatedplan - *

- * Description: Plan relationship exists with
- * Type: reference
- * Path: CarePlan.relatedPlan.plan
- *

- */ - @SearchParamDefinition(name="relatedplan", path="CarePlan.relatedPlan.plan", description="Plan relationship exists with", type="reference" ) - public static final String SP_RELATEDPLAN = "relatedplan"; - /** - * Fluent Client search parameter constant for relatedplan - *

- * Description: Plan relationship exists with
- * Type: reference
- * Path: CarePlan.relatedPlan.plan
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDPLAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDPLAN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CarePlan:relatedplan". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDPLAN = new ca.uhn.fhir.model.api.Include("CarePlan:relatedplan").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CareTeam.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CareTeam.java deleted file mode 100644 index 14f55675f72..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CareTeam.java +++ /dev/null @@ -1,1030 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. - */ -@ResourceDef(name="CareTeam", profile="http://hl7.org/fhir/Profile/CareTeam") -public class CareTeam extends DomainResource { - - @Block() - public static class CareTeamParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates specific responsibility of an individual within the care team, such as "Primary physician", "Team coordinator", "Caregiver", etc. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of involvement", formalDefinition="Indicates specific responsibility of an individual within the care team, such as \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc." ) - protected CodeableConcept role; - - /** - * The specific person or organization who is participating/expected to participate in the care team. - */ - @Child(name = "member", type = {Practitioner.class, RelatedPerson.class, Patient.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who is involved", formalDefinition="The specific person or organization who is participating/expected to participate in the care team." ) - protected Reference member; - - /** - * The actual object that is the target of the reference (The specific person or organization who is participating/expected to participate in the care team.) - */ - protected Resource memberTarget; - - /** - * Indicates when the specific member or organization did (or is intended to) come into effect and end. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Time period of participant", formalDefinition="Indicates when the specific member or organization did (or is intended to) come into effect and end." ) - protected Period period; - - private static final long serialVersionUID = -1416929603L; - - /** - * Constructor - */ - public CareTeamParticipantComponent() { - super(); - } - - /** - * @return {@link #role} (Indicates specific responsibility of an individual within the care team, such as "Primary physician", "Team coordinator", "Caregiver", etc.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamParticipantComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Indicates specific responsibility of an individual within the care team, such as "Primary physician", "Team coordinator", "Caregiver", etc.) - */ - public CareTeamParticipantComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - /** - * @return {@link #member} (The specific person or organization who is participating/expected to participate in the care team.) - */ - public Reference getMember() { - if (this.member == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamParticipantComponent.member"); - else if (Configuration.doAutoCreate()) - this.member = new Reference(); // cc - return this.member; - } - - public boolean hasMember() { - return this.member != null && !this.member.isEmpty(); - } - - /** - * @param value {@link #member} (The specific person or organization who is participating/expected to participate in the care team.) - */ - public CareTeamParticipantComponent setMember(Reference value) { - this.member = value; - return this; - } - - /** - * @return {@link #member} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care team.) - */ - public Resource getMemberTarget() { - return this.memberTarget; - } - - /** - * @param value {@link #member} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specific person or organization who is participating/expected to participate in the care team.) - */ - public CareTeamParticipantComponent setMemberTarget(Resource value) { - this.memberTarget = value; - return this; - } - - /** - * @return {@link #period} (Indicates when the specific member or organization did (or is intended to) come into effect and end.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeamParticipantComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates when the specific member or organization did (or is intended to) come into effect and end.) - */ - public CareTeamParticipantComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "CodeableConcept", "Indicates specific responsibility of an individual within the care team, such as \"Primary physician\", \"Team coordinator\", \"Caregiver\", etc.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("member", "Reference(Practitioner|RelatedPerson|Patient|Organization)", "The specific person or organization who is participating/expected to participate in the care team.", 0, java.lang.Integer.MAX_VALUE, member)); - childrenList.add(new Property("period", "Period", "Indicates when the specific member or organization did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept - case -1077769574: /*member*/ return this.member == null ? new Base[0] : new Base[] {this.member}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3506294: // role - this.role = castToCodeableConcept(value); // CodeableConcept - break; - case -1077769574: // member - this.member = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("role")) - this.role = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("member")) - this.member = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3506294: return getRole(); // CodeableConcept - case -1077769574: return getMember(); // Reference - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("role")) { - this.role = new CodeableConcept(); - return this.role; - } - else if (name.equals("member")) { - this.member = new Reference(); - return this.member; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public CareTeamParticipantComponent copy() { - CareTeamParticipantComponent dst = new CareTeamParticipantComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.member = member == null ? null : member.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CareTeamParticipantComponent)) - return false; - CareTeamParticipantComponent o = (CareTeamParticipantComponent) other; - return compareDeep(role, o.role, true) && compareDeep(member, o.member, true) && compareDeep(period, o.period, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CareTeamParticipantComponent)) - return false; - CareTeamParticipantComponent o = (CareTeamParticipantComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (member == null || member.isEmpty()) - && (period == null || period.isEmpty()); - } - - public String fhirType() { - return "CareTeam.participant"; - - } - - } - - /** - * This records identifiers associated with this care team 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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this team", formalDefinition="This records identifiers associated with this care team 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." ) - protected List identifier; - - /** - * Indicates whether the care team is currently active, suspended, inactive, or entered in error. - */ - @Child(name = "status", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | suspended | inactive | entered in error", formalDefinition="Indicates whether the care team is currently active, suspended, inactive, or entered in error." ) - protected CodeableConcept status; - - /** - * Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Type of team", formalDefinition="Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team." ) - protected List type; - - /** - * Name of the care team. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the team, such as crisis assessment team", formalDefinition="Name of the care team." ) - protected StringType name; - - /** - * Identifies the patient or group whose intended care is handled by the team. - */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who care team is for", formalDefinition="Identifies the patient or group whose intended care is handled by the team." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient or group whose intended care is handled by the team.) - */ - protected Resource subjectTarget; - - /** - * Indicates when the team did (or is intended to) come into effect and end. - */ - @Child(name = "period", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period team covers", formalDefinition="Indicates when the team did (or is intended to) come into effect and end." ) - protected Period period; - - /** - * Identifies all people and organizations who are expected to be involved in the care team. - */ - @Child(name = "participant", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Members of the team", formalDefinition="Identifies all people and organizations who are expected to be involved in the care team." ) - protected List participant; - - /** - * The organization responsible for the care team. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization responsible for the care team", formalDefinition="The organization responsible for the care team." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization responsible for the care team.) - */ - protected Organization managingOrganizationTarget; - - private static final long serialVersionUID = -917605050L; - - /** - * Constructor - */ - public CareTeam() { - super(); - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care team 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.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care team 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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public CareTeam addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (Indicates whether the care team is currently active, suspended, inactive, or entered in error.) - */ - public CodeableConcept getStatus() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeam.status"); - else if (Configuration.doAutoCreate()) - this.status = new CodeableConcept(); // cc - return this.status; - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the care team is currently active, suspended, inactive, or entered in error.) - */ - public CareTeam setStatus(CodeableConcept value) { - this.status = value; - return this; - } - - /** - * @return {@link #type} (Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public CareTeam addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #name} (Name of the care team.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeam.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name of the care team.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CareTeam setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name of the care team. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name of the care team. - */ - public CareTeam setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Identifies the patient or group whose intended care is handled by the team.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeam.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Identifies the patient or group whose intended care is handled by the team.) - */ - public CareTeam setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is handled by the team.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient or group whose intended care is handled by the team.) - */ - public CareTeam setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #period} (Indicates when the team did (or is intended to) come into effect and end.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeam.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates when the team did (or is intended to) come into effect and end.) - */ - public CareTeam setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care team.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (CareTeamParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (Identifies all people and organizations who are expected to be involved in the care team.) - */ - // syntactic sugar - public CareTeamParticipantComponent addParticipant() { //3 - CareTeamParticipantComponent t = new CareTeamParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public CareTeam addParticipant(CareTeamParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #managingOrganization} (The organization responsible for the care team.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeam.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization responsible for the care team.) - */ - public CareTeam setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization responsible for the care team.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CareTeam.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization responsible for the care team.) - */ - public CareTeam setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care team 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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "CodeableConcept", "Indicates whether the care team is currently active, suspended, inactive, or entered in error.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("name", "string", "Name of the care team.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "Identifies the patient or group whose intended care is handled by the team.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("period", "Period", "Indicates when the team did (or is intended to) come into effect and end.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("participant", "", "Identifies all people and organizations who are expected to be involved in the care team.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization responsible for the care team.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeableConcept - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // CareTeamParticipantComponent - case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = castToCodeableConcept(value); // CodeableConcept - break; - case 3575610: // type - this.getType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 767422259: // participant - this.getParticipant().add((CareTeamParticipantComponent) value); // CareTeamParticipantComponent - break; - case -2058947787: // managingOrganization - this.managingOrganization = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("type")) - this.getType().add(castToCodeableConcept(value)); - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("participant")) - this.getParticipant().add((CareTeamParticipantComponent) value); - else if (name.equals("managingOrganization")) - this.managingOrganization = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: return getStatus(); // CodeableConcept - case 3575610: return addType(); // CodeableConcept - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1867885268: return getSubject(); // Reference - case -991726143: return getPeriod(); // Period - case 767422259: return addParticipant(); // CareTeamParticipantComponent - case -2058947787: return getManagingOrganization(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - this.status = new CodeableConcept(); - return this.status; - } - else if (name.equals("type")) { - return addType(); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type CareTeam.name"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("participant")) { - return addParticipant(); - } - else if (name.equals("managingOrganization")) { - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "CareTeam"; - - } - - public CareTeam copy() { - CareTeam dst = new CareTeam(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.period = period == null ? null : period.copy(); - if (participant != null) { - dst.participant = new ArrayList(); - for (CareTeamParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - return dst; - } - - protected CareTeam typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CareTeam)) - return false; - CareTeam o = (CareTeam) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) - && compareDeep(name, o.name, true) && compareDeep(subject, o.subject, true) && compareDeep(period, o.period, true) - && compareDeep(participant, o.participant, true) && compareDeep(managingOrganization, o.managingOrganization, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CareTeam)) - return false; - CareTeam o = (CareTeam) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) && (subject == null || subject.isEmpty()) - && (period == null || period.isEmpty()) && (participant == null || participant.isEmpty()) - && (managingOrganization == null || managingOrganization.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CareTeam; - } - - /** - * Search parameter: patient - *

- * Description: Who care team is for
- * Type: reference
- * Path: CareTeam.subject
- *

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

- * Description: Who care team is for
- * Type: reference
- * Path: CareTeam.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CareTeam:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CareTeam:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: active | suspended | inactive | entered in error
- * Type: token
- * Path: CareTeam.status
- *

- */ - @SearchParamDefinition(name="status", path="CareTeam.status", description="active | suspended | inactive | entered in error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: active | suspended | inactive | entered in error
- * Type: token
- * Path: CareTeam.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: Who care team is for
- * Type: reference
- * Path: CareTeam.subject
- *

- */ - @SearchParamDefinition(name="subject", path="CareTeam.subject", description="Who care team is for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who care team is for
- * Type: reference
- * Path: CareTeam.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CareTeam:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CareTeam:subject").toLocked(); - - /** - * Search parameter: participant - *

- * Description: Who is involved
- * Type: reference
- * Path: CareTeam.participant.member
- *

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

- * Description: Who is involved
- * Type: reference
- * Path: CareTeam.participant.member
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CareTeam:participant". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("CareTeam:participant").toLocked(); - - /** - * Search parameter: type - *

- * Description: Type of team
- * Type: token
- * Path: CareTeam.type
- *

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

- * Description: Type of team
- * Type: token
- * Path: CareTeam.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: Time period team covers
- * Type: date
- * Path: CareTeam.period
- *

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

- * Description: Time period team covers
- * Type: date
- * Path: CareTeam.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: External Ids for this team
- * Type: token
- * Path: CareTeam.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="CareTeam.identifier", description="External Ids for this team", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: External Ids for this team
- * Type: token
- * Path: CareTeam.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Claim.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Claim.java deleted file mode 100644 index daa109e95fd..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Claim.java +++ /dev/null @@ -1,8270 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ -@ResourceDef(name="Claim", profile="http://hl7.org/fhir/Profile/Claim") -public class Claim extends DomainResource { - - public enum ClaimType { - /** - * A claim for Institution based, typically in-patient, goods and services. - */ - INSTITUTIONAL, - /** - * A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services. - */ - ORAL, - /** - * A claim for Pharmacy based goods and services. - */ - PHARMACY, - /** - * A claim for Professional, typically out-patient, goods and services. - */ - PROFESSIONAL, - /** - * A claim for Vision (Opthamologist, Optometrist and Optician) goods and services. - */ - VISION, - /** - * added to help the parsers - */ - NULL; - public static ClaimType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("institutional".equals(codeString)) - return INSTITUTIONAL; - if ("oral".equals(codeString)) - return ORAL; - if ("pharmacy".equals(codeString)) - return PHARMACY; - if ("professional".equals(codeString)) - return PROFESSIONAL; - if ("vision".equals(codeString)) - return VISION; - throw new FHIRException("Unknown ClaimType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INSTITUTIONAL: return "institutional"; - case ORAL: return "oral"; - case PHARMACY: return "pharmacy"; - case PROFESSIONAL: return "professional"; - case VISION: return "vision"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INSTITUTIONAL: return "http://hl7.org/fhir/claim-type-link"; - case ORAL: return "http://hl7.org/fhir/claim-type-link"; - case PHARMACY: return "http://hl7.org/fhir/claim-type-link"; - case PROFESSIONAL: return "http://hl7.org/fhir/claim-type-link"; - case VISION: return "http://hl7.org/fhir/claim-type-link"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INSTITUTIONAL: return "A claim for Institution based, typically in-patient, goods and services."; - case ORAL: return "A claim for Oral Health (Dentist, Denturist, Hygienist) goods and services."; - case PHARMACY: return "A claim for Pharmacy based goods and services."; - case PROFESSIONAL: return "A claim for Professional, typically out-patient, goods and services."; - case VISION: return "A claim for Vision (Opthamologist, Optometrist and Optician) goods and services."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INSTITUTIONAL: return "Institutional"; - case ORAL: return "Oral Health"; - case PHARMACY: return "Pharmacy"; - case PROFESSIONAL: return "Professional"; - case VISION: return "Vision"; - default: return "?"; - } - } - } - - public static class ClaimTypeEnumFactory implements EnumFactory { - public ClaimType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("institutional".equals(codeString)) - return ClaimType.INSTITUTIONAL; - if ("oral".equals(codeString)) - return ClaimType.ORAL; - if ("pharmacy".equals(codeString)) - return ClaimType.PHARMACY; - if ("professional".equals(codeString)) - return ClaimType.PROFESSIONAL; - if ("vision".equals(codeString)) - return ClaimType.VISION; - throw new IllegalArgumentException("Unknown ClaimType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("institutional".equals(codeString)) - return new Enumeration(this, ClaimType.INSTITUTIONAL); - if ("oral".equals(codeString)) - return new Enumeration(this, ClaimType.ORAL); - if ("pharmacy".equals(codeString)) - return new Enumeration(this, ClaimType.PHARMACY); - if ("professional".equals(codeString)) - return new Enumeration(this, ClaimType.PROFESSIONAL); - if ("vision".equals(codeString)) - return new Enumeration(this, ClaimType.VISION); - throw new FHIRException("Unknown ClaimType code '"+codeString+"'"); - } - public String toCode(ClaimType code) { - if (code == ClaimType.INSTITUTIONAL) - return "institutional"; - if (code == ClaimType.ORAL) - return "oral"; - if (code == ClaimType.PHARMACY) - return "pharmacy"; - if (code == ClaimType.PROFESSIONAL) - return "professional"; - if (code == ClaimType.VISION) - return "vision"; - return "?"; - } - public String toSystem(ClaimType code) { - return code.getSystem(); - } - } - - public enum Use { - /** - * The treatment is complete and this represents a Claim for the services. - */ - COMPLETE, - /** - * The treatment is proposed and this represents a Pre-authorization for the services. - */ - PROPOSED, - /** - * The treatment is proposed and this represents a Pre-determination for the services. - */ - EXPLORATORY, - /** - * A locally defined or otherwise resolved status. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static Use fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("exploratory".equals(codeString)) - return EXPLORATORY; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown Use code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PROPOSED: return "proposed"; - case EXPLORATORY: return "exploratory"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return "http://hl7.org/fhir/claim-use-link"; - case PROPOSED: return "http://hl7.org/fhir/claim-use-link"; - case EXPLORATORY: return "http://hl7.org/fhir/claim-use-link"; - case OTHER: return "http://hl7.org/fhir/claim-use-link"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The treatment is complete and this represents a Claim for the services."; - case PROPOSED: return "The treatment is proposed and this represents a Pre-authorization for the services."; - case EXPLORATORY: return "The treatment is proposed and this represents a Pre-determination for the services."; - case OTHER: return "A locally defined or otherwise resolved status."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case PROPOSED: return "Proposed"; - case EXPLORATORY: return "Exploratory"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class UseEnumFactory implements EnumFactory { - public Use fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return Use.COMPLETE; - if ("proposed".equals(codeString)) - return Use.PROPOSED; - if ("exploratory".equals(codeString)) - return Use.EXPLORATORY; - if ("other".equals(codeString)) - return Use.OTHER; - throw new IllegalArgumentException("Unknown Use code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return new Enumeration(this, Use.COMPLETE); - if ("proposed".equals(codeString)) - return new Enumeration(this, Use.PROPOSED); - if ("exploratory".equals(codeString)) - return new Enumeration(this, Use.EXPLORATORY); - if ("other".equals(codeString)) - return new Enumeration(this, Use.OTHER); - throw new FHIRException("Unknown Use code '"+codeString+"'"); - } - public String toCode(Use code) { - if (code == Use.COMPLETE) - return "complete"; - if (code == Use.PROPOSED) - return "proposed"; - if (code == Use.EXPLORATORY) - return "exploratory"; - if (code == Use.OTHER) - return "other"; - return "?"; - } - public String toSystem(Use code) { - return code.getSystem(); - } - } - - @Block() - public static class RelatedClaimsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Other claims which are related to this claim such as prior claim versions or for related services. - */ - @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to the related claim", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) - protected Type claim; - - /** - * For example prior or umbrella. - */ - @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." ) - protected Coding relationship; - - /** - * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # . - */ - @Child(name = "reference", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." ) - protected Identifier reference; - - private static final long serialVersionUID = -2033217402L; - - /** - * Constructor - */ - public RelatedClaimsComponent() { - super(); - } - - /** - * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public Type getClaim() { - return this.claim; - } - - /** - * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public Identifier getClaimIdentifier() throws FHIRException { - if (!(this.claim instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered"); - return (Identifier) this.claim; - } - - public boolean hasClaimIdentifier() { - return this.claim instanceof Identifier; - } - - /** - * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public Reference getClaimReference() throws FHIRException { - if (!(this.claim instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered"); - return (Reference) this.claim; - } - - public boolean hasClaimReference() { - return this.claim instanceof Reference; - } - - public boolean hasClaim() { - return this.claim != null && !this.claim.isEmpty(); - } - - /** - * @param value {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public RelatedClaimsComponent setClaim(Type value) { - this.claim = value; - return this; - } - - /** - * @return {@link #relationship} (For example prior or umbrella.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedClaimsComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (For example prior or umbrella.) - */ - public RelatedClaimsComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) - */ - public Identifier getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedClaimsComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Identifier(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) - */ - public RelatedClaimsComponent setReference(Identifier value) { - this.reference = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("claim[x]", "Identifier|Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim)); - childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 94742588: // claim - this.claim = (Type) value; // Type - break; - case -261851592: // relationship - this.relationship = castToCoding(value); // Coding - break; - case -925155509: // reference - this.reference = castToIdentifier(value); // Identifier - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("claim[x]")) - this.claim = (Type) value; // Type - else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding - else if (name.equals("reference")) - this.reference = castToIdentifier(value); // Identifier - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 683016900: return getClaim(); // Type - case -261851592: return getRelationship(); // Coding - case -925155509: return getReference(); // Identifier - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("claimIdentifier")) { - this.claim = new Identifier(); - return this.claim; - } - else if (name.equals("claimReference")) { - this.claim = new Reference(); - return this.claim; - } - else if (name.equals("relationship")) { - this.relationship = new Coding(); - return this.relationship; - } - else if (name.equals("reference")) { - this.reference = new Identifier(); - return this.reference; - } - else - return super.addChild(name); - } - - public RelatedClaimsComponent copy() { - RelatedClaimsComponent dst = new RelatedClaimsComponent(); - copyValues(dst); - dst.claim = claim == null ? null : claim.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.reference = reference == null ? null : reference.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RelatedClaimsComponent)) - return false; - RelatedClaimsComponent o = (RelatedClaimsComponent) other; - return compareDeep(claim, o.claim, true) && compareDeep(relationship, o.relationship, true) && compareDeep(reference, o.reference, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RelatedClaimsComponent)) - return false; - RelatedClaimsComponent o = (RelatedClaimsComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (claim == null || claim.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (reference == null || reference.isEmpty()); - } - - public String fhirType() { - return "Claim.related"; - - } - - } - - @Block() - public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Type of Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "party", type = {Identifier.class, Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Party to receive the payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Type party; - - private static final long serialVersionUID = 1304353420L; - - /** - * Constructor - */ - public PayeeComponent() { - super(); - } - - /** - * Constructor - */ - public PayeeComponent(Coding type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Type getParty() { - return this.party; - } - - /** - * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Identifier getPartyIdentifier() throws FHIRException { - if (!(this.party instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.party.getClass().getName()+" was encountered"); - return (Identifier) this.party; - } - - public boolean hasPartyIdentifier() { - return this.party instanceof Identifier; - } - - /** - * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Reference getPartyReference() throws FHIRException { - if (!(this.party instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.party.getClass().getName()+" was encountered"); - return (Reference) this.party; - } - - public boolean hasPartyReference() { - return this.party instanceof Reference; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setParty(Type value) { - this.party = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("party[x]", "Identifier|Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 106437350: // party - this.party = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("party[x]")) - this.party = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 1189320666: return getParty(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("partyIdentifier")) { - this.party = new Identifier(); - return this.party; - } - else if (name.equals("partyReference")) { - this.party = new Reference(); - return this.party; - } - else - return super.addChild(name); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.party = party == null ? null : party.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PayeeComponent)) - return false; - PayeeComponent o = (PayeeComponent) other; - return compareDeep(type, o.type, true) && compareDeep(party, o.party, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PayeeComponent)) - return false; - PayeeComponent o = (PayeeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) - ; - } - - public String fhirType() { - return "Claim.payee"; - - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Sequence of diagnosis which serves to order and provide a link. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number to covey order of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." ) - protected PositiveIntType sequence; - - /** - * The diagnosis. - */ - @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -795010186L; - - /** - * Constructor - */ - public DiagnosisComponent() { - super(); - } - - /** - * Constructor - */ - public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis which serves to order and provide a link. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis which serves to order and provide a link. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); // cc - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 1196993265: // diagnosis - this.diagnosis = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("diagnosis")) - this.diagnosis = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1196993265: return getDiagnosis(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); - } - else if (name.equals("diagnosis")) { - this.diagnosis = new Coding(); - return this.diagnosis; - } - else - return super.addChild(name); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosisComponent)) - return false; - DiagnosisComponent o = (DiagnosisComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosisComponent)) - return false; - DiagnosisComponent o = (DiagnosisComponent) other; - return compareValues(sequence, o.sequence, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - public String fhirType() { - return "Claim.diagnosis"; - - } - - } - - @Block() - public static class ProcedureComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Sequence of procedures which serves to order and provide a link. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Procedure sequence for reference", formalDefinition="Sequence of procedures which serves to order and provide a link." ) - protected PositiveIntType sequence; - - /** - * Date and optionally time the procedure was performed . - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the procedure was performed", formalDefinition="Date and optionally time the procedure was performed ." ) - protected DateTimeType date; - - /** - * The procedure code. - */ - @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." ) - protected Type procedure; - - private static final long serialVersionUID = 864307347L; - - /** - * Constructor - */ - public ProcedureComponent() { - super(); - } - - /** - * Constructor - */ - public ProcedureComponent(PositiveIntType sequence, Type procedure) { - super(); - this.sequence = sequence; - this.procedure = procedure; - } - - /** - * @return {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ProcedureComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of procedures which serves to order and provide a link. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value Sequence of procedures which serves to order and provide a link. - */ - public ProcedureComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #date} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ProcedureComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date and optionally time the procedure was performed . - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date and optionally time the procedure was performed . - */ - public ProcedureComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (The procedure code.) - */ - public Type getProcedure() { - return this.procedure; - } - - /** - * @return {@link #procedure} (The procedure code.) - */ - public Coding getProcedureCoding() throws FHIRException { - if (!(this.procedure instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered"); - return (Coding) this.procedure; - } - - public boolean hasProcedureCoding() { - return this.procedure instanceof Coding; - } - - /** - * @return {@link #procedure} (The procedure code.) - */ - public Reference getProcedureReference() throws FHIRException { - if (!(this.procedure instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.procedure.getClass().getName()+" was encountered"); - return (Reference) this.procedure; - } - - public boolean hasProcedureReference() { - return this.procedure instanceof Reference; - } - - public boolean hasProcedure() { - return this.procedure != null && !this.procedure.isEmpty(); - } - - /** - * @param value {@link #procedure} (The procedure code.) - */ - public ProcedureComponent setProcedure(Type value) { - this.procedure = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1095204141: // procedure - this.procedure = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("procedure[x]")) - this.procedure = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1640074445: return getProcedure(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.date"); - } - else if (name.equals("procedureCoding")) { - this.procedure = new Coding(); - return this.procedure; - } - else if (name.equals("procedureReference")) { - this.procedure = new Reference(); - return this.procedure; - } - else - return super.addChild(name); - } - - public ProcedureComponent copy() { - ProcedureComponent dst = new ProcedureComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.date = date == null ? null : date.copy(); - dst.procedure = procedure == null ? null : procedure.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureComponent)) - return false; - ProcedureComponent o = (ProcedureComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(date, o.date, true) && compareDeep(procedure, o.procedure, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureComponent)) - return false; - ProcedureComponent o = (ProcedureComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (date == null || date.isEmpty()) - && (procedure == null || procedure.isEmpty()); - } - - public String fhirType() { - return "Claim.procedure"; - - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line item. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected PositiveIntType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Type coverage; - - /** - * The contract number of a business agreement which describes the terms and conditions. - */ - @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preAuthRef; - - /** - * The Coverages adjudication details. - */ - @Child(name = "claimResponse", type = {ClaimResponse.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - private static final long serialVersionUID = 2031704818L; - - /** - * Constructor - */ - public CoverageComponent() { - super(); - } - - /** - * Constructor - */ - public CoverageComponent(PositiveIntType sequence, BooleanType focal, Type coverage) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); // bb - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public boolean getFocal() { - return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Type getCoverage() { - return this.coverage; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Identifier getCoverageIdentifier() throws FHIRException { - if (!(this.coverage instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Identifier) this.coverage; - } - - public boolean hasCoverageIdentifier() { - return this.coverage instanceof Identifier; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverageReference() throws FHIRException { - if (!(this.coverage instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Reference) this.coverage; - } - - public boolean hasCoverageReference() { - return this.coverage instanceof Reference; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Type value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); // bb - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agreement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agreement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreAuthRef() { - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - return this.preAuthRef; - } - - public boolean hasPreAuthRef() { - if (this.preAuthRef == null) - return false; - for (StringType item : this.preAuthRef) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreAuthRefElement() {//2 - StringType t = new StringType(); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return t; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreAuthRef(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return this; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreAuthRef(String value) { - if (this.preAuthRef == null) - return false; - for (StringType v : this.preAuthRef) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); // cc - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); // aa - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public CoverageComponent setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type - case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType - case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType - case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 97604197: // focal - this.focal = castToBoolean(value); // BooleanType - break; - case -351767064: // coverage - this.coverage = (Type) value; // Type - break; - case 259920682: // businessArrangement - this.businessArrangement = castToString(value); // StringType - break; - case 522246568: // preAuthRef - this.getPreAuthRef().add(castToString(value)); // StringType - break; - case 689513629: // claimResponse - this.claimResponse = castToReference(value); // Reference - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("focal")) - this.focal = castToBoolean(value); // BooleanType - else if (name.equals("coverage[x]")) - this.coverage = (Type) value; // Type - else if (name.equals("businessArrangement")) - this.businessArrangement = castToString(value); // StringType - else if (name.equals("preAuthRef")) - this.getPreAuthRef().add(castToString(value)); - else if (name.equals("claimResponse")) - this.claimResponse = castToReference(value); // Reference - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 97604197: throw new FHIRException("Cannot make property focal as it is not a complex type"); // BooleanType - case 227689880: return getCoverage(); // Type - case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType - case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType - case 689513629: return getClaimResponse(); // Reference - case 1089373397: return getOriginalRuleset(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); - } - else if (name.equals("focal")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.focal"); - } - else if (name.equals("coverageIdentifier")) { - this.coverage = new Identifier(); - return this.coverage; - } - else if (name.equals("coverageReference")) { - this.coverage = new Reference(); - return this.coverage; - } - else if (name.equals("businessArrangement")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.businessArrangement"); - } - else if (name.equals("preAuthRef")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.preAuthRef"); - } - else if (name.equals("claimResponse")) { - this.claimResponse = new Reference(); - return this.claimResponse; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else - return super.addChild(name); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - if (preAuthRef != null) { - dst.preAuthRef = new ArrayList(); - for (StringType i : preAuthRef) - dst.preAuthRef.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true) - && compareDeep(claimResponse, o.claimResponse, true) && compareDeep(originalRuleset, o.originalRuleset, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) - && compareValues(preAuthRef, o.preAuthRef, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (preAuthRef == null || preAuthRef.isEmpty()) && (claimResponse == null || claimResponse.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()); - } - - public String fhirType() { - return "Claim.coverage"; - - } - - } - - @Block() - public static class OnsetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The start or start and end dates for the treatable condition. - */ - @Child(name = "time", type = {DateType.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Illness, injury or treatable condition date", formalDefinition="The start or start and end dates for the treatable condition." ) - protected Type time; - - /** - * Onset typifications eg. Start of pregnancy, start of illnes, etc. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Onset of what", formalDefinition="Onset typifications eg. Start of pregnancy, start of illnes, etc." ) - protected Coding type; - - private static final long serialVersionUID = -560173231L; - - /** - * Constructor - */ - public OnsetComponent() { - super(); - } - - /** - * @return {@link #time} (The start or start and end dates for the treatable condition.) - */ - public Type getTime() { - return this.time; - } - - /** - * @return {@link #time} (The start or start and end dates for the treatable condition.) - */ - public DateType getTimeDateType() throws FHIRException { - if (!(this.time instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.time.getClass().getName()+" was encountered"); - return (DateType) this.time; - } - - public boolean hasTimeDateType() { - return this.time instanceof DateType; - } - - /** - * @return {@link #time} (The start or start and end dates for the treatable condition.) - */ - public Period getTimePeriod() throws FHIRException { - if (!(this.time instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.time.getClass().getName()+" was encountered"); - return (Period) this.time; - } - - public boolean hasTimePeriod() { - return this.time instanceof Period; - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (The start or start and end dates for the treatable condition.) - */ - public OnsetComponent setTime(Type value) { - this.time = value; - return this; - } - - /** - * @return {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OnsetComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) - */ - public OnsetComponent setType(Coding value) { - this.type = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("time[x]", "date|Period", "The start or start and end dates for the treatable condition.", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("type", "Coding", "Onset typifications eg. Start of pregnancy, start of illnes, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // Type - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3560141: // time - this.time = (Type) value; // Type - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("time[x]")) - this.time = (Type) value; // Type - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1313930605: return getTime(); // Type - case 3575610: return getType(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("timeDate")) { - this.time = new DateType(); - return this.time; - } - else if (name.equals("timePeriod")) { - this.time = new Period(); - return this.time; - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else - return super.addChild(name); - } - - public OnsetComponent copy() { - OnsetComponent dst = new OnsetComponent(); - copyValues(dst); - dst.time = time == null ? null : time.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OnsetComponent)) - return false; - OnsetComponent o = (OnsetComponent) other; - return compareDeep(time, o.time, true) && compareDeep(type, o.type, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OnsetComponent)) - return false; - OnsetComponent o = (OnsetComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (time == null || time.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - public String fhirType() { - return "Claim.onset"; - - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type provider; - - /** - * The practitioner who is supervising the work of the servicing provider(s). - */ - @Child(name = "supervisor", type = {Identifier.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Supervising Practitioner", formalDefinition="The practitioner who is supervising the work of the servicing provider(s)." ) - protected Type supervisor; - - /** - * The qualification which is applicable for this service. - */ - @Child(name = "providerQualification", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) - protected Coding providerQualification; - - /** - * Diagnosis applicable for this service or product line. - */ - @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Applicable diagnoses", formalDefinition="Diagnosis applicable for this service or product line." ) - protected List diagnosisLinkId; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * Unusual circumstances which may influence adjudication. - */ - @Child(name = "serviceModifier", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service/Product modifiers", formalDefinition="Unusual circumstances which may influence adjudication." ) - protected List serviceModifier; - - /** - * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. - */ - @Child(name = "modifier", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) - protected List modifier; - - /** - * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. - */ - @Child(name = "programCode", type = {Coding.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) - protected List programCode; - - /** - * The date or dates when the enclosed suite of services were performed or completed. - */ - @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) - protected Type serviced; - - /** - * Where the service was provided. - */ - @Child(name = "place", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." ) - protected Coding place; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected SimpleQuantity quantity; - - /** - * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. - */ - @Child(name = "unitPrice", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Device.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected List udi; - /** - * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) - */ - protected List udiTarget; - - - /** - * Physical service site on the patient (limb, tooth, etc). - */ - @Child(name = "bodySite", type = {Coding.class}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) - protected Coding bodySite; - - /** - * A region or surface of the site, eg. limb region or tooth surface(s). - */ - @Child(name = "subSite", type = {Coding.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) - protected List subSite; - - /** - * Second tier of goods and services. - */ - @Child(name = "detail", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) - protected List detail; - - /** - * The materials and placement date of prior fixed prosthesis. - */ - @Child(name = "prosthesis", type = {}, order=22, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) - protected ProsthesisComponent prosthesis; - - private static final long serialVersionUID = 1007480127L; - - /** - * Constructor - */ - public ItemsComponent() { - super(); - } - - /** - * Constructor - */ - public ItemsComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public Type getSupervisor() { - return this.supervisor; - } - - /** - * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public Identifier getSupervisorIdentifier() throws FHIRException { - if (!(this.supervisor instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.supervisor.getClass().getName()+" was encountered"); - return (Identifier) this.supervisor; - } - - public boolean hasSupervisorIdentifier() { - return this.supervisor instanceof Identifier; - } - - /** - * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public Reference getSupervisorReference() throws FHIRException { - if (!(this.supervisor instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.supervisor.getClass().getName()+" was encountered"); - return (Reference) this.supervisor; - } - - public boolean hasSupervisorReference() { - return this.supervisor instanceof Reference; - } - - public boolean hasSupervisor() { - return this.supervisor != null && !this.supervisor.isEmpty(); - } - - /** - * @param value {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public ItemsComponent setSupervisor(Type value) { - this.supervisor = value; - return this; - } - - /** - * @return {@link #providerQualification} (The qualification which is applicable for this service.) - */ - public Coding getProviderQualification() { - if (this.providerQualification == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.providerQualification"); - else if (Configuration.doAutoCreate()) - this.providerQualification = new Coding(); // cc - return this.providerQualification; - } - - public boolean hasProviderQualification() { - return this.providerQualification != null && !this.providerQualification.isEmpty(); - } - - /** - * @param value {@link #providerQualification} (The qualification which is applicable for this service.) - */ - public ItemsComponent setProviderQualification(Coding value) { - this.providerQualification = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - return this.diagnosisLinkId; - } - - public boolean hasDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - return false; - for (PositiveIntType item : this.diagnosisLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - // syntactic sugar - public PositiveIntType addDiagnosisLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - this.diagnosisLinkId.add(t); - return t; - } - - /** - * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public ItemsComponent addDiagnosisLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - this.diagnosisLinkId.add(t); - return this; - } - - /** - * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public boolean hasDiagnosisLinkId(int value) { - if (this.diagnosisLinkId == null) - return false; - for (PositiveIntType v : this.diagnosisLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.) - */ - public List getServiceModifier() { - if (this.serviceModifier == null) - this.serviceModifier = new ArrayList(); - return this.serviceModifier; - } - - public boolean hasServiceModifier() { - if (this.serviceModifier == null) - return false; - for (Coding item : this.serviceModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.) - */ - // syntactic sugar - public Coding addServiceModifier() { //3 - Coding t = new Coding(); - if (this.serviceModifier == null) - this.serviceModifier = new ArrayList(); - this.serviceModifier.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addServiceModifier(Coding t) { //3 - if (t == null) - return this; - if (this.serviceModifier == null) - this.serviceModifier = new ArrayList(); - this.serviceModifier.add(t); - return this; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addModifier(Coding t) { //3 - if (t == null) - return this; - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return this; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - public List getProgramCode() { - if (this.programCode == null) - this.programCode = new ArrayList(); - return this.programCode; - } - - public boolean hasProgramCode() { - if (this.programCode == null) - return false; - for (Coding item : this.programCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - // syntactic sugar - public Coding addProgramCode() { //3 - Coding t = new Coding(); - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addProgramCode(Coding t) { //3 - if (t == null) - return this; - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return this; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Type getServiced() { - return this.serviced; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public DateType getServicedDateType() throws FHIRException { - if (!(this.serviced instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (DateType) this.serviced; - } - - public boolean hasServicedDateType() { - return this.serviced instanceof DateType; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Period getServicedPeriod() throws FHIRException { - if (!(this.serviced instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (Period) this.serviced; - } - - public boolean hasServicedPeriod() { - return this.serviced instanceof Period; - } - - public boolean hasServiced() { - return this.serviced != null && !this.serviced.isEmpty(); - } - - /** - * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public ItemsComponent setServiced(Type value) { - this.serviced = value; - return this; - } - - /** - * @return {@link #place} (Where the service was provided.) - */ - public Coding getPlace() { - if (this.place == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.place"); - else if (Configuration.doAutoCreate()) - this.place = new Coding(); // cc - return this.place; - } - - public boolean hasPlace() { - return this.place != null && !this.place.isEmpty(); - } - - /** - * @param value {@link #place} (Where the service was provided.) - */ - public ItemsComponent setPlace(Coding value) { - this.place = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public List getUdi() { - if (this.udi == null) - this.udi = new ArrayList(); - return this.udi; - } - - public boolean hasUdi() { - if (this.udi == null) - return false; - for (Reference item : this.udi) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - // syntactic sugar - public Reference addUdi() { //3 - Reference t = new Reference(); - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addUdi(Reference t) { //3 - if (t == null) - return this; - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return this; - } - - /** - * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public List getUdiTarget() { - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - return this.udiTarget; - } - - // syntactic sugar - /** - * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public Device addUdiTarget() { - Device r = new Device(); - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - this.udiTarget.add(r); - return r; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubSite() { - if (this.subSite == null) - this.subSite = new ArrayList(); - return this.subSite; - } - - public boolean hasSubSite() { - if (this.subSite == null) - return false; - for (Coding item : this.subSite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubSite() { //3 - Coding t = new Coding(); - if (this.subSite == null) - this.subSite = new ArrayList(); - this.subSite.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addSubSite(Coding t) { //3 - if (t == null) - return this; - if (this.subSite == null) - this.subSite = new ArrayList(); - this.subSite.add(t); - return this; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addDetail(DetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ProsthesisComponent getProsthesis() { - if (this.prosthesis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); - else if (Configuration.doAutoCreate()) - this.prosthesis = new ProsthesisComponent(); // cc - return this.prosthesis; - } - - public boolean hasProsthesis() { - return this.prosthesis != null && !this.prosthesis.isEmpty(); - } - - /** - * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ItemsComponent setProsthesis(ProsthesisComponent value) { - this.prosthesis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("supervisor[x]", "Identifier|Reference(Practitioner)", "The practitioner who is supervising the work of the servicing provider(s).", 0, java.lang.Integer.MAX_VALUE, supervisor)); - childrenList.add(new Property("providerQualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, providerQualification)); - childrenList.add(new Property("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); - childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("serviceModifier", "Coding", "Unusual circumstances which may influence adjudication.", 0, java.lang.Integer.MAX_VALUE, serviceModifier)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); - childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); - childrenList.add(new Property("place", "Coding", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, place)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subSite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case -1697229976: /*supervisor*/ return this.supervisor == null ? new Base[0] : new Base[] {this.supervisor}; // Type - case -1240156290: /*providerQualification*/ return this.providerQualification == null ? new Base[0] : new Base[] {this.providerQualification}; // Coding - case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 615164076: /*serviceModifier*/ return this.serviceModifier == null ? new Base[0] : this.serviceModifier.toArray(new Base[this.serviceModifier.size()]); // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding - case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type - case 106748167: /*place*/ return this.place == null ? new Base[0] : new Base[] {this.place}; // Coding - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding - case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent - case -2138744398: /*prosthesis*/ return this.prosthesis == null ? new Base[0] : new Base[] {this.prosthesis}; // ProsthesisComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case -1697229976: // supervisor - this.supervisor = (Type) value; // Type - break; - case -1240156290: // providerQualification - this.providerQualification = castToCoding(value); // Coding - break; - case -1659207418: // diagnosisLinkId - this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 615164076: // serviceModifier - this.getServiceModifier().add(castToCoding(value)); // Coding - break; - case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding - break; - case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding - break; - case 1379209295: // serviced - this.serviced = (Type) value; // Type - break; - case 106748167: // place - this.place = castToCoding(value); // Coding - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - case 115642: // udi - this.getUdi().add(castToReference(value)); // Reference - break; - case 1702620169: // bodySite - this.bodySite = castToCoding(value); // Coding - break; - case -1868566105: // subSite - this.getSubSite().add(castToCoding(value)); // Coding - break; - case -1335224239: // detail - this.getDetail().add((DetailComponent) value); // DetailComponent - break; - case -2138744398: // prosthesis - this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("supervisor[x]")) - this.supervisor = (Type) value; // Type - else if (name.equals("providerQualification")) - this.providerQualification = castToCoding(value); // Coding - else if (name.equals("diagnosisLinkId")) - this.getDiagnosisLinkId().add(castToPositiveInt(value)); - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("serviceModifier")) - this.getServiceModifier().add(castToCoding(value)); - else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); - else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); - else if (name.equals("serviced[x]")) - this.serviced = (Type) value; // Type - else if (name.equals("place")) - this.place = castToCoding(value); // Coding - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else if (name.equals("udi")) - this.getUdi().add(castToReference(value)); - else if (name.equals("bodySite")) - this.bodySite = castToCoding(value); // Coding - else if (name.equals("subSite")) - this.getSubSite().add(castToCoding(value)); - else if (name.equals("detail")) - this.getDetail().add((DetailComponent) value); - else if (name.equals("prosthesis")) - this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 2064698607: return getProvider(); // Type - case -1823115240: return getSupervisor(); // Type - case -1240156290: return getProviderQualification(); // Coding - case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType - case 1984153269: return getService(); // Coding - case 615164076: return addServiceModifier(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding - case -1927922223: return getServiced(); // Type - case 106748167: return getPlace(); // Coding - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - case 115642: return addUdi(); // Reference - case 1702620169: return getBodySite(); // Coding - case -1868566105: return addSubSite(); // Coding - case -1335224239: return addDetail(); // DetailComponent - case -2138744398: return getProsthesis(); // ProsthesisComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("supervisorIdentifier")) { - this.supervisor = new Identifier(); - return this.supervisor; - } - else if (name.equals("supervisorReference")) { - this.supervisor = new Reference(); - return this.supervisor; - } - else if (name.equals("providerQualification")) { - this.providerQualification = new Coding(); - return this.providerQualification; - } - else if (name.equals("diagnosisLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.diagnosisLinkId"); - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("serviceModifier")) { - return addServiceModifier(); - } - else if (name.equals("modifier")) { - return addModifier(); - } - else if (name.equals("programCode")) { - return addProgramCode(); - } - else if (name.equals("servicedDate")) { - this.serviced = new DateType(); - return this.serviced; - } - else if (name.equals("servicedPeriod")) { - this.serviced = new Period(); - return this.serviced; - } - else if (name.equals("place")) { - this.place = new Coding(); - return this.place; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else if (name.equals("udi")) { - return addUdi(); - } - else if (name.equals("bodySite")) { - this.bodySite = new Coding(); - return this.bodySite; - } - else if (name.equals("subSite")) { - return addSubSite(); - } - else if (name.equals("detail")) { - return addDetail(); - } - else if (name.equals("prosthesis")) { - this.prosthesis = new ProsthesisComponent(); - return this.prosthesis; - } - else - return super.addChild(name); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.supervisor = supervisor == null ? null : supervisor.copy(); - dst.providerQualification = providerQualification == null ? null : providerQualification.copy(); - if (diagnosisLinkId != null) { - dst.diagnosisLinkId = new ArrayList(); - for (PositiveIntType i : diagnosisLinkId) - dst.diagnosisLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - if (serviceModifier != null) { - dst.serviceModifier = new ArrayList(); - for (Coding i : serviceModifier) - dst.serviceModifier.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) - dst.programCode.add(i.copy()); - }; - dst.serviced = serviced == null ? null : serviced.copy(); - dst.place = place == null ? null : place.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (udi != null) { - dst.udi = new ArrayList(); - for (Reference i : udi) - dst.udi.add(i.copy()); - }; - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subSite != null) { - dst.subSite = new ArrayList(); - for (Coding i : subSite) - dst.subSite.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) - && compareDeep(supervisor, o.supervisor, true) && compareDeep(providerQualification, o.providerQualification, true) - && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true) - && compareDeep(serviceModifier, o.serviceModifier, true) && compareDeep(modifier, o.modifier, true) - && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(place, o.place, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) - && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) && compareDeep(detail, o.detail, true) - && compareDeep(prosthesis, o.prosthesis, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) - && compareValues(factor, o.factor, true) && compareValues(points, o.points, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (provider == null || provider.isEmpty()) && (supervisor == null || supervisor.isEmpty()) - && (providerQualification == null || providerQualification.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) - && (service == null || service.isEmpty()) && (serviceModifier == null || serviceModifier.isEmpty()) - && (modifier == null || modifier.isEmpty()) && (programCode == null || programCode.isEmpty()) - && (serviced == null || serviced.isEmpty()) && (place == null || place.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()) && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) - && (subSite == null || subSite.isEmpty()) && (detail == null || detail.isEmpty()) && (prosthesis == null || prosthesis.isEmpty()) - ; - } - - public String fhirType() { - return "Claim.item"; - - } - - } - - @Block() - public static class DetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. - */ - @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) - protected List programCode; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected SimpleQuantity quantity; - - /** - * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. - */ - @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected List udi; - /** - * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) - */ - protected List udiTarget; - - - /** - * Third tier of goods and services. - */ - @Child(name = "subDetail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -1099698352L; - - /** - * Constructor - */ - public DetailComponent() { - super(); - } - - /** - * Constructor - */ - public DetailComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - public List getProgramCode() { - if (this.programCode == null) - this.programCode = new ArrayList(); - return this.programCode; - } - - public boolean hasProgramCode() { - if (this.programCode == null) - return false; - for (Coding item : this.programCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - // syntactic sugar - public Coding addProgramCode() { //3 - Coding t = new Coding(); - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addProgramCode(Coding t) { //3 - if (t == null) - return this; - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public List getUdi() { - if (this.udi == null) - this.udi = new ArrayList(); - return this.udi; - } - - public boolean hasUdi() { - if (this.udi == null) - return false; - for (Reference item : this.udi) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - // syntactic sugar - public Reference addUdi() { //3 - Reference t = new Reference(); - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addUdi(Reference t) { //3 - if (t == null) - return this; - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return this; - } - - /** - * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public List getUdiTarget() { - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - return this.udiTarget; - } - - // syntactic sugar - /** - * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public Device addUdiTarget() { - Device r = new Device(); - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - this.udiTarget.add(r); - return r; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addSubDetail(SubDetailComponent t) { //3 - if (t == null) - return this; - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - case 115642: // udi - this.getUdi().add(castToReference(value)); // Reference - break; - case -828829007: // subDetail - this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else if (name.equals("udi")) - this.getUdi().add(castToReference(value)); - else if (name.equals("subDetail")) - this.getSubDetail().add((SubDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 1984153269: return getService(); // Coding - case 1010065041: return addProgramCode(); // Coding - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - case 115642: return addUdi(); // Reference - case -828829007: return addSubDetail(); // SubDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("programCode")) { - return addProgramCode(); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else if (name.equals("udi")) { - return addUdi(); - } - else if (name.equals("subDetail")) { - return addSubDetail(); - } - else - return super.addChild(name); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) - dst.programCode.add(i.copy()); - }; - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (udi != null) { - dst.udi = new ArrayList(); - for (Reference i : udi) - dst.udi.add(i.copy()); - }; - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailComponent)) - return false; - DetailComponent o = (DetailComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) - && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(subDetail, o.subDetail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailComponent)) - return false; - DetailComponent o = (DetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.isEmpty()) && (programCode == null || programCode.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()) && (subDetail == null || subDetail.isEmpty()); - } - - public String fhirType() { - return "Claim.item.detail"; - - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addittional service or product or charge. - */ - @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." ) - protected Coding service; - - /** - * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. - */ - @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) - protected List programCode; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected SimpleQuantity quantity; - - /** - * The fee for an addittional service or product or charge. - */ - @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional service or product or charge." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected List udi; - /** - * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) - */ - protected List udiTarget; - - - private static final long serialVersionUID = 846630321L; - - /** - * Constructor - */ - public SubDetailComponent() { - super(); - } - - /** - * Constructor - */ - public SubDetailComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addittional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addittional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - public List getProgramCode() { - if (this.programCode == null) - this.programCode = new ArrayList(); - return this.programCode; - } - - public boolean hasProgramCode() { - if (this.programCode == null) - return false; - for (Coding item : this.programCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - // syntactic sugar - public Coding addProgramCode() { //3 - Coding t = new Coding(); - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addProgramCode(Coding t) { //3 - if (t == null) - return this; - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addittional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addittional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public List getUdi() { - if (this.udi == null) - this.udi = new ArrayList(); - return this.udi; - } - - public boolean hasUdi() { - if (this.udi == null) - return false; - for (Reference item : this.udi) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - // syntactic sugar - public Reference addUdi() { //3 - Reference t = new Reference(); - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addUdi(Reference t) { //3 - if (t == null) - return this; - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return this; - } - - /** - * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public List getUdiTarget() { - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - return this.udiTarget; - } - - // syntactic sugar - /** - * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public Device addUdiTarget() { - Device r = new Device(); - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - this.udiTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("service", "Coding", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - case 115642: // udi - this.getUdi().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else if (name.equals("udi")) - this.getUdi().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 1984153269: return getService(); // Coding - case 1010065041: return addProgramCode(); // Coding - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - case 115642: return addUdi(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.sequence"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("programCode")) { - return addProgramCode(); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else if (name.equals("udi")) { - return addUdi(); - } - else - return super.addChild(name); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) - dst.programCode.add(i.copy()); - }; - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (udi != null) { - dst.udi = new ArrayList(); - for (Reference i : udi) - dst.udi.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) - && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.isEmpty()) && (programCode == null || programCode.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()); - } - - public String fhirType() { - return "Claim.item.detail.subDetail"; - - } - - } - - @Block() - public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates whether this is the initial placement of a fixed prosthesis. - */ - @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." ) - protected BooleanType initial; - - /** - * Date of the initial placement. - */ - @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) - protected DateType priorDate; - - /** - * Material of the prior denture or bridge prosthesis. (Oral). - */ - @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) - protected Coding priorMaterial; - - private static final long serialVersionUID = 1739349641L; - - /** - * Constructor - */ - public ProsthesisComponent() { - super(); - } - - /** - * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public BooleanType getInitialElement() { - if (this.initial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.initial"); - else if (Configuration.doAutoCreate()) - this.initial = new BooleanType(); // bb - return this.initial; - } - - public boolean hasInitialElement() { - return this.initial != null && !this.initial.isEmpty(); - } - - public boolean hasInitial() { - return this.initial != null && !this.initial.isEmpty(); - } - - /** - * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public ProsthesisComponent setInitialElement(BooleanType value) { - this.initial = value; - return this; - } - - /** - * @return Indicates whether this is the initial placement of a fixed prosthesis. - */ - public boolean getInitial() { - return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue(); - } - - /** - * @param value Indicates whether this is the initial placement of a fixed prosthesis. - */ - public ProsthesisComponent setInitial(boolean value) { - if (this.initial == null) - this.initial = new BooleanType(); - this.initial.setValue(value); - return this; - } - - /** - * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public DateType getPriorDateElement() { - if (this.priorDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); - else if (Configuration.doAutoCreate()) - this.priorDate = new DateType(); // bb - return this.priorDate; - } - - public boolean hasPriorDateElement() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - public boolean hasPriorDate() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - /** - * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public ProsthesisComponent setPriorDateElement(DateType value) { - this.priorDate = value; - return this; - } - - /** - * @return Date of the initial placement. - */ - public Date getPriorDate() { - return this.priorDate == null ? null : this.priorDate.getValue(); - } - - /** - * @param value Date of the initial placement. - */ - public ProsthesisComponent setPriorDate(Date value) { - if (value == null) - this.priorDate = null; - else { - if (this.priorDate == null) - this.priorDate = new DateType(); - this.priorDate.setValue(value); - } - return this; - } - - /** - * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public Coding getPriorMaterial() { - if (this.priorMaterial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); - else if (Configuration.doAutoCreate()) - this.priorMaterial = new Coding(); // cc - return this.priorMaterial; - } - - public boolean hasPriorMaterial() { - return this.priorMaterial != null && !this.priorMaterial.isEmpty(); - } - - /** - * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public ProsthesisComponent setPriorMaterial(Coding value) { - this.priorMaterial = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); - childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); - childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType - case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType - case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1948342084: // initial - this.initial = castToBoolean(value); // BooleanType - break; - case -1770675816: // priorDate - this.priorDate = castToDate(value); // DateType - break; - case -532999663: // priorMaterial - this.priorMaterial = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("initial")) - this.initial = castToBoolean(value); // BooleanType - else if (name.equals("priorDate")) - this.priorDate = castToDate(value); // DateType - else if (name.equals("priorMaterial")) - this.priorMaterial = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType - case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType - case -532999663: return getPriorMaterial(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("initial")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.initial"); - } - else if (name.equals("priorDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.priorDate"); - } - else if (name.equals("priorMaterial")) { - this.priorMaterial = new Coding(); - return this.priorMaterial; - } - else - return super.addChild(name); - } - - public ProsthesisComponent copy() { - ProsthesisComponent dst = new ProsthesisComponent(); - copyValues(dst); - dst.initial = initial == null ? null : initial.copy(); - dst.priorDate = priorDate == null ? null : priorDate.copy(); - dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProsthesisComponent)) - return false; - ProsthesisComponent o = (ProsthesisComponent) other; - return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProsthesisComponent)) - return false; - ProsthesisComponent o = (ProsthesisComponent) other; - return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) - && (priorMaterial == null || priorMaterial.isEmpty()); - } - - public String fhirType() { - return "Claim.item.prosthesis"; - - } - - } - - @Block() - public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code identifying which tooth is missing. - */ - @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) - protected Coding tooth; - - /** - * Missing reason may be: E-extraction, O-other. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Indicates whether it was extracted or other reason", formalDefinition="Missing reason may be: E-extraction, O-other." ) - protected Coding reason; - - /** - * The date of the extraction either known from records or patient reported estimate. - */ - @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date tooth was extracted if known", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) - protected DateType extractionDate; - - private static final long serialVersionUID = 352913313L; - - /** - * Constructor - */ - public MissingTeethComponent() { - super(); - } - - /** - * Constructor - */ - public MissingTeethComponent(Coding tooth) { - super(); - this.tooth = tooth; - } - - /** - * @return {@link #tooth} (The code identifying which tooth is missing.) - */ - public Coding getTooth() { - if (this.tooth == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); - else if (Configuration.doAutoCreate()) - this.tooth = new Coding(); // cc - return this.tooth; - } - - public boolean hasTooth() { - return this.tooth != null && !this.tooth.isEmpty(); - } - - /** - * @param value {@link #tooth} (The code identifying which tooth is missing.) - */ - public MissingTeethComponent setTooth(Coding value) { - this.tooth = value; - return this; - } - - /** - * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public MissingTeethComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public DateType getExtractionDateElement() { - if (this.extractionDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); - else if (Configuration.doAutoCreate()) - this.extractionDate = new DateType(); // bb - return this.extractionDate; - } - - public boolean hasExtractionDateElement() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - public boolean hasExtractionDate() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - /** - * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public MissingTeethComponent setExtractionDateElement(DateType value) { - this.extractionDate = value; - return this; - } - - /** - * @return The date of the extraction either known from records or patient reported estimate. - */ - public Date getExtractionDate() { - return this.extractionDate == null ? null : this.extractionDate.getValue(); - } - - /** - * @param value The date of the extraction either known from records or patient reported estimate. - */ - public MissingTeethComponent setExtractionDate(Date value) { - if (value == null) - this.extractionDate = null; - else { - if (this.extractionDate == null) - this.extractionDate = new DateType(); - this.extractionDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); - childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 110545608: // tooth - this.tooth = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case 580646965: // extractionDate - this.extractionDate = castToDate(value); // DateType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("tooth")) - this.tooth = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("extractionDate")) - this.extractionDate = castToDate(value); // DateType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 110545608: return getTooth(); // Coding - case -934964668: return getReason(); // Coding - case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("tooth")) { - this.tooth = new Coding(); - return this.tooth; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("extractionDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.extractionDate"); - } - else - return super.addChild(name); - } - - public MissingTeethComponent copy() { - MissingTeethComponent dst = new MissingTeethComponent(); - copyValues(dst); - dst.tooth = tooth == null ? null : tooth.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareValues(extractionDate, o.extractionDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) - && (extractionDate == null || extractionDate.isEmpty()); - } - - public String fhirType() { - return "Claim.missingTeeth"; - - } - - } - - /** - * The category of claim. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="institutional | oral | pharmacy | professional | vision", formalDefinition="The category of claim." ) - protected Enumeration type; - - /** - * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. - */ - @Child(name = "subType", type = {Coding.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." ) - protected List subType; - - /** - * The business identifier for the instance: claim number, pre-determination or pre-authorization number. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: claim number, pre-determination or pre-authorization number." ) - protected List identifier; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name = "ruleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The billable period for which charges are being submitted. - */ - @Child(name = "billablePeriod", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." ) - protected Period billablePeriod; - - /** - * Insurer Identifier, typical BIN number (6 digit). - */ - @Child(name = "target", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="Insurer Identifier, typical BIN number (6 digit)." ) - protected Type target; - - /** - * The provider which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible provider", formalDefinition="The provider which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Type provider; - - /** - * The organization which is responsible for the bill, claim pre-determination, pre-authorization. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the bill, claim pre-determination, pre-authorization." ) - protected Type organization; - - /** - * Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - @Child(name = "use", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="complete | proposed | exploratory | other", formalDefinition="Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination)." ) - protected Enumeration use; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name = "priority", type = {Coding.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested. - */ - @Child(name = "fundsReserve", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Funds requested to be reserved", formalDefinition="In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested." ) - protected Coding fundsReserve; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name = "enterer", type = {Identifier.class, Practitioner.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Type enterer; - - /** - * Facility where the services were provided. - */ - @Child(name = "facility", type = {Identifier.class, Location.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Type facility; - - /** - * Other claims which are related to this claim such as prior claim versions or for related services. - */ - @Child(name = "related", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) - protected List related; - - /** - * Prescription to support the dispensing of Pharmacy or Vision products. - */ - @Child(name = "prescription", type = {Identifier.class, MedicationOrder.class, VisionPrescription.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) - protected Type prescription; - - /** - * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. - */ - @Child(name = "originalPrescription", type = {Identifier.class, MedicationOrder.class}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products." ) - protected Type originalPrescription; - - /** - * The party to be reimbursed for the services. - */ - @Child(name = "payee", type = {}, order=18, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="The party to be reimbursed for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name = "referral", type = {Identifier.class, ReferralRequest.class}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Type referral; - - /** - * **Insert definition of Occurrence codes. - */ - @Child(name = "occurrenceCode", type = {Coding.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Occurrence Codes", formalDefinition="**Insert definition of Occurrence codes." ) - protected List occurrenceCode; - - /** - * **Insert definition of Occurrence Span codes. - */ - @Child(name = "occurenceSpanCode", type = {Coding.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Occurrence Span Codes", formalDefinition="**Insert definition of Occurrence Span codes." ) - protected List occurenceSpanCode; - - /** - * **Insert definition of Value codes. - */ - @Child(name = "valueCode", type = {Coding.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Value Codes", formalDefinition="**Insert definition of Value codes." ) - protected List valueCode; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name = "diagnosis", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * Ordered list of patient procedures performed to support the adjudication. - */ - @Child(name = "procedure", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." ) - protected List procedure; - - /** - * List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. - */ - @Child(name = "specialCondition", type = {Coding.class}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of special Conditions", formalDefinition="List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication." ) - protected List specialCondition; - - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Identifier.class, Patient.class}, order=26, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Type patient; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name = "coverage", type = {}, order=27, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - /** - * Date of an accident which these services are addressing. - */ - @Child(name = "accidentDate", type = {DateType.class}, order=28, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the accident occurred", formalDefinition="Date of an accident which these services are addressing." ) - protected DateType accidentDate; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name = "accidentType", type = {Coding.class}, order=29, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * Accident Place. - */ - @Child(name = "accidentLocation", type = {Address.class, Location.class}, order=30, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Accident Place", formalDefinition="Accident Place." ) - protected Type accidentLocation; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name = "interventionException", type = {Coding.class}, order=31, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * Period, start and last dates of aspects of the Condition or related services. - */ - @Child(name = "onset", type = {}, order=32, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Condition related Onset related dates and codes", formalDefinition="Period, start and last dates of aspects of the Condition or related services." ) - protected List onset; - - /** - * The start and optional end dates of when the patient was precluded from working due to the treatable condition(s). - */ - @Child(name = "employmentImpacted", type = {Period.class}, order=33, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period unable to work", formalDefinition="The start and optional end dates of when the patient was precluded from working due to the treatable condition(s)." ) - protected Period employmentImpacted; - - /** - * The start and optional end dates of when the patient was confined to a treatment center. - */ - @Child(name = "hospitalization", type = {Period.class}, order=34, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period in hospital", formalDefinition="The start and optional end dates of when the patient was confined to a treatment center." ) - protected Period hospitalization; - - /** - * First tier of goods and services. - */ - @Child(name = "item", type = {}, order=35, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * The total value of the claim. - */ - @Child(name = "total", type = {Money.class}, order=36, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total claim cost", formalDefinition="The total value of the claim." ) - protected Money total; - - /** - * Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission. - */ - @Child(name = "additionalMaterial", type = {Coding.class}, order=37, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional supporting materials and documents", formalDefinition="Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission." ) - protected List additionalMaterial; - - /** - * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - */ - @Child(name = "missingTeeth", type = {}, order=38, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) - protected List missingTeeth; - - private static final long serialVersionUID = 1478562254L; - - /** - * Constructor - */ - public Claim() { - super(); - } - - /** - * Constructor - */ - public Claim(Enumeration type, Type patient) { - super(); - this.type = type; - this.patient = patient; - } - - /** - * @return {@link #type} (The category of claim.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ClaimTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The category of claim.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Claim setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The category of claim. - */ - public ClaimType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The category of claim. - */ - public Claim setType(ClaimType value) { - if (this.type == null) - this.type = new Enumeration(new ClaimTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) - */ - public List getSubType() { - if (this.subType == null) - this.subType = new ArrayList(); - return this.subType; - } - - public boolean hasSubType() { - if (this.subType == null) - return false; - for (Coding item : this.subType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) - */ - // syntactic sugar - public Coding addSubType() { //3 - Coding t = new Coding(); - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return t; - } - - // syntactic sugar - public Claim addSubType(Coding t) { //3 - if (t == null) - return this; - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return this; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Claim addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Claim setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Claim setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Claim setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public Claim setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #billablePeriod} (The billable period for which charges are being submitted.) - */ - public Period getBillablePeriod() { - if (this.billablePeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.billablePeriod"); - else if (Configuration.doAutoCreate()) - this.billablePeriod = new Period(); // cc - return this.billablePeriod; - } - - public boolean hasBillablePeriod() { - return this.billablePeriod != null && !this.billablePeriod.isEmpty(); - } - - /** - * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) - */ - public Claim setBillablePeriod(Period value) { - this.billablePeriod = value; - return this; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Identifier getTargetIdentifier() throws FHIRException { - if (!(this.target instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Identifier) this.target; - } - - public boolean hasTargetIdentifier() { - return this.target instanceof Identifier; - } - - /** - * @return {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Reference getTargetReference() throws FHIRException { - if (!(this.target instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTargetReference() { - return this.target instanceof Reference; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Insurer Identifier, typical BIN number (6 digit).) - */ - public Claim setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Claim setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the bill, claim pre-determination, pre-authorization.) - */ - public Claim setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new UseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Claim setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public Use getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). - */ - public Claim setUse(Use value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new UseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Claim setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Coding getFundsReserve() { - if (this.fundsReserve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.fundsReserve"); - else if (Configuration.doAutoCreate()) - this.fundsReserve = new Coding(); // cc - return this.fundsReserve; - } - - public boolean hasFundsReserve() { - return this.fundsReserve != null && !this.fundsReserve.isEmpty(); - } - - /** - * @param value {@link #fundsReserve} (In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.) - */ - public Claim setFundsReserve(Coding value) { - this.fundsReserve = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Type getEnterer() { - return this.enterer; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Identifier getEntererIdentifier() throws FHIRException { - if (!(this.enterer instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.enterer.getClass().getName()+" was encountered"); - return (Identifier) this.enterer; - } - - public boolean hasEntererIdentifier() { - return this.enterer instanceof Identifier; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEntererReference() throws FHIRException { - if (!(this.enterer instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.enterer.getClass().getName()+" was encountered"); - return (Reference) this.enterer; - } - - public boolean hasEntererReference() { - return this.enterer instanceof Reference; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Claim setEnterer(Type value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Type getFacility() { - return this.facility; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Identifier getFacilityIdentifier() throws FHIRException { - if (!(this.facility instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered"); - return (Identifier) this.facility; - } - - public boolean hasFacilityIdentifier() { - return this.facility instanceof Identifier; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacilityReference() throws FHIRException { - if (!(this.facility instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered"); - return (Reference) this.facility; - } - - public boolean hasFacilityReference() { - return this.facility instanceof Reference; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public Claim setFacility(Type value) { - this.facility = value; - return this; - } - - /** - * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (RelatedClaimsComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - // syntactic sugar - public RelatedClaimsComponent addRelated() { //3 - RelatedClaimsComponent t = new RelatedClaimsComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public Claim addRelated(RelatedClaimsComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Type getPrescription() { - return this.prescription; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Identifier getPrescriptionIdentifier() throws FHIRException { - if (!(this.prescription instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.prescription.getClass().getName()+" was encountered"); - return (Identifier) this.prescription; - } - - public boolean hasPrescriptionIdentifier() { - return this.prescription instanceof Identifier; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Reference getPrescriptionReference() throws FHIRException { - if (!(this.prescription instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.prescription.getClass().getName()+" was encountered"); - return (Reference) this.prescription; - } - - public boolean hasPrescriptionReference() { - return this.prescription instanceof Reference; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Claim setPrescription(Type value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Type getOriginalPrescription() { - return this.originalPrescription; - } - - /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Identifier getOriginalPrescriptionIdentifier() throws FHIRException { - if (!(this.originalPrescription instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); - return (Identifier) this.originalPrescription; - } - - public boolean hasOriginalPrescriptionIdentifier() { - return this.originalPrescription instanceof Identifier; - } - - /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Reference getOriginalPrescriptionReference() throws FHIRException { - if (!(this.originalPrescription instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); - return (Reference) this.originalPrescription; - } - - public boolean hasOriginalPrescriptionReference() { - return this.originalPrescription instanceof Reference; - } - - public boolean hasOriginalPrescription() { - return this.originalPrescription != null && !this.originalPrescription.isEmpty(); - } - - /** - * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Claim setOriginalPrescription(Type value) { - this.originalPrescription = value; - return this; - } - - /** - * @return {@link #payee} (The party to be reimbursed for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); // cc - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (The party to be reimbursed for the services.) - */ - public Claim setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Type getReferral() { - return this.referral; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Identifier getReferralIdentifier() throws FHIRException { - if (!(this.referral instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.referral.getClass().getName()+" was encountered"); - return (Identifier) this.referral; - } - - public boolean hasReferralIdentifier() { - return this.referral instanceof Identifier; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferralReference() throws FHIRException { - if (!(this.referral instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.referral.getClass().getName()+" was encountered"); - return (Reference) this.referral; - } - - public boolean hasReferralReference() { - return this.referral instanceof Reference; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Claim setReferral(Type value) { - this.referral = value; - return this; - } - - /** - * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) - */ - public List getOccurrenceCode() { - if (this.occurrenceCode == null) - this.occurrenceCode = new ArrayList(); - return this.occurrenceCode; - } - - public boolean hasOccurrenceCode() { - if (this.occurrenceCode == null) - return false; - for (Coding item : this.occurrenceCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) - */ - // syntactic sugar - public Coding addOccurrenceCode() { //3 - Coding t = new Coding(); - if (this.occurrenceCode == null) - this.occurrenceCode = new ArrayList(); - this.occurrenceCode.add(t); - return t; - } - - // syntactic sugar - public Claim addOccurrenceCode(Coding t) { //3 - if (t == null) - return this; - if (this.occurrenceCode == null) - this.occurrenceCode = new ArrayList(); - this.occurrenceCode.add(t); - return this; - } - - /** - * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) - */ - public List getOccurenceSpanCode() { - if (this.occurenceSpanCode == null) - this.occurenceSpanCode = new ArrayList(); - return this.occurenceSpanCode; - } - - public boolean hasOccurenceSpanCode() { - if (this.occurenceSpanCode == null) - return false; - for (Coding item : this.occurenceSpanCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) - */ - // syntactic sugar - public Coding addOccurenceSpanCode() { //3 - Coding t = new Coding(); - if (this.occurenceSpanCode == null) - this.occurenceSpanCode = new ArrayList(); - this.occurenceSpanCode.add(t); - return t; - } - - // syntactic sugar - public Claim addOccurenceSpanCode(Coding t) { //3 - if (t == null) - return this; - if (this.occurenceSpanCode == null) - this.occurenceSpanCode = new ArrayList(); - this.occurenceSpanCode.add(t); - return this; - } - - /** - * @return {@link #valueCode} (**Insert definition of Value codes.) - */ - public List getValueCode() { - if (this.valueCode == null) - this.valueCode = new ArrayList(); - return this.valueCode; - } - - public boolean hasValueCode() { - if (this.valueCode == null) - return false; - for (Coding item : this.valueCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueCode} (**Insert definition of Value codes.) - */ - // syntactic sugar - public Coding addValueCode() { //3 - Coding t = new Coding(); - if (this.valueCode == null) - this.valueCode = new ArrayList(); - this.valueCode.add(t); - return t; - } - - // syntactic sugar - public Claim addValueCode(Coding t) { //3 - if (t == null) - return this; - if (this.valueCode == null) - this.valueCode = new ArrayList(); - this.valueCode.add(t); - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - // syntactic sugar - public Claim addDiagnosis(DiagnosisComponent t) { //3 - if (t == null) - return this; - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return this; - } - - /** - * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) - */ - public List getProcedure() { - if (this.procedure == null) - this.procedure = new ArrayList(); - return this.procedure; - } - - public boolean hasProcedure() { - if (this.procedure == null) - return false; - for (ProcedureComponent item : this.procedure) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) - */ - // syntactic sugar - public ProcedureComponent addProcedure() { //3 - ProcedureComponent t = new ProcedureComponent(); - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return t; - } - - // syntactic sugar - public Claim addProcedure(ProcedureComponent t) { //3 - if (t == null) - return this; - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return this; - } - - /** - * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) - */ - public List getSpecialCondition() { - if (this.specialCondition == null) - this.specialCondition = new ArrayList(); - return this.specialCondition; - } - - public boolean hasSpecialCondition() { - if (this.specialCondition == null) - return false; - for (Coding item : this.specialCondition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) - */ - // syntactic sugar - public Coding addSpecialCondition() { //3 - Coding t = new Coding(); - if (this.specialCondition == null) - this.specialCondition = new ArrayList(); - this.specialCondition.add(t); - return t; - } - - // syntactic sugar - public Claim addSpecialCondition(Coding t) { //3 - if (t == null) - return this; - if (this.specialCondition == null) - this.specialCondition = new ArrayList(); - this.specialCondition.add(t); - return this; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Type getPatient() { - return this.patient; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Identifier getPatientIdentifier() throws FHIRException { - if (!(this.patient instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered"); - return (Identifier) this.patient; - } - - public boolean hasPatientIdentifier() { - return this.patient instanceof Identifier; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatientReference() throws FHIRException { - if (!(this.patient instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered"); - return (Reference) this.patient; - } - - public boolean hasPatientReference() { - return this.patient instanceof Reference; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public Claim setPatient(Type value) { - this.patient = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - // syntactic sugar - public Claim addCoverage(CoverageComponent t) { //3 - if (t == null) - return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return this; - } - - /** - * @return {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value - */ - public DateType getAccidentDateElement() { - if (this.accidentDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.accidentDate"); - else if (Configuration.doAutoCreate()) - this.accidentDate = new DateType(); // bb - return this.accidentDate; - } - - public boolean hasAccidentDateElement() { - return this.accidentDate != null && !this.accidentDate.isEmpty(); - } - - public boolean hasAccidentDate() { - return this.accidentDate != null && !this.accidentDate.isEmpty(); - } - - /** - * @param value {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value - */ - public Claim setAccidentDateElement(DateType value) { - this.accidentDate = value; - return this; - } - - /** - * @return Date of an accident which these services are addressing. - */ - public Date getAccidentDate() { - return this.accidentDate == null ? null : this.accidentDate.getValue(); - } - - /** - * @param value Date of an accident which these services are addressing. - */ - public Claim setAccidentDate(Date value) { - if (value == null) - this.accidentDate = null; - else { - if (this.accidentDate == null) - this.accidentDate = new DateType(); - this.accidentDate.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); // cc - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Claim setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #accidentLocation} (Accident Place.) - */ - public Type getAccidentLocation() { - return this.accidentLocation; - } - - /** - * @return {@link #accidentLocation} (Accident Place.) - */ - public Address getAccidentLocationAddress() throws FHIRException { - if (!(this.accidentLocation instanceof Address)) - throw new FHIRException("Type mismatch: the type Address was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); - return (Address) this.accidentLocation; - } - - public boolean hasAccidentLocationAddress() { - return this.accidentLocation instanceof Address; - } - - /** - * @return {@link #accidentLocation} (Accident Place.) - */ - public Reference getAccidentLocationReference() throws FHIRException { - if (!(this.accidentLocation instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); - return (Reference) this.accidentLocation; - } - - public boolean hasAccidentLocationReference() { - return this.accidentLocation instanceof Reference; - } - - public boolean hasAccidentLocation() { - return this.accidentLocation != null && !this.accidentLocation.isEmpty(); - } - - /** - * @param value {@link #accidentLocation} (Accident Place.) - */ - public Claim setAccidentLocation(Type value) { - this.accidentLocation = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - // syntactic sugar - public Claim addInterventionException(Coding t) { //3 - if (t == null) - return this; - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return this; - } - - /** - * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) - */ - public List getOnset() { - if (this.onset == null) - this.onset = new ArrayList(); - return this.onset; - } - - public boolean hasOnset() { - if (this.onset == null) - return false; - for (OnsetComponent item : this.onset) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) - */ - // syntactic sugar - public OnsetComponent addOnset() { //3 - OnsetComponent t = new OnsetComponent(); - if (this.onset == null) - this.onset = new ArrayList(); - this.onset.add(t); - return t; - } - - // syntactic sugar - public Claim addOnset(OnsetComponent t) { //3 - if (t == null) - return this; - if (this.onset == null) - this.onset = new ArrayList(); - this.onset.add(t); - return this; - } - - /** - * @return {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) - */ - public Period getEmploymentImpacted() { - if (this.employmentImpacted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.employmentImpacted"); - else if (Configuration.doAutoCreate()) - this.employmentImpacted = new Period(); // cc - return this.employmentImpacted; - } - - public boolean hasEmploymentImpacted() { - return this.employmentImpacted != null && !this.employmentImpacted.isEmpty(); - } - - /** - * @param value {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) - */ - public Claim setEmploymentImpacted(Period value) { - this.employmentImpacted = value; - return this; - } - - /** - * @return {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) - */ - public Period getHospitalization() { - if (this.hospitalization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.hospitalization"); - else if (Configuration.doAutoCreate()) - this.hospitalization = new Period(); // cc - return this.hospitalization; - } - - public boolean hasHospitalization() { - return this.hospitalization != null && !this.hospitalization.isEmpty(); - } - - /** - * @param value {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) - */ - public Claim setHospitalization(Period value) { - this.hospitalization = value; - return this; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public Claim addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #total} (The total value of the claim.) - */ - public Money getTotal() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Claim.total"); - else if (Configuration.doAutoCreate()) - this.total = new Money(); // cc - return this.total; - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (The total value of the claim.) - */ - public Claim setTotal(Money value) { - this.total = value; - return this; - } - - /** - * @return {@link #additionalMaterial} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - public List getAdditionalMaterial() { - if (this.additionalMaterial == null) - this.additionalMaterial = new ArrayList(); - return this.additionalMaterial; - } - - public boolean hasAdditionalMaterial() { - if (this.additionalMaterial == null) - return false; - for (Coding item : this.additionalMaterial) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additionalMaterial} (Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.) - */ - // syntactic sugar - public Coding addAdditionalMaterial() { //3 - Coding t = new Coding(); - if (this.additionalMaterial == null) - this.additionalMaterial = new ArrayList(); - this.additionalMaterial.add(t); - return t; - } - - // syntactic sugar - public Claim addAdditionalMaterial(Coding t) { //3 - if (t == null) - return this; - if (this.additionalMaterial == null) - this.additionalMaterial = new ArrayList(); - this.additionalMaterial.add(t); - return this; - } - - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - public List getMissingTeeth() { - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - return this.missingTeeth; - } - - public boolean hasMissingTeeth() { - if (this.missingTeeth == null) - return false; - for (MissingTeethComponent item : this.missingTeeth) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - // syntactic sugar - public MissingTeethComponent addMissingTeeth() { //3 - MissingTeethComponent t = new MissingTeethComponent(); - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return t; - } - - // syntactic sugar - public Claim addMissingTeeth(MissingTeethComponent t) { //3 - if (t == null) - return this; - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The category of claim.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); - childrenList.add(new Property("identifier", "Identifier", "The business identifier for the instance: claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod)); - childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "Insurer Identifier, typical BIN number (6 digit).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The provider which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the bill, claim pre-determination, pre-authorization.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("use", "code", "Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination).", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("fundsReserve", "Coding", "In the case of a Pre-Determination/Pre-Authorization the provider may request that funds in the amount of the expected Benefit be reserved ('Patient' or 'Provider') to pay for the Benefits determined on the subsequent claim(s). 'None' explicitly indicates no funds reserving is requested.", 0, java.lang.Integer.MAX_VALUE, fundsReserve)); - childrenList.add(new Property("enterer[x]", "Identifier|Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related)); - childrenList.add(new Property("prescription[x]", "Identifier|Reference(MedicationOrder|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("originalPrescription[x]", "Identifier|Reference(MedicationOrder)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); - childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral[x]", "Identifier|Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("occurrenceCode", "Coding", "**Insert definition of Occurrence codes.", 0, java.lang.Integer.MAX_VALUE, occurrenceCode)); - childrenList.add(new Property("occurenceSpanCode", "Coding", "**Insert definition of Occurrence Span codes.", 0, java.lang.Integer.MAX_VALUE, occurenceSpanCode)); - childrenList.add(new Property("valueCode", "Coding", "**Insert definition of Value codes.", 0, java.lang.Integer.MAX_VALUE, valueCode)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("specialCondition", "Coding", "List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, specialCondition)); - childrenList.add(new Property("patient[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("accidentDate", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accidentDate)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("accidentLocation[x]", "Address|Reference(Location)", "Accident Place.", 0, java.lang.Integer.MAX_VALUE, accidentLocation)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("onset", "", "Period, start and last dates of aspects of the Condition or related services.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted)); - childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("total", "Money", "The total value of the claim.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("additionalMaterial", "Coding", "Code to indicate that Xrays, images, emails, documents, models or attachments are being sent in support of this submission.", 0, java.lang.Integer.MAX_VALUE, additionalMaterial)); - childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding - case 1314609806: /*fundsReserve*/ return this.fundsReserve == null ? new Base[0] : new Base[] {this.fundsReserve}; // Coding - case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Type - case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type - case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimsComponent - case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Type - case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Type - case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent - case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Type - case 1721744222: /*occurrenceCode*/ return this.occurrenceCode == null ? new Base[0] : this.occurrenceCode.toArray(new Base[this.occurrenceCode.size()]); // Coding - case -556690898: /*occurenceSpanCode*/ return this.occurenceSpanCode == null ? new Base[0] : this.occurenceSpanCode.toArray(new Base[this.occurenceSpanCode.size()]); // Coding - case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // Coding - case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent - case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent - case -481489822: /*specialCondition*/ return this.specialCondition == null ? new Base[0] : this.specialCondition.toArray(new Base[this.specialCondition.size()]); // Coding - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent - case -63170979: /*accidentDate*/ return this.accidentDate == null ? new Base[0] : new Base[] {this.accidentDate}; // DateType - case -62671383: /*accidentType*/ return this.accidentType == null ? new Base[0] : new Base[] {this.accidentType}; // Coding - case -1074014492: /*accidentLocation*/ return this.accidentLocation == null ? new Base[0] : new Base[] {this.accidentLocation}; // Type - case 1753076536: /*interventionException*/ return this.interventionException == null ? new Base[0] : this.interventionException.toArray(new Base[this.interventionException.size()]); // Coding - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : this.onset.toArray(new Base[this.onset.size()]); // OnsetComponent - case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period - case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent - case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money - case -1534875026: /*additionalMaterial*/ return this.additionalMaterial == null ? new Base[0] : this.additionalMaterial.toArray(new Base[this.additionalMaterial.size()]); // Coding - case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new ClaimTypeEnumFactory().fromType(value); // Enumeration - break; - case -1868521062: // subType - this.getSubType().add(castToCoding(value)); // Coding - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -332066046: // billablePeriod - this.billablePeriod = castToPeriod(value); // Period - break; - case -880905839: // target - this.target = (Type) value; // Type - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 116103: // use - this.use = new UseEnumFactory().fromType(value); // Enumeration - break; - case -1165461084: // priority - this.priority = castToCoding(value); // Coding - break; - case 1314609806: // fundsReserve - this.fundsReserve = castToCoding(value); // Coding - break; - case -1591951995: // enterer - this.enterer = (Type) value; // Type - break; - case 501116579: // facility - this.facility = (Type) value; // Type - break; - case 1090493483: // related - this.getRelated().add((RelatedClaimsComponent) value); // RelatedClaimsComponent - break; - case 460301338: // prescription - this.prescription = (Type) value; // Type - break; - case -1814015861: // originalPrescription - this.originalPrescription = (Type) value; // Type - break; - case 106443592: // payee - this.payee = (PayeeComponent) value; // PayeeComponent - break; - case -722568291: // referral - this.referral = (Type) value; // Type - break; - case 1721744222: // occurrenceCode - this.getOccurrenceCode().add(castToCoding(value)); // Coding - break; - case -556690898: // occurenceSpanCode - this.getOccurenceSpanCode().add(castToCoding(value)); // Coding - break; - case -766209282: // valueCode - this.getValueCode().add(castToCoding(value)); // Coding - break; - case 1196993265: // diagnosis - this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent - break; - case -1095204141: // procedure - this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent - break; - case -481489822: // specialCondition - this.getSpecialCondition().add(castToCoding(value)); // Coding - break; - case -791418107: // patient - this.patient = (Type) value; // Type - break; - case -351767064: // coverage - this.getCoverage().add((CoverageComponent) value); // CoverageComponent - break; - case -63170979: // accidentDate - this.accidentDate = castToDate(value); // DateType - break; - case -62671383: // accidentType - this.accidentType = castToCoding(value); // Coding - break; - case -1074014492: // accidentLocation - this.accidentLocation = (Type) value; // Type - break; - case 1753076536: // interventionException - this.getInterventionException().add(castToCoding(value)); // Coding - break; - case 105901603: // onset - this.getOnset().add((OnsetComponent) value); // OnsetComponent - break; - case 1051487345: // employmentImpacted - this.employmentImpacted = castToPeriod(value); // Period - break; - case 1057894634: // hospitalization - this.hospitalization = castToPeriod(value); // Period - break; - case 3242771: // item - this.getItem().add((ItemsComponent) value); // ItemsComponent - break; - case 110549828: // total - this.total = castToMoney(value); // Money - break; - case -1534875026: // additionalMaterial - this.getAdditionalMaterial().add(castToCoding(value)); // Coding - break; - case -1157130302: // missingTeeth - this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new ClaimTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("subType")) - this.getSubType().add(castToCoding(value)); - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("billablePeriod")) - this.billablePeriod = castToPeriod(value); // Period - else if (name.equals("target[x]")) - this.target = (Type) value; // Type - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("use")) - this.use = new UseEnumFactory().fromType(value); // Enumeration - else if (name.equals("priority")) - this.priority = castToCoding(value); // Coding - else if (name.equals("fundsReserve")) - this.fundsReserve = castToCoding(value); // Coding - else if (name.equals("enterer[x]")) - this.enterer = (Type) value; // Type - else if (name.equals("facility[x]")) - this.facility = (Type) value; // Type - else if (name.equals("related")) - this.getRelated().add((RelatedClaimsComponent) value); - else if (name.equals("prescription[x]")) - this.prescription = (Type) value; // Type - else if (name.equals("originalPrescription[x]")) - this.originalPrescription = (Type) value; // Type - else if (name.equals("payee")) - this.payee = (PayeeComponent) value; // PayeeComponent - else if (name.equals("referral[x]")) - this.referral = (Type) value; // Type - else if (name.equals("occurrenceCode")) - this.getOccurrenceCode().add(castToCoding(value)); - else if (name.equals("occurenceSpanCode")) - this.getOccurenceSpanCode().add(castToCoding(value)); - else if (name.equals("valueCode")) - this.getValueCode().add(castToCoding(value)); - else if (name.equals("diagnosis")) - this.getDiagnosis().add((DiagnosisComponent) value); - else if (name.equals("procedure")) - this.getProcedure().add((ProcedureComponent) value); - else if (name.equals("specialCondition")) - this.getSpecialCondition().add(castToCoding(value)); - else if (name.equals("patient[x]")) - this.patient = (Type) value; // Type - else if (name.equals("coverage")) - this.getCoverage().add((CoverageComponent) value); - else if (name.equals("accidentDate")) - this.accidentDate = castToDate(value); // DateType - else if (name.equals("accidentType")) - this.accidentType = castToCoding(value); // Coding - else if (name.equals("accidentLocation[x]")) - this.accidentLocation = (Type) value; // Type - else if (name.equals("interventionException")) - this.getInterventionException().add(castToCoding(value)); - else if (name.equals("onset")) - this.getOnset().add((OnsetComponent) value); - else if (name.equals("employmentImpacted")) - this.employmentImpacted = castToPeriod(value); // Period - else if (name.equals("hospitalization")) - this.hospitalization = castToPeriod(value); // Period - else if (name.equals("item")) - this.getItem().add((ItemsComponent) value); - else if (name.equals("total")) - this.total = castToMoney(value); // Money - else if (name.equals("additionalMaterial")) - this.getAdditionalMaterial().add(castToCoding(value)); - else if (name.equals("missingTeeth")) - this.getMissingTeeth().add((MissingTeethComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -1868521062: return addSubType(); // Coding - case -1618432855: return addIdentifier(); // Identifier - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -332066046: return getBillablePeriod(); // Period - case -815579825: return getTarget(); // Type - case 2064698607: return getProvider(); // Type - case 1326483053: return getOrganization(); // Type - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case -1165461084: return getPriority(); // Coding - case 1314609806: return getFundsReserve(); // Coding - case -812909349: return getEnterer(); // Type - case -542224643: return getFacility(); // Type - case 1090493483: return addRelated(); // RelatedClaimsComponent - case -993324506: return getPrescription(); // Type - case -2067905515: return getOriginalPrescription(); // Type - case 106443592: return getPayee(); // PayeeComponent - case 344221635: return getReferral(); // Type - case 1721744222: return addOccurrenceCode(); // Coding - case -556690898: return addOccurenceSpanCode(); // Coding - case -766209282: return addValueCode(); // Coding - case 1196993265: return addDiagnosis(); // DiagnosisComponent - case -1095204141: return addProcedure(); // ProcedureComponent - case -481489822: return addSpecialCondition(); // Coding - case -2061246629: return getPatient(); // Type - case -351767064: return addCoverage(); // CoverageComponent - case -63170979: throw new FHIRException("Cannot make property accidentDate as it is not a complex type"); // DateType - case -62671383: return getAccidentType(); // Coding - case 1540715292: return getAccidentLocation(); // Type - case 1753076536: return addInterventionException(); // Coding - case 105901603: return addOnset(); // OnsetComponent - case 1051487345: return getEmploymentImpacted(); // Period - case 1057894634: return getHospitalization(); // Period - case 3242771: return addItem(); // ItemsComponent - case 110549828: return getTotal(); // Money - case -1534875026: return addAdditionalMaterial(); // Coding - case -1157130302: return addMissingTeeth(); // MissingTeethComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.type"); - } - else if (name.equals("subType")) { - return addSubType(); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.created"); - } - else if (name.equals("billablePeriod")) { - this.billablePeriod = new Period(); - return this.billablePeriod; - } - else if (name.equals("targetIdentifier")) { - this.target = new Identifier(); - return this.target; - } - else if (name.equals("targetReference")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.use"); - } - else if (name.equals("priority")) { - this.priority = new Coding(); - return this.priority; - } - else if (name.equals("fundsReserve")) { - this.fundsReserve = new Coding(); - return this.fundsReserve; - } - else if (name.equals("entererIdentifier")) { - this.enterer = new Identifier(); - return this.enterer; - } - else if (name.equals("entererReference")) { - this.enterer = new Reference(); - return this.enterer; - } - else if (name.equals("facilityIdentifier")) { - this.facility = new Identifier(); - return this.facility; - } - else if (name.equals("facilityReference")) { - this.facility = new Reference(); - return this.facility; - } - else if (name.equals("related")) { - return addRelated(); - } - else if (name.equals("prescriptionIdentifier")) { - this.prescription = new Identifier(); - return this.prescription; - } - else if (name.equals("prescriptionReference")) { - this.prescription = new Reference(); - return this.prescription; - } - else if (name.equals("originalPrescriptionIdentifier")) { - this.originalPrescription = new Identifier(); - return this.originalPrescription; - } - else if (name.equals("originalPrescriptionReference")) { - this.originalPrescription = new Reference(); - return this.originalPrescription; - } - else if (name.equals("payee")) { - this.payee = new PayeeComponent(); - return this.payee; - } - else if (name.equals("referralIdentifier")) { - this.referral = new Identifier(); - return this.referral; - } - else if (name.equals("referralReference")) { - this.referral = new Reference(); - return this.referral; - } - else if (name.equals("occurrenceCode")) { - return addOccurrenceCode(); - } - else if (name.equals("occurenceSpanCode")) { - return addOccurenceSpanCode(); - } - else if (name.equals("valueCode")) { - return addValueCode(); - } - else if (name.equals("diagnosis")) { - return addDiagnosis(); - } - else if (name.equals("procedure")) { - return addProcedure(); - } - else if (name.equals("specialCondition")) { - return addSpecialCondition(); - } - else if (name.equals("patientIdentifier")) { - this.patient = new Identifier(); - return this.patient; - } - else if (name.equals("patientReference")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("coverage")) { - return addCoverage(); - } - else if (name.equals("accidentDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Claim.accidentDate"); - } - else if (name.equals("accidentType")) { - this.accidentType = new Coding(); - return this.accidentType; - } - else if (name.equals("accidentLocationAddress")) { - this.accidentLocation = new Address(); - return this.accidentLocation; - } - else if (name.equals("accidentLocationReference")) { - this.accidentLocation = new Reference(); - return this.accidentLocation; - } - else if (name.equals("interventionException")) { - return addInterventionException(); - } - else if (name.equals("onset")) { - return addOnset(); - } - else if (name.equals("employmentImpacted")) { - this.employmentImpacted = new Period(); - return this.employmentImpacted; - } - else if (name.equals("hospitalization")) { - this.hospitalization = new Period(); - return this.hospitalization; - } - else if (name.equals("item")) { - return addItem(); - } - else if (name.equals("total")) { - this.total = new Money(); - return this.total; - } - else if (name.equals("additionalMaterial")) { - return addAdditionalMaterial(); - } - else if (name.equals("missingTeeth")) { - return addMissingTeeth(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Claim"; - - } - - public Claim copy() { - Claim dst = new Claim(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (subType != null) { - dst.subType = new ArrayList(); - for (Coding i : subType) - dst.subType.add(i.copy()); - }; - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.billablePeriod = billablePeriod == null ? null : billablePeriod.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.use = use == null ? null : use.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.fundsReserve = fundsReserve == null ? null : fundsReserve.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - if (related != null) { - dst.related = new ArrayList(); - for (RelatedClaimsComponent i : related) - dst.related.add(i.copy()); - }; - dst.prescription = prescription == null ? null : prescription.copy(); - dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (occurrenceCode != null) { - dst.occurrenceCode = new ArrayList(); - for (Coding i : occurrenceCode) - dst.occurrenceCode.add(i.copy()); - }; - if (occurenceSpanCode != null) { - dst.occurenceSpanCode = new ArrayList(); - for (Coding i : occurenceSpanCode) - dst.occurenceSpanCode.add(i.copy()); - }; - if (valueCode != null) { - dst.valueCode = new ArrayList(); - for (Coding i : valueCode) - dst.valueCode.add(i.copy()); - }; - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (procedure != null) { - dst.procedure = new ArrayList(); - for (ProcedureComponent i : procedure) - dst.procedure.add(i.copy()); - }; - if (specialCondition != null) { - dst.specialCondition = new ArrayList(); - for (Coding i : specialCondition) - dst.specialCondition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - dst.accidentDate = accidentDate == null ? null : accidentDate.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - dst.accidentLocation = accidentLocation == null ? null : accidentLocation.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (onset != null) { - dst.onset = new ArrayList(); - for (OnsetComponent i : onset) - dst.onset.add(i.copy()); - }; - dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy(); - dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - dst.total = total == null ? null : total.copy(); - if (additionalMaterial != null) { - dst.additionalMaterial = new ArrayList(); - for (Coding i : additionalMaterial) - dst.additionalMaterial.add(i.copy()); - }; - if (missingTeeth != null) { - dst.missingTeeth = new ArrayList(); - for (MissingTeethComponent i : missingTeeth) - dst.missingTeeth.add(i.copy()); - }; - return dst; - } - - protected Claim typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Claim)) - return false; - Claim o = (Claim) other; - return compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true) - && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(use, o.use, true) && compareDeep(priority, o.priority, true) && compareDeep(fundsReserve, o.fundsReserve, true) - && compareDeep(enterer, o.enterer, true) && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true) - && compareDeep(prescription, o.prescription, true) && compareDeep(originalPrescription, o.originalPrescription, true) - && compareDeep(payee, o.payee, true) && compareDeep(referral, o.referral, true) && compareDeep(occurrenceCode, o.occurrenceCode, true) - && compareDeep(occurenceSpanCode, o.occurenceSpanCode, true) && compareDeep(valueCode, o.valueCode, true) - && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(specialCondition, o.specialCondition, true) - && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) && compareDeep(accidentDate, o.accidentDate, true) - && compareDeep(accidentType, o.accidentType, true) && compareDeep(accidentLocation, o.accidentLocation, true) - && compareDeep(interventionException, o.interventionException, true) && compareDeep(onset, o.onset, true) - && compareDeep(employmentImpacted, o.employmentImpacted, true) && compareDeep(hospitalization, o.hospitalization, true) - && compareDeep(item, o.item, true) && compareDeep(total, o.total, true) && compareDeep(additionalMaterial, o.additionalMaterial, true) - && compareDeep(missingTeeth, o.missingTeeth, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Claim)) - return false; - Claim o = (Claim) other; - return compareValues(type, o.type, true) && compareValues(created, o.created, true) && compareValues(use, o.use, true) - && compareValues(accidentDate, o.accidentDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (billablePeriod == null || billablePeriod.isEmpty()) && (target == null || target.isEmpty()) - && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (use == null || use.isEmpty()) && (priority == null || priority.isEmpty()) && (fundsReserve == null || fundsReserve.isEmpty()) - && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) && (related == null || related.isEmpty()) - && (prescription == null || prescription.isEmpty()) && (originalPrescription == null || originalPrescription.isEmpty()) - && (payee == null || payee.isEmpty()) && (referral == null || referral.isEmpty()) && (occurrenceCode == null || occurrenceCode.isEmpty()) - && (occurenceSpanCode == null || occurenceSpanCode.isEmpty()) && (valueCode == null || valueCode.isEmpty()) - && (diagnosis == null || diagnosis.isEmpty()) && (procedure == null || procedure.isEmpty()) - && (specialCondition == null || specialCondition.isEmpty()) && (patient == null || patient.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (accidentDate == null || accidentDate.isEmpty()) - && (accidentType == null || accidentType.isEmpty()) && (accidentLocation == null || accidentLocation.isEmpty()) - && (interventionException == null || interventionException.isEmpty()) && (onset == null || onset.isEmpty()) - && (employmentImpacted == null || employmentImpacted.isEmpty()) && (hospitalization == null || hospitalization.isEmpty()) - && (item == null || item.isEmpty()) && (total == null || total.isEmpty()) && (additionalMaterial == null || additionalMaterial.isEmpty()) - && (missingTeeth == null || missingTeeth.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Claim; - } - - /** - * Search parameter: patientidentifier - *

- * Description: Patient receiving the services
- * Type: token
- * Path: Claim.patientIdentifier
- *

- */ - @SearchParamDefinition(name="patientidentifier", path="Claim.patient.as(Identifier)", description="Patient receiving the services", type="token" ) - public static final String SP_PATIENTIDENTIFIER = "patientidentifier"; - /** - * Fluent Client search parameter constant for patientidentifier - *

- * Description: Patient receiving the services
- * Type: token
- * Path: Claim.patientIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER); - - /** - * Search parameter: targetreference - *

- * Description: The target payor/insurer for the Claim
- * Type: reference
- * Path: Claim.targetReference
- *

- */ - @SearchParamDefinition(name="targetreference", path="Claim.target.as(Reference)", description="The target payor/insurer for the Claim", type="reference" ) - public static final String SP_TARGETREFERENCE = "targetreference"; - /** - * Fluent Client search parameter constant for targetreference - *

- * Description: The target payor/insurer for the Claim
- * Type: reference
- * Path: Claim.targetReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGETREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGETREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Claim:targetreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGETREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:targetreference").toLocked(); - - /** - * Search parameter: facilityidentifier - *

- * Description: Facility responsible for the goods and services
- * Type: token
- * Path: Claim.facilityIdentifier
- *

- */ - @SearchParamDefinition(name="facilityidentifier", path="Claim.facility.as(Identifier)", description="Facility responsible for the goods and services", type="token" ) - public static final String SP_FACILITYIDENTIFIER = "facilityidentifier"; - /** - * Fluent Client search parameter constant for facilityidentifier - *

- * Description: Facility responsible for the goods and services
- * Type: token
- * Path: Claim.facilityIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER); - - /** - * Search parameter: facilityreference - *

- * Description: Facility responsible for the goods and services
- * Type: reference
- * Path: Claim.facilityReference
- *

- */ - @SearchParamDefinition(name="facilityreference", path="Claim.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" ) - public static final String SP_FACILITYREFERENCE = "facilityreference"; - /** - * Fluent Client search parameter constant for facilityreference - *

- * Description: Facility responsible for the goods and services
- * Type: reference
- * Path: Claim.facilityReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Claim:facilityreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:facilityreference").toLocked(); - - /** - * Search parameter: use - *

- * Description: The kind of financial resource
- * Type: token
- * Path: Claim.use
- *

- */ - @SearchParamDefinition(name="use", path="Claim.use", description="The kind of financial resource", type="token" ) - public static final String SP_USE = "use"; - /** - * Fluent Client search parameter constant for use - *

- * Description: The kind of financial resource
- * Type: token
- * Path: Claim.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USE); - - /** - * Search parameter: providerreference - *

- * Description: Provider responsible for the Claim
- * Type: reference
- * Path: Claim.providerReference
- *

- */ - @SearchParamDefinition(name="providerreference", path="Claim.provider.as(Reference)", description="Provider responsible for the Claim", type="reference" ) - public static final String SP_PROVIDERREFERENCE = "providerreference"; - /** - * Fluent Client search parameter constant for providerreference - *

- * Description: Provider responsible for the Claim
- * Type: reference
- * Path: Claim.providerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Claim:providerreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:providerreference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The reference to the providing organization
- * Type: token
- * Path: Claim.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="Claim.organization.as(Identifier)", description="The reference to the providing organization", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The reference to the providing organization
- * Type: token
- * Path: Claim.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: patientreference - *

- * Description: Patient receiving the services
- * Type: reference
- * Path: Claim.patientReference
- *

- */ - @SearchParamDefinition(name="patientreference", path="Claim.patient.as(Reference)", description="Patient receiving the services", type="reference" ) - public static final String SP_PATIENTREFERENCE = "patientreference"; - /** - * Fluent Client search parameter constant for patientreference - *

- * Description: Patient receiving the services
- * Type: reference
- * Path: Claim.patientReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Claim:patientreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:patientreference").toLocked(); - - /** - * Search parameter: created - *

- * Description: The creation date for the Claim
- * Type: date
- * Path: Claim.created
- *

- */ - @SearchParamDefinition(name="created", path="Claim.created", description="The creation date for the Claim", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: The creation date for the Claim
- * Type: date
- * Path: Claim.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: priority - *

- * Description: Processing priority requested
- * Type: token
- * Path: Claim.priority
- *

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

- * Description: Processing priority requested
- * Type: token
- * Path: Claim.priority
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); - - /** - * Search parameter: targetidentifier - *

- * Description: The target payor/insurer for the Claim
- * Type: token
- * Path: Claim.targetIdentifier
- *

- */ - @SearchParamDefinition(name="targetidentifier", path="Claim.target.as(Identifier)", description="The target payor/insurer for the Claim", type="token" ) - public static final String SP_TARGETIDENTIFIER = "targetidentifier"; - /** - * Fluent Client search parameter constant for targetidentifier - *

- * Description: The target payor/insurer for the Claim
- * Type: token
- * Path: Claim.targetIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGETIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGETIDENTIFIER); - - /** - * Search parameter: organizationreference - *

- * Description: The reference to the providing organization
- * Type: reference
- * Path: Claim.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="Claim.organization.as(Reference)", description="The reference to the providing organization", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The reference to the providing organization
- * Type: reference
- * Path: Claim.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Claim:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("Claim:organizationreference").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The primary identifier of the financial resource
- * Type: token
- * Path: Claim.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Claim.identifier", description="The primary identifier of the financial resource", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The primary identifier of the financial resource
- * Type: token
- * Path: Claim.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: provideridentifier - *

- * Description: Provider responsible for the Claim
- * Type: token
- * Path: Claim.providerIdentifier
- *

- */ - @SearchParamDefinition(name="provideridentifier", path="Claim.provider.as(Identifier)", description="Provider responsible for the Claim", type="token" ) - public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; - /** - * Fluent Client search parameter constant for provideridentifier - *

- * Description: Provider responsible for the Claim
- * Type: token
- * Path: Claim.providerIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ClaimResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ClaimResponse.java deleted file mode 100644 index 7b78a4ef1b8..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ClaimResponse.java +++ /dev/null @@ -1,6116 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides the adjudication details from the processing of a Claim resource. - */ -@ResourceDef(name="ClaimResponse", profile="http://hl7.org/fhir/Profile/ClaimResponse") -public class ClaimResponse extends DomainResource { - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequenceLinkId; - - /** - * A list of note references to the notes provided below. - */ - @Child(name = "noteNumber", type = {PositiveIntType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumber; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for submitted services. - */ - @Child(name = "detail", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Detail line items", formalDefinition="The second tier service adjudications for submitted services." ) - protected List detail; - - private static final long serialVersionUID = -1917866697L; - - /** - * Constructor - */ - public ItemsComponent() { - super(); - } - - /** - * Constructor - */ - public ItemsComponent(PositiveIntType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemsComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public List getNoteNumber() { - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - return this.noteNumber; - } - - public boolean hasNoteNumber() { - if (this.noteNumber == null) - return false; - for (PositiveIntType item : this.noteNumber) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public PositiveIntType addNoteNumberElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return t; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public ItemsComponent addNoteNumber(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return this; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumber(int value) { - if (this.noteNumber == null) - return false; - for (PositiveIntType v : this.noteNumber) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (ItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public ItemAdjudicationComponent addAdjudication() { //3 - ItemAdjudicationComponent t = new ItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #detail} (The second tier service adjudications for submitted services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (ItemDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemDetailComponent addDetail() { //3 - ItemDetailComponent t = new ItemDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addDetail(ItemDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType - case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // ItemAdjudicationComponent - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // ItemDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - break; - case -1110033957: // noteNumber - this.getNoteNumber().add(castToPositiveInt(value)); // PositiveIntType - break; - case -231349275: // adjudication - this.getAdjudication().add((ItemAdjudicationComponent) value); // ItemAdjudicationComponent - break; - case -1335224239: // detail - this.getDetail().add((ItemDetailComponent) value); // ItemDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - else if (name.equals("noteNumber")) - this.getNoteNumber().add(castToPositiveInt(value)); - else if (name.equals("adjudication")) - this.getAdjudication().add((ItemAdjudicationComponent) value); - else if (name.equals("detail")) - this.getDetail().add((ItemDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType - case -231349275: return addAdjudication(); // ItemAdjudicationComponent - case -1335224239: return addDetail(); // ItemDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); - } - else if (name.equals("noteNumber")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.noteNumber"); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (noteNumber != null) { - dst.noteNumber = new ArrayList(); - for (PositiveIntType i : noteNumber) - dst.noteNumber.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (ItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (ItemDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(noteNumber, o.noteNumber, true) - && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumber, o.noteNumber, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - public String fhirType() { - return "ClaimResponse.item"; - - } - - } - - @Block() - public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monetary amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public ItemAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public ItemAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public ItemAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public ItemAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monetary amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monetary amount associated with the code.) - */ - public ItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); - } - else - return super.addChild(name); - } - - public ItemAdjudicationComponent copy() { - ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemAdjudicationComponent)) - return false; - ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemAdjudicationComponent)) - return false; - ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.item.adjudication"; - - } - - } - - @Block() - public static class ItemDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequenceLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The third tier service adjudications for submitted services. - */ - @Child(name = "subDetail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Subdetail line items", formalDefinition="The third tier service adjudications for submitted services." ) - protected List subDetail; - - private static final long serialVersionUID = -1751018357L; - - /** - * Constructor - */ - public ItemDetailComponent() { - super(); - } - - /** - * Constructor - */ - public ItemDetailComponent(PositiveIntType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemDetailComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemDetailComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemDetailComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (DetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public DetailAdjudicationComponent addAdjudication() { //3 - DetailAdjudicationComponent t = new DetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public ItemDetailComponent addAdjudication(DetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #subDetail} (The third tier service adjudications for submitted services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (The third tier service adjudications for submitted services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - // syntactic sugar - public ItemDetailComponent addSubDetail(SubDetailComponent t) { //3 - if (t == null) - return this; - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("subDetail", "", "The third tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // DetailAdjudicationComponent - case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - break; - case -231349275: // adjudication - this.getAdjudication().add((DetailAdjudicationComponent) value); // DetailAdjudicationComponent - break; - case -828829007: // subDetail - this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - else if (name.equals("adjudication")) - this.getAdjudication().add((DetailAdjudicationComponent) value); - else if (name.equals("subDetail")) - this.getSubDetail().add((SubDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case -231349275: return addAdjudication(); // DetailAdjudicationComponent - case -828829007: return addSubDetail(); // SubDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else if (name.equals("subDetail")) { - return addSubDetail(); - } - else - return super.addChild(name); - } - - public ItemDetailComponent copy() { - ItemDetailComponent dst = new ItemDetailComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (DetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemDetailComponent)) - return false; - ItemDetailComponent o = (ItemDetailComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) - && compareDeep(subDetail, o.subDetail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemDetailComponent)) - return false; - ItemDetailComponent o = (ItemDetailComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) - && (subDetail == null || subDetail.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.item.detail"; - - } - - } - - @Block() - public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monetary amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public DetailAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public DetailAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public DetailAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public DetailAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monetary amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monetary amount associated with the code.) - */ - public DetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); - } - else - return super.addChild(name); - } - - public DetailAdjudicationComponent copy() { - DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailAdjudicationComponent)) - return false; - DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailAdjudicationComponent)) - return false; - DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.item.detail.adjudication"; - - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequenceLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Subdetail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = 1780202110L; - - /** - * Constructor - */ - public SubDetailComponent() { - super(); - } - - /** - * Constructor - */ - public SubDetailComponent(PositiveIntType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public SubDetailComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (SubdetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public SubdetailAdjudicationComponent addAdjudication() { //3 - SubdetailAdjudicationComponent t = new SubdetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addAdjudication(SubdetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // SubdetailAdjudicationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - break; - case -231349275: // adjudication - this.getAdjudication().add((SubdetailAdjudicationComponent) value); // SubdetailAdjudicationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - else if (name.equals("adjudication")) - this.getAdjudication().add((SubdetailAdjudicationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case -231349275: return addAdjudication(); // SubdetailAdjudicationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else - return super.addChild(name); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (SubdetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(adjudication, o.adjudication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (adjudication == null || adjudication.isEmpty()) - ; - } - - public String fhirType() { - return "ClaimResponse.item.detail.subDetail"; - - } - - } - - @Block() - public static class SubdetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monetary amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public SubdetailAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public SubdetailAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public SubdetailAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public SubdetailAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monetary amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monetary amount associated with the code.) - */ - public SubdetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubdetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SubdetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubdetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubdetailAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubdetailAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); - } - else - return super.addChild(name); - } - - public SubdetailAdjudicationComponent copy() { - SubdetailAdjudicationComponent dst = new SubdetailAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubdetailAdjudicationComponent)) - return false; - SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubdetailAdjudicationComponent)) - return false; - SubdetailAdjudicationComponent o = (SubdetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.item.detail.subDetail.adjudication"; - - } - - } - - @Block() - public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * List of input service items which this service line is intended to replace. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) - protected List sequenceLinkId; - - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * A list of note references to the notes provided below. - */ - @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumberLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for payor added services. - */ - @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) - protected List detail; - - private static final long serialVersionUID = -1675935854L; - - /** - * Constructor - */ - public AddedItemComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public List getSequenceLinkId() { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkId() { - if (this.sequenceLinkId == null) - return false; - for (PositiveIntType item : this.sequenceLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - // syntactic sugar - public PositiveIntType addSequenceLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return t; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public AddedItemComponent addSequenceLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return this; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public boolean hasSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - return false; - for (PositiveIntType v : this.sequenceLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); // cc - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public List getNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - return this.noteNumberLinkId; - } - - public boolean hasNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - return false; - for (PositiveIntType item : this.noteNumberLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public PositiveIntType addNoteNumberLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return t; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public AddedItemComponent addNoteNumberLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return this; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumberLinkId(int value) { - if (this.noteNumberLinkId == null) - return false; - for (PositiveIntType v : this.noteNumberLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemAdjudicationComponent addAdjudication() { //3 - AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (AddedItemsDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemsDetailComponent addDetail() { //3 - AddedItemsDetailComponent t = new AddedItemsDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money - case -1859667856: /*noteNumberLinkId*/ return this.noteNumberLinkId == null ? new Base[0] : this.noteNumberLinkId.toArray(new Base[this.noteNumberLinkId.size()]); // PositiveIntType - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemAdjudicationComponent - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AddedItemsDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 101254: // fee - this.fee = castToMoney(value); // Money - break; - case -1859667856: // noteNumberLinkId - this.getNoteNumberLinkId().add(castToPositiveInt(value)); // PositiveIntType - break; - case -231349275: // adjudication - this.getAdjudication().add((AddedItemAdjudicationComponent) value); // AddedItemAdjudicationComponent - break; - case -1335224239: // detail - this.getDetail().add((AddedItemsDetailComponent) value); // AddedItemsDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.getSequenceLinkId().add(castToPositiveInt(value)); - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("fee")) - this.fee = castToMoney(value); // Money - else if (name.equals("noteNumberLinkId")) - this.getNoteNumberLinkId().add(castToPositiveInt(value)); - else if (name.equals("adjudication")) - this.getAdjudication().add((AddedItemAdjudicationComponent) value); - else if (name.equals("detail")) - this.getDetail().add((AddedItemsDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case 1984153269: return getService(); // Coding - case 101254: return getFee(); // Money - case -1859667856: throw new FHIRException("Cannot make property noteNumberLinkId as it is not a complex type"); // PositiveIntType - case -231349275: return addAdjudication(); // AddedItemAdjudicationComponent - case -1335224239: return addDetail(); // AddedItemsDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("fee")) { - this.fee = new Money(); - return this.fee; - } - else if (name.equals("noteNumberLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.noteNumberLinkId"); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public AddedItemComponent copy() { - AddedItemComponent dst = new AddedItemComponent(); - copyValues(dst); - if (sequenceLinkId != null) { - dst.sequenceLinkId = new ArrayList(); - for (PositiveIntType i : sequenceLinkId) - dst.sequenceLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (noteNumberLinkId != null) { - dst.noteNumberLinkId = new ArrayList(); - for (PositiveIntType i : noteNumberLinkId) - dst.noteNumberLinkId.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (AddedItemsDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemComponent)) - return false; - AddedItemComponent o = (AddedItemComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true) - && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true) - && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemComponent)) - return false; - AddedItemComponent o = (AddedItemComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) - && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - public String fhirType() { - return "ClaimResponse.addItem"; - - } - - } - - @Block() - public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monetary amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public AddedItemAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public AddedItemAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public AddedItemAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monetary amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monetary amount associated with the code.) - */ - public AddedItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); - } - else - return super.addChild(name); - } - - public AddedItemAdjudicationComponent copy() { - AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemAdjudicationComponent)) - return false; - AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemAdjudicationComponent)) - return false; - AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.addItem.adjudication"; - - } - - } - - @Block() - public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = -2104242020L; - - /** - * Constructor - */ - public AddedItemsDetailComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemsDetailComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemsDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); // cc - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemsDetailComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemDetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemDetailAdjudicationComponent addAdjudication() { //3 - AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemDetailAdjudicationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 101254: // fee - this.fee = castToMoney(value); // Money - break; - case -231349275: // adjudication - this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); // AddedItemDetailAdjudicationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("fee")) - this.fee = castToMoney(value); // Money - else if (name.equals("adjudication")) - this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1984153269: return getService(); // Coding - case 101254: return getFee(); // Money - case -231349275: return addAdjudication(); // AddedItemDetailAdjudicationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("fee")) { - this.fee = new Money(); - return this.fee; - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else - return super.addChild(name); - } - - public AddedItemsDetailComponent copy() { - AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); - copyValues(dst); - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemDetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemsDetailComponent)) - return false; - AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; - return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemsDetailComponent)) - return false; - AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) - && (adjudication == null || adjudication.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.addItem.detail"; - - } - - } - - @Block() - public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monetary amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monetary amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monetary value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public AddedItemDetailAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemDetailAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.) - */ - public AddedItemDetailAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public AddedItemDetailAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monetary amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monetary amount associated with the code.) - */ - public AddedItemDetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductible, eligible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monetary amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.value"); - } - else - return super.addChild(name); - } - - public AddedItemDetailAdjudicationComponent copy() { - AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemDetailAdjudicationComponent)) - return false; - AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemDetailAdjudicationComponent)) - return false; - AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.addItem.detail.adjudication"; - - } - - } - - @Block() - public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Item sequence number", formalDefinition="The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere." ) - protected PositiveIntType sequenceLinkId; - - /** - * The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - */ - @Child(name = "detailSequenceLinkId", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Detail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition." ) - protected PositiveIntType detailSequenceLinkId; - - /** - * The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - */ - @Child(name = "subdetailSequenceLinkId", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Subdetail sequence number", formalDefinition="The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition." ) - protected PositiveIntType subdetailSequenceLinkId; - - /** - * An error code,from a specified code system, which details why the claim could not be adjudicated. - */ - @Child(name = "code", type = {Coding.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the claim could not be adjudicated." ) - protected Coding code; - - private static final long serialVersionUID = -1893641175L; - - /** - * Constructor - */ - public ErrorsComponent() { - super(); - } - - /** - * Constructor - */ - public ErrorsComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new PositiveIntType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setSequenceLinkIdElement(PositiveIntType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere. - */ - public ErrorsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new PositiveIntType(); - this.sequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getDetailSequenceLinkIdElement() { - if (this.detailSequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.detailSequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.detailSequenceLinkId = new PositiveIntType(); // bb - return this.detailSequenceLinkId; - } - - public boolean hasDetailSequenceLinkIdElement() { - return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); - } - - public boolean hasDetailSequenceLinkId() { - return this.detailSequenceLinkId != null && !this.detailSequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #detailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getDetailSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setDetailSequenceLinkIdElement(PositiveIntType value) { - this.detailSequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - */ - public int getDetailSequenceLinkId() { - return this.detailSequenceLinkId == null || this.detailSequenceLinkId.isEmpty() ? 0 : this.detailSequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - */ - public ErrorsComponent setDetailSequenceLinkId(int value) { - if (this.detailSequenceLinkId == null) - this.detailSequenceLinkId = new PositiveIntType(); - this.detailSequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value - */ - public PositiveIntType getSubdetailSequenceLinkIdElement() { - if (this.subdetailSequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.subdetailSequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.subdetailSequenceLinkId = new PositiveIntType(); // bb - return this.subdetailSequenceLinkId; - } - - public boolean hasSubdetailSequenceLinkIdElement() { - return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); - } - - public boolean hasSubdetailSequenceLinkId() { - return this.subdetailSequenceLinkId != null && !this.subdetailSequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #subdetailSequenceLinkId} (The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.). This is the underlying object with id, value and extensions. The accessor "getSubdetailSequenceLinkId" gives direct access to the value - */ - public ErrorsComponent setSubdetailSequenceLinkIdElement(PositiveIntType value) { - this.subdetailSequenceLinkId = value; - return this; - } - - /** - * @return The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - */ - public int getSubdetailSequenceLinkId() { - return this.subdetailSequenceLinkId == null || this.subdetailSequenceLinkId.isEmpty() ? 0 : this.subdetailSequenceLinkId.getValue(); - } - - /** - * @param value The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition. - */ - public ErrorsComponent setSubdetailSequenceLinkId(int value) { - if (this.subdetailSequenceLinkId == null) - this.subdetailSequenceLinkId = new PositiveIntType(); - this.subdetailSequenceLinkId.setValue(value); - return this; - } - - /** - * @return {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (An error code,from a specified code system, which details why the claim could not be adjudicated.) - */ - public ErrorsComponent setCode(Coding value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "The sequence number of the line item submitted which contains the error. This value is omitted when the error is elsewhere.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("detailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, detailSequenceLinkId)); - childrenList.add(new Property("subdetailSequenceLinkId", "positiveInt", "The sequence number of the addition within the line item submitted which contains the error. This value is omitted when the error is not related to an Addition.", 0, java.lang.Integer.MAX_VALUE, subdetailSequenceLinkId)); - childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the claim could not be adjudicated.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // PositiveIntType - case 516748423: /*detailSequenceLinkId*/ return this.detailSequenceLinkId == null ? new Base[0] : new Base[] {this.detailSequenceLinkId}; // PositiveIntType - case -1061088569: /*subdetailSequenceLinkId*/ return this.subdetailSequenceLinkId == null ? new Base[0] : new Base[] {this.subdetailSequenceLinkId}; // PositiveIntType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - break; - case 516748423: // detailSequenceLinkId - this.detailSequenceLinkId = castToPositiveInt(value); // PositiveIntType - break; - case -1061088569: // subdetailSequenceLinkId - this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType - break; - case 3059181: // code - this.code = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.sequenceLinkId = castToPositiveInt(value); // PositiveIntType - else if (name.equals("detailSequenceLinkId")) - this.detailSequenceLinkId = castToPositiveInt(value); // PositiveIntType - else if (name.equals("subdetailSequenceLinkId")) - this.subdetailSequenceLinkId = castToPositiveInt(value); // PositiveIntType - else if (name.equals("code")) - this.code = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case 516748423: throw new FHIRException("Cannot make property detailSequenceLinkId as it is not a complex type"); // PositiveIntType - case -1061088569: throw new FHIRException("Cannot make property subdetailSequenceLinkId as it is not a complex type"); // PositiveIntType - case 3059181: return getCode(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequenceLinkId"); - } - else if (name.equals("detailSequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.detailSequenceLinkId"); - } - else if (name.equals("subdetailSequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.subdetailSequenceLinkId"); - } - else if (name.equals("code")) { - this.code = new Coding(); - return this.code; - } - else - return super.addChild(name); - } - - public ErrorsComponent copy() { - ErrorsComponent dst = new ErrorsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - dst.detailSequenceLinkId = detailSequenceLinkId == null ? null : detailSequenceLinkId.copy(); - dst.subdetailSequenceLinkId = subdetailSequenceLinkId == null ? null : subdetailSequenceLinkId.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ErrorsComponent)) - return false; - ErrorsComponent o = (ErrorsComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(detailSequenceLinkId, o.detailSequenceLinkId, true) - && compareDeep(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true) && compareDeep(code, o.code, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ErrorsComponent)) - return false; - ErrorsComponent o = (ErrorsComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(detailSequenceLinkId, o.detailSequenceLinkId, true) - && compareValues(subdetailSequenceLinkId, o.subdetailSequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (detailSequenceLinkId == null || detailSequenceLinkId.isEmpty()) - && (subdetailSequenceLinkId == null || subdetailSequenceLinkId.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - public String fhirType() { - return "ClaimResponse.error"; - - } - - } - - @Block() - public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An integer associated with each note which may be referred to from each service line item. - */ - @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) - protected PositiveIntType number; - - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Note explanatory text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 1768923951L; - - /** - * Constructor - */ - public NotesComponent() { - super(); - } - - /** - * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public PositiveIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new PositiveIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public NotesComponent setNumberElement(PositiveIntType value) { - this.number = value; - return this; - } - - /** - * @return An integer associated with each note which may be referred to from each service line item. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value An integer associated with each note which may be referred to from each service line item. - */ - public NotesComponent setNumber(int value) { - if (this.number == null) - this.number = new PositiveIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1034364087: // number - this.number = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("number")) - this.number = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("number")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.number"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.text"); - } - else - return super.addChild(name); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareValues(number, o.number, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) - && (text == null || text.isEmpty()); - } - - public String fhirType() { - return "ClaimResponse.note"; - - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line item. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance identifier", formalDefinition="A service line item." ) - protected PositiveIntType sequence; - - /** - * The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - @Child(name = "focal", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Is the focal Coverage", formalDefinition="The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated." ) - protected BooleanType focal; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Type coverage; - - /** - * The contract number of a business agreement which describes the terms and conditions. - */ - @Child(name = "businessArrangement", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preAuthRef; - - /** - * The Coverages adjudication details. - */ - @Child(name = "claimResponse", type = {ClaimResponse.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." ) - protected Reference claimResponse; - - /** - * The actual object that is the target of the reference (The Coverages adjudication details.) - */ - protected ClaimResponse claimResponseTarget; - - private static final long serialVersionUID = -1151494539L; - - /** - * Constructor - */ - public CoverageComponent() { - super(); - } - - /** - * Constructor - */ - public CoverageComponent(PositiveIntType sequence, BooleanType focal, Type coverage) { - super(); - this.sequence = sequence; - this.focal = focal; - this.coverage = coverage; - } - - /** - * @return {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line item.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public CoverageComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line item. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line item. - */ - public CoverageComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public BooleanType getFocalElement() { - if (this.focal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.focal"); - else if (Configuration.doAutoCreate()) - this.focal = new BooleanType(); // bb - return this.focal; - } - - public boolean hasFocalElement() { - return this.focal != null && !this.focal.isEmpty(); - } - - public boolean hasFocal() { - return this.focal != null && !this.focal.isEmpty(); - } - - /** - * @param value {@link #focal} (The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.). This is the underlying object with id, value and extensions. The accessor "getFocal" gives direct access to the value - */ - public CoverageComponent setFocalElement(BooleanType value) { - this.focal = value; - return this; - } - - /** - * @return The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public boolean getFocal() { - return this.focal == null || this.focal.isEmpty() ? false : this.focal.getValue(); - } - - /** - * @param value The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated. - */ - public CoverageComponent setFocal(boolean value) { - if (this.focal == null) - this.focal = new BooleanType(); - this.focal.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Type getCoverage() { - return this.coverage; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Identifier getCoverageIdentifier() throws FHIRException { - if (!(this.coverage instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Identifier) this.coverage; - } - - public boolean hasCoverageIdentifier() { - return this.coverage instanceof Identifier; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverageReference() throws FHIRException { - if (!(this.coverage instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Reference) this.coverage; - } - - public boolean hasCoverageReference() { - return this.coverage instanceof Reference; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Type value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); // bb - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public CoverageComponent setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agreement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agreement which describes the terms and conditions. - */ - public CoverageComponent setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreAuthRef() { - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - return this.preAuthRef; - } - - public boolean hasPreAuthRef() { - if (this.preAuthRef == null) - return false; - for (StringType item : this.preAuthRef) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreAuthRefElement() {//2 - StringType t = new StringType(); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return t; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreAuthRef(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return this; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreAuthRef(String value) { - if (this.preAuthRef == null) - return false; - for (StringType v : this.preAuthRef) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #claimResponse} (The Coverages adjudication details.) - */ - public Reference getClaimResponse() { - if (this.claimResponse == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponse = new Reference(); // cc - return this.claimResponse; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponse(Reference value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public ClaimResponse getClaimResponseTarget() { - if (this.claimResponseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CoverageComponent.claimResponse"); - else if (Configuration.doAutoCreate()) - this.claimResponseTarget = new ClaimResponse(); // aa - return this.claimResponseTarget; - } - - /** - * @param value {@link #claimResponse} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Coverages adjudication details.) - */ - public CoverageComponent setClaimResponseTarget(ClaimResponse value) { - this.claimResponseTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line item.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("focal", "boolean", "The instance number of the Coverage which is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, java.lang.Integer.MAX_VALUE, focal)); - childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); - childrenList.add(new Property("claimResponse", "Reference(ClaimResponse)", "The Coverages adjudication details.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type - case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType - case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType - case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 97604197: // focal - this.focal = castToBoolean(value); // BooleanType - break; - case -351767064: // coverage - this.coverage = (Type) value; // Type - break; - case 259920682: // businessArrangement - this.businessArrangement = castToString(value); // StringType - break; - case 522246568: // preAuthRef - this.getPreAuthRef().add(castToString(value)); // StringType - break; - case 689513629: // claimResponse - this.claimResponse = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("focal")) - this.focal = castToBoolean(value); // BooleanType - else if (name.equals("coverage[x]")) - this.coverage = (Type) value; // Type - else if (name.equals("businessArrangement")) - this.businessArrangement = castToString(value); // StringType - else if (name.equals("preAuthRef")) - this.getPreAuthRef().add(castToString(value)); - else if (name.equals("claimResponse")) - this.claimResponse = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 97604197: throw new FHIRException("Cannot make property focal as it is not a complex type"); // BooleanType - case 227689880: return getCoverage(); // Type - case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType - case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType - case 689513629: return getClaimResponse(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.sequence"); - } - else if (name.equals("focal")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.focal"); - } - else if (name.equals("coverageIdentifier")) { - this.coverage = new Identifier(); - return this.coverage; - } - else if (name.equals("coverageReference")) { - this.coverage = new Reference(); - return this.coverage; - } - else if (name.equals("businessArrangement")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.businessArrangement"); - } - else if (name.equals("preAuthRef")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.preAuthRef"); - } - else if (name.equals("claimResponse")) { - this.claimResponse = new Reference(); - return this.claimResponse; - } - else - return super.addChild(name); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.focal = focal == null ? null : focal.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - if (preAuthRef != null) { - dst.preAuthRef = new ArrayList(); - for (StringType i : preAuthRef) - dst.preAuthRef.add(i.copy()); - }; - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true) - && compareDeep(claimResponse, o.claimResponse, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(focal, o.focal, true) && compareValues(businessArrangement, o.businessArrangement, true) - && compareValues(preAuthRef, o.preAuthRef, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (focal == null || focal.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (preAuthRef == null || preAuthRef.isEmpty()) && (claimResponse == null || claimResponse.isEmpty()) - ; - } - - public String fhirType() { - return "ClaimResponse.coverage"; - - } - - } - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Response number", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * Original request resource referrence. - */ - @Child(name = "request", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Id of resource triggering adjudication", formalDefinition="Original request resource referrence." ) - protected Type request; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Type organization; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type requestProvider; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type requestOrganization; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "payeeType", type = {Coding.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Party to be paid any benefits payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Coding payeeType; - - /** - * The first tier service adjudications for submitted services. - */ - @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Line items", formalDefinition="The first tier service adjudications for submitted services." ) - protected List item; - - /** - * The first tier service adjudications for payor added services. - */ - @Child(name = "addItem", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) - protected List addItem; - - /** - * Mutually exclusive with Services Provided (Item). - */ - @Child(name = "error", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) - protected List error; - - /** - * The total cost of the services reported. - */ - @Child(name = "totalCost", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) - protected Money totalCost; - - /** - * The amount of deductible applied which was not allocated to any particular service line. - */ - @Child(name = "unallocDeductable", type = {Money.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unallocated deductible", formalDefinition="The amount of deductible applied which was not allocated to any particular service line." ) - protected Money unallocDeductable; - - /** - * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible). - */ - @Child(name = "totalBenefit", type = {Money.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible)." ) - protected Money totalBenefit; - - /** - * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. - */ - @Child(name = "paymentAdjustment", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) - protected Money paymentAdjustment; - - /** - * Reason for the payment adjustment. - */ - @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=18, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) - protected Coding paymentAdjustmentReason; - - /** - * Estimated payment data. - */ - @Child(name = "paymentDate", type = {DateType.class}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) - protected DateType paymentDate; - - /** - * Payable less any payment adjustment. - */ - @Child(name = "paymentAmount", type = {Money.class}, order=20, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) - protected Money paymentAmount; - - /** - * Payment identifier. - */ - @Child(name = "paymentRef", type = {Identifier.class}, order=21, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifier." ) - protected Identifier paymentRef; - - /** - * Status of funds reservation (For provider, for Patient, None). - */ - @Child(name = "reserved", type = {Coding.class}, order=22, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) - protected Coding reserved; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=23, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Note text. - */ - @Child(name = "note", type = {}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) - protected List note; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name = "coverage", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected List coverage; - - private static final long serialVersionUID = 1381594471L; - - /** - * Constructor - */ - public ClaimResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Original request resource referrence.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource referrence.) - */ - public ClaimResponse setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ClaimResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ClaimResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ClaimResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public ClaimResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public ClaimResponse setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getRequestProvider() { - return this.requestProvider; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getRequestProviderIdentifier() throws FHIRException { - if (!(this.requestProvider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Identifier) this.requestProvider; - } - - public boolean hasRequestProviderIdentifier() { - return this.requestProvider instanceof Identifier; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProviderReference() throws FHIRException { - if (!(this.requestProvider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Reference) this.requestProvider; - } - - public boolean hasRequestProviderReference() { - return this.requestProvider instanceof Reference; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestProvider(Type value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Type getRequestOrganization() { - return this.requestOrganization; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getRequestOrganizationIdentifier() throws FHIRException { - if (!(this.requestOrganization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Identifier) this.requestOrganization; - } - - public boolean hasRequestOrganizationIdentifier() { - return this.requestOrganization instanceof Identifier; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganizationReference() throws FHIRException { - if (!(this.requestOrganization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Reference) this.requestOrganization; - } - - public boolean hasRequestOrganizationReference() { - return this.requestOrganization instanceof Reference; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ClaimResponse setRequestOrganization(Type value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public ClaimResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public ClaimResponse setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ClaimResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public ClaimResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getPayeeType() { - if (this.payeeType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.payeeType"); - else if (Configuration.doAutoCreate()) - this.payeeType = new Coding(); // cc - return this.payeeType; - } - - public boolean hasPayeeType() { - return this.payeeType != null && !this.payeeType.isEmpty(); - } - - /** - * @param value {@link #payeeType} (Party to be reimbursed: Subscriber, provider, other.) - */ - public ClaimResponse setPayeeType(Coding value) { - this.payeeType = value; - return this; - } - - /** - * @return {@link #item} (The first tier service adjudications for submitted services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (The first tier service adjudications for submitted services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #addItem} (The first tier service adjudications for payor added services.) - */ - public List getAddItem() { - if (this.addItem == null) - this.addItem = new ArrayList(); - return this.addItem; - } - - public boolean hasAddItem() { - if (this.addItem == null) - return false; - for (AddedItemComponent item : this.addItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #addItem} (The first tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemComponent addAddItem() { //3 - AddedItemComponent t = new AddedItemComponent(); - if (this.addItem == null) - this.addItem = new ArrayList(); - this.addItem.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addAddItem(AddedItemComponent t) { //3 - if (t == null) - return this; - if (this.addItem == null) - this.addItem = new ArrayList(); - this.addItem.add(t); - return this; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (ErrorsComponent item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - // syntactic sugar - public ErrorsComponent addError() { //3 - ErrorsComponent t = new ErrorsComponent(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addError(ErrorsComponent t) { //3 - if (t == null) - return this; - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return this; - } - - /** - * @return {@link #totalCost} (The total cost of the services reported.) - */ - public Money getTotalCost() { - if (this.totalCost == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.totalCost"); - else if (Configuration.doAutoCreate()) - this.totalCost = new Money(); // cc - return this.totalCost; - } - - public boolean hasTotalCost() { - return this.totalCost != null && !this.totalCost.isEmpty(); - } - - /** - * @param value {@link #totalCost} (The total cost of the services reported.) - */ - public ClaimResponse setTotalCost(Money value) { - this.totalCost = value; - return this; - } - - /** - * @return {@link #unallocDeductable} (The amount of deductible applied which was not allocated to any particular service line.) - */ - public Money getUnallocDeductable() { - if (this.unallocDeductable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.unallocDeductable"); - else if (Configuration.doAutoCreate()) - this.unallocDeductable = new Money(); // cc - return this.unallocDeductable; - } - - public boolean hasUnallocDeductable() { - return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); - } - - /** - * @param value {@link #unallocDeductable} (The amount of deductible applied which was not allocated to any particular service line.) - */ - public ClaimResponse setUnallocDeductable(Money value) { - this.unallocDeductable = value; - return this; - } - - /** - * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).) - */ - public Money getTotalBenefit() { - if (this.totalBenefit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.totalBenefit"); - else if (Configuration.doAutoCreate()) - this.totalBenefit = new Money(); // cc - return this.totalBenefit; - } - - public boolean hasTotalBenefit() { - return this.totalBenefit != null && !this.totalBenefit.isEmpty(); - } - - /** - * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).) - */ - public ClaimResponse setTotalBenefit(Money value) { - this.totalBenefit = value; - return this; - } - - /** - * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public Money getPaymentAdjustment() { - if (this.paymentAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustment"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustment = new Money(); // cc - return this.paymentAdjustment; - } - - public boolean hasPaymentAdjustment() { - return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public ClaimResponse setPaymentAdjustment(Money value) { - this.paymentAdjustment = value; - return this; - } - - /** - * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public Coding getPaymentAdjustmentReason() { - if (this.paymentAdjustmentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAdjustmentReason"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustmentReason = new Coding(); // cc - return this.paymentAdjustmentReason; - } - - public boolean hasPaymentAdjustmentReason() { - return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public ClaimResponse setPaymentAdjustmentReason(Coding value) { - this.paymentAdjustmentReason = value; - return this; - } - - /** - * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public DateType getPaymentDateElement() { - if (this.paymentDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentDate"); - else if (Configuration.doAutoCreate()) - this.paymentDate = new DateType(); // bb - return this.paymentDate; - } - - public boolean hasPaymentDateElement() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - public boolean hasPaymentDate() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - /** - * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public ClaimResponse setPaymentDateElement(DateType value) { - this.paymentDate = value; - return this; - } - - /** - * @return Estimated payment data. - */ - public Date getPaymentDate() { - return this.paymentDate == null ? null : this.paymentDate.getValue(); - } - - /** - * @param value Estimated payment data. - */ - public ClaimResponse setPaymentDate(Date value) { - if (value == null) - this.paymentDate = null; - else { - if (this.paymentDate == null) - this.paymentDate = new DateType(); - this.paymentDate.setValue(value); - } - return this; - } - - /** - * @return {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public Money getPaymentAmount() { - if (this.paymentAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentAmount"); - else if (Configuration.doAutoCreate()) - this.paymentAmount = new Money(); // cc - return this.paymentAmount; - } - - public boolean hasPaymentAmount() { - return this.paymentAmount != null && !this.paymentAmount.isEmpty(); - } - - /** - * @param value {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public ClaimResponse setPaymentAmount(Money value) { - this.paymentAmount = value; - return this; - } - - /** - * @return {@link #paymentRef} (Payment identifier.) - */ - public Identifier getPaymentRef() { - if (this.paymentRef == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.paymentRef"); - else if (Configuration.doAutoCreate()) - this.paymentRef = new Identifier(); // cc - return this.paymentRef; - } - - public boolean hasPaymentRef() { - return this.paymentRef != null && !this.paymentRef.isEmpty(); - } - - /** - * @param value {@link #paymentRef} (Payment identifier.) - */ - public ClaimResponse setPaymentRef(Identifier value) { - this.paymentRef = value; - return this; - } - - /** - * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public Coding getReserved() { - if (this.reserved == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.reserved"); - else if (Configuration.doAutoCreate()) - this.reserved = new Coding(); // cc - return this.reserved; - } - - public boolean hasReserved() { - return this.reserved != null && !this.reserved.isEmpty(); - } - - /** - * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public ClaimResponse setReserved(Coding value) { - this.reserved = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClaimResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public ClaimResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #note} (Note text.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Note text.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addNote(NotesComponent t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (CoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - // syntactic sugar - public CoverageComponent addCoverage() { //3 - CoverageComponent t = new CoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - // syntactic sugar - public ClaimResponse addCoverage(CoverageComponent t) { //3 - if (t == null) - return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request[x]", "Identifier|Reference(Claim)", "Original request resource referrence.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("payeeType", "Coding", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, payeeType)); - childrenList.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); - childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); - childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductible applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); - childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductible).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); - childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); - childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); - childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); - childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); - childrenList.add(new Property("paymentRef", "Identifier", "Payment identifier.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); - childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type - case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // Coding - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent - case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent - case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent - case -577782479: /*totalCost*/ return this.totalCost == null ? new Base[0] : new Base[] {this.totalCost}; // Money - case 2096309753: /*unallocDeductable*/ return this.unallocDeductable == null ? new Base[0] : new Base[] {this.unallocDeductable}; // Money - case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money - case 856402963: /*paymentAdjustment*/ return this.paymentAdjustment == null ? new Base[0] : new Base[] {this.paymentAdjustment}; // Money - case -1386508233: /*paymentAdjustmentReason*/ return this.paymentAdjustmentReason == null ? new Base[0] : new Base[] {this.paymentAdjustmentReason}; // Coding - case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType - case 909332990: /*paymentAmount*/ return this.paymentAmount == null ? new Base[0] : new Base[] {this.paymentAmount}; // Money - case 1612875949: /*paymentRef*/ return this.paymentRef == null ? new Base[0] : new Base[] {this.paymentRef}; // Identifier - case -350385368: /*reserved*/ return this.reserved == null ? new Base[0] : new Base[] {this.reserved}; // Coding - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // CoverageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 1601527200: // requestProvider - this.requestProvider = (Type) value; // Type - break; - case 599053666: // requestOrganization - this.requestOrganization = (Type) value; // Type - break; - case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case -316321118: // payeeType - this.payeeType = castToCoding(value); // Coding - break; - case 3242771: // item - this.getItem().add((ItemsComponent) value); // ItemsComponent - break; - case -1148899500: // addItem - this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent - break; - case 96784904: // error - this.getError().add((ErrorsComponent) value); // ErrorsComponent - break; - case -577782479: // totalCost - this.totalCost = castToMoney(value); // Money - break; - case 2096309753: // unallocDeductable - this.unallocDeductable = castToMoney(value); // Money - break; - case 332332211: // totalBenefit - this.totalBenefit = castToMoney(value); // Money - break; - case 856402963: // paymentAdjustment - this.paymentAdjustment = castToMoney(value); // Money - break; - case -1386508233: // paymentAdjustmentReason - this.paymentAdjustmentReason = castToCoding(value); // Coding - break; - case -1540873516: // paymentDate - this.paymentDate = castToDate(value); // DateType - break; - case 909332990: // paymentAmount - this.paymentAmount = castToMoney(value); // Money - break; - case 1612875949: // paymentRef - this.paymentRef = castToIdentifier(value); // Identifier - break; - case -350385368: // reserved - this.reserved = castToCoding(value); // Coding - break; - case 3148996: // form - this.form = castToCoding(value); // Coding - break; - case 3387378: // note - this.getNote().add((NotesComponent) value); // NotesComponent - break; - case -351767064: // coverage - this.getCoverage().add((CoverageComponent) value); // CoverageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("requestProvider[x]")) - this.requestProvider = (Type) value; // Type - else if (name.equals("requestOrganization[x]")) - this.requestOrganization = (Type) value; // Type - else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("payeeType")) - this.payeeType = castToCoding(value); // Coding - else if (name.equals("item")) - this.getItem().add((ItemsComponent) value); - else if (name.equals("addItem")) - this.getAddItem().add((AddedItemComponent) value); - else if (name.equals("error")) - this.getError().add((ErrorsComponent) value); - else if (name.equals("totalCost")) - this.totalCost = castToMoney(value); // Money - else if (name.equals("unallocDeductable")) - this.unallocDeductable = castToMoney(value); // Money - else if (name.equals("totalBenefit")) - this.totalBenefit = castToMoney(value); // Money - else if (name.equals("paymentAdjustment")) - this.paymentAdjustment = castToMoney(value); // Money - else if (name.equals("paymentAdjustmentReason")) - this.paymentAdjustmentReason = castToCoding(value); // Coding - else if (name.equals("paymentDate")) - this.paymentDate = castToDate(value); // DateType - else if (name.equals("paymentAmount")) - this.paymentAmount = castToMoney(value); // Money - else if (name.equals("paymentRef")) - this.paymentRef = castToIdentifier(value); // Identifier - else if (name.equals("reserved")) - this.reserved = castToCoding(value); // Coding - else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("note")) - this.getNote().add((NotesComponent) value); - else if (name.equals("coverage")) - this.getCoverage().add((CoverageComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 37106577: return getRequest(); // Type - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1326483053: return getOrganization(); // Type - case -1694784800: return getRequestProvider(); // Type - case 818740190: return getRequestOrganization(); // Type - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case -316321118: return getPayeeType(); // Coding - case 3242771: return addItem(); // ItemsComponent - case -1148899500: return addAddItem(); // AddedItemComponent - case 96784904: return addError(); // ErrorsComponent - case -577782479: return getTotalCost(); // Money - case 2096309753: return getUnallocDeductable(); // Money - case 332332211: return getTotalBenefit(); // Money - case 856402963: return getPaymentAdjustment(); // Money - case -1386508233: return getPaymentAdjustmentReason(); // Coding - case -1540873516: throw new FHIRException("Cannot make property paymentDate as it is not a complex type"); // DateType - case 909332990: return getPaymentAmount(); // Money - case 1612875949: return getPaymentRef(); // Identifier - case -350385368: return getReserved(); // Coding - case 3148996: return getForm(); // Coding - case 3387378: return addNote(); // NotesComponent - case -351767064: return addCoverage(); // CoverageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.created"); - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestProviderIdentifier")) { - this.requestProvider = new Identifier(); - return this.requestProvider; - } - else if (name.equals("requestProviderReference")) { - this.requestProvider = new Reference(); - return this.requestProvider; - } - else if (name.equals("requestOrganizationIdentifier")) { - this.requestOrganization = new Identifier(); - return this.requestOrganization; - } - else if (name.equals("requestOrganizationReference")) { - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.outcome"); - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.disposition"); - } - else if (name.equals("payeeType")) { - this.payeeType = new Coding(); - return this.payeeType; - } - else if (name.equals("item")) { - return addItem(); - } - else if (name.equals("addItem")) { - return addAddItem(); - } - else if (name.equals("error")) { - return addError(); - } - else if (name.equals("totalCost")) { - this.totalCost = new Money(); - return this.totalCost; - } - else if (name.equals("unallocDeductable")) { - this.unallocDeductable = new Money(); - return this.unallocDeductable; - } - else if (name.equals("totalBenefit")) { - this.totalBenefit = new Money(); - return this.totalBenefit; - } - else if (name.equals("paymentAdjustment")) { - this.paymentAdjustment = new Money(); - return this.paymentAdjustment; - } - else if (name.equals("paymentAdjustmentReason")) { - this.paymentAdjustmentReason = new Coding(); - return this.paymentAdjustmentReason; - } - else if (name.equals("paymentDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.paymentDate"); - } - else if (name.equals("paymentAmount")) { - this.paymentAmount = new Money(); - return this.paymentAmount; - } - else if (name.equals("paymentRef")) { - this.paymentRef = new Identifier(); - return this.paymentRef; - } - else if (name.equals("reserved")) { - this.reserved = new Coding(); - return this.reserved; - } - else if (name.equals("form")) { - this.form = new Coding(); - return this.form; - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("coverage")) { - return addCoverage(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ClaimResponse"; - - } - - public ClaimResponse copy() { - ClaimResponse dst = new ClaimResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.payeeType = payeeType == null ? null : payeeType.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (addItem != null) { - dst.addItem = new ArrayList(); - for (AddedItemComponent i : addItem) - dst.addItem.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (ErrorsComponent i : error) - dst.error.add(i.copy()); - }; - dst.totalCost = totalCost == null ? null : totalCost.copy(); - dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); - dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); - dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); - dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); - dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); - dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); - dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); - dst.reserved = reserved == null ? null : reserved.copy(); - dst.form = form == null ? null : form.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - if (coverage != null) { - dst.coverage = new ArrayList(); - for (CoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - return dst; - } - - protected ClaimResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClaimResponse)) - return false; - ClaimResponse o = (ClaimResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(payeeType, o.payeeType, true) && compareDeep(item, o.item, true) - && compareDeep(addItem, o.addItem, true) && compareDeep(error, o.error, true) && compareDeep(totalCost, o.totalCost, true) - && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) - && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true) - && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true) - && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) - && compareDeep(note, o.note, true) && compareDeep(coverage, o.coverage, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClaimResponse)) - return false; - ClaimResponse o = (ClaimResponse) other; - return compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) - && compareValues(paymentDate, o.paymentDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (payeeType == null || payeeType.isEmpty()) && (item == null || item.isEmpty()) && (addItem == null || addItem.isEmpty()) - && (error == null || error.isEmpty()) && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty()) - && (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty()) - && (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty()) - && (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty()) - && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) - && (coverage == null || coverage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ClaimResponse; - } - - /** - * Search parameter: created - *

- * Description: The creation date
- * Type: date
- * Path: ClaimResponse.created
- *

- */ - @SearchParamDefinition(name="created", path="ClaimResponse.created", description="The creation date", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: The creation date
- * Type: date
- * Path: ClaimResponse.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: requestidentifier - *

- * Description: The claim reference
- * Type: token
- * Path: ClaimResponse.requestIdentifier
- *

- */ - @SearchParamDefinition(name="requestidentifier", path="ClaimResponse.request.as(Identifier)", description="The claim reference", type="token" ) - public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; - /** - * Fluent Client search parameter constant for requestidentifier - *

- * Description: The claim reference
- * Type: token
- * Path: ClaimResponse.requestIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); - - /** - * Search parameter: requestreference - *

- * Description: The claim reference
- * Type: reference
- * Path: ClaimResponse.requestReference
- *

- */ - @SearchParamDefinition(name="requestreference", path="ClaimResponse.request.as(Reference)", description="The claim reference", type="reference" ) - public static final String SP_REQUESTREFERENCE = "requestreference"; - /** - * Fluent Client search parameter constant for requestreference - *

- * Description: The claim reference
- * Type: reference
- * Path: ClaimResponse.requestReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClaimResponse:requestreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("ClaimResponse:requestreference").toLocked(); - - /** - * Search parameter: paymentdate - *

- * Description: The expected paymentDate
- * Type: date
- * Path: ClaimResponse.paymentDate
- *

- */ - @SearchParamDefinition(name="paymentdate", path="ClaimResponse.paymentDate", description="The expected paymentDate", type="date" ) - public static final String SP_PAYMENTDATE = "paymentdate"; - /** - * Fluent Client search parameter constant for paymentdate - *

- * Description: The expected paymentDate
- * Type: date
- * Path: ClaimResponse.paymentDate
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam PAYMENTDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PAYMENTDATE); - - /** - * Search parameter: organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: ClaimResponse.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="ClaimResponse.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: ClaimResponse.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: ClaimResponse.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="ClaimResponse.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: ClaimResponse.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClaimResponse:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ClaimResponse:organizationreference").toLocked(); - - /** - * Search parameter: outcome - *

- * Description: The processing outcome
- * Type: token
- * Path: ClaimResponse.outcome
- *

- */ - @SearchParamDefinition(name="outcome", path="ClaimResponse.outcome", description="The processing outcome", type="token" ) - public static final String SP_OUTCOME = "outcome"; - /** - * Fluent Client search parameter constant for outcome - *

- * Description: The processing outcome
- * Type: token
- * Path: ClaimResponse.outcome
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME); - - /** - * Search parameter: identifier - *

- * Description: The identity of the insurer
- * Type: token
- * Path: ClaimResponse.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ClaimResponse.identifier", description="The identity of the insurer", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identity of the insurer
- * Type: token
- * Path: ClaimResponse.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: ClaimResponse.disposition
- *

- */ - @SearchParamDefinition(name="disposition", path="ClaimResponse.disposition", description="The contents of the disposition message", type="string" ) - public static final String SP_DISPOSITION = "disposition"; - /** - * Fluent Client search parameter constant for disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: ClaimResponse.disposition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java deleted file mode 100644 index 5082c3da424..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ClinicalImpression.java +++ /dev/null @@ -1,2399 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. - */ -@ResourceDef(name="ClinicalImpression", profile="http://hl7.org/fhir/Profile/ClinicalImpression") -public class ClinicalImpression extends DomainResource { - - public enum ClinicalImpressionStatus { - /** - * The assessment is still on-going and results are not yet final. - */ - INPROGRESS, - /** - * The assessment is done and the results are final. - */ - COMPLETED, - /** - * This assessment was never actually done and the record is erroneous (e.g. Wrong patient). - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ClinicalImpressionStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/clinical-impression-status"; - case COMPLETED: return "http://hl7.org/fhir/clinical-impression-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/clinical-impression-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The assessment is still on-going and results are not yet final."; - case COMPLETED: return "The assessment is done and the results are final."; - case ENTEREDINERROR: return "This assessment was never actually done and the record is erroneous (e.g. Wrong patient)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In progress"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class ClinicalImpressionStatusEnumFactory implements EnumFactory { - public ClinicalImpressionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return ClinicalImpressionStatus.INPROGRESS; - if ("completed".equals(codeString)) - return ClinicalImpressionStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return ClinicalImpressionStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, ClinicalImpressionStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, ClinicalImpressionStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, ClinicalImpressionStatus.ENTEREDINERROR); - throw new FHIRException("Unknown ClinicalImpressionStatus code '"+codeString+"'"); - } - public String toCode(ClinicalImpressionStatus code) { - if (code == ClinicalImpressionStatus.INPROGRESS) - return "in-progress"; - if (code == ClinicalImpressionStatus.COMPLETED) - return "completed"; - if (code == ClinicalImpressionStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(ClinicalImpressionStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class ClinicalImpressionInvestigationsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="A name/code for the set", formalDefinition="A name/code for the group (\"set\") of investigations. Typically, this will be something like \"signs\", \"symptoms\", \"clinical\", \"diagnostic\", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used." ) - protected CodeableConcept code; - - /** - * A record of a specific investigation that was undertaken. - */ - @Child(name = "item", type = {Observation.class, QuestionnaireResponse.class, FamilyMemberHistory.class, DiagnosticReport.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Record of a specific investigation", formalDefinition="A record of a specific investigation that was undertaken." ) - protected List item; - /** - * The actual objects that are the target of the reference (A record of a specific investigation that was undertaken.) - */ - protected List itemTarget; - - - private static final long serialVersionUID = -301363326L; - - /** - * Constructor - */ - public ClinicalImpressionInvestigationsComponent() { - super(); - } - - /** - * Constructor - */ - public ClinicalImpressionInvestigationsComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionInvestigationsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A name/code for the group ("set") of investigations. Typically, this will be something like "signs", "symptoms", "clinical", "diagnostic", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.) - */ - public ClinicalImpressionInvestigationsComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #item} (A record of a specific investigation that was undertaken.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (Reference item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (A record of a specific investigation that was undertaken.) - */ - // syntactic sugar - public Reference addItem() { //3 - Reference t = new Reference(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpressionInvestigationsComponent addItem(Reference t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #item} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A record of a specific investigation that was undertaken.) - */ - public List getItemTarget() { - if (this.itemTarget == null) - this.itemTarget = new ArrayList(); - return this.itemTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A name/code for the group (\"set\") of investigations. Typically, this will be something like \"signs\", \"symptoms\", \"clinical\", \"diagnostic\", but the list is not constrained, and others such groups such as (exposure|family|travel|nutitirional) history may be used.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("item", "Reference(Observation|QuestionnaireResponse|FamilyMemberHistory|DiagnosticReport)", "A record of a specific investigation that was undertaken.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 3242771: // item - this.getItem().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("item")) - this.getItem().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case 3242771: return addItem(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public ClinicalImpressionInvestigationsComponent copy() { - ClinicalImpressionInvestigationsComponent dst = new ClinicalImpressionInvestigationsComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (Reference i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpressionInvestigationsComponent)) - return false; - ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; - return compareDeep(code, o.code, true) && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpressionInvestigationsComponent)) - return false; - ClinicalImpressionInvestigationsComponent o = (ClinicalImpressionInvestigationsComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (item == null || item.isEmpty()) - ; - } - - public String fhirType() { - return "ClinicalImpression.investigations"; - - } - - } - - @Block() - public static class ClinicalImpressionFindingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific text of code for finding or diagnosis. - */ - @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specific text or code for finding", formalDefinition="Specific text of code for finding or diagnosis." ) - protected CodeableConcept item; - - /** - * Which investigations support finding or diagnosis. - */ - @Child(name = "cause", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Which investigations support finding", formalDefinition="Which investigations support finding or diagnosis." ) - protected StringType cause; - - private static final long serialVersionUID = -888590978L; - - /** - * Constructor - */ - public ClinicalImpressionFindingComponent() { - super(); - } - - /** - * Constructor - */ - public ClinicalImpressionFindingComponent(CodeableConcept item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Specific text of code for finding or diagnosis.) - */ - public CodeableConcept getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new CodeableConcept(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Specific text of code for finding or diagnosis.) - */ - public ClinicalImpressionFindingComponent setItem(CodeableConcept value) { - this.item = value; - return this; - } - - /** - * @return {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value - */ - public StringType getCauseElement() { - if (this.cause == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionFindingComponent.cause"); - else if (Configuration.doAutoCreate()) - this.cause = new StringType(); // bb - return this.cause; - } - - public boolean hasCauseElement() { - return this.cause != null && !this.cause.isEmpty(); - } - - public boolean hasCause() { - return this.cause != null && !this.cause.isEmpty(); - } - - /** - * @param value {@link #cause} (Which investigations support finding or diagnosis.). This is the underlying object with id, value and extensions. The accessor "getCause" gives direct access to the value - */ - public ClinicalImpressionFindingComponent setCauseElement(StringType value) { - this.cause = value; - return this; - } - - /** - * @return Which investigations support finding or diagnosis. - */ - public String getCause() { - return this.cause == null ? null : this.cause.getValue(); - } - - /** - * @param value Which investigations support finding or diagnosis. - */ - public ClinicalImpressionFindingComponent setCause(String value) { - if (Utilities.noString(value)) - this.cause = null; - else { - if (this.cause == null) - this.cause = new StringType(); - this.cause.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("cause", "string", "Which investigations support finding or diagnosis.", 0, java.lang.Integer.MAX_VALUE, cause)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableConcept - case 94434409: /*cause*/ return this.cause == null ? new Base[0] : new Base[] {this.cause}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3242771: // item - this.item = castToCodeableConcept(value); // CodeableConcept - break; - case 94434409: // cause - this.cause = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("item")) - this.item = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("cause")) - this.cause = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3242771: return getItem(); // CodeableConcept - case 94434409: throw new FHIRException("Cannot make property cause as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("item")) { - this.item = new CodeableConcept(); - return this.item; - } - else if (name.equals("cause")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.cause"); - } - else - return super.addChild(name); - } - - public ClinicalImpressionFindingComponent copy() { - ClinicalImpressionFindingComponent dst = new ClinicalImpressionFindingComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.cause = cause == null ? null : cause.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpressionFindingComponent)) - return false; - ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; - return compareDeep(item, o.item, true) && compareDeep(cause, o.cause, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpressionFindingComponent)) - return false; - ClinicalImpressionFindingComponent o = (ClinicalImpressionFindingComponent) other; - return compareValues(cause, o.cause, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (cause == null || cause.isEmpty()) - ; - } - - public String fhirType() { - return "ClinicalImpression.finding"; - - } - - } - - @Block() - public static class ClinicalImpressionRuledOutComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific text of code for diagnosis. - */ - @Child(name = "item", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specific text of code for diagnosis", formalDefinition="Specific text of code for diagnosis." ) - protected CodeableConcept item; - - /** - * Grounds for elimination. - */ - @Child(name = "reason", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Grounds for elimination", formalDefinition="Grounds for elimination." ) - protected StringType reason; - - private static final long serialVersionUID = -1001661243L; - - /** - * Constructor - */ - public ClinicalImpressionRuledOutComponent() { - super(); - } - - /** - * Constructor - */ - public ClinicalImpressionRuledOutComponent(CodeableConcept item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Specific text of code for diagnosis.) - */ - public CodeableConcept getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new CodeableConcept(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Specific text of code for diagnosis.) - */ - public ClinicalImpressionRuledOutComponent setItem(CodeableConcept value) { - this.item = value; - return this; - } - - /** - * @return {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public StringType getReasonElement() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpressionRuledOutComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new StringType(); // bb - return this.reason; - } - - public boolean hasReasonElement() { - return this.reason != null && !this.reason.isEmpty(); - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Grounds for elimination.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public ClinicalImpressionRuledOutComponent setReasonElement(StringType value) { - this.reason = value; - return this; - } - - /** - * @return Grounds for elimination. - */ - public String getReason() { - return this.reason == null ? null : this.reason.getValue(); - } - - /** - * @param value Grounds for elimination. - */ - public ClinicalImpressionRuledOutComponent setReason(String value) { - if (Utilities.noString(value)) - this.reason = null; - else { - if (this.reason == null) - this.reason = new StringType(); - this.reason.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item", "CodeableConcept", "Specific text of code for diagnosis.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("reason", "string", "Grounds for elimination.", 0, java.lang.Integer.MAX_VALUE, reason)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // CodeableConcept - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3242771: // item - this.item = castToCodeableConcept(value); // CodeableConcept - break; - case -934964668: // reason - this.reason = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("item")) - this.item = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("reason")) - this.reason = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3242771: return getItem(); // CodeableConcept - case -934964668: throw new FHIRException("Cannot make property reason as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("item")) { - this.item = new CodeableConcept(); - return this.item; - } - else if (name.equals("reason")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.reason"); - } - else - return super.addChild(name); - } - - public ClinicalImpressionRuledOutComponent copy() { - ClinicalImpressionRuledOutComponent dst = new ClinicalImpressionRuledOutComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.reason = reason == null ? null : reason.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpressionRuledOutComponent)) - return false; - ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; - return compareDeep(item, o.item, true) && compareDeep(reason, o.reason, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpressionRuledOutComponent)) - return false; - ClinicalImpressionRuledOutComponent o = (ClinicalImpressionRuledOutComponent) other; - return compareValues(reason, o.reason, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (reason == null || reason.isEmpty()) - ; - } - - public String fhirType() { - return "ClinicalImpression.ruledOut"; - - } - - } - - /** - * The patient being assessed. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The patient being assessed", formalDefinition="The patient being assessed." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient being assessed.) - */ - protected Patient patientTarget; - - /** - * The clinician performing the assessment. - */ - @Child(name = "assessor", type = {Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The clinician performing the assessment", formalDefinition="The clinician performing the assessment." ) - protected Reference assessor; - - /** - * The actual object that is the target of the reference (The clinician performing the assessment.) - */ - protected Practitioner assessorTarget; - - /** - * Identifies the workflow status of the assessment. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | completed | entered-in-error", formalDefinition="Identifies the workflow status of the assessment." ) - protected Enumeration status; - - /** - * The point in time at which the assessment was concluded (not when it was recorded). - */ - @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the assessment occurred", formalDefinition="The point in time at which the assessment was concluded (not when it was recorded)." ) - protected DateTimeType date; - - /** - * A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why/how the assessment was performed", formalDefinition="A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it." ) - protected StringType description; - - /** - * A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes. - */ - @Child(name = "previous", type = {ClinicalImpression.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reference to last assessment", formalDefinition="A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes." ) - protected Reference previous; - - /** - * The actual object that is the target of the reference (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - protected ClinicalImpression previousTarget; - - /** - * This a list of the general problems/conditions for a patient. - */ - @Child(name = "problem", type = {Condition.class, AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="General assessment of patient state", formalDefinition="This a list of the general problems/conditions for a patient." ) - protected List problem; - /** - * The actual objects that are the target of the reference (This a list of the general problems/conditions for a patient.) - */ - protected List problemTarget; - - - /** - * The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource. - */ - @Child(name = "trigger", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Request or event that necessitated this assessment", formalDefinition="The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource." ) - protected Type trigger; - - /** - * One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes. - */ - @Child(name = "investigations", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="One or more sets of investigations (signs, symptions, etc.)", formalDefinition="One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes." ) - protected List investigations; - - /** - * Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - @Child(name = "protocol", type = {UriType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Clinical Protocol followed", formalDefinition="Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis." ) - protected UriType protocol; - - /** - * A text summary of the investigations and the diagnosis. - */ - @Child(name = "summary", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Summary of the assessment", formalDefinition="A text summary of the investigations and the diagnosis." ) - protected StringType summary; - - /** - * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. - */ - @Child(name = "finding", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Possible or likely findings and diagnoses", formalDefinition="Specific findings or diagnoses that was considered likely or relevant to ongoing treatment." ) - protected List finding; - - /** - * Diagnoses/conditions resolved since the last assessment. - */ - @Child(name = "resolved", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Diagnoses/conditions resolved since previous assessment", formalDefinition="Diagnoses/conditions resolved since the last assessment." ) - protected List resolved; - - /** - * Diagnosis considered not possible. - */ - @Child(name = "ruledOut", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Diagnosis considered not possible", formalDefinition="Diagnosis considered not possible." ) - protected List ruledOut; - - /** - * Estimate of likely outcome. - */ - @Child(name = "prognosis", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Estimate of likely outcome", formalDefinition="Estimate of likely outcome." ) - protected StringType prognosis; - - /** - * Plan of action after assessment. - */ - @Child(name = "plan", type = {CarePlan.class, Appointment.class, CommunicationRequest.class, DeviceUseRequest.class, DiagnosticOrder.class, MedicationOrder.class, NutritionOrder.class, Order.class, ProcedureRequest.class, ProcessRequest.class, ReferralRequest.class, SupplyRequest.class, VisionPrescription.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Plan of action after assessment", formalDefinition="Plan of action after assessment." ) - protected List plan; - /** - * The actual objects that are the target of the reference (Plan of action after assessment.) - */ - protected List planTarget; - - - /** - * Actions taken during assessment. - */ - @Child(name = "action", type = {ReferralRequest.class, ProcedureRequest.class, Procedure.class, MedicationOrder.class, DiagnosticOrder.class, NutritionOrder.class, SupplyRequest.class, Appointment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Actions taken during assessment", formalDefinition="Actions taken during assessment." ) - protected List action; - /** - * The actual objects that are the target of the reference (Actions taken during assessment.) - */ - protected List actionTarget; - - - private static final long serialVersionUID = 1650458630L; - - /** - * Constructor - */ - public ClinicalImpression() { - super(); - } - - /** - * Constructor - */ - public ClinicalImpression(Reference patient, Enumeration status) { - super(); - this.patient = patient; - this.status = status; - } - - /** - * @return {@link #patient} (The patient being assessed.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient being assessed.) - */ - public ClinicalImpression setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient being assessed.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient being assessed.) - */ - public ClinicalImpression setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #assessor} (The clinician performing the assessment.) - */ - public Reference getAssessor() { - if (this.assessor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.assessor"); - else if (Configuration.doAutoCreate()) - this.assessor = new Reference(); // cc - return this.assessor; - } - - public boolean hasAssessor() { - return this.assessor != null && !this.assessor.isEmpty(); - } - - /** - * @param value {@link #assessor} (The clinician performing the assessment.) - */ - public ClinicalImpression setAssessor(Reference value) { - this.assessor = value; - return this; - } - - /** - * @return {@link #assessor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.) - */ - public Practitioner getAssessorTarget() { - if (this.assessorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.assessor"); - else if (Configuration.doAutoCreate()) - this.assessorTarget = new Practitioner(); // aa - return this.assessorTarget; - } - - /** - * @param value {@link #assessor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The clinician performing the assessment.) - */ - public ClinicalImpression setAssessorTarget(Practitioner value) { - this.assessorTarget = value; - return this; - } - - /** - * @return {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Identifies the workflow status of the assessment.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ClinicalImpression setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Identifies the workflow status of the assessment. - */ - public ClinicalImpressionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Identifies the workflow status of the assessment. - */ - public ClinicalImpression setStatus(ClinicalImpressionStatus value) { - if (this.status == null) - this.status = new Enumeration(new ClinicalImpressionStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The point in time at which the assessment was concluded (not when it was recorded).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ClinicalImpression setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The point in time at which the assessment was concluded (not when it was recorded). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The point in time at which the assessment was concluded (not when it was recorded). - */ - public ClinicalImpression setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ClinicalImpression setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it. - */ - public ClinicalImpression setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public Reference getPrevious() { - if (this.previous == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.previous"); - else if (Configuration.doAutoCreate()) - this.previous = new Reference(); // cc - return this.previous; - } - - public boolean hasPrevious() { - return this.previous != null && !this.previous.isEmpty(); - } - - /** - * @param value {@link #previous} (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalImpression setPrevious(Reference value) { - this.previous = value; - return this; - } - - /** - * @return {@link #previous} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalImpression getPreviousTarget() { - if (this.previousTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.previous"); - else if (Configuration.doAutoCreate()) - this.previousTarget = new ClinicalImpression(); // aa - return this.previousTarget; - } - - /** - * @param value {@link #previous} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.) - */ - public ClinicalImpression setPreviousTarget(ClinicalImpression value) { - this.previousTarget = value; - return this; - } - - /** - * @return {@link #problem} (This a list of the general problems/conditions for a patient.) - */ - public List getProblem() { - if (this.problem == null) - this.problem = new ArrayList(); - return this.problem; - } - - public boolean hasProblem() { - if (this.problem == null) - return false; - for (Reference item : this.problem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #problem} (This a list of the general problems/conditions for a patient.) - */ - // syntactic sugar - public Reference addProblem() { //3 - Reference t = new Reference(); - if (this.problem == null) - this.problem = new ArrayList(); - this.problem.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addProblem(Reference t) { //3 - if (t == null) - return this; - if (this.problem == null) - this.problem = new ArrayList(); - this.problem.add(t); - return this; - } - - /** - * @return {@link #problem} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This a list of the general problems/conditions for a patient.) - */ - public List getProblemTarget() { - if (this.problemTarget == null) - this.problemTarget = new ArrayList(); - return this.problemTarget; - } - - /** - * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public Type getTrigger() { - return this.trigger; - } - - /** - * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public CodeableConcept getTriggerCodeableConcept() throws FHIRException { - if (!(this.trigger instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.trigger.getClass().getName()+" was encountered"); - return (CodeableConcept) this.trigger; - } - - public boolean hasTriggerCodeableConcept() { - return this.trigger instanceof CodeableConcept; - } - - /** - * @return {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public Reference getTriggerReference() throws FHIRException { - if (!(this.trigger instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.trigger.getClass().getName()+" was encountered"); - return (Reference) this.trigger; - } - - public boolean hasTriggerReference() { - return this.trigger instanceof Reference; - } - - public boolean hasTrigger() { - return this.trigger != null && !this.trigger.isEmpty(); - } - - /** - * @param value {@link #trigger} (The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.) - */ - public ClinicalImpression setTrigger(Type value) { - this.trigger = value; - return this; - } - - /** - * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) - */ - public List getInvestigations() { - if (this.investigations == null) - this.investigations = new ArrayList(); - return this.investigations; - } - - public boolean hasInvestigations() { - if (this.investigations == null) - return false; - for (ClinicalImpressionInvestigationsComponent item : this.investigations) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #investigations} (One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.) - */ - // syntactic sugar - public ClinicalImpressionInvestigationsComponent addInvestigations() { //3 - ClinicalImpressionInvestigationsComponent t = new ClinicalImpressionInvestigationsComponent(); - if (this.investigations == null) - this.investigations = new ArrayList(); - this.investigations.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addInvestigations(ClinicalImpressionInvestigationsComponent t) { //3 - if (t == null) - return this; - if (this.investigations == null) - this.investigations = new ArrayList(); - this.investigations.add(t); - return this; - } - - /** - * @return {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value - */ - public UriType getProtocolElement() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new UriType(); // bb - return this.protocol; - } - - public boolean hasProtocolElement() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getProtocol" gives direct access to the value - */ - public ClinicalImpression setProtocolElement(UriType value) { - this.protocol = value; - return this; - } - - /** - * @return Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - public String getProtocol() { - return this.protocol == null ? null : this.protocol.getValue(); - } - - /** - * @param value Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis. - */ - public ClinicalImpression setProtocol(String value) { - if (Utilities.noString(value)) - this.protocol = null; - else { - if (this.protocol == null) - this.protocol = new UriType(); - this.protocol.setValue(value); - } - return this; - } - - /** - * @return {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value - */ - public StringType getSummaryElement() { - if (this.summary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.summary"); - else if (Configuration.doAutoCreate()) - this.summary = new StringType(); // bb - return this.summary; - } - - public boolean hasSummaryElement() { - return this.summary != null && !this.summary.isEmpty(); - } - - public boolean hasSummary() { - return this.summary != null && !this.summary.isEmpty(); - } - - /** - * @param value {@link #summary} (A text summary of the investigations and the diagnosis.). This is the underlying object with id, value and extensions. The accessor "getSummary" gives direct access to the value - */ - public ClinicalImpression setSummaryElement(StringType value) { - this.summary = value; - return this; - } - - /** - * @return A text summary of the investigations and the diagnosis. - */ - public String getSummary() { - return this.summary == null ? null : this.summary.getValue(); - } - - /** - * @param value A text summary of the investigations and the diagnosis. - */ - public ClinicalImpression setSummary(String value) { - if (Utilities.noString(value)) - this.summary = null; - else { - if (this.summary == null) - this.summary = new StringType(); - this.summary.setValue(value); - } - return this; - } - - /** - * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) - */ - public List getFinding() { - if (this.finding == null) - this.finding = new ArrayList(); - return this.finding; - } - - public boolean hasFinding() { - if (this.finding == null) - return false; - for (ClinicalImpressionFindingComponent item : this.finding) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #finding} (Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.) - */ - // syntactic sugar - public ClinicalImpressionFindingComponent addFinding() { //3 - ClinicalImpressionFindingComponent t = new ClinicalImpressionFindingComponent(); - if (this.finding == null) - this.finding = new ArrayList(); - this.finding.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addFinding(ClinicalImpressionFindingComponent t) { //3 - if (t == null) - return this; - if (this.finding == null) - this.finding = new ArrayList(); - this.finding.add(t); - return this; - } - - /** - * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) - */ - public List getResolved() { - if (this.resolved == null) - this.resolved = new ArrayList(); - return this.resolved; - } - - public boolean hasResolved() { - if (this.resolved == null) - return false; - for (CodeableConcept item : this.resolved) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resolved} (Diagnoses/conditions resolved since the last assessment.) - */ - // syntactic sugar - public CodeableConcept addResolved() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.resolved == null) - this.resolved = new ArrayList(); - this.resolved.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addResolved(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.resolved == null) - this.resolved = new ArrayList(); - this.resolved.add(t); - return this; - } - - /** - * @return {@link #ruledOut} (Diagnosis considered not possible.) - */ - public List getRuledOut() { - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - return this.ruledOut; - } - - public boolean hasRuledOut() { - if (this.ruledOut == null) - return false; - for (ClinicalImpressionRuledOutComponent item : this.ruledOut) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ruledOut} (Diagnosis considered not possible.) - */ - // syntactic sugar - public ClinicalImpressionRuledOutComponent addRuledOut() { //3 - ClinicalImpressionRuledOutComponent t = new ClinicalImpressionRuledOutComponent(); - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - this.ruledOut.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addRuledOut(ClinicalImpressionRuledOutComponent t) { //3 - if (t == null) - return this; - if (this.ruledOut == null) - this.ruledOut = new ArrayList(); - this.ruledOut.add(t); - return this; - } - - /** - * @return {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value - */ - public StringType getPrognosisElement() { - if (this.prognosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ClinicalImpression.prognosis"); - else if (Configuration.doAutoCreate()) - this.prognosis = new StringType(); // bb - return this.prognosis; - } - - public boolean hasPrognosisElement() { - return this.prognosis != null && !this.prognosis.isEmpty(); - } - - public boolean hasPrognosis() { - return this.prognosis != null && !this.prognosis.isEmpty(); - } - - /** - * @param value {@link #prognosis} (Estimate of likely outcome.). This is the underlying object with id, value and extensions. The accessor "getPrognosis" gives direct access to the value - */ - public ClinicalImpression setPrognosisElement(StringType value) { - this.prognosis = value; - return this; - } - - /** - * @return Estimate of likely outcome. - */ - public String getPrognosis() { - return this.prognosis == null ? null : this.prognosis.getValue(); - } - - /** - * @param value Estimate of likely outcome. - */ - public ClinicalImpression setPrognosis(String value) { - if (Utilities.noString(value)) - this.prognosis = null; - else { - if (this.prognosis == null) - this.prognosis = new StringType(); - this.prognosis.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (Plan of action after assessment.) - */ - public List getPlan() { - if (this.plan == null) - this.plan = new ArrayList(); - return this.plan; - } - - public boolean hasPlan() { - if (this.plan == null) - return false; - for (Reference item : this.plan) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #plan} (Plan of action after assessment.) - */ - // syntactic sugar - public Reference addPlan() { //3 - Reference t = new Reference(); - if (this.plan == null) - this.plan = new ArrayList(); - this.plan.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addPlan(Reference t) { //3 - if (t == null) - return this; - if (this.plan == null) - this.plan = new ArrayList(); - this.plan.add(t); - return this; - } - - /** - * @return {@link #plan} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Plan of action after assessment.) - */ - public List getPlanTarget() { - if (this.planTarget == null) - this.planTarget = new ArrayList(); - return this.planTarget; - } - - /** - * @return {@link #action} (Actions taken during assessment.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (Reference item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Actions taken during assessment.) - */ - // syntactic sugar - public Reference addAction() { //3 - Reference t = new Reference(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public ClinicalImpression addAction(Reference t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #action} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Actions taken during assessment.) - */ - public List getActionTarget() { - if (this.actionTarget == null) - this.actionTarget = new ArrayList(); - return this.actionTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient being assessed.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("assessor", "Reference(Practitioner)", "The clinician performing the assessment.", 0, java.lang.Integer.MAX_VALUE, assessor)); - childrenList.add(new Property("status", "code", "Identifies the workflow status of the assessment.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The point in time at which the assessment was concluded (not when it was recorded).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A summary of the context and/or cause of the assessment - why / where was it peformed, and what patient events/sstatus prompted it.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("previous", "Reference(ClinicalImpression)", "A reference to the last assesment that was conducted bon this patient. Assessments are often/usually ongoing in nature; a care provider (practitioner or team) will make new assessments on an ongoing basis as new data arises or the patient's conditions changes.", 0, java.lang.Integer.MAX_VALUE, previous)); - childrenList.add(new Property("problem", "Reference(Condition|AllergyIntolerance)", "This a list of the general problems/conditions for a patient.", 0, java.lang.Integer.MAX_VALUE, problem)); - childrenList.add(new Property("trigger[x]", "CodeableConcept|Reference(Any)", "The request or event that necessitated this assessment. This may be a diagnosis, a Care Plan, a Request Referral, or some other resource.", 0, java.lang.Integer.MAX_VALUE, trigger)); - childrenList.add(new Property("investigations", "", "One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly depending on the type and context of the assessment. These investigations may include data generated during the assessment process, or data previously generated and recorded that is pertinent to the outcomes.", 0, java.lang.Integer.MAX_VALUE, investigations)); - childrenList.add(new Property("protocol", "uri", "Reference to a specific published clinical protocol that was followed during this assessment, and/or that provides evidence in support of the diagnosis.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("summary", "string", "A text summary of the investigations and the diagnosis.", 0, java.lang.Integer.MAX_VALUE, summary)); - childrenList.add(new Property("finding", "", "Specific findings or diagnoses that was considered likely or relevant to ongoing treatment.", 0, java.lang.Integer.MAX_VALUE, finding)); - childrenList.add(new Property("resolved", "CodeableConcept", "Diagnoses/conditions resolved since the last assessment.", 0, java.lang.Integer.MAX_VALUE, resolved)); - childrenList.add(new Property("ruledOut", "", "Diagnosis considered not possible.", 0, java.lang.Integer.MAX_VALUE, ruledOut)); - childrenList.add(new Property("prognosis", "string", "Estimate of likely outcome.", 0, java.lang.Integer.MAX_VALUE, prognosis)); - childrenList.add(new Property("plan", "Reference(CarePlan|Appointment|CommunicationRequest|DeviceUseRequest|DiagnosticOrder|MedicationOrder|NutritionOrder|Order|ProcedureRequest|ProcessRequest|ReferralRequest|SupplyRequest|VisionPrescription)", "Plan of action after assessment.", 0, java.lang.Integer.MAX_VALUE, plan)); - childrenList.add(new Property("action", "Reference(ReferralRequest|ProcedureRequest|Procedure|MedicationOrder|DiagnosticOrder|NutritionOrder|SupplyRequest|Appointment)", "Actions taken during assessment.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -373213113: /*assessor*/ return this.assessor == null ? new Base[0] : new Base[] {this.assessor}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1273775369: /*previous*/ return this.previous == null ? new Base[0] : new Base[] {this.previous}; // Reference - case -309542241: /*problem*/ return this.problem == null ? new Base[0] : this.problem.toArray(new Base[this.problem.size()]); // Reference - case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : new Base[] {this.trigger}; // Type - case -428294735: /*investigations*/ return this.investigations == null ? new Base[0] : this.investigations.toArray(new Base[this.investigations.size()]); // ClinicalImpressionInvestigationsComponent - case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // UriType - case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : new Base[] {this.summary}; // StringType - case -853173367: /*finding*/ return this.finding == null ? new Base[0] : this.finding.toArray(new Base[this.finding.size()]); // ClinicalImpressionFindingComponent - case -341328904: /*resolved*/ return this.resolved == null ? new Base[0] : this.resolved.toArray(new Base[this.resolved.size()]); // CodeableConcept - case 763913542: /*ruledOut*/ return this.ruledOut == null ? new Base[0] : this.ruledOut.toArray(new Base[this.ruledOut.size()]); // ClinicalImpressionRuledOutComponent - case -972050334: /*prognosis*/ return this.prognosis == null ? new Base[0] : new Base[] {this.prognosis}; // StringType - case 3443497: /*plan*/ return this.plan == null ? new Base[0] : this.plan.toArray(new Base[this.plan.size()]); // Reference - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -373213113: // assessor - this.assessor = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new ClinicalImpressionStatusEnumFactory().fromType(value); // Enumeration - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1273775369: // previous - this.previous = castToReference(value); // Reference - break; - case -309542241: // problem - this.getProblem().add(castToReference(value)); // Reference - break; - case -1059891784: // trigger - this.trigger = (Type) value; // Type - break; - case -428294735: // investigations - this.getInvestigations().add((ClinicalImpressionInvestigationsComponent) value); // ClinicalImpressionInvestigationsComponent - break; - case -989163880: // protocol - this.protocol = castToUri(value); // UriType - break; - case -1857640538: // summary - this.summary = castToString(value); // StringType - break; - case -853173367: // finding - this.getFinding().add((ClinicalImpressionFindingComponent) value); // ClinicalImpressionFindingComponent - break; - case -341328904: // resolved - this.getResolved().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 763913542: // ruledOut - this.getRuledOut().add((ClinicalImpressionRuledOutComponent) value); // ClinicalImpressionRuledOutComponent - break; - case -972050334: // prognosis - this.prognosis = castToString(value); // StringType - break; - case 3443497: // plan - this.getPlan().add(castToReference(value)); // Reference - break; - case -1422950858: // action - this.getAction().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("assessor")) - this.assessor = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new ClinicalImpressionStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("previous")) - this.previous = castToReference(value); // Reference - else if (name.equals("problem")) - this.getProblem().add(castToReference(value)); - else if (name.equals("trigger[x]")) - this.trigger = (Type) value; // Type - else if (name.equals("investigations")) - this.getInvestigations().add((ClinicalImpressionInvestigationsComponent) value); - else if (name.equals("protocol")) - this.protocol = castToUri(value); // UriType - else if (name.equals("summary")) - this.summary = castToString(value); // StringType - else if (name.equals("finding")) - this.getFinding().add((ClinicalImpressionFindingComponent) value); - else if (name.equals("resolved")) - this.getResolved().add(castToCodeableConcept(value)); - else if (name.equals("ruledOut")) - this.getRuledOut().add((ClinicalImpressionRuledOutComponent) value); - else if (name.equals("prognosis")) - this.prognosis = castToString(value); // StringType - else if (name.equals("plan")) - this.getPlan().add(castToReference(value)); - else if (name.equals("action")) - this.getAction().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -791418107: return getPatient(); // Reference - case -373213113: return getAssessor(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1273775369: return getPrevious(); // Reference - case -309542241: return addProblem(); // Reference - case 1363514312: return getTrigger(); // Type - case -428294735: return addInvestigations(); // ClinicalImpressionInvestigationsComponent - case -989163880: throw new FHIRException("Cannot make property protocol as it is not a complex type"); // UriType - case -1857640538: throw new FHIRException("Cannot make property summary as it is not a complex type"); // StringType - case -853173367: return addFinding(); // ClinicalImpressionFindingComponent - case -341328904: return addResolved(); // CodeableConcept - case 763913542: return addRuledOut(); // ClinicalImpressionRuledOutComponent - case -972050334: throw new FHIRException("Cannot make property prognosis as it is not a complex type"); // StringType - case 3443497: return addPlan(); // Reference - case -1422950858: return addAction(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("assessor")) { - this.assessor = new Reference(); - return this.assessor; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.status"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.description"); - } - else if (name.equals("previous")) { - this.previous = new Reference(); - return this.previous; - } - else if (name.equals("problem")) { - return addProblem(); - } - else if (name.equals("triggerCodeableConcept")) { - this.trigger = new CodeableConcept(); - return this.trigger; - } - else if (name.equals("triggerReference")) { - this.trigger = new Reference(); - return this.trigger; - } - else if (name.equals("investigations")) { - return addInvestigations(); - } - else if (name.equals("protocol")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.protocol"); - } - else if (name.equals("summary")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.summary"); - } - else if (name.equals("finding")) { - return addFinding(); - } - else if (name.equals("resolved")) { - return addResolved(); - } - else if (name.equals("ruledOut")) { - return addRuledOut(); - } - else if (name.equals("prognosis")) { - throw new FHIRException("Cannot call addChild on a primitive type ClinicalImpression.prognosis"); - } - else if (name.equals("plan")) { - return addPlan(); - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ClinicalImpression"; - - } - - public ClinicalImpression copy() { - ClinicalImpression dst = new ClinicalImpression(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.assessor = assessor == null ? null : assessor.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - dst.previous = previous == null ? null : previous.copy(); - if (problem != null) { - dst.problem = new ArrayList(); - for (Reference i : problem) - dst.problem.add(i.copy()); - }; - dst.trigger = trigger == null ? null : trigger.copy(); - if (investigations != null) { - dst.investigations = new ArrayList(); - for (ClinicalImpressionInvestigationsComponent i : investigations) - dst.investigations.add(i.copy()); - }; - dst.protocol = protocol == null ? null : protocol.copy(); - dst.summary = summary == null ? null : summary.copy(); - if (finding != null) { - dst.finding = new ArrayList(); - for (ClinicalImpressionFindingComponent i : finding) - dst.finding.add(i.copy()); - }; - if (resolved != null) { - dst.resolved = new ArrayList(); - for (CodeableConcept i : resolved) - dst.resolved.add(i.copy()); - }; - if (ruledOut != null) { - dst.ruledOut = new ArrayList(); - for (ClinicalImpressionRuledOutComponent i : ruledOut) - dst.ruledOut.add(i.copy()); - }; - dst.prognosis = prognosis == null ? null : prognosis.copy(); - if (plan != null) { - dst.plan = new ArrayList(); - for (Reference i : plan) - dst.plan.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (Reference i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - protected ClinicalImpression typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ClinicalImpression)) - return false; - ClinicalImpression o = (ClinicalImpression) other; - return compareDeep(patient, o.patient, true) && compareDeep(assessor, o.assessor, true) && compareDeep(status, o.status, true) - && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) && compareDeep(previous, o.previous, true) - && compareDeep(problem, o.problem, true) && compareDeep(trigger, o.trigger, true) && compareDeep(investigations, o.investigations, true) - && compareDeep(protocol, o.protocol, true) && compareDeep(summary, o.summary, true) && compareDeep(finding, o.finding, true) - && compareDeep(resolved, o.resolved, true) && compareDeep(ruledOut, o.ruledOut, true) && compareDeep(prognosis, o.prognosis, true) - && compareDeep(plan, o.plan, true) && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ClinicalImpression)) - return false; - ClinicalImpression o = (ClinicalImpression) other; - return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true) - && compareValues(protocol, o.protocol, true) && compareValues(summary, o.summary, true) && compareValues(prognosis, o.prognosis, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (assessor == null || assessor.isEmpty()) - && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (previous == null || previous.isEmpty()) && (problem == null || problem.isEmpty()) && (trigger == null || trigger.isEmpty()) - && (investigations == null || investigations.isEmpty()) && (protocol == null || protocol.isEmpty()) - && (summary == null || summary.isEmpty()) && (finding == null || finding.isEmpty()) && (resolved == null || resolved.isEmpty()) - && (ruledOut == null || ruledOut.isEmpty()) && (prognosis == null || prognosis.isEmpty()) - && (plan == null || plan.isEmpty()) && (action == null || action.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ClinicalImpression; - } - - /** - * Search parameter: assessor - *

- * Description: The clinician performing the assessment
- * Type: reference
- * Path: ClinicalImpression.assessor
- *

- */ - @SearchParamDefinition(name="assessor", path="ClinicalImpression.assessor", description="The clinician performing the assessment", type="reference" ) - public static final String SP_ASSESSOR = "assessor"; - /** - * Fluent Client search parameter constant for assessor - *

- * Description: The clinician performing the assessment
- * Type: reference
- * Path: ClinicalImpression.assessor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSESSOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ASSESSOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:assessor". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSESSOR = new ca.uhn.fhir.model.api.Include("ClinicalImpression:assessor").toLocked(); - - /** - * Search parameter: trigger - *

- * Description: Request or event that necessitated this assessment
- * Type: reference
- * Path: ClinicalImpression.triggerReference
- *

- */ - @SearchParamDefinition(name="trigger", path="ClinicalImpression.trigger.as(Reference)", description="Request or event that necessitated this assessment", type="reference" ) - public static final String SP_TRIGGER = "trigger"; - /** - * Fluent Client search parameter constant for trigger - *

- * Description: Request or event that necessitated this assessment
- * Type: reference
- * Path: ClinicalImpression.triggerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TRIGGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TRIGGER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:trigger". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TRIGGER = new ca.uhn.fhir.model.api.Include("ClinicalImpression:trigger").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The patient being assessed
- * Type: reference
- * Path: ClinicalImpression.patient
- *

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

- * Description: The patient being assessed
- * Type: reference
- * Path: ClinicalImpression.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ClinicalImpression:patient").toLocked(); - - /** - * Search parameter: plan - *

- * Description: Plan of action after assessment
- * Type: reference
- * Path: ClinicalImpression.plan
- *

- */ - @SearchParamDefinition(name="plan", path="ClinicalImpression.plan", description="Plan of action after assessment", type="reference" ) - public static final String SP_PLAN = "plan"; - /** - * Fluent Client search parameter constant for plan - *

- * Description: Plan of action after assessment
- * Type: reference
- * Path: ClinicalImpression.plan
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PLAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PLAN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:plan". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PLAN = new ca.uhn.fhir.model.api.Include("ClinicalImpression:plan").toLocked(); - - /** - * Search parameter: resolved - *

- * Description: Diagnoses/conditions resolved since previous assessment
- * Type: token
- * Path: ClinicalImpression.resolved
- *

- */ - @SearchParamDefinition(name="resolved", path="ClinicalImpression.resolved", description="Diagnoses/conditions resolved since previous assessment", type="token" ) - public static final String SP_RESOLVED = "resolved"; - /** - * Fluent Client search parameter constant for resolved - *

- * Description: Diagnoses/conditions resolved since previous assessment
- * Type: token
- * Path: ClinicalImpression.resolved
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOLVED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOLVED); - - /** - * Search parameter: trigger-code - *

- * Description: Request or event that necessitated this assessment
- * Type: token
- * Path: ClinicalImpression.triggerCodeableConcept
- *

- */ - @SearchParamDefinition(name="trigger-code", path="ClinicalImpression.trigger.as(CodeableConcept)", description="Request or event that necessitated this assessment", type="token" ) - public static final String SP_TRIGGER_CODE = "trigger-code"; - /** - * Fluent Client search parameter constant for trigger-code - *

- * Description: Request or event that necessitated this assessment
- * Type: token
- * Path: ClinicalImpression.triggerCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TRIGGER_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TRIGGER_CODE); - - /** - * Search parameter: previous - *

- * Description: Reference to last assessment
- * Type: reference
- * Path: ClinicalImpression.previous
- *

- */ - @SearchParamDefinition(name="previous", path="ClinicalImpression.previous", description="Reference to last assessment", type="reference" ) - public static final String SP_PREVIOUS = "previous"; - /** - * Fluent Client search parameter constant for previous - *

- * Description: Reference to last assessment
- * Type: reference
- * Path: ClinicalImpression.previous
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PREVIOUS = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PREVIOUS); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:previous". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PREVIOUS = new ca.uhn.fhir.model.api.Include("ClinicalImpression:previous").toLocked(); - - /** - * Search parameter: status - *

- * Description: in-progress | completed | entered-in-error
- * Type: token
- * Path: ClinicalImpression.status
- *

- */ - @SearchParamDefinition(name="status", path="ClinicalImpression.status", description="in-progress | completed | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: in-progress | completed | entered-in-error
- * Type: token
- * Path: ClinicalImpression.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: action - *

- * Description: Actions taken during assessment
- * Type: reference
- * Path: ClinicalImpression.action
- *

- */ - @SearchParamDefinition(name="action", path="ClinicalImpression.action", description="Actions taken during assessment", type="reference" ) - public static final String SP_ACTION = "action"; - /** - * Fluent Client search parameter constant for action - *

- * Description: Actions taken during assessment
- * Type: reference
- * Path: ClinicalImpression.action
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:action". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTION = new ca.uhn.fhir.model.api.Include("ClinicalImpression:action").toLocked(); - - /** - * Search parameter: finding - *

- * Description: Specific text or code for finding
- * Type: token
- * Path: ClinicalImpression.finding.item
- *

- */ - @SearchParamDefinition(name="finding", path="ClinicalImpression.finding.item", description="Specific text or code for finding", type="token" ) - public static final String SP_FINDING = "finding"; - /** - * Fluent Client search parameter constant for finding - *

- * Description: Specific text or code for finding
- * Type: token
- * Path: ClinicalImpression.finding.item
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FINDING = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FINDING); - - /** - * Search parameter: investigation - *

- * Description: Record of a specific investigation
- * Type: reference
- * Path: ClinicalImpression.investigations.item
- *

- */ - @SearchParamDefinition(name="investigation", path="ClinicalImpression.investigations.item", description="Record of a specific investigation", type="reference" ) - public static final String SP_INVESTIGATION = "investigation"; - /** - * Fluent Client search parameter constant for investigation - *

- * Description: Record of a specific investigation
- * Type: reference
- * Path: ClinicalImpression.investigations.item
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INVESTIGATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INVESTIGATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:investigation". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_INVESTIGATION = new ca.uhn.fhir.model.api.Include("ClinicalImpression:investigation").toLocked(); - - /** - * Search parameter: problem - *

- * Description: General assessment of patient state
- * Type: reference
- * Path: ClinicalImpression.problem
- *

- */ - @SearchParamDefinition(name="problem", path="ClinicalImpression.problem", description="General assessment of patient state", type="reference" ) - public static final String SP_PROBLEM = "problem"; - /** - * Fluent Client search parameter constant for problem - *

- * Description: General assessment of patient state
- * Type: reference
- * Path: ClinicalImpression.problem
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROBLEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROBLEM); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ClinicalImpression:problem". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROBLEM = new ca.uhn.fhir.model.api.Include("ClinicalImpression:problem").toLocked(); - - /** - * Search parameter: date - *

- * Description: When the assessment occurred
- * Type: date
- * Path: ClinicalImpression.date
- *

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

- * Description: When the assessment occurred
- * Type: date
- * Path: ClinicalImpression.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: ruledout - *

- * Description: Specific text of code for diagnosis
- * Type: token
- * Path: ClinicalImpression.ruledOut.item
- *

- */ - @SearchParamDefinition(name="ruledout", path="ClinicalImpression.ruledOut.item", description="Specific text of code for diagnosis", type="token" ) - public static final String SP_RULEDOUT = "ruledout"; - /** - * Fluent Client search parameter constant for ruledout - *

- * Description: Specific text of code for diagnosis
- * Type: token
- * Path: ClinicalImpression.ruledOut.item
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RULEDOUT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RULEDOUT); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeSystem.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeSystem.java deleted file mode 100644 index d00bca3d9db..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeSystem.java +++ /dev/null @@ -1,4082 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A code system resource specifies a set of codes drawn from one or more code systems. - */ -@ResourceDef(name="CodeSystem", profile="http://hl7.org/fhir/Profile/CodeSystem") -public class CodeSystem extends DomainResource { - - public enum CodeSystemContentMode { - /** - * None of the concepts defined by the code system are included in the code system resource - */ - NOTPRESENT, - /** - * A few representative concepts are included in the code system resource - */ - EXAMPLAR, - /** - * A subset of the code system concepts are included in the code system resource - */ - FRAGMENT, - /** - * All the concepts defined by the code system are included in the code system resource - */ - COMPLETE, - /** - * added to help the parsers - */ - NULL; - public static CodeSystemContentMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-present".equals(codeString)) - return NOTPRESENT; - if ("examplar".equals(codeString)) - return EXAMPLAR; - if ("fragment".equals(codeString)) - return FRAGMENT; - if ("complete".equals(codeString)) - return COMPLETE; - throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTPRESENT: return "not-present"; - case EXAMPLAR: return "examplar"; - case FRAGMENT: return "fragment"; - case COMPLETE: return "complete"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTPRESENT: return "http://hl7.org/fhir/codesystem-content-mode"; - case EXAMPLAR: return "http://hl7.org/fhir/codesystem-content-mode"; - case FRAGMENT: return "http://hl7.org/fhir/codesystem-content-mode"; - case COMPLETE: return "http://hl7.org/fhir/codesystem-content-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTPRESENT: return "None of the concepts defined by the code system are included in the code system resource"; - case EXAMPLAR: return "A few representative concepts are included in the code system resource"; - case FRAGMENT: return "A subset of the code system concepts are included in the code system resource"; - case COMPLETE: return "All the concepts defined by the code system are included in the code system resource"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTPRESENT: return "Not Present"; - case EXAMPLAR: return "Examplar"; - case FRAGMENT: return "Fragment"; - case COMPLETE: return "Complete"; - default: return "?"; - } - } - } - - public static class CodeSystemContentModeEnumFactory implements EnumFactory { - public CodeSystemContentMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-present".equals(codeString)) - return CodeSystemContentMode.NOTPRESENT; - if ("examplar".equals(codeString)) - return CodeSystemContentMode.EXAMPLAR; - if ("fragment".equals(codeString)) - return CodeSystemContentMode.FRAGMENT; - if ("complete".equals(codeString)) - return CodeSystemContentMode.COMPLETE; - throw new IllegalArgumentException("Unknown CodeSystemContentMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("not-present".equals(codeString)) - return new Enumeration(this, CodeSystemContentMode.NOTPRESENT); - if ("examplar".equals(codeString)) - return new Enumeration(this, CodeSystemContentMode.EXAMPLAR); - if ("fragment".equals(codeString)) - return new Enumeration(this, CodeSystemContentMode.FRAGMENT); - if ("complete".equals(codeString)) - return new Enumeration(this, CodeSystemContentMode.COMPLETE); - throw new FHIRException("Unknown CodeSystemContentMode code '"+codeString+"'"); - } - public String toCode(CodeSystemContentMode code) { - if (code == CodeSystemContentMode.NOTPRESENT) - return "not-present"; - if (code == CodeSystemContentMode.EXAMPLAR) - return "examplar"; - if (code == CodeSystemContentMode.FRAGMENT) - return "fragment"; - if (code == CodeSystemContentMode.COMPLETE) - return "complete"; - return "?"; - } - public String toSystem(CodeSystemContentMode code) { - return code.getSystem(); - } - } - - public enum PropertyType { - /** - * The property value is a code that identifies a concept defined in the code system - */ - CODE, - /** - * The property value is a code defined in an external code system. This may be used for translations, but is not the intent - */ - CODING, - /** - * The property value is a string - */ - STRING, - /** - * The property value is a string (often used to assign ranking values to concepts for supporting score assessments) - */ - INTEGER, - /** - * The property value is a boolean true | false - */ - BOOLEAN, - /** - * The property is a date or a date + time - */ - DATETIME, - /** - * added to help the parsers - */ - NULL; - public static PropertyType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("code".equals(codeString)) - return CODE; - if ("Coding".equals(codeString)) - return CODING; - if ("string".equals(codeString)) - return STRING; - if ("integer".equals(codeString)) - return INTEGER; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("dateTime".equals(codeString)) - return DATETIME; - throw new FHIRException("Unknown PropertyType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CODE: return "code"; - case CODING: return "Coding"; - case STRING: return "string"; - case INTEGER: return "integer"; - case BOOLEAN: return "boolean"; - case DATETIME: return "dateTime"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CODE: return "http://hl7.org/fhir/concept-property-type"; - case CODING: return "http://hl7.org/fhir/concept-property-type"; - case STRING: return "http://hl7.org/fhir/concept-property-type"; - case INTEGER: return "http://hl7.org/fhir/concept-property-type"; - case BOOLEAN: return "http://hl7.org/fhir/concept-property-type"; - case DATETIME: return "http://hl7.org/fhir/concept-property-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CODE: return "The property value is a code that identifies a concept defined in the code system"; - case CODING: return "The property value is a code defined in an external code system. This may be used for translations, but is not the intent"; - case STRING: return "The property value is a string"; - case INTEGER: return "The property value is a string (often used to assign ranking values to concepts for supporting score assessments)"; - case BOOLEAN: return "The property value is a boolean true | false"; - case DATETIME: return "The property is a date or a date + time"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CODE: return "code (internal reference)"; - case CODING: return "Coding (external reference)"; - case STRING: return "string"; - case INTEGER: return "integer"; - case BOOLEAN: return "boolean"; - case DATETIME: return "dateTime"; - default: return "?"; - } - } - } - - public static class PropertyTypeEnumFactory implements EnumFactory { - public PropertyType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("code".equals(codeString)) - return PropertyType.CODE; - if ("Coding".equals(codeString)) - return PropertyType.CODING; - if ("string".equals(codeString)) - return PropertyType.STRING; - if ("integer".equals(codeString)) - return PropertyType.INTEGER; - if ("boolean".equals(codeString)) - return PropertyType.BOOLEAN; - if ("dateTime".equals(codeString)) - return PropertyType.DATETIME; - throw new IllegalArgumentException("Unknown PropertyType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("code".equals(codeString)) - return new Enumeration(this, PropertyType.CODE); - if ("Coding".equals(codeString)) - return new Enumeration(this, PropertyType.CODING); - if ("string".equals(codeString)) - return new Enumeration(this, PropertyType.STRING); - if ("integer".equals(codeString)) - return new Enumeration(this, PropertyType.INTEGER); - if ("boolean".equals(codeString)) - return new Enumeration(this, PropertyType.BOOLEAN); - if ("dateTime".equals(codeString)) - return new Enumeration(this, PropertyType.DATETIME); - throw new FHIRException("Unknown PropertyType code '"+codeString+"'"); - } - public String toCode(PropertyType code) { - if (code == PropertyType.CODE) - return "code"; - if (code == PropertyType.CODING) - return "Coding"; - if (code == PropertyType.STRING) - return "string"; - if (code == PropertyType.INTEGER) - return "integer"; - if (code == PropertyType.BOOLEAN) - return "boolean"; - if (code == PropertyType.DATETIME) - return "dateTime"; - return "?"; - } - public String toSystem(PropertyType code) { - return code.getSystem(); - } - } - - @Block() - public static class CodeSystemContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the code system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the code system." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public CodeSystemContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeSystemContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the code system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the code system. - */ - public CodeSystemContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public CodeSystemContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the code system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public CodeSystemContactComponent copy() { - CodeSystemContactComponent dst = new CodeSystemContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemContactComponent)) - return false; - CodeSystemContactComponent o = (CodeSystemContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemContactComponent)) - return false; - CodeSystemContactComponent o = (CodeSystemContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "CodeSystem.contact"; - - } - - } - - @Block() - public static class CodeSystemFilterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code that identifies thise filter when it is used in the instance. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Code that identifies the filter", formalDefinition="The code that identifies thise filter when it is used in the instance." ) - protected CodeType code; - - /** - * A description of how or why the filter is used. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How or why the filter is used", formalDefinition="A description of how or why the filter is used." ) - protected StringType description; - - /** - * A list of operators that can be used with the filter. - */ - @Child(name = "operator", type = {CodeType.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Operators that can be used with filter", formalDefinition="A list of operators that can be used with the filter." ) - protected List operator; - - /** - * A description of what the value for the filter should be. - */ - @Child(name = "value", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="What to use for the value", formalDefinition="A description of what the value for the filter should be." ) - protected StringType value; - - private static final long serialVersionUID = 20272432L; - - /** - * Constructor - */ - public CodeSystemFilterComponent() { - super(); - } - - /** - * Constructor - */ - public CodeSystemFilterComponent(CodeType code, StringType value) { - super(); - this.code = code; - this.value = value; - } - - /** - * @return {@link #code} (The code that identifies thise filter when it is used in the instance.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemFilterComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The code that identifies thise filter when it is used in the instance.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeSystemFilterComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return The code that identifies thise filter when it is used in the instance. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The code that identifies thise filter when it is used in the instance. - */ - public CodeSystemFilterComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of how or why the filter is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemFilterComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of how or why the filter is used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public CodeSystemFilterComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of how or why the filter is used. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of how or why the filter is used. - */ - public CodeSystemFilterComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #operator} (A list of operators that can be used with the filter.) - */ - public List getOperator() { - if (this.operator == null) - this.operator = new ArrayList(); - return this.operator; - } - - public boolean hasOperator() { - if (this.operator == null) - return false; - for (CodeType item : this.operator) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operator} (A list of operators that can be used with the filter.) - */ - // syntactic sugar - public CodeType addOperatorElement() {//2 - CodeType t = new CodeType(); - if (this.operator == null) - this.operator = new ArrayList(); - this.operator.add(t); - return t; - } - - /** - * @param value {@link #operator} (A list of operators that can be used with the filter.) - */ - public CodeSystemFilterComponent addOperator(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.operator == null) - this.operator = new ArrayList(); - this.operator.add(t); - return this; - } - - /** - * @param value {@link #operator} (A list of operators that can be used with the filter.) - */ - public boolean hasOperator(String value) { - if (this.operator == null) - return false; - for (CodeType v : this.operator) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #value} (A description of what the value for the filter should be.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemFilterComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A description of what the value for the filter should be.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public CodeSystemFilterComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return A description of what the value for the filter should be. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A description of what the value for the filter should be. - */ - public CodeSystemFilterComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "The code that identifies thise filter when it is used in the instance.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("description", "string", "A description of how or why the filter is used.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("operator", "code", "A list of operators that can be used with the filter.", 0, java.lang.Integer.MAX_VALUE, operator)); - childrenList.add(new Property("value", "string", "A description of what the value for the filter should be.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -500553564: /*operator*/ return this.operator == null ? new Base[0] : this.operator.toArray(new Base[this.operator.size()]); // CodeType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -500553564: // operator - this.getOperator().add(castToCode(value)); // CodeType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("operator")) - this.getOperator().add(castToCode(value)); - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -500553564: throw new FHIRException("Cannot make property operator as it is not a complex type"); // CodeType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description"); - } - else if (name.equals("operator")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.operator"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.value"); - } - else - return super.addChild(name); - } - - public CodeSystemFilterComponent copy() { - CodeSystemFilterComponent dst = new CodeSystemFilterComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.description = description == null ? null : description.copy(); - if (operator != null) { - dst.operator = new ArrayList(); - for (CodeType i : operator) - dst.operator.add(i.copy()); - }; - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemFilterComponent)) - return false; - CodeSystemFilterComponent o = (CodeSystemFilterComponent) other; - return compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(operator, o.operator, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemFilterComponent)) - return false; - CodeSystemFilterComponent o = (CodeSystemFilterComponent) other; - return compareValues(code, o.code, true) && compareValues(description, o.description, true) && compareValues(operator, o.operator, true) - && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) - && (operator == null || operator.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "CodeSystem.filter"; - - } - - } - - @Block() - public static class CodeSystemPropertyComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifies the property, both internally and externally", formalDefinition="A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters." ) - protected CodeType code; - - /** - * A description of the property- why it is defined, and how it's value might be used. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why the property is defined, and/or what it conveys", formalDefinition="A description of the property- why it is defined, and how it's value might be used." ) - protected StringType description; - - /** - * The type of the property value. - */ - @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="code | Coding | string | integer | boolean | dateTime", formalDefinition="The type of the property value." ) - protected Enumeration type; - - private static final long serialVersionUID = -1346176181L; - - /** - * Constructor - */ - public CodeSystemPropertyComponent() { - super(); - } - - /** - * Constructor - */ - public CodeSystemPropertyComponent(CodeType code, Enumeration type) { - super(); - this.code = code; - this.type = type; - } - - /** - * @return {@link #code} (A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemPropertyComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeSystemPropertyComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters. - */ - public CodeSystemPropertyComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of the property- why it is defined, and how it's value might be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemPropertyComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the property- why it is defined, and how it's value might be used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public CodeSystemPropertyComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the property- why it is defined, and how it's value might be used. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the property- why it is defined, and how it's value might be used. - */ - public CodeSystemPropertyComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of the property value.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemPropertyComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new PropertyTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the property value.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeSystemPropertyComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of the property value. - */ - public PropertyType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the property value. - */ - public CodeSystemPropertyComponent setType(PropertyType value) { - if (this.type == null) - this.type = new Enumeration(new PropertyTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "A code that is used to identify the property. The code is used internally (in CodeSystem.concept.property.code) and also externally, such as in property filters.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("description", "string", "A description of the property- why it is defined, and how it's value might be used.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("type", "code", "The type of the property value.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 3575610: // type - this.type = new PropertyTypeEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("type")) - this.type = new PropertyTypeEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.type"); - } - else - return super.addChild(name); - } - - public CodeSystemPropertyComponent copy() { - CodeSystemPropertyComponent dst = new CodeSystemPropertyComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.description = description == null ? null : description.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemPropertyComponent)) - return false; - CodeSystemPropertyComponent o = (CodeSystemPropertyComponent) other; - return compareDeep(code, o.code, true) && compareDeep(description, o.description, true) && compareDeep(type, o.type, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemPropertyComponent)) - return false; - CodeSystemPropertyComponent o = (CodeSystemPropertyComponent) other; - return compareValues(code, o.code, true) && compareValues(description, o.description, true) && compareValues(type, o.type, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) - && (type == null || type.isEmpty()); - } - - public String fhirType() { - return "CodeSystem.property"; - - } - - } - - @Block() - public static class ConceptDefinitionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code - a text symbol - that uniquely identifies the concept within the code system. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code that identifies concept", formalDefinition="A code - a text symbol - that uniquely identifies the concept within the code system." ) - protected CodeType code; - - /** - * A human readable string that is the recommended default way to present this concept to a user. - */ - @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Text to display to the user", formalDefinition="A human readable string that is the recommended default way to present this concept to a user." ) - protected StringType display; - - /** - * The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - @Child(name = "definition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Formal definition", formalDefinition="The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept." ) - protected StringType definition; - - /** - * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc. - */ - @Child(name = "designation", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional representations for the concept", formalDefinition="Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc." ) - protected List designation; - - /** - * A property value for this concept. - */ - @Child(name = "property", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Property value for the concept", formalDefinition="A property value for this concept." ) - protected List property; - - /** - * Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts. - */ - @Child(name = "concept", type = {ConceptDefinitionComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Child Concepts (is-a/contains/categorizes)", formalDefinition="Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts." ) - protected List concept; - - private static final long serialVersionUID = 1495076297L; - - /** - * Constructor - */ - public ConceptDefinitionComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptDefinitionComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code - a text symbol - that uniquely identifies the concept within the code system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptDefinitionComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A code - a text symbol - that uniquely identifies the concept within the code system. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A code - a text symbol - that uniquely identifies the concept within the code system. - */ - public ConceptDefinitionComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (A human readable string that is the recommended default way to present this concept to a user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ConceptDefinitionComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return A human readable string that is the recommended default way to present this concept to a user. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value A human readable string that is the recommended default way to present this concept to a user. - */ - public ConceptDefinitionComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public StringType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new StringType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ConceptDefinitionComponent setDefinitionElement(StringType value) { - this.definition = value; - return this; - } - - /** - * @return The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept. - */ - public ConceptDefinitionComponent setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new StringType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (ConceptDefinitionDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.) - */ - // syntactic sugar - public ConceptDefinitionDesignationComponent addDesignation() { //3 - ConceptDefinitionDesignationComponent t = new ConceptDefinitionDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - // syntactic sugar - public ConceptDefinitionComponent addDesignation(ConceptDefinitionDesignationComponent t) { //3 - if (t == null) - return this; - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return this; - } - - /** - * @return {@link #property} (A property value for this concept.) - */ - public List getProperty() { - if (this.property == null) - this.property = new ArrayList(); - return this.property; - } - - public boolean hasProperty() { - if (this.property == null) - return false; - for (ConceptDefinitionPropertyComponent item : this.property) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #property} (A property value for this concept.) - */ - // syntactic sugar - public ConceptDefinitionPropertyComponent addProperty() { //3 - ConceptDefinitionPropertyComponent t = new ConceptDefinitionPropertyComponent(); - if (this.property == null) - this.property = new ArrayList(); - this.property.add(t); - return t; - } - - // syntactic sugar - public ConceptDefinitionComponent addProperty(ConceptDefinitionPropertyComponent t) { //3 - if (t == null) - return this; - if (this.property == null) - this.property = new ArrayList(); - this.property.add(t); - return this; - } - - /** - * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptDefinitionComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.) - */ - // syntactic sugar - public ConceptDefinitionComponent addConcept() { //3 - ConceptDefinitionComponent t = new ConceptDefinitionComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public ConceptDefinitionComponent addConcept(ConceptDefinitionComponent t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "A code - a text symbol - that uniquely identifies the concept within the code system.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "A human readable string that is the recommended default way to present this concept to a user.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("definition", "string", "The formal definition of the concept. The code system resource does not make formal definitions required, because of the prevalence of legacy systems. However, they are highly recommended, as without them there is no formal meaning associated with the concept.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("designation", "", "Additional representations for the concept - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); - childrenList.add(new Property("property", "", "A property value for this concept.", 0, java.lang.Integer.MAX_VALUE, property)); - childrenList.add(new Property("concept", "@CodeSystem.concept", "Defines children of a concept to produce a hierarchy of concepts. The nature of the relationships is variable (is-a/contains/categorizes) and can only be determined by examining the definitions of the concepts.", 0, java.lang.Integer.MAX_VALUE, concept)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // StringType - case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // ConceptDefinitionDesignationComponent - case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // ConceptDefinitionPropertyComponent - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - case -1014418093: // definition - this.definition = castToString(value); // StringType - break; - case -900931593: // designation - this.getDesignation().add((ConceptDefinitionDesignationComponent) value); // ConceptDefinitionDesignationComponent - break; - case -993141291: // property - this.getProperty().add((ConceptDefinitionPropertyComponent) value); // ConceptDefinitionPropertyComponent - break; - case 951024232: // concept - this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else if (name.equals("definition")) - this.definition = castToString(value); // StringType - else if (name.equals("designation")) - this.getDesignation().add((ConceptDefinitionDesignationComponent) value); - else if (name.equals("property")) - this.getProperty().add((ConceptDefinitionPropertyComponent) value); - else if (name.equals("concept")) - this.getConcept().add((ConceptDefinitionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // StringType - case -900931593: return addDesignation(); // ConceptDefinitionDesignationComponent - case -993141291: return addProperty(); // ConceptDefinitionPropertyComponent - case 951024232: return addConcept(); // ConceptDefinitionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.display"); - } - else if (name.equals("definition")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.definition"); - } - else if (name.equals("designation")) { - return addDesignation(); - } - else if (name.equals("property")) { - return addProperty(); - } - else if (name.equals("concept")) { - return addConcept(); - } - else - return super.addChild(name); - } - - public ConceptDefinitionComponent copy() { - ConceptDefinitionComponent dst = new ConceptDefinitionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - dst.definition = definition == null ? null : definition.copy(); - if (designation != null) { - dst.designation = new ArrayList(); - for (ConceptDefinitionDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - if (property != null) { - dst.property = new ArrayList(); - for (ConceptDefinitionPropertyComponent i : property) - dst.property.add(i.copy()); - }; - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptDefinitionComponent i : concept) - dst.concept.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptDefinitionComponent)) - return false; - ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(definition, o.definition, true) - && compareDeep(designation, o.designation, true) && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptDefinitionComponent)) - return false; - ConceptDefinitionComponent o = (ConceptDefinitionComponent) other; - return compareValues(code, o.code, true) && compareValues(display, o.display, true) && compareValues(definition, o.definition, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (definition == null || definition.isEmpty()) && (designation == null || designation.isEmpty()) - && (property == null || property.isEmpty()) && (concept == null || concept.isEmpty()); - } - - public String fhirType() { - return "CodeSystem.concept"; - - } - - } - - @Block() - public static class ConceptDefinitionDesignationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The language this designation is defined for. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Human language of the designation", formalDefinition="The language this designation is defined for." ) - protected CodeType language; - - /** - * A code that details how this designation would be used. - */ - @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) - protected Coding use; - - /** - * The text value for this designation. - */ - @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) - protected StringType value; - - private static final long serialVersionUID = 1515662414L; - - /** - * Constructor - */ - public ConceptDefinitionDesignationComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptDefinitionDesignationComponent(StringType value) { - super(); - this.value = value; - } - - /** - * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public ConceptDefinitionDesignationComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The language this designation is defined for. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The language this designation is defined for. - */ - public ConceptDefinitionDesignationComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (A code that details how this designation would be used.) - */ - public Coding getUse() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Coding(); // cc - return this.use; - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (A code that details how this designation would be used.) - */ - public ConceptDefinitionDesignationComponent setUse(Coding value) { - this.use = value; - return this; - } - - /** - * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionDesignationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptDefinitionDesignationComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The text value for this designation. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The text value for this designation. - */ - public ConceptDefinitionDesignationComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - case 116103: // use - this.use = castToCoding(value); // Coding - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("language")) - this.language = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = castToCoding(value); // Coding - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - case 116103: return getUse(); // Coding - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.language"); - } - else if (name.equals("use")) { - this.use = new Coding(); - return this.use; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.value"); - } - else - return super.addChild(name); - } - - public ConceptDefinitionDesignationComponent copy() { - ConceptDefinitionDesignationComponent dst = new ConceptDefinitionDesignationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.use = use == null ? null : use.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptDefinitionDesignationComponent)) - return false; - ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptDefinitionDesignationComponent)) - return false; - ConceptDefinitionDesignationComponent o = (ConceptDefinitionDesignationComponent) other; - return compareValues(language, o.language, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) - && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "CodeSystem.concept.designation"; - - } - - } - - @Block() - public static class ConceptDefinitionPropertyComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that is a reference to CodeSystem.property.code. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reference to CodeSystem.property.code", formalDefinition="A code that is a reference to CodeSystem.property.code." ) - protected CodeType code; - - /** - * The value of this property. - */ - @Child(name = "value", type = {CodeType.class, Coding.class, StringType.class, IntegerType.class, BooleanType.class, DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Value of the property for this concept", formalDefinition="The value of this property." ) - protected Type value; - - private static final long serialVersionUID = 1742812311L; - - /** - * Constructor - */ - public ConceptDefinitionPropertyComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptDefinitionPropertyComponent(CodeType code, Type value) { - super(); - this.code = code; - this.value = value; - } - - /** - * @return {@link #code} (A code that is a reference to CodeSystem.property.code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptDefinitionPropertyComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that is a reference to CodeSystem.property.code.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptDefinitionPropertyComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A code that is a reference to CodeSystem.property.code. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A code that is a reference to CodeSystem.property.code. - */ - public ConceptDefinitionPropertyComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public CodeType getValueCodeType() throws FHIRException { - if (!(this.value instanceof CodeType)) - throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeType) this.value; - } - - public boolean hasValueCodeType() { - return this.value instanceof CodeType; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public Coding getValueCoding() throws FHIRException { - if (!(this.value instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Coding) this.value; - } - - public boolean hasValueCoding() { - return this.value instanceof Coding; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public IntegerType getValueIntegerType() throws FHIRException { - if (!(this.value instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - public boolean hasValueIntegerType() { - return this.value instanceof IntegerType; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public BooleanType getValueBooleanType() throws FHIRException { - if (!(this.value instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - public boolean hasValueBooleanType() { - return this.value instanceof BooleanType; - } - - /** - * @return {@link #value} (The value of this property.) - */ - public DateTimeType getValueDateTimeType() throws FHIRException { - if (!(this.value instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - public boolean hasValueDateTimeType() { - return this.value instanceof DateTimeType; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of this property.) - */ - public ConceptDefinitionPropertyComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "A code that is a reference to CodeSystem.property.code.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value[x]", "code|Coding|string|integer|boolean|dateTime", "The value of this property.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.code"); - } - else if (name.equals("valueCode")) { - this.value = new CodeType(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else - return super.addChild(name); - } - - public ConceptDefinitionPropertyComponent copy() { - ConceptDefinitionPropertyComponent dst = new ConceptDefinitionPropertyComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptDefinitionPropertyComponent)) - return false; - ConceptDefinitionPropertyComponent o = (ConceptDefinitionPropertyComponent) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptDefinitionPropertyComponent)) - return false; - ConceptDefinitionPropertyComponent o = (ConceptDefinitionPropertyComponent) other; - return compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "CodeSystem.concept.property"; - - } - - } - - /** - * An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Globally unique logical identifier for code system (Coding.system)", formalDefinition="An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional identifier for the code system (e.g. HL7 v2 / CDA)", formalDefinition="Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical identifier for this version (Coding.version)", formalDefinition="Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version." ) - protected StringType version; - - /** - * A free text natural language name describing the code system. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this code system", formalDefinition="A free text natural language name describing the code system." ) - protected StringType name; - - /** - * The status of the code system. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the code system." ) - protected Enumeration status; - - /** - * This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the code system. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the code system." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). - */ - @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition')." ) - protected DateTimeType date; - - /** - * A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system. - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human language description of the code system", formalDefinition="A free text natural language description of the use of the code system - reason for definition, \"the semantic space\" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions." ) - protected List useContext; - - /** - * Explains why this code system is needed and why it has been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why needed", formalDefinition="Explains why this code system is needed and why it has been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. - */ - @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system." ) - protected StringType copyright; - - /** - * If code comparison is case sensitive when codes within this system are compared to each other. - */ - @Child(name = "caseSensitive", type = {BooleanType.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If code comparison is case sensitive", formalDefinition="If code comparison is case sensitive when codes within this system are compared to each other." ) - protected BooleanType caseSensitive; - - /** - * Canonical URL of value set that contains the entire code system. - */ - @Child(name = "valueSet", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Canonical URL for value set with entire code system", formalDefinition="Canonical URL of value set that contains the entire code system." ) - protected UriType valueSet; - - /** - * True If code system defines a post-composition grammar. - */ - @Child(name = "compositional", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If code system defines a post-composition grammar", formalDefinition="True If code system defines a post-composition grammar." ) - protected BooleanType compositional; - - /** - * This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system. - */ - @Child(name = "versionNeeded", type = {BooleanType.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If definitions are not stable", formalDefinition="This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system." ) - protected BooleanType versionNeeded; - - /** - * How much of the content of the code system - the concepts and codes it defines - are represented in this resource. - */ - @Child(name = "content", type = {CodeType.class}, order=17, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="not-present | examplar | fragment | complete", formalDefinition="How much of the content of the code system - the concepts and codes it defines - are represented in this resource." ) - protected Enumeration content; - - /** - * The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts. - */ - @Child(name = "count", type = {UnsignedIntType.class}, order=18, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total concepts in the code system", formalDefinition="The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts." ) - protected UnsignedIntType count; - - /** - * A filter that can be used in a value set compose statement when selecting concepts using a filter. - */ - @Child(name = "filter", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Filter that can be used in a value set", formalDefinition="A filter that can be used in a value set compose statement when selecting concepts using a filter." ) - protected List filter; - - /** - * A property defines an additional slot through which additional information can be provided about a concept. - */ - @Child(name = "property", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional information supplied about each concept", formalDefinition="A property defines an additional slot through which additional information can be provided about a concept." ) - protected List property; - - /** - * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are. - */ - @Child(name = "concept", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Concepts in the code system", formalDefinition="Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are." ) - protected List concept; - - private static final long serialVersionUID = 1466696062L; - - /** - * Constructor - */ - public CodeSystem() { - super(); - } - - /** - * Constructor - */ - public CodeSystem(Enumeration status, Enumeration content) { - super(); - this.status = status; - this.content = content; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public CodeSystem setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system. - */ - public CodeSystem setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public CodeSystem setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public CodeSystem setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version. - */ - public CodeSystem setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name describing the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeSystem setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the code system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the code system. - */ - public CodeSystem setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the code system.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the code system.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CodeSystem setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the code system. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the code system. - */ - public CodeSystem setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public CodeSystem setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public CodeSystem setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the code system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the code system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public CodeSystem setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the code system. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the code system. - */ - public CodeSystem setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (CodeSystemContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public CodeSystemContactComponent addContact() { //3 - CodeSystemContactComponent t = new CodeSystemContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public CodeSystem addContact(CodeSystemContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public CodeSystem setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). - */ - public CodeSystem setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public CodeSystem setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the code system - reason for definition, "the semantic space" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system. - */ - public CodeSystem setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public CodeSystem addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this code system is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this code system is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public CodeSystem setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this code system is needed and why it has been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this code system is needed and why it has been constrained as it has. - */ - public CodeSystem setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public CodeSystem setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system. - */ - public CodeSystem setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value - */ - public BooleanType getCaseSensitiveElement() { - if (this.caseSensitive == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.caseSensitive"); - else if (Configuration.doAutoCreate()) - this.caseSensitive = new BooleanType(); // bb - return this.caseSensitive; - } - - public boolean hasCaseSensitiveElement() { - return this.caseSensitive != null && !this.caseSensitive.isEmpty(); - } - - public boolean hasCaseSensitive() { - return this.caseSensitive != null && !this.caseSensitive.isEmpty(); - } - - /** - * @param value {@link #caseSensitive} (If code comparison is case sensitive when codes within this system are compared to each other.). This is the underlying object with id, value and extensions. The accessor "getCaseSensitive" gives direct access to the value - */ - public CodeSystem setCaseSensitiveElement(BooleanType value) { - this.caseSensitive = value; - return this; - } - - /** - * @return If code comparison is case sensitive when codes within this system are compared to each other. - */ - public boolean getCaseSensitive() { - return this.caseSensitive == null || this.caseSensitive.isEmpty() ? false : this.caseSensitive.getValue(); - } - - /** - * @param value If code comparison is case sensitive when codes within this system are compared to each other. - */ - public CodeSystem setCaseSensitive(boolean value) { - if (this.caseSensitive == null) - this.caseSensitive = new BooleanType(); - this.caseSensitive.setValue(value); - return this; - } - - /** - * @return {@link #valueSet} (Canonical URL of value set that contains the entire code system.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value - */ - public UriType getValueSetElement() { - if (this.valueSet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.valueSet"); - else if (Configuration.doAutoCreate()) - this.valueSet = new UriType(); // bb - return this.valueSet; - } - - public boolean hasValueSetElement() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (Canonical URL of value set that contains the entire code system.). This is the underlying object with id, value and extensions. The accessor "getValueSet" gives direct access to the value - */ - public CodeSystem setValueSetElement(UriType value) { - this.valueSet = value; - return this; - } - - /** - * @return Canonical URL of value set that contains the entire code system. - */ - public String getValueSet() { - return this.valueSet == null ? null : this.valueSet.getValue(); - } - - /** - * @param value Canonical URL of value set that contains the entire code system. - */ - public CodeSystem setValueSet(String value) { - if (Utilities.noString(value)) - this.valueSet = null; - else { - if (this.valueSet == null) - this.valueSet = new UriType(); - this.valueSet.setValue(value); - } - return this; - } - - /** - * @return {@link #compositional} (True If code system defines a post-composition grammar.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value - */ - public BooleanType getCompositionalElement() { - if (this.compositional == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.compositional"); - else if (Configuration.doAutoCreate()) - this.compositional = new BooleanType(); // bb - return this.compositional; - } - - public boolean hasCompositionalElement() { - return this.compositional != null && !this.compositional.isEmpty(); - } - - public boolean hasCompositional() { - return this.compositional != null && !this.compositional.isEmpty(); - } - - /** - * @param value {@link #compositional} (True If code system defines a post-composition grammar.). This is the underlying object with id, value and extensions. The accessor "getCompositional" gives direct access to the value - */ - public CodeSystem setCompositionalElement(BooleanType value) { - this.compositional = value; - return this; - } - - /** - * @return True If code system defines a post-composition grammar. - */ - public boolean getCompositional() { - return this.compositional == null || this.compositional.isEmpty() ? false : this.compositional.getValue(); - } - - /** - * @param value True If code system defines a post-composition grammar. - */ - public CodeSystem setCompositional(boolean value) { - if (this.compositional == null) - this.compositional = new BooleanType(); - this.compositional.setValue(value); - return this; - } - - /** - * @return {@link #versionNeeded} (This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.). This is the underlying object with id, value and extensions. The accessor "getVersionNeeded" gives direct access to the value - */ - public BooleanType getVersionNeededElement() { - if (this.versionNeeded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.versionNeeded"); - else if (Configuration.doAutoCreate()) - this.versionNeeded = new BooleanType(); // bb - return this.versionNeeded; - } - - public boolean hasVersionNeededElement() { - return this.versionNeeded != null && !this.versionNeeded.isEmpty(); - } - - public boolean hasVersionNeeded() { - return this.versionNeeded != null && !this.versionNeeded.isEmpty(); - } - - /** - * @param value {@link #versionNeeded} (This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.). This is the underlying object with id, value and extensions. The accessor "getVersionNeeded" gives direct access to the value - */ - public CodeSystem setVersionNeededElement(BooleanType value) { - this.versionNeeded = value; - return this; - } - - /** - * @return This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system. - */ - public boolean getVersionNeeded() { - return this.versionNeeded == null || this.versionNeeded.isEmpty() ? false : this.versionNeeded.getValue(); - } - - /** - * @param value This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system. - */ - public CodeSystem setVersionNeeded(boolean value) { - if (this.versionNeeded == null) - this.versionNeeded = new BooleanType(); - this.versionNeeded.setValue(value); - return this; - } - - /** - * @return {@link #content} (How much of the content of the code system - the concepts and codes it defines - are represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public Enumeration getContentElement() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.content"); - else if (Configuration.doAutoCreate()) - this.content = new Enumeration(new CodeSystemContentModeEnumFactory()); // bb - return this.content; - } - - public boolean hasContentElement() { - return this.content != null && !this.content.isEmpty(); - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (How much of the content of the code system - the concepts and codes it defines - are represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getContent" gives direct access to the value - */ - public CodeSystem setContentElement(Enumeration value) { - this.content = value; - return this; - } - - /** - * @return How much of the content of the code system - the concepts and codes it defines - are represented in this resource. - */ - public CodeSystemContentMode getContent() { - return this.content == null ? null : this.content.getValue(); - } - - /** - * @param value How much of the content of the code system - the concepts and codes it defines - are represented in this resource. - */ - public CodeSystem setContent(CodeSystemContentMode value) { - if (this.content == null) - this.content = new Enumeration(new CodeSystemContentModeEnumFactory()); - this.content.setValue(value); - return this; - } - - /** - * @return {@link #count} (The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public UnsignedIntType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystem.count"); - else if (Configuration.doAutoCreate()) - this.count = new UnsignedIntType(); // bb - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public CodeSystem setCountElement(UnsignedIntType value) { - this.count = value; - return this; - } - - /** - * @return The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts. - */ - public int getCount() { - return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); - } - - /** - * @param value The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts. - */ - public CodeSystem setCount(int value) { - if (this.count == null) - this.count = new UnsignedIntType(); - this.count.setValue(value); - return this; - } - - /** - * @return {@link #filter} (A filter that can be used in a value set compose statement when selecting concepts using a filter.) - */ - public List getFilter() { - if (this.filter == null) - this.filter = new ArrayList(); - return this.filter; - } - - public boolean hasFilter() { - if (this.filter == null) - return false; - for (CodeSystemFilterComponent item : this.filter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #filter} (A filter that can be used in a value set compose statement when selecting concepts using a filter.) - */ - // syntactic sugar - public CodeSystemFilterComponent addFilter() { //3 - CodeSystemFilterComponent t = new CodeSystemFilterComponent(); - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return t; - } - - // syntactic sugar - public CodeSystem addFilter(CodeSystemFilterComponent t) { //3 - if (t == null) - return this; - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return this; - } - - /** - * @return {@link #property} (A property defines an additional slot through which additional information can be provided about a concept.) - */ - public List getProperty() { - if (this.property == null) - this.property = new ArrayList(); - return this.property; - } - - public boolean hasProperty() { - if (this.property == null) - return false; - for (CodeSystemPropertyComponent item : this.property) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #property} (A property defines an additional slot through which additional information can be provided about a concept.) - */ - // syntactic sugar - public CodeSystemPropertyComponent addProperty() { //3 - CodeSystemPropertyComponent t = new CodeSystemPropertyComponent(); - if (this.property == null) - this.property = new ArrayList(); - this.property.add(t); - return t; - } - - // syntactic sugar - public CodeSystem addProperty(CodeSystemPropertyComponent t) { //3 - if (t == null) - return this; - if (this.property == null) - this.property = new ArrayList(); - this.property.add(t); - return this; - } - - /** - * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptDefinitionComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.) - */ - // syntactic sugar - public ConceptDefinitionComponent addConcept() { //3 - ConceptDefinitionComponent t = new ConceptDefinitionComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public CodeSystem addConcept(ConceptDefinitionComponent t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this code system when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this code system is (or will be) published. This is used in [Coding]{datatypes.html#Coding}.system.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this code system when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "Used to identify this version of the code system when it is referenced in a specification, model, design or instance (e.g. Coding.version). This is an arbitrary value managed by the profile author manually and the value should be a timestamp. This is used in [Coding]{datatypes.html#Coding}.version.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the code system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the code system.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This CodeSystem was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the code system.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date that the code system status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the code system - reason for definition, \"the semantic space\" to be included in the code system, conditions of use, etc. The description may include a list of expected usages for the code system and can also describe the approach taken to build the code system.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of code system definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this code system is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the code system and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the code system.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("caseSensitive", "boolean", "If code comparison is case sensitive when codes within this system are compared to each other.", 0, java.lang.Integer.MAX_VALUE, caseSensitive)); - childrenList.add(new Property("valueSet", "uri", "Canonical URL of value set that contains the entire code system.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - childrenList.add(new Property("compositional", "boolean", "True If code system defines a post-composition grammar.", 0, java.lang.Integer.MAX_VALUE, compositional)); - childrenList.add(new Property("versionNeeded", "boolean", "This flag is used to signify that the code system has not (or does not) maintain the definitions, and a version must be specified when referencing this code system.", 0, java.lang.Integer.MAX_VALUE, versionNeeded)); - childrenList.add(new Property("content", "code", "How much of the content of the code system - the concepts and codes it defines - are represented in this resource.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("count", "unsignedInt", "The total number of concepts defined by the code system. Where the code system has a compositional grammar, the count refers to the number of base (primitive) concepts.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("filter", "", "A filter that can be used in a value set compose statement when selecting concepts using a filter.", 0, java.lang.Integer.MAX_VALUE, filter)); - childrenList.add(new Property("property", "", "A property defines an additional slot through which additional information can be provided about a concept.", 0, java.lang.Integer.MAX_VALUE, property)); - childrenList.add(new Property("concept", "", "Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be consulted to determine what the meaning of the hierarchical relationships are.", 0, java.lang.Integer.MAX_VALUE, concept)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // CodeSystemContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case -35616442: /*caseSensitive*/ return this.caseSensitive == null ? new Base[0] : new Base[] {this.caseSensitive}; // BooleanType - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // UriType - case 1248023381: /*compositional*/ return this.compositional == null ? new Base[0] : new Base[] {this.compositional}; // BooleanType - case 617270957: /*versionNeeded*/ return this.versionNeeded == null ? new Base[0] : new Base[] {this.versionNeeded}; // BooleanType - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Enumeration - case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // UnsignedIntType - case -1274492040: /*filter*/ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // CodeSystemFilterComponent - case -993141291: /*property*/ return this.property == null ? new Base[0] : this.property.toArray(new Base[this.property.size()]); // CodeSystemPropertyComponent - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptDefinitionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((CodeSystemContactComponent) value); // CodeSystemContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case -35616442: // caseSensitive - this.caseSensitive = castToBoolean(value); // BooleanType - break; - case -1410174671: // valueSet - this.valueSet = castToUri(value); // UriType - break; - case 1248023381: // compositional - this.compositional = castToBoolean(value); // BooleanType - break; - case 617270957: // versionNeeded - this.versionNeeded = castToBoolean(value); // BooleanType - break; - case 951530617: // content - this.content = new CodeSystemContentModeEnumFactory().fromType(value); // Enumeration - break; - case 94851343: // count - this.count = castToUnsignedInt(value); // UnsignedIntType - break; - case -1274492040: // filter - this.getFilter().add((CodeSystemFilterComponent) value); // CodeSystemFilterComponent - break; - case -993141291: // property - this.getProperty().add((CodeSystemPropertyComponent) value); // CodeSystemPropertyComponent - break; - case 951024232: // concept - this.getConcept().add((ConceptDefinitionComponent) value); // ConceptDefinitionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((CodeSystemContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("caseSensitive")) - this.caseSensitive = castToBoolean(value); // BooleanType - else if (name.equals("valueSet")) - this.valueSet = castToUri(value); // UriType - else if (name.equals("compositional")) - this.compositional = castToBoolean(value); // BooleanType - else if (name.equals("versionNeeded")) - this.versionNeeded = castToBoolean(value); // BooleanType - else if (name.equals("content")) - this.content = new CodeSystemContentModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("count")) - this.count = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("filter")) - this.getFilter().add((CodeSystemFilterComponent) value); - else if (name.equals("property")) - this.getProperty().add((CodeSystemPropertyComponent) value); - else if (name.equals("concept")) - this.getConcept().add((ConceptDefinitionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return getIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // CodeSystemContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case -35616442: throw new FHIRException("Cannot make property caseSensitive as it is not a complex type"); // BooleanType - case -1410174671: throw new FHIRException("Cannot make property valueSet as it is not a complex type"); // UriType - case 1248023381: throw new FHIRException("Cannot make property compositional as it is not a complex type"); // BooleanType - case 617270957: throw new FHIRException("Cannot make property versionNeeded as it is not a complex type"); // BooleanType - case 951530617: throw new FHIRException("Cannot make property content as it is not a complex type"); // Enumeration - case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // UnsignedIntType - case -1274492040: return addFilter(); // CodeSystemFilterComponent - case -993141291: return addProperty(); // CodeSystemPropertyComponent - case 951024232: return addConcept(); // ConceptDefinitionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.url"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.copyright"); - } - else if (name.equals("caseSensitive")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.caseSensitive"); - } - else if (name.equals("valueSet")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.valueSet"); - } - else if (name.equals("compositional")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.compositional"); - } - else if (name.equals("versionNeeded")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.versionNeeded"); - } - else if (name.equals("content")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.content"); - } - else if (name.equals("count")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeSystem.count"); - } - else if (name.equals("filter")) { - return addFilter(); - } - else if (name.equals("property")) { - return addProperty(); - } - else if (name.equals("concept")) { - return addConcept(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "CodeSystem"; - - } - - public CodeSystem copy() { - CodeSystem dst = new CodeSystem(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (CodeSystemContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.caseSensitive = caseSensitive == null ? null : caseSensitive.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - dst.compositional = compositional == null ? null : compositional.copy(); - dst.versionNeeded = versionNeeded == null ? null : versionNeeded.copy(); - dst.content = content == null ? null : content.copy(); - dst.count = count == null ? null : count.copy(); - if (filter != null) { - dst.filter = new ArrayList(); - for (CodeSystemFilterComponent i : filter) - dst.filter.add(i.copy()); - }; - if (property != null) { - dst.property = new ArrayList(); - for (CodeSystemPropertyComponent i : property) - dst.property.add(i.copy()); - }; - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptDefinitionComponent i : concept) - dst.concept.add(i.copy()); - }; - return dst; - } - - protected CodeSystem typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystem)) - return false; - CodeSystem o = (CodeSystem) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) - && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(caseSensitive, o.caseSensitive, true) && compareDeep(valueSet, o.valueSet, true) - && compareDeep(compositional, o.compositional, true) && compareDeep(versionNeeded, o.versionNeeded, true) - && compareDeep(content, o.content, true) && compareDeep(count, o.count, true) && compareDeep(filter, o.filter, true) - && compareDeep(property, o.property, true) && compareDeep(concept, o.concept, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystem)) - return false; - CodeSystem o = (CodeSystem) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true) && compareValues(caseSensitive, o.caseSensitive, true) - && compareValues(valueSet, o.valueSet, true) && compareValues(compositional, o.compositional, true) - && compareValues(versionNeeded, o.versionNeeded, true) && compareValues(content, o.content, true) && compareValues(count, o.count, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (caseSensitive == null || caseSensitive.isEmpty()) - && (valueSet == null || valueSet.isEmpty()) && (compositional == null || compositional.isEmpty()) - && (versionNeeded == null || versionNeeded.isEmpty()) && (content == null || content.isEmpty()) - && (count == null || count.isEmpty()) && (filter == null || filter.isEmpty()) && (property == null || property.isEmpty()) - && (concept == null || concept.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CodeSystem; - } - - /** - * Search parameter: content - *

- * Description: not-present | examplar | fragment | complete
- * Type: token
- * Path: CodeSystem.content
- *

- */ - @SearchParamDefinition(name="content", path="CodeSystem.content", description="not-present | examplar | fragment | complete", type="token" ) - public static final String SP_CONTENT = "content"; - /** - * Fluent Client search parameter constant for content - *

- * Description: not-present | examplar | fragment | complete
- * Type: token
- * Path: CodeSystem.content
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTENT); - - /** - * Search parameter: system - *

- * Description: The system for any codes defined by this code system (same as 'url')
- * Type: uri
- * Path: CodeSystem.url
- *

- */ - @SearchParamDefinition(name="system", path="CodeSystem.url", description="The system for any codes defined by this code system (same as 'url')", type="uri" ) - public static final String SP_SYSTEM = "system"; - /** - * Fluent Client search parameter constant for system - *

- * Description: The system for any codes defined by this code system (same as 'url')
- * Type: uri
- * Path: CodeSystem.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SYSTEM); - - /** - * Search parameter: status - *

- * Description: The status of the code system
- * Type: token
- * Path: CodeSystem.status
- *

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

- * Description: The status of the code system
- * Type: token
- * Path: CodeSystem.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search in the description of the code system
- * Type: string
- * Path: CodeSystem.description
- *

- */ - @SearchParamDefinition(name="description", path="CodeSystem.description", description="Text search in the description of the code system", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search in the description of the code system
- * Type: string
- * Path: CodeSystem.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: The name of the code system
- * Type: string
- * Path: CodeSystem.name
- *

- */ - @SearchParamDefinition(name="name", path="CodeSystem.name", description="The name of the code system", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: The name of the code system
- * Type: string
- * Path: CodeSystem.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the code system
- * Type: token
- * Path: CodeSystem.useContext
- *

- */ - @SearchParamDefinition(name="context", path="CodeSystem.useContext", description="A use context assigned to the code system", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the code system
- * Type: token
- * Path: CodeSystem.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: language - *

- * Description: A language in which a designation is provided
- * Type: token
- * Path: CodeSystem.concept.designation.language
- *

- */ - @SearchParamDefinition(name="language", path="CodeSystem.concept.designation.language", description="A language in which a designation is provided", type="token" ) - public static final String SP_LANGUAGE = "language"; - /** - * Fluent Client search parameter constant for language - *

- * Description: A language in which a designation is provided
- * Type: token
- * Path: CodeSystem.concept.designation.language
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE); - - /** - * Search parameter: code - *

- * Description: A code defined in the code system
- * Type: token
- * Path: CodeSystem.concept.code
- *

- */ - @SearchParamDefinition(name="code", path="CodeSystem.concept.code", description="A code defined in the code system", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: A code defined in the code system
- * Type: token
- * Path: CodeSystem.concept.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: The code system publication date
- * Type: date
- * Path: CodeSystem.date
- *

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

- * Description: The code system publication date
- * Type: date
- * Path: CodeSystem.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: The identifier for the code system
- * Type: token
- * Path: CodeSystem.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="CodeSystem.identifier", description="The identifier for the code system", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identifier for the code system
- * Type: token
- * Path: CodeSystem.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: url - *

- * Description: The logical URL for the code system
- * Type: uri
- * Path: CodeSystem.url
- *

- */ - @SearchParamDefinition(name="url", path="CodeSystem.url", description="The logical URL for the code system", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The logical URL for the code system
- * Type: uri
- * Path: CodeSystem.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher of the code system
- * Type: string
- * Path: CodeSystem.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="CodeSystem.publisher", description="Name of the publisher of the code system", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher of the code system
- * Type: string
- * Path: CodeSystem.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: version - *

- * Description: The version identifier of the code system
- * Type: token
- * Path: CodeSystem.version
- *

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

- * Description: The version identifier of the code system
- * Type: token
- * Path: CodeSystem.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeType.java deleted file mode 100644 index 0aa6fb589d0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeType.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -package org.hl7.fhir.dstu2016may.model; - -import static org.apache.commons.lang3.StringUtils.defaultString; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "code" in FHIR, when not bound to an enumerated list of codes - */ -@DatatypeDef(name="code", profileOf=StringType.class) -public class CodeType extends StringType implements Comparable { - - private static final long serialVersionUID = 3L; - - public CodeType() { - super(); - } - - public CodeType(String theCode) { - setValue(theCode); - } - - public int compareTo(CodeType theCode) { - if (theCode == null) { - return 1; - } - return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); - } - - @Override - protected String parse(String theValue) { - return theValue.trim(); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public CodeType copy() { - return new CodeType(getValue()); - } - - public String fhirType() { - return "code"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeableConcept.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeableConcept.java deleted file mode 100644 index c6745ab5360..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CodeableConcept.java +++ /dev/null @@ -1,271 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ -@DatatypeDef(name="CodeableConcept") -public class CodeableConcept extends Type implements ICompositeType { - - /** - * A reference to a code defined by a terminology system. - */ - @Child(name = "coding", type = {Coding.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Code defined by a terminology system", formalDefinition="A reference to a code defined by a terminology system." ) - protected List coding; - - /** - * A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Plain text representation of the concept", formalDefinition="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." ) - protected StringType text; - - private static final long serialVersionUID = 760353246L; - - /** - * Constructor - */ - public CodeableConcept() { - super(); - } - - /** - * @return {@link #coding} (A reference to a code defined by a terminology system.) - */ - public List getCoding() { - if (this.coding == null) - this.coding = new ArrayList(); - return this.coding; - } - - public boolean hasCoding() { - if (this.coding == null) - return false; - for (Coding item : this.coding) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coding} (A reference to a code defined by a terminology system.) - */ - // syntactic sugar - public Coding addCoding() { //3 - Coding t = new Coding(); - if (this.coding == null) - this.coding = new ArrayList(); - this.coding.add(t); - return t; - } - - // syntactic sugar - public CodeableConcept addCoding(Coding t) { //3 - if (t == null) - return this; - if (this.coding == null) - this.coding = new ArrayList(); - this.coding.add(t); - return this; - } - - /** - * @return {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeableConcept.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public CodeableConcept setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. - */ - public CodeableConcept setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("coding", "Coding", "A reference to a code defined by a terminology system.", 0, java.lang.Integer.MAX_VALUE, coding)); - childrenList.add(new Property("text", "string", "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1355086998: /*coding*/ return this.coding == null ? new Base[0] : this.coding.toArray(new Base[this.coding.size()]); // Coding - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1355086998: // coding - this.getCoding().add(castToCoding(value)); // Coding - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("coding")) - this.getCoding().add(castToCoding(value)); - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1355086998: return addCoding(); // Coding - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("coding")) { - return addCoding(); - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type CodeableConcept.text"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "CodeableConcept"; - - } - - public CodeableConcept copy() { - CodeableConcept dst = new CodeableConcept(); - copyValues(dst); - if (coding != null) { - dst.coding = new ArrayList(); - for (Coding i : coding) - dst.coding.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - return dst; - } - - protected CodeableConcept typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeableConcept)) - return false; - CodeableConcept o = (CodeableConcept) other; - return compareDeep(coding, o.coding, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeableConcept)) - return false; - CodeableConcept o = (CodeableConcept) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (coding == null || coding.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Coding.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Coding.java deleted file mode 100644 index 5f2b70eb769..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Coding.java +++ /dev/null @@ -1,491 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseCoding; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A reference to a code defined by a terminology system. - */ -@DatatypeDef(name="Coding") -public class Coding extends Type implements IBaseCoding, ICompositeType { - - /** - * The identification of the code system that defines the meaning of the symbol in the code. - */ - @Child(name = "system", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identity of the terminology system", formalDefinition="The identification of the code system that defines the meaning of the symbol in the code." ) - protected UriType system; - - /** - * 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. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType version; - - /** - * 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). - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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)." ) - protected CodeType code; - - /** - * A representation of the meaning of the code in the system, following the rules of the system. - */ - @Child(name = "display", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType display; - - /** - * Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays). - */ - @Child(name = "userSelected", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If this coding was chosen directly by the user", formalDefinition="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." ) - protected BooleanType userSelected; - - private static final long serialVersionUID = -1417514061L; - - /** - * Constructor - */ - public Coding() { - super(); - } - - /** - * Convenience constructor - * - * @param theSystem The {@link #setSystem(String) code system} - * @param theCode The {@link #setCode(String) code} - * @param theDisplay The {@link #setDisplay(String) human readable display} - */ - public Coding(String theSystem, String theCode, String theDisplay) { - setSystem(theSystem); - setCode(theCode); - setDisplay(theDisplay); - } - /** - * @return {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The identification of the code system that defines the meaning of the symbol in the code.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Coding setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The identification of the code system that defines the meaning of the symbol in the code. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The identification of the code system that defines the meaning of the symbol in the code. - */ - public Coding setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (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.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (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.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Coding setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return 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 String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value 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 Coding setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (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).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (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).). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Coding setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return 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 String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value 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 Coding setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (A representation of the meaning of the code in the system, following the rules of the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public Coding setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return A representation of the meaning of the code in the system, following the rules of the system. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value A representation of the meaning of the code in the system, following the rules of the system. - */ - public Coding setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #userSelected} (Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getUserSelected" gives direct access to the value - */ - public BooleanType getUserSelectedElement() { - if (this.userSelected == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coding.userSelected"); - else if (Configuration.doAutoCreate()) - this.userSelected = new BooleanType(); // bb - return this.userSelected; - } - - public boolean hasUserSelectedElement() { - return this.userSelected != null && !this.userSelected.isEmpty(); - } - - public boolean hasUserSelected() { - return this.userSelected != null && !this.userSelected.isEmpty(); - } - - /** - * @param value {@link #userSelected} (Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).). This is the underlying object with id, value and extensions. The accessor "getUserSelected" gives direct access to the value - */ - public Coding setUserSelectedElement(BooleanType value) { - this.userSelected = value; - return this; - } - - /** - * @return Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays). - */ - public boolean getUserSelected() { - return this.userSelected == null || this.userSelected.isEmpty() ? false : this.userSelected.getValue(); - } - - /** - * @param value Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays). - */ - public Coding setUserSelected(boolean value) { - if (this.userSelected == null) - this.userSelected = new BooleanType(); - this.userSelected.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "The identification of the code system that defines the meaning of the symbol in the code.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "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.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "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).", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "A representation of the meaning of the code in the system, following the rules of the system.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("userSelected", "boolean", "Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).", 0, java.lang.Integer.MAX_VALUE, userSelected)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - case 423643014: /*userSelected*/ return this.userSelected == null ? new Base[0] : new Base[] {this.userSelected}; // BooleanType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - case 423643014: // userSelected - this.userSelected = castToBoolean(value); // BooleanType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else if (name.equals("userSelected")) - this.userSelected = castToBoolean(value); // BooleanType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - case 423643014: throw new FHIRException("Cannot make property userSelected as it is not a complex type"); // BooleanType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type Coding.system"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Coding.version"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type Coding.code"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type Coding.display"); - } - else if (name.equals("userSelected")) { - throw new FHIRException("Cannot call addChild on a primitive type Coding.userSelected"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Coding"; - - } - - public Coding copy() { - Coding dst = new Coding(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - dst.userSelected = userSelected == null ? null : userSelected.copy(); - return dst; - } - - protected Coding typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Coding)) - return false; - Coding o = (Coding) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) - && compareDeep(display, o.display, true) && compareDeep(userSelected, o.userSelected, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Coding)) - return false; - Coding o = (Coding) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) - && compareValues(display, o.display, true) && compareValues(userSelected, o.userSelected, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) && (userSelected == null || userSelected.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Communication.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Communication.java deleted file mode 100644 index ba2b4565f55..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Communication.java +++ /dev/null @@ -1,1597 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. - */ -@ResourceDef(name="Communication", profile="http://hl7.org/fhir/Profile/Communication") -public class Communication extends DomainResource { - - public enum CommunicationStatus { - /** - * The communication transmission is ongoing. - */ - INPROGRESS, - /** - * The message transmission is complete, i.e., delivered to the recipient's destination. - */ - COMPLETED, - /** - * The communication transmission has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to accept the message. - */ - REJECTED, - /** - * There was a failure in transmitting the message out. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - public static CommunicationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("failed".equals(codeString)) - return FAILED; - throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/communication-status"; - case COMPLETED: return "http://hl7.org/fhir/communication-status"; - case SUSPENDED: return "http://hl7.org/fhir/communication-status"; - case REJECTED: return "http://hl7.org/fhir/communication-status"; - case FAILED: return "http://hl7.org/fhir/communication-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The communication transmission is ongoing."; - case COMPLETED: return "The message transmission is complete, i.e., delivered to the recipient's destination."; - case SUSPENDED: return "The communication transmission has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to accept the message."; - case FAILED: return "There was a failure in transmitting the message out."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case FAILED: return "Failed"; - default: return "?"; - } - } - } - - public static class CommunicationStatusEnumFactory implements EnumFactory { - public CommunicationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return CommunicationStatus.INPROGRESS; - if ("completed".equals(codeString)) - return CommunicationStatus.COMPLETED; - if ("suspended".equals(codeString)) - return CommunicationStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return CommunicationStatus.REJECTED; - if ("failed".equals(codeString)) - return CommunicationStatus.FAILED; - throw new IllegalArgumentException("Unknown CommunicationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, CommunicationStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, CommunicationStatus.COMPLETED); - if ("suspended".equals(codeString)) - return new Enumeration(this, CommunicationStatus.SUSPENDED); - if ("rejected".equals(codeString)) - return new Enumeration(this, CommunicationStatus.REJECTED); - if ("failed".equals(codeString)) - return new Enumeration(this, CommunicationStatus.FAILED); - throw new FHIRException("Unknown CommunicationStatus code '"+codeString+"'"); - } - public String toCode(CommunicationStatus code) { - if (code == CommunicationStatus.INPROGRESS) - return "in-progress"; - if (code == CommunicationStatus.COMPLETED) - return "completed"; - if (code == CommunicationStatus.SUSPENDED) - return "suspended"; - if (code == CommunicationStatus.REJECTED) - return "rejected"; - if (code == CommunicationStatus.FAILED) - return "failed"; - return "?"; - } - public String toSystem(CommunicationStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class CommunicationPayloadComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A communicated content (or for multi-part communications, one portion of the communication). - */ - @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message part content", formalDefinition="A communicated content (or for multi-part communications, one portion of the communication)." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /** - * Constructor - */ - public CommunicationPayloadComponent() { - super(); - } - - /** - * Constructor - */ - public CommunicationPayloadComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) - */ - public StringType getContentStringType() throws FHIRException { - if (!(this.content instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); - return (StringType) this.content; - } - - public boolean hasContentStringType() { - return this.content instanceof StringType; - } - - /** - * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) - */ - public Attachment getContentAttachment() throws FHIRException { - if (!(this.content instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - public boolean hasContentAttachment() { - return this.content instanceof Attachment; - } - - /** - * @return {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) - */ - public Reference getContentReference() throws FHIRException { - if (!(this.content instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContentReference() { - return this.content instanceof Reference; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (A communicated content (or for multi-part communications, one portion of the communication).) - */ - public CommunicationPayloadComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "A communicated content (or for multi-part communications, one portion of the communication).", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 951530617: // content - this.content = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("content[x]")) - this.content = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 264548711: return getContent(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentString")) { - this.content = new StringType(); - return this.content; - } - else if (name.equals("contentAttachment")) { - this.content = new Attachment(); - return this.content; - } - else if (name.equals("contentReference")) { - this.content = new Reference(); - return this.content; - } - else - return super.addChild(name); - } - - public CommunicationPayloadComponent copy() { - CommunicationPayloadComponent dst = new CommunicationPayloadComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CommunicationPayloadComponent)) - return false; - CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CommunicationPayloadComponent)) - return false; - CommunicationPayloadComponent o = (CommunicationPayloadComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - public String fhirType() { - return "Communication.payload"; - - } - - } - - /** - * Identifiers associated with this Communication 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="Identifiers associated with this Communication 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)." ) - protected List identifier; - - /** - * The type of message conveyed such as alert, notification, reminder, instruction, etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message category", formalDefinition="The type of message conveyed such as alert, notification, reminder, instruction, etc." ) - protected CodeableConcept category; - - /** - * The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication. - */ - @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication." ) - protected Reference sender; - - /** - * The actual object that is the target of the reference (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.) - */ - protected Resource senderTarget; - - /** - * The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time). - */ - @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Group.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time)." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) - */ - protected List recipientTarget; - - - /** - * Text, attachment(s), or resource(s) that was communicated to the recipient. - */ - @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) that was communicated to the recipient." ) - protected List payload; - - /** - * A channel that was used for this communication (e.g. email, fax). - */ - @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." ) - protected List medium; - - /** - * The status of the transmission. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the transmission." ) - protected Enumeration status; - - /** - * The encounter within which the communication was sent. - */ - @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication was sent." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the communication was sent.) - */ - protected Encounter encounterTarget; - - /** - * The time when this communication was sent. - */ - @Child(name = "sent", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When sent", formalDefinition="The time when this communication was sent." ) - protected DateTimeType sent; - - /** - * The time when this communication arrived at the destination. - */ - @Child(name = "received", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When received", formalDefinition="The time when this communication arrived at the destination." ) - protected DateTimeType received; - - /** - * The reason or justification for the communication. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication." ) - protected List reason; - - /** - * The patient who was the focus of this communication. - */ - @Child(name = "subject", type = {Patient.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Focus of message", formalDefinition="The patient who was the focus of this communication." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who was the focus of this communication.) - */ - protected Patient subjectTarget; - - /** - * The communication request that was responsible for producing this communication. - */ - @Child(name = "requestDetail", type = {CommunicationRequest.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="CommunicationRequest producing this message", formalDefinition="The communication request that was responsible for producing this communication." ) - protected Reference requestDetail; - - /** - * The actual object that is the target of the reference (The communication request that was responsible for producing this communication.) - */ - protected CommunicationRequest requestDetailTarget; - - private static final long serialVersionUID = -1654449146L; - - /** - * Constructor - */ - public Communication() { - super(); - } - - /** - * @return {@link #identifier} (Identifiers associated with this Communication 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers associated with this Communication 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Communication addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The type of message conveyed such as alert, notification, reminder, instruction, etc.) - */ - public Communication setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Reference getSender() { - if (this.sender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.sender"); - else if (Configuration.doAutoCreate()) - this.sender = new Reference(); // cc - return this.sender; - } - - public boolean hasSender() { - return this.sender != null && !this.sender.isEmpty(); - } - - /** - * @param value {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Communication setSender(Reference value) { - this.sender = value; - return this; - } - - /** - * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Resource getSenderTarget() { - return this.senderTarget; - } - - /** - * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.) - */ - public Communication setSenderTarget(Resource value) { - this.senderTarget = value; - return this; - } - - /** - * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public Communication addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) - */ - public List getPayload() { - if (this.payload == null) - this.payload = new ArrayList(); - return this.payload; - } - - public boolean hasPayload() { - if (this.payload == null) - return false; - for (CommunicationPayloadComponent item : this.payload) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) that was communicated to the recipient.) - */ - // syntactic sugar - public CommunicationPayloadComponent addPayload() { //3 - CommunicationPayloadComponent t = new CommunicationPayloadComponent(); - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return t; - } - - // syntactic sugar - public Communication addPayload(CommunicationPayloadComponent t) { //3 - if (t == null) - return this; - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return this; - } - - /** - * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).) - */ - public List getMedium() { - if (this.medium == null) - this.medium = new ArrayList(); - return this.medium; - } - - public boolean hasMedium() { - if (this.medium == null) - return false; - for (CodeableConcept item : this.medium) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).) - */ - // syntactic sugar - public CodeableConcept addMedium() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return t; - } - - // syntactic sugar - public Communication addMedium(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return this; - } - - /** - * @return {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CommunicationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the transmission.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Communication setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the transmission. - */ - public CommunicationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the transmission. - */ - public Communication setStatus(CommunicationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new CommunicationStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the communication was sent.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter within which the communication was sent.) - */ - public Communication setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication was sent.) - */ - public Communication setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value - */ - public DateTimeType getSentElement() { - if (this.sent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.sent"); - else if (Configuration.doAutoCreate()) - this.sent = new DateTimeType(); // bb - return this.sent; - } - - public boolean hasSentElement() { - return this.sent != null && !this.sent.isEmpty(); - } - - public boolean hasSent() { - return this.sent != null && !this.sent.isEmpty(); - } - - /** - * @param value {@link #sent} (The time when this communication was sent.). This is the underlying object with id, value and extensions. The accessor "getSent" gives direct access to the value - */ - public Communication setSentElement(DateTimeType value) { - this.sent = value; - return this; - } - - /** - * @return The time when this communication was sent. - */ - public Date getSent() { - return this.sent == null ? null : this.sent.getValue(); - } - - /** - * @param value The time when this communication was sent. - */ - public Communication setSent(Date value) { - if (value == null) - this.sent = null; - else { - if (this.sent == null) - this.sent = new DateTimeType(); - this.sent.setValue(value); - } - return this; - } - - /** - * @return {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value - */ - public DateTimeType getReceivedElement() { - if (this.received == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.received"); - else if (Configuration.doAutoCreate()) - this.received = new DateTimeType(); // bb - return this.received; - } - - public boolean hasReceivedElement() { - return this.received != null && !this.received.isEmpty(); - } - - public boolean hasReceived() { - return this.received != null && !this.received.isEmpty(); - } - - /** - * @param value {@link #received} (The time when this communication arrived at the destination.). This is the underlying object with id, value and extensions. The accessor "getReceived" gives direct access to the value - */ - public Communication setReceivedElement(DateTimeType value) { - this.received = value; - return this; - } - - /** - * @return The time when this communication arrived at the destination. - */ - public Date getReceived() { - return this.received == null ? null : this.received.getValue(); - } - - /** - * @param value The time when this communication arrived at the destination. - */ - public Communication setReceived(Date value) { - if (value == null) - this.received = null; - else { - if (this.received == null) - this.received = new DateTimeType(); - this.received.setValue(value); - } - return this; - } - - /** - * @return {@link #reason} (The reason or justification for the communication.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (The reason or justification for the communication.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public Communication addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #subject} (The patient who was the focus of this communication.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who was the focus of this communication.) - */ - public Communication setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who was the focus of this communication.) - */ - public Communication setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #requestDetail} (The communication request that was responsible for producing this communication.) - */ - public Reference getRequestDetail() { - if (this.requestDetail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.requestDetail"); - else if (Configuration.doAutoCreate()) - this.requestDetail = new Reference(); // cc - return this.requestDetail; - } - - public boolean hasRequestDetail() { - return this.requestDetail != null && !this.requestDetail.isEmpty(); - } - - /** - * @param value {@link #requestDetail} (The communication request that was responsible for producing this communication.) - */ - public Communication setRequestDetail(Reference value) { - this.requestDetail = value; - return this; - } - - /** - * @return {@link #requestDetail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The communication request that was responsible for producing this communication.) - */ - public CommunicationRequest getRequestDetailTarget() { - if (this.requestDetailTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Communication.requestDetail"); - else if (Configuration.doAutoCreate()) - this.requestDetailTarget = new CommunicationRequest(); // aa - return this.requestDetailTarget; - } - - /** - * @param value {@link #requestDetail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The communication request that was responsible for producing this communication.) - */ - public Communication setRequestDetailTarget(CommunicationRequest value) { - this.requestDetailTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers associated with this Communication 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "The type of message conveyed such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which was the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); - childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson|Group)", "The entity (e.g. person, organization, clinical information system, or device) which was the target of the communication. If receipts need to be tracked by individual, a separate resource instance will need to be created for each recipient.  Multiple recipient communications are intended where either a receipt(s) is not tracked (e.g. a mass mail-out) or is captured in aggregate (all emails confirmed received by a particular time).", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) that was communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium)); - childrenList.add(new Property("status", "code", "The status of the transmission.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication was sent.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("sent", "dateTime", "The time when this communication was sent.", 0, java.lang.Integer.MAX_VALUE, sent)); - childrenList.add(new Property("received", "dateTime", "The time when this communication arrived at the destination.", 0, java.lang.Integer.MAX_VALUE, received)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who was the focus of this communication.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("requestDetail", "Reference(CommunicationRequest)", "The communication request that was responsible for producing this communication.", 0, java.lang.Integer.MAX_VALUE, requestDetail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference - case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference - case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationPayloadComponent - case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 3526552: /*sent*/ return this.sent == null ? new Base[0] : new Base[] {this.sent}; // DateTimeType - case -808719903: /*received*/ return this.received == null ? new Base[0] : new Base[] {this.received}; // DateTimeType - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 960204736: /*requestDetail*/ return this.requestDetail == null ? new Base[0] : new Base[] {this.requestDetail}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case -905962955: // sender - this.sender = castToReference(value); // Reference - break; - case 820081177: // recipient - this.getRecipient().add(castToReference(value)); // Reference - break; - case -786701938: // payload - this.getPayload().add((CommunicationPayloadComponent) value); // CommunicationPayloadComponent - break; - case -1078030475: // medium - this.getMedium().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -892481550: // status - this.status = new CommunicationStatusEnumFactory().fromType(value); // Enumeration - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 3526552: // sent - this.sent = castToDateTime(value); // DateTimeType - break; - case -808719903: // received - this.received = castToDateTime(value); // DateTimeType - break; - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 960204736: // requestDetail - this.requestDetail = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("sender")) - this.sender = castToReference(value); // Reference - else if (name.equals("recipient")) - this.getRecipient().add(castToReference(value)); - else if (name.equals("payload")) - this.getPayload().add((CommunicationPayloadComponent) value); - else if (name.equals("medium")) - this.getMedium().add(castToCodeableConcept(value)); - else if (name.equals("status")) - this.status = new CommunicationStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("sent")) - this.sent = castToDateTime(value); // DateTimeType - else if (name.equals("received")) - this.received = castToDateTime(value); // DateTimeType - else if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("requestDetail")) - this.requestDetail = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 50511102: return getCategory(); // CodeableConcept - case -905962955: return getSender(); // Reference - case 820081177: return addRecipient(); // Reference - case -786701938: return addPayload(); // CommunicationPayloadComponent - case -1078030475: return addMedium(); // CodeableConcept - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1524132147: return getEncounter(); // Reference - case 3526552: throw new FHIRException("Cannot make property sent as it is not a complex type"); // DateTimeType - case -808719903: throw new FHIRException("Cannot make property received as it is not a complex type"); // DateTimeType - case -934964668: return addReason(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case 960204736: return getRequestDetail(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("sender")) { - this.sender = new Reference(); - return this.sender; - } - else if (name.equals("recipient")) { - return addRecipient(); - } - else if (name.equals("payload")) { - return addPayload(); - } - else if (name.equals("medium")) { - return addMedium(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Communication.status"); - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("sent")) { - throw new FHIRException("Cannot call addChild on a primitive type Communication.sent"); - } - else if (name.equals("received")) { - throw new FHIRException("Cannot call addChild on a primitive type Communication.received"); - } - else if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("requestDetail")) { - this.requestDetail = new Reference(); - return this.requestDetail; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Communication"; - - } - - public Communication copy() { - Communication dst = new Communication(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.sender = sender == null ? null : sender.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - if (payload != null) { - dst.payload = new ArrayList(); - for (CommunicationPayloadComponent i : payload) - dst.payload.add(i.copy()); - }; - if (medium != null) { - dst.medium = new ArrayList(); - for (CodeableConcept i : medium) - dst.medium.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.sent = sent == null ? null : sent.copy(); - dst.received = received == null ? null : received.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.requestDetail = requestDetail == null ? null : requestDetail.copy(); - return dst; - } - - protected Communication typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Communication)) - return false; - Communication o = (Communication) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) - && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) - && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) && compareDeep(sent, o.sent, true) - && compareDeep(received, o.received, true) && compareDeep(reason, o.reason, true) && compareDeep(subject, o.subject, true) - && compareDeep(requestDetail, o.requestDetail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Communication)) - return false; - Communication o = (Communication) other; - return compareValues(status, o.status, true) && compareValues(sent, o.sent, true) && compareValues(received, o.received, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) - && (medium == null || medium.isEmpty()) && (status == null || status.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (sent == null || sent.isEmpty()) && (received == null || received.isEmpty()) && (reason == null || reason.isEmpty()) - && (subject == null || subject.isEmpty()) && (requestDetail == null || requestDetail.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Communication; - } - - /** - * Search parameter: sender - *

- * Description: Message sender
- * Type: reference
- * Path: Communication.sender
- *

- */ - @SearchParamDefinition(name="sender", path="Communication.sender", description="Message sender", type="reference" ) - public static final String SP_SENDER = "sender"; - /** - * Fluent Client search parameter constant for sender - *

- * Description: Message sender
- * Type: reference
- * Path: Communication.sender
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Communication:sender". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("Communication:sender").toLocked(); - - /** - * Search parameter: sent - *

- * Description: When sent
- * Type: date
- * Path: Communication.sent
- *

- */ - @SearchParamDefinition(name="sent", path="Communication.sent", description="When sent", type="date" ) - public static final String SP_SENT = "sent"; - /** - * Fluent Client search parameter constant for sent - *

- * Description: When sent
- * Type: date
- * Path: Communication.sent
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam SENT = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_SENT); - - /** - * Search parameter: category - *

- * Description: Message category
- * Type: token
- * Path: Communication.category
- *

- */ - @SearchParamDefinition(name="category", path="Communication.category", description="Message category", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: Message category
- * Type: token
- * Path: Communication.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: patient - *

- * Description: Focus of message
- * Type: reference
- * Path: Communication.subject
- *

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

- * Description: Focus of message
- * Type: reference
- * Path: Communication.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Communication:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Communication:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: in-progress | completed | suspended | rejected | failed
- * Type: token
- * Path: Communication.status
- *

- */ - @SearchParamDefinition(name="status", path="Communication.status", description="in-progress | completed | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: in-progress | completed | suspended | rejected | failed
- * Type: token
- * Path: Communication.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: Focus of message
- * Type: reference
- * Path: Communication.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Communication.subject", description="Focus of message", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Focus of message
- * Type: reference
- * Path: Communication.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Communication:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Communication:subject").toLocked(); - - /** - * Search parameter: request - *

- * Description: CommunicationRequest producing this message
- * Type: reference
- * Path: Communication.requestDetail
- *

- */ - @SearchParamDefinition(name="request", path="Communication.requestDetail", description="CommunicationRequest producing this message", type="reference" ) - public static final String SP_REQUEST = "request"; - /** - * Fluent Client search parameter constant for request - *

- * Description: CommunicationRequest producing this message
- * Type: reference
- * Path: Communication.requestDetail
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Communication:request". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("Communication:request").toLocked(); - - /** - * Search parameter: received - *

- * Description: When received
- * Type: date
- * Path: Communication.received
- *

- */ - @SearchParamDefinition(name="received", path="Communication.received", description="When received", type="date" ) - public static final String SP_RECEIVED = "received"; - /** - * Fluent Client search parameter constant for received - *

- * Description: When received
- * Type: date
- * Path: Communication.received
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam RECEIVED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_RECEIVED); - - /** - * Search parameter: encounter - *

- * Description: Encounter leading to message
- * Type: reference
- * Path: Communication.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Communication.encounter", description="Encounter leading to message", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Encounter leading to message
- * Type: reference
- * Path: Communication.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Communication:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Communication:encounter").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Unique identifier
- * Type: token
- * Path: Communication.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Communication.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique identifier
- * Type: token
- * Path: Communication.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: medium - *

- * Description: A channel of communication
- * Type: token
- * Path: Communication.medium
- *

- */ - @SearchParamDefinition(name="medium", path="Communication.medium", description="A channel of communication", type="token" ) - public static final String SP_MEDIUM = "medium"; - /** - * Fluent Client search parameter constant for medium - *

- * Description: A channel of communication
- * Type: token
- * Path: Communication.medium
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM); - - /** - * Search parameter: recipient - *

- * Description: Message recipient
- * Type: reference
- * Path: Communication.recipient
- *

- */ - @SearchParamDefinition(name="recipient", path="Communication.recipient", description="Message recipient", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - /** - * Fluent Client search parameter constant for recipient - *

- * Description: Message recipient
- * Type: reference
- * Path: Communication.recipient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Communication:recipient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("Communication:recipient").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java deleted file mode 100644 index 18072d5fd32..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CommunicationRequest.java +++ /dev/null @@ -1,1736 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. - */ -@ResourceDef(name="CommunicationRequest", profile="http://hl7.org/fhir/Profile/CommunicationRequest") -public class CommunicationRequest extends DomainResource { - - public enum CommunicationRequestStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the order, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request - */ - REJECTED, - /** - * The communication was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * added to help the parsers - */ - NULL; - public static CommunicationRequestStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("failed".equals(codeString)) - return FAILED; - throw new FHIRException("Unknown CommunicationRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/communication-request-status"; - case PLANNED: return "http://hl7.org/fhir/communication-request-status"; - case REQUESTED: return "http://hl7.org/fhir/communication-request-status"; - case RECEIVED: return "http://hl7.org/fhir/communication-request-status"; - case ACCEPTED: return "http://hl7.org/fhir/communication-request-status"; - case INPROGRESS: return "http://hl7.org/fhir/communication-request-status"; - case COMPLETED: return "http://hl7.org/fhir/communication-request-status"; - case SUSPENDED: return "http://hl7.org/fhir/communication-request-status"; - case REJECTED: return "http://hl7.org/fhir/communication-request-status"; - case FAILED: return "http://hl7.org/fhir/communication-request-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request"; - case FAILED: return "The communication was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case FAILED: return "Failed"; - default: return "?"; - } - } - } - - public static class CommunicationRequestStatusEnumFactory implements EnumFactory { - public CommunicationRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return CommunicationRequestStatus.PROPOSED; - if ("planned".equals(codeString)) - return CommunicationRequestStatus.PLANNED; - if ("requested".equals(codeString)) - return CommunicationRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return CommunicationRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return CommunicationRequestStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return CommunicationRequestStatus.INPROGRESS; - if ("completed".equals(codeString)) - return CommunicationRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return CommunicationRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return CommunicationRequestStatus.REJECTED; - if ("failed".equals(codeString)) - return CommunicationRequestStatus.FAILED; - throw new IllegalArgumentException("Unknown CommunicationRequestStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.PROPOSED); - if ("planned".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.PLANNED); - if ("requested".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.REQUESTED); - if ("received".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.RECEIVED); - if ("accepted".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.ACCEPTED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.COMPLETED); - if ("suspended".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.SUSPENDED); - if ("rejected".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.REJECTED); - if ("failed".equals(codeString)) - return new Enumeration(this, CommunicationRequestStatus.FAILED); - throw new FHIRException("Unknown CommunicationRequestStatus code '"+codeString+"'"); - } - public String toCode(CommunicationRequestStatus code) { - if (code == CommunicationRequestStatus.PROPOSED) - return "proposed"; - if (code == CommunicationRequestStatus.PLANNED) - return "planned"; - if (code == CommunicationRequestStatus.REQUESTED) - return "requested"; - if (code == CommunicationRequestStatus.RECEIVED) - return "received"; - if (code == CommunicationRequestStatus.ACCEPTED) - return "accepted"; - if (code == CommunicationRequestStatus.INPROGRESS) - return "in-progress"; - if (code == CommunicationRequestStatus.COMPLETED) - return "completed"; - if (code == CommunicationRequestStatus.SUSPENDED) - return "suspended"; - if (code == CommunicationRequestStatus.REJECTED) - return "rejected"; - if (code == CommunicationRequestStatus.FAILED) - return "failed"; - return "?"; - } - public String toSystem(CommunicationRequestStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class CommunicationRequestPayloadComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The communicated content (or for multi-part communications, one portion of the communication). - */ - @Child(name = "content", type = {StringType.class, Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message part content", formalDefinition="The communicated content (or for multi-part communications, one portion of the communication)." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /** - * Constructor - */ - public CommunicationRequestPayloadComponent() { - super(); - } - - /** - * Constructor - */ - public CommunicationRequestPayloadComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) - */ - public StringType getContentStringType() throws FHIRException { - if (!(this.content instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.content.getClass().getName()+" was encountered"); - return (StringType) this.content; - } - - public boolean hasContentStringType() { - return this.content instanceof StringType; - } - - /** - * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) - */ - public Attachment getContentAttachment() throws FHIRException { - if (!(this.content instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - public boolean hasContentAttachment() { - return this.content instanceof Attachment; - } - - /** - * @return {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) - */ - public Reference getContentReference() throws FHIRException { - if (!(this.content instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContentReference() { - return this.content instanceof Reference; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The communicated content (or for multi-part communications, one portion of the communication).) - */ - public CommunicationRequestPayloadComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "string|Attachment|Reference(Any)", "The communicated content (or for multi-part communications, one portion of the communication).", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 951530617: // content - this.content = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("content[x]")) - this.content = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 264548711: return getContent(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentString")) { - this.content = new StringType(); - return this.content; - } - else if (name.equals("contentAttachment")) { - this.content = new Attachment(); - return this.content; - } - else if (name.equals("contentReference")) { - this.content = new Reference(); - return this.content; - } - else - return super.addChild(name); - } - - public CommunicationRequestPayloadComponent copy() { - CommunicationRequestPayloadComponent dst = new CommunicationRequestPayloadComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CommunicationRequestPayloadComponent)) - return false; - CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CommunicationRequestPayloadComponent)) - return false; - CommunicationRequestPayloadComponent o = (CommunicationRequestPayloadComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - public String fhirType() { - return "CommunicationRequest.payload"; - - } - - } - - /** - * A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system." ) - protected List identifier; - - /** - * The type of message to be sent such as alert, notification, reminder, instruction, etc. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message category", formalDefinition="The type of message to be sent such as alert, notification, reminder, instruction, etc." ) - protected CodeableConcept category; - - /** - * The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication. - */ - @Child(name = "sender", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message sender", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication." ) - protected Reference sender; - - /** - * The actual object that is the target of the reference (The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - protected Resource senderTarget; - - /** - * The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication. - */ - @Child(name = "recipient", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Message recipient", formalDefinition="The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - protected List recipientTarget; - - - /** - * Text, attachment(s), or resource(s) to be communicated to the recipient. - */ - @Child(name = "payload", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Message payload", formalDefinition="Text, attachment(s), or resource(s) to be communicated to the recipient." ) - protected List payload; - - /** - * A channel that was used for this communication (e.g. email, fax). - */ - @Child(name = "medium", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A channel of communication", formalDefinition="A channel that was used for this communication (e.g. email, fax)." ) - protected List medium; - - /** - * The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application. - */ - @Child(name = "requester", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="An individual who requested a communication", formalDefinition="The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) - */ - protected Resource requesterTarget; - - /** - * The status of the proposal or order. - */ - @Child(name = "status", type = {CodeType.class}, order=7, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", formalDefinition="The status of the proposal or order." ) - protected Enumeration status; - - /** - * The encounter within which the communication request was created. - */ - @Child(name = "encounter", type = {Encounter.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Encounter leading to message", formalDefinition="The encounter within which the communication request was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the communication request was created.) - */ - protected Encounter encounterTarget; - - /** - * The time when this communication is to occur. - */ - @Child(name = "scheduled", type = {DateTimeType.class, Period.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When scheduled", formalDefinition="The time when this communication is to occur." ) - protected Type scheduled; - - /** - * The reason or justification for the communication request. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Indication for message", formalDefinition="The reason or justification for the communication request." ) - protected List reason; - - /** - * The time when the request was made. - */ - @Child(name = "requestedOn", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When ordered or proposed", formalDefinition="The time when the request was made." ) - protected DateTimeType requestedOn; - - /** - * The patient who is the focus of this communication request. - */ - @Child(name = "subject", type = {Patient.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Focus of message", formalDefinition="The patient who is the focus of this communication request." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who is the focus of this communication request.) - */ - protected Patient subjectTarget; - - /** - * Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message urgency", formalDefinition="Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine." ) - protected CodeableConcept priority; - - private static final long serialVersionUID = 146906020L; - - /** - * Constructor - */ - public CommunicationRequest() { - super(); - } - - /** - * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The type of message to be sent such as alert, notification, reminder, instruction, etc.) - */ - public CommunicationRequest setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public Reference getSender() { - if (this.sender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.sender"); - else if (Configuration.doAutoCreate()) - this.sender = new Reference(); // cc - return this.sender; - } - - public boolean hasSender() { - return this.sender != null && !this.sender.isEmpty(); - } - - /** - * @param value {@link #sender} (The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public CommunicationRequest setSender(Reference value) { - this.sender = value; - return this; - } - - /** - * @return {@link #sender} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public Resource getSenderTarget() { - return this.senderTarget; - } - - /** - * @param value {@link #sender} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.) - */ - public CommunicationRequest setSenderTarget(Resource value) { - this.senderTarget = value; - return this; - } - - /** - * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) - */ - public List getPayload() { - if (this.payload == null) - this.payload = new ArrayList(); - return this.payload; - } - - public boolean hasPayload() { - if (this.payload == null) - return false; - for (CommunicationRequestPayloadComponent item : this.payload) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #payload} (Text, attachment(s), or resource(s) to be communicated to the recipient.) - */ - // syntactic sugar - public CommunicationRequestPayloadComponent addPayload() { //3 - CommunicationRequestPayloadComponent t = new CommunicationRequestPayloadComponent(); - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addPayload(CommunicationRequestPayloadComponent t) { //3 - if (t == null) - return this; - if (this.payload == null) - this.payload = new ArrayList(); - this.payload.add(t); - return this; - } - - /** - * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).) - */ - public List getMedium() { - if (this.medium == null) - this.medium = new ArrayList(); - return this.medium; - } - - public boolean hasMedium() { - if (this.medium == null) - return false; - for (CodeableConcept item : this.medium) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #medium} (A channel that was used for this communication (e.g. email, fax).) - */ - // syntactic sugar - public CodeableConcept addMedium() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addMedium(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.medium == null) - this.medium = new ArrayList(); - this.medium.add(t); - return this; - } - - /** - * @return {@link #requester} (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) - */ - public CommunicationRequest setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.) - */ - public CommunicationRequest setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the proposal or order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CommunicationRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the proposal or order. - */ - public CommunicationRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the proposal or order. - */ - public CommunicationRequest setStatus(CommunicationRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new CommunicationRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the communication request was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter within which the communication request was created.) - */ - public CommunicationRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the communication request was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the communication request was created.) - */ - public CommunicationRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #scheduled} (The time when this communication is to occur.) - */ - public Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The time when this communication is to occur.) - */ - public DateTimeType getScheduledDateTimeType() throws FHIRException { - if (!(this.scheduled instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (DateTimeType) this.scheduled; - } - - public boolean hasScheduledDateTimeType() { - return this.scheduled instanceof DateTimeType; - } - - /** - * @return {@link #scheduled} (The time when this communication is to occur.) - */ - public Period getScheduledPeriod() throws FHIRException { - if (!(this.scheduled instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - public boolean hasScheduledPeriod() { - return this.scheduled instanceof Period; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The time when this communication is to occur.) - */ - public CommunicationRequest setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #reason} (The reason or justification for the communication request.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (The reason or justification for the communication request.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public CommunicationRequest addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #requestedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getRequestedOn" gives direct access to the value - */ - public DateTimeType getRequestedOnElement() { - if (this.requestedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.requestedOn"); - else if (Configuration.doAutoCreate()) - this.requestedOn = new DateTimeType(); // bb - return this.requestedOn; - } - - public boolean hasRequestedOnElement() { - return this.requestedOn != null && !this.requestedOn.isEmpty(); - } - - public boolean hasRequestedOn() { - return this.requestedOn != null && !this.requestedOn.isEmpty(); - } - - /** - * @param value {@link #requestedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getRequestedOn" gives direct access to the value - */ - public CommunicationRequest setRequestedOnElement(DateTimeType value) { - this.requestedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getRequestedOn() { - return this.requestedOn == null ? null : this.requestedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public CommunicationRequest setRequestedOn(Date value) { - if (value == null) - this.requestedOn = null; - else { - if (this.requestedOn == null) - this.requestedOn = new DateTimeType(); - this.requestedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who is the focus of this communication request.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who is the focus of this communication request.) - */ - public CommunicationRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication request.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the focus of this communication request.) - */ - public CommunicationRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CommunicationRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.) - */ - public CommunicationRequest setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique ID of this request for reference purposes. It must be provided if user wants it returned as part of any output, otherwise it will be autogenerated, if needed, by CDS system. Does not need to be the actual ID of the source system.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "The type of message to be sent such as alert, notification, reminder, instruction, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("sender", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which is to be the source of the communication.", 0, java.lang.Integer.MAX_VALUE, sender)); - childrenList.add(new Property("recipient", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The entity (e.g. person, organization, clinical information system, or device) which is the intended target of the communication.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("payload", "", "Text, attachment(s), or resource(s) to be communicated to the recipient.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("medium", "CodeableConcept", "A channel that was used for this communication (e.g. email, fax).", 0, java.lang.Integer.MAX_VALUE, medium)); - childrenList.add(new Property("requester", "Reference(Practitioner|Patient|RelatedPerson)", "The responsible person who authorizes this order, e.g. physician. This may be different than the author of the order statement, e.g. clerk, who may have entered the statement into the order entry application.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("status", "code", "The status of the proposal or order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the communication request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("scheduled[x]", "dateTime|Period", "The time when this communication is to occur.", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("reason", "CodeableConcept", "The reason or justification for the communication request.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("requestedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, requestedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who is the focus of this communication request.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("priority", "CodeableConcept", "Characterizes how quickly the proposed act must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case -905962955: /*sender*/ return this.sender == null ? new Base[0] : new Base[] {this.sender}; // Reference - case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference - case -786701938: /*payload*/ return this.payload == null ? new Base[0] : this.payload.toArray(new Base[this.payload.size()]); // CommunicationRequestPayloadComponent - case -1078030475: /*medium*/ return this.medium == null ? new Base[0] : this.medium.toArray(new Base[this.medium.size()]); // CodeableConcept - case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept - case 1150582253: /*requestedOn*/ return this.requestedOn == null ? new Base[0] : new Base[] {this.requestedOn}; // DateTimeType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case -905962955: // sender - this.sender = castToReference(value); // Reference - break; - case 820081177: // recipient - this.getRecipient().add(castToReference(value)); // Reference - break; - case -786701938: // payload - this.getPayload().add((CommunicationRequestPayloadComponent) value); // CommunicationRequestPayloadComponent - break; - case -1078030475: // medium - this.getMedium().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 693933948: // requester - this.requester = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new CommunicationRequestStatusEnumFactory().fromType(value); // Enumeration - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -160710483: // scheduled - this.scheduled = (Type) value; // Type - break; - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1150582253: // requestedOn - this.requestedOn = castToDateTime(value); // DateTimeType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -1165461084: // priority - this.priority = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("sender")) - this.sender = castToReference(value); // Reference - else if (name.equals("recipient")) - this.getRecipient().add(castToReference(value)); - else if (name.equals("payload")) - this.getPayload().add((CommunicationRequestPayloadComponent) value); - else if (name.equals("medium")) - this.getMedium().add(castToCodeableConcept(value)); - else if (name.equals("requester")) - this.requester = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new CommunicationRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("scheduled[x]")) - this.scheduled = (Type) value; // Type - else if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); - else if (name.equals("requestedOn")) - this.requestedOn = castToDateTime(value); // DateTimeType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("priority")) - this.priority = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 50511102: return getCategory(); // CodeableConcept - case -905962955: return getSender(); // Reference - case 820081177: return addRecipient(); // Reference - case -786701938: return addPayload(); // CommunicationRequestPayloadComponent - case -1078030475: return addMedium(); // CodeableConcept - case 693933948: return getRequester(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1524132147: return getEncounter(); // Reference - case 1162627251: return getScheduled(); // Type - case -934964668: return addReason(); // CodeableConcept - case 1150582253: throw new FHIRException("Cannot make property requestedOn as it is not a complex type"); // DateTimeType - case -1867885268: return getSubject(); // Reference - case -1165461084: return getPriority(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("sender")) { - this.sender = new Reference(); - return this.sender; - } - else if (name.equals("recipient")) { - return addRecipient(); - } - else if (name.equals("payload")) { - return addPayload(); - } - else if (name.equals("medium")) { - return addMedium(); - } - else if (name.equals("requester")) { - this.requester = new Reference(); - return this.requester; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type CommunicationRequest.status"); - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("scheduledDateTime")) { - this.scheduled = new DateTimeType(); - return this.scheduled; - } - else if (name.equals("scheduledPeriod")) { - this.scheduled = new Period(); - return this.scheduled; - } - else if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("requestedOn")) { - throw new FHIRException("Cannot call addChild on a primitive type CommunicationRequest.requestedOn"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("priority")) { - this.priority = new CodeableConcept(); - return this.priority; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "CommunicationRequest"; - - } - - public CommunicationRequest copy() { - CommunicationRequest dst = new CommunicationRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.sender = sender == null ? null : sender.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - if (payload != null) { - dst.payload = new ArrayList(); - for (CommunicationRequestPayloadComponent i : payload) - dst.payload.add(i.copy()); - }; - if (medium != null) { - dst.medium = new ArrayList(); - for (CodeableConcept i : medium) - dst.medium.add(i.copy()); - }; - dst.requester = requester == null ? null : requester.copy(); - dst.status = status == null ? null : status.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - dst.requestedOn = requestedOn == null ? null : requestedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected CommunicationRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CommunicationRequest)) - return false; - CommunicationRequest o = (CommunicationRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(sender, o.sender, true) - && compareDeep(recipient, o.recipient, true) && compareDeep(payload, o.payload, true) && compareDeep(medium, o.medium, true) - && compareDeep(requester, o.requester, true) && compareDeep(status, o.status, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(scheduled, o.scheduled, true) && compareDeep(reason, o.reason, true) && compareDeep(requestedOn, o.requestedOn, true) - && compareDeep(subject, o.subject, true) && compareDeep(priority, o.priority, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CommunicationRequest)) - return false; - CommunicationRequest o = (CommunicationRequest) other; - return compareValues(status, o.status, true) && compareValues(requestedOn, o.requestedOn, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (sender == null || sender.isEmpty()) && (recipient == null || recipient.isEmpty()) && (payload == null || payload.isEmpty()) - && (medium == null || medium.isEmpty()) && (requester == null || requester.isEmpty()) && (status == null || status.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (scheduled == null || scheduled.isEmpty()) - && (reason == null || reason.isEmpty()) && (requestedOn == null || requestedOn.isEmpty()) - && (subject == null || subject.isEmpty()) && (priority == null || priority.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CommunicationRequest; - } - - /** - * Search parameter: sender - *

- * Description: Message sender
- * Type: reference
- * Path: CommunicationRequest.sender
- *

- */ - @SearchParamDefinition(name="sender", path="CommunicationRequest.sender", description="Message sender", type="reference" ) - public static final String SP_SENDER = "sender"; - /** - * Fluent Client search parameter constant for sender - *

- * Description: Message sender
- * Type: reference
- * Path: CommunicationRequest.sender
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SENDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SENDER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CommunicationRequest:sender". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SENDER = new ca.uhn.fhir.model.api.Include("CommunicationRequest:sender").toLocked(); - - /** - * Search parameter: requested - *

- * Description: When ordered or proposed
- * Type: date
- * Path: CommunicationRequest.requestedOn
- *

- */ - @SearchParamDefinition(name="requested", path="CommunicationRequest.requestedOn", description="When ordered or proposed", type="date" ) - public static final String SP_REQUESTED = "requested"; - /** - * Fluent Client search parameter constant for requested - *

- * Description: When ordered or proposed
- * Type: date
- * Path: CommunicationRequest.requestedOn
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam REQUESTED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_REQUESTED); - - /** - * Search parameter: time - *

- * Description: When scheduled
- * Type: date
- * Path: CommunicationRequest.scheduledDateTime
- *

- */ - @SearchParamDefinition(name="time", path="CommunicationRequest.scheduled.as(DateTime)", description="When scheduled", type="date" ) - public static final String SP_TIME = "time"; - /** - * Fluent Client search parameter constant for time - *

- * Description: When scheduled
- * Type: date
- * Path: CommunicationRequest.scheduledDateTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TIME); - - /** - * Search parameter: requester - *

- * Description: An individual who requested a communication
- * Type: reference
- * Path: CommunicationRequest.requester
- *

- */ - @SearchParamDefinition(name="requester", path="CommunicationRequest.requester", description="An individual who requested a communication", type="reference" ) - public static final String SP_REQUESTER = "requester"; - /** - * Fluent Client search parameter constant for requester - *

- * Description: An individual who requested a communication
- * Type: reference
- * Path: CommunicationRequest.requester
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CommunicationRequest:requester". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("CommunicationRequest:requester").toLocked(); - - /** - * Search parameter: category - *

- * Description: Message category
- * Type: token
- * Path: CommunicationRequest.category
- *

- */ - @SearchParamDefinition(name="category", path="CommunicationRequest.category", description="Message category", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: Message category
- * Type: token
- * Path: CommunicationRequest.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: patient - *

- * Description: Focus of message
- * Type: reference
- * Path: CommunicationRequest.subject
- *

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

- * Description: Focus of message
- * Type: reference
- * Path: CommunicationRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CommunicationRequest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("CommunicationRequest:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed
- * Type: token
- * Path: CommunicationRequest.status
- *

- */ - @SearchParamDefinition(name="status", path="CommunicationRequest.status", description="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed
- * Type: token
- * Path: CommunicationRequest.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: priority - *

- * Description: Message urgency
- * Type: token
- * Path: CommunicationRequest.priority
- *

- */ - @SearchParamDefinition(name="priority", path="CommunicationRequest.priority", description="Message urgency", type="token" ) - public static final String SP_PRIORITY = "priority"; - /** - * Fluent Client search parameter constant for priority - *

- * Description: Message urgency
- * Type: token
- * Path: CommunicationRequest.priority
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); - - /** - * Search parameter: subject - *

- * Description: Focus of message
- * Type: reference
- * Path: CommunicationRequest.subject
- *

- */ - @SearchParamDefinition(name="subject", path="CommunicationRequest.subject", description="Focus of message", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Focus of message
- * Type: reference
- * Path: CommunicationRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CommunicationRequest:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("CommunicationRequest:subject").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Encounter leading to message
- * Type: reference
- * Path: CommunicationRequest.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="CommunicationRequest.encounter", description="Encounter leading to message", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Encounter leading to message
- * Type: reference
- * Path: CommunicationRequest.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CommunicationRequest:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("CommunicationRequest:encounter").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Unique identifier
- * Type: token
- * Path: CommunicationRequest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="CommunicationRequest.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique identifier
- * Type: token
- * Path: CommunicationRequest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: medium - *

- * Description: A channel of communication
- * Type: token
- * Path: CommunicationRequest.medium
- *

- */ - @SearchParamDefinition(name="medium", path="CommunicationRequest.medium", description="A channel of communication", type="token" ) - public static final String SP_MEDIUM = "medium"; - /** - * Fluent Client search parameter constant for medium - *

- * Description: A channel of communication
- * Type: token
- * Path: CommunicationRequest.medium
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam MEDIUM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MEDIUM); - - /** - * Search parameter: recipient - *

- * Description: Message recipient
- * Type: reference
- * Path: CommunicationRequest.recipient
- *

- */ - @SearchParamDefinition(name="recipient", path="CommunicationRequest.recipient", description="Message recipient", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - /** - * Fluent Client search parameter constant for recipient - *

- * Description: Message recipient
- * Type: reference
- * Path: CommunicationRequest.recipient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "CommunicationRequest:recipient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("CommunicationRequest:recipient").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Comparison.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Comparison.java deleted file mode 100644 index c5b1d1de3c1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Comparison.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.util.List; - -import org.apache.commons.lang3.NotImplementedException; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -/** - * See http://www.healthintersections.com.au/?p=1941 - * - * @author Grahame - * - */ -public class Comparison { - - public class MatchProfile { - - } - - public static boolean matches(String c1, String c2, MatchProfile profile) { - if (Utilities.noString(c1) || Utilities.noString(c2)) - return false; - c1 = Utilities.normalize(c1); - c2 = Utilities.normalize(c2); - return c1.equals(c2); - } - - public static > boolean matches(Enumeration e1, Enumeration e2, MatchProfile profile) { - if (e1 == null || e2 == null) - return false; - return e1.getValue().equals(e2.getValue()); - } - - public static boolean matches(CodeableConcept c1, CodeableConcept c2, MatchProfile profile) throws FHIRException { - if (profile != null) - throw new NotImplementedException("Not Implemented Yet"); - - if (c1.getCoding().isEmpty() && c2.getCoding().isEmpty()) { - return matches(c1.getText(), c2.getText(), null); - } else { - // in the absence of specific guidance, we just require that all codes match - boolean ok = true; - for (Coding c : c1.getCoding()) { - ok = ok && inList(c2.getCoding(), c, null); - } - for (Coding c : c2.getCoding()) { - ok = ok && inList(c1.getCoding(), c, null); - } - return ok; - } - } - - public static void merge(CodeableConcept dst, CodeableConcept src) { - if (dst.getTextElement() == null && src.getTextElement() != null) - dst.setTextElement(src.getTextElement()); - } - - - public static boolean inList(List list, Coding c, MatchProfile profile) { - for (Coding item : list) { - if (matches(item, c, profile)) - return true; - } - return false; - } - - public static boolean matches(Coding c1, Coding c2, MatchProfile profile) { - if (profile != null) - throw new NotImplementedException("Not Implemented Yet"); - - // in the absence of a profile, we ignore version - return matches(c1.getSystem(), c2.getSystem(), null) && matches(c1.getCode(), c2.getCode(), null); - } - - public static boolean matches(Identifier i1, Identifier i2, MatchProfile profile) { - if (profile != null) - throw new NotImplementedException("Not Implemented Yet"); - - // in the absence of a profile, we ignore version - return matches(i1.getSystem(), i2.getSystem(), null) && matches(i1.getValue(), i2.getValue(), null); - } - - public static void merge(Identifier dst, Identifier src) { - if (dst.getUseElement() == null && src.getUseElement() != null) - dst.setUseElement(src.getUseElement()); - if (dst.getType() == null && src.getType() != null) - dst.setType(src.getType()); - if (dst.getPeriod() == null && src.getPeriod() != null) - dst.setPeriod(src.getPeriod()); - if (dst.getAssigner() == null && src.getAssigner() != null) - dst.setAssigner(src.getAssigner()); - } - - public static boolean matches(ContactPoint c1, ContactPoint c2, Object profile) { - if (profile != null) - throw new NotImplementedException("Not Implemented Yet"); - - // in the absence of a profile, we insist on system - return matches(c1.getSystemElement(), c2.getSystemElement(), null) && matches(c1.getValue(), c2.getValue(), null); - } - - public static void merge(ContactPoint dst, ContactPoint src) { - if (dst.getUseElement() == null && src.getUseElement() != null) - dst.setUseElement(src.getUseElement()); - if (dst.getPeriod() == null && src.getPeriod() != null) - dst.setPeriod(src.getPeriod()); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java deleted file mode 100644 index 48a56dbfea4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/CompartmentDefinition.java +++ /dev/null @@ -1,1741 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A compartment definition that defines how resources are accessed on a server. - */ -@ResourceDef(name="CompartmentDefinition", profile="http://hl7.org/fhir/Profile/CompartmentDefinition") -public class CompartmentDefinition extends DomainResource { - - public enum CompartmentType { - /** - * The compartment definition is for the patient compartment - */ - PATIENT, - /** - * The compartment definition is for the encounter compartment - */ - ENCOUNTER, - /** - * The compartment definition is for the related-person compartment - */ - RELATEDPERSON, - /** - * The compartment definition is for the practitioner compartment - */ - PRACTITIONER, - /** - * The compartment definition is for the device compartment - */ - DEVICE, - /** - * added to help the parsers - */ - NULL; - public static CompartmentType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("Patient".equals(codeString)) - return PATIENT; - if ("Encounter".equals(codeString)) - return ENCOUNTER; - if ("RelatedPerson".equals(codeString)) - return RELATEDPERSON; - if ("Practitioner".equals(codeString)) - return PRACTITIONER; - if ("Device".equals(codeString)) - return DEVICE; - throw new FHIRException("Unknown CompartmentType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PATIENT: return "Patient"; - case ENCOUNTER: return "Encounter"; - case RELATEDPERSON: return "RelatedPerson"; - case PRACTITIONER: return "Practitioner"; - case DEVICE: return "Device"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PATIENT: return "http://hl7.org/fhir/compartment-type"; - case ENCOUNTER: return "http://hl7.org/fhir/compartment-type"; - case RELATEDPERSON: return "http://hl7.org/fhir/compartment-type"; - case PRACTITIONER: return "http://hl7.org/fhir/compartment-type"; - case DEVICE: return "http://hl7.org/fhir/compartment-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PATIENT: return "The compartment definition is for the patient compartment"; - case ENCOUNTER: return "The compartment definition is for the encounter compartment"; - case RELATEDPERSON: return "The compartment definition is for the related-person compartment"; - case PRACTITIONER: return "The compartment definition is for the practitioner compartment"; - case DEVICE: return "The compartment definition is for the device compartment"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PATIENT: return "Patient"; - case ENCOUNTER: return "Encounter"; - case RELATEDPERSON: return "RelatedPerson"; - case PRACTITIONER: return "Practitioner"; - case DEVICE: return "Device"; - default: return "?"; - } - } - } - - public static class CompartmentTypeEnumFactory implements EnumFactory { - public CompartmentType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("Patient".equals(codeString)) - return CompartmentType.PATIENT; - if ("Encounter".equals(codeString)) - return CompartmentType.ENCOUNTER; - if ("RelatedPerson".equals(codeString)) - return CompartmentType.RELATEDPERSON; - if ("Practitioner".equals(codeString)) - return CompartmentType.PRACTITIONER; - if ("Device".equals(codeString)) - return CompartmentType.DEVICE; - throw new IllegalArgumentException("Unknown CompartmentType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("Patient".equals(codeString)) - return new Enumeration(this, CompartmentType.PATIENT); - if ("Encounter".equals(codeString)) - return new Enumeration(this, CompartmentType.ENCOUNTER); - if ("RelatedPerson".equals(codeString)) - return new Enumeration(this, CompartmentType.RELATEDPERSON); - if ("Practitioner".equals(codeString)) - return new Enumeration(this, CompartmentType.PRACTITIONER); - if ("Device".equals(codeString)) - return new Enumeration(this, CompartmentType.DEVICE); - throw new FHIRException("Unknown CompartmentType code '"+codeString+"'"); - } - public String toCode(CompartmentType code) { - if (code == CompartmentType.PATIENT) - return "Patient"; - if (code == CompartmentType.ENCOUNTER) - return "Encounter"; - if (code == CompartmentType.RELATEDPERSON) - return "RelatedPerson"; - if (code == CompartmentType.PRACTITIONER) - return "Practitioner"; - if (code == CompartmentType.DEVICE) - return "Device"; - return "?"; - } - public String toSystem(CompartmentType code) { - return code.getSystem(); - } - } - - @Block() - public static class CompartmentDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the compartment definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the compartment definition." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public CompartmentDefinitionContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinitionContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CompartmentDefinitionContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the compartment definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the compartment definition. - */ - public CompartmentDefinitionContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public CompartmentDefinitionContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the compartment definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public CompartmentDefinitionContactComponent copy() { - CompartmentDefinitionContactComponent dst = new CompartmentDefinitionContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompartmentDefinitionContactComponent)) - return false; - CompartmentDefinitionContactComponent o = (CompartmentDefinitionContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompartmentDefinitionContactComponent)) - return false; - CompartmentDefinitionContactComponent o = (CompartmentDefinitionContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "CompartmentDefinition.contact"; - - } - - } - - @Block() - public static class CompartmentDefinitionResourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of a resource supported by the server. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of resource type", formalDefinition="The name of a resource supported by the server." ) - protected CodeType code; - - /** - * The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way. - */ - @Child(name = "param", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Search Parameter Name, or chained params", formalDefinition="The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way." ) - protected List param; - - /** - * Additional doco about the resource and compartment. - */ - @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional doco about the resource and compartment", formalDefinition="Additional doco about the resource and compartment." ) - protected StringType documentation; - - private static final long serialVersionUID = 988080897L; - - /** - * Constructor - */ - public CompartmentDefinitionResourceComponent() { - super(); - } - - /** - * Constructor - */ - public CompartmentDefinitionResourceComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (The name of a resource supported by the server.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinitionResourceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The name of a resource supported by the server.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CompartmentDefinitionResourceComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return The name of a resource supported by the server. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The name of a resource supported by the server. - */ - public CompartmentDefinitionResourceComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) - */ - public List getParam() { - if (this.param == null) - this.param = new ArrayList(); - return this.param; - } - - public boolean hasParam() { - if (this.param == null) - return false; - for (StringType item : this.param) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) - */ - // syntactic sugar - public StringType addParamElement() {//2 - StringType t = new StringType(); - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return t; - } - - /** - * @param value {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) - */ - public CompartmentDefinitionResourceComponent addParam(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return this; - } - - /** - * @param value {@link #param} (The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.) - */ - public boolean hasParam(String value) { - if (this.param == null) - return false; - for (StringType v : this.param) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #documentation} (Additional doco about the resource and compartment.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinitionResourceComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Additional doco about the resource and compartment.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public CompartmentDefinitionResourceComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Additional doco about the resource and compartment. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Additional doco about the resource and compartment. - */ - public CompartmentDefinitionResourceComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "The name of a resource supported by the server.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("param", "string", "The name of a search parameter that represents the link to the compartment. More than one may be listed because a resource may be linked to a compartment more than one way.", 0, java.lang.Integer.MAX_VALUE, param)); - childrenList.add(new Property("documentation", "string", "Additional doco about the resource and compartment.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // StringType - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 106436749: // param - this.getParam().add(castToString(value)); // StringType - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("param")) - this.getParam().add(castToString(value)); - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 106436749: throw new FHIRException("Cannot make property param as it is not a complex type"); // StringType - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.code"); - } - else if (name.equals("param")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.param"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.documentation"); - } - else - return super.addChild(name); - } - - public CompartmentDefinitionResourceComponent copy() { - CompartmentDefinitionResourceComponent dst = new CompartmentDefinitionResourceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (param != null) { - dst.param = new ArrayList(); - for (StringType i : param) - dst.param.add(i.copy()); - }; - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompartmentDefinitionResourceComponent)) - return false; - CompartmentDefinitionResourceComponent o = (CompartmentDefinitionResourceComponent) other; - return compareDeep(code, o.code, true) && compareDeep(param, o.param, true) && compareDeep(documentation, o.documentation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompartmentDefinitionResourceComponent)) - return false; - CompartmentDefinitionResourceComponent o = (CompartmentDefinitionResourceComponent) other; - return compareValues(code, o.code, true) && compareValues(param, o.param, true) && compareValues(documentation, o.documentation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (param == null || param.isEmpty()) - && (documentation == null || documentation.isEmpty()); - } - - public String fhirType() { - return "CompartmentDefinition.resource"; - - } - - } - - /** - * An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL used to reference this compartment definition", formalDefinition="An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published." ) - protected UriType url; - - /** - * A free text natural language name identifying the compartment definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this compartment definition", formalDefinition="A free text natural language name identifying the compartment definition." ) - protected StringType name; - - /** - * The status of this compartment definition definition. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this compartment definition definition." ) - protected Enumeration status; - - /** - * A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the compartment definition. - */ - @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the compartment definition." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes." ) - protected DateTimeType date; - - /** - * A free text natural language description of the CompartmentDefinition and its use. - */ - @Child(name = "description", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Natural language description of the CompartmentDefinition", formalDefinition="A free text natural language description of the CompartmentDefinition and its use." ) - protected StringType description; - - /** - * The Scope and Usage that this compartment definition was created to meet. - */ - @Child(name = "requirements", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why this compartment definition is defined", formalDefinition="The Scope and Usage that this compartment definition was created to meet." ) - protected StringType requirements; - - /** - * Which compartment this definition describes. - */ - @Child(name = "code", type = {CodeType.class}, order=9, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient | Encounter | RelatedPerson | Practitioner | Device", formalDefinition="Which compartment this definition describes." ) - protected Enumeration code; - - /** - * Whether the search syntax is supported. - */ - @Child(name = "search", type = {BooleanType.class}, order=10, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether the search syntax is supported", formalDefinition="Whether the search syntax is supported." ) - protected BooleanType search; - - /** - * Information about how a resource it related to the compartment. - */ - @Child(name = "resource", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="How resource is related to the compartment", formalDefinition="Information about how a resource it related to the compartment." ) - protected List resource; - - private static final long serialVersionUID = -1431357313L; - - /** - * Constructor - */ - public CompartmentDefinition() { - super(); - } - - /** - * Constructor - */ - public CompartmentDefinition(UriType url, StringType name, Enumeration code, BooleanType search) { - super(); - this.url = url; - this.name = name; - this.code = code; - this.search = search; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public CompartmentDefinition setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published. - */ - public CompartmentDefinition setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CompartmentDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the compartment definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the compartment definition. - */ - public CompartmentDefinition setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of this compartment definition definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this compartment definition definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CompartmentDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this compartment definition definition. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this compartment definition definition. - */ - public CompartmentDefinition setStatus(ConformanceResourceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public CompartmentDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public CompartmentDefinition setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the compartment definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public CompartmentDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the compartment definition. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the compartment definition. - */ - public CompartmentDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (CompartmentDefinitionContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public CompartmentDefinitionContactComponent addContact() { //3 - CompartmentDefinitionContactComponent t = new CompartmentDefinitionContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public CompartmentDefinition addContact(CompartmentDefinitionContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public CompartmentDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes. - */ - public CompartmentDefinition setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the CompartmentDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the CompartmentDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public CompartmentDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the CompartmentDefinition and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the CompartmentDefinition and its use. - */ - public CompartmentDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (The Scope and Usage that this compartment definition was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (The Scope and Usage that this compartment definition was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public CompartmentDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return The Scope and Usage that this compartment definition was created to meet. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value The Scope and Usage that this compartment definition was created to meet. - */ - public CompartmentDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Which compartment this definition describes.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new CompartmentTypeEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Which compartment this definition describes.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CompartmentDefinition setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Which compartment this definition describes. - */ - public CompartmentType getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Which compartment this definition describes. - */ - public CompartmentDefinition setCode(CompartmentType value) { - if (this.code == null) - this.code = new Enumeration(new CompartmentTypeEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #search} (Whether the search syntax is supported.). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value - */ - public BooleanType getSearchElement() { - if (this.search == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompartmentDefinition.search"); - else if (Configuration.doAutoCreate()) - this.search = new BooleanType(); // bb - return this.search; - } - - public boolean hasSearchElement() { - return this.search != null && !this.search.isEmpty(); - } - - public boolean hasSearch() { - return this.search != null && !this.search.isEmpty(); - } - - /** - * @param value {@link #search} (Whether the search syntax is supported.). This is the underlying object with id, value and extensions. The accessor "getSearch" gives direct access to the value - */ - public CompartmentDefinition setSearchElement(BooleanType value) { - this.search = value; - return this; - } - - /** - * @return Whether the search syntax is supported. - */ - public boolean getSearch() { - return this.search == null || this.search.isEmpty() ? false : this.search.getValue(); - } - - /** - * @param value Whether the search syntax is supported. - */ - public CompartmentDefinition setSearch(boolean value) { - if (this.search == null) - this.search = new BooleanType(); - this.search.setValue(value); - return this; - } - - /** - * @return {@link #resource} (Information about how a resource it related to the compartment.) - */ - public List getResource() { - if (this.resource == null) - this.resource = new ArrayList(); - return this.resource; - } - - public boolean hasResource() { - if (this.resource == null) - return false; - for (CompartmentDefinitionResourceComponent item : this.resource) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resource} (Information about how a resource it related to the compartment.) - */ - // syntactic sugar - public CompartmentDefinitionResourceComponent addResource() { //3 - CompartmentDefinitionResourceComponent t = new CompartmentDefinitionResourceComponent(); - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return t; - } - - // syntactic sugar - public CompartmentDefinition addResource(CompartmentDefinitionResourceComponent t) { //3 - if (t == null) - return this; - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this compartment definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this compartment definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the compartment definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of this compartment definition definition.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this compartment definition definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the compartment definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the compartment definition definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the compartment definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the CompartmentDefinition and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("requirements", "string", "The Scope and Usage that this compartment definition was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("code", "code", "Which compartment this definition describes.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("search", "boolean", "Whether the search syntax is supported.", 0, java.lang.Integer.MAX_VALUE, search)); - childrenList.add(new Property("resource", "", "Information about how a resource it related to the compartment.", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // CompartmentDefinitionContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case -906336856: /*search*/ return this.search == null ? new Base[0] : new Base[] {this.search}; // BooleanType - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // CompartmentDefinitionResourceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((CompartmentDefinitionContactComponent) value); // CompartmentDefinitionContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 3059181: // code - this.code = new CompartmentTypeEnumFactory().fromType(value); // Enumeration - break; - case -906336856: // search - this.search = castToBoolean(value); // BooleanType - break; - case -341064690: // resource - this.getResource().add((CompartmentDefinitionResourceComponent) value); // CompartmentDefinitionResourceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((CompartmentDefinitionContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("code")) - this.code = new CompartmentTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("search")) - this.search = castToBoolean(value); // BooleanType - else if (name.equals("resource")) - this.getResource().add((CompartmentDefinitionResourceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // CompartmentDefinitionContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case -906336856: throw new FHIRException("Cannot make property search as it is not a complex type"); // BooleanType - case -341064690: return addResource(); // CompartmentDefinitionResourceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.url"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.description"); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.requirements"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.code"); - } - else if (name.equals("search")) { - throw new FHIRException("Cannot call addChild on a primitive type CompartmentDefinition.search"); - } - else if (name.equals("resource")) { - return addResource(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "CompartmentDefinition"; - - } - - public CompartmentDefinition copy() { - CompartmentDefinition dst = new CompartmentDefinition(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (CompartmentDefinitionContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.code = code == null ? null : code.copy(); - dst.search = search == null ? null : search.copy(); - if (resource != null) { - dst.resource = new ArrayList(); - for (CompartmentDefinitionResourceComponent i : resource) - dst.resource.add(i.copy()); - }; - return dst; - } - - protected CompartmentDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompartmentDefinition)) - return false; - CompartmentDefinition o = (CompartmentDefinition) other; - return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) - && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(code, o.code, true) && compareDeep(search, o.search, true) - && compareDeep(resource, o.resource, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompartmentDefinition)) - return false; - CompartmentDefinition o = (CompartmentDefinition) other; - return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(status, o.status, true) - && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(code, o.code, true) && compareValues(search, o.search, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) - && (description == null || description.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (code == null || code.isEmpty()) && (search == null || search.isEmpty()) && (resource == null || resource.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.CompartmentDefinition; - } - - /** - * Search parameter: status - *

- * Description: draft | active | retired
- * Type: token
- * Path: CompartmentDefinition.status
- *

- */ - @SearchParamDefinition(name="status", path="CompartmentDefinition.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: draft | active | retired
- * Type: token
- * Path: CompartmentDefinition.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: name - *

- * Description: Informal name for this compartment definition
- * Type: string
- * Path: CompartmentDefinition.name
- *

- */ - @SearchParamDefinition(name="name", path="CompartmentDefinition.name", description="Informal name for this compartment definition", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Informal name for this compartment definition
- * Type: string
- * Path: CompartmentDefinition.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: resource - *

- * Description: Name of resource type
- * Type: token
- * Path: CompartmentDefinition.resource.code
- *

- */ - @SearchParamDefinition(name="resource", path="CompartmentDefinition.resource.code", description="Name of resource type", type="token" ) - public static final String SP_RESOURCE = "resource"; - /** - * Fluent Client search parameter constant for resource - *

- * Description: Name of resource type
- * Type: token
- * Path: CompartmentDefinition.resource.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOURCE); - - /** - * Search parameter: code - *

- * Description: Patient | Encounter | RelatedPerson | Practitioner | Device
- * Type: token
- * Path: CompartmentDefinition.code
- *

- */ - @SearchParamDefinition(name="code", path="CompartmentDefinition.code", description="Patient | Encounter | RelatedPerson | Practitioner | Device", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Patient | Encounter | RelatedPerson | Practitioner | Device
- * Type: token
- * Path: CompartmentDefinition.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: Publication Date(/time)
- * Type: date
- * Path: CompartmentDefinition.date
- *

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

- * Description: Publication Date(/time)
- * Type: date
- * Path: CompartmentDefinition.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: url - *

- * Description: Absolute URL used to reference this compartment definition
- * Type: uri
- * Path: CompartmentDefinition.url
- *

- */ - @SearchParamDefinition(name="url", path="CompartmentDefinition.url", description="Absolute URL used to reference this compartment definition", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Absolute URL used to reference this compartment definition
- * Type: uri
- * Path: CompartmentDefinition.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Composition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Composition.java deleted file mode 100644 index b6df2d8c49a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Composition.java +++ /dev/null @@ -1,2742 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. - */ -@ResourceDef(name="Composition", profile="http://hl7.org/fhir/Profile/Composition") -public class Composition extends DomainResource { - - public enum CompositionStatus { - /** - * This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified. - */ - PRELIMINARY, - /** - * This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition. - */ - FINAL, - /** - * The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as "final" and the composition is complete and verified by an authorized person. - */ - AMENDED, - /** - * The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static CompositionStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("preliminary".equals(codeString)) - return PRELIMINARY; - if ("final".equals(codeString)) - return FINAL; - if ("amended".equals(codeString)) - return AMENDED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case AMENDED: return "amended"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRELIMINARY: return "http://hl7.org/fhir/composition-status"; - case FINAL: return "http://hl7.org/fhir/composition-status"; - case AMENDED: return "http://hl7.org/fhir/composition-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/composition-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRELIMINARY: return "This is a preliminary composition or document (also known as initial or interim). The content may be incomplete or unverified."; - case FINAL: return "This version of the composition is complete and verified by an appropriate person and no further work is planned. Any subsequent updates would be on a new version of the composition."; - case AMENDED: return "The composition content or the referenced resources have been modified (edited or added to) subsequent to being released as \"final\" and the composition is complete and verified by an authorized person."; - case ENTEREDINERROR: return "The composition or document was originally created/issued in error, and this is an amendment that marks that the entire series should not be considered as valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRELIMINARY: return "Preliminary"; - case FINAL: return "Final"; - case AMENDED: return "Amended"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class CompositionStatusEnumFactory implements EnumFactory { - public CompositionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("preliminary".equals(codeString)) - return CompositionStatus.PRELIMINARY; - if ("final".equals(codeString)) - return CompositionStatus.FINAL; - if ("amended".equals(codeString)) - return CompositionStatus.AMENDED; - if ("entered-in-error".equals(codeString)) - return CompositionStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown CompositionStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("preliminary".equals(codeString)) - return new Enumeration(this, CompositionStatus.PRELIMINARY); - if ("final".equals(codeString)) - return new Enumeration(this, CompositionStatus.FINAL); - if ("amended".equals(codeString)) - return new Enumeration(this, CompositionStatus.AMENDED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, CompositionStatus.ENTEREDINERROR); - throw new FHIRException("Unknown CompositionStatus code '"+codeString+"'"); - } - public String toCode(CompositionStatus code) { - if (code == CompositionStatus.PRELIMINARY) - return "preliminary"; - if (code == CompositionStatus.FINAL) - return "final"; - if (code == CompositionStatus.AMENDED) - return "amended"; - if (code == CompositionStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(CompositionStatus code) { - return code.getSystem(); - } - } - - public enum CompositionAttestationMode { - /** - * The person authenticated the content in their personal capacity. - */ - PERSONAL, - /** - * The person authenticated the content in their professional capacity. - */ - PROFESSIONAL, - /** - * The person authenticated the content and accepted legal responsibility for its content. - */ - LEGAL, - /** - * The organization authenticated the content as consistent with their policies and procedures. - */ - OFFICIAL, - /** - * added to help the parsers - */ - NULL; - public static CompositionAttestationMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("personal".equals(codeString)) - return PERSONAL; - if ("professional".equals(codeString)) - return PROFESSIONAL; - if ("legal".equals(codeString)) - return LEGAL; - if ("official".equals(codeString)) - return OFFICIAL; - throw new FHIRException("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PERSONAL: return "personal"; - case PROFESSIONAL: return "professional"; - case LEGAL: return "legal"; - case OFFICIAL: return "official"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PERSONAL: return "http://hl7.org/fhir/composition-attestation-mode"; - case PROFESSIONAL: return "http://hl7.org/fhir/composition-attestation-mode"; - case LEGAL: return "http://hl7.org/fhir/composition-attestation-mode"; - case OFFICIAL: return "http://hl7.org/fhir/composition-attestation-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PERSONAL: return "The person authenticated the content in their personal capacity."; - case PROFESSIONAL: return "The person authenticated the content in their professional capacity."; - case LEGAL: return "The person authenticated the content and accepted legal responsibility for its content."; - case OFFICIAL: return "The organization authenticated the content as consistent with their policies and procedures."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PERSONAL: return "Personal"; - case PROFESSIONAL: return "Professional"; - case LEGAL: return "Legal"; - case OFFICIAL: return "Official"; - default: return "?"; - } - } - } - - public static class CompositionAttestationModeEnumFactory implements EnumFactory { - public CompositionAttestationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("personal".equals(codeString)) - return CompositionAttestationMode.PERSONAL; - if ("professional".equals(codeString)) - return CompositionAttestationMode.PROFESSIONAL; - if ("legal".equals(codeString)) - return CompositionAttestationMode.LEGAL; - if ("official".equals(codeString)) - return CompositionAttestationMode.OFFICIAL; - throw new IllegalArgumentException("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("personal".equals(codeString)) - return new Enumeration(this, CompositionAttestationMode.PERSONAL); - if ("professional".equals(codeString)) - return new Enumeration(this, CompositionAttestationMode.PROFESSIONAL); - if ("legal".equals(codeString)) - return new Enumeration(this, CompositionAttestationMode.LEGAL); - if ("official".equals(codeString)) - return new Enumeration(this, CompositionAttestationMode.OFFICIAL); - throw new FHIRException("Unknown CompositionAttestationMode code '"+codeString+"'"); - } - public String toCode(CompositionAttestationMode code) { - if (code == CompositionAttestationMode.PERSONAL) - return "personal"; - if (code == CompositionAttestationMode.PROFESSIONAL) - return "professional"; - if (code == CompositionAttestationMode.LEGAL) - return "legal"; - if (code == CompositionAttestationMode.OFFICIAL) - return "official"; - return "?"; - } - public String toSystem(CompositionAttestationMode code) { - return code.getSystem(); - } - } - - @Block() - public static class CompositionAttesterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of attestation the authenticator offers. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="personal | professional | legal | official", formalDefinition="The type of attestation the authenticator offers." ) - protected List> mode; - - /** - * When composition was attested by the party. - */ - @Child(name = "time", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When composition attested", formalDefinition="When composition was attested by the party." ) - protected DateTimeType time; - - /** - * Who attested the composition in the specified way. - */ - @Child(name = "party", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." ) - protected Reference party; - - /** - * The actual object that is the target of the reference (Who attested the composition in the specified way.) - */ - protected Resource partyTarget; - - private static final long serialVersionUID = -436604745L; - - /** - * Constructor - */ - public CompositionAttesterComponent() { - super(); - } - - /** - * @return {@link #mode} (The type of attestation the authenticator offers.) - */ - public List> getMode() { - if (this.mode == null) - this.mode = new ArrayList>(); - return this.mode; - } - - public boolean hasMode() { - if (this.mode == null) - return false; - for (Enumeration item : this.mode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mode} (The type of attestation the authenticator offers.) - */ - // syntactic sugar - public Enumeration addModeElement() {//2 - Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); - if (this.mode == null) - this.mode = new ArrayList>(); - this.mode.add(t); - return t; - } - - /** - * @param value {@link #mode} (The type of attestation the authenticator offers.) - */ - public CompositionAttesterComponent addMode(CompositionAttestationMode value) { //1 - Enumeration t = new Enumeration(new CompositionAttestationModeEnumFactory()); - t.setValue(value); - if (this.mode == null) - this.mode = new ArrayList>(); - this.mode.add(t); - return this; - } - - /** - * @param value {@link #mode} (The type of attestation the authenticator offers.) - */ - public boolean hasMode(CompositionAttestationMode value) { - if (this.mode == null) - return false; - for (Enumeration v : this.mode) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DateTimeType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionAttesterComponent.time"); - else if (Configuration.doAutoCreate()) - this.time = new DateTimeType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (When composition was attested by the party.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public CompositionAttesterComponent setTimeElement(DateTimeType value) { - this.time = value; - return this; - } - - /** - * @return When composition was attested by the party. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value When composition was attested by the party. - */ - public CompositionAttesterComponent setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new DateTimeType(); - this.time.setValue(value); - } - return this; - } - - /** - * @return {@link #party} (Who attested the composition in the specified way.) - */ - public Reference getParty() { - if (this.party == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionAttesterComponent.party"); - else if (Configuration.doAutoCreate()) - this.party = new Reference(); // cc - return this.party; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Who attested the composition in the specified way.) - */ - public CompositionAttesterComponent setParty(Reference value) { - this.party = value; - return this; - } - - /** - * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.) - */ - public Resource getPartyTarget() { - return this.partyTarget; - } - - /** - * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who attested the composition in the specified way.) - */ - public CompositionAttesterComponent setPartyTarget(Resource value) { - this.partyTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("time", "dateTime", "When composition was attested by the party.", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, java.lang.Integer.MAX_VALUE, party)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : this.mode.toArray(new Base[this.mode.size()]); // Enumeration - case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType - case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3357091: // mode - this.getMode().add(new CompositionAttestationModeEnumFactory().fromType(value)); // Enumeration - break; - case 3560141: // time - this.time = castToDateTime(value); // DateTimeType - break; - case 106437350: // party - this.party = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("mode")) - this.getMode().add(new CompositionAttestationModeEnumFactory().fromType(value)); - else if (name.equals("time")) - this.time = castToDateTime(value); // DateTimeType - else if (name.equals("party")) - this.party = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // DateTimeType - case 106437350: return getParty(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.mode"); - } - else if (name.equals("time")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.time"); - } - else if (name.equals("party")) { - this.party = new Reference(); - return this.party; - } - else - return super.addChild(name); - } - - public CompositionAttesterComponent copy() { - CompositionAttesterComponent dst = new CompositionAttesterComponent(); - copyValues(dst); - if (mode != null) { - dst.mode = new ArrayList>(); - for (Enumeration i : mode) - dst.mode.add(i.copy()); - }; - dst.time = time == null ? null : time.copy(); - dst.party = party == null ? null : party.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompositionAttesterComponent)) - return false; - CompositionAttesterComponent o = (CompositionAttesterComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(time, o.time, true) && compareDeep(party, o.party, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompositionAttesterComponent)) - return false; - CompositionAttesterComponent o = (CompositionAttesterComponent) other; - return compareValues(mode, o.mode, true) && compareValues(time, o.time, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (time == null || time.isEmpty()) - && (party == null || party.isEmpty()); - } - - public String fhirType() { - return "Composition.attester"; - - } - - } - - @Block() - public static class CompositionEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 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. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List code; - - /** - * 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. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Period period; - - /** - * The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy. - */ - @Child(name = "detail", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The event(s) being documented", formalDefinition="The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy." ) - protected List detail; - /** - * The actual objects that are the target of the reference (The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = -1581379774L; - - /** - * Constructor - */ - public CompositionEventComponent() { - super(); - } - - /** - * @return {@link #code} (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 List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (CodeableConcept item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (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.) - */ - // syntactic sugar - public CodeableConcept addCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - // syntactic sugar - public CompositionEventComponent addCode(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return this; - } - - /** - * @return {@link #period} (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 Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CompositionEventComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (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 CompositionEventComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #detail} (The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public CompositionEventComponent addDetail(Reference t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("period", "Period", "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.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("detail", "Reference(Any)", "The description and/or reference of the event(s) being documented. For example, this could be used to document such a colonoscopy or an appendectomy.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // CodeableConcept - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.getCode().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -1335224239: // detail - this.getDetail().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.getCode().add(castToCodeableConcept(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("detail")) - this.getDetail().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return addCode(); // CodeableConcept - case -991726143: return getPeriod(); // Period - case -1335224239: return addDetail(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - return addCode(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public CompositionEventComponent copy() { - CompositionEventComponent dst = new CompositionEventComponent(); - copyValues(dst); - if (code != null) { - dst.code = new ArrayList(); - for (CodeableConcept i : code) - dst.code.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CompositionEventComponent)) - return false; - CompositionEventComponent o = (CompositionEventComponent) other; - return compareDeep(code, o.code, true) && compareDeep(period, o.period, true) && compareDeep(detail, o.detail, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CompositionEventComponent)) - return false; - CompositionEventComponent o = (CompositionEventComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (period == null || period.isEmpty()) - && (detail == null || detail.isEmpty()); - } - - public String fhirType() { - return "Composition.event"; - - } - - } - - @Block() - public static class SectionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Label for section (e.g. for ToC)", formalDefinition="The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents." ) - protected StringType title; - - /** - * A code identifying the kind of content contained within the section. This must be consistent with the section title. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Classification of section (recommended)", formalDefinition="A code identifying the kind of content contained within the section. This must be consistent with the section title." ) - protected CodeableConcept code; - - /** - * A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. - */ - @Child(name = "text", type = {Narrative.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Text summary of the section, for human interpretation", formalDefinition="A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative." ) - protected Narrative text; - - /** - * How the entry 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. - */ - @Child(name = "mode", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="working | snapshot | changes", formalDefinition="How the entry 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." ) - protected CodeType mode; - - /** - * Specifies the order applied to the items in the section entries. - */ - @Child(name = "orderedBy", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Order of section entries", formalDefinition="Specifies the order applied to the items in the section entries." ) - protected CodeableConcept orderedBy; - - /** - * A reference to the actual resource from which the narrative in the section is derived. - */ - @Child(name = "entry", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A reference to data that supports this section", formalDefinition="A reference to the actual resource from which the narrative in the section is derived." ) - protected List entry; - /** - * The actual objects that are the target of the reference (A reference to the actual resource from which the narrative in the section is derived.) - */ - protected List entryTarget; - - - /** - * If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason. - */ - @Child(name = "emptyReason", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why the section is empty", formalDefinition="If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason." ) - protected CodeableConcept emptyReason; - - /** - * A nested sub-section within this section. - */ - @Child(name = "section", type = {SectionComponent.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Nested Section", formalDefinition="A nested sub-section within this section." ) - protected List section; - - private static final long serialVersionUID = -726390626L; - - /** - * Constructor - */ - public SectionComponent() { - super(); - } - - /** - * @return {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public SectionComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents. - */ - public SectionComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code identifying the kind of content contained within the section. This must be consistent with the section title.) - */ - public SectionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #text} (A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative.) - */ - public Narrative getText() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new Narrative(); // cc - return this.text; - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative.) - */ - public SectionComponent setText(Narrative value) { - this.text = value; - return this; - } - - /** - * @return {@link #mode} (How the entry 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.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public CodeType getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new CodeType(); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (How the entry 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.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public SectionComponent setModeElement(CodeType value) { - this.mode = value; - return this; - } - - /** - * @return How the entry 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 String getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value How the entry 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 SectionComponent setMode(String value) { - if (Utilities.noString(value)) - this.mode = null; - else { - if (this.mode == null) - this.mode = new CodeType(); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #orderedBy} (Specifies the order applied to the items in the section entries.) - */ - public CodeableConcept getOrderedBy() { - if (this.orderedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.orderedBy"); - else if (Configuration.doAutoCreate()) - this.orderedBy = new CodeableConcept(); // cc - return this.orderedBy; - } - - public boolean hasOrderedBy() { - return this.orderedBy != null && !this.orderedBy.isEmpty(); - } - - /** - * @param value {@link #orderedBy} (Specifies the order applied to the items in the section entries.) - */ - public SectionComponent setOrderedBy(CodeableConcept value) { - this.orderedBy = value; - return this; - } - - /** - * @return {@link #entry} (A reference to the actual resource from which the narrative in the section is derived.) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (Reference item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (A reference to the actual resource from which the narrative in the section is derived.) - */ - // syntactic sugar - public Reference addEntry() { //3 - Reference t = new Reference(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - // syntactic sugar - public SectionComponent addEntry(Reference t) { //3 - if (t == null) - return this; - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return this; - } - - /** - * @return {@link #entry} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A reference to the actual resource from which the narrative in the section is derived.) - */ - public List getEntryTarget() { - if (this.entryTarget == null) - this.entryTarget = new ArrayList(); - return this.entryTarget; - } - - /** - * @return {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.) - */ - public CodeableConcept getEmptyReason() { - if (this.emptyReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SectionComponent.emptyReason"); - else if (Configuration.doAutoCreate()) - this.emptyReason = new CodeableConcept(); // cc - return this.emptyReason; - } - - public boolean hasEmptyReason() { - return this.emptyReason != null && !this.emptyReason.isEmpty(); - } - - /** - * @param value {@link #emptyReason} (If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.) - */ - public SectionComponent setEmptyReason(CodeableConcept value) { - this.emptyReason = value; - return this; - } - - /** - * @return {@link #section} (A nested sub-section within this section.) - */ - public List getSection() { - if (this.section == null) - this.section = new ArrayList(); - return this.section; - } - - public boolean hasSection() { - if (this.section == null) - return false; - for (SectionComponent item : this.section) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #section} (A nested sub-section within this section.) - */ - // syntactic sugar - public SectionComponent addSection() { //3 - SectionComponent t = new SectionComponent(); - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return t; - } - - // syntactic sugar - public SectionComponent addSection(SectionComponent t) { //3 - if (t == null) - return this; - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("title", "string", "The label for this particular section. This will be part of the rendered content for the document, and is often used to build a table of contents.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("code", "CodeableConcept", "A code identifying the kind of content contained within the section. This must be consistent with the section title.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains the attested content of the section, used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("mode", "code", "How the entry 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.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("orderedBy", "CodeableConcept", "Specifies the order applied to the items in the section entries.", 0, java.lang.Integer.MAX_VALUE, orderedBy)); - childrenList.add(new Property("entry", "Reference(Any)", "A reference to the actual resource from which the narrative in the section is derived.", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("emptyReason", "CodeableConcept", "If the section is empty, why the list is empty. An empty section typically has some text explaining the empty reason.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); - childrenList.add(new Property("section", "@Composition.section", "A nested sub-section within this section.", 0, java.lang.Integer.MAX_VALUE, section)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // CodeType - case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept - case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // Reference - case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept - case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 3556653: // text - this.text = castToNarrative(value); // Narrative - break; - case 3357091: // mode - this.mode = castToCode(value); // CodeType - break; - case -391079516: // orderedBy - this.orderedBy = castToCodeableConcept(value); // CodeableConcept - break; - case 96667762: // entry - this.getEntry().add(castToReference(value)); // Reference - break; - case 1140135409: // emptyReason - this.emptyReason = castToCodeableConcept(value); // CodeableConcept - break; - case 1970241253: // section - this.getSection().add((SectionComponent) value); // SectionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("text")) - this.text = castToNarrative(value); // Narrative - else if (name.equals("mode")) - this.mode = castToCode(value); // CodeType - else if (name.equals("orderedBy")) - this.orderedBy = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("entry")) - this.getEntry().add(castToReference(value)); - else if (name.equals("emptyReason")) - this.emptyReason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("section")) - this.getSection().add((SectionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 3059181: return getCode(); // CodeableConcept - case 3556653: return getText(); // Narrative - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // CodeType - case -391079516: return getOrderedBy(); // CodeableConcept - case 96667762: return addEntry(); // Reference - case 1140135409: return getEmptyReason(); // CodeableConcept - case 1970241253: return addSection(); // SectionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.title"); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("text")) { - this.text = new Narrative(); - return this.text; - } - else if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.mode"); - } - else if (name.equals("orderedBy")) { - this.orderedBy = new CodeableConcept(); - return this.orderedBy; - } - else if (name.equals("entry")) { - return addEntry(); - } - else if (name.equals("emptyReason")) { - this.emptyReason = new CodeableConcept(); - return this.emptyReason; - } - else if (name.equals("section")) { - return addSection(); - } - else - return super.addChild(name); - } - - public SectionComponent copy() { - SectionComponent dst = new SectionComponent(); - copyValues(dst); - dst.title = title == null ? null : title.copy(); - dst.code = code == null ? null : code.copy(); - dst.text = text == null ? null : text.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); - if (entry != null) { - dst.entry = new ArrayList(); - for (Reference i : entry) - dst.entry.add(i.copy()); - }; - dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); - if (section != null) { - dst.section = new ArrayList(); - for (SectionComponent i : section) - dst.section.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SectionComponent)) - return false; - SectionComponent o = (SectionComponent) other; - return compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(text, o.text, true) - && compareDeep(mode, o.mode, true) && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(entry, o.entry, true) - && compareDeep(emptyReason, o.emptyReason, true) && compareDeep(section, o.section, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SectionComponent)) - return false; - SectionComponent o = (SectionComponent) other; - return compareValues(title, o.title, true) && compareValues(mode, o.mode, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) - && (text == null || text.isEmpty()) && (mode == null || mode.isEmpty()) && (orderedBy == null || orderedBy.isEmpty()) - && (entry == null || entry.isEmpty()) && (emptyReason == null || emptyReason.isEmpty()) && (section == null || section.isEmpty()) - ; - } - - public String fhirType() { - return "Composition.section"; - - } - - } - - /** - * Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Identifier identifier; - - /** - * The composition editing time, when the composition was last logically changed by the author. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Composition editing time", formalDefinition="The composition editing time, when the composition was last logically changed by the author." ) - protected DateTimeType date; - - /** - * 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. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept type; - - /** - * A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type. - */ - @Child(name = "class", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Categorization of Composition", formalDefinition="A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type." ) - protected CodeableConcept class_; - - /** - * Official human-readable label for the composition. - */ - @Child(name = "title", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human Readable name/title", formalDefinition="Official human-readable label for the composition." ) - protected StringType title; - - /** - * The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="preliminary | final | amended | entered-in-error", formalDefinition="The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document." ) - protected Enumeration status; - - /** - * The code specifying the level of confidentiality of the Composition. - */ - @Child(name = "confidentiality", type = {CodeType.class}, order=6, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="As defined by affinity domain", formalDefinition="The code specifying the level of confidentiality of the Composition." ) - protected CodeType confidentiality; - - /** - * Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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). - */ - @Child(name = "subject", type = {}, order=7, min=1, max=1, modifier=false, summary=true) - @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 (e.g. a 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)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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).) - */ - protected Resource subjectTarget; - - /** - * Identifies who is responsible for the information in the composition, not necessarily who typed it in. - */ - @Child(name = "author", type = {Practitioner.class, Device.class, Patient.class, RelatedPerson.class}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for the information in the composition, not necessarily who typed it in.) - */ - protected List authorTarget; - - - /** - * A participant who has attested to the accuracy of the composition/document. - */ - @Child(name = "attester", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Attests to accuracy of composition", formalDefinition="A participant who has attested to the accuracy of the composition/document." ) - protected List attester; - - /** - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information. - */ - @Child(name = "custodian", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization which maintains the composition", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information." ) - protected Reference custodian; - - /** - * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - protected Organization custodianTarget; - - /** - * The clinical service, such as a colonoscopy or an appendectomy, being documented. - */ - @Child(name = "event", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The clinical service(s) being documented", formalDefinition="The clinical service, such as a colonoscopy or an appendectomy, being documented." ) - protected List event; - - /** - * Describes the clinical encounter or type of care this documentation is associated with. - */ - @Child(name = "encounter", type = {Encounter.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Context of the Composition", formalDefinition="Describes the clinical encounter or type of care this documentation is associated with." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Describes the clinical encounter or type of care this documentation is associated with.) - */ - protected Encounter encounterTarget; - - /** - * The root of the sections that make up the composition. - */ - @Child(name = "section", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Composition is broken into sections", formalDefinition="The root of the sections that make up the composition." ) - protected List section; - - private static final long serialVersionUID = 2127852326L; - - /** - * Constructor - */ - public Composition() { - super(); - } - - /** - * Constructor - */ - public Composition(DateTimeType date, CodeableConcept type, StringType title, Enumeration status, Reference subject) { - super(); - this.date = date; - this.type = type; - this.title = title; - this.status = status; - this.subject = subject; - } - - /** - * @return {@link #identifier} (Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.) - */ - public Composition setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The composition editing time, when the composition was last logically changed by the author.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Composition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The composition editing time, when the composition was last logically changed by the author. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The composition editing time, when the composition was last logically changed by the author. - */ - public Composition setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #type} (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 CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (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(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #class_} (A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.) - */ - public CodeableConcept getClass_() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new CodeableConcept(); // cc - return this.class_; - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.) - */ - public Composition setClass_(CodeableConcept value) { - this.class_ = value; - return this; - } - - /** - * @return {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (Official human-readable label for the composition.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Composition setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return Official human-readable label for the composition. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value Official human-readable label for the composition. - */ - public Composition setTitle(String value) { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - return this; - } - - /** - * @return {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new CompositionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Composition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - public CompositionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document. - */ - public Composition setStatus(CompositionStatus value) { - if (this.status == null) - this.status = new Enumeration(new CompositionStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value - */ - public CodeType getConfidentialityElement() { - if (this.confidentiality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.confidentiality"); - else if (Configuration.doAutoCreate()) - this.confidentiality = new CodeType(); // bb - return this.confidentiality; - } - - public boolean hasConfidentialityElement() { - return this.confidentiality != null && !this.confidentiality.isEmpty(); - } - - public boolean hasConfidentiality() { - return this.confidentiality != null && !this.confidentiality.isEmpty(); - } - - /** - * @param value {@link #confidentiality} (The code specifying the level of confidentiality of the Composition.). This is the underlying object with id, value and extensions. The accessor "getConfidentiality" gives direct access to the value - */ - public Composition setConfidentialityElement(CodeType value) { - this.confidentiality = value; - return this; - } - - /** - * @return The code specifying the level of confidentiality of the Composition. - */ - public String getConfidentiality() { - return this.confidentiality == null ? null : this.confidentiality.getValue(); - } - - /** - * @param value The code specifying the level of confidentiality of the Composition. - */ - public Composition setConfidentiality(String value) { - if (Utilities.noString(value)) - this.confidentiality = null; - else { - if (this.confidentiality == null) - this.confidentiality = new CodeType(); - this.confidentiality.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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 Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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 Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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 setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for the information in the composition, not necessarily who typed it in.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for the information in the composition, not necessarily who typed it in.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public Composition addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for the information in the composition, not necessarily who typed it in.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) - */ - public List getAttester() { - if (this.attester == null) - this.attester = new ArrayList(); - return this.attester; - } - - public boolean hasAttester() { - if (this.attester == null) - return false; - for (CompositionAttesterComponent item : this.attester) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #attester} (A participant who has attested to the accuracy of the composition/document.) - */ - // syntactic sugar - public CompositionAttesterComponent addAttester() { //3 - CompositionAttesterComponent t = new CompositionAttesterComponent(); - if (this.attester == null) - this.attester = new ArrayList(); - this.attester.add(t); - return t; - } - - // syntactic sugar - public Composition addAttester(CompositionAttesterComponent t) { //3 - if (t == null) - return this; - if (this.attester == null) - this.attester = new ArrayList(); - this.attester.add(t); - return this; - } - - /** - * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Reference getCustodian() { - if (this.custodian == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.custodian"); - else if (Configuration.doAutoCreate()) - this.custodian = new Reference(); // cc - return this.custodian; - } - - public boolean hasCustodian() { - return this.custodian != null && !this.custodian.isEmpty(); - } - - /** - * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Composition setCustodian(Reference value) { - this.custodian = value; - return this; - } - - /** - * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Organization getCustodianTarget() { - if (this.custodianTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.custodian"); - else if (Configuration.doAutoCreate()) - this.custodianTarget = new Organization(); // aa - return this.custodianTarget; - } - - /** - * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.) - */ - public Composition setCustodianTarget(Organization value) { - this.custodianTarget = value; - return this; - } - - /** - * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (CompositionEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (The clinical service, such as a colonoscopy or an appendectomy, being documented.) - */ - // syntactic sugar - public CompositionEventComponent addEvent() { //3 - CompositionEventComponent t = new CompositionEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public Composition addEvent(CompositionEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @return {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Composition setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Composition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care this documentation is associated with.) - */ - public Composition setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #section} (The root of the sections that make up the composition.) - */ - public List getSection() { - if (this.section == null) - this.section = new ArrayList(); - return this.section; - } - - public boolean hasSection() { - if (this.section == null) - return false; - for (SectionComponent item : this.section) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #section} (The root of the sections that make up the composition.) - */ - // syntactic sugar - public SectionComponent addSection() { //3 - SectionComponent t = new SectionComponent(); - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return t; - } - - // syntactic sugar - public Composition addSection(SectionComponent t) { //3 - if (t == null) - return this; - if (this.section == null) - this.section = new ArrayList(); - this.section.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Logical identifier for the composition, assigned when created. This identifier stays constant as the composition is changed over time.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("type", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of the composition - helps for indexing and searching. This may be implied by or derived from the code specified in the Composition Type.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("title", "string", "Official human-readable label for the composition.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("status", "code", "The workflow/clinical status of this composition. The status is a marker for the clinical standing of the document.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, java.lang.Integer.MAX_VALUE, confidentiality)); - childrenList.add(new Property("subject", "Reference(Any)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Patient|RelatedPerson)", "Identifies who is responsible for the information in the composition, not necessarily who typed it in.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester)); - childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the composition/document information.", 0, java.lang.Integer.MAX_VALUE, custodian)); - childrenList.add(new Property("event", "", "The clinical service, such as a colonoscopy or an appendectomy, being documented.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("section", "", "The root of the sections that make up the composition.", 0, java.lang.Integer.MAX_VALUE, section)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // CodeableConcept - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1923018202: /*confidentiality*/ return this.confidentiality == null ? new Base[0] : new Base[] {this.confidentiality}; // CodeType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference - case 542920370: /*attester*/ return this.attester == null ? new Base[0] : this.attester.toArray(new Base[this.attester.size()]); // CompositionAttesterComponent - case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference - case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CompositionEventComponent - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 1970241253: /*section*/ return this.section == null ? new Base[0] : this.section.toArray(new Base[this.section.size()]); // SectionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case 94742904: // class - this.class_ = castToCodeableConcept(value); // CodeableConcept - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case -892481550: // status - this.status = new CompositionStatusEnumFactory().fromType(value); // Enumeration - break; - case -1923018202: // confidentiality - this.confidentiality = castToCode(value); // CodeType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -1406328437: // author - this.getAuthor().add(castToReference(value)); // Reference - break; - case 542920370: // attester - this.getAttester().add((CompositionAttesterComponent) value); // CompositionAttesterComponent - break; - case 1611297262: // custodian - this.custodian = castToReference(value); // Reference - break; - case 96891546: // event - this.getEvent().add((CompositionEventComponent) value); // CompositionEventComponent - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 1970241253: // section - this.getSection().add((SectionComponent) value); // SectionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("class")) - this.class_ = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("status")) - this.status = new CompositionStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("confidentiality")) - this.confidentiality = castToCode(value); // CodeType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("author")) - this.getAuthor().add(castToReference(value)); - else if (name.equals("attester")) - this.getAttester().add((CompositionAttesterComponent) value); - else if (name.equals("custodian")) - this.custodian = castToReference(value); // Reference - else if (name.equals("event")) - this.getEvent().add((CompositionEventComponent) value); - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("section")) - this.getSection().add((SectionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 3575610: return getType(); // CodeableConcept - case 94742904: return getClass_(); // CodeableConcept - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1923018202: throw new FHIRException("Cannot make property confidentiality as it is not a complex type"); // CodeType - case -1867885268: return getSubject(); // Reference - case -1406328437: return addAuthor(); // Reference - case 542920370: return addAttester(); // CompositionAttesterComponent - case 1611297262: return getCustodian(); // Reference - case 96891546: return addEvent(); // CompositionEventComponent - case 1524132147: return getEncounter(); // Reference - case 1970241253: return addSection(); // SectionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.date"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("class")) { - this.class_ = new CodeableConcept(); - return this.class_; - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.title"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.status"); - } - else if (name.equals("confidentiality")) { - throw new FHIRException("Cannot call addChild on a primitive type Composition.confidentiality"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("author")) { - return addAuthor(); - } - else if (name.equals("attester")) { - return addAttester(); - } - else if (name.equals("custodian")) { - this.custodian = new Reference(); - return this.custodian; - } - else if (name.equals("event")) { - return addEvent(); - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("section")) { - return addSection(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Composition"; - - } - - public Composition copy() { - Composition dst = new Composition(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.date = date == null ? null : date.copy(); - dst.type = type == null ? null : type.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - dst.title = title == null ? null : title.copy(); - dst.status = status == null ? null : status.copy(); - dst.confidentiality = confidentiality == null ? null : confidentiality.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - if (attester != null) { - dst.attester = new ArrayList(); - for (CompositionAttesterComponent i : attester) - dst.attester.add(i.copy()); - }; - dst.custodian = custodian == null ? null : custodian.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (CompositionEventComponent i : event) - dst.event.add(i.copy()); - }; - dst.encounter = encounter == null ? null : encounter.copy(); - if (section != null) { - dst.section = new ArrayList(); - for (SectionComponent i : section) - dst.section.add(i.copy()); - }; - return dst; - } - - protected Composition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Composition)) - return false; - Composition o = (Composition) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(type, o.type, true) - && compareDeep(class_, o.class_, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) - && compareDeep(confidentiality, o.confidentiality, true) && compareDeep(subject, o.subject, true) - && compareDeep(author, o.author, true) && compareDeep(attester, o.attester, true) && compareDeep(custodian, o.custodian, true) - && compareDeep(event, o.event, true) && compareDeep(encounter, o.encounter, true) && compareDeep(section, o.section, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Composition)) - return false; - Composition o = (Composition) other; - return compareValues(date, o.date, true) && compareValues(title, o.title, true) && compareValues(status, o.status, true) - && compareValues(confidentiality, o.confidentiality, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) && (title == null || title.isEmpty()) - && (status == null || status.isEmpty()) && (confidentiality == null || confidentiality.isEmpty()) - && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) && (attester == null || attester.isEmpty()) - && (custodian == null || custodian.isEmpty()) && (event == null || event.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (section == null || section.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Composition; - } - - /** - * Search parameter: status - *

- * Description: preliminary | final | amended | entered-in-error
- * Type: token
- * Path: Composition.status
- *

- */ - @SearchParamDefinition(name="status", path="Composition.status", description="preliminary | final | amended | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: preliminary | final | amended | entered-in-error
- * Type: token
- * Path: Composition.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: Who and/or what the composition is about
- * Type: reference
- * Path: Composition.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who and/or what the composition is about
- * Type: reference
- * Path: Composition.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Composition:subject").toLocked(); - - /** - * Search parameter: class - *

- * Description: Categorization of Composition
- * Type: token
- * Path: Composition.class
- *

- */ - @SearchParamDefinition(name="class", path="Composition.class", description="Categorization of Composition", type="token" ) - public static final String SP_CLASS = "class"; - /** - * Fluent Client search parameter constant for class - *

- * Description: Categorization of Composition
- * Type: token
- * Path: Composition.class
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS); - - /** - * Search parameter: encounter - *

- * Description: Context of the Composition
- * Type: reference
- * Path: Composition.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Composition.encounter", description="Context of the Composition", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Context of the Composition
- * Type: reference
- * Path: Composition.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Composition:encounter").toLocked(); - - /** - * Search parameter: period - *

- * Description: The period covered by the documentation
- * Type: date
- * Path: Composition.event.period
- *

- */ - @SearchParamDefinition(name="period", path="Composition.event.period", description="The period covered by the documentation", type="date" ) - public static final String SP_PERIOD = "period"; - /** - * Fluent Client search parameter constant for period - *

- * Description: The period covered by the documentation
- * Type: date
- * Path: Composition.event.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); - - /** - * Search parameter: type - *

- * Description: Kind of composition (LOINC if possible)
- * Type: token
- * Path: Composition.type
- *

- */ - @SearchParamDefinition(name="type", path="Composition.type", description="Kind of composition (LOINC if possible)", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Kind of composition (LOINC if possible)
- * Type: token
- * Path: Composition.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: Composition editing time
- * Type: date
- * Path: Composition.date
- *

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

- * Description: Composition editing time
- * Type: date
- * Path: Composition.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: section - *

- * Description: Classification of section (recommended)
- * Type: token
- * Path: Composition.section.code
- *

- */ - @SearchParamDefinition(name="section", path="Composition.section.code", description="Classification of section (recommended)", type="token" ) - public static final String SP_SECTION = "section"; - /** - * Fluent Client search parameter constant for section - *

- * Description: Classification of section (recommended)
- * Type: token
- * Path: Composition.section.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECTION); - - /** - * Search parameter: author - *

- * Description: Who and/or what authored the composition
- * Type: reference
- * Path: Composition.author
- *

- */ - @SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Who and/or what authored the composition
- * Type: reference
- * Path: Composition.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Composition:author").toLocked(); - - /** - * Search parameter: title - *

- * Description: Human Readable name/title
- * Type: string
- * Path: Composition.title
- *

- */ - @SearchParamDefinition(name="title", path="Composition.title", description="Human Readable name/title", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Human Readable name/title
- * Type: string
- * Path: Composition.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: patient - *

- * Description: Who and/or what the composition is about
- * Type: reference
- * Path: Composition.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Composition.subject", description="Who and/or what the composition is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Who and/or what the composition is about
- * Type: reference
- * Path: Composition.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Composition:patient").toLocked(); - - /** - * Search parameter: confidentiality - *

- * Description: As defined by affinity domain
- * Type: token
- * Path: Composition.confidentiality
- *

- */ - @SearchParamDefinition(name="confidentiality", path="Composition.confidentiality", description="As defined by affinity domain", type="token" ) - public static final String SP_CONFIDENTIALITY = "confidentiality"; - /** - * Fluent Client search parameter constant for confidentiality - *

- * Description: As defined by affinity domain
- * Type: token
- * Path: Composition.confidentiality
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONFIDENTIALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONFIDENTIALITY); - - /** - * Search parameter: attester - *

- * Description: Who attested the composition
- * Type: reference
- * Path: Composition.attester.party
- *

- */ - @SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference" ) - public static final String SP_ATTESTER = "attester"; - /** - * Fluent Client search parameter constant for attester - *

- * Description: Who attested the composition
- * Type: reference
- * Path: Composition.attester.party
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ATTESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ATTESTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition:attester". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ATTESTER = new ca.uhn.fhir.model.api.Include("Composition:attester").toLocked(); - - /** - * Search parameter: entry - *

- * Description: A reference to data that supports this section
- * Type: reference
- * Path: Composition.section.entry
- *

- */ - @SearchParamDefinition(name="entry", path="Composition.section.entry", description="A reference to data that supports this section", type="reference" ) - public static final String SP_ENTRY = "entry"; - /** - * Fluent Client search parameter constant for entry - *

- * Description: A reference to data that supports this section
- * Type: reference
- * Path: Composition.section.entry
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTRY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTRY); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Composition:entry". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTRY = new ca.uhn.fhir.model.api.Include("Composition:entry").toLocked(); - - /** - * Search parameter: context - *

- * Description: Code(s) that apply to the event being documented
- * Type: token
- * Path: Composition.event.code
- *

- */ - @SearchParamDefinition(name="context", path="Composition.event.code", description="Code(s) that apply to the event being documented", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: Code(s) that apply to the event being documented
- * Type: token
- * Path: Composition.event.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: identifier - *

- * Description: Logical identifier of composition (version-independent)
- * Type: token
- * Path: Composition.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Composition.identifier", description="Logical identifier of composition (version-independent)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Logical identifier of composition (version-independent)
- * Type: token
- * Path: Composition.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ConceptMap.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ConceptMap.java deleted file mode 100644 index 752cfa667d6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ConceptMap.java +++ /dev/null @@ -1,3031 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalence; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConceptMapEquivalenceEnumFactory; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. - */ -@ResourceDef(name="ConceptMap", profile="http://hl7.org/fhir/Profile/ConceptMap") -public class ConceptMap extends DomainResource { - - @Block() - public static class ConceptMapContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the concept map. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the concept map." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ConceptMapContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMapContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConceptMapContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the concept map. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the concept map. - */ - public ConceptMapContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ConceptMapContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ConceptMapContactComponent copy() { - ConceptMapContactComponent dst = new ConceptMapContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptMapContactComponent)) - return false; - ConceptMapContactComponent o = (ConceptMapContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptMapContactComponent)) - return false; - ConceptMapContactComponent o = (ConceptMapContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "ConceptMap.contact"; - - } - - } - - @Block() - public static class SourceElementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system). - */ - @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code System (if value set crosses code systems)", formalDefinition="An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system)." ) - protected UriType system; - - /** - * The specific version of the code system, as determined by the code system authority. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specific version of the code system", formalDefinition="The specific version of the code system, as determined by the code system authority." ) - protected StringType version; - - /** - * Identity (code or path) or the element/item being mapped. - */ - @Child(name = "code", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Identifies element being mapped", formalDefinition="Identity (code or path) or the element/item being mapped." ) - protected CodeType code; - - /** - * A concept from the target value set that this concept maps to. - */ - @Child(name = "target", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Concept in target system for element", formalDefinition="A concept from the target value set that this concept maps to." ) - protected List target; - - private static final long serialVersionUID = -387093487L; - - /** - * Constructor - */ - public SourceElementComponent() { - super(); - } - - /** - * @return {@link #system} (An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SourceElementComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public SourceElementComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system). - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system). - */ - public SourceElementComponent setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SourceElementComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public SourceElementComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The specific version of the code system, as determined by the code system authority. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The specific version of the code system, as determined by the code system authority. - */ - public SourceElementComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SourceElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item being mapped.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public SourceElementComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item being mapped. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item being mapped. - */ - public SourceElementComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (A concept from the target value set that this concept maps to.) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (TargetElementComponent item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (A concept from the target value set that this concept maps to.) - */ - // syntactic sugar - public TargetElementComponent addTarget() { //3 - TargetElementComponent t = new TargetElementComponent(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - // syntactic sugar - public SourceElementComponent addTarget(TargetElementComponent t) { //3 - if (t == null) - return this; - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI that identifies the Code System (if the source is a value set that crosses more than one code system).", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The specific version of the code system, as determined by the code system authority.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item being mapped.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("target", "", "A concept from the target value set that this concept maps to.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // TargetElementComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case -880905839: // target - this.getTarget().add((TargetElementComponent) value); // TargetElementComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("target")) - this.getTarget().add((TargetElementComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case -880905839: return addTarget(); // TargetElementComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.system"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.version"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.code"); - } - else if (name.equals("target")) { - return addTarget(); - } - else - return super.addChild(name); - } - - public SourceElementComponent copy() { - SourceElementComponent dst = new SourceElementComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (TargetElementComponent i : target) - dst.target.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SourceElementComponent)) - return false; - SourceElementComponent o = (SourceElementComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) - && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SourceElementComponent)) - return false; - SourceElementComponent o = (SourceElementComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (code == null || code.isEmpty()) && (target == null || target.isEmpty()); - } - - public String fhirType() { - return "ConceptMap.element"; - - } - - } - - @Block() - public static class TargetElementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). - */ - @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="System of the target (if necessary)", formalDefinition="An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems)." ) - protected UriType system; - - /** - * The specific version of the code system, as determined by the code system authority. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specific version of the code system", formalDefinition="The specific version of the code system, as determined by the code system authority." ) - protected StringType version; - - /** - * Identity (code or path) or the element/item that the map refers to. - */ - @Child(name = "code", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code that identifies the target element", formalDefinition="Identity (code or path) or the element/item that the map refers to." ) - protected CodeType code; - - /** - * The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). - */ - @Child(name = "equivalence", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="equivalent | equal | wider | subsumes | narrower | specializes | inexact | unmatched | disjoint", formalDefinition="The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source)." ) - protected Enumeration equivalence; - - /** - * A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - @Child(name = "comments", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description of status/issues in mapping", formalDefinition="A description of status/issues in mapping that conveys additional information not represented in the structured data." ) - protected StringType comments; - - /** - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value. - */ - @Child(name = "dependsOn", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Other elements 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 element can be resolved, and it has the specified value." ) - protected List dependsOn; - - /** - * A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element 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. - */ - @Child(name = "product", type = {OtherElementComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Other concepts that this mapping also produces", formalDefinition="A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element 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." ) - protected List product; - - private static final long serialVersionUID = 2147112127L; - - /** - * Constructor - */ - public TargetElementComponent() { - super(); - } - - /** - * Constructor - */ - public TargetElementComponent(Enumeration equivalence) { - super(); - this.equivalence = equivalence; - } - - /** - * @return {@link #system} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TargetElementComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public TargetElementComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems). - */ - public TargetElementComponent setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TargetElementComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The specific version of the code system, as determined by the code system authority.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public TargetElementComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The specific version of the code system, as determined by the code system authority. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The specific version of the code system, as determined by the code system authority. - */ - public TargetElementComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TargetElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item that the map refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public TargetElementComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item that the map refers to. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item that the map refers to. - */ - public TargetElementComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value - */ - public Enumeration getEquivalenceElement() { - if (this.equivalence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TargetElementComponent.equivalence"); - else if (Configuration.doAutoCreate()) - this.equivalence = new Enumeration(new ConceptMapEquivalenceEnumFactory()); // bb - return this.equivalence; - } - - public boolean hasEquivalenceElement() { - return this.equivalence != null && !this.equivalence.isEmpty(); - } - - public boolean hasEquivalence() { - return this.equivalence != null && !this.equivalence.isEmpty(); - } - - /** - * @param value {@link #equivalence} (The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).). This is the underlying object with id, value and extensions. The accessor "getEquivalence" gives direct access to the value - */ - public TargetElementComponent setEquivalenceElement(Enumeration value) { - this.equivalence = value; - return this; - } - - /** - * @return The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). - */ - public ConceptMapEquivalence getEquivalence() { - return this.equivalence == null ? null : this.equivalence.getValue(); - } - - /** - * @param value The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source). - */ - public TargetElementComponent setEquivalence(ConceptMapEquivalence value) { - if (this.equivalence == null) - this.equivalence = new Enumeration(new ConceptMapEquivalenceEnumFactory()); - this.equivalence.setValue(value); - return this; - } - - /** - * @return {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TargetElementComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (A description of status/issues in mapping that conveys additional information not represented in the structured data.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public TargetElementComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value A description of status/issues in mapping that conveys additional information not represented in the structured data. - */ - public TargetElementComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) - */ - public List getDependsOn() { - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - return this.dependsOn; - } - - public boolean hasDependsOn() { - if (this.dependsOn == null) - return false; - for (OtherElementComponent item : this.dependsOn) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dependsOn} (A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.) - */ - // syntactic sugar - public OtherElementComponent addDependsOn() { //3 - OtherElementComponent t = new OtherElementComponent(); - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - this.dependsOn.add(t); - return t; - } - - // syntactic sugar - public TargetElementComponent addDependsOn(OtherElementComponent t) { //3 - if (t == null) - return this; - if (this.dependsOn == null) - this.dependsOn = new ArrayList(); - this.dependsOn.add(t); - return this; - } - - /** - * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element 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 List getProduct() { - if (this.product == null) - this.product = new ArrayList(); - return this.product; - } - - public boolean hasProduct() { - if (this.product == null) - return false; - for (OtherElementComponent item : this.product) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #product} (A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element 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.) - */ - // syntactic sugar - public OtherElementComponent addProduct() { //3 - OtherElementComponent t = new OtherElementComponent(); - if (this.product == null) - this.product = new ArrayList(); - this.product.add(t); - return t; - } - - // syntactic sugar - public TargetElementComponent addProduct(OtherElementComponent t) { //3 - if (t == null) - return this; - if (this.product == null) - this.product = new ArrayList(); - this.product.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI that identifies the code system of the target code (if the target is a value set that cross code systems).", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The specific version of the code system, as determined by the code system authority.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "Identity (code or path) or the element/item that the map refers to.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("equivalence", "code", "The equivalence between the source and target concepts (counting for the dependencies and products). The equivalence is read from target to source (e.g. the target is 'wider' than the source).", 0, java.lang.Integer.MAX_VALUE, equivalence)); - childrenList.add(new Property("comments", "string", "A description of status/issues in mapping that conveys additional information not represented in the structured data.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("dependsOn", "", "A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can be resolved, and it has the specified value.", 0, java.lang.Integer.MAX_VALUE, dependsOn)); - childrenList.add(new Property("product", "@ConceptMap.element.target.dependsOn", "A set of additional outcomes from this mapping to other elements. To properly execute this mapping, the specified element 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.", 0, java.lang.Integer.MAX_VALUE, product)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case -15828692: /*equivalence*/ return this.equivalence == null ? new Base[0] : new Base[] {this.equivalence}; // Enumeration - case -602415628: /*comments*/ return this.comments == null ? new Base[0] : new Base[] {this.comments}; // StringType - case -1109214266: /*dependsOn*/ return this.dependsOn == null ? new Base[0] : this.dependsOn.toArray(new Base[this.dependsOn.size()]); // OtherElementComponent - case -309474065: /*product*/ return this.product == null ? new Base[0] : this.product.toArray(new Base[this.product.size()]); // OtherElementComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case -15828692: // equivalence - this.equivalence = new ConceptMapEquivalenceEnumFactory().fromType(value); // Enumeration - break; - case -602415628: // comments - this.comments = castToString(value); // StringType - break; - case -1109214266: // dependsOn - this.getDependsOn().add((OtherElementComponent) value); // OtherElementComponent - break; - case -309474065: // product - this.getProduct().add((OtherElementComponent) value); // OtherElementComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("equivalence")) - this.equivalence = new ConceptMapEquivalenceEnumFactory().fromType(value); // Enumeration - else if (name.equals("comments")) - this.comments = castToString(value); // StringType - else if (name.equals("dependsOn")) - this.getDependsOn().add((OtherElementComponent) value); - else if (name.equals("product")) - this.getProduct().add((OtherElementComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case -15828692: throw new FHIRException("Cannot make property equivalence as it is not a complex type"); // Enumeration - case -602415628: throw new FHIRException("Cannot make property comments as it is not a complex type"); // StringType - case -1109214266: return addDependsOn(); // OtherElementComponent - case -309474065: return addProduct(); // OtherElementComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.system"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.version"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.code"); - } - else if (name.equals("equivalence")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.equivalence"); - } - else if (name.equals("comments")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.comments"); - } - else if (name.equals("dependsOn")) { - return addDependsOn(); - } - else if (name.equals("product")) { - return addProduct(); - } - else - return super.addChild(name); - } - - public TargetElementComponent copy() { - TargetElementComponent dst = new TargetElementComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - dst.equivalence = equivalence == null ? null : equivalence.copy(); - dst.comments = comments == null ? null : comments.copy(); - if (dependsOn != null) { - dst.dependsOn = new ArrayList(); - for (OtherElementComponent i : dependsOn) - dst.dependsOn.add(i.copy()); - }; - if (product != null) { - dst.product = new ArrayList(); - for (OtherElementComponent i : product) - dst.product.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TargetElementComponent)) - return false; - TargetElementComponent o = (TargetElementComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(code, o.code, true) - && compareDeep(equivalence, o.equivalence, true) && compareDeep(comments, o.comments, true) && compareDeep(dependsOn, o.dependsOn, true) - && compareDeep(product, o.product, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TargetElementComponent)) - return false; - TargetElementComponent o = (TargetElementComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true) && compareValues(code, o.code, true) - && compareValues(equivalence, o.equivalence, true) && compareValues(comments, o.comments, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (code == null || code.isEmpty()) && (equivalence == null || equivalence.isEmpty()) && (comments == null || comments.isEmpty()) - && (dependsOn == null || dependsOn.isEmpty()) && (product == null || product.isEmpty()); - } - - public String fhirType() { - return "ConceptMap.element.target"; - - } - - } - - @Block() - public static class OtherElementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - @Child(name = "element", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reference to element/field/ValueSet mapping depends on", 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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition." ) - protected UriType element; - - /** - * An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). - */ - @Child(name = "system", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code System (if necessary)", formalDefinition="An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems)." ) - protected UriType system; - - /** - * Identity (code or path) or the element/item/ValueSet that the map depends on / refers to. - */ - @Child(name = "code", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Value of the referenced element", formalDefinition="Identity (code or path) or the element/item/ValueSet that the map depends on / refers to." ) - protected StringType code; - - private static final long serialVersionUID = 1365816253L; - - /** - * Constructor - */ - public OtherElementComponent() { - super(); - } - - /** - * Constructor - */ - public OtherElementComponent(UriType element, UriType system, StringType code) { - super(); - this.element = element; - this.system = system; - this.code = code; - } - - /** - * @return {@link #element} (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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public UriType getElementElement() { - if (this.element == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.element"); - else if (Configuration.doAutoCreate()) - this.element = new UriType(); // bb - return this.element; - } - - public boolean hasElementElement() { - return this.element != null && !this.element.isEmpty(); - } - - public boolean hasElement() { - return this.element != null && !this.element.isEmpty(); - } - - /** - * @param value {@link #element} (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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public OtherElementComponent setElementElement(UriType value) { - this.element = value; - return this; - } - - /** - * @return 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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - public String getElement() { - return this.element == null ? null : this.element.getValue(); - } - - /** - * @param value 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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition. - */ - public OtherElementComponent setElement(String value) { - if (this.element == null) - this.element = new UriType(); - this.element.setValue(value); - return this; - } - - /** - * @return {@link #system} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public OtherElementComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems). - */ - public OtherElementComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #code} (Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public StringType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OtherElementComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new StringType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OtherElementComponent setCodeElement(StringType value) { - this.code = value; - return this; - } - - /** - * @return Identity (code or path) or the element/item/ValueSet that the map depends on / refers to. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Identity (code or path) or the element/item/ValueSet that the map depends on / refers to. - */ - public OtherElementComponent setCode(String value) { - if (this.code == null) - this.code = new StringType(); - this.code.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "uri", "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. HL7 v2) or a general reference to a kind of data field, or a reference to a value set with an appropriately narrow definition.", 0, java.lang.Integer.MAX_VALUE, element)); - childrenList.add(new Property("system", "uri", "An absolute URI that identifies the code system of the dependency code (if the source/dependency is a value set that crosses code systems).", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("code", "string", "Identity (code or path) or the element/item/ValueSet that the map depends on / refers to.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // UriType - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1662836996: // element - this.element = castToUri(value); // UriType - break; - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 3059181: // code - this.code = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("element")) - this.element = castToUri(value); // UriType - else if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("code")) - this.code = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // UriType - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("element")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.element"); - } - else if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.system"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.code"); - } - else - return super.addChild(name); - } - - public OtherElementComponent copy() { - OtherElementComponent dst = new OtherElementComponent(); - copyValues(dst); - dst.element = element == null ? null : element.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OtherElementComponent)) - return false; - OtherElementComponent o = (OtherElementComponent) other; - return compareDeep(element, o.element, true) && compareDeep(system, o.system, true) && compareDeep(code, o.code, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OtherElementComponent)) - return false; - OtherElementComponent o = (OtherElementComponent) other; - return compareValues(element, o.element, true) && compareValues(system, o.system, true) && compareValues(code, o.code, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()) && (system == null || system.isEmpty()) - && (code == null || code.isEmpty()); - } - - public String fhirType() { - return "ConceptMap.element.target.dependsOn"; - - } - - } - - /** - * An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Globally unique logical id for concept map", formalDefinition="An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional identifier for the concept map", formalDefinition="Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * 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. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType version; - - /** - * A free text natural language name describing the concept map. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this concept map", formalDefinition="A free text natural language name describing the concept map." ) - protected StringType name; - - /** - * The status of the concept map. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the concept map." ) - protected Enumeration status; - - /** - * This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the concept map. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the concept map." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for given status", formalDefinition="The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes." ) - protected DateTimeType date; - - /** - * A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances." ) - protected List useContext; - - /** - * Explains why this concept map is needed and why it has been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why needed", formalDefinition="Explains why this concept map is needed and why it has been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the concept map and/or its contents. - */ - @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the concept map and/or its contents." ) - protected StringType copyright; - - /** - * The source value set that specifies the concepts that are being mapped. - */ - @Child(name = "source", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=13, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifies the source of the concepts which are being mapped", formalDefinition="The source value set that specifies the concepts that are being mapped." ) - protected Type source; - - /** - * 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. - */ - @Child(name = "target", type = {UriType.class, ValueSet.class, StructureDefinition.class}, order=14, min=1, max=1, modifier=false, summary=true) - @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." ) - protected Type target; - - /** - * Mappings for an individual concept in the source to one or more concepts in the target. - */ - @Child(name = "element", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Mappings for a concept from the source set", formalDefinition="Mappings for an individual concept in the source to one or more concepts in the target." ) - protected List element; - - private static final long serialVersionUID = 1687563642L; - - /** - * Constructor - */ - public ConceptMap() { - super(); - } - - /** - * Constructor - */ - public ConceptMap(Enumeration status, Type source, Type target) { - super(); - this.status = status; - this.source = source; - this.target = target; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ConceptMap setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published. - */ - public ConceptMap setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public ConceptMap setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (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.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (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.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConceptMap setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return 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 String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value 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 value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name describing the concept map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConceptMap setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the concept map. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the concept map. - */ - public ConceptMap setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the concept map.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ConceptMap setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the concept map. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the concept map. - */ - public ConceptMap setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ConceptMap setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value 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 value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the concept map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ConceptMap setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the concept map. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the concept map. - */ - public ConceptMap setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ConceptMapContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ConceptMapContactComponent addContact() { //3 - ConceptMapContactComponent t = new ConceptMapContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ConceptMap addContact(ConceptMapContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ConceptMap setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes. - */ - public ConceptMap setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConceptMap setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc. - */ - public ConceptMap setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public ConceptMap addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this concept map is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this concept map is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ConceptMap setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this concept map is needed and why it has been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this concept map is needed and why it has been constrained as it has. - */ - public ConceptMap setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptMap.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the concept map and/or its contents.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ConceptMap setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the concept map and/or its contents. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the concept map and/or its contents. - */ - public ConceptMap setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public Type getSource() { - return this.source; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public UriType getSourceUriType() throws FHIRException { - if (!(this.source instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); - return (UriType) this.source; - } - - public boolean hasSourceUriType() { - return this.source instanceof UriType; - } - - /** - * @return {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public Reference getSourceReference() throws FHIRException { - if (!(this.source instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); - return (Reference) this.source; - } - - public boolean hasSourceReference() { - return this.source instanceof Reference; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source value set that specifies the concepts that are being mapped.) - */ - public ConceptMap setSource(Type value) { - this.source = value; - return this; - } - - /** - * @return {@link #target} (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 Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (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 UriType getTargetUriType() throws FHIRException { - if (!(this.target instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.target.getClass().getName()+" was encountered"); - return (UriType) this.target; - } - - public boolean hasTargetUriType() { - return this.target instanceof UriType; - } - - /** - * @return {@link #target} (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 Reference getTargetReference() throws FHIRException { - if (!(this.target instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTargetReference() { - return this.target instanceof Reference; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (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(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (SourceElementComponent item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Mappings for an individual concept in the source to one or more concepts in the target.) - */ - // syntactic sugar - public SourceElementComponent addElement() { //3 - SourceElementComponent t = new SourceElementComponent(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public ConceptMap addElement(SourceElementComponent t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this concept map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this concept map is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this concept map when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "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.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the concept map.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the concept map.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This ConceptMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the concept map.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date this version of the concept map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the concept map changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the concept map - reason for definition, conditions of use, etc.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of concept map instances.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this concept map is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the concept map and/or its contents.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("source[x]", "uri|Reference(ValueSet|StructureDefinition)", "The source value set that specifies the concepts that are being mapped.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target[x]", "uri|Reference(ValueSet|StructureDefinition)", "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.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("element", "", "Mappings for an individual concept in the source to one or more concepts in the target.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ConceptMapContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Type - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type - case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // SourceElementComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ConceptMapContactComponent) value); // ConceptMapContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case -896505829: // source - this.source = (Type) value; // Type - break; - case -880905839: // target - this.target = (Type) value; // Type - break; - case -1662836996: // element - this.getElement().add((SourceElementComponent) value); // SourceElementComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ConceptMapContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("source[x]")) - this.source = (Type) value; // Type - else if (name.equals("target[x]")) - this.target = (Type) value; // Type - else if (name.equals("element")) - this.getElement().add((SourceElementComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return getIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // ConceptMapContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case -1698413947: return getSource(); // Type - case -815579825: return getTarget(); // Type - case -1662836996: return addElement(); // SourceElementComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.url"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type ConceptMap.copyright"); - } - else if (name.equals("sourceUri")) { - this.source = new UriType(); - return this.source; - } - else if (name.equals("sourceReference")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("targetUri")) { - this.target = new UriType(); - return this.target; - } - else if (name.equals("targetReference")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("element")) { - return addElement(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ConceptMap"; - - } - - public ConceptMap copy() { - ConceptMap dst = new ConceptMap(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ConceptMapContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.source = source == null ? null : source.copy(); - dst.target = target == null ? null : target.copy(); - if (element != null) { - dst.element = new ArrayList(); - for (SourceElementComponent i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - protected ConceptMap typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptMap)) - return false; - ConceptMap o = (ConceptMap) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) - && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) && compareDeep(element, o.element, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptMap)) - return false; - ConceptMap o = (ConceptMap) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) - && (element == null || element.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ConceptMap; - } - - /** - * Search parameter: source-system - *

- * Description: Code System (if value set crosses code systems)
- * Type: uri
- * Path: ConceptMap.element.system
- *

- */ - @SearchParamDefinition(name="source-system", path="ConceptMap.element.system", description="Code System (if value set crosses code systems)", type="uri" ) - public static final String SP_SOURCE_SYSTEM = "source-system"; - /** - * Fluent Client search parameter constant for source-system - *

- * Description: Code System (if value set crosses code systems)
- * Type: uri
- * Path: ConceptMap.element.system
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SOURCE_SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SOURCE_SYSTEM); - - /** - * Search parameter: dependson - *

- * Description: Reference to element/field/ValueSet mapping depends on
- * Type: uri
- * Path: ConceptMap.element.target.dependsOn.element
- *

- */ - @SearchParamDefinition(name="dependson", path="ConceptMap.element.target.dependsOn.element", description="Reference to element/field/ValueSet mapping depends on", type="uri" ) - public static final String SP_DEPENDSON = "dependson"; - /** - * Fluent Client search parameter constant for dependson - *

- * Description: Reference to element/field/ValueSet mapping depends on
- * Type: uri
- * Path: ConceptMap.element.target.dependsOn.element
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam DEPENDSON = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEPENDSON); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: url - *

- * Description: The URL of the concept map
- * Type: uri
- * Path: ConceptMap.url
- *

- */ - @SearchParamDefinition(name="url", path="ConceptMap.url", description="The URL of the concept map", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The URL of the concept map
- * Type: uri
- * Path: ConceptMap.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: target-code - *

- * Description: Code that identifies the target element
- * Type: token
- * Path: ConceptMap.element.target.code
- *

- */ - @SearchParamDefinition(name="target-code", path="ConceptMap.element.target.code", description="Code that identifies the target element", type="token" ) - public static final String SP_TARGET_CODE = "target-code"; - /** - * Fluent Client search parameter constant for target-code - *

- * Description: Code that identifies the target element
- * Type: token
- * Path: ConceptMap.element.target.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET_CODE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: product - *

- * Description: Reference to element/field/ValueSet mapping depends on
- * Type: uri
- * Path: ConceptMap.element.target.product.element
- *

- */ - @SearchParamDefinition(name="product", path="ConceptMap.element.target.product.element", description="Reference to element/field/ValueSet mapping depends on", type="uri" ) - public static final String SP_PRODUCT = "product"; - /** - * Fluent Client search parameter constant for product - *

- * Description: Reference to element/field/ValueSet mapping depends on
- * Type: uri
- * Path: ConceptMap.element.target.product.element
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam PRODUCT = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_PRODUCT); - - /** - * Search parameter: source-code - *

- * Description: Identifies element being mapped
- * Type: token
- * Path: ConceptMap.element.code
- *

- */ - @SearchParamDefinition(name="source-code", path="ConceptMap.element.code", description="Identifies element being mapped", type="token" ) - public static final String SP_SOURCE_CODE = "source-code"; - /** - * Fluent Client search parameter constant for source-code - *

- * Description: Identifies element being mapped
- * Type: token
- * Path: ConceptMap.element.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SOURCE_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SOURCE_CODE); - - /** - * Search parameter: source-uri - *

- * Description: Identifies the source of the concepts which are being mapped
- * Type: reference
- * Path: ConceptMap.sourceUri
- *

- */ - @SearchParamDefinition(name="source-uri", path="ConceptMap.source.as(Uri)", description="Identifies the source of the concepts which are being mapped", type="reference" ) - public static final String SP_SOURCE_URI = "source-uri"; - /** - * Fluent Client search parameter constant for source-uri - *

- * Description: Identifies the source of the concepts which are being mapped
- * Type: reference
- * Path: ConceptMap.sourceUri
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE_URI = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE_URI); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ConceptMap:source-uri". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE_URI = new ca.uhn.fhir.model.api.Include("ConceptMap:source-uri").toLocked(); - - /** - * Search parameter: source - *

- * Description: Identifies the source of the concepts which are being mapped
- * Type: reference
- * Path: ConceptMap.sourceReference
- *

- */ - @SearchParamDefinition(name="source", path="ConceptMap.source.as(Reference)", description="Identifies the source of the concepts which are being mapped", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Identifies the source of the concepts which are being mapped
- * Type: reference
- * Path: ConceptMap.sourceReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ConceptMap:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("ConceptMap:source").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the concept map
- * Type: token
- * Path: ConceptMap.useContext
- *

- */ - @SearchParamDefinition(name="context", path="ConceptMap.useContext", description="A use context assigned to the concept map", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the concept map
- * Type: token
- * Path: ConceptMap.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: target - *

- * Description: Provides context to the mappings
- * Type: reference
- * Path: ConceptMap.target[x]
- *

- */ - @SearchParamDefinition(name="target", path="ConceptMap.target", description="Provides context to the mappings", type="reference" ) - public static final String SP_TARGET = "target"; - /** - * Fluent Client search parameter constant for target - *

- * Description: Provides context to the mappings
- * Type: reference
- * Path: ConceptMap.target[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ConceptMap:target". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("ConceptMap:target").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Additional identifier for the concept map
- * Type: token
- * Path: ConceptMap.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ConceptMap.identifier", description="Additional identifier for the concept map", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Additional identifier for the concept map
- * Type: token
- * Path: ConceptMap.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: target-system - *

- * Description: System of the target (if necessary)
- * Type: uri
- * Path: ConceptMap.element.target.system
- *

- */ - @SearchParamDefinition(name="target-system", path="ConceptMap.element.target.system", description="System of the target (if necessary)", type="uri" ) - public static final String SP_TARGET_SYSTEM = "target-system"; - /** - * Fluent Client search parameter constant for target-system - *

- * Description: System of the target (if necessary)
- * Type: uri
- * Path: ConceptMap.element.target.system
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam TARGET_SYSTEM = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_TARGET_SYSTEM); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Condition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Condition.java deleted file mode 100644 index 3fd6b3bbd65..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Condition.java +++ /dev/null @@ -1,2132 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * 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. - */ -@ResourceDef(name="Condition", profile="http://hl7.org/fhir/Profile/Condition") -public class Condition extends DomainResource { - - public enum ConditionVerificationStatus { - /** - * This is a tentative diagnosis - still a candidate that is under consideration. - */ - PROVISIONAL, - /** - * One of a set of potential (and typically mutually exclusive) diagnosis asserted to further guide the diagnostic process and preliminary treatment. - */ - DIFFERENTIAL, - /** - * There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. - */ - CONFIRMED, - /** - * This condition has been ruled out by diagnostic and clinical evidence. - */ - REFUTED, - /** - * The statement was entered in error and is not valid. - */ - ENTEREDINERROR, - /** - * The condition status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static ConditionVerificationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("provisional".equals(codeString)) - return PROVISIONAL; - if ("differential".equals(codeString)) - return DIFFERENTIAL; - if ("confirmed".equals(codeString)) - return CONFIRMED; - if ("refuted".equals(codeString)) - return REFUTED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new FHIRException("Unknown ConditionVerificationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROVISIONAL: return "provisional"; - case DIFFERENTIAL: return "differential"; - case CONFIRMED: return "confirmed"; - case REFUTED: return "refuted"; - case ENTEREDINERROR: return "entered-in-error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROVISIONAL: return "http://hl7.org/fhir/condition-ver-status"; - case DIFFERENTIAL: return "http://hl7.org/fhir/condition-ver-status"; - case CONFIRMED: return "http://hl7.org/fhir/condition-ver-status"; - case REFUTED: return "http://hl7.org/fhir/condition-ver-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/condition-ver-status"; - case UNKNOWN: return "http://hl7.org/fhir/condition-ver-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROVISIONAL: return "This is a tentative diagnosis - still a candidate that is under consideration."; - case DIFFERENTIAL: return "One of a set of potential (and typically mutually exclusive) diagnosis asserted to further guide the diagnostic process and preliminary treatment."; - case CONFIRMED: return "There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition."; - case REFUTED: return "This condition has been ruled out by diagnostic and clinical evidence."; - case ENTEREDINERROR: return "The statement was entered in error and is not valid."; - case UNKNOWN: return "The condition status is unknown. Note that \"unknown\" is a value of last resort and every attempt should be made to provide a meaningful value other than \"unknown\"."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROVISIONAL: return "Provisional"; - case DIFFERENTIAL: return "Differential"; - case CONFIRMED: return "Confirmed"; - case REFUTED: return "Refuted"; - case ENTEREDINERROR: return "Entered In Error"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class ConditionVerificationStatusEnumFactory implements EnumFactory { - public ConditionVerificationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("provisional".equals(codeString)) - return ConditionVerificationStatus.PROVISIONAL; - if ("differential".equals(codeString)) - return ConditionVerificationStatus.DIFFERENTIAL; - if ("confirmed".equals(codeString)) - return ConditionVerificationStatus.CONFIRMED; - if ("refuted".equals(codeString)) - return ConditionVerificationStatus.REFUTED; - if ("entered-in-error".equals(codeString)) - return ConditionVerificationStatus.ENTEREDINERROR; - if ("unknown".equals(codeString)) - return ConditionVerificationStatus.UNKNOWN; - throw new IllegalArgumentException("Unknown ConditionVerificationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("provisional".equals(codeString)) - return new Enumeration(this, ConditionVerificationStatus.PROVISIONAL); - if ("differential".equals(codeString)) - return new Enumeration(this, ConditionVerificationStatus.DIFFERENTIAL); - if ("confirmed".equals(codeString)) - return new Enumeration(this, ConditionVerificationStatus.CONFIRMED); - if ("refuted".equals(codeString)) - return new Enumeration(this, ConditionVerificationStatus.REFUTED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, ConditionVerificationStatus.ENTEREDINERROR); - if ("unknown".equals(codeString)) - return new Enumeration(this, ConditionVerificationStatus.UNKNOWN); - throw new FHIRException("Unknown ConditionVerificationStatus code '"+codeString+"'"); - } - public String toCode(ConditionVerificationStatus code) { - if (code == ConditionVerificationStatus.PROVISIONAL) - return "provisional"; - if (code == ConditionVerificationStatus.DIFFERENTIAL) - return "differential"; - if (code == ConditionVerificationStatus.CONFIRMED) - return "confirmed"; - if (code == ConditionVerificationStatus.REFUTED) - return "refuted"; - if (code == ConditionVerificationStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == ConditionVerificationStatus.UNKNOWN) - return "unknown"; - return "?"; - } - public String toSystem(ConditionVerificationStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class ConditionStageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific. - */ - @Child(name = "summary", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept summary; - - /** - * Reference to a formal record of the evidence on which the staging assessment is based. - */ - @Child(name = "assessment", type = {ClinicalImpression.class, DiagnosticReport.class, Observation.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Formal record of assessment", formalDefinition="Reference to a formal record of the evidence on which the staging assessment is based." ) - protected List assessment; - /** - * The actual objects that are the target of the reference (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - protected List assessmentTarget; - - - private static final long serialVersionUID = -1961530405L; - - /** - * Constructor - */ - public ConditionStageComponent() { - super(); - } - - /** - * @return {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) - */ - public CodeableConcept getSummary() { - if (this.summary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionStageComponent.summary"); - else if (Configuration.doAutoCreate()) - this.summary = new CodeableConcept(); // cc - return this.summary; - } - - public boolean hasSummary() { - return this.summary != null && !this.summary.isEmpty(); - } - - /** - * @param value {@link #summary} (A simple summary of the stage such as "Stage 3". The determination of the stage is disease-specific.) - */ - public ConditionStageComponent setSummary(CodeableConcept value) { - this.summary = value; - return this; - } - - /** - * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - public List getAssessment() { - if (this.assessment == null) - this.assessment = new ArrayList(); - return this.assessment; - } - - public boolean hasAssessment() { - if (this.assessment == null) - return false; - for (Reference item : this.assessment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #assessment} (Reference to a formal record of the evidence on which the staging assessment is based.) - */ - // syntactic sugar - public Reference addAssessment() { //3 - Reference t = new Reference(); - if (this.assessment == null) - this.assessment = new ArrayList(); - this.assessment.add(t); - return t; - } - - // syntactic sugar - public ConditionStageComponent addAssessment(Reference t) { //3 - if (t == null) - return this; - if (this.assessment == null) - this.assessment = new ArrayList(); - this.assessment.add(t); - return this; - } - - /** - * @return {@link #assessment} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to a formal record of the evidence on which the staging assessment is based.) - */ - public List getAssessmentTarget() { - if (this.assessmentTarget == null) - this.assessmentTarget = new ArrayList(); - return this.assessmentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("summary", "CodeableConcept", "A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific.", 0, java.lang.Integer.MAX_VALUE, summary)); - childrenList.add(new Property("assessment", "Reference(ClinicalImpression|DiagnosticReport|Observation)", "Reference to a formal record of the evidence on which the staging assessment is based.", 0, java.lang.Integer.MAX_VALUE, assessment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1857640538: /*summary*/ return this.summary == null ? new Base[0] : new Base[] {this.summary}; // CodeableConcept - case 2119382722: /*assessment*/ return this.assessment == null ? new Base[0] : this.assessment.toArray(new Base[this.assessment.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1857640538: // summary - this.summary = castToCodeableConcept(value); // CodeableConcept - break; - case 2119382722: // assessment - this.getAssessment().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("summary")) - this.summary = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("assessment")) - this.getAssessment().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1857640538: return getSummary(); // CodeableConcept - case 2119382722: return addAssessment(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("summary")) { - this.summary = new CodeableConcept(); - return this.summary; - } - else if (name.equals("assessment")) { - return addAssessment(); - } - else - return super.addChild(name); - } - - public ConditionStageComponent copy() { - ConditionStageComponent dst = new ConditionStageComponent(); - copyValues(dst); - dst.summary = summary == null ? null : summary.copy(); - if (assessment != null) { - dst.assessment = new ArrayList(); - for (Reference i : assessment) - dst.assessment.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionStageComponent)) - return false; - ConditionStageComponent o = (ConditionStageComponent) other; - return compareDeep(summary, o.summary, true) && compareDeep(assessment, o.assessment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionStageComponent)) - return false; - ConditionStageComponent o = (ConditionStageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (summary == null || summary.isEmpty()) && (assessment == null || assessment.isEmpty()) - ; - } - - public String fhirType() { - return "Condition.stage"; - - } - - } - - @Block() - public static class ConditionEvidenceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A manifestation or symptom that led to the recording of this condition. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Manifestation/symptom", formalDefinition="A manifestation or symptom that led to the recording of this condition." ) - protected CodeableConcept code; - - /** - * Links to other relevant information, including pathology reports. - */ - @Child(name = "detail", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Supporting information found elsewhere", formalDefinition="Links to other relevant information, including pathology reports." ) - protected List detail; - /** - * The actual objects that are the target of the reference (Links to other relevant information, including pathology reports.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = 945689926L; - - /** - * Constructor - */ - public ConditionEvidenceComponent() { - super(); - } - - /** - * @return {@link #code} (A manifestation or symptom that led to the recording of this condition.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConditionEvidenceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A manifestation or symptom that led to the recording of this condition.) - */ - public ConditionEvidenceComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #detail} (Links to other relevant information, including pathology reports.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Links to other relevant information, including pathology reports.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ConditionEvidenceComponent addDetail(Reference t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Links to other relevant information, including pathology reports.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A manifestation or symptom that led to the recording of this condition.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("detail", "Reference(Any)", "Links to other relevant information, including pathology reports.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1335224239: // detail - this.getDetail().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("detail")) - this.getDetail().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -1335224239: return addDetail(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public ConditionEvidenceComponent copy() { - ConditionEvidenceComponent dst = new ConditionEvidenceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConditionEvidenceComponent)) - return false; - ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; - return compareDeep(code, o.code, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConditionEvidenceComponent)) - return false; - ConditionEvidenceComponent o = (ConditionEvidenceComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - public String fhirType() { - return "Condition.evidence"; - - } - - } - - /** - * This records identifiers associated with this condition 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this condition", formalDefinition="This records identifiers associated with this condition 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)." ) - protected List identifier; - - /** - * Indicates the patient who the condition record is associated with. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who has the condition?", formalDefinition="Indicates the patient who the condition record is associated with." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Indicates the patient who the condition record is associated with.) - */ - protected Patient patientTarget; - - /** - * Encounter during which the condition was first asserted. - */ - @Child(name = "encounter", type = {Encounter.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Encounter when condition first asserted", formalDefinition="Encounter during which the condition was first asserted." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Encounter during which the condition was first asserted.) - */ - protected Encounter encounterTarget; - - /** - * Individual who is making the condition statement. - */ - @Child(name = "asserter", type = {Practitioner.class, Patient.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Person who asserts this condition", formalDefinition="Individual who is making the condition statement." ) - protected Reference asserter; - - /** - * The actual object that is the target of the reference (Individual who is making the condition statement.) - */ - protected Resource asserterTarget; - - /** - * A date, when the Condition statement was documented. - */ - @Child(name = "dateRecorded", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When first entered", formalDefinition="A date, when the Condition statement was documented." ) - protected DateType dateRecorded; - - /** - * Identification of the condition, problem or diagnosis. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identification of the condition, problem or diagnosis", formalDefinition="Identification of the condition, problem or diagnosis." ) - protected CodeableConcept code; - - /** - * A category assigned to the condition. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="complaint | symptom | finding | diagnosis", formalDefinition="A category assigned to the condition." ) - protected CodeableConcept category; - - /** - * The clinical status of the condition. - */ - @Child(name = "clinicalStatus", type = {CodeType.class}, order=7, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | relapse | remission | resolved", formalDefinition="The clinical status of the condition." ) - protected CodeType clinicalStatus; - - /** - * The verification status to support the clinical status of the condition. - */ - @Child(name = "verificationStatus", type = {CodeType.class}, order=8, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="provisional | differential | confirmed | refuted | entered-in-error | unknown", formalDefinition="The verification status to support the clinical status of the condition." ) - protected Enumeration verificationStatus; - - /** - * A subjective assessment of the severity of the condition as evaluated by the clinician. - */ - @Child(name = "severity", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Subjective severity of condition", formalDefinition="A subjective assessment of the severity of the condition as evaluated by the clinician." ) - protected CodeableConcept severity; - - /** - * Estimated or actual date or date-time the condition began, in the opinion of the clinician. - */ - @Child(name = "onset", type = {DateTimeType.class, Age.class, Period.class, Range.class, StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Estimated or actual date, date-time, or age", formalDefinition="Estimated or actual date or date-time the condition began, in the opinion of the clinician." ) - protected Type onset; - - /** - * 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. - */ - @Child(name = "abatement", type = {DateTimeType.class, Age.class, BooleanType.class, Period.class, Range.class, StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Type abatement; - - /** - * Clinical stage or grade of a condition. May include formal severity assessments. - */ - @Child(name = "stage", type = {}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Stage/grade, usually assessed formally", formalDefinition="Clinical stage or grade of a condition. May include formal severity assessments." ) - protected ConditionStageComponent stage; - - /** - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. - */ - @Child(name = "evidence", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Supporting evidence", formalDefinition="Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed." ) - protected List evidence; - - /** - * The anatomical location where this condition manifests itself. - */ - @Child(name = "bodySite", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Anatomical location, if relevant", formalDefinition="The anatomical location where this condition manifests itself." ) - protected List bodySite; - - /** - * Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType notes; - - private static final long serialVersionUID = -341227215L; - - /** - * Constructor - */ - public Condition() { - super(); - } - - /** - * Constructor - */ - public Condition(Reference patient, CodeableConcept code, Enumeration verificationStatus) { - super(); - this.patient = patient; - this.code = code; - this.verificationStatus = verificationStatus; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this condition 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this condition 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Condition addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (Indicates the patient who the condition record is associated with.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Indicates the patient who the condition record is associated with.) - */ - public Condition setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the patient who the condition record is associated with.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the patient who the condition record is associated with.) - */ - public Condition setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #encounter} (Encounter during which the condition was first asserted.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Encounter during which the condition was first asserted.) - */ - public Condition setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which the condition was first asserted.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which the condition was first asserted.) - */ - public Condition setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #asserter} (Individual who is making the condition statement.) - */ - public Reference getAsserter() { - if (this.asserter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.asserter"); - else if (Configuration.doAutoCreate()) - this.asserter = new Reference(); // cc - return this.asserter; - } - - public boolean hasAsserter() { - return this.asserter != null && !this.asserter.isEmpty(); - } - - /** - * @param value {@link #asserter} (Individual who is making the condition statement.) - */ - public Condition setAsserter(Reference value) { - this.asserter = value; - return this; - } - - /** - * @return {@link #asserter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual who is making the condition statement.) - */ - public Resource getAsserterTarget() { - return this.asserterTarget; - } - - /** - * @param value {@link #asserter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual who is making the condition statement.) - */ - public Condition setAsserterTarget(Resource value) { - this.asserterTarget = value; - return this; - } - - /** - * @return {@link #dateRecorded} (A date, when the Condition statement was documented.). This is the underlying object with id, value and extensions. The accessor "getDateRecorded" gives direct access to the value - */ - public DateType getDateRecordedElement() { - if (this.dateRecorded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.dateRecorded"); - else if (Configuration.doAutoCreate()) - this.dateRecorded = new DateType(); // bb - return this.dateRecorded; - } - - public boolean hasDateRecordedElement() { - return this.dateRecorded != null && !this.dateRecorded.isEmpty(); - } - - public boolean hasDateRecorded() { - return this.dateRecorded != null && !this.dateRecorded.isEmpty(); - } - - /** - * @param value {@link #dateRecorded} (A date, when the Condition statement was documented.). This is the underlying object with id, value and extensions. The accessor "getDateRecorded" gives direct access to the value - */ - public Condition setDateRecordedElement(DateType value) { - this.dateRecorded = value; - return this; - } - - /** - * @return A date, when the Condition statement was documented. - */ - public Date getDateRecorded() { - return this.dateRecorded == null ? null : this.dateRecorded.getValue(); - } - - /** - * @param value A date, when the Condition statement was documented. - */ - public Condition setDateRecorded(Date value) { - if (value == null) - this.dateRecorded = null; - else { - if (this.dateRecorded == null) - this.dateRecorded = new DateType(); - this.dateRecorded.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Identification of the condition, problem or diagnosis.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Identification of the condition, problem or diagnosis.) - */ - public Condition setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #category} (A category assigned to the condition.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (A category assigned to the condition.) - */ - public Condition setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value - */ - public CodeType getClinicalStatusElement() { - if (this.clinicalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.clinicalStatus"); - else if (Configuration.doAutoCreate()) - this.clinicalStatus = new CodeType(); // bb - return this.clinicalStatus; - } - - public boolean hasClinicalStatusElement() { - return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); - } - - public boolean hasClinicalStatus() { - return this.clinicalStatus != null && !this.clinicalStatus.isEmpty(); - } - - /** - * @param value {@link #clinicalStatus} (The clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getClinicalStatus" gives direct access to the value - */ - public Condition setClinicalStatusElement(CodeType value) { - this.clinicalStatus = value; - return this; - } - - /** - * @return The clinical status of the condition. - */ - public String getClinicalStatus() { - return this.clinicalStatus == null ? null : this.clinicalStatus.getValue(); - } - - /** - * @param value The clinical status of the condition. - */ - public Condition setClinicalStatus(String value) { - if (Utilities.noString(value)) - this.clinicalStatus = null; - else { - if (this.clinicalStatus == null) - this.clinicalStatus = new CodeType(); - this.clinicalStatus.setValue(value); - } - return this; - } - - /** - * @return {@link #verificationStatus} (The verification status to support the clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getVerificationStatus" gives direct access to the value - */ - public Enumeration getVerificationStatusElement() { - if (this.verificationStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.verificationStatus"); - else if (Configuration.doAutoCreate()) - this.verificationStatus = new Enumeration(new ConditionVerificationStatusEnumFactory()); // bb - return this.verificationStatus; - } - - public boolean hasVerificationStatusElement() { - return this.verificationStatus != null && !this.verificationStatus.isEmpty(); - } - - public boolean hasVerificationStatus() { - return this.verificationStatus != null && !this.verificationStatus.isEmpty(); - } - - /** - * @param value {@link #verificationStatus} (The verification status to support the clinical status of the condition.). This is the underlying object with id, value and extensions. The accessor "getVerificationStatus" gives direct access to the value - */ - public Condition setVerificationStatusElement(Enumeration value) { - this.verificationStatus = value; - return this; - } - - /** - * @return The verification status to support the clinical status of the condition. - */ - public ConditionVerificationStatus getVerificationStatus() { - return this.verificationStatus == null ? null : this.verificationStatus.getValue(); - } - - /** - * @param value The verification status to support the clinical status of the condition. - */ - public Condition setVerificationStatus(ConditionVerificationStatus value) { - if (this.verificationStatus == null) - this.verificationStatus = new Enumeration(new ConditionVerificationStatusEnumFactory()); - this.verificationStatus.setValue(value); - return this; - } - - /** - * @return {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) - */ - public CodeableConcept getSeverity() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new CodeableConcept(); // cc - return this.severity; - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (A subjective assessment of the severity of the condition as evaluated by the clinician.) - */ - public Condition setSeverity(CodeableConcept value) { - this.severity = value; - return this; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Type getOnset() { - return this.onset; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public DateTimeType getOnsetDateTimeType() throws FHIRException { - if (!(this.onset instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (DateTimeType) this.onset; - } - - public boolean hasOnsetDateTimeType() { - return this.onset instanceof DateTimeType; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Age getOnsetAge() throws FHIRException { - if (!(this.onset instanceof Age)) - throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Age) this.onset; - } - - public boolean hasOnsetAge() { - return this.onset instanceof Age; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Period getOnsetPeriod() throws FHIRException { - if (!(this.onset instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Period) this.onset; - } - - public boolean hasOnsetPeriod() { - return this.onset instanceof Period; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Range getOnsetRange() throws FHIRException { - if (!(this.onset instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Range) this.onset; - } - - public boolean hasOnsetRange() { - return this.onset instanceof Range; - } - - /** - * @return {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public StringType getOnsetStringType() throws FHIRException { - if (!(this.onset instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (StringType) this.onset; - } - - public boolean hasOnsetStringType() { - return this.onset instanceof StringType; - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (Estimated or actual date or date-time the condition began, in the opinion of the clinician.) - */ - public Condition setOnset(Type value) { - this.onset = value; - return this; - } - - /** - * @return {@link #abatement} (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 Type getAbatement() { - return this.abatement; - } - - /** - * @return {@link #abatement} (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 DateTimeType getAbatementDateTimeType() throws FHIRException { - if (!(this.abatement instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (DateTimeType) this.abatement; - } - - public boolean hasAbatementDateTimeType() { - return this.abatement instanceof DateTimeType; - } - - /** - * @return {@link #abatement} (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 Age getAbatementAge() throws FHIRException { - if (!(this.abatement instanceof Age)) - throw new FHIRException("Type mismatch: the type Age was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Age) this.abatement; - } - - public boolean hasAbatementAge() { - return this.abatement instanceof Age; - } - - /** - * @return {@link #abatement} (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 BooleanType getAbatementBooleanType() throws FHIRException { - if (!(this.abatement instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (BooleanType) this.abatement; - } - - public boolean hasAbatementBooleanType() { - return this.abatement instanceof BooleanType; - } - - /** - * @return {@link #abatement} (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 Period getAbatementPeriod() throws FHIRException { - if (!(this.abatement instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Period) this.abatement; - } - - public boolean hasAbatementPeriod() { - return this.abatement instanceof Period; - } - - /** - * @return {@link #abatement} (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 Range getAbatementRange() throws FHIRException { - if (!(this.abatement instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (Range) this.abatement; - } - - public boolean hasAbatementRange() { - return this.abatement instanceof Range; - } - - /** - * @return {@link #abatement} (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 StringType getAbatementStringType() throws FHIRException { - if (!(this.abatement instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.abatement.getClass().getName()+" was encountered"); - return (StringType) this.abatement; - } - - public boolean hasAbatementStringType() { - return this.abatement instanceof StringType; - } - - public boolean hasAbatement() { - return this.abatement != null && !this.abatement.isEmpty(); - } - - /** - * @param value {@link #abatement} (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(Type value) { - this.abatement = value; - return this; - } - - /** - * @return {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) - */ - public ConditionStageComponent getStage() { - if (this.stage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.stage"); - else if (Configuration.doAutoCreate()) - this.stage = new ConditionStageComponent(); // cc - return this.stage; - } - - public boolean hasStage() { - return this.stage != null && !this.stage.isEmpty(); - } - - /** - * @param value {@link #stage} (Clinical stage or grade of a condition. May include formal severity assessments.) - */ - public Condition setStage(ConditionStageComponent value) { - this.stage = value; - return this; - } - - /** - * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) - */ - public List getEvidence() { - if (this.evidence == null) - this.evidence = new ArrayList(); - return this.evidence; - } - - public boolean hasEvidence() { - if (this.evidence == null) - return false; - for (ConditionEvidenceComponent item : this.evidence) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #evidence} (Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.) - */ - // syntactic sugar - public ConditionEvidenceComponent addEvidence() { //3 - ConditionEvidenceComponent t = new ConditionEvidenceComponent(); - if (this.evidence == null) - this.evidence = new ArrayList(); - this.evidence.add(t); - return t; - } - - // syntactic sugar - public Condition addEvidence(ConditionEvidenceComponent t) { //3 - if (t == null) - return this; - if (this.evidence == null) - this.evidence = new ArrayList(); - this.evidence.add(t); - return this; - } - - /** - * @return {@link #bodySite} (The anatomical location where this condition manifests itself.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (The anatomical location where this condition manifests itself.) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - // syntactic sugar - public Condition addBodySite(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return this; - } - - /** - * @return {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Condition.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public Condition setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value 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 value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this condition 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient who the condition record is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which the condition was first asserted.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("asserter", "Reference(Practitioner|Patient)", "Individual who is making the condition statement.", 0, java.lang.Integer.MAX_VALUE, asserter)); - childrenList.add(new Property("dateRecorded", "date", "A date, when the Condition statement was documented.", 0, java.lang.Integer.MAX_VALUE, dateRecorded)); - childrenList.add(new Property("code", "CodeableConcept", "Identification of the condition, problem or diagnosis.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("category", "CodeableConcept", "A category assigned to the condition.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("clinicalStatus", "code", "The clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, clinicalStatus)); - childrenList.add(new Property("verificationStatus", "code", "The verification status to support the clinical status of the condition.", 0, java.lang.Integer.MAX_VALUE, verificationStatus)); - childrenList.add(new Property("severity", "CodeableConcept", "A subjective assessment of the severity of the condition as evaluated by the clinician.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("onset[x]", "dateTime|Age|Period|Range|string", "Estimated or actual date or date-time the condition began, in the opinion of the clinician.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("abatement[x]", "dateTime|Age|boolean|Period|Range|string", "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.", 0, java.lang.Integer.MAX_VALUE, abatement)); - childrenList.add(new Property("stage", "", "Clinical stage or grade of a condition. May include formal severity assessments.", 0, java.lang.Integer.MAX_VALUE, stage)); - childrenList.add(new Property("evidence", "", "Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed.", 0, java.lang.Integer.MAX_VALUE, evidence)); - childrenList.add(new Property("bodySite", "CodeableConcept", "The anatomical location where this condition manifests itself.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("notes", "string", "Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -373242253: /*asserter*/ return this.asserter == null ? new Base[0] : new Base[] {this.asserter}; // Reference - case 1888120446: /*dateRecorded*/ return this.dateRecorded == null ? new Base[0] : new Base[] {this.dateRecorded}; // DateType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case -462853915: /*clinicalStatus*/ return this.clinicalStatus == null ? new Base[0] : new Base[] {this.clinicalStatus}; // CodeType - case -842509843: /*verificationStatus*/ return this.verificationStatus == null ? new Base[0] : new Base[] {this.verificationStatus}; // Enumeration - case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // CodeableConcept - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type - case -921554001: /*abatement*/ return this.abatement == null ? new Base[0] : new Base[] {this.abatement}; // Type - case 109757182: /*stage*/ return this.stage == null ? new Base[0] : new Base[] {this.stage}; // ConditionStageComponent - case 382967383: /*evidence*/ return this.evidence == null ? new Base[0] : this.evidence.toArray(new Base[this.evidence.size()]); // ConditionEvidenceComponent - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : new Base[] {this.notes}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -373242253: // asserter - this.asserter = castToReference(value); // Reference - break; - case 1888120446: // dateRecorded - this.dateRecorded = castToDate(value); // DateType - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case -462853915: // clinicalStatus - this.clinicalStatus = castToCode(value); // CodeType - break; - case -842509843: // verificationStatus - this.verificationStatus = new ConditionVerificationStatusEnumFactory().fromType(value); // Enumeration - break; - case 1478300413: // severity - this.severity = castToCodeableConcept(value); // CodeableConcept - break; - case 105901603: // onset - this.onset = (Type) value; // Type - break; - case -921554001: // abatement - this.abatement = (Type) value; // Type - break; - case 109757182: // stage - this.stage = (ConditionStageComponent) value; // ConditionStageComponent - break; - case 382967383: // evidence - this.getEvidence().add((ConditionEvidenceComponent) value); // ConditionEvidenceComponent - break; - case 1702620169: // bodySite - this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 105008833: // notes - this.notes = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("asserter")) - this.asserter = castToReference(value); // Reference - else if (name.equals("dateRecorded")) - this.dateRecorded = castToDate(value); // DateType - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("clinicalStatus")) - this.clinicalStatus = castToCode(value); // CodeType - else if (name.equals("verificationStatus")) - this.verificationStatus = new ConditionVerificationStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("severity")) - this.severity = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("onset[x]")) - this.onset = (Type) value; // Type - else if (name.equals("abatement[x]")) - this.abatement = (Type) value; // Type - else if (name.equals("stage")) - this.stage = (ConditionStageComponent) value; // ConditionStageComponent - else if (name.equals("evidence")) - this.getEvidence().add((ConditionEvidenceComponent) value); - else if (name.equals("bodySite")) - this.getBodySite().add(castToCodeableConcept(value)); - else if (name.equals("notes")) - this.notes = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -791418107: return getPatient(); // Reference - case 1524132147: return getEncounter(); // Reference - case -373242253: return getAsserter(); // Reference - case 1888120446: throw new FHIRException("Cannot make property dateRecorded as it is not a complex type"); // DateType - case 3059181: return getCode(); // CodeableConcept - case 50511102: return getCategory(); // CodeableConcept - case -462853915: throw new FHIRException("Cannot make property clinicalStatus as it is not a complex type"); // CodeType - case -842509843: throw new FHIRException("Cannot make property verificationStatus as it is not a complex type"); // Enumeration - case 1478300413: return getSeverity(); // CodeableConcept - case -1886216323: return getOnset(); // Type - case -584196495: return getAbatement(); // Type - case 109757182: return getStage(); // ConditionStageComponent - case 382967383: return addEvidence(); // ConditionEvidenceComponent - case 1702620169: return addBodySite(); // CodeableConcept - case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("asserter")) { - this.asserter = new Reference(); - return this.asserter; - } - else if (name.equals("dateRecorded")) { - throw new FHIRException("Cannot call addChild on a primitive type Condition.dateRecorded"); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("clinicalStatus")) { - throw new FHIRException("Cannot call addChild on a primitive type Condition.clinicalStatus"); - } - else if (name.equals("verificationStatus")) { - throw new FHIRException("Cannot call addChild on a primitive type Condition.verificationStatus"); - } - else if (name.equals("severity")) { - this.severity = new CodeableConcept(); - return this.severity; - } - else if (name.equals("onsetDateTime")) { - this.onset = new DateTimeType(); - return this.onset; - } - else if (name.equals("onsetAge")) { - this.onset = new Age(); - return this.onset; - } - else if (name.equals("onsetPeriod")) { - this.onset = new Period(); - return this.onset; - } - else if (name.equals("onsetRange")) { - this.onset = new Range(); - return this.onset; - } - else if (name.equals("onsetString")) { - this.onset = new StringType(); - return this.onset; - } - else if (name.equals("abatementDateTime")) { - this.abatement = new DateTimeType(); - return this.abatement; - } - else if (name.equals("abatementAge")) { - this.abatement = new Age(); - return this.abatement; - } - else if (name.equals("abatementBoolean")) { - this.abatement = new BooleanType(); - return this.abatement; - } - else if (name.equals("abatementPeriod")) { - this.abatement = new Period(); - return this.abatement; - } - else if (name.equals("abatementRange")) { - this.abatement = new Range(); - return this.abatement; - } - else if (name.equals("abatementString")) { - this.abatement = new StringType(); - return this.abatement; - } - else if (name.equals("stage")) { - this.stage = new ConditionStageComponent(); - return this.stage; - } - else if (name.equals("evidence")) { - return addEvidence(); - } - else if (name.equals("bodySite")) { - return addBodySite(); - } - else if (name.equals("notes")) { - throw new FHIRException("Cannot call addChild on a primitive type Condition.notes"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Condition"; - - } - - public Condition copy() { - Condition dst = new Condition(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.asserter = asserter == null ? null : asserter.copy(); - dst.dateRecorded = dateRecorded == null ? null : dateRecorded.copy(); - dst.code = code == null ? null : code.copy(); - dst.category = category == null ? null : category.copy(); - dst.clinicalStatus = clinicalStatus == null ? null : clinicalStatus.copy(); - dst.verificationStatus = verificationStatus == null ? null : verificationStatus.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.abatement = abatement == null ? null : abatement.copy(); - dst.stage = stage == null ? null : stage.copy(); - if (evidence != null) { - dst.evidence = new ArrayList(); - for (ConditionEvidenceComponent i : evidence) - dst.evidence.add(i.copy()); - }; - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - protected Condition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Condition)) - return false; - Condition o = (Condition) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(asserter, o.asserter, true) && compareDeep(dateRecorded, o.dateRecorded, true) && compareDeep(code, o.code, true) - && compareDeep(category, o.category, true) && compareDeep(clinicalStatus, o.clinicalStatus, true) - && compareDeep(verificationStatus, o.verificationStatus, true) && compareDeep(severity, o.severity, true) - && compareDeep(onset, o.onset, true) && compareDeep(abatement, o.abatement, true) && compareDeep(stage, o.stage, true) - && compareDeep(evidence, o.evidence, true) && compareDeep(bodySite, o.bodySite, true) && compareDeep(notes, o.notes, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Condition)) - return false; - Condition o = (Condition) other; - return compareValues(dateRecorded, o.dateRecorded, true) && compareValues(clinicalStatus, o.clinicalStatus, true) - && compareValues(verificationStatus, o.verificationStatus, true) && compareValues(notes, o.notes, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (asserter == null || asserter.isEmpty()) - && (dateRecorded == null || dateRecorded.isEmpty()) && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) - && (clinicalStatus == null || clinicalStatus.isEmpty()) && (verificationStatus == null || verificationStatus.isEmpty()) - && (severity == null || severity.isEmpty()) && (onset == null || onset.isEmpty()) && (abatement == null || abatement.isEmpty()) - && (stage == null || stage.isEmpty()) && (evidence == null || evidence.isEmpty()) && (bodySite == null || bodySite.isEmpty()) - && (notes == null || notes.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Condition; - } - - /** - * Search parameter: date-recorded - *

- * Description: A date, when the Condition statement was documented
- * Type: date
- * Path: Condition.dateRecorded
- *

- */ - @SearchParamDefinition(name="date-recorded", path="Condition.dateRecorded", description="A date, when the Condition statement was documented", type="date" ) - public static final String SP_DATE_RECORDED = "date-recorded"; - /** - * Fluent Client search parameter constant for date-recorded - *

- * Description: A date, when the Condition statement was documented
- * Type: date
- * Path: Condition.dateRecorded
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE_RECORDED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE_RECORDED); - - /** - * Search parameter: asserter - *

- * Description: Person who asserts this condition
- * Type: reference
- * Path: Condition.asserter
- *

- */ - @SearchParamDefinition(name="asserter", path="Condition.asserter", description="Person who asserts this condition", type="reference" ) - public static final String SP_ASSERTER = "asserter"; - /** - * Fluent Client search parameter constant for asserter - *

- * Description: Person who asserts this condition
- * Type: reference
- * Path: Condition.asserter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ASSERTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ASSERTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition:asserter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ASSERTER = new ca.uhn.fhir.model.api.Include("Condition:asserter").toLocked(); - - /** - * Search parameter: onset - *

- * Description: Date related onsets (dateTime and Period)
- * Type: date
- * Path: Condition.onset[x]
- *

- */ - @SearchParamDefinition(name="onset", path="Condition.onset.as(dateTime) | Condition.onset.as(Period)", description="Date related onsets (dateTime and Period)", type="date" ) - public static final String SP_ONSET = "onset"; - /** - * Fluent Client search parameter constant for onset - *

- * Description: Date related onsets (dateTime and Period)
- * Type: date
- * Path: Condition.onset[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam ONSET = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ONSET); - - /** - * Search parameter: evidence - *

- * Description: Manifestation/symptom
- * Type: token
- * Path: Condition.evidence.code
- *

- */ - @SearchParamDefinition(name="evidence", path="Condition.evidence.code", description="Manifestation/symptom", type="token" ) - public static final String SP_EVIDENCE = "evidence"; - /** - * Fluent Client search parameter constant for evidence - *

- * Description: Manifestation/symptom
- * Type: token
- * Path: Condition.evidence.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVIDENCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVIDENCE); - - /** - * Search parameter: body-site - *

- * Description: Anatomical location, if relevant
- * Type: token
- * Path: Condition.bodySite
- *

- */ - @SearchParamDefinition(name="body-site", path="Condition.bodySite", description="Anatomical location, if relevant", type="token" ) - public static final String SP_BODY_SITE = "body-site"; - /** - * Fluent Client search parameter constant for body-site - *

- * Description: Anatomical location, if relevant
- * Type: token
- * Path: Condition.bodySite
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODY_SITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODY_SITE); - - /** - * Search parameter: onset-info - *

- * Description: Other onsets (boolean, age, range, string)
- * Type: string
- * Path: Condition.onset[x]
- *

- */ - @SearchParamDefinition(name="onset-info", path="Condition.onset.as(boolean) | Condition.onset.as(Quantity) | Condition.onset.as(Range) | Condition.onset.as(string)", description="Other onsets (boolean, age, range, string)", type="string" ) - public static final String SP_ONSET_INFO = "onset-info"; - /** - * Fluent Client search parameter constant for onset-info - *

- * Description: Other onsets (boolean, age, range, string)
- * Type: string
- * Path: Condition.onset[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ONSET_INFO = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ONSET_INFO); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam SEVERITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEVERITY); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: encounter - *

- * Description: Encounter when condition first asserted
- * Type: reference
- * Path: Condition.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Condition.encounter", description="Encounter when condition first asserted", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Encounter when condition first asserted
- * Type: reference
- * Path: Condition.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Condition:encounter").toLocked(); - - /** - * Search parameter: stage - *

- * Description: Simple summary (disease specific)
- * Type: token
- * Path: Condition.stage.summary
- *

- */ - @SearchParamDefinition(name="stage", path="Condition.stage.summary", description="Simple summary (disease specific)", type="token" ) - public static final String SP_STAGE = "stage"; - /** - * Fluent Client search parameter constant for stage - *

- * Description: Simple summary (disease specific)
- * Type: token
- * Path: Condition.stage.summary
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STAGE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: patient - *

- * Description: Who has the condition?
- * Type: reference
- * Path: Condition.patient
- *

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

- * Description: Who has the condition?
- * Type: reference
- * Path: Condition.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Condition:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Condition:patient").toLocked(); - - /** - * Search parameter: clinicalstatus - *

- * Description: The clinical status of the condition
- * Type: token
- * Path: Condition.clinicalStatus
- *

- */ - @SearchParamDefinition(name="clinicalstatus", path="Condition.clinicalStatus", description="The clinical status of the condition", type="token" ) - public static final String SP_CLINICALSTATUS = "clinicalstatus"; - /** - * Fluent Client search parameter constant for clinicalstatus - *

- * Description: The clinical status of the condition
- * Type: token
- * Path: Condition.clinicalStatus
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLINICALSTATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLINICALSTATUS); - - /** - * Search parameter: identifier - *

- * Description: A unique identifier of the condition record
- * Type: token
- * Path: Condition.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Condition.identifier", description="A unique identifier of the condition record", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A unique identifier of the condition record
- * Type: token
- * Path: Condition.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Configuration.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Configuration.java deleted file mode 100644 index 25da12876ff..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Configuration.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* -Copyright (c) 2011+, HL7, Inc. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -/** - * This class is created to help implementers deal with a change to - * the API that was made between versions 0.81 and 0.9 - * - * The change is the behaviour of the .getX() where the cardinality of - * x is 0..1 or 1..1. Before the change, these routines would return - * null if the object had not previously been assigned, and after the ' - * change, they will automatically create the object if it had not - * been assigned (unless the object is polymorphic, in which case, - * only the type specific getters create the object) - * - * When making the transition from the old style to the new style, - * the main change is that when testing for presence or abssense - * of the element, instead of doing one of these two: - * - * if (obj.getProperty() == null) - * if (obj.getProperty() != null) - * - * you instead do - * - * if (!obj.hasProperty()) - * if (obj.hasProperty()) - * - * or else one of these two: - * - * if (obj.getProperty().isEmpty()) - * if (!obj.getProperty().isEmpty()) - * - * The only way to sort this out is by finding all these things - * in the code, and changing them. - * - * To help with that, you can set the status field of this class - * to change how this API behaves. Note: the status value is tied - * to the way that you program. The intent of this class is to - * help make developers the transiition to status = 0. The old - * behaviour is status = 2. To make the transition, set the - * status code to 1. This way, any time a .getX routine needs - * to automatically create an object, an exception will be - * raised instead. The expected use of this is: - * - set status = 1 - * - test your code (all paths) - * - when an exception happens, change the code to use .hasX() or .isEmpty() - * - when all execution paths don't raise an exception, set status = 0 - * - start programming to the new style. - * - * You can set status = 2 and leave it like that, but this is not - * compatible with the utilities and validation code, nor with the - * HAPI code. So everyone shoul make this transition - * - * This is a difficult change to make to an API. Most users should engage with it - * as they migrate from DSTU1 to DSTU2, at the same time as they encounter - * other changes. This change was made in order to align the two java reference - * implementations on a common object model, which is an important outcome that - * justifies making this change to implementers (sorry for any pain caused) - * - * @author Grahame - * - */ -public class Configuration { - - private static int status = 0; - // 0: auto-create - // 1: error - // 2: return null - - public static boolean errorOnAutoCreate() { - return status == 1; - } - - - public static boolean doAutoCreate() { - return status == 0; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Conformance.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Conformance.java deleted file mode 100644 index f9e4bdd91d0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Conformance.java +++ /dev/null @@ -1,8989 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType; -import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.instance.model.api.IBaseConformance; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. - */ -@ResourceDef(name="Conformance", profile="http://hl7.org/fhir/Profile/Conformance") -public class Conformance extends DomainResource implements IBaseConformance { - - public enum ConformanceStatementKind { - /** - * The Conformance instance represents the present capabilities of a specific system instance. This is the kind returned by OPTIONS for a FHIR server end-point. - */ - INSTANCE, - /** - * The Conformance instance represents the capabilities of a system or piece of software, independent of a particular installation. - */ - CAPABILITY, - /** - * The Conformance instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'. - */ - REQUIREMENTS, - /** - * added to help the parsers - */ - NULL; - public static ConformanceStatementKind fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return INSTANCE; - if ("capability".equals(codeString)) - return CAPABILITY; - if ("requirements".equals(codeString)) - return REQUIREMENTS; - throw new FHIRException("Unknown ConformanceStatementKind code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INSTANCE: return "instance"; - case CAPABILITY: return "capability"; - case REQUIREMENTS: return "requirements"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INSTANCE: return "http://hl7.org/fhir/conformance-statement-kind"; - case CAPABILITY: return "http://hl7.org/fhir/conformance-statement-kind"; - case REQUIREMENTS: return "http://hl7.org/fhir/conformance-statement-kind"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INSTANCE: return "The Conformance instance represents the present capabilities of a specific system instance. This is the kind returned by OPTIONS for a FHIR server end-point."; - case CAPABILITY: return "The Conformance instance represents the capabilities of a system or piece of software, independent of a particular installation."; - case REQUIREMENTS: return "The Conformance instance represents a set of requirements for other systems to meet; e.g. as part of an implementation guide or 'request for proposal'."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INSTANCE: return "Instance"; - case CAPABILITY: return "Capability"; - case REQUIREMENTS: return "Requirements"; - default: return "?"; - } - } - } - - public static class ConformanceStatementKindEnumFactory implements EnumFactory { - public ConformanceStatementKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return ConformanceStatementKind.INSTANCE; - if ("capability".equals(codeString)) - return ConformanceStatementKind.CAPABILITY; - if ("requirements".equals(codeString)) - return ConformanceStatementKind.REQUIREMENTS; - throw new IllegalArgumentException("Unknown ConformanceStatementKind code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return new Enumeration(this, ConformanceStatementKind.INSTANCE); - if ("capability".equals(codeString)) - return new Enumeration(this, ConformanceStatementKind.CAPABILITY); - if ("requirements".equals(codeString)) - return new Enumeration(this, ConformanceStatementKind.REQUIREMENTS); - throw new FHIRException("Unknown ConformanceStatementKind code '"+codeString+"'"); - } - public String toCode(ConformanceStatementKind code) { - if (code == ConformanceStatementKind.INSTANCE) - return "instance"; - if (code == ConformanceStatementKind.CAPABILITY) - return "capability"; - if (code == ConformanceStatementKind.REQUIREMENTS) - return "requirements"; - return "?"; - } - public String toSystem(ConformanceStatementKind code) { - return code.getSystem(); - } - } - - public enum UnknownContentCode { - /** - * The application does not accept either unknown elements or extensions. - */ - NO, - /** - * The application accepts unknown extensions, but not unknown elements. - */ - EXTENSIONS, - /** - * The application accepts unknown elements, but not unknown extensions. - */ - ELEMENTS, - /** - * The application accepts unknown elements and extensions. - */ - BOTH, - /** - * added to help the parsers - */ - NULL; - public static UnknownContentCode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("no".equals(codeString)) - return NO; - if ("extensions".equals(codeString)) - return EXTENSIONS; - if ("elements".equals(codeString)) - return ELEMENTS; - if ("both".equals(codeString)) - return BOTH; - throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NO: return "no"; - case EXTENSIONS: return "extensions"; - case ELEMENTS: return "elements"; - case BOTH: return "both"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NO: return "http://hl7.org/fhir/unknown-content-code"; - case EXTENSIONS: return "http://hl7.org/fhir/unknown-content-code"; - case ELEMENTS: return "http://hl7.org/fhir/unknown-content-code"; - case BOTH: return "http://hl7.org/fhir/unknown-content-code"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NO: return "The application does not accept either unknown elements or extensions."; - case EXTENSIONS: return "The application accepts unknown extensions, but not unknown elements."; - case ELEMENTS: return "The application accepts unknown elements, but not unknown extensions."; - case BOTH: return "The application accepts unknown elements and extensions."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NO: return "Neither Elements or Extensions"; - case EXTENSIONS: return "Unknown Extensions"; - case ELEMENTS: return "Unknown Elements"; - case BOTH: return "Unknown Elements and Extensions"; - default: return "?"; - } - } - } - - public static class UnknownContentCodeEnumFactory implements EnumFactory { - public UnknownContentCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("no".equals(codeString)) - return UnknownContentCode.NO; - if ("extensions".equals(codeString)) - return UnknownContentCode.EXTENSIONS; - if ("elements".equals(codeString)) - return UnknownContentCode.ELEMENTS; - if ("both".equals(codeString)) - return UnknownContentCode.BOTH; - throw new IllegalArgumentException("Unknown UnknownContentCode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("no".equals(codeString)) - return new Enumeration(this, UnknownContentCode.NO); - if ("extensions".equals(codeString)) - return new Enumeration(this, UnknownContentCode.EXTENSIONS); - if ("elements".equals(codeString)) - return new Enumeration(this, UnknownContentCode.ELEMENTS); - if ("both".equals(codeString)) - return new Enumeration(this, UnknownContentCode.BOTH); - throw new FHIRException("Unknown UnknownContentCode code '"+codeString+"'"); - } - public String toCode(UnknownContentCode code) { - if (code == UnknownContentCode.NO) - return "no"; - if (code == UnknownContentCode.EXTENSIONS) - return "extensions"; - if (code == UnknownContentCode.ELEMENTS) - return "elements"; - if (code == UnknownContentCode.BOTH) - return "both"; - return "?"; - } - public String toSystem(UnknownContentCode code) { - return code.getSystem(); - } - } - - public enum RestfulConformanceMode { - /** - * The application acts as a client for this resource. - */ - CLIENT, - /** - * The application acts as a server for this resource. - */ - SERVER, - /** - * added to help the parsers - */ - NULL; - public static RestfulConformanceMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("client".equals(codeString)) - return CLIENT; - if ("server".equals(codeString)) - return SERVER; - throw new FHIRException("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CLIENT: return "client"; - case SERVER: return "server"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CLIENT: return "http://hl7.org/fhir/restful-conformance-mode"; - case SERVER: return "http://hl7.org/fhir/restful-conformance-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CLIENT: return "The application acts as a client for this resource."; - case SERVER: return "The application acts as a server for this resource."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CLIENT: return "Client"; - case SERVER: return "Server"; - default: return "?"; - } - } - } - - public static class RestfulConformanceModeEnumFactory implements EnumFactory { - public RestfulConformanceMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("client".equals(codeString)) - return RestfulConformanceMode.CLIENT; - if ("server".equals(codeString)) - return RestfulConformanceMode.SERVER; - throw new IllegalArgumentException("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("client".equals(codeString)) - return new Enumeration(this, RestfulConformanceMode.CLIENT); - if ("server".equals(codeString)) - return new Enumeration(this, RestfulConformanceMode.SERVER); - throw new FHIRException("Unknown RestfulConformanceMode code '"+codeString+"'"); - } - public String toCode(RestfulConformanceMode code) { - if (code == RestfulConformanceMode.CLIENT) - return "client"; - if (code == RestfulConformanceMode.SERVER) - return "server"; - return "?"; - } - public String toSystem(RestfulConformanceMode code) { - return code.getSystem(); - } - } - - public enum TypeRestfulInteraction { - /** - * null - */ - READ, - /** - * null - */ - VREAD, - /** - * null - */ - UPDATE, - /** - * null - */ - DELETE, - /** - * null - */ - HISTORYINSTANCE, - /** - * null - */ - HISTORYTYPE, - /** - * null - */ - CREATE, - /** - * null - */ - SEARCHTYPE, - /** - * added to help the parsers - */ - NULL; - public static TypeRestfulInteraction fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("read".equals(codeString)) - return READ; - if ("vread".equals(codeString)) - return VREAD; - if ("update".equals(codeString)) - return UPDATE; - if ("delete".equals(codeString)) - return DELETE; - if ("history-instance".equals(codeString)) - return HISTORYINSTANCE; - if ("history-type".equals(codeString)) - return HISTORYTYPE; - if ("create".equals(codeString)) - return CREATE; - if ("search-type".equals(codeString)) - return SEARCHTYPE; - throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case READ: return "read"; - case VREAD: return "vread"; - case UPDATE: return "update"; - case DELETE: return "delete"; - case HISTORYINSTANCE: return "history-instance"; - case HISTORYTYPE: return "history-type"; - case CREATE: return "create"; - case SEARCHTYPE: return "search-type"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case READ: return "http://hl7.org/fhir/restful-interaction"; - case VREAD: return "http://hl7.org/fhir/restful-interaction"; - case UPDATE: return "http://hl7.org/fhir/restful-interaction"; - case DELETE: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYINSTANCE: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYTYPE: return "http://hl7.org/fhir/restful-interaction"; - case CREATE: return "http://hl7.org/fhir/restful-interaction"; - case SEARCHTYPE: return "http://hl7.org/fhir/restful-interaction"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case READ: return ""; - case VREAD: return ""; - case UPDATE: return ""; - case DELETE: return ""; - case HISTORYINSTANCE: return ""; - case HISTORYTYPE: return ""; - case CREATE: return ""; - case SEARCHTYPE: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case READ: return "read"; - case VREAD: return "vread"; - case UPDATE: return "update"; - case DELETE: return "delete"; - case HISTORYINSTANCE: return "history-instance"; - case HISTORYTYPE: return "history-type"; - case CREATE: return "create"; - case SEARCHTYPE: return "search-type"; - default: return "?"; - } - } - } - - public static class TypeRestfulInteractionEnumFactory implements EnumFactory { - public TypeRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("read".equals(codeString)) - return TypeRestfulInteraction.READ; - if ("vread".equals(codeString)) - return TypeRestfulInteraction.VREAD; - if ("update".equals(codeString)) - return TypeRestfulInteraction.UPDATE; - if ("delete".equals(codeString)) - return TypeRestfulInteraction.DELETE; - if ("history-instance".equals(codeString)) - return TypeRestfulInteraction.HISTORYINSTANCE; - if ("history-type".equals(codeString)) - return TypeRestfulInteraction.HISTORYTYPE; - if ("create".equals(codeString)) - return TypeRestfulInteraction.CREATE; - if ("search-type".equals(codeString)) - return TypeRestfulInteraction.SEARCHTYPE; - throw new IllegalArgumentException("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("read".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.READ); - if ("vread".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.VREAD); - if ("update".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.UPDATE); - if ("delete".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.DELETE); - if ("history-instance".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.HISTORYINSTANCE); - if ("history-type".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.HISTORYTYPE); - if ("create".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.CREATE); - if ("search-type".equals(codeString)) - return new Enumeration(this, TypeRestfulInteraction.SEARCHTYPE); - throw new FHIRException("Unknown TypeRestfulInteraction code '"+codeString+"'"); - } - public String toCode(TypeRestfulInteraction code) { - if (code == TypeRestfulInteraction.READ) - return "read"; - if (code == TypeRestfulInteraction.VREAD) - return "vread"; - if (code == TypeRestfulInteraction.UPDATE) - return "update"; - if (code == TypeRestfulInteraction.DELETE) - return "delete"; - if (code == TypeRestfulInteraction.HISTORYINSTANCE) - return "history-instance"; - if (code == TypeRestfulInteraction.HISTORYTYPE) - return "history-type"; - if (code == TypeRestfulInteraction.CREATE) - return "create"; - if (code == TypeRestfulInteraction.SEARCHTYPE) - return "search-type"; - return "?"; - } - public String toSystem(TypeRestfulInteraction code) { - return code.getSystem(); - } - } - - public enum ResourceVersionPolicy { - /** - * VersionId meta-property is not supported (server) or used (client). - */ - NOVERSION, - /** - * VersionId meta-property is supported (server) or used (client). - */ - VERSIONED, - /** - * VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). - */ - VERSIONEDUPDATE, - /** - * added to help the parsers - */ - NULL; - public static ResourceVersionPolicy fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("no-version".equals(codeString)) - return NOVERSION; - if ("versioned".equals(codeString)) - return VERSIONED; - if ("versioned-update".equals(codeString)) - return VERSIONEDUPDATE; - throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOVERSION: return "no-version"; - case VERSIONED: return "versioned"; - case VERSIONEDUPDATE: return "versioned-update"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOVERSION: return "http://hl7.org/fhir/versioning-policy"; - case VERSIONED: return "http://hl7.org/fhir/versioning-policy"; - case VERSIONEDUPDATE: return "http://hl7.org/fhir/versioning-policy"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOVERSION: return "VersionId meta-property is not supported (server) or used (client)."; - case VERSIONED: return "VersionId meta-property is supported (server) or used (client)."; - case VERSIONEDUPDATE: return "VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOVERSION: return "No VersionId Support"; - case VERSIONED: return "Versioned"; - case VERSIONEDUPDATE: return "VersionId tracked fully"; - default: return "?"; - } - } - } - - public static class ResourceVersionPolicyEnumFactory implements EnumFactory { - public ResourceVersionPolicy fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("no-version".equals(codeString)) - return ResourceVersionPolicy.NOVERSION; - if ("versioned".equals(codeString)) - return ResourceVersionPolicy.VERSIONED; - if ("versioned-update".equals(codeString)) - return ResourceVersionPolicy.VERSIONEDUPDATE; - throw new IllegalArgumentException("Unknown ResourceVersionPolicy code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("no-version".equals(codeString)) - return new Enumeration(this, ResourceVersionPolicy.NOVERSION); - if ("versioned".equals(codeString)) - return new Enumeration(this, ResourceVersionPolicy.VERSIONED); - if ("versioned-update".equals(codeString)) - return new Enumeration(this, ResourceVersionPolicy.VERSIONEDUPDATE); - throw new FHIRException("Unknown ResourceVersionPolicy code '"+codeString+"'"); - } - public String toCode(ResourceVersionPolicy code) { - if (code == ResourceVersionPolicy.NOVERSION) - return "no-version"; - if (code == ResourceVersionPolicy.VERSIONED) - return "versioned"; - if (code == ResourceVersionPolicy.VERSIONEDUPDATE) - return "versioned-update"; - return "?"; - } - public String toSystem(ResourceVersionPolicy code) { - return code.getSystem(); - } - } - - public enum ConditionalDeleteStatus { - /** - * No support for conditional deletes. - */ - NOTSUPPORTED, - /** - * Conditional deletes are supported, but only single resources at a time. - */ - SINGLE, - /** - * Conditional deletes are supported, and multiple resources can be deleted in a single interaction. - */ - MULTIPLE, - /** - * added to help the parsers - */ - NULL; - public static ConditionalDeleteStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-supported".equals(codeString)) - return NOTSUPPORTED; - if ("single".equals(codeString)) - return SINGLE; - if ("multiple".equals(codeString)) - return MULTIPLE; - throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTSUPPORTED: return "not-supported"; - case SINGLE: return "single"; - case MULTIPLE: return "multiple"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTSUPPORTED: return "http://hl7.org/fhir/conditional-delete-status"; - case SINGLE: return "http://hl7.org/fhir/conditional-delete-status"; - case MULTIPLE: return "http://hl7.org/fhir/conditional-delete-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTSUPPORTED: return "No support for conditional deletes."; - case SINGLE: return "Conditional deletes are supported, but only single resources at a time."; - case MULTIPLE: return "Conditional deletes are supported, and multiple resources can be deleted in a single interaction."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTSUPPORTED: return "Not Supported"; - case SINGLE: return "Single Deletes Supported"; - case MULTIPLE: return "Multiple Deletes Supported"; - default: return "?"; - } - } - } - - public static class ConditionalDeleteStatusEnumFactory implements EnumFactory { - public ConditionalDeleteStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-supported".equals(codeString)) - return ConditionalDeleteStatus.NOTSUPPORTED; - if ("single".equals(codeString)) - return ConditionalDeleteStatus.SINGLE; - if ("multiple".equals(codeString)) - return ConditionalDeleteStatus.MULTIPLE; - throw new IllegalArgumentException("Unknown ConditionalDeleteStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("not-supported".equals(codeString)) - return new Enumeration(this, ConditionalDeleteStatus.NOTSUPPORTED); - if ("single".equals(codeString)) - return new Enumeration(this, ConditionalDeleteStatus.SINGLE); - if ("multiple".equals(codeString)) - return new Enumeration(this, ConditionalDeleteStatus.MULTIPLE); - throw new FHIRException("Unknown ConditionalDeleteStatus code '"+codeString+"'"); - } - public String toCode(ConditionalDeleteStatus code) { - if (code == ConditionalDeleteStatus.NOTSUPPORTED) - return "not-supported"; - if (code == ConditionalDeleteStatus.SINGLE) - return "single"; - if (code == ConditionalDeleteStatus.MULTIPLE) - return "multiple"; - return "?"; - } - public String toSystem(ConditionalDeleteStatus code) { - return code.getSystem(); - } - } - - public enum SearchModifierCode { - /** - * The search parameter returns resources that have a value or not. - */ - MISSING, - /** - * The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents). - */ - EXACT, - /** - * The search parameter returns resources that include the supplied parameter value anywhere within the field being searched. - */ - CONTAINS, - /** - * The search parameter returns resources that do not contain a match . - */ - NOT, - /** - * The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text. - */ - TEXT, - /** - * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set. - */ - IN, - /** - * The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set. - */ - NOTIN, - /** - * The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships). - */ - BELOW, - /** - * The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships). - */ - ABOVE, - /** - * The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.). - */ - TYPE, - /** - * added to help the parsers - */ - NULL; - public static SearchModifierCode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("missing".equals(codeString)) - return MISSING; - if ("exact".equals(codeString)) - return EXACT; - if ("contains".equals(codeString)) - return CONTAINS; - if ("not".equals(codeString)) - return NOT; - if ("text".equals(codeString)) - return TEXT; - if ("in".equals(codeString)) - return IN; - if ("not-in".equals(codeString)) - return NOTIN; - if ("below".equals(codeString)) - return BELOW; - if ("above".equals(codeString)) - return ABOVE; - if ("type".equals(codeString)) - return TYPE; - throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MISSING: return "missing"; - case EXACT: return "exact"; - case CONTAINS: return "contains"; - case NOT: return "not"; - case TEXT: return "text"; - case IN: return "in"; - case NOTIN: return "not-in"; - case BELOW: return "below"; - case ABOVE: return "above"; - case TYPE: return "type"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MISSING: return "http://hl7.org/fhir/search-modifier-code"; - case EXACT: return "http://hl7.org/fhir/search-modifier-code"; - case CONTAINS: return "http://hl7.org/fhir/search-modifier-code"; - case NOT: return "http://hl7.org/fhir/search-modifier-code"; - case TEXT: return "http://hl7.org/fhir/search-modifier-code"; - case IN: return "http://hl7.org/fhir/search-modifier-code"; - case NOTIN: return "http://hl7.org/fhir/search-modifier-code"; - case BELOW: return "http://hl7.org/fhir/search-modifier-code"; - case ABOVE: return "http://hl7.org/fhir/search-modifier-code"; - case TYPE: return "http://hl7.org/fhir/search-modifier-code"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MISSING: return "The search parameter returns resources that have a value or not."; - case EXACT: return "The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole string, including casing and accents)."; - case CONTAINS: return "The search parameter returns resources that include the supplied parameter value anywhere within the field being searched."; - case NOT: return "The search parameter returns resources that do not contain a match ."; - case TEXT: return "The search parameter is processed as a string that searches text associated with the code/value - either CodeableConcept.text, Coding.display, or Identifier.type.text."; - case IN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is in the specified value set."; - case NOTIN: return "The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests whether the coding is not in the specified value set."; - case BELOW: return "The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or hierarchical relationships)."; - case ABOVE: return "The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical relationships)."; - case TYPE: return "The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not actually :type, but :Patient etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MISSING: return "Missing"; - case EXACT: return "Exact"; - case CONTAINS: return "Contains"; - case NOT: return "Not"; - case TEXT: return "Text"; - case IN: return "In"; - case NOTIN: return "Not In"; - case BELOW: return "Below"; - case ABOVE: return "Above"; - case TYPE: return "Type"; - default: return "?"; - } - } - } - - public static class SearchModifierCodeEnumFactory implements EnumFactory { - public SearchModifierCode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("missing".equals(codeString)) - return SearchModifierCode.MISSING; - if ("exact".equals(codeString)) - return SearchModifierCode.EXACT; - if ("contains".equals(codeString)) - return SearchModifierCode.CONTAINS; - if ("not".equals(codeString)) - return SearchModifierCode.NOT; - if ("text".equals(codeString)) - return SearchModifierCode.TEXT; - if ("in".equals(codeString)) - return SearchModifierCode.IN; - if ("not-in".equals(codeString)) - return SearchModifierCode.NOTIN; - if ("below".equals(codeString)) - return SearchModifierCode.BELOW; - if ("above".equals(codeString)) - return SearchModifierCode.ABOVE; - if ("type".equals(codeString)) - return SearchModifierCode.TYPE; - throw new IllegalArgumentException("Unknown SearchModifierCode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("missing".equals(codeString)) - return new Enumeration(this, SearchModifierCode.MISSING); - if ("exact".equals(codeString)) - return new Enumeration(this, SearchModifierCode.EXACT); - if ("contains".equals(codeString)) - return new Enumeration(this, SearchModifierCode.CONTAINS); - if ("not".equals(codeString)) - return new Enumeration(this, SearchModifierCode.NOT); - if ("text".equals(codeString)) - return new Enumeration(this, SearchModifierCode.TEXT); - if ("in".equals(codeString)) - return new Enumeration(this, SearchModifierCode.IN); - if ("not-in".equals(codeString)) - return new Enumeration(this, SearchModifierCode.NOTIN); - if ("below".equals(codeString)) - return new Enumeration(this, SearchModifierCode.BELOW); - if ("above".equals(codeString)) - return new Enumeration(this, SearchModifierCode.ABOVE); - if ("type".equals(codeString)) - return new Enumeration(this, SearchModifierCode.TYPE); - throw new FHIRException("Unknown SearchModifierCode code '"+codeString+"'"); - } - public String toCode(SearchModifierCode code) { - if (code == SearchModifierCode.MISSING) - return "missing"; - if (code == SearchModifierCode.EXACT) - return "exact"; - if (code == SearchModifierCode.CONTAINS) - return "contains"; - if (code == SearchModifierCode.NOT) - return "not"; - if (code == SearchModifierCode.TEXT) - return "text"; - if (code == SearchModifierCode.IN) - return "in"; - if (code == SearchModifierCode.NOTIN) - return "not-in"; - if (code == SearchModifierCode.BELOW) - return "below"; - if (code == SearchModifierCode.ABOVE) - return "above"; - if (code == SearchModifierCode.TYPE) - return "type"; - return "?"; - } - public String toSystem(SearchModifierCode code) { - return code.getSystem(); - } - } - - public enum SystemRestfulInteraction { - /** - * null - */ - TRANSACTION, - /** - * null - */ - SEARCHSYSTEM, - /** - * null - */ - HISTORYSYSTEM, - /** - * added to help the parsers - */ - NULL; - public static SystemRestfulInteraction fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("transaction".equals(codeString)) - return TRANSACTION; - if ("search-system".equals(codeString)) - return SEARCHSYSTEM; - if ("history-system".equals(codeString)) - return HISTORYSYSTEM; - throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case TRANSACTION: return "transaction"; - case SEARCHSYSTEM: return "search-system"; - case HISTORYSYSTEM: return "history-system"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TRANSACTION: return "http://hl7.org/fhir/restful-interaction"; - case SEARCHSYSTEM: return "http://hl7.org/fhir/restful-interaction"; - case HISTORYSYSTEM: return "http://hl7.org/fhir/restful-interaction"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TRANSACTION: return ""; - case SEARCHSYSTEM: return ""; - case HISTORYSYSTEM: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TRANSACTION: return "transaction"; - case SEARCHSYSTEM: return "search-system"; - case HISTORYSYSTEM: return "history-system"; - default: return "?"; - } - } - } - - public static class SystemRestfulInteractionEnumFactory implements EnumFactory { - public SystemRestfulInteraction fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("transaction".equals(codeString)) - return SystemRestfulInteraction.TRANSACTION; - if ("search-system".equals(codeString)) - return SystemRestfulInteraction.SEARCHSYSTEM; - if ("history-system".equals(codeString)) - return SystemRestfulInteraction.HISTORYSYSTEM; - throw new IllegalArgumentException("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("transaction".equals(codeString)) - return new Enumeration(this, SystemRestfulInteraction.TRANSACTION); - if ("search-system".equals(codeString)) - return new Enumeration(this, SystemRestfulInteraction.SEARCHSYSTEM); - if ("history-system".equals(codeString)) - return new Enumeration(this, SystemRestfulInteraction.HISTORYSYSTEM); - throw new FHIRException("Unknown SystemRestfulInteraction code '"+codeString+"'"); - } - public String toCode(SystemRestfulInteraction code) { - if (code == SystemRestfulInteraction.TRANSACTION) - return "transaction"; - if (code == SystemRestfulInteraction.SEARCHSYSTEM) - return "search-system"; - if (code == SystemRestfulInteraction.HISTORYSYSTEM) - return "history-system"; - return "?"; - } - public String toSystem(SystemRestfulInteraction code) { - return code.getSystem(); - } - } - - public enum TransactionMode { - /** - * Neither batch or transaction is supported. - */ - NOTSUPPORTED, - /** - * Batches are supported. - */ - BATCH, - /** - * Transactions are supported. - */ - TRANSACTION, - /** - * Both batches and transactions are supported. - */ - BOTH, - /** - * added to help the parsers - */ - NULL; - public static TransactionMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-supported".equals(codeString)) - return NOTSUPPORTED; - if ("batch".equals(codeString)) - return BATCH; - if ("transaction".equals(codeString)) - return TRANSACTION; - if ("both".equals(codeString)) - return BOTH; - throw new FHIRException("Unknown TransactionMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTSUPPORTED: return "not-supported"; - case BATCH: return "batch"; - case TRANSACTION: return "transaction"; - case BOTH: return "both"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTSUPPORTED: return "http://hl7.org/fhir/transaction-mode"; - case BATCH: return "http://hl7.org/fhir/transaction-mode"; - case TRANSACTION: return "http://hl7.org/fhir/transaction-mode"; - case BOTH: return "http://hl7.org/fhir/transaction-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTSUPPORTED: return "Neither batch or transaction is supported."; - case BATCH: return "Batches are supported."; - case TRANSACTION: return "Transactions are supported."; - case BOTH: return "Both batches and transactions are supported."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTSUPPORTED: return "None"; - case BATCH: return "Batches supported"; - case TRANSACTION: return "Transactions Supported"; - case BOTH: return "Batches & Transactions"; - default: return "?"; - } - } - } - - public static class TransactionModeEnumFactory implements EnumFactory { - public TransactionMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-supported".equals(codeString)) - return TransactionMode.NOTSUPPORTED; - if ("batch".equals(codeString)) - return TransactionMode.BATCH; - if ("transaction".equals(codeString)) - return TransactionMode.TRANSACTION; - if ("both".equals(codeString)) - return TransactionMode.BOTH; - throw new IllegalArgumentException("Unknown TransactionMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("not-supported".equals(codeString)) - return new Enumeration(this, TransactionMode.NOTSUPPORTED); - if ("batch".equals(codeString)) - return new Enumeration(this, TransactionMode.BATCH); - if ("transaction".equals(codeString)) - return new Enumeration(this, TransactionMode.TRANSACTION); - if ("both".equals(codeString)) - return new Enumeration(this, TransactionMode.BOTH); - throw new FHIRException("Unknown TransactionMode code '"+codeString+"'"); - } - public String toCode(TransactionMode code) { - if (code == TransactionMode.NOTSUPPORTED) - return "not-supported"; - if (code == TransactionMode.BATCH) - return "batch"; - if (code == TransactionMode.TRANSACTION) - return "transaction"; - if (code == TransactionMode.BOTH) - return "both"; - return "?"; - } - public String toSystem(TransactionMode code) { - return code.getSystem(); - } - } - - public enum MessageSignificanceCategory { - /** - * The message represents/requests a change that should not be processed more than once; e.g. Making a booking for an appointment. - */ - CONSEQUENCE, - /** - * The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful. - */ - CURRENCY, - /** - * The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications. - */ - NOTIFICATION, - /** - * added to help the parsers - */ - NULL; - public static MessageSignificanceCategory fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("Consequence".equals(codeString)) - return CONSEQUENCE; - if ("Currency".equals(codeString)) - return CURRENCY; - if ("Notification".equals(codeString)) - return NOTIFICATION; - throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CONSEQUENCE: return "Consequence"; - case CURRENCY: return "Currency"; - case NOTIFICATION: return "Notification"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONSEQUENCE: return "http://hl7.org/fhir/message-significance-category"; - case CURRENCY: return "http://hl7.org/fhir/message-significance-category"; - case NOTIFICATION: return "http://hl7.org/fhir/message-significance-category"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONSEQUENCE: return "The message represents/requests a change that should not be processed more than once; e.g. Making a booking for an appointment."; - case CURRENCY: return "The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful."; - case NOTIFICATION: return "The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONSEQUENCE: return "Consequence"; - case CURRENCY: return "Currency"; - case NOTIFICATION: return "Notification"; - default: return "?"; - } - } - } - - public static class MessageSignificanceCategoryEnumFactory implements EnumFactory { - public MessageSignificanceCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("Consequence".equals(codeString)) - return MessageSignificanceCategory.CONSEQUENCE; - if ("Currency".equals(codeString)) - return MessageSignificanceCategory.CURRENCY; - if ("Notification".equals(codeString)) - return MessageSignificanceCategory.NOTIFICATION; - throw new IllegalArgumentException("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("Consequence".equals(codeString)) - return new Enumeration(this, MessageSignificanceCategory.CONSEQUENCE); - if ("Currency".equals(codeString)) - return new Enumeration(this, MessageSignificanceCategory.CURRENCY); - if ("Notification".equals(codeString)) - return new Enumeration(this, MessageSignificanceCategory.NOTIFICATION); - throw new FHIRException("Unknown MessageSignificanceCategory code '"+codeString+"'"); - } - public String toCode(MessageSignificanceCategory code) { - if (code == MessageSignificanceCategory.CONSEQUENCE) - return "Consequence"; - if (code == MessageSignificanceCategory.CURRENCY) - return "Currency"; - if (code == MessageSignificanceCategory.NOTIFICATION) - return "Notification"; - return "?"; - } - public String toSystem(MessageSignificanceCategory code) { - return code.getSystem(); - } - } - - public enum ConformanceEventMode { - /** - * The application sends requests and receives responses. - */ - SENDER, - /** - * The application receives requests and sends responses. - */ - RECEIVER, - /** - * added to help the parsers - */ - NULL; - public static ConformanceEventMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("sender".equals(codeString)) - return SENDER; - if ("receiver".equals(codeString)) - return RECEIVER; - throw new FHIRException("Unknown ConformanceEventMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SENDER: return "sender"; - case RECEIVER: return "receiver"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SENDER: return "http://hl7.org/fhir/message-conformance-event-mode"; - case RECEIVER: return "http://hl7.org/fhir/message-conformance-event-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SENDER: return "The application sends requests and receives responses."; - case RECEIVER: return "The application receives requests and sends responses."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SENDER: return "Sender"; - case RECEIVER: return "Receiver"; - default: return "?"; - } - } - } - - public static class ConformanceEventModeEnumFactory implements EnumFactory { - public ConformanceEventMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("sender".equals(codeString)) - return ConformanceEventMode.SENDER; - if ("receiver".equals(codeString)) - return ConformanceEventMode.RECEIVER; - throw new IllegalArgumentException("Unknown ConformanceEventMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("sender".equals(codeString)) - return new Enumeration(this, ConformanceEventMode.SENDER); - if ("receiver".equals(codeString)) - return new Enumeration(this, ConformanceEventMode.RECEIVER); - throw new FHIRException("Unknown ConformanceEventMode code '"+codeString+"'"); - } - public String toCode(ConformanceEventMode code) { - if (code == ConformanceEventMode.SENDER) - return "sender"; - if (code == ConformanceEventMode.RECEIVER) - return "receiver"; - return "?"; - } - public String toSystem(ConformanceEventMode code) { - return code.getSystem(); - } - } - - public enum DocumentMode { - /** - * The application produces documents of the specified type. - */ - PRODUCER, - /** - * The application consumes documents of the specified type. - */ - CONSUMER, - /** - * added to help the parsers - */ - NULL; - public static DocumentMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("producer".equals(codeString)) - return PRODUCER; - if ("consumer".equals(codeString)) - return CONSUMER; - throw new FHIRException("Unknown DocumentMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PRODUCER: return "producer"; - case CONSUMER: return "consumer"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PRODUCER: return "http://hl7.org/fhir/document-mode"; - case CONSUMER: return "http://hl7.org/fhir/document-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PRODUCER: return "The application produces documents of the specified type."; - case CONSUMER: return "The application consumes documents of the specified type."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PRODUCER: return "Producer"; - case CONSUMER: return "Consumer"; - default: return "?"; - } - } - } - - public static class DocumentModeEnumFactory implements EnumFactory { - public DocumentMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("producer".equals(codeString)) - return DocumentMode.PRODUCER; - if ("consumer".equals(codeString)) - return DocumentMode.CONSUMER; - throw new IllegalArgumentException("Unknown DocumentMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("producer".equals(codeString)) - return new Enumeration(this, DocumentMode.PRODUCER); - if ("consumer".equals(codeString)) - return new Enumeration(this, DocumentMode.CONSUMER); - throw new FHIRException("Unknown DocumentMode code '"+codeString+"'"); - } - public String toCode(DocumentMode code) { - if (code == DocumentMode.PRODUCER) - return "producer"; - if (code == DocumentMode.CONSUMER) - return "consumer"; - return "?"; - } - public String toSystem(DocumentMode code) { - return code.getSystem(); - } - } - - @Block() - public static class ConformanceContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the conformance. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the conformance." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ConformanceContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the conformance.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the conformance. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the conformance. - */ - public ConformanceContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ConformanceContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the conformance.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ConformanceContactComponent copy() { - ConformanceContactComponent dst = new ConformanceContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceContactComponent)) - return false; - ConformanceContactComponent o = (ConformanceContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceContactComponent)) - return false; - ConformanceContactComponent o = (ConformanceContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.contact"; - - } - - } - - @Block() - public static class ConformanceSoftwareComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name software is known by. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="A name the software is known by", formalDefinition="Name software is known by." ) - protected StringType name; - - /** - * The version identifier for the software covered by this statement. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Version covered by this statement", formalDefinition="The version identifier for the software covered by this statement." ) - protected StringType version; - - /** - * Date this version of the software released. - */ - @Child(name = "releaseDate", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date this version released", formalDefinition="Date this version of the software released." ) - protected DateTimeType releaseDate; - - private static final long serialVersionUID = 1819769027L; - - /** - * Constructor - */ - public ConformanceSoftwareComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceSoftwareComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name software is known by.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceSoftwareComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name software is known by. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name software is known by. - */ - public ConformanceSoftwareComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version identifier for the software covered by this statement.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConformanceSoftwareComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version identifier for the software covered by this statement. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version identifier for the software covered by this statement. - */ - public ConformanceSoftwareComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value - */ - public DateTimeType getReleaseDateElement() { - if (this.releaseDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceSoftwareComponent.releaseDate"); - else if (Configuration.doAutoCreate()) - this.releaseDate = new DateTimeType(); // bb - return this.releaseDate; - } - - public boolean hasReleaseDateElement() { - return this.releaseDate != null && !this.releaseDate.isEmpty(); - } - - public boolean hasReleaseDate() { - return this.releaseDate != null && !this.releaseDate.isEmpty(); - } - - /** - * @param value {@link #releaseDate} (Date this version of the software released.). This is the underlying object with id, value and extensions. The accessor "getReleaseDate" gives direct access to the value - */ - public ConformanceSoftwareComponent setReleaseDateElement(DateTimeType value) { - this.releaseDate = value; - return this; - } - - /** - * @return Date this version of the software released. - */ - public Date getReleaseDate() { - return this.releaseDate == null ? null : this.releaseDate.getValue(); - } - - /** - * @param value Date this version of the software released. - */ - public ConformanceSoftwareComponent setReleaseDate(Date value) { - if (value == null) - this.releaseDate = null; - else { - if (this.releaseDate == null) - this.releaseDate = new DateTimeType(); - this.releaseDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Name software is known by.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("version", "string", "The version identifier for the software covered by this statement.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("releaseDate", "dateTime", "Date this version of the software released.", 0, java.lang.Integer.MAX_VALUE, releaseDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 212873301: /*releaseDate*/ return this.releaseDate == null ? new Base[0] : new Base[] {this.releaseDate}; // DateTimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 212873301: // releaseDate - this.releaseDate = castToDateTime(value); // DateTimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("releaseDate")) - this.releaseDate = castToDateTime(value); // DateTimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 212873301: throw new FHIRException("Cannot make property releaseDate as it is not a complex type"); // DateTimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.version"); - } - else if (name.equals("releaseDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.releaseDate"); - } - else - return super.addChild(name); - } - - public ConformanceSoftwareComponent copy() { - ConformanceSoftwareComponent dst = new ConformanceSoftwareComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.version = version == null ? null : version.copy(); - dst.releaseDate = releaseDate == null ? null : releaseDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceSoftwareComponent)) - return false; - ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; - return compareDeep(name, o.name, true) && compareDeep(version, o.version, true) && compareDeep(releaseDate, o.releaseDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceSoftwareComponent)) - return false; - ConformanceSoftwareComponent o = (ConformanceSoftwareComponent) other; - return compareValues(name, o.name, true) && compareValues(version, o.version, true) && compareValues(releaseDate, o.releaseDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (version == null || version.isEmpty()) - && (releaseDate == null || releaseDate.isEmpty()); - } - - public String fhirType() { - return "Conformance.software"; - - } - - } - - @Block() - public static class ConformanceImplementationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Information about the specific installation that this conformance statement relates to. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Describes this specific instance", formalDefinition="Information about the specific installation that this conformance statement relates to." ) - protected StringType description; - - /** - * An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Base URL for the installation", formalDefinition="An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces." ) - protected UriType url; - - private static final long serialVersionUID = -289238508L; - - /** - * Constructor - */ - public ConformanceImplementationComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceImplementationComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceImplementationComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Information about the specific installation that this conformance statement relates to.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConformanceImplementationComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Information about the specific installation that this conformance statement relates to. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Information about the specific installation that this conformance statement relates to. - */ - public ConformanceImplementationComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceImplementationComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ConformanceImplementationComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces. - */ - public ConformanceImplementationComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Information about the specific installation that this conformance statement relates to.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("url", "uri", "An absolute base URL for the implementation. This forms the base for REST interfaces as well as the mailbox and document interfaces.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.description"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.url"); - } - else - return super.addChild(name); - } - - public ConformanceImplementationComponent copy() { - ConformanceImplementationComponent dst = new ConformanceImplementationComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceImplementationComponent)) - return false; - ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; - return compareDeep(description, o.description, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceImplementationComponent)) - return false; - ConformanceImplementationComponent o = (ConformanceImplementationComponent) other; - return compareValues(description, o.description, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.implementation"; - - } - - } - - @Block() - public static class ConformanceRestComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="client | server", formalDefinition="Identifies whether this portion of the statement is describing ability to initiate or receive restful operations." ) - protected Enumeration mode; - - /** - * Information about the system's restful capabilities that apply across all applications, such as security. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="General description of implementation", formalDefinition="Information about the system's restful capabilities that apply across all applications, such as security." ) - protected StringType documentation; - - /** - * Information about security implementation from an interface perspective - what a client needs to know. - */ - @Child(name = "security", type = {}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Information about security of implementation", formalDefinition="Information about security implementation from an interface perspective - what a client needs to know." ) - protected ConformanceRestSecurityComponent security; - - /** - * A specification of the restful capabilities of the solution for a specific resource type. - */ - @Child(name = "resource", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Resource served on the REST interface", formalDefinition="A specification of the restful capabilities of the solution for a specific resource type." ) - protected List resource; - - /** - * A specification of restful operations supported by the system. - */ - @Child(name = "interaction", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="What operations are supported?", formalDefinition="A specification of restful operations supported by the system." ) - protected List interaction; - - /** - * A code that indicates how transactions are supported. - */ - @Child(name = "transactionMode", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="not-supported | batch | transaction | both", formalDefinition="A code that indicates how transactions are supported." ) - protected Enumeration transactionMode; - - /** - * Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. - */ - @Child(name = "searchParam", type = {ConformanceRestResourceSearchParamComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Search params for searching all resources", formalDefinition="Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." ) - protected List searchParam; - - /** - * Definition of an operation or a named query and with its parameters and their meaning and type. - */ - @Child(name = "operation", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Definition of an operation or a custom query", formalDefinition="Definition of an operation or a named query and with its parameters and their meaning and type." ) - protected List operation; - - /** - * An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL. - */ - @Child(name = "compartment", type = {UriType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Compartments served/used by system", formalDefinition="An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL." ) - protected List compartment; - - private static final long serialVersionUID = 931983837L; - - /** - * Constructor - */ - public ConformanceRestComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceRestComponent(Enumeration mode) { - super(); - this.mode = mode; - } - - /** - * @return {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceRestComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - public RestfulConformanceMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Identifies whether this portion of the statement is describing ability to initiate or receive restful operations. - */ - public ConformanceRestComponent setMode(RestfulConformanceMode value) { - if (this.mode == null) - this.mode = new Enumeration(new RestfulConformanceModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Information about the system's restful capabilities that apply across all applications, such as security.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceRestComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Information about the system's restful capabilities that apply across all applications, such as security. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Information about the system's restful capabilities that apply across all applications, such as security. - */ - public ConformanceRestComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) - */ - public ConformanceRestSecurityComponent getSecurity() { - if (this.security == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.security"); - else if (Configuration.doAutoCreate()) - this.security = new ConformanceRestSecurityComponent(); // cc - return this.security; - } - - public boolean hasSecurity() { - return this.security != null && !this.security.isEmpty(); - } - - /** - * @param value {@link #security} (Information about security implementation from an interface perspective - what a client needs to know.) - */ - public ConformanceRestComponent setSecurity(ConformanceRestSecurityComponent value) { - this.security = value; - return this; - } - - /** - * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) - */ - public List getResource() { - if (this.resource == null) - this.resource = new ArrayList(); - return this.resource; - } - - public boolean hasResource() { - if (this.resource == null) - return false; - for (ConformanceRestResourceComponent item : this.resource) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resource} (A specification of the restful capabilities of the solution for a specific resource type.) - */ - // syntactic sugar - public ConformanceRestResourceComponent addResource() { //3 - ConformanceRestResourceComponent t = new ConformanceRestResourceComponent(); - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addResource(ConformanceRestResourceComponent t) { //3 - if (t == null) - return this; - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return this; - } - - /** - * @return {@link #interaction} (A specification of restful operations supported by the system.) - */ - public List getInteraction() { - if (this.interaction == null) - this.interaction = new ArrayList(); - return this.interaction; - } - - public boolean hasInteraction() { - if (this.interaction == null) - return false; - for (SystemInteractionComponent item : this.interaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interaction} (A specification of restful operations supported by the system.) - */ - // syntactic sugar - public SystemInteractionComponent addInteraction() { //3 - SystemInteractionComponent t = new SystemInteractionComponent(); - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addInteraction(SystemInteractionComponent t) { //3 - if (t == null) - return this; - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return this; - } - - /** - * @return {@link #transactionMode} (A code that indicates how transactions are supported.). This is the underlying object with id, value and extensions. The accessor "getTransactionMode" gives direct access to the value - */ - public Enumeration getTransactionModeElement() { - if (this.transactionMode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestComponent.transactionMode"); - else if (Configuration.doAutoCreate()) - this.transactionMode = new Enumeration(new TransactionModeEnumFactory()); // bb - return this.transactionMode; - } - - public boolean hasTransactionModeElement() { - return this.transactionMode != null && !this.transactionMode.isEmpty(); - } - - public boolean hasTransactionMode() { - return this.transactionMode != null && !this.transactionMode.isEmpty(); - } - - /** - * @param value {@link #transactionMode} (A code that indicates how transactions are supported.). This is the underlying object with id, value and extensions. The accessor "getTransactionMode" gives direct access to the value - */ - public ConformanceRestComponent setTransactionModeElement(Enumeration value) { - this.transactionMode = value; - return this; - } - - /** - * @return A code that indicates how transactions are supported. - */ - public TransactionMode getTransactionMode() { - return this.transactionMode == null ? null : this.transactionMode.getValue(); - } - - /** - * @param value A code that indicates how transactions are supported. - */ - public ConformanceRestComponent setTransactionMode(TransactionMode value) { - if (value == null) - this.transactionMode = null; - else { - if (this.transactionMode == null) - this.transactionMode = new Enumeration(new TransactionModeEnumFactory()); - this.transactionMode.setValue(value); - } - return this; - } - - /** - * @return {@link #searchParam} (Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) - */ - public List getSearchParam() { - if (this.searchParam == null) - this.searchParam = new ArrayList(); - return this.searchParam; - } - - public boolean hasSearchParam() { - if (this.searchParam == null) - return false; - for (ConformanceRestResourceSearchParamComponent item : this.searchParam) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchParam} (Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) - */ - // syntactic sugar - public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 - ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addSearchParam(ConformanceRestResourceSearchParamComponent t) { //3 - if (t == null) - return this; - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return this; - } - - /** - * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) - */ - public List getOperation() { - if (this.operation == null) - this.operation = new ArrayList(); - return this.operation; - } - - public boolean hasOperation() { - if (this.operation == null) - return false; - for (ConformanceRestOperationComponent item : this.operation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operation} (Definition of an operation or a named query and with its parameters and their meaning and type.) - */ - // syntactic sugar - public ConformanceRestOperationComponent addOperation() { //3 - ConformanceRestOperationComponent t = new ConformanceRestOperationComponent(); - if (this.operation == null) - this.operation = new ArrayList(); - this.operation.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestComponent addOperation(ConformanceRestOperationComponent t) { //3 - if (t == null) - return this; - if (this.operation == null) - this.operation = new ArrayList(); - this.operation.add(t); - return this; - } - - /** - * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) - */ - public List getCompartment() { - if (this.compartment == null) - this.compartment = new ArrayList(); - return this.compartment; - } - - public boolean hasCompartment() { - if (this.compartment == null) - return false; - for (UriType item : this.compartment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) - */ - // syntactic sugar - public UriType addCompartmentElement() {//2 - UriType t = new UriType(); - if (this.compartment == null) - this.compartment = new ArrayList(); - this.compartment.add(t); - return t; - } - - /** - * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) - */ - public ConformanceRestComponent addCompartment(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.compartment == null) - this.compartment = new ArrayList(); - this.compartment.add(t); - return this; - } - - /** - * @param value {@link #compartment} (An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.) - */ - public boolean hasCompartment(String value) { - if (this.compartment == null) - return false; - for (UriType v : this.compartment) - if (v.equals(value)) // uri - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Identifies whether this portion of the statement is describing ability to initiate or receive restful operations.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "Information about the system's restful capabilities that apply across all applications, such as security.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("security", "", "Information about security implementation from an interface perspective - what a client needs to know.", 0, java.lang.Integer.MAX_VALUE, security)); - childrenList.add(new Property("resource", "", "A specification of the restful capabilities of the solution for a specific resource type.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("interaction", "", "A specification of restful operations supported by the system.", 0, java.lang.Integer.MAX_VALUE, interaction)); - childrenList.add(new Property("transactionMode", "code", "A code that indicates how transactions are supported.", 0, java.lang.Integer.MAX_VALUE, transactionMode)); - childrenList.add(new Property("searchParam", "@Conformance.rest.resource.searchParam", "Search parameters that are supported for searching all resources for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam)); - childrenList.add(new Property("operation", "", "Definition of an operation or a named query and with its parameters and their meaning and type.", 0, java.lang.Integer.MAX_VALUE, operation)); - childrenList.add(new Property("compartment", "uri", "An absolute URI which is a reference to the definition of a compartment that the system supports. The reference is to a CompartmentDefinition resource by it's canonical URL.", 0, java.lang.Integer.MAX_VALUE, compartment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case 949122880: /*security*/ return this.security == null ? new Base[0] : new Base[] {this.security}; // ConformanceRestSecurityComponent - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // ConformanceRestResourceComponent - case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // SystemInteractionComponent - case 1262805409: /*transactionMode*/ return this.transactionMode == null ? new Base[0] : new Base[] {this.transactionMode}; // Enumeration - case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // ConformanceRestResourceSearchParamComponent - case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : this.operation.toArray(new Base[this.operation.size()]); // ConformanceRestOperationComponent - case -397756334: /*compartment*/ return this.compartment == null ? new Base[0] : this.compartment.toArray(new Base[this.compartment.size()]); // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3357091: // mode - this.mode = new RestfulConformanceModeEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case 949122880: // security - this.security = (ConformanceRestSecurityComponent) value; // ConformanceRestSecurityComponent - break; - case -341064690: // resource - this.getResource().add((ConformanceRestResourceComponent) value); // ConformanceRestResourceComponent - break; - case 1844104722: // interaction - this.getInteraction().add((SystemInteractionComponent) value); // SystemInteractionComponent - break; - case 1262805409: // transactionMode - this.transactionMode = new TransactionModeEnumFactory().fromType(value); // Enumeration - break; - case -553645115: // searchParam - this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); // ConformanceRestResourceSearchParamComponent - break; - case 1662702951: // operation - this.getOperation().add((ConformanceRestOperationComponent) value); // ConformanceRestOperationComponent - break; - case -397756334: // compartment - this.getCompartment().add(castToUri(value)); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("mode")) - this.mode = new RestfulConformanceModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("security")) - this.security = (ConformanceRestSecurityComponent) value; // ConformanceRestSecurityComponent - else if (name.equals("resource")) - this.getResource().add((ConformanceRestResourceComponent) value); - else if (name.equals("interaction")) - this.getInteraction().add((SystemInteractionComponent) value); - else if (name.equals("transactionMode")) - this.transactionMode = new TransactionModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("searchParam")) - this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); - else if (name.equals("operation")) - this.getOperation().add((ConformanceRestOperationComponent) value); - else if (name.equals("compartment")) - this.getCompartment().add(castToUri(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case 949122880: return getSecurity(); // ConformanceRestSecurityComponent - case -341064690: return addResource(); // ConformanceRestResourceComponent - case 1844104722: return addInteraction(); // SystemInteractionComponent - case 1262805409: throw new FHIRException("Cannot make property transactionMode as it is not a complex type"); // Enumeration - case -553645115: return addSearchParam(); // ConformanceRestResourceSearchParamComponent - case 1662702951: return addOperation(); // ConformanceRestOperationComponent - case -397756334: throw new FHIRException("Cannot make property compartment as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.mode"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else if (name.equals("security")) { - this.security = new ConformanceRestSecurityComponent(); - return this.security; - } - else if (name.equals("resource")) { - return addResource(); - } - else if (name.equals("interaction")) { - return addInteraction(); - } - else if (name.equals("transactionMode")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.transactionMode"); - } - else if (name.equals("searchParam")) { - return addSearchParam(); - } - else if (name.equals("operation")) { - return addOperation(); - } - else if (name.equals("compartment")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.compartment"); - } - else - return super.addChild(name); - } - - public ConformanceRestComponent copy() { - ConformanceRestComponent dst = new ConformanceRestComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.security = security == null ? null : security.copy(); - if (resource != null) { - dst.resource = new ArrayList(); - for (ConformanceRestResourceComponent i : resource) - dst.resource.add(i.copy()); - }; - if (interaction != null) { - dst.interaction = new ArrayList(); - for (SystemInteractionComponent i : interaction) - dst.interaction.add(i.copy()); - }; - dst.transactionMode = transactionMode == null ? null : transactionMode.copy(); - if (searchParam != null) { - dst.searchParam = new ArrayList(); - for (ConformanceRestResourceSearchParamComponent i : searchParam) - dst.searchParam.add(i.copy()); - }; - if (operation != null) { - dst.operation = new ArrayList(); - for (ConformanceRestOperationComponent i : operation) - dst.operation.add(i.copy()); - }; - if (compartment != null) { - dst.compartment = new ArrayList(); - for (UriType i : compartment) - dst.compartment.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestComponent)) - return false; - ConformanceRestComponent o = (ConformanceRestComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(security, o.security, true) - && compareDeep(resource, o.resource, true) && compareDeep(interaction, o.interaction, true) && compareDeep(transactionMode, o.transactionMode, true) - && compareDeep(searchParam, o.searchParam, true) && compareDeep(operation, o.operation, true) && compareDeep(compartment, o.compartment, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestComponent)) - return false; - ConformanceRestComponent o = (ConformanceRestComponent) other; - return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) && compareValues(transactionMode, o.transactionMode, true) - && compareValues(compartment, o.compartment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (security == null || security.isEmpty()) && (resource == null || resource.isEmpty()) && (interaction == null || interaction.isEmpty()) - && (transactionMode == null || transactionMode.isEmpty()) && (searchParam == null || searchParam.isEmpty()) - && (operation == null || operation.isEmpty()) && (compartment == null || compartment.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest"; - - } - - } - - @Block() - public static class ConformanceRestSecurityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - @Child(name = "cors", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Adds CORS Headers (http://enable-cors.org/)", formalDefinition="Server adds CORS headers when responding to requests - this enables javascript applications to use the server." ) - protected BooleanType cors; - - /** - * Types of security services are supported/required by the system. - */ - @Child(name = "service", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", formalDefinition="Types of security services are supported/required by the system." ) - protected List service; - - /** - * General description of how security works. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="General description of how security works", formalDefinition="General description of how security works." ) - protected StringType description; - - /** - * Certificates associated with security profiles. - */ - @Child(name = "certificate", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Certificates associated with security profiles", formalDefinition="Certificates associated with security profiles." ) - protected List certificate; - - private static final long serialVersionUID = 391663952L; - - /** - * Constructor - */ - public ConformanceRestSecurityComponent() { - super(); - } - - /** - * @return {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value - */ - public BooleanType getCorsElement() { - if (this.cors == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.cors"); - else if (Configuration.doAutoCreate()) - this.cors = new BooleanType(); // bb - return this.cors; - } - - public boolean hasCorsElement() { - return this.cors != null && !this.cors.isEmpty(); - } - - public boolean hasCors() { - return this.cors != null && !this.cors.isEmpty(); - } - - /** - * @param value {@link #cors} (Server adds CORS headers when responding to requests - this enables javascript applications to use the server.). This is the underlying object with id, value and extensions. The accessor "getCors" gives direct access to the value - */ - public ConformanceRestSecurityComponent setCorsElement(BooleanType value) { - this.cors = value; - return this; - } - - /** - * @return Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - public boolean getCors() { - return this.cors == null || this.cors.isEmpty() ? false : this.cors.getValue(); - } - - /** - * @param value Server adds CORS headers when responding to requests - this enables javascript applications to use the server. - */ - public ConformanceRestSecurityComponent setCors(boolean value) { - if (this.cors == null) - this.cors = new BooleanType(); - this.cors.setValue(value); - return this; - } - - /** - * @return {@link #service} (Types of security services are supported/required by the system.) - */ - public List getService() { - if (this.service == null) - this.service = new ArrayList(); - return this.service; - } - - public boolean hasService() { - if (this.service == null) - return false; - for (CodeableConcept item : this.service) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #service} (Types of security services are supported/required by the system.) - */ - // syntactic sugar - public CodeableConcept addService() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.service == null) - this.service = new ArrayList(); - this.service.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestSecurityComponent addService(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.service == null) - this.service = new ArrayList(); - this.service.add(t); - return this; - } - - /** - * @return {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (General description of how security works.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ConformanceRestSecurityComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return General description of how security works. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value General description of how security works. - */ - public ConformanceRestSecurityComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #certificate} (Certificates associated with security profiles.) - */ - public List getCertificate() { - if (this.certificate == null) - this.certificate = new ArrayList(); - return this.certificate; - } - - public boolean hasCertificate() { - if (this.certificate == null) - return false; - for (ConformanceRestSecurityCertificateComponent item : this.certificate) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #certificate} (Certificates associated with security profiles.) - */ - // syntactic sugar - public ConformanceRestSecurityCertificateComponent addCertificate() { //3 - ConformanceRestSecurityCertificateComponent t = new ConformanceRestSecurityCertificateComponent(); - if (this.certificate == null) - this.certificate = new ArrayList(); - this.certificate.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestSecurityComponent addCertificate(ConformanceRestSecurityCertificateComponent t) { //3 - if (t == null) - return this; - if (this.certificate == null) - this.certificate = new ArrayList(); - this.certificate.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("cors", "boolean", "Server adds CORS headers when responding to requests - this enables javascript applications to use the server.", 0, java.lang.Integer.MAX_VALUE, cors)); - childrenList.add(new Property("service", "CodeableConcept", "Types of security services are supported/required by the system.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("description", "string", "General description of how security works.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("certificate", "", "Certificates associated with security profiles.", 0, java.lang.Integer.MAX_VALUE, certificate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059629: /*cors*/ return this.cors == null ? new Base[0] : new Base[] {this.cors}; // BooleanType - case 1984153269: /*service*/ return this.service == null ? new Base[0] : this.service.toArray(new Base[this.service.size()]); // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1952399767: /*certificate*/ return this.certificate == null ? new Base[0] : this.certificate.toArray(new Base[this.certificate.size()]); // ConformanceRestSecurityCertificateComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059629: // cors - this.cors = castToBoolean(value); // BooleanType - break; - case 1984153269: // service - this.getService().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 1952399767: // certificate - this.getCertificate().add((ConformanceRestSecurityCertificateComponent) value); // ConformanceRestSecurityCertificateComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("cors")) - this.cors = castToBoolean(value); // BooleanType - else if (name.equals("service")) - this.getService().add(castToCodeableConcept(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("certificate")) - this.getCertificate().add((ConformanceRestSecurityCertificateComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059629: throw new FHIRException("Cannot make property cors as it is not a complex type"); // BooleanType - case 1984153269: return addService(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1952399767: return addCertificate(); // ConformanceRestSecurityCertificateComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("cors")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.cors"); - } - else if (name.equals("service")) { - return addService(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.description"); - } - else if (name.equals("certificate")) { - return addCertificate(); - } - else - return super.addChild(name); - } - - public ConformanceRestSecurityComponent copy() { - ConformanceRestSecurityComponent dst = new ConformanceRestSecurityComponent(); - copyValues(dst); - dst.cors = cors == null ? null : cors.copy(); - if (service != null) { - dst.service = new ArrayList(); - for (CodeableConcept i : service) - dst.service.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (certificate != null) { - dst.certificate = new ArrayList(); - for (ConformanceRestSecurityCertificateComponent i : certificate) - dst.certificate.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestSecurityComponent)) - return false; - ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; - return compareDeep(cors, o.cors, true) && compareDeep(service, o.service, true) && compareDeep(description, o.description, true) - && compareDeep(certificate, o.certificate, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestSecurityComponent)) - return false; - ConformanceRestSecurityComponent o = (ConformanceRestSecurityComponent) other; - return compareValues(cors, o.cors, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (cors == null || cors.isEmpty()) && (service == null || service.isEmpty()) - && (description == null || description.isEmpty()) && (certificate == null || certificate.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.security"; - - } - - } - - @Block() - public static class ConformanceRestSecurityCertificateComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Mime type for certificate. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Mime type for certificate", formalDefinition="Mime type for certificate." ) - protected CodeType type; - - /** - * Actual certificate. - */ - @Child(name = "blob", type = {Base64BinaryType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Actual certificate", formalDefinition="Actual certificate." ) - protected Base64BinaryType blob; - - private static final long serialVersionUID = 2092655854L; - - /** - * Constructor - */ - public ConformanceRestSecurityCertificateComponent() { - super(); - } - - /** - * @return {@link #type} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Mime type for certificate.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestSecurityCertificateComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return Mime type for certificate. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Mime type for certificate. - */ - public ConformanceRestSecurityCertificateComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Base64BinaryType getBlobElement() { - if (this.blob == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestSecurityCertificateComponent.blob"); - else if (Configuration.doAutoCreate()) - this.blob = new Base64BinaryType(); // bb - return this.blob; - } - - public boolean hasBlobElement() { - return this.blob != null && !this.blob.isEmpty(); - } - - public boolean hasBlob() { - return this.blob != null && !this.blob.isEmpty(); - } - - /** - * @param value {@link #blob} (Actual certificate.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public ConformanceRestSecurityCertificateComponent setBlobElement(Base64BinaryType value) { - this.blob = value; - return this; - } - - /** - * @return Actual certificate. - */ - public byte[] getBlob() { - return this.blob == null ? null : this.blob.getValue(); - } - - /** - * @param value Actual certificate. - */ - public ConformanceRestSecurityCertificateComponent setBlob(byte[] value) { - if (value == null) - this.blob = null; - else { - if (this.blob == null) - this.blob = new Base64BinaryType(); - this.blob.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Mime type for certificate.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("blob", "base64Binary", "Actual certificate.", 0, java.lang.Integer.MAX_VALUE, blob)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case 3026845: /*blob*/ return this.blob == null ? new Base[0] : new Base[] {this.blob}; // Base64BinaryType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case 3026845: // blob - this.blob = castToBase64Binary(value); // Base64BinaryType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("blob")) - this.blob = castToBase64Binary(value); // Base64BinaryType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case 3026845: throw new FHIRException("Cannot make property blob as it is not a complex type"); // Base64BinaryType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.type"); - } - else if (name.equals("blob")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.blob"); - } - else - return super.addChild(name); - } - - public ConformanceRestSecurityCertificateComponent copy() { - ConformanceRestSecurityCertificateComponent dst = new ConformanceRestSecurityCertificateComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.blob = blob == null ? null : blob.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestSecurityCertificateComponent)) - return false; - ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; - return compareDeep(type, o.type, true) && compareDeep(blob, o.blob, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestSecurityCertificateComponent)) - return false; - ConformanceRestSecurityCertificateComponent o = (ConformanceRestSecurityCertificateComponent) other; - return compareValues(type, o.type, true) && compareValues(blob, o.blob, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (blob == null || blob.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.security.certificate"; - - } - - } - - @Block() - public static class ConformanceRestResourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A type of resource exposed via the restful interface. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="A resource type that is supported", formalDefinition="A type of resource exposed via the restful interface." ) - protected CodeType type; - - /** - * A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Base System profile for all uses of resource", formalDefinition="A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - protected StructureDefinition profileTarget; - - /** - * Identifies a restful operation supported by the solution. - */ - @Child(name = "interaction", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="What operations are supported?", formalDefinition="Identifies a restful operation supported by the solution." ) - protected List interaction; - - /** - * This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. - */ - @Child(name = "versioning", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="no-version | versioned | versioned-update", formalDefinition="This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API." ) - protected Enumeration versioning; - - /** - * A flag for whether the server is able to return past versions as part of the vRead operation. - */ - @Child(name = "readHistory", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether vRead can return past versions", formalDefinition="A flag for whether the server is able to return past versions as part of the vRead operation." ) - protected BooleanType readHistory; - - /** - * A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. - */ - @Child(name = "updateCreate", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If update can commit to a new identity", formalDefinition="A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server." ) - protected BooleanType updateCreate; - - /** - * A flag that indicates that the server supports conditional create. - */ - @Child(name = "conditionalCreate", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If allows/uses conditional create", formalDefinition="A flag that indicates that the server supports conditional create." ) - protected BooleanType conditionalCreate; - - /** - * A flag that indicates that the server supports conditional update. - */ - @Child(name = "conditionalUpdate", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If allows/uses conditional update", formalDefinition="A flag that indicates that the server supports conditional update." ) - protected BooleanType conditionalUpdate; - - /** - * A code that indicates how the server supports conditional delete. - */ - @Child(name = "conditionalDelete", type = {CodeType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="not-supported | single | multiple - how conditional delete is supported", formalDefinition="A code that indicates how the server supports conditional delete." ) - protected Enumeration conditionalDelete; - - /** - * A list of _include values supported by the server. - */ - @Child(name = "searchInclude", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="_include values supported by the server", formalDefinition="A list of _include values supported by the server." ) - protected List searchInclude; - - /** - * A list of _revinclude (reverse include) values supported by the server. - */ - @Child(name = "searchRevInclude", type = {StringType.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="_revinclude values supported by the server", formalDefinition="A list of _revinclude (reverse include) values supported by the server." ) - protected List searchRevInclude; - - /** - * Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation. - */ - @Child(name = "searchParam", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Search params supported by implementation", formalDefinition="Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation." ) - protected List searchParam; - - private static final long serialVersionUID = 1781959905L; - - /** - * Constructor - */ - public ConformanceRestResourceComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceRestResourceComponent(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A type of resource exposed via the restful interface.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestResourceComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return A type of resource exposed via the restful interface. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A type of resource exposed via the restful interface. - */ - public ConformanceRestResourceComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public ConformanceRestResourceComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public ConformanceRestResourceComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #interaction} (Identifies a restful operation supported by the solution.) - */ - public List getInteraction() { - if (this.interaction == null) - this.interaction = new ArrayList(); - return this.interaction; - } - - public boolean hasInteraction() { - if (this.interaction == null) - return false; - for (ResourceInteractionComponent item : this.interaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interaction} (Identifies a restful operation supported by the solution.) - */ - // syntactic sugar - public ResourceInteractionComponent addInteraction() { //3 - ResourceInteractionComponent t = new ResourceInteractionComponent(); - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestResourceComponent addInteraction(ResourceInteractionComponent t) { //3 - if (t == null) - return this; - if (this.interaction == null) - this.interaction = new ArrayList(); - this.interaction.add(t); - return this; - } - - /** - * @return {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public Enumeration getVersioningElement() { - if (this.versioning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.versioning"); - else if (Configuration.doAutoCreate()) - this.versioning = new Enumeration(new ResourceVersionPolicyEnumFactory()); // bb - return this.versioning; - } - - public boolean hasVersioningElement() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - public boolean hasVersioning() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - /** - * @param value {@link #versioning} (This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public ConformanceRestResourceComponent setVersioningElement(Enumeration value) { - this.versioning = value; - return this; - } - - /** - * @return This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. - */ - public ResourceVersionPolicy getVersioning() { - return this.versioning == null ? null : this.versioning.getValue(); - } - - /** - * @param value This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API. - */ - public ConformanceRestResourceComponent setVersioning(ResourceVersionPolicy value) { - if (value == null) - this.versioning = null; - else { - if (this.versioning == null) - this.versioning = new Enumeration(new ResourceVersionPolicyEnumFactory()); - this.versioning.setValue(value); - } - return this; - } - - /** - * @return {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value - */ - public BooleanType getReadHistoryElement() { - if (this.readHistory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.readHistory"); - else if (Configuration.doAutoCreate()) - this.readHistory = new BooleanType(); // bb - return this.readHistory; - } - - public boolean hasReadHistoryElement() { - return this.readHistory != null && !this.readHistory.isEmpty(); - } - - public boolean hasReadHistory() { - return this.readHistory != null && !this.readHistory.isEmpty(); - } - - /** - * @param value {@link #readHistory} (A flag for whether the server is able to return past versions as part of the vRead operation.). This is the underlying object with id, value and extensions. The accessor "getReadHistory" gives direct access to the value - */ - public ConformanceRestResourceComponent setReadHistoryElement(BooleanType value) { - this.readHistory = value; - return this; - } - - /** - * @return A flag for whether the server is able to return past versions as part of the vRead operation. - */ - public boolean getReadHistory() { - return this.readHistory == null || this.readHistory.isEmpty() ? false : this.readHistory.getValue(); - } - - /** - * @param value A flag for whether the server is able to return past versions as part of the vRead operation. - */ - public ConformanceRestResourceComponent setReadHistory(boolean value) { - if (this.readHistory == null) - this.readHistory = new BooleanType(); - this.readHistory.setValue(value); - return this; - } - - /** - * @return {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value - */ - public BooleanType getUpdateCreateElement() { - if (this.updateCreate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.updateCreate"); - else if (Configuration.doAutoCreate()) - this.updateCreate = new BooleanType(); // bb - return this.updateCreate; - } - - public boolean hasUpdateCreateElement() { - return this.updateCreate != null && !this.updateCreate.isEmpty(); - } - - public boolean hasUpdateCreate() { - return this.updateCreate != null && !this.updateCreate.isEmpty(); - } - - /** - * @param value {@link #updateCreate} (A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.). This is the underlying object with id, value and extensions. The accessor "getUpdateCreate" gives direct access to the value - */ - public ConformanceRestResourceComponent setUpdateCreateElement(BooleanType value) { - this.updateCreate = value; - return this; - } - - /** - * @return A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. - */ - public boolean getUpdateCreate() { - return this.updateCreate == null || this.updateCreate.isEmpty() ? false : this.updateCreate.getValue(); - } - - /** - * @param value A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server. - */ - public ConformanceRestResourceComponent setUpdateCreate(boolean value) { - if (this.updateCreate == null) - this.updateCreate = new BooleanType(); - this.updateCreate.setValue(value); - return this; - } - - /** - * @return {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value - */ - public BooleanType getConditionalCreateElement() { - if (this.conditionalCreate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalCreate"); - else if (Configuration.doAutoCreate()) - this.conditionalCreate = new BooleanType(); // bb - return this.conditionalCreate; - } - - public boolean hasConditionalCreateElement() { - return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); - } - - public boolean hasConditionalCreate() { - return this.conditionalCreate != null && !this.conditionalCreate.isEmpty(); - } - - /** - * @param value {@link #conditionalCreate} (A flag that indicates that the server supports conditional create.). This is the underlying object with id, value and extensions. The accessor "getConditionalCreate" gives direct access to the value - */ - public ConformanceRestResourceComponent setConditionalCreateElement(BooleanType value) { - this.conditionalCreate = value; - return this; - } - - /** - * @return A flag that indicates that the server supports conditional create. - */ - public boolean getConditionalCreate() { - return this.conditionalCreate == null || this.conditionalCreate.isEmpty() ? false : this.conditionalCreate.getValue(); - } - - /** - * @param value A flag that indicates that the server supports conditional create. - */ - public ConformanceRestResourceComponent setConditionalCreate(boolean value) { - if (this.conditionalCreate == null) - this.conditionalCreate = new BooleanType(); - this.conditionalCreate.setValue(value); - return this; - } - - /** - * @return {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value - */ - public BooleanType getConditionalUpdateElement() { - if (this.conditionalUpdate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalUpdate"); - else if (Configuration.doAutoCreate()) - this.conditionalUpdate = new BooleanType(); // bb - return this.conditionalUpdate; - } - - public boolean hasConditionalUpdateElement() { - return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); - } - - public boolean hasConditionalUpdate() { - return this.conditionalUpdate != null && !this.conditionalUpdate.isEmpty(); - } - - /** - * @param value {@link #conditionalUpdate} (A flag that indicates that the server supports conditional update.). This is the underlying object with id, value and extensions. The accessor "getConditionalUpdate" gives direct access to the value - */ - public ConformanceRestResourceComponent setConditionalUpdateElement(BooleanType value) { - this.conditionalUpdate = value; - return this; - } - - /** - * @return A flag that indicates that the server supports conditional update. - */ - public boolean getConditionalUpdate() { - return this.conditionalUpdate == null || this.conditionalUpdate.isEmpty() ? false : this.conditionalUpdate.getValue(); - } - - /** - * @param value A flag that indicates that the server supports conditional update. - */ - public ConformanceRestResourceComponent setConditionalUpdate(boolean value) { - if (this.conditionalUpdate == null) - this.conditionalUpdate = new BooleanType(); - this.conditionalUpdate.setValue(value); - return this; - } - - /** - * @return {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value - */ - public Enumeration getConditionalDeleteElement() { - if (this.conditionalDelete == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceComponent.conditionalDelete"); - else if (Configuration.doAutoCreate()) - this.conditionalDelete = new Enumeration(new ConditionalDeleteStatusEnumFactory()); // bb - return this.conditionalDelete; - } - - public boolean hasConditionalDeleteElement() { - return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); - } - - public boolean hasConditionalDelete() { - return this.conditionalDelete != null && !this.conditionalDelete.isEmpty(); - } - - /** - * @param value {@link #conditionalDelete} (A code that indicates how the server supports conditional delete.). This is the underlying object with id, value and extensions. The accessor "getConditionalDelete" gives direct access to the value - */ - public ConformanceRestResourceComponent setConditionalDeleteElement(Enumeration value) { - this.conditionalDelete = value; - return this; - } - - /** - * @return A code that indicates how the server supports conditional delete. - */ - public ConditionalDeleteStatus getConditionalDelete() { - return this.conditionalDelete == null ? null : this.conditionalDelete.getValue(); - } - - /** - * @param value A code that indicates how the server supports conditional delete. - */ - public ConformanceRestResourceComponent setConditionalDelete(ConditionalDeleteStatus value) { - if (value == null) - this.conditionalDelete = null; - else { - if (this.conditionalDelete == null) - this.conditionalDelete = new Enumeration(new ConditionalDeleteStatusEnumFactory()); - this.conditionalDelete.setValue(value); - } - return this; - } - - /** - * @return {@link #searchInclude} (A list of _include values supported by the server.) - */ - public List getSearchInclude() { - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - return this.searchInclude; - } - - public boolean hasSearchInclude() { - if (this.searchInclude == null) - return false; - for (StringType item : this.searchInclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchInclude} (A list of _include values supported by the server.) - */ - // syntactic sugar - public StringType addSearchIncludeElement() {//2 - StringType t = new StringType(); - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - this.searchInclude.add(t); - return t; - } - - /** - * @param value {@link #searchInclude} (A list of _include values supported by the server.) - */ - public ConformanceRestResourceComponent addSearchInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.searchInclude == null) - this.searchInclude = new ArrayList(); - this.searchInclude.add(t); - return this; - } - - /** - * @param value {@link #searchInclude} (A list of _include values supported by the server.) - */ - public boolean hasSearchInclude(String value) { - if (this.searchInclude == null) - return false; - for (StringType v : this.searchInclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) - */ - public List getSearchRevInclude() { - if (this.searchRevInclude == null) - this.searchRevInclude = new ArrayList(); - return this.searchRevInclude; - } - - public boolean hasSearchRevInclude() { - if (this.searchRevInclude == null) - return false; - for (StringType item : this.searchRevInclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) - */ - // syntactic sugar - public StringType addSearchRevIncludeElement() {//2 - StringType t = new StringType(); - if (this.searchRevInclude == null) - this.searchRevInclude = new ArrayList(); - this.searchRevInclude.add(t); - return t; - } - - /** - * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) - */ - public ConformanceRestResourceComponent addSearchRevInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.searchRevInclude == null) - this.searchRevInclude = new ArrayList(); - this.searchRevInclude.add(t); - return this; - } - - /** - * @param value {@link #searchRevInclude} (A list of _revinclude (reverse include) values supported by the server.) - */ - public boolean hasSearchRevInclude(String value) { - if (this.searchRevInclude == null) - return false; - for (StringType v : this.searchRevInclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) - */ - public List getSearchParam() { - if (this.searchParam == null) - this.searchParam = new ArrayList(); - return this.searchParam; - } - - public boolean hasSearchParam() { - if (this.searchParam == null) - return false; - for (ConformanceRestResourceSearchParamComponent item : this.searchParam) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #searchParam} (Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.) - */ - // syntactic sugar - public ConformanceRestResourceSearchParamComponent addSearchParam() { //3 - ConformanceRestResourceSearchParamComponent t = new ConformanceRestResourceSearchParamComponent(); - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return t; - } - - // syntactic sugar - public ConformanceRestResourceComponent addSearchParam(ConformanceRestResourceSearchParamComponent t) { //3 - if (t == null) - return this; - if (this.searchParam == null) - this.searchParam = new ArrayList(); - this.searchParam.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "A type of resource exposed via the restful interface.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A specification of the profile that describes the solution's overall support for the resource, including any constraints on cardinality, bindings, lengths or other limitations. See further discussion in [Using Profiles]{profiling.html#profile-uses}.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("interaction", "", "Identifies a restful operation supported by the solution.", 0, java.lang.Integer.MAX_VALUE, interaction)); - childrenList.add(new Property("versioning", "code", "This field is set to no-version to specify that the system does not support (server) or use (client) versioning for this resource type. If this has some other value, the server must at least correctly track and populate the versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the versioning features, including using e-tags for version integrity in the API.", 0, java.lang.Integer.MAX_VALUE, versioning)); - childrenList.add(new Property("readHistory", "boolean", "A flag for whether the server is able to return past versions as part of the vRead operation.", 0, java.lang.Integer.MAX_VALUE, readHistory)); - childrenList.add(new Property("updateCreate", "boolean", "A flag to indicate that the server allows or needs to allow the client to create new identities on the server (e.g. that is, the client PUTs to a location where there is no existing resource). Allowing this operation means that the server allows the client to create new identities on the server.", 0, java.lang.Integer.MAX_VALUE, updateCreate)); - childrenList.add(new Property("conditionalCreate", "boolean", "A flag that indicates that the server supports conditional create.", 0, java.lang.Integer.MAX_VALUE, conditionalCreate)); - childrenList.add(new Property("conditionalUpdate", "boolean", "A flag that indicates that the server supports conditional update.", 0, java.lang.Integer.MAX_VALUE, conditionalUpdate)); - childrenList.add(new Property("conditionalDelete", "code", "A code that indicates how the server supports conditional delete.", 0, java.lang.Integer.MAX_VALUE, conditionalDelete)); - childrenList.add(new Property("searchInclude", "string", "A list of _include values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchInclude)); - childrenList.add(new Property("searchRevInclude", "string", "A list of _revinclude (reverse include) values supported by the server.", 0, java.lang.Integer.MAX_VALUE, searchRevInclude)); - childrenList.add(new Property("searchParam", "", "Search parameters for implementations to support and/or make use of - either references to ones defined in the specification, or additional ones defined for/by the implementation.", 0, java.lang.Integer.MAX_VALUE, searchParam)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - case 1844104722: /*interaction*/ return this.interaction == null ? new Base[0] : this.interaction.toArray(new Base[this.interaction.size()]); // ResourceInteractionComponent - case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration - case 187518494: /*readHistory*/ return this.readHistory == null ? new Base[0] : new Base[] {this.readHistory}; // BooleanType - case -1400550619: /*updateCreate*/ return this.updateCreate == null ? new Base[0] : new Base[] {this.updateCreate}; // BooleanType - case 6401826: /*conditionalCreate*/ return this.conditionalCreate == null ? new Base[0] : new Base[] {this.conditionalCreate}; // BooleanType - case 519849711: /*conditionalUpdate*/ return this.conditionalUpdate == null ? new Base[0] : new Base[] {this.conditionalUpdate}; // BooleanType - case 23237585: /*conditionalDelete*/ return this.conditionalDelete == null ? new Base[0] : new Base[] {this.conditionalDelete}; // Enumeration - case -1035904544: /*searchInclude*/ return this.searchInclude == null ? new Base[0] : this.searchInclude.toArray(new Base[this.searchInclude.size()]); // StringType - case -2123884979: /*searchRevInclude*/ return this.searchRevInclude == null ? new Base[0] : this.searchRevInclude.toArray(new Base[this.searchRevInclude.size()]); // StringType - case -553645115: /*searchParam*/ return this.searchParam == null ? new Base[0] : this.searchParam.toArray(new Base[this.searchParam.size()]); // ConformanceRestResourceSearchParamComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - case 1844104722: // interaction - this.getInteraction().add((ResourceInteractionComponent) value); // ResourceInteractionComponent - break; - case -670487542: // versioning - this.versioning = new ResourceVersionPolicyEnumFactory().fromType(value); // Enumeration - break; - case 187518494: // readHistory - this.readHistory = castToBoolean(value); // BooleanType - break; - case -1400550619: // updateCreate - this.updateCreate = castToBoolean(value); // BooleanType - break; - case 6401826: // conditionalCreate - this.conditionalCreate = castToBoolean(value); // BooleanType - break; - case 519849711: // conditionalUpdate - this.conditionalUpdate = castToBoolean(value); // BooleanType - break; - case 23237585: // conditionalDelete - this.conditionalDelete = new ConditionalDeleteStatusEnumFactory().fromType(value); // Enumeration - break; - case -1035904544: // searchInclude - this.getSearchInclude().add(castToString(value)); // StringType - break; - case -2123884979: // searchRevInclude - this.getSearchRevInclude().add(castToString(value)); // StringType - break; - case -553645115: // searchParam - this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); // ConformanceRestResourceSearchParamComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else if (name.equals("interaction")) - this.getInteraction().add((ResourceInteractionComponent) value); - else if (name.equals("versioning")) - this.versioning = new ResourceVersionPolicyEnumFactory().fromType(value); // Enumeration - else if (name.equals("readHistory")) - this.readHistory = castToBoolean(value); // BooleanType - else if (name.equals("updateCreate")) - this.updateCreate = castToBoolean(value); // BooleanType - else if (name.equals("conditionalCreate")) - this.conditionalCreate = castToBoolean(value); // BooleanType - else if (name.equals("conditionalUpdate")) - this.conditionalUpdate = castToBoolean(value); // BooleanType - else if (name.equals("conditionalDelete")) - this.conditionalDelete = new ConditionalDeleteStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("searchInclude")) - this.getSearchInclude().add(castToString(value)); - else if (name.equals("searchRevInclude")) - this.getSearchRevInclude().add(castToString(value)); - else if (name.equals("searchParam")) - this.getSearchParam().add((ConformanceRestResourceSearchParamComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return getProfile(); // Reference - case 1844104722: return addInteraction(); // ResourceInteractionComponent - case -670487542: throw new FHIRException("Cannot make property versioning as it is not a complex type"); // Enumeration - case 187518494: throw new FHIRException("Cannot make property readHistory as it is not a complex type"); // BooleanType - case -1400550619: throw new FHIRException("Cannot make property updateCreate as it is not a complex type"); // BooleanType - case 6401826: throw new FHIRException("Cannot make property conditionalCreate as it is not a complex type"); // BooleanType - case 519849711: throw new FHIRException("Cannot make property conditionalUpdate as it is not a complex type"); // BooleanType - case 23237585: throw new FHIRException("Cannot make property conditionalDelete as it is not a complex type"); // Enumeration - case -1035904544: throw new FHIRException("Cannot make property searchInclude as it is not a complex type"); // StringType - case -2123884979: throw new FHIRException("Cannot make property searchRevInclude as it is not a complex type"); // StringType - case -553645115: return addSearchParam(); // ConformanceRestResourceSearchParamComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.type"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else if (name.equals("interaction")) { - return addInteraction(); - } - else if (name.equals("versioning")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.versioning"); - } - else if (name.equals("readHistory")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.readHistory"); - } - else if (name.equals("updateCreate")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.updateCreate"); - } - else if (name.equals("conditionalCreate")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.conditionalCreate"); - } - else if (name.equals("conditionalUpdate")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.conditionalUpdate"); - } - else if (name.equals("conditionalDelete")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.conditionalDelete"); - } - else if (name.equals("searchInclude")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.searchInclude"); - } - else if (name.equals("searchRevInclude")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.searchRevInclude"); - } - else if (name.equals("searchParam")) { - return addSearchParam(); - } - else - return super.addChild(name); - } - - public ConformanceRestResourceComponent copy() { - ConformanceRestResourceComponent dst = new ConformanceRestResourceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (interaction != null) { - dst.interaction = new ArrayList(); - for (ResourceInteractionComponent i : interaction) - dst.interaction.add(i.copy()); - }; - dst.versioning = versioning == null ? null : versioning.copy(); - dst.readHistory = readHistory == null ? null : readHistory.copy(); - dst.updateCreate = updateCreate == null ? null : updateCreate.copy(); - dst.conditionalCreate = conditionalCreate == null ? null : conditionalCreate.copy(); - dst.conditionalUpdate = conditionalUpdate == null ? null : conditionalUpdate.copy(); - dst.conditionalDelete = conditionalDelete == null ? null : conditionalDelete.copy(); - if (searchInclude != null) { - dst.searchInclude = new ArrayList(); - for (StringType i : searchInclude) - dst.searchInclude.add(i.copy()); - }; - if (searchRevInclude != null) { - dst.searchRevInclude = new ArrayList(); - for (StringType i : searchRevInclude) - dst.searchRevInclude.add(i.copy()); - }; - if (searchParam != null) { - dst.searchParam = new ArrayList(); - for (ConformanceRestResourceSearchParamComponent i : searchParam) - dst.searchParam.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestResourceComponent)) - return false; - ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; - return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(interaction, o.interaction, true) - && compareDeep(versioning, o.versioning, true) && compareDeep(readHistory, o.readHistory, true) - && compareDeep(updateCreate, o.updateCreate, true) && compareDeep(conditionalCreate, o.conditionalCreate, true) - && compareDeep(conditionalUpdate, o.conditionalUpdate, true) && compareDeep(conditionalDelete, o.conditionalDelete, true) - && compareDeep(searchInclude, o.searchInclude, true) && compareDeep(searchRevInclude, o.searchRevInclude, true) - && compareDeep(searchParam, o.searchParam, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestResourceComponent)) - return false; - ConformanceRestResourceComponent o = (ConformanceRestResourceComponent) other; - return compareValues(type, o.type, true) && compareValues(versioning, o.versioning, true) && compareValues(readHistory, o.readHistory, true) - && compareValues(updateCreate, o.updateCreate, true) && compareValues(conditionalCreate, o.conditionalCreate, true) - && compareValues(conditionalUpdate, o.conditionalUpdate, true) && compareValues(conditionalDelete, o.conditionalDelete, true) - && compareValues(searchInclude, o.searchInclude, true) && compareValues(searchRevInclude, o.searchRevInclude, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) - && (interaction == null || interaction.isEmpty()) && (versioning == null || versioning.isEmpty()) - && (readHistory == null || readHistory.isEmpty()) && (updateCreate == null || updateCreate.isEmpty()) - && (conditionalCreate == null || conditionalCreate.isEmpty()) && (conditionalUpdate == null || conditionalUpdate.isEmpty()) - && (conditionalDelete == null || conditionalDelete.isEmpty()) && (searchInclude == null || searchInclude.isEmpty()) - && (searchRevInclude == null || searchRevInclude.isEmpty()) && (searchParam == null || searchParam.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.resource"; - - } - - } - - @Block() - public static class ResourceInteractionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Coded identifier of the operation, supported by the system resource. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="read | vread | update | delete | history-instance | history-type | create | search-type", formalDefinition="Coded identifier of the operation, supported by the system resource." ) - protected Enumeration code; - - /** - * Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'." ) - protected StringType documentation; - - private static final long serialVersionUID = -437507806L; - - /** - * Constructor - */ - public ResourceInteractionComponent() { - super(); - } - - /** - * Constructor - */ - public ResourceInteractionComponent(Enumeration code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceInteractionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Coded identifier of the operation, supported by the system resource.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ResourceInteractionComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Coded identifier of the operation, supported by the system resource. - */ - public TypeRestfulInteraction getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Coded identifier of the operation, supported by the system resource. - */ - public ResourceInteractionComponent setCode(TypeRestfulInteraction value) { - if (this.code == null) - this.code = new Enumeration(new TypeRestfulInteractionEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ResourceInteractionComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ResourceInteractionComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'. - */ - public ResourceInteractionComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Coded identifier of the operation, supported by the system resource.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as 'delete is a logical delete' or 'updates are only allowed with version id' or 'creates permitted from pre-authorized certificates only'.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = new TypeRestfulInteractionEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = new TypeRestfulInteractionEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.code"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else - return super.addChild(name); - } - - public ResourceInteractionComponent copy() { - ResourceInteractionComponent dst = new ResourceInteractionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ResourceInteractionComponent)) - return false; - ResourceInteractionComponent o = (ResourceInteractionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ResourceInteractionComponent)) - return false; - ResourceInteractionComponent o = (ResourceInteractionComponent) other; - return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.resource.interaction"; - - } - - } - - @Block() - public static class ConformanceRestResourceSearchParamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the search parameter used in the interface. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of search parameter", formalDefinition="The name of the search parameter used in the interface." ) - protected StringType name; - - /** - * An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). - */ - @Child(name = "definition", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Source of definition for parameter", formalDefinition="An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]])." ) - protected UriType definition; - - /** - * The type of value a search parameter refers to, and how the content is interpreted. - */ - @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) - protected Enumeration type; - - /** - * This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Server-specific usage", formalDefinition="This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms." ) - protected StringType documentation; - - /** - * Types of resource (if a resource is referenced). - */ - @Child(name = "target", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - protected List target; - - /** - * A modifier supported for the search parameter. - */ - @Child(name = "modifier", type = {CodeType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="missing | exact | contains | not | text | in | not-in | below | above | type", formalDefinition="A modifier supported for the search parameter." ) - protected List> modifier; - - /** - * Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type. - */ - @Child(name = "chain", type = {StringType.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Chained names supported", formalDefinition="Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type." ) - protected List chain; - - private static final long serialVersionUID = -1020405086L; - - /** - * Constructor - */ - public ConformanceRestResourceSearchParamComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceRestResourceSearchParamComponent(StringType name, Enumeration type) { - super(); - this.name = name; - this.type = type; - } - - /** - * @return {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the search parameter used in the interface.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the search parameter used in the interface. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the search parameter used in the interface. - */ - public ConformanceRestResourceSearchParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public UriType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new UriType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setDefinitionElement(UriType value) { - this.definition = value; - return this; - } - - /** - * @return An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]). - */ - public ConformanceRestResourceSearchParamComponent setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new UriType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParamType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of value a search parameter refers to, and how the content is interpreted. - */ - public ConformanceRestResourceSearchParamComponent setType(SearchParamType value) { - if (this.type == null) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestResourceSearchParamComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceRestResourceSearchParamComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms. - */ - public ConformanceRestResourceSearchParamComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - // syntactic sugar - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public ConformanceRestResourceSearchParamComponent addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #modifier} (A modifier supported for the search parameter.) - */ - public List> getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList>(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Enumeration item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (A modifier supported for the search parameter.) - */ - // syntactic sugar - public Enumeration addModifierElement() {//2 - Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); - if (this.modifier == null) - this.modifier = new ArrayList>(); - this.modifier.add(t); - return t; - } - - /** - * @param value {@link #modifier} (A modifier supported for the search parameter.) - */ - public ConformanceRestResourceSearchParamComponent addModifier(SearchModifierCode value) { //1 - Enumeration t = new Enumeration(new SearchModifierCodeEnumFactory()); - t.setValue(value); - if (this.modifier == null) - this.modifier = new ArrayList>(); - this.modifier.add(t); - return this; - } - - /** - * @param value {@link #modifier} (A modifier supported for the search parameter.) - */ - public boolean hasModifier(SearchModifierCode value) { - if (this.modifier == null) - return false; - for (Enumeration v : this.modifier) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) - */ - public List getChain() { - if (this.chain == null) - this.chain = new ArrayList(); - return this.chain; - } - - public boolean hasChain() { - if (this.chain == null) - return false; - for (StringType item : this.chain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) - */ - // syntactic sugar - public StringType addChainElement() {//2 - StringType t = new StringType(); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return t; - } - - /** - * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) - */ - public ConformanceRestResourceSearchParamComponent addChain(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.chain == null) - this.chain = new ArrayList(); - this.chain.add(t); - return this; - } - - /** - * @param value {@link #chain} (Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.) - */ - public boolean hasChain(String value) { - if (this.chain == null) - return false; - for (StringType v : this.chain) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the search parameter used in the interface.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("definition", "uri", "An absolute URI that is a formal reference to where this parameter was first defined, so that a client can be confident of the meaning of the search parameter (a reference to [[[SearchParameter.url]]]).", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("documentation", "string", "This allows documentation of any distinct behaviors about how the search parameter is used. For example, text matching algorithms.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("modifier", "code", "A modifier supported for the search parameter.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("chain", "string", "Contains the names of any search parameters which may be chained to the containing search parameter. Chained parameters may be added to search parameters of type reference, and specify that resources will only be returned if they contain a reference to a resource which matches the chained parameter value. Values for this field should be drawn from Conformance.rest.resource.searchParam.name on the target resource type.", 0, java.lang.Integer.MAX_VALUE, chain)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Enumeration - case 94623425: /*chain*/ return this.chain == null ? new Base[0] : this.chain.toArray(new Base[this.chain.size()]); // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1014418093: // definition - this.definition = castToUri(value); // UriType - break; - case 3575610: // type - this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case -880905839: // target - this.getTarget().add(castToCode(value)); // CodeType - break; - case -615513385: // modifier - this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); // Enumeration - break; - case 94623425: // chain - this.getChain().add(castToString(value)); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("definition")) - this.definition = castToUri(value); // UriType - else if (name.equals("type")) - this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("target")) - this.getTarget().add(castToCode(value)); - else if (name.equals("modifier")) - this.getModifier().add(new SearchModifierCodeEnumFactory().fromType(value)); - else if (name.equals("chain")) - this.getChain().add(castToString(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // CodeType - case -615513385: throw new FHIRException("Cannot make property modifier as it is not a complex type"); // Enumeration - case 94623425: throw new FHIRException("Cannot make property chain as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); - } - else if (name.equals("definition")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.definition"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.type"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else if (name.equals("target")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.target"); - } - else if (name.equals("modifier")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.modifier"); - } - else if (name.equals("chain")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.chain"); - } - else - return super.addChild(name); - } - - public ConformanceRestResourceSearchParamComponent copy() { - ConformanceRestResourceSearchParamComponent dst = new ConformanceRestResourceSearchParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.type = type == null ? null : type.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList>(); - for (Enumeration i : modifier) - dst.modifier.add(i.copy()); - }; - if (chain != null) { - dst.chain = new ArrayList(); - for (StringType i : chain) - dst.chain.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestResourceSearchParamComponent)) - return false; - ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; - return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true) && compareDeep(type, o.type, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(target, o.target, true) && compareDeep(modifier, o.modifier, true) - && compareDeep(chain, o.chain, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestResourceSearchParamComponent)) - return false; - ConformanceRestResourceSearchParamComponent o = (ConformanceRestResourceSearchParamComponent) other; - return compareValues(name, o.name, true) && compareValues(definition, o.definition, true) && compareValues(type, o.type, true) - && compareValues(documentation, o.documentation, true) && compareValues(target, o.target, true) && compareValues(modifier, o.modifier, true) - && compareValues(chain, o.chain, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) - && (type == null || type.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (target == null || target.isEmpty()) && (modifier == null || modifier.isEmpty()) && (chain == null || chain.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.resource.searchParam"; - - } - - } - - @Block() - public static class SystemInteractionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A coded identifier of the operation, supported by the system. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="transaction | search-system | history-system", formalDefinition="A coded identifier of the operation, supported by the system." ) - protected Enumeration code; - - /** - * Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Anything special about operation behavior", formalDefinition="Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented." ) - protected StringType documentation; - - private static final long serialVersionUID = 510675287L; - - /** - * Constructor - */ - public SystemInteractionComponent() { - super(); - } - - /** - * Constructor - */ - public SystemInteractionComponent(Enumeration code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SystemInteractionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A coded identifier of the operation, supported by the system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public SystemInteractionComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return A coded identifier of the operation, supported by the system. - */ - public SystemRestfulInteraction getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A coded identifier of the operation, supported by the system. - */ - public SystemInteractionComponent setCode(SystemRestfulInteraction value) { - if (this.code == null) - this.code = new Enumeration(new SystemRestfulInteractionEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SystemInteractionComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public SystemInteractionComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented. - */ - public SystemInteractionComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "A coded identifier of the operation, supported by the system.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("documentation", "string", "Guidance specific to the implementation of this operation, such as limitations on the kind of transactions allowed, or information about system wide search is implemented.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = new SystemRestfulInteractionEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = new SystemRestfulInteractionEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.code"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else - return super.addChild(name); - } - - public SystemInteractionComponent copy() { - SystemInteractionComponent dst = new SystemInteractionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SystemInteractionComponent)) - return false; - SystemInteractionComponent o = (SystemInteractionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(documentation, o.documentation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SystemInteractionComponent)) - return false; - SystemInteractionComponent o = (SystemInteractionComponent) other; - return compareValues(code, o.code, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.interaction"; - - } - - } - - @Block() - public static class ConformanceRestOperationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name by which the operation/query is invoked", formalDefinition="The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called." ) - protected StringType name; - - /** - * Where the formal definition can be found. - */ - @Child(name = "definition", type = {OperationDefinition.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The defined operation/query", formalDefinition="Where the formal definition can be found." ) - protected Reference definition; - - /** - * The actual object that is the target of the reference (Where the formal definition can be found.) - */ - protected OperationDefinition definitionTarget; - - private static final long serialVersionUID = 122107272L; - - /** - * Constructor - */ - public ConformanceRestOperationComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceRestOperationComponent(StringType name, Reference definition) { - super(); - this.name = name; - this.definition = definition; - } - - /** - * @return {@link #name} (The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ConformanceRestOperationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called. - */ - public ConformanceRestOperationComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #definition} (Where the formal definition can be found.) - */ - public Reference getDefinition() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new Reference(); // cc - return this.definition; - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (Where the formal definition can be found.) - */ - public ConformanceRestOperationComponent setDefinition(Reference value) { - this.definition = value; - return this; - } - - /** - * @return {@link #definition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.) - */ - public OperationDefinition getDefinitionTarget() { - if (this.definitionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceRestOperationComponent.definition"); - else if (Configuration.doAutoCreate()) - this.definitionTarget = new OperationDefinition(); // aa - return this.definitionTarget; - } - - /** - * @param value {@link #definition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the formal definition can be found.) - */ - public ConformanceRestOperationComponent setDefinitionTarget(OperationDefinition value) { - this.definitionTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the operation or query. For an operation, this is the name prefixed with $ and used in the url. For a query, this is the name used in the _query parameter when the query is called.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("definition", "Reference(OperationDefinition)", "Where the formal definition can be found.", 0, java.lang.Integer.MAX_VALUE, definition)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1014418093: // definition - this.definition = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("definition")) - this.definition = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1014418093: return getDefinition(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); - } - else if (name.equals("definition")) { - this.definition = new Reference(); - return this.definition; - } - else - return super.addChild(name); - } - - public ConformanceRestOperationComponent copy() { - ConformanceRestOperationComponent dst = new ConformanceRestOperationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.definition = definition == null ? null : definition.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceRestOperationComponent)) - return false; - ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; - return compareDeep(name, o.name, true) && compareDeep(definition, o.definition, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceRestOperationComponent)) - return false; - ConformanceRestOperationComponent o = (ConformanceRestOperationComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (definition == null || definition.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.rest.operation"; - - } - - } - - @Block() - public static class ConformanceMessagingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An endpoint (network accessible address) to which messages and/or replies are to be sent. - */ - @Child(name = "endpoint", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Where messages should be sent", formalDefinition="An endpoint (network accessible address) to which messages and/or replies are to be sent." ) - protected List endpoint; - - /** - * Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - @Child(name = "reliableCache", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reliable Message Cache Length (min)", formalDefinition="Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender)." ) - protected UnsignedIntType reliableCache; - - /** - * Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Messaging interface behavior details", formalDefinition="Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner." ) - protected StringType documentation; - - /** - * A description of the solution's support for an event at this end-point. - */ - @Child(name = "event", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Declare support for this event", formalDefinition="A description of the solution's support for an event at this end-point." ) - protected List event; - - private static final long serialVersionUID = -712362545L; - - /** - * Constructor - */ - public ConformanceMessagingComponent() { - super(); - } - - /** - * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.) - */ - public List getEndpoint() { - if (this.endpoint == null) - this.endpoint = new ArrayList(); - return this.endpoint; - } - - public boolean hasEndpoint() { - if (this.endpoint == null) - return false; - for (ConformanceMessagingEndpointComponent item : this.endpoint) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #endpoint} (An endpoint (network accessible address) to which messages and/or replies are to be sent.) - */ - // syntactic sugar - public ConformanceMessagingEndpointComponent addEndpoint() { //3 - ConformanceMessagingEndpointComponent t = new ConformanceMessagingEndpointComponent(); - if (this.endpoint == null) - this.endpoint = new ArrayList(); - this.endpoint.add(t); - return t; - } - - // syntactic sugar - public ConformanceMessagingComponent addEndpoint(ConformanceMessagingEndpointComponent t) { //3 - if (t == null) - return this; - if (this.endpoint == null) - this.endpoint = new ArrayList(); - this.endpoint.add(t); - return this; - } - - /** - * @return {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value - */ - public UnsignedIntType getReliableCacheElement() { - if (this.reliableCache == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.reliableCache"); - else if (Configuration.doAutoCreate()) - this.reliableCache = new UnsignedIntType(); // bb - return this.reliableCache; - } - - public boolean hasReliableCacheElement() { - return this.reliableCache != null && !this.reliableCache.isEmpty(); - } - - public boolean hasReliableCache() { - return this.reliableCache != null && !this.reliableCache.isEmpty(); - } - - /** - * @param value {@link #reliableCache} (Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).). This is the underlying object with id, value and extensions. The accessor "getReliableCache" gives direct access to the value - */ - public ConformanceMessagingComponent setReliableCacheElement(UnsignedIntType value) { - this.reliableCache = value; - return this; - } - - /** - * @return Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - public int getReliableCache() { - return this.reliableCache == null || this.reliableCache.isEmpty() ? 0 : this.reliableCache.getValue(); - } - - /** - * @param value Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender). - */ - public ConformanceMessagingComponent setReliableCache(int value) { - if (this.reliableCache == null) - this.reliableCache = new UnsignedIntType(); - this.reliableCache.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceMessagingComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner. - */ - public ConformanceMessagingComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A description of the solution's support for an event at this end-point.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (ConformanceMessagingEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A description of the solution's support for an event at this end-point.) - */ - // syntactic sugar - public ConformanceMessagingEventComponent addEvent() { //3 - ConformanceMessagingEventComponent t = new ConformanceMessagingEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public ConformanceMessagingComponent addEvent(ConformanceMessagingEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("endpoint", "", "An endpoint (network accessible address) to which messages and/or replies are to be sent.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - childrenList.add(new Property("reliableCache", "unsignedInt", "Length if the receiver's reliable messaging cache in minutes (if a receiver) or how long the cache length on the receiver should be (if a sender).", 0, java.lang.Integer.MAX_VALUE, reliableCache)); - childrenList.add(new Property("documentation", "string", "Documentation about the system's messaging capabilities for this endpoint not otherwise documented by the conformance statement. For example, process for becoming an authorized messaging exchange partner.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("event", "", "A description of the solution's support for an event at this end-point.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : this.endpoint.toArray(new Base[this.endpoint.size()]); // ConformanceMessagingEndpointComponent - case 897803608: /*reliableCache*/ return this.reliableCache == null ? new Base[0] : new Base[] {this.reliableCache}; // UnsignedIntType - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // ConformanceMessagingEventComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1741102485: // endpoint - this.getEndpoint().add((ConformanceMessagingEndpointComponent) value); // ConformanceMessagingEndpointComponent - break; - case 897803608: // reliableCache - this.reliableCache = castToUnsignedInt(value); // UnsignedIntType - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case 96891546: // event - this.getEvent().add((ConformanceMessagingEventComponent) value); // ConformanceMessagingEventComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("endpoint")) - this.getEndpoint().add((ConformanceMessagingEndpointComponent) value); - else if (name.equals("reliableCache")) - this.reliableCache = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("event")) - this.getEvent().add((ConformanceMessagingEventComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1741102485: return addEndpoint(); // ConformanceMessagingEndpointComponent - case 897803608: throw new FHIRException("Cannot make property reliableCache as it is not a complex type"); // UnsignedIntType - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case 96891546: return addEvent(); // ConformanceMessagingEventComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("endpoint")) { - return addEndpoint(); - } - else if (name.equals("reliableCache")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.reliableCache"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else if (name.equals("event")) { - return addEvent(); - } - else - return super.addChild(name); - } - - public ConformanceMessagingComponent copy() { - ConformanceMessagingComponent dst = new ConformanceMessagingComponent(); - copyValues(dst); - if (endpoint != null) { - dst.endpoint = new ArrayList(); - for (ConformanceMessagingEndpointComponent i : endpoint) - dst.endpoint.add(i.copy()); - }; - dst.reliableCache = reliableCache == null ? null : reliableCache.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (ConformanceMessagingEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceMessagingComponent)) - return false; - ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; - return compareDeep(endpoint, o.endpoint, true) && compareDeep(reliableCache, o.reliableCache, true) - && compareDeep(documentation, o.documentation, true) && compareDeep(event, o.event, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceMessagingComponent)) - return false; - ConformanceMessagingComponent o = (ConformanceMessagingComponent) other; - return compareValues(reliableCache, o.reliableCache, true) && compareValues(documentation, o.documentation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (endpoint == null || endpoint.isEmpty()) && (reliableCache == null || reliableCache.isEmpty()) - && (documentation == null || documentation.isEmpty()) && (event == null || event.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.messaging"; - - } - - } - - @Block() - public static class ConformanceMessagingEndpointComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A list of the messaging transport protocol(s) identifiers, supported by this endpoint. - */ - @Child(name = "protocol", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="http | ftp | mllp +", formalDefinition="A list of the messaging transport protocol(s) identifiers, supported by this endpoint." ) - protected Coding protocol; - - /** - * The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier. - */ - @Child(name = "address", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Address of end-point", formalDefinition="The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier." ) - protected UriType address; - - private static final long serialVersionUID = 1294656428L; - - /** - * Constructor - */ - public ConformanceMessagingEndpointComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceMessagingEndpointComponent(Coding protocol, UriType address) { - super(); - this.protocol = protocol; - this.address = address; - } - - /** - * @return {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) - */ - public Coding getProtocol() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEndpointComponent.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new Coding(); // cc - return this.protocol; - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (A list of the messaging transport protocol(s) identifiers, supported by this endpoint.) - */ - public ConformanceMessagingEndpointComponent setProtocol(Coding value) { - this.protocol = value; - return this; - } - - /** - * @return {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value - */ - public UriType getAddressElement() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEndpointComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new UriType(); // bb - return this.address; - } - - public boolean hasAddressElement() { - return this.address != null && !this.address.isEmpty(); - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.). This is the underlying object with id, value and extensions. The accessor "getAddress" gives direct access to the value - */ - public ConformanceMessagingEndpointComponent setAddressElement(UriType value) { - this.address = value; - return this; - } - - /** - * @return The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier. - */ - public String getAddress() { - return this.address == null ? null : this.address.getValue(); - } - - /** - * @param value The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier. - */ - public ConformanceMessagingEndpointComponent setAddress(String value) { - if (this.address == null) - this.address = new UriType(); - this.address.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("protocol", "Coding", "A list of the messaging transport protocol(s) identifiers, supported by this endpoint.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("address", "uri", "The network address of the end-point. For solutions that do not use network addresses for routing, it can be just an identifier.", 0, java.lang.Integer.MAX_VALUE, address)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // Coding - case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -989163880: // protocol - this.protocol = castToCoding(value); // Coding - break; - case -1147692044: // address - this.address = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("protocol")) - this.protocol = castToCoding(value); // Coding - else if (name.equals("address")) - this.address = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -989163880: return getProtocol(); // Coding - case -1147692044: throw new FHIRException("Cannot make property address as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("protocol")) { - this.protocol = new Coding(); - return this.protocol; - } - else if (name.equals("address")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.address"); - } - else - return super.addChild(name); - } - - public ConformanceMessagingEndpointComponent copy() { - ConformanceMessagingEndpointComponent dst = new ConformanceMessagingEndpointComponent(); - copyValues(dst); - dst.protocol = protocol == null ? null : protocol.copy(); - dst.address = address == null ? null : address.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceMessagingEndpointComponent)) - return false; - ConformanceMessagingEndpointComponent o = (ConformanceMessagingEndpointComponent) other; - return compareDeep(protocol, o.protocol, true) && compareDeep(address, o.address, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceMessagingEndpointComponent)) - return false; - ConformanceMessagingEndpointComponent o = (ConformanceMessagingEndpointComponent) other; - return compareValues(address, o.address, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (protocol == null || protocol.isEmpty()) && (address == null || address.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.messaging.endpoint"; - - } - - } - - @Block() - public static class ConformanceMessagingEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A coded identifier of a supported messaging event. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Event type", formalDefinition="A coded identifier of a supported messaging event." ) - protected Coding code; - - /** - * The impact of the content of the message. - */ - @Child(name = "category", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Consequence | Currency | Notification", formalDefinition="The impact of the content of the message." ) - protected Enumeration category; - - /** - * The mode of this event declaration - whether application is sender or receiver. - */ - @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="sender | receiver", formalDefinition="The mode of this event declaration - whether application is sender or receiver." ) - protected Enumeration mode; - - /** - * A resource associated with the event. This is the resource that defines the event. - */ - @Child(name = "focus", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource that's focus of message", formalDefinition="A resource associated with the event. This is the resource that defines the event." ) - protected CodeType focus; - - /** - * Information about the request for this event. - */ - @Child(name = "request", type = {StructureDefinition.class}, order=5, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Profile that describes the request", formalDefinition="Information about the request for this event." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Information about the request for this event.) - */ - protected StructureDefinition requestTarget; - - /** - * Information about the response for this event. - */ - @Child(name = "response", type = {StructureDefinition.class}, order=6, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Profile that describes the response", formalDefinition="Information about the response for this event." ) - protected Reference response; - - /** - * The actual object that is the target of the reference (Information about the response for this event.) - */ - protected StructureDefinition responseTarget; - - /** - * Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - @Child(name = "documentation", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Endpoint-specific event documentation", formalDefinition="Guidance on how this event is handled, such as internal system trigger points, business rules, etc." ) - protected StringType documentation; - - private static final long serialVersionUID = -47031390L; - - /** - * Constructor - */ - public ConformanceMessagingEventComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceMessagingEventComponent(Coding code, Enumeration mode, CodeType focus, Reference request, Reference response) { - super(); - this.code = code; - this.mode = mode; - this.focus = focus; - this.request = request; - this.response = response; - } - - /** - * @return {@link #code} (A coded identifier of a supported messaging event.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A coded identifier of a supported messaging event.) - */ - public ConformanceMessagingEventComponent setCode(Coding value) { - this.code = value; - return this; - } - - /** - * @return {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (The impact of the content of the message.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public ConformanceMessagingEventComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return The impact of the content of the message. - */ - public MessageSignificanceCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value The impact of the content of the message. - */ - public ConformanceMessagingEventComponent setCategory(MessageSignificanceCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(new MessageSignificanceCategoryEnumFactory()); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new ConformanceEventModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (The mode of this event declaration - whether application is sender or receiver.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceMessagingEventComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return The mode of this event declaration - whether application is sender or receiver. - */ - public ConformanceEventMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value The mode of this event declaration - whether application is sender or receiver. - */ - public ConformanceMessagingEventComponent setMode(ConformanceEventMode value) { - if (this.mode == null) - this.mode = new Enumeration(new ConformanceEventModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value - */ - public CodeType getFocusElement() { - if (this.focus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.focus"); - else if (Configuration.doAutoCreate()) - this.focus = new CodeType(); // bb - return this.focus; - } - - public boolean hasFocusElement() { - return this.focus != null && !this.focus.isEmpty(); - } - - public boolean hasFocus() { - return this.focus != null && !this.focus.isEmpty(); - } - - /** - * @param value {@link #focus} (A resource associated with the event. This is the resource that defines the event.). This is the underlying object with id, value and extensions. The accessor "getFocus" gives direct access to the value - */ - public ConformanceMessagingEventComponent setFocusElement(CodeType value) { - this.focus = value; - return this; - } - - /** - * @return A resource associated with the event. This is the resource that defines the event. - */ - public String getFocus() { - return this.focus == null ? null : this.focus.getValue(); - } - - /** - * @param value A resource associated with the event. This is the resource that defines the event. - */ - public ConformanceMessagingEventComponent setFocus(String value) { - if (this.focus == null) - this.focus = new CodeType(); - this.focus.setValue(value); - return this; - } - - /** - * @return {@link #request} (Information about the request for this event.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Information about the request for this event.) - */ - public ConformanceMessagingEventComponent setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the request for this event.) - */ - public StructureDefinition getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new StructureDefinition(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the request for this event.) - */ - public ConformanceMessagingEventComponent setRequestTarget(StructureDefinition value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #response} (Information about the response for this event.) - */ - public Reference getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); - else if (Configuration.doAutoCreate()) - this.response = new Reference(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Information about the response for this event.) - */ - public ConformanceMessagingEventComponent setResponse(Reference value) { - this.response = value; - return this; - } - - /** - * @return {@link #response} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Information about the response for this event.) - */ - public StructureDefinition getResponseTarget() { - if (this.responseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.response"); - else if (Configuration.doAutoCreate()) - this.responseTarget = new StructureDefinition(); // aa - return this.responseTarget; - } - - /** - * @param value {@link #response} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Information about the response for this event.) - */ - public ConformanceMessagingEventComponent setResponseTarget(StructureDefinition value) { - this.responseTarget = value; - return this; - } - - /** - * @return {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceMessagingEventComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Guidance on how this event is handled, such as internal system trigger points, business rules, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceMessagingEventComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Guidance on how this event is handled, such as internal system trigger points, business rules, etc. - */ - public ConformanceMessagingEventComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "A coded identifier of a supported messaging event.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("category", "code", "The impact of the content of the message.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("mode", "code", "The mode of this event declaration - whether application is sender or receiver.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("focus", "code", "A resource associated with the event. This is the resource that defines the event.", 0, java.lang.Integer.MAX_VALUE, focus)); - childrenList.add(new Property("request", "Reference(StructureDefinition)", "Information about the request for this event.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response", "Reference(StructureDefinition)", "Information about the response for this event.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("documentation", "string", "Guidance on how this event is handled, such as internal system trigger points, business rules, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // CodeType - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Reference - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCoding(value); // Coding - break; - case 50511102: // category - this.category = new MessageSignificanceCategoryEnumFactory().fromType(value); // Enumeration - break; - case 3357091: // mode - this.mode = new ConformanceEventModeEnumFactory().fromType(value); // Enumeration - break; - case 97604824: // focus - this.focus = castToCode(value); // CodeType - break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case -340323263: // response - this.response = castToReference(value); // Reference - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCoding(value); // Coding - else if (name.equals("category")) - this.category = new MessageSignificanceCategoryEnumFactory().fromType(value); // Enumeration - else if (name.equals("mode")) - this.mode = new ConformanceEventModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("focus")) - this.focus = castToCode(value); // CodeType - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("response")) - this.response = castToReference(value); // Reference - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // Coding - case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 97604824: throw new FHIRException("Cannot make property focus as it is not a complex type"); // CodeType - case 1095692943: return getRequest(); // Reference - case -340323263: return getResponse(); // Reference - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new Coding(); - return this.code; - } - else if (name.equals("category")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.category"); - } - else if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.mode"); - } - else if (name.equals("focus")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.focus"); - } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("response")) { - this.response = new Reference(); - return this.response; - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else - return super.addChild(name); - } - - public ConformanceMessagingEventComponent copy() { - ConformanceMessagingEventComponent dst = new ConformanceMessagingEventComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.category = category == null ? null : category.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.focus = focus == null ? null : focus.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceMessagingEventComponent)) - return false; - ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; - return compareDeep(code, o.code, true) && compareDeep(category, o.category, true) && compareDeep(mode, o.mode, true) - && compareDeep(focus, o.focus, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) - && compareDeep(documentation, o.documentation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceMessagingEventComponent)) - return false; - ConformanceMessagingEventComponent o = (ConformanceMessagingEventComponent) other; - return compareValues(category, o.category, true) && compareValues(mode, o.mode, true) && compareValues(focus, o.focus, true) - && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (category == null || category.isEmpty()) - && (mode == null || mode.isEmpty()) && (focus == null || focus.isEmpty()) && (request == null || request.isEmpty()) - && (response == null || response.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - public String fhirType() { - return "Conformance.messaging.event"; - - } - - } - - @Block() - public static class ConformanceDocumentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Mode of this document declaration - whether application is producer or consumer. - */ - @Child(name = "mode", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="producer | consumer", formalDefinition="Mode of this document declaration - whether application is producer or consumer." ) - protected Enumeration mode; - - /** - * A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - @Child(name = "documentation", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description of document support", formalDefinition="A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc." ) - protected StringType documentation; - - /** - * A constraint on a resource used in the document. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Constraint on a resource used in the document", formalDefinition="A constraint on a resource used in the document." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A constraint on a resource used in the document.) - */ - protected StructureDefinition profileTarget; - - private static final long serialVersionUID = -1059555053L; - - /** - * Constructor - */ - public ConformanceDocumentComponent() { - super(); - } - - /** - * Constructor - */ - public ConformanceDocumentComponent(Enumeration mode, Reference profile) { - super(); - this.mode = mode; - this.profile = profile; - } - - /** - * @return {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new DocumentModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Mode of this document declaration - whether application is producer or consumer.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ConformanceDocumentComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Mode of this document declaration - whether application is producer or consumer. - */ - public DocumentMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Mode of this document declaration - whether application is producer or consumer. - */ - public ConformanceDocumentComponent setMode(DocumentMode value) { - if (this.mode == null) - this.mode = new Enumeration(new DocumentModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ConformanceDocumentComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc. - */ - public ConformanceDocumentComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A constraint on a resource used in the document.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A constraint on a resource used in the document.) - */ - public ConformanceDocumentComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConformanceDocumentComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A constraint on a resource used in the document.) - */ - public ConformanceDocumentComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("mode", "code", "Mode of this document declaration - whether application is producer or consumer.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "A description of how the application supports or uses the specified document profile. For example, when are documents created, what action is taken with consumed documents, etc.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A constraint on a resource used in the document.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3357091: // mode - this.mode = new DocumentModeEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("mode")) - this.mode = new DocumentModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case -309425751: return getProfile(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.mode"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.documentation"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else - return super.addChild(name); - } - - public ConformanceDocumentComponent copy() { - ConformanceDocumentComponent dst = new ConformanceDocumentComponent(); - copyValues(dst); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConformanceDocumentComponent)) - return false; - ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; - return compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) && compareDeep(profile, o.profile, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConformanceDocumentComponent)) - return false; - ConformanceDocumentComponent o = (ConformanceDocumentComponent) other; - return compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (profile == null || profile.isEmpty()); - } - - public String fhirType() { - return "Conformance.document"; - - } - - } - - /** - * An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical uri to reference this statement", formalDefinition="An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published." ) - protected UriType url; - - /** - * The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id for this version of the statement", formalDefinition="The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name identifying the conformance statement. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this conformance statement", formalDefinition="A free text natural language name identifying the conformance statement." ) - protected StringType name; - - /** - * The status of this conformance statement. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this conformance statement." ) - protected Enumeration status; - - /** - * A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes." ) - protected DateTimeType date; - - /** - * The name of the individual or organization that published the conformance. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the conformance." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human description of the conformance statement", formalDefinition="A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements." ) - protected List useContext; - - /** - * Explains why this conformance statement is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why this resource has been created", formalDefinition="Explains why this conformance statement is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. - */ - @Child(name = "copyright", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement." ) - protected StringType copyright; - - /** - * The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). - */ - @Child(name = "kind", type = {CodeType.class}, order=12, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="instance | capability | requirements", formalDefinition="The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase)." ) - protected Enumeration kind; - - /** - * Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation. - */ - @Child(name = "software", type = {}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Software that is covered by this conformance statement", formalDefinition="Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation." ) - protected ConformanceSoftwareComponent software; - - /** - * Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program. - */ - @Child(name = "implementation", type = {}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If this describes a specific instance", formalDefinition="Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program." ) - protected ConformanceImplementationComponent implementation; - - /** - * The version of the FHIR specification on which this conformance statement is based. - */ - @Child(name = "fhirVersion", type = {IdType.class}, order=15, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="FHIR Version the system uses", formalDefinition="The version of the FHIR specification on which this conformance statement is based." ) - protected IdType fhirVersion; - - /** - * A code that indicates whether the application accepts unknown elements or extensions when reading resources. - */ - @Child(name = "acceptUnknown", type = {CodeType.class}, order=16, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="no | extensions | elements | both", formalDefinition="A code that indicates whether the application accepts unknown elements or extensions when reading resources." ) - protected Enumeration acceptUnknown; - - /** - * A list of the formats supported by this implementation using their content types. - */ - @Child(name = "format", type = {CodeType.class}, order=17, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="formats supported (xml | json | mime type)", formalDefinition="A list of the formats supported by this implementation using their content types." ) - protected List format; - - /** - * A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Profiles for use cases supported", formalDefinition="A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}." ) - protected List profile; - /** - * The actual objects that are the target of the reference (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - protected List profileTarget; - - - /** - * A definition of the restful capabilities of the solution, if any. - */ - @Child(name = "rest", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="If the endpoint is a RESTful one", formalDefinition="A definition of the restful capabilities of the solution, if any." ) - protected List rest; - - /** - * A description of the messaging capabilities of the solution. - */ - @Child(name = "messaging", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="If messaging is supported", formalDefinition="A description of the messaging capabilities of the solution." ) - protected List messaging; - - /** - * A document definition. - */ - @Child(name = "document", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Document definition", formalDefinition="A document definition." ) - protected List document; - - private static final long serialVersionUID = 64276427L; - - /** - * Constructor - */ - public Conformance() { - super(); - } - - /** - * Constructor - */ - public Conformance(Enumeration status, DateTimeType date, Enumeration kind, IdType fhirVersion, Enumeration acceptUnknown) { - super(); - this.status = status; - this.date = date; - this.kind = kind; - this.fhirVersion = fhirVersion; - this.acceptUnknown = acceptUnknown; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Conformance setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published. - */ - public Conformance setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Conformance setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public Conformance setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Conformance setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the conformance statement. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the conformance statement. - */ - public Conformance setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this conformance statement.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Conformance setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this conformance statement. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this conformance statement. - */ - public Conformance setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public Conformance setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public Conformance setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Conformance setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes. - */ - public Conformance setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the conformance.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Conformance setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the conformance. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the conformance. - */ - public Conformance setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ConformanceContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ConformanceContactComponent addContact() { //3 - ConformanceContactComponent t = new ConformanceContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Conformance addContact(ConformanceContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Conformance setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP. - */ - public Conformance setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public Conformance addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this conformance statement is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public Conformance setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this conformance statement is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this conformance statement is needed and why it's been constrained as it has. - */ - public Conformance setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public Conformance setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement. - */ - public Conformance setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new ConformanceStatementKindEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Conformance setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). - */ - public ConformanceStatementKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). - */ - public Conformance setKind(ConformanceStatementKind value) { - if (this.kind == null) - this.kind = new Enumeration(new ConformanceStatementKindEnumFactory()); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) - */ - public ConformanceSoftwareComponent getSoftware() { - if (this.software == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.software"); - else if (Configuration.doAutoCreate()) - this.software = new ConformanceSoftwareComponent(); // cc - return this.software; - } - - public boolean hasSoftware() { - return this.software != null && !this.software.isEmpty(); - } - - /** - * @param value {@link #software} (Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.) - */ - public Conformance setSoftware(ConformanceSoftwareComponent value) { - this.software = value; - return this; - } - - /** - * @return {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) - */ - public ConformanceImplementationComponent getImplementation() { - if (this.implementation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.implementation"); - else if (Configuration.doAutoCreate()) - this.implementation = new ConformanceImplementationComponent(); // cc - return this.implementation; - } - - public boolean hasImplementation() { - return this.implementation != null && !this.implementation.isEmpty(); - } - - /** - * @param value {@link #implementation} (Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.) - */ - public Conformance setImplementation(ConformanceImplementationComponent value) { - this.implementation = value; - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); // bb - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this conformance statement is based.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public Conformance setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this conformance statement is based. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this conformance statement is based. - */ - public Conformance setFhirVersion(String value) { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - return this; - } - - /** - * @return {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value - */ - public Enumeration getAcceptUnknownElement() { - if (this.acceptUnknown == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Conformance.acceptUnknown"); - else if (Configuration.doAutoCreate()) - this.acceptUnknown = new Enumeration(new UnknownContentCodeEnumFactory()); // bb - return this.acceptUnknown; - } - - public boolean hasAcceptUnknownElement() { - return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); - } - - public boolean hasAcceptUnknown() { - return this.acceptUnknown != null && !this.acceptUnknown.isEmpty(); - } - - /** - * @param value {@link #acceptUnknown} (A code that indicates whether the application accepts unknown elements or extensions when reading resources.). This is the underlying object with id, value and extensions. The accessor "getAcceptUnknown" gives direct access to the value - */ - public Conformance setAcceptUnknownElement(Enumeration value) { - this.acceptUnknown = value; - return this; - } - - /** - * @return A code that indicates whether the application accepts unknown elements or extensions when reading resources. - */ - public UnknownContentCode getAcceptUnknown() { - return this.acceptUnknown == null ? null : this.acceptUnknown.getValue(); - } - - /** - * @param value A code that indicates whether the application accepts unknown elements or extensions when reading resources. - */ - public Conformance setAcceptUnknown(UnknownContentCode value) { - if (this.acceptUnknown == null) - this.acceptUnknown = new Enumeration(new UnknownContentCodeEnumFactory()); - this.acceptUnknown.setValue(value); - return this; - } - - /** - * @return {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - public List getFormat() { - if (this.format == null) - this.format = new ArrayList(); - return this.format; - } - - public boolean hasFormat() { - if (this.format == null) - return false; - for (CodeType item : this.format) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - // syntactic sugar - public CodeType addFormatElement() {//2 - CodeType t = new CodeType(); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return t; - } - - /** - * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - public Conformance addFormat(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return this; - } - - /** - * @param value {@link #format} (A list of the formats supported by this implementation using their content types.) - */ - public boolean hasFormat(String value) { - if (this.format == null) - return false; - for (CodeType v : this.format) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (Reference item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - // syntactic sugar - public Reference addProfile() { //3 - Reference t = new Reference(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - // syntactic sugar - public Conformance addProfile(Reference t) { //3 - if (t == null) - return this; - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @return {@link #profile} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public List getProfileTarget() { - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - return this.profileTarget; - } - - // syntactic sugar - /** - * @return {@link #profile} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of profiles that represent different use cases supported by the system. For a server, "supported by the system" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.) - */ - public StructureDefinition addProfileTarget() { - StructureDefinition r = new StructureDefinition(); - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - this.profileTarget.add(r); - return r; - } - - /** - * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) - */ - public List getRest() { - if (this.rest == null) - this.rest = new ArrayList(); - return this.rest; - } - - public boolean hasRest() { - if (this.rest == null) - return false; - for (ConformanceRestComponent item : this.rest) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rest} (A definition of the restful capabilities of the solution, if any.) - */ - // syntactic sugar - public ConformanceRestComponent addRest() { //3 - ConformanceRestComponent t = new ConformanceRestComponent(); - if (this.rest == null) - this.rest = new ArrayList(); - this.rest.add(t); - return t; - } - - // syntactic sugar - public Conformance addRest(ConformanceRestComponent t) { //3 - if (t == null) - return this; - if (this.rest == null) - this.rest = new ArrayList(); - this.rest.add(t); - return this; - } - - /** - * @return {@link #messaging} (A description of the messaging capabilities of the solution.) - */ - public List getMessaging() { - if (this.messaging == null) - this.messaging = new ArrayList(); - return this.messaging; - } - - public boolean hasMessaging() { - if (this.messaging == null) - return false; - for (ConformanceMessagingComponent item : this.messaging) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #messaging} (A description of the messaging capabilities of the solution.) - */ - // syntactic sugar - public ConformanceMessagingComponent addMessaging() { //3 - ConformanceMessagingComponent t = new ConformanceMessagingComponent(); - if (this.messaging == null) - this.messaging = new ArrayList(); - this.messaging.add(t); - return t; - } - - // syntactic sugar - public Conformance addMessaging(ConformanceMessagingComponent t) { //3 - if (t == null) - return this; - if (this.messaging == null) - this.messaging = new ArrayList(); - this.messaging.add(t); - return this; - } - - /** - * @return {@link #document} (A document definition.) - */ - public List getDocument() { - if (this.document == null) - this.document = new ArrayList(); - return this.document; - } - - public boolean hasDocument() { - if (this.document == null) - return false; - for (ConformanceDocumentComponent item : this.document) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #document} (A document definition.) - */ - // syntactic sugar - public ConformanceDocumentComponent addDocument() { //3 - ConformanceDocumentComponent t = new ConformanceDocumentComponent(); - if (this.document == null) - this.document = new ArrayList(); - this.document.add(t); - return t; - } - - // syntactic sugar - public Conformance addDocument(ConformanceDocumentComponent t) { //3 - if (t == null) - return this; - if (this.document == null) - this.document = new ArrayList(); - this.document.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this conformance statement when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this conformance statement is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the conformance statement when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the conformance statement.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of this conformance statement.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this conformance statement is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the conformance statement was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the conformance statement changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the conformance.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the conformance statement and its use. Typically, this is used when the conformance statement describes a desired rather than an actual solution, for example as a formal expression of requirements as part of an RFP.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of conformance statements.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this conformance statement is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the conformance statement and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the system described by the conformance statement.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("kind", "code", "The way that this statement is intended to be used, to describe an actual running instance of software, a particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase).", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("software", "", "Software that is covered by this conformance statement. It is used when the conformance statement describes the capabilities of a particular software version, independent of an installation.", 0, java.lang.Integer.MAX_VALUE, software)); - childrenList.add(new Property("implementation", "", "Identifies a specific implementation instance that is described by the conformance statement - i.e. a particular installation, rather than the capabilities of a software program.", 0, java.lang.Integer.MAX_VALUE, implementation)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this conformance statement is based.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("acceptUnknown", "code", "A code that indicates whether the application accepts unknown elements or extensions when reading resources.", 0, java.lang.Integer.MAX_VALUE, acceptUnknown)); - childrenList.add(new Property("format", "code", "A list of the formats supported by this implementation using their content types.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A list of profiles that represent different use cases supported by the system. For a server, \"supported by the system\" means the system hosts/produces a set of resources that are conformant to a particular profile, and allows clients that use its services to search using this profile and to find appropriate data. For a client, it means the system will search by this profile and process data according to the guidance implicit in the profile. See further discussion in [Using Profiles]{profiling.html#profile-uses}.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("rest", "", "A definition of the restful capabilities of the solution, if any.", 0, java.lang.Integer.MAX_VALUE, rest)); - childrenList.add(new Property("messaging", "", "A description of the messaging capabilities of the solution.", 0, java.lang.Integer.MAX_VALUE, messaging)); - childrenList.add(new Property("document", "", "A document definition.", 0, java.lang.Integer.MAX_VALUE, document)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ConformanceContactComponent - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration - case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // ConformanceSoftwareComponent - case 1683336114: /*implementation*/ return this.implementation == null ? new Base[0] : new Base[] {this.implementation}; // ConformanceImplementationComponent - case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType - case -1862642142: /*acceptUnknown*/ return this.acceptUnknown == null ? new Base[0] : new Base[] {this.acceptUnknown}; // Enumeration - case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference - case 3496916: /*rest*/ return this.rest == null ? new Base[0] : this.rest.toArray(new Base[this.rest.size()]); // ConformanceRestComponent - case -1440008444: /*messaging*/ return this.messaging == null ? new Base[0] : this.messaging.toArray(new Base[this.messaging.size()]); // ConformanceMessagingComponent - case 861720859: /*document*/ return this.document == null ? new Base[0] : this.document.toArray(new Base[this.document.size()]); // ConformanceDocumentComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ConformanceContactComponent) value); // ConformanceContactComponent - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case 3292052: // kind - this.kind = new ConformanceStatementKindEnumFactory().fromType(value); // Enumeration - break; - case 1319330215: // software - this.software = (ConformanceSoftwareComponent) value; // ConformanceSoftwareComponent - break; - case 1683336114: // implementation - this.implementation = (ConformanceImplementationComponent) value; // ConformanceImplementationComponent - break; - case 461006061: // fhirVersion - this.fhirVersion = castToId(value); // IdType - break; - case -1862642142: // acceptUnknown - this.acceptUnknown = new UnknownContentCodeEnumFactory().fromType(value); // Enumeration - break; - case -1268779017: // format - this.getFormat().add(castToCode(value)); // CodeType - break; - case -309425751: // profile - this.getProfile().add(castToReference(value)); // Reference - break; - case 3496916: // rest - this.getRest().add((ConformanceRestComponent) value); // ConformanceRestComponent - break; - case -1440008444: // messaging - this.getMessaging().add((ConformanceMessagingComponent) value); // ConformanceMessagingComponent - break; - case 861720859: // document - this.getDocument().add((ConformanceDocumentComponent) value); // ConformanceDocumentComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ConformanceContactComponent) value); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("kind")) - this.kind = new ConformanceStatementKindEnumFactory().fromType(value); // Enumeration - else if (name.equals("software")) - this.software = (ConformanceSoftwareComponent) value; // ConformanceSoftwareComponent - else if (name.equals("implementation")) - this.implementation = (ConformanceImplementationComponent) value; // ConformanceImplementationComponent - else if (name.equals("fhirVersion")) - this.fhirVersion = castToId(value); // IdType - else if (name.equals("acceptUnknown")) - this.acceptUnknown = new UnknownContentCodeEnumFactory().fromType(value); // Enumeration - else if (name.equals("format")) - this.getFormat().add(castToCode(value)); - else if (name.equals("profile")) - this.getProfile().add(castToReference(value)); - else if (name.equals("rest")) - this.getRest().add((ConformanceRestComponent) value); - else if (name.equals("messaging")) - this.getMessaging().add((ConformanceMessagingComponent) value); - else if (name.equals("document")) - this.getDocument().add((ConformanceDocumentComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // ConformanceContactComponent - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration - case 1319330215: return getSoftware(); // ConformanceSoftwareComponent - case 1683336114: return getImplementation(); // ConformanceImplementationComponent - case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType - case -1862642142: throw new FHIRException("Cannot make property acceptUnknown as it is not a complex type"); // Enumeration - case -1268779017: throw new FHIRException("Cannot make property format as it is not a complex type"); // CodeType - case -309425751: return addProfile(); // Reference - case 3496916: return addRest(); // ConformanceRestComponent - case -1440008444: return addMessaging(); // ConformanceMessagingComponent - case 861720859: return addDocument(); // ConformanceDocumentComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.url"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.experimental"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.date"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.copyright"); - } - else if (name.equals("kind")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.kind"); - } - else if (name.equals("software")) { - this.software = new ConformanceSoftwareComponent(); - return this.software; - } - else if (name.equals("implementation")) { - this.implementation = new ConformanceImplementationComponent(); - return this.implementation; - } - else if (name.equals("fhirVersion")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.fhirVersion"); - } - else if (name.equals("acceptUnknown")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.acceptUnknown"); - } - else if (name.equals("format")) { - throw new FHIRException("Cannot call addChild on a primitive type Conformance.format"); - } - else if (name.equals("profile")) { - return addProfile(); - } - else if (name.equals("rest")) { - return addRest(); - } - else if (name.equals("messaging")) { - return addMessaging(); - } - else if (name.equals("document")) { - return addDocument(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Conformance"; - - } - - public Conformance copy() { - Conformance dst = new Conformance(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ConformanceContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.software = software == null ? null : software.copy(); - dst.implementation = implementation == null ? null : implementation.copy(); - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - dst.acceptUnknown = acceptUnknown == null ? null : acceptUnknown.copy(); - if (format != null) { - dst.format = new ArrayList(); - for (CodeType i : format) - dst.format.add(i.copy()); - }; - if (profile != null) { - dst.profile = new ArrayList(); - for (Reference i : profile) - dst.profile.add(i.copy()); - }; - if (rest != null) { - dst.rest = new ArrayList(); - for (ConformanceRestComponent i : rest) - dst.rest.add(i.copy()); - }; - if (messaging != null) { - dst.messaging = new ArrayList(); - for (ConformanceMessagingComponent i : messaging) - dst.messaging.add(i.copy()); - }; - if (document != null) { - dst.document = new ArrayList(); - for (ConformanceDocumentComponent i : document) - dst.document.add(i.copy()); - }; - return dst; - } - - protected Conformance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Conformance)) - return false; - Conformance o = (Conformance) other; - return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) - && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(description, o.description, true) - && compareDeep(useContext, o.useContext, true) && compareDeep(requirements, o.requirements, true) - && compareDeep(copyright, o.copyright, true) && compareDeep(kind, o.kind, true) && compareDeep(software, o.software, true) - && compareDeep(implementation, o.implementation, true) && compareDeep(fhirVersion, o.fhirVersion, true) - && compareDeep(acceptUnknown, o.acceptUnknown, true) && compareDeep(format, o.format, true) && compareDeep(profile, o.profile, true) - && compareDeep(rest, o.rest, true) && compareDeep(messaging, o.messaging, true) && compareDeep(document, o.document, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Conformance)) - return false; - Conformance o = (Conformance) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) - && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true) && compareValues(kind, o.kind, true) && compareValues(fhirVersion, o.fhirVersion, true) - && compareValues(acceptUnknown, o.acceptUnknown, true) && compareValues(format, o.format, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) - && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) - && (kind == null || kind.isEmpty()) && (software == null || software.isEmpty()) && (implementation == null || implementation.isEmpty()) - && (fhirVersion == null || fhirVersion.isEmpty()) && (acceptUnknown == null || acceptUnknown.isEmpty()) - && (format == null || format.isEmpty()) && (profile == null || profile.isEmpty()) && (rest == null || rest.isEmpty()) - && (messaging == null || messaging.isEmpty()) && (document == null || document.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Conformance; - } - - /** - * Search parameter: securityservice - *

- * Description: OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates
- * Type: token
- * Path: Conformance.rest.security.service
- *

- */ - @SearchParamDefinition(name="securityservice", path="Conformance.rest.security.service", description="OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates", type="token" ) - public static final String SP_SECURITYSERVICE = "securityservice"; - /** - * Fluent Client search parameter constant for securityservice - *

- * Description: OAuth | SMART-on-FHIR | NTLM | Basic | Kerberos | Certificates
- * Type: token
- * Path: Conformance.rest.security.service
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITYSERVICE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITYSERVICE); - - /** - * Search parameter: status - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: resource - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESOURCE); - - /** - * Search parameter: format - *

- * Description: formats supported (xml | json | mime type)
- * Type: token
- * Path: Conformance.format
- *

- */ - @SearchParamDefinition(name="format", path="Conformance.format", description="formats supported (xml | json | mime type)", type="token" ) - public static final String SP_FORMAT = "format"; - /** - * Fluent Client search parameter constant for format - *

- * Description: formats supported (xml | json | mime type)
- * Type: token
- * Path: Conformance.format
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT); - - /** - * Search parameter: date - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: url - *

- * Description: The uri that identifies the conformance statement
- * Type: uri
- * Path: Conformance.url
- *

- */ - @SearchParamDefinition(name="url", path="Conformance.url", description="The uri that identifies the conformance statement", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The uri that identifies the conformance statement
- * Type: uri
- * Path: Conformance.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: version - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - /** - * Search parameter: publisher - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: mode - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MODE); - - /** - * Search parameter: resourceprofile - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCEPROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCEPROFILE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Conformance:resourceprofile". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCEPROFILE = new ca.uhn.fhir.model.api.Include("Conformance:resourceprofile").toLocked(); - - /** - * Search parameter: software - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam SOFTWARE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOFTWARE); - - /** - * Search parameter: description - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: event - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); - - /** - * Search parameter: name - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the conformance statement
- * Type: token
- * Path: Conformance.useContext
- *

- */ - @SearchParamDefinition(name="context", path="Conformance.useContext", description="A use context assigned to the conformance statement", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the conformance statement
- * Type: token
- * Path: Conformance.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: supported-profile - *

- * Description: Profiles for use cases supported
- * Type: reference
- * Path: Conformance.profile
- *

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

- * Description: Profiles for use cases supported
- * Type: reference
- * Path: Conformance.profile
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORTED_PROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORTED_PROFILE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Conformance:supported-profile". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORTED_PROFILE = new ca.uhn.fhir.model.api.Include("Conformance:supported-profile").toLocked(); - - /** - * Search parameter: fhirversion - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FHIRVERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FHIRVERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Constants.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Constants.java deleted file mode 100644 index 9e23286e81c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Constants.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - - -public class Constants { - - public final static String VERSION = "1.4.0"; - public final static String REVISION = "8226"; - public final static String DATE = "Sun May 08 03:05:30 AEST 2016"; -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ContactPoint.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ContactPoint.java deleted file mode 100644 index bc64dddead0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ContactPoint.java +++ /dev/null @@ -1,724 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - */ -@DatatypeDef(name="ContactPoint") -public class ContactPoint extends Type implements ICompositeType { - - public enum ContactPointSystem { - /** - * The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. - */ - PHONE, - /** - * The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required. - */ - FAX, - /** - * The value is an email address. - */ - EMAIL, - /** - * The value is a pager number. These may be local pager numbers that are only usable on a particular pager system. - */ - PAGER, - /** - * A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human interpretation. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static ContactPointSystem fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("phone".equals(codeString)) - return PHONE; - if ("fax".equals(codeString)) - return FAX; - if ("email".equals(codeString)) - return EMAIL; - if ("pager".equals(codeString)) - return PAGER; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown ContactPointSystem code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PHONE: return "phone"; - case FAX: return "fax"; - case EMAIL: return "email"; - case PAGER: return "pager"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PHONE: return "http://hl7.org/fhir/contact-point-system"; - case FAX: return "http://hl7.org/fhir/contact-point-system"; - case EMAIL: return "http://hl7.org/fhir/contact-point-system"; - case PAGER: return "http://hl7.org/fhir/contact-point-system"; - case OTHER: return "http://hl7.org/fhir/contact-point-system"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PHONE: return "The value is a telephone number used for voice calls. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; - case FAX: return "The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic dialing support but not required."; - case EMAIL: return "The value is an email address."; - case PAGER: return "The value is a pager number. These may be local pager numbers that are only usable on a particular pager system."; - case OTHER: return "A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this is not a URL, then it will require human interpretation."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PHONE: return "Phone"; - case FAX: return "Fax"; - case EMAIL: return "Email"; - case PAGER: return "Pager"; - case OTHER: return "URL"; - default: return "?"; - } - } - } - - public static class ContactPointSystemEnumFactory implements EnumFactory { - public ContactPointSystem fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("phone".equals(codeString)) - return ContactPointSystem.PHONE; - if ("fax".equals(codeString)) - return ContactPointSystem.FAX; - if ("email".equals(codeString)) - return ContactPointSystem.EMAIL; - if ("pager".equals(codeString)) - return ContactPointSystem.PAGER; - if ("other".equals(codeString)) - return ContactPointSystem.OTHER; - throw new IllegalArgumentException("Unknown ContactPointSystem code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("phone".equals(codeString)) - return new Enumeration(this, ContactPointSystem.PHONE); - if ("fax".equals(codeString)) - return new Enumeration(this, ContactPointSystem.FAX); - if ("email".equals(codeString)) - return new Enumeration(this, ContactPointSystem.EMAIL); - if ("pager".equals(codeString)) - return new Enumeration(this, ContactPointSystem.PAGER); - if ("other".equals(codeString)) - return new Enumeration(this, ContactPointSystem.OTHER); - throw new FHIRException("Unknown ContactPointSystem code '"+codeString+"'"); - } - public String toCode(ContactPointSystem code) { - if (code == ContactPointSystem.PHONE) - return "phone"; - if (code == ContactPointSystem.FAX) - return "fax"; - if (code == ContactPointSystem.EMAIL) - return "email"; - if (code == ContactPointSystem.PAGER) - return "pager"; - if (code == ContactPointSystem.OTHER) - return "other"; - return "?"; - } - public String toSystem(ContactPointSystem code) { - return code.getSystem(); - } - } - - public enum ContactPointUse { - /** - * A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available. - */ - HOME, - /** - * An office contact point. First choice for business related contacts during business hours. - */ - WORK, - /** - * A temporary contact point. The period can provide more detailed information. - */ - TEMP, - /** - * This contact point is no longer in use (or was never correct, but retained for records). - */ - OLD, - /** - * A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business. - */ - MOBILE, - /** - * added to help the parsers - */ - NULL; - public static ContactPointUse fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return HOME; - if ("work".equals(codeString)) - return WORK; - if ("temp".equals(codeString)) - return TEMP; - if ("old".equals(codeString)) - return OLD; - if ("mobile".equals(codeString)) - return MOBILE; - throw new FHIRException("Unknown ContactPointUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HOME: return "home"; - case WORK: return "work"; - case TEMP: return "temp"; - case OLD: return "old"; - case MOBILE: return "mobile"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HOME: return "http://hl7.org/fhir/contact-point-use"; - case WORK: return "http://hl7.org/fhir/contact-point-use"; - case TEMP: return "http://hl7.org/fhir/contact-point-use"; - case OLD: return "http://hl7.org/fhir/contact-point-use"; - case MOBILE: return "http://hl7.org/fhir/contact-point-use"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HOME: return "A communication contact point at a home; attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no other contacts are available."; - case WORK: return "An office contact point. First choice for business related contacts during business hours."; - case TEMP: return "A temporary contact point. The period can provide more detailed information."; - case OLD: return "This contact point is no longer in use (or was never correct, but retained for records)."; - case MOBILE: return "A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HOME: return "Home"; - case WORK: return "Work"; - case TEMP: return "Temp"; - case OLD: return "Old"; - case MOBILE: return "Mobile"; - default: return "?"; - } - } - } - - public static class ContactPointUseEnumFactory implements EnumFactory { - public ContactPointUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return ContactPointUse.HOME; - if ("work".equals(codeString)) - return ContactPointUse.WORK; - if ("temp".equals(codeString)) - return ContactPointUse.TEMP; - if ("old".equals(codeString)) - return ContactPointUse.OLD; - if ("mobile".equals(codeString)) - return ContactPointUse.MOBILE; - throw new IllegalArgumentException("Unknown ContactPointUse code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("home".equals(codeString)) - return new Enumeration(this, ContactPointUse.HOME); - if ("work".equals(codeString)) - return new Enumeration(this, ContactPointUse.WORK); - if ("temp".equals(codeString)) - return new Enumeration(this, ContactPointUse.TEMP); - if ("old".equals(codeString)) - return new Enumeration(this, ContactPointUse.OLD); - if ("mobile".equals(codeString)) - return new Enumeration(this, ContactPointUse.MOBILE); - throw new FHIRException("Unknown ContactPointUse code '"+codeString+"'"); - } - public String toCode(ContactPointUse code) { - if (code == ContactPointUse.HOME) - return "home"; - if (code == ContactPointUse.WORK) - return "work"; - if (code == ContactPointUse.TEMP) - return "temp"; - if (code == ContactPointUse.OLD) - return "old"; - if (code == ContactPointUse.MOBILE) - return "mobile"; - return "?"; - } - public String toSystem(ContactPointUse code) { - return code.getSystem(); - } - } - - /** - * Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - @Child(name = "system", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="phone | fax | email | pager | other", formalDefinition="Telecommunications form for contact point - what communications system is required to make use of the contact." ) - protected Enumeration system; - - /** - * The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - @Child(name = "value", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The actual contact point details", formalDefinition="The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address)." ) - protected StringType value; - - /** - * Identifies the purpose for the contact point. - */ - @Child(name = "use", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="home | work | temp | old | mobile - purpose of this contact point", formalDefinition="Identifies the purpose for the contact point." ) - protected Enumeration use; - - /** - * Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values. - */ - @Child(name = "rank", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specify preferred order of use (1 = highest)", formalDefinition="Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values." ) - protected PositiveIntType rank; - - /** - * Time period when the contact point was/is in use. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period when the contact point was/is in use", formalDefinition="Time period when the contact point was/is in use." ) - protected Period period; - - private static final long serialVersionUID = 1509610874L; - - /** - * Constructor - */ - public ContactPoint() { - super(); - } - - /** - * @return {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Enumeration getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.system"); - else if (Configuration.doAutoCreate()) - this.system = new Enumeration(new ContactPointSystemEnumFactory()); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Telecommunications form for contact point - what communications system is required to make use of the contact.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ContactPoint setSystemElement(Enumeration value) { - this.system = value; - return this; - } - - /** - * @return Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - public ContactPointSystem getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value Telecommunications form for contact point - what communications system is required to make use of the contact. - */ - public ContactPoint setSystem(ContactPointSystem value) { - if (value == null) - this.system = null; - else { - if (this.system == null) - this.system = new Enumeration(new ContactPointSystemEnumFactory()); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ContactPoint setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address). - */ - public ContactPoint setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new ContactPointUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Identifies the purpose for the contact point.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public ContactPoint setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Identifies the purpose for the contact point. - */ - public ContactPointUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Identifies the purpose for the contact point. - */ - public ContactPoint setUse(ContactPointUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new ContactPointUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #rank} (Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value - */ - public PositiveIntType getRankElement() { - if (this.rank == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.rank"); - else if (Configuration.doAutoCreate()) - this.rank = new PositiveIntType(); // bb - return this.rank; - } - - public boolean hasRankElement() { - return this.rank != null && !this.rank.isEmpty(); - } - - public boolean hasRank() { - return this.rank != null && !this.rank.isEmpty(); - } - - /** - * @param value {@link #rank} (Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.). This is the underlying object with id, value and extensions. The accessor "getRank" gives direct access to the value - */ - public ContactPoint setRankElement(PositiveIntType value) { - this.rank = value; - return this; - } - - /** - * @return Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values. - */ - public int getRank() { - return this.rank == null || this.rank.isEmpty() ? 0 : this.rank.getValue(); - } - - /** - * @param value Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values. - */ - public ContactPoint setRank(int value) { - if (this.rank == null) - this.rank = new PositiveIntType(); - this.rank.setValue(value); - return this; - } - - /** - * @return {@link #period} (Time period when the contact point was/is in use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactPoint.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period when the contact point was/is in use.) - */ - public ContactPoint setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "code", "Telecommunications form for contact point - what communications system is required to make use of the contact.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("value", "string", "The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("use", "code", "Identifies the purpose for the contact point.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("rank", "positiveInt", "Specifies a preferred order in which to use a set of contacts. Contacts are ranked with lower values coming before higher values.", 0, java.lang.Integer.MAX_VALUE, rank)); - childrenList.add(new Property("period", "Period", "Time period when the contact point was/is in use.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // Enumeration - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration - case 3492908: /*rank*/ return this.rank == null ? new Base[0] : new Base[] {this.rank}; // PositiveIntType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = new ContactPointSystemEnumFactory().fromType(value); // Enumeration - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - case 116103: // use - this.use = new ContactPointUseEnumFactory().fromType(value); // Enumeration - break; - case 3492908: // rank - this.rank = castToPositiveInt(value); // PositiveIntType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = new ContactPointSystemEnumFactory().fromType(value); // Enumeration - else if (name.equals("value")) - this.value = castToString(value); // StringType - else if (name.equals("use")) - this.use = new ContactPointUseEnumFactory().fromType(value); // Enumeration - else if (name.equals("rank")) - this.rank = castToPositiveInt(value); // PositiveIntType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // Enumeration - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case 3492908: throw new FHIRException("Cannot make property rank as it is not a complex type"); // PositiveIntType - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.system"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.value"); - } - else if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.use"); - } - else if (name.equals("rank")) { - throw new FHIRException("Cannot call addChild on a primitive type ContactPoint.rank"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ContactPoint"; - - } - - public ContactPoint copy() { - ContactPoint dst = new ContactPoint(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.value = value == null ? null : value.copy(); - dst.use = use == null ? null : use.copy(); - dst.rank = rank == null ? null : rank.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected ContactPoint typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ContactPoint)) - return false; - ContactPoint o = (ContactPoint) other; - return compareDeep(system, o.system, true) && compareDeep(value, o.value, true) && compareDeep(use, o.use, true) - && compareDeep(rank, o.rank, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ContactPoint)) - return false; - ContactPoint o = (ContactPoint) other; - return compareValues(system, o.system, true) && compareValues(value, o.value, true) && compareValues(use, o.use, true) - && compareValues(rank, o.rank, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) - && (use == null || use.isEmpty()) && (rank == null || rank.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Contract.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Contract.java deleted file mode 100644 index 0a2260ea600..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Contract.java +++ /dev/null @@ -1,4811 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ -@ResourceDef(name="Contract", profile="http://hl7.org/fhir/Profile/Contract") -public class Contract extends DomainResource { - - @Block() - public static class AgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Who or what parties are assigned roles in this Contract. - */ - @Child(name = "actor", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Agent Type", formalDefinition="Who or what parties are assigned roles in this Contract." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (Who or what parties are assigned roles in this Contract.) - */ - protected Resource actorTarget; - - /** - * Role type of agent assigned roles in this Contract. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Agent Role", formalDefinition="Role type of agent assigned roles in this Contract." ) - protected List role; - - private static final long serialVersionUID = -454551165L; - - /** - * Constructor - */ - public AgentComponent() { - super(); - } - - /** - * Constructor - */ - public AgentComponent(Reference actor) { - super(); - this.actor = actor; - } - - /** - * @return {@link #actor} (Who or what parties are assigned roles in this Contract.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AgentComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (Who or what parties are assigned roles in this Contract.) - */ - public AgentComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what parties are assigned roles in this Contract.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what parties are assigned roles in this Contract.) - */ - public AgentComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #role} (Role type of agent assigned roles in this Contract.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Role type of agent assigned roles in this Contract.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public AgentComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actor", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance)", "Who or what parties are assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("role", "CodeableConcept", "Role type of agent assigned roles in this Contract.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case 3506294: // role - this.getRole().add(castToCodeableConcept(value)); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("role")) - this.getRole().add(castToCodeableConcept(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 92645877: return getActor(); // Reference - case 3506294: return addRole(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("role")) { - return addRole(); - } - else - return super.addChild(name); - } - - public AgentComponent copy() { - AgentComponent dst = new AgentComponent(); - copyValues(dst); - dst.actor = actor == null ? null : actor.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AgentComponent)) - return false; - AgentComponent o = (AgentComponent) other; - return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AgentComponent)) - return false; - AgentComponent o = (AgentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (actor == null || actor.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - public String fhirType() { - return "Contract.agent"; - - } - - } - - @Block() - public static class SignatoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Role of this Contract signer, e.g. notary, grantee. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Signer Type", formalDefinition="Role of this Contract signer, e.g. notary, grantee." ) - protected Coding type; - - /** - * Party which is a signator to this Contract. - */ - @Child(name = "party", type = {Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Signatory Party", formalDefinition="Party which is a signator to this Contract." ) - protected Reference party; - - /** - * The actual object that is the target of the reference (Party which is a signator to this Contract.) - */ - protected Resource partyTarget; - - /** - * Legally binding Contract DSIG signature contents in Base64. - */ - @Child(name = "signature", type = {Signature.class}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Documentation Signature", formalDefinition="Legally binding Contract DSIG signature contents in Base64." ) - protected List signature; - - private static final long serialVersionUID = 1948139228L; - - /** - * Constructor - */ - public SignatoryComponent() { - super(); - } - - /** - * Constructor - */ - public SignatoryComponent(Coding type, Reference party) { - super(); - this.type = type; - this.party = party; - } - - /** - * @return {@link #type} (Role of this Contract signer, e.g. notary, grantee.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SignatoryComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Role of this Contract signer, e.g. notary, grantee.) - */ - public SignatoryComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #party} (Party which is a signator to this Contract.) - */ - public Reference getParty() { - if (this.party == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SignatoryComponent.party"); - else if (Configuration.doAutoCreate()) - this.party = new Reference(); // cc - return this.party; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Party which is a signator to this Contract.) - */ - public SignatoryComponent setParty(Reference value) { - this.party = value; - return this; - } - - /** - * @return {@link #party} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.) - */ - public Resource getPartyTarget() { - return this.partyTarget; - } - - /** - * @param value {@link #party} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Party which is a signator to this Contract.) - */ - public SignatoryComponent setPartyTarget(Resource value) { - this.partyTarget = value; - return this; - } - - /** - * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.) - */ - public List getSignature() { - if (this.signature == null) - this.signature = new ArrayList(); - return this.signature; - } - - public boolean hasSignature() { - if (this.signature == null) - return false; - for (Signature item : this.signature) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #signature} (Legally binding Contract DSIG signature contents in Base64.) - */ - // syntactic sugar - public Signature addSignature() { //3 - Signature t = new Signature(); - if (this.signature == null) - this.signature = new ArrayList(); - this.signature.add(t); - return t; - } - - // syntactic sugar - public SignatoryComponent addSignature(Signature t) { //3 - if (t == null) - return this; - if (this.signature == null) - this.signature = new ArrayList(); - this.signature.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Role of this Contract signer, e.g. notary, grantee.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("party", "Reference(Organization|Patient|Practitioner|RelatedPerson)", "Party which is a signator to this Contract.", 0, java.lang.Integer.MAX_VALUE, party)); - childrenList.add(new Property("signature", "Signature", "Legally binding Contract DSIG signature contents in Base64.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Reference - case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 106437350: // party - this.party = castToReference(value); // Reference - break; - case 1073584312: // signature - this.getSignature().add(castToSignature(value)); // Signature - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("party")) - this.party = castToReference(value); // Reference - else if (name.equals("signature")) - this.getSignature().add(castToSignature(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 106437350: return getParty(); // Reference - case 1073584312: return addSignature(); // Signature - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("party")) { - this.party = new Reference(); - return this.party; - } - else if (name.equals("signature")) { - return addSignature(); - } - else - return super.addChild(name); - } - - public SignatoryComponent copy() { - SignatoryComponent dst = new SignatoryComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.party = party == null ? null : party.copy(); - if (signature != null) { - dst.signature = new ArrayList(); - for (Signature i : signature) - dst.signature.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SignatoryComponent)) - return false; - SignatoryComponent o = (SignatoryComponent) other; - return compareDeep(type, o.type, true) && compareDeep(party, o.party, true) && compareDeep(signature, o.signature, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SignatoryComponent)) - return false; - SignatoryComponent o = (SignatoryComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) - && (signature == null || signature.isEmpty()); - } - - public String fhirType() { - return "Contract.signer"; - - } - - } - - @Block() - public static class ValuedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific type of Contract Valued Item that may be priced. - */ - @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item Type", formalDefinition="Specific type of Contract Valued Item that may be priced." ) - protected Type entity; - - /** - * Identifies a Contract Valued Item instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item Identifier", formalDefinition="Identifies a Contract Valued Item instance." ) - protected Identifier identifier; - - /** - * Indicates the time during which this Contract ValuedItem information is effective. - */ - @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract ValuedItem information is effective." ) - protected DateTimeType effectiveTime; - - /** - * Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Count of Contract Valued Items", formalDefinition="Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances." ) - protected SimpleQuantity quantity; - - /** - * A Contract Valued Item unit valuation measure. - */ - @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item fee, charge, or cost", formalDefinition="A Contract Valued Item unit valuation measure." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Total Contract Valued Item Value", formalDefinition="Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - private static final long serialVersionUID = 1782449516L; - - /** - * Constructor - */ - public ValuedItemComponent() { - super(); - } - - /** - * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public Type getEntity() { - return this.entity; - } - - /** - * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public CodeableConcept getEntityCodeableConcept() throws FHIRException { - if (!(this.entity instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (CodeableConcept) this.entity; - } - - public boolean hasEntityCodeableConcept() { - return this.entity instanceof CodeableConcept; - } - - /** - * @return {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public Reference getEntityReference() throws FHIRException { - if (!(this.entity instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (Reference) this.entity; - } - - public boolean hasEntityReference() { - return this.entity instanceof Reference; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (Specific type of Contract Valued Item that may be priced.) - */ - public ValuedItemComponent setEntity(Type value) { - this.entity = value; - return this; - } - - /** - * @return {@link #identifier} (Identifies a Contract Valued Item instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a Contract Valued Item instance.) - */ - public ValuedItemComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public DateTimeType getEffectiveTimeElement() { - if (this.effectiveTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.effectiveTime"); - else if (Configuration.doAutoCreate()) - this.effectiveTime = new DateTimeType(); // bb - return this.effectiveTime; - } - - public boolean hasEffectiveTimeElement() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (Indicates the time during which this Contract ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public ValuedItemComponent setEffectiveTimeElement(DateTimeType value) { - this.effectiveTime = value; - return this; - } - - /** - * @return Indicates the time during which this Contract ValuedItem information is effective. - */ - public Date getEffectiveTime() { - return this.effectiveTime == null ? null : this.effectiveTime.getValue(); - } - - /** - * @param value Indicates the time during which this Contract ValuedItem information is effective. - */ - public ValuedItemComponent setEffectiveTime(Date value) { - if (value == null) - this.effectiveTime = null; - else { - if (this.effectiveTime == null) - this.effectiveTime = new DateTimeType(); - this.effectiveTime.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.) - */ - public ValuedItemComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (A Contract Valued Item unit valuation measure.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (A Contract Valued Item unit valuation measure.) - */ - public ValuedItemComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ValuedItemComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ValuedItemComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ValuedItemComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ValuedItemComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ValuedItemComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - public ValuedItemComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - public ValuedItemComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point. - */ - public ValuedItemComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValuedItemComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public ValuedItemComponent setNet(Money value) { - this.net = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("quantity", "SimpleQuantity", "Specifies the units by which the Contract Valued Item is measured or counted, and quantifies the countable or measurable Contract Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "A Contract Valued Item unit valuation measure.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Valued Item delivered. The concept of Points allows for assignment of point values for a Contract Valued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Type - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1298275357: // entity - this.entity = (Type) value; // Type - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -929905388: // effectiveTime - this.effectiveTime = castToDateTime(value); // DateTimeType - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("entity[x]")) - this.entity = (Type) value; // Type - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("effectiveTime")) - this.effectiveTime = castToDateTime(value); // DateTimeType - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -740568643: return getEntity(); // Type - case -1618432855: return getIdentifier(); // Identifier - case -929905388: throw new FHIRException("Cannot make property effectiveTime as it is not a complex type"); // DateTimeType - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("entityCodeableConcept")) { - this.entity = new CodeableConcept(); - return this.entity; - } - else if (name.equals("entityReference")) { - this.entity = new Reference(); - return this.entity; - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("effectiveTime")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.effectiveTime"); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else - return super.addChild(name); - } - - public ValuedItemComponent copy() { - ValuedItemComponent dst = new ValuedItemComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValuedItemComponent)) - return false; - ValuedItemComponent o = (ValuedItemComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValuedItemComponent)) - return false; - ValuedItemComponent o = (ValuedItemComponent) other; - return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) - && compareValues(points, o.points, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()); - } - - public String fhirType() { - return "Contract.valuedItem"; - - } - - } - - @Block() - public static class TermComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Unique identifier for this particular Contract Provision. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contract Term identifier", formalDefinition="Unique identifier for this particular Contract Provision." ) - protected Identifier identifier; - - /** - * When this Contract Provision was issued. - */ - @Child(name = "issued", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contract Term Issue Date Time", formalDefinition="When this Contract Provision was issued." ) - protected DateTimeType issued; - - /** - * Relevant time or time-period when this Contract Provision is applicable. - */ - @Child(name = "applies", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contract Term Effective Time", formalDefinition="Relevant time or time-period when this Contract Provision is applicable." ) - protected Period applies; - - /** - * Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Type", formalDefinition="Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit." ) - protected CodeableConcept type; - - /** - * Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment. - */ - @Child(name = "subType", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Subtype", formalDefinition="Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment." ) - protected CodeableConcept subType; - - /** - * The matter of concern in the context of this provision of the agrement. - */ - @Child(name = "topic", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Context of the Contract term", formalDefinition="The matter of concern in the context of this provision of the agrement." ) - protected List topic; - /** - * The actual objects that are the target of the reference (The matter of concern in the context of this provision of the agrement.) - */ - protected List topicTarget; - - - /** - * Action stipulated by this Contract Provision. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Action", formalDefinition="Action stipulated by this Contract Provision." ) - protected List action; - - /** - * Reason or purpose for the action stipulated by this Contract Provision. - */ - @Child(name = "actionReason", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Action Reason", formalDefinition="Reason or purpose for the action stipulated by this Contract Provision." ) - protected List actionReason; - - /** - * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. - */ - @Child(name = "agent", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Agent List", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) - protected List agent; - - /** - * Human readable form of this Contract Provision. - */ - @Child(name = "text", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Human readable Contract term text", formalDefinition="Human readable form of this Contract Provision." ) - protected StringType text; - - /** - * Contract Provision Valued Item List. - */ - @Child(name = "valuedItem", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item", formalDefinition="Contract Provision Valued Item List." ) - protected List valuedItem; - - /** - * Nested group of Contract Provisions. - */ - @Child(name = "group", type = {TermComponent.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Nested Contract Term Group", formalDefinition="Nested group of Contract Provisions." ) - protected List group; - - private static final long serialVersionUID = -1949614999L; - - /** - * Constructor - */ - public TermComponent() { - super(); - } - - /** - * @return {@link #identifier} (Unique identifier for this particular Contract Provision.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this particular Contract Provision.) - */ - public TermComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (When this Contract Provision was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public TermComponent setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return When this Contract Provision was issued. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value When this Contract Provision was issued. - */ - public TermComponent setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) - */ - public Period getApplies() { - if (this.applies == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.applies"); - else if (Configuration.doAutoCreate()) - this.applies = new Period(); // cc - return this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (Relevant time or time-period when this Contract Provision is applicable.) - */ - public TermComponent setApplies(Period value) { - this.applies = value; - return this; - } - - /** - * @return {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.) - */ - public TermComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subType} (Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.) - */ - public CodeableConcept getSubType() { - if (this.subType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.subType"); - else if (Configuration.doAutoCreate()) - this.subType = new CodeableConcept(); // cc - return this.subType; - } - - public boolean hasSubType() { - return this.subType != null && !this.subType.isEmpty(); - } - - /** - * @param value {@link #subType} (Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.) - */ - public TermComponent setSubType(CodeableConcept value) { - this.subType = value; - return this; - } - - /** - * @return {@link #topic} (The matter of concern in the context of this provision of the agrement.) - */ - public List getTopic() { - if (this.topic == null) - this.topic = new ArrayList(); - return this.topic; - } - - public boolean hasTopic() { - if (this.topic == null) - return false; - for (Reference item : this.topic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #topic} (The matter of concern in the context of this provision of the agrement.) - */ - // syntactic sugar - public Reference addTopic() { //3 - Reference t = new Reference(); - if (this.topic == null) - this.topic = new ArrayList(); - this.topic.add(t); - return t; - } - - // syntactic sugar - public TermComponent addTopic(Reference t) { //3 - if (t == null) - return this; - if (this.topic == null) - this.topic = new ArrayList(); - this.topic.add(t); - return this; - } - - /** - * @return {@link #topic} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The matter of concern in the context of this provision of the agrement.) - */ - public List getTopicTarget() { - if (this.topicTarget == null) - this.topicTarget = new ArrayList(); - return this.topicTarget; - } - - /** - * @return {@link #action} (Action stipulated by this Contract Provision.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (CodeableConcept item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Action stipulated by this Contract Provision.) - */ - // syntactic sugar - public CodeableConcept addAction() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public TermComponent addAction(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) - */ - public List getActionReason() { - if (this.actionReason == null) - this.actionReason = new ArrayList(); - return this.actionReason; - } - - public boolean hasActionReason() { - if (this.actionReason == null) - return false; - for (CodeableConcept item : this.actionReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionReason} (Reason or purpose for the action stipulated by this Contract Provision.) - */ - // syntactic sugar - public CodeableConcept addActionReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return t; - } - - // syntactic sugar - public TermComponent addActionReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return this; - } - - /** - * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) - */ - public List getAgent() { - if (this.agent == null) - this.agent = new ArrayList(); - return this.agent; - } - - public boolean hasAgent() { - if (this.agent == null) - return false; - for (TermAgentComponent item : this.agent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) - */ - // syntactic sugar - public TermAgentComponent addAgent() { //3 - TermAgentComponent t = new TermAgentComponent(); - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return t; - } - - // syntactic sugar - public TermComponent addAgent(TermAgentComponent t) { //3 - if (t == null) - return this; - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return this; - } - - /** - * @return {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Human readable form of this Contract Provision.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public TermComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Human readable form of this Contract Provision. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Human readable form of this Contract Provision. - */ - public TermComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #valuedItem} (Contract Provision Valued Item List.) - */ - public List getValuedItem() { - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - return this.valuedItem; - } - - public boolean hasValuedItem() { - if (this.valuedItem == null) - return false; - for (TermValuedItemComponent item : this.valuedItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valuedItem} (Contract Provision Valued Item List.) - */ - // syntactic sugar - public TermValuedItemComponent addValuedItem() { //3 - TermValuedItemComponent t = new TermValuedItemComponent(); - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return t; - } - - // syntactic sugar - public TermComponent addValuedItem(TermValuedItemComponent t) { //3 - if (t == null) - return this; - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return this; - } - - /** - * @return {@link #group} (Nested group of Contract Provisions.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (TermComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Nested group of Contract Provisions.) - */ - // syntactic sugar - public TermComponent addGroup() { //3 - TermComponent t = new TermComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public TermComponent addGroup(TermComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this particular Contract Provision.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("issued", "dateTime", "When this Contract Provision was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract Provision is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("type", "CodeableConcept", "Type of Contract Provision such as specific requirements, purposes for actions, obligations, prohibitions, e.g. life time maximum benefit.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "CodeableConcept", "Subtype of this Contract Provision, e.g. life time maximum payment for a contract term for specific valued item, e.g. disability payment.", 0, java.lang.Integer.MAX_VALUE, subType)); - childrenList.add(new Property("topic", "Reference(Any)", "The matter of concern in the context of this provision of the agrement.", 0, java.lang.Integer.MAX_VALUE, topic)); - childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("actionReason", "CodeableConcept", "Reason or purpose for the action stipulated by this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actionReason)); - childrenList.add(new Property("agent", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent)); - childrenList.add(new Property("text", "string", "Human readable form of this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("valuedItem", "", "Contract Provision Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); - childrenList.add(new Property("group", "@Contract.term", "Nested group of Contract Provisions.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType - case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : new Base[] {this.subType}; // CodeableConcept - case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // Reference - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept - case 1465121818: /*actionReason*/ return this.actionReason == null ? new Base[0] : this.actionReason.toArray(new Base[this.actionReason.size()]); // CodeableConcept - case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // TermAgentComponent - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // TermValuedItemComponent - case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // TermComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -1179159893: // issued - this.issued = castToDateTime(value); // DateTimeType - break; - case -793235316: // applies - this.applies = castToPeriod(value); // Period - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1868521062: // subType - this.subType = castToCodeableConcept(value); // CodeableConcept - break; - case 110546223: // topic - this.getTopic().add(castToReference(value)); // Reference - break; - case -1422950858: // action - this.getAction().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1465121818: // actionReason - this.getActionReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 92750597: // agent - this.getAgent().add((TermAgentComponent) value); // TermAgentComponent - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - case 2046675654: // valuedItem - this.getValuedItem().add((TermValuedItemComponent) value); // TermValuedItemComponent - break; - case 98629247: // group - this.getGroup().add((TermComponent) value); // TermComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("issued")) - this.issued = castToDateTime(value); // DateTimeType - else if (name.equals("applies")) - this.applies = castToPeriod(value); // Period - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subType")) - this.subType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("topic")) - this.getTopic().add(castToReference(value)); - else if (name.equals("action")) - this.getAction().add(castToCodeableConcept(value)); - else if (name.equals("actionReason")) - this.getActionReason().add(castToCodeableConcept(value)); - else if (name.equals("agent")) - this.getAgent().add((TermAgentComponent) value); - else if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("valuedItem")) - this.getValuedItem().add((TermValuedItemComponent) value); - else if (name.equals("group")) - this.getGroup().add((TermComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // DateTimeType - case -793235316: return getApplies(); // Period - case 3575610: return getType(); // CodeableConcept - case -1868521062: return getSubType(); // CodeableConcept - case 110546223: return addTopic(); // Reference - case -1422950858: return addAction(); // CodeableConcept - case 1465121818: return addActionReason(); // CodeableConcept - case 92750597: return addAgent(); // TermAgentComponent - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case 2046675654: return addValuedItem(); // TermValuedItemComponent - case 98629247: return addGroup(); // TermComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("issued")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.issued"); - } - else if (name.equals("applies")) { - this.applies = new Period(); - return this.applies; - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("subType")) { - this.subType = new CodeableConcept(); - return this.subType; - } - else if (name.equals("topic")) { - return addTopic(); - } - else if (name.equals("action")) { - return addAction(); - } - else if (name.equals("actionReason")) { - return addActionReason(); - } - else if (name.equals("agent")) { - return addAgent(); - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.text"); - } - else if (name.equals("valuedItem")) { - return addValuedItem(); - } - else if (name.equals("group")) { - return addGroup(); - } - else - return super.addChild(name); - } - - public TermComponent copy() { - TermComponent dst = new TermComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.applies = applies == null ? null : applies.copy(); - dst.type = type == null ? null : type.copy(); - dst.subType = subType == null ? null : subType.copy(); - if (topic != null) { - dst.topic = new ArrayList(); - for (Reference i : topic) - dst.topic.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (CodeableConcept i : action) - dst.action.add(i.copy()); - }; - if (actionReason != null) { - dst.actionReason = new ArrayList(); - for (CodeableConcept i : actionReason) - dst.actionReason.add(i.copy()); - }; - if (agent != null) { - dst.agent = new ArrayList(); - for (TermAgentComponent i : agent) - dst.agent.add(i.copy()); - }; - dst.text = text == null ? null : text.copy(); - if (valuedItem != null) { - dst.valuedItem = new ArrayList(); - for (TermValuedItemComponent i : valuedItem) - dst.valuedItem.add(i.copy()); - }; - if (group != null) { - dst.group = new ArrayList(); - for (TermComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TermComponent)) - return false; - TermComponent o = (TermComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) - && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) && compareDeep(topic, o.topic, true) - && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(agent, o.agent, true) - && compareDeep(text, o.text, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(group, o.group, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TermComponent)) - return false; - TermComponent o = (TermComponent) other; - return compareValues(issued, o.issued, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) - && (applies == null || applies.isEmpty()) && (type == null || type.isEmpty()) && (subType == null || subType.isEmpty()) - && (topic == null || topic.isEmpty()) && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) - && (agent == null || agent.isEmpty()) && (text == null || text.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) - && (group == null || group.isEmpty()); - } - - public String fhirType() { - return "Contract.term"; - - } - - } - - @Block() - public static class TermAgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The agent assigned a role in this Contract Provision. - */ - @Child(name = "actor", type = {Contract.class, Device.class, Group.class, Location.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Agent List", formalDefinition="The agent assigned a role in this Contract Provision." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The agent assigned a role in this Contract Provision.) - */ - protected Resource actorTarget; - - /** - * Role played by the agent assigned this role in the execution of this Contract Provision. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Agent Role", formalDefinition="Role played by the agent assigned this role in the execution of this Contract Provision." ) - protected List role; - - private static final long serialVersionUID = -454551165L; - - /** - * Constructor - */ - public TermAgentComponent() { - super(); - } - - /** - * Constructor - */ - public TermAgentComponent(Reference actor) { - super(); - this.actor = actor; - } - - /** - * @return {@link #actor} (The agent assigned a role in this Contract Provision.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermAgentComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The agent assigned a role in this Contract Provision.) - */ - public TermAgentComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The agent assigned a role in this Contract Provision.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The agent assigned a role in this Contract Provision.) - */ - public TermAgentComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #role} (Role played by the agent assigned this role in the execution of this Contract Provision.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Role played by the agent assigned this role in the execution of this Contract Provision.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public TermAgentComponent addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actor", "Reference(Contract|Device|Group|Location|Organization|Patient|Practitioner|RelatedPerson|Substance)", "The agent assigned a role in this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("role", "CodeableConcept", "Role played by the agent assigned this role in the execution of this Contract Provision.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case 3506294: // role - this.getRole().add(castToCodeableConcept(value)); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("role")) - this.getRole().add(castToCodeableConcept(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 92645877: return getActor(); // Reference - case 3506294: return addRole(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("role")) { - return addRole(); - } - else - return super.addChild(name); - } - - public TermAgentComponent copy() { - TermAgentComponent dst = new TermAgentComponent(); - copyValues(dst); - dst.actor = actor == null ? null : actor.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TermAgentComponent)) - return false; - TermAgentComponent o = (TermAgentComponent) other; - return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TermAgentComponent)) - return false; - TermAgentComponent o = (TermAgentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (actor == null || actor.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - public String fhirType() { - return "Contract.term.agent"; - - } - - } - - @Block() - public static class TermValuedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specific type of Contract Provision Valued Item that may be priced. - */ - @Child(name = "entity", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item Type", formalDefinition="Specific type of Contract Provision Valued Item that may be priced." ) - protected Type entity; - - /** - * Identifies a Contract Provision Valued Item instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item Identifier", formalDefinition="Identifies a Contract Provision Valued Item instance." ) - protected Identifier identifier; - - /** - * Indicates the time during which this Contract Term ValuedItem information is effective. - */ - @Child(name = "effectiveTime", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item Effective Tiem", formalDefinition="Indicates the time during which this Contract Term ValuedItem information is effective." ) - protected DateTimeType effectiveTime; - - /** - * Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item Count", formalDefinition="Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances." ) - protected SimpleQuantity quantity; - - /** - * A Contract Provision Valued Item unit valuation measure. - */ - @Child(name = "unitPrice", type = {Money.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item fee, charge, or cost", formalDefinition="A Contract Provision Valued Item unit valuation measure." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item Price Scaling Factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Term Valued Item Difficulty Scaling Factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Total Contract Term Valued Item Value", formalDefinition="Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - private static final long serialVersionUID = 1782449516L; - - /** - * Constructor - */ - public TermValuedItemComponent() { - super(); - } - - /** - * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public Type getEntity() { - return this.entity; - } - - /** - * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public CodeableConcept getEntityCodeableConcept() throws FHIRException { - if (!(this.entity instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (CodeableConcept) this.entity; - } - - public boolean hasEntityCodeableConcept() { - return this.entity instanceof CodeableConcept; - } - - /** - * @return {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public Reference getEntityReference() throws FHIRException { - if (!(this.entity instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.entity.getClass().getName()+" was encountered"); - return (Reference) this.entity; - } - - public boolean hasEntityReference() { - return this.entity instanceof Reference; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (Specific type of Contract Provision Valued Item that may be priced.) - */ - public TermValuedItemComponent setEntity(Type value) { - this.entity = value; - return this; - } - - /** - * @return {@link #identifier} (Identifies a Contract Provision Valued Item instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifies a Contract Provision Valued Item instance.) - */ - public TermValuedItemComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public DateTimeType getEffectiveTimeElement() { - if (this.effectiveTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.effectiveTime"); - else if (Configuration.doAutoCreate()) - this.effectiveTime = new DateTimeType(); // bb - return this.effectiveTime; - } - - public boolean hasEffectiveTimeElement() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (Indicates the time during which this Contract Term ValuedItem information is effective.). This is the underlying object with id, value and extensions. The accessor "getEffectiveTime" gives direct access to the value - */ - public TermValuedItemComponent setEffectiveTimeElement(DateTimeType value) { - this.effectiveTime = value; - return this; - } - - /** - * @return Indicates the time during which this Contract Term ValuedItem information is effective. - */ - public Date getEffectiveTime() { - return this.effectiveTime == null ? null : this.effectiveTime.getValue(); - } - - /** - * @param value Indicates the time during which this Contract Term ValuedItem information is effective. - */ - public TermValuedItemComponent setEffectiveTime(Date value) { - if (value == null) - this.effectiveTime = null; - else { - if (this.effectiveTime == null) - this.effectiveTime = new DateTimeType(); - this.effectiveTime.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.) - */ - public TermValuedItemComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (A Contract Provision Valued Item unit valuation measure.) - */ - public TermValuedItemComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public TermValuedItemComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public TermValuedItemComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public TermValuedItemComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public TermValuedItemComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public TermValuedItemComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - public TermValuedItemComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - public TermValuedItemComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point. - */ - public TermValuedItemComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TermValuedItemComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public TermValuedItemComponent setNet(Money value) { - this.net = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity[x]", "CodeableConcept|Reference(Any)", "Specific type of Contract Provision Valued Item that may be priced.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("identifier", "Identifier", "Identifies a Contract Provision Valued Item instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("effectiveTime", "dateTime", "Indicates the time during which this Contract Term ValuedItem information is effective.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("quantity", "SimpleQuantity", "Specifies the units by which the Contract Provision Valued Item is measured or counted, and quantifies the countable or measurable Contract Term Valued Item instances.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "A Contract Provision Valued Item unit valuation measure.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of the Contract Provision Valued Item delivered. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the Contract Provision Valued Item delivered. The concept of Points allows for assignment of point values for a Contract ProvisionValued Item, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "Expresses the product of the Contract Provision Valued Item unitQuantity and the unitPriceAmt. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Type - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // DateTimeType - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1298275357: // entity - this.entity = (Type) value; // Type - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -929905388: // effectiveTime - this.effectiveTime = castToDateTime(value); // DateTimeType - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("entity[x]")) - this.entity = (Type) value; // Type - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("effectiveTime")) - this.effectiveTime = castToDateTime(value); // DateTimeType - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -740568643: return getEntity(); // Type - case -1618432855: return getIdentifier(); // Identifier - case -929905388: throw new FHIRException("Cannot make property effectiveTime as it is not a complex type"); // DateTimeType - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("entityCodeableConcept")) { - this.entity = new CodeableConcept(); - return this.entity; - } - else if (name.equals("entityReference")) { - this.entity = new Reference(); - return this.entity; - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("effectiveTime")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.effectiveTime"); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else - return super.addChild(name); - } - - public TermValuedItemComponent copy() { - TermValuedItemComponent dst = new TermValuedItemComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TermValuedItemComponent)) - return false; - TermValuedItemComponent o = (TermValuedItemComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(identifier, o.identifier, true) && compareDeep(effectiveTime, o.effectiveTime, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TermValuedItemComponent)) - return false; - TermValuedItemComponent o = (TermValuedItemComponent) other; - return compareValues(effectiveTime, o.effectiveTime, true) && compareValues(factor, o.factor, true) - && compareValues(points, o.points, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (effectiveTime == null || effectiveTime.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()); - } - - public String fhirType() { - return "Contract.term.valuedItem"; - - } - - } - - @Block() - public static class FriendlyLanguageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability. - */ - @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Easily comprehended representation of this Contract", formalDefinition="Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /** - * Constructor - */ - public FriendlyLanguageComponent() { - super(); - } - - /** - * Constructor - */ - public FriendlyLanguageComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public Attachment getContentAttachment() throws FHIRException { - if (!(this.content instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - public boolean hasContentAttachment() { - return this.content instanceof Attachment; - } - - /** - * @return {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public Reference getContentReference() throws FHIRException { - if (!(this.content instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContentReference() { - return this.content instanceof Reference; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.) - */ - public FriendlyLanguageComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Human readable rendering of this Contract in a format and representation intended to enhance comprehension and ensure understandability.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 951530617: // content - this.content = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("content[x]")) - this.content = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 264548711: return getContent(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentAttachment")) { - this.content = new Attachment(); - return this.content; - } - else if (name.equals("contentReference")) { - this.content = new Reference(); - return this.content; - } - else - return super.addChild(name); - } - - public FriendlyLanguageComponent copy() { - FriendlyLanguageComponent dst = new FriendlyLanguageComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FriendlyLanguageComponent)) - return false; - FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FriendlyLanguageComponent)) - return false; - FriendlyLanguageComponent o = (FriendlyLanguageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - public String fhirType() { - return "Contract.friendly"; - - } - - } - - @Block() - public static class LegalLanguageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Contract legal text in human renderable form. - */ - @Child(name = "content", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Contract Legal Text", formalDefinition="Contract legal text in human renderable form." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /** - * Constructor - */ - public LegalLanguageComponent() { - super(); - } - - /** - * Constructor - */ - public LegalLanguageComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (Contract legal text in human renderable form.) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (Contract legal text in human renderable form.) - */ - public Attachment getContentAttachment() throws FHIRException { - if (!(this.content instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - public boolean hasContentAttachment() { - return this.content instanceof Attachment; - } - - /** - * @return {@link #content} (Contract legal text in human renderable form.) - */ - public Reference getContentReference() throws FHIRException { - if (!(this.content instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContentReference() { - return this.content instanceof Reference; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (Contract legal text in human renderable form.) - */ - public LegalLanguageComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Contract legal text in human renderable form.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 951530617: // content - this.content = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("content[x]")) - this.content = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 264548711: return getContent(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentAttachment")) { - this.content = new Attachment(); - return this.content; - } - else if (name.equals("contentReference")) { - this.content = new Reference(); - return this.content; - } - else - return super.addChild(name); - } - - public LegalLanguageComponent copy() { - LegalLanguageComponent dst = new LegalLanguageComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LegalLanguageComponent)) - return false; - LegalLanguageComponent o = (LegalLanguageComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LegalLanguageComponent)) - return false; - LegalLanguageComponent o = (LegalLanguageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - public String fhirType() { - return "Contract.legal"; - - } - - } - - @Block() - public static class ComputableLanguageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal). - */ - @Child(name = "content", type = {Attachment.class, DocumentReference.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Computable Contract Rules", formalDefinition="Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal)." ) - protected Type content; - - private static final long serialVersionUID = -1763459053L; - - /** - * Constructor - */ - public ComputableLanguageComponent() { - super(); - } - - /** - * Constructor - */ - public ComputableLanguageComponent(Type content) { - super(); - this.content = content; - } - - /** - * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public Type getContent() { - return this.content; - } - - /** - * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public Attachment getContentAttachment() throws FHIRException { - if (!(this.content instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Attachment) this.content; - } - - public boolean hasContentAttachment() { - return this.content instanceof Attachment; - } - - /** - * @return {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public Reference getContentReference() throws FHIRException { - if (!(this.content instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.content.getClass().getName()+" was encountered"); - return (Reference) this.content; - } - - public boolean hasContentReference() { - return this.content instanceof Reference; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).) - */ - public ComputableLanguageComponent setContent(Type value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("content[x]", "Attachment|Reference(DocumentReference)", "Computable Contract conveyed using a policy rule language (e.g. XACML, DKAL, SecPal).", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 951530617: // content - this.content = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("content[x]")) - this.content = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 264548711: return getContent(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentAttachment")) { - this.content = new Attachment(); - return this.content; - } - else if (name.equals("contentReference")) { - this.content = new Reference(); - return this.content; - } - else - return super.addChild(name); - } - - public ComputableLanguageComponent copy() { - ComputableLanguageComponent dst = new ComputableLanguageComponent(); - copyValues(dst); - dst.content = content == null ? null : content.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ComputableLanguageComponent)) - return false; - ComputableLanguageComponent o = (ComputableLanguageComponent) other; - return compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ComputableLanguageComponent)) - return false; - ComputableLanguageComponent o = (ComputableLanguageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (content == null || content.isEmpty()); - } - - public String fhirType() { - return "Contract.rule"; - - } - - } - - /** - * Unique identifier for this Contract. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contract identifier", formalDefinition="Unique identifier for this Contract." ) - protected Identifier identifier; - - /** - * When this Contract was issued. - */ - @Child(name = "issued", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When this Contract was issued", formalDefinition="When this Contract was issued." ) - protected DateTimeType issued; - - /** - * Relevant time or time-period when this Contract is applicable. - */ - @Child(name = "applies", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Effective time", formalDefinition="Relevant time or time-period when this Contract is applicable." ) - protected Period applies; - - /** - * The target entity impacted by or of interest to parties to the agreement. - */ - @Child(name = "subject", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contract Target Entity", formalDefinition="The target entity impacted by or of interest to parties to the agreement." ) - protected List subject; - /** - * The actual objects that are the target of the reference (The target entity impacted by or of interest to parties to the agreement.) - */ - protected List subjectTarget; - - - /** - * The matter of concern in the context of this agreement. - */ - @Child(name = "topic", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Context of the Contract", formalDefinition="The matter of concern in the context of this agreement." ) - protected List topic; - /** - * The actual objects that are the target of the reference (The matter of concern in the context of this agreement.) - */ - protected List topicTarget; - - - /** - * A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies. - */ - @Child(name = "authority", type = {Organization.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Authority under which this Contract has standing", formalDefinition="A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies." ) - protected List authority; - /** - * The actual objects that are the target of the reference (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - protected List authorityTarget; - - - /** - * Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources. - */ - @Child(name = "domain", type = {Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Domain in which this Contract applies", formalDefinition="Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources." ) - protected List domain; - /** - * The actual objects that are the target of the reference (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - protected List domainTarget; - - - /** - * Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contract Type", formalDefinition="Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc." ) - protected CodeableConcept type; - - /** - * More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent. - */ - @Child(name = "subType", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contract Subtype", formalDefinition="More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent." ) - protected List subType; - - /** - * Action stipulated by this Contract. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Action", formalDefinition="Action stipulated by this Contract." ) - protected List action; - - /** - * Reason for action stipulated by this Contract. - */ - @Child(name = "actionReason", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Action Reason", formalDefinition="Reason for action stipulated by this Contract." ) - protected List actionReason; - - /** - * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. - */ - @Child(name = "agent", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Agent", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) - protected List agent; - - /** - * Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness. - */ - @Child(name = "signer", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Signer", formalDefinition="Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness." ) - protected List signer; - - /** - * Contract Valued Item List. - */ - @Child(name = "valuedItem", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Valued Item", formalDefinition="Contract Valued Item List." ) - protected List valuedItem; - - /** - * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. - */ - @Child(name = "term", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Term List", formalDefinition="One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups." ) - protected List term; - - /** - * Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract. - */ - @Child(name = "binding", type = {Attachment.class, Composition.class, DocumentReference.class, QuestionnaireResponse.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Binding Contract", formalDefinition="Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract." ) - protected Type binding; - - /** - * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. - */ - @Child(name = "friendly", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Friendly Language", formalDefinition="The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement." ) - protected List friendly; - - /** - * List of Legal expressions or representations of this Contract. - */ - @Child(name = "legal", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract Legal Language", formalDefinition="List of Legal expressions or representations of this Contract." ) - protected List legal; - - /** - * List of Computable Policy Rule Language Representations of this Contract. - */ - @Child(name = "rule", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Computable Contract Language", formalDefinition="List of Computable Policy Rule Language Representations of this Contract." ) - protected List rule; - - private static final long serialVersionUID = -1116217303L; - - /** - * Constructor - */ - public Contract() { - super(); - } - - /** - * @return {@link #identifier} (Unique identifier for this Contract.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this Contract.) - */ - public Contract setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DateTimeType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new DateTimeType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (When this Contract was issued.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public Contract setIssuedElement(DateTimeType value) { - this.issued = value; - return this; - } - - /** - * @return When this Contract was issued. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value When this Contract was issued. - */ - public Contract setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new DateTimeType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #applies} (Relevant time or time-period when this Contract is applicable.) - */ - public Period getApplies() { - if (this.applies == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.applies"); - else if (Configuration.doAutoCreate()) - this.applies = new Period(); // cc - return this.applies; - } - - public boolean hasApplies() { - return this.applies != null && !this.applies.isEmpty(); - } - - /** - * @param value {@link #applies} (Relevant time or time-period when this Contract is applicable.) - */ - public Contract setApplies(Period value) { - this.applies = value; - return this; - } - - /** - * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.) - */ - public List getSubject() { - if (this.subject == null) - this.subject = new ArrayList(); - return this.subject; - } - - public boolean hasSubject() { - if (this.subject == null) - return false; - for (Reference item : this.subject) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subject} (The target entity impacted by or of interest to parties to the agreement.) - */ - // syntactic sugar - public Reference addSubject() { //3 - Reference t = new Reference(); - if (this.subject == null) - this.subject = new ArrayList(); - this.subject.add(t); - return t; - } - - // syntactic sugar - public Contract addSubject(Reference t) { //3 - if (t == null) - return this; - if (this.subject == null) - this.subject = new ArrayList(); - this.subject.add(t); - return this; - } - - /** - * @return {@link #subject} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The target entity impacted by or of interest to parties to the agreement.) - */ - public List getSubjectTarget() { - if (this.subjectTarget == null) - this.subjectTarget = new ArrayList(); - return this.subjectTarget; - } - - /** - * @return {@link #topic} (The matter of concern in the context of this agreement.) - */ - public List getTopic() { - if (this.topic == null) - this.topic = new ArrayList(); - return this.topic; - } - - public boolean hasTopic() { - if (this.topic == null) - return false; - for (Reference item : this.topic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #topic} (The matter of concern in the context of this agreement.) - */ - // syntactic sugar - public Reference addTopic() { //3 - Reference t = new Reference(); - if (this.topic == null) - this.topic = new ArrayList(); - this.topic.add(t); - return t; - } - - // syntactic sugar - public Contract addTopic(Reference t) { //3 - if (t == null) - return this; - if (this.topic == null) - this.topic = new ArrayList(); - this.topic.add(t); - return this; - } - - /** - * @return {@link #topic} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The matter of concern in the context of this agreement.) - */ - public List getTopicTarget() { - if (this.topicTarget == null) - this.topicTarget = new ArrayList(); - return this.topicTarget; - } - - /** - * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - public List getAuthority() { - if (this.authority == null) - this.authority = new ArrayList(); - return this.authority; - } - - public boolean hasAuthority() { - if (this.authority == null) - return false; - for (Reference item : this.authority) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #authority} (A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - // syntactic sugar - public Reference addAuthority() { //3 - Reference t = new Reference(); - if (this.authority == null) - this.authority = new ArrayList(); - this.authority.add(t); - return t; - } - - // syntactic sugar - public Contract addAuthority(Reference t) { //3 - if (t == null) - return this; - if (this.authority == null) - this.authority = new ArrayList(); - this.authority.add(t); - return this; - } - - /** - * @return {@link #authority} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - public List getAuthorityTarget() { - if (this.authorityTarget == null) - this.authorityTarget = new ArrayList(); - return this.authorityTarget; - } - - // syntactic sugar - /** - * @return {@link #authority} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.) - */ - public Organization addAuthorityTarget() { - Organization r = new Organization(); - if (this.authorityTarget == null) - this.authorityTarget = new ArrayList(); - this.authorityTarget.add(r); - return r; - } - - /** - * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - public List getDomain() { - if (this.domain == null) - this.domain = new ArrayList(); - return this.domain; - } - - public boolean hasDomain() { - if (this.domain == null) - return false; - for (Reference item : this.domain) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #domain} (Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - // syntactic sugar - public Reference addDomain() { //3 - Reference t = new Reference(); - if (this.domain == null) - this.domain = new ArrayList(); - this.domain.add(t); - return t; - } - - // syntactic sugar - public Contract addDomain(Reference t) { //3 - if (t == null) - return this; - if (this.domain == null) - this.domain = new ArrayList(); - this.domain.add(t); - return this; - } - - /** - * @return {@link #domain} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - public List getDomainTarget() { - if (this.domainTarget == null) - this.domainTarget = new ArrayList(); - return this.domainTarget; - } - - // syntactic sugar - /** - * @return {@link #domain} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.) - */ - public Location addDomainTarget() { - Location r = new Location(); - if (this.domainTarget == null) - this.domainTarget = new ArrayList(); - this.domainTarget.add(r); - return r; - } - - /** - * @return {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Contract.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.) - */ - public Contract setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) - */ - public List getSubType() { - if (this.subType == null) - this.subType = new ArrayList(); - return this.subType; - } - - public boolean hasSubType() { - if (this.subType == null) - return false; - for (CodeableConcept item : this.subType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subType} (More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.) - */ - // syntactic sugar - public CodeableConcept addSubType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return t; - } - - // syntactic sugar - public Contract addSubType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return this; - } - - /** - * @return {@link #action} (Action stipulated by this Contract.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (CodeableConcept item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Action stipulated by this Contract.) - */ - // syntactic sugar - public CodeableConcept addAction() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public Contract addAction(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #actionReason} (Reason for action stipulated by this Contract.) - */ - public List getActionReason() { - if (this.actionReason == null) - this.actionReason = new ArrayList(); - return this.actionReason; - } - - public boolean hasActionReason() { - if (this.actionReason == null) - return false; - for (CodeableConcept item : this.actionReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #actionReason} (Reason for action stipulated by this Contract.) - */ - // syntactic sugar - public CodeableConcept addActionReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return t; - } - - // syntactic sugar - public Contract addActionReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.actionReason == null) - this.actionReason = new ArrayList(); - this.actionReason.add(t); - return this; - } - - /** - * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) - */ - public List getAgent() { - if (this.agent == null) - this.agent = new ArrayList(); - return this.agent; - } - - public boolean hasAgent() { - if (this.agent == null) - return false; - for (AgentComponent item : this.agent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) - */ - // syntactic sugar - public AgentComponent addAgent() { //3 - AgentComponent t = new AgentComponent(); - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return t; - } - - // syntactic sugar - public Contract addAgent(AgentComponent t) { //3 - if (t == null) - return this; - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return this; - } - - /** - * @return {@link #signer} (Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.) - */ - public List getSigner() { - if (this.signer == null) - this.signer = new ArrayList(); - return this.signer; - } - - public boolean hasSigner() { - if (this.signer == null) - return false; - for (SignatoryComponent item : this.signer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #signer} (Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.) - */ - // syntactic sugar - public SignatoryComponent addSigner() { //3 - SignatoryComponent t = new SignatoryComponent(); - if (this.signer == null) - this.signer = new ArrayList(); - this.signer.add(t); - return t; - } - - // syntactic sugar - public Contract addSigner(SignatoryComponent t) { //3 - if (t == null) - return this; - if (this.signer == null) - this.signer = new ArrayList(); - this.signer.add(t); - return this; - } - - /** - * @return {@link #valuedItem} (Contract Valued Item List.) - */ - public List getValuedItem() { - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - return this.valuedItem; - } - - public boolean hasValuedItem() { - if (this.valuedItem == null) - return false; - for (ValuedItemComponent item : this.valuedItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valuedItem} (Contract Valued Item List.) - */ - // syntactic sugar - public ValuedItemComponent addValuedItem() { //3 - ValuedItemComponent t = new ValuedItemComponent(); - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return t; - } - - // syntactic sugar - public Contract addValuedItem(ValuedItemComponent t) { //3 - if (t == null) - return this; - if (this.valuedItem == null) - this.valuedItem = new ArrayList(); - this.valuedItem.add(t); - return this; - } - - /** - * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) - */ - public List getTerm() { - if (this.term == null) - this.term = new ArrayList(); - return this.term; - } - - public boolean hasTerm() { - if (this.term == null) - return false; - for (TermComponent item : this.term) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #term} (One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.) - */ - // syntactic sugar - public TermComponent addTerm() { //3 - TermComponent t = new TermComponent(); - if (this.term == null) - this.term = new ArrayList(); - this.term.add(t); - return t; - } - - // syntactic sugar - public Contract addTerm(TermComponent t) { //3 - if (t == null) - return this; - if (this.term == null) - this.term = new ArrayList(); - this.term.add(t); - return this; - } - - /** - * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Type getBinding() { - return this.binding; - } - - /** - * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Attachment getBindingAttachment() throws FHIRException { - if (!(this.binding instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.binding.getClass().getName()+" was encountered"); - return (Attachment) this.binding; - } - - public boolean hasBindingAttachment() { - return this.binding instanceof Attachment; - } - - /** - * @return {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Reference getBindingReference() throws FHIRException { - if (!(this.binding instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.binding.getClass().getName()+" was encountered"); - return (Reference) this.binding; - } - - public boolean hasBindingReference() { - return this.binding instanceof Reference; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the "source of truth" and which would be the basis for legal action related to enforcement of this Contract.) - */ - public Contract setBinding(Type value) { - this.binding = value; - return this; - } - - /** - * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) - */ - public List getFriendly() { - if (this.friendly == null) - this.friendly = new ArrayList(); - return this.friendly; - } - - public boolean hasFriendly() { - if (this.friendly == null) - return false; - for (FriendlyLanguageComponent item : this.friendly) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #friendly} (The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.) - */ - // syntactic sugar - public FriendlyLanguageComponent addFriendly() { //3 - FriendlyLanguageComponent t = new FriendlyLanguageComponent(); - if (this.friendly == null) - this.friendly = new ArrayList(); - this.friendly.add(t); - return t; - } - - // syntactic sugar - public Contract addFriendly(FriendlyLanguageComponent t) { //3 - if (t == null) - return this; - if (this.friendly == null) - this.friendly = new ArrayList(); - this.friendly.add(t); - return this; - } - - /** - * @return {@link #legal} (List of Legal expressions or representations of this Contract.) - */ - public List getLegal() { - if (this.legal == null) - this.legal = new ArrayList(); - return this.legal; - } - - public boolean hasLegal() { - if (this.legal == null) - return false; - for (LegalLanguageComponent item : this.legal) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #legal} (List of Legal expressions or representations of this Contract.) - */ - // syntactic sugar - public LegalLanguageComponent addLegal() { //3 - LegalLanguageComponent t = new LegalLanguageComponent(); - if (this.legal == null) - this.legal = new ArrayList(); - this.legal.add(t); - return t; - } - - // syntactic sugar - public Contract addLegal(LegalLanguageComponent t) { //3 - if (t == null) - return this; - if (this.legal == null) - this.legal = new ArrayList(); - this.legal.add(t); - return this; - } - - /** - * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (ComputableLanguageComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (List of Computable Policy Rule Language Representations of this Contract.) - */ - // syntactic sugar - public ComputableLanguageComponent addRule() { //3 - ComputableLanguageComponent t = new ComputableLanguageComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public Contract addRule(ComputableLanguageComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this Contract.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("issued", "dateTime", "When this Contract was issued.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("applies", "Period", "Relevant time or time-period when this Contract is applicable.", 0, java.lang.Integer.MAX_VALUE, applies)); - childrenList.add(new Property("subject", "Reference(Any)", "The target entity impacted by or of interest to parties to the agreement.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("topic", "Reference(Any)", "The matter of concern in the context of this agreement.", 0, java.lang.Integer.MAX_VALUE, topic)); - childrenList.add(new Property("authority", "Reference(Organization)", "A formally or informally recognized grouping of people, principals, organizations, or jurisdictions formed for the purpose of achieving some form of collective action such as the promulgation, administration and enforcement of contracts and policies.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("domain", "Reference(Location)", "Recognized governance framework or system operating with a circumscribed scope in accordance with specified principles, policies, processes or procedures for managing rights, actions, or behaviors of parties or principals relative to resources.", 0, java.lang.Integer.MAX_VALUE, domain)); - childrenList.add(new Property("type", "CodeableConcept", "Type of Contract such as an insurance policy, real estate contract, a will, power of attorny, Privacy or Security policy , trust framework agreement, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subType", "CodeableConcept", "More specific type or specialization of an overarching or more general contract such as auto insurance, home owner insurance, prenupial agreement, Advanced-Directive, or privacy consent.", 0, java.lang.Integer.MAX_VALUE, subType)); - childrenList.add(new Property("action", "CodeableConcept", "Action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("actionReason", "CodeableConcept", "Reason for action stipulated by this Contract.", 0, java.lang.Integer.MAX_VALUE, actionReason)); - childrenList.add(new Property("agent", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent)); - childrenList.add(new Property("signer", "", "Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the contract such as a notary or witness.", 0, java.lang.Integer.MAX_VALUE, signer)); - childrenList.add(new Property("valuedItem", "", "Contract Valued Item List.", 0, java.lang.Integer.MAX_VALUE, valuedItem)); - childrenList.add(new Property("term", "", "One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups.", 0, java.lang.Integer.MAX_VALUE, term)); - childrenList.add(new Property("binding[x]", "Attachment|Reference(Composition|DocumentReference|QuestionnaireResponse)", "Legally binding Contract: This is the signed and legally recognized representation of the Contract, which is considered the \"source of truth\" and which would be the basis for legal action related to enforcement of this Contract.", 0, java.lang.Integer.MAX_VALUE, binding)); - childrenList.add(new Property("friendly", "", "The \"patient friendly language\" versionof the Contract in whole or in parts. \"Patient friendly language\" means the representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement.", 0, java.lang.Integer.MAX_VALUE, friendly)); - childrenList.add(new Property("legal", "", "List of Legal expressions or representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, legal)); - childrenList.add(new Property("rule", "", "List of Computable Policy Rule Language Representations of this Contract.", 0, java.lang.Integer.MAX_VALUE, rule)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // DateTimeType - case -793235316: /*applies*/ return this.applies == null ? new Base[0] : new Base[] {this.applies}; // Period - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : this.subject.toArray(new Base[this.subject.size()]); // Reference - case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // Reference - case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : this.authority.toArray(new Base[this.authority.size()]); // Reference - case -1326197564: /*domain*/ return this.domain == null ? new Base[0] : this.domain.toArray(new Base[this.domain.size()]); // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // CodeableConcept - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // CodeableConcept - case 1465121818: /*actionReason*/ return this.actionReason == null ? new Base[0] : this.actionReason.toArray(new Base[this.actionReason.size()]); // CodeableConcept - case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // AgentComponent - case -902467798: /*signer*/ return this.signer == null ? new Base[0] : this.signer.toArray(new Base[this.signer.size()]); // SignatoryComponent - case 2046675654: /*valuedItem*/ return this.valuedItem == null ? new Base[0] : this.valuedItem.toArray(new Base[this.valuedItem.size()]); // ValuedItemComponent - case 3556460: /*term*/ return this.term == null ? new Base[0] : this.term.toArray(new Base[this.term.size()]); // TermComponent - case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // Type - case -1423054677: /*friendly*/ return this.friendly == null ? new Base[0] : this.friendly.toArray(new Base[this.friendly.size()]); // FriendlyLanguageComponent - case 102851257: /*legal*/ return this.legal == null ? new Base[0] : this.legal.toArray(new Base[this.legal.size()]); // LegalLanguageComponent - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // ComputableLanguageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -1179159893: // issued - this.issued = castToDateTime(value); // DateTimeType - break; - case -793235316: // applies - this.applies = castToPeriod(value); // Period - break; - case -1867885268: // subject - this.getSubject().add(castToReference(value)); // Reference - break; - case 110546223: // topic - this.getTopic().add(castToReference(value)); // Reference - break; - case 1475610435: // authority - this.getAuthority().add(castToReference(value)); // Reference - break; - case -1326197564: // domain - this.getDomain().add(castToReference(value)); // Reference - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1868521062: // subType - this.getSubType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1422950858: // action - this.getAction().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1465121818: // actionReason - this.getActionReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 92750597: // agent - this.getAgent().add((AgentComponent) value); // AgentComponent - break; - case -902467798: // signer - this.getSigner().add((SignatoryComponent) value); // SignatoryComponent - break; - case 2046675654: // valuedItem - this.getValuedItem().add((ValuedItemComponent) value); // ValuedItemComponent - break; - case 3556460: // term - this.getTerm().add((TermComponent) value); // TermComponent - break; - case -108220795: // binding - this.binding = (Type) value; // Type - break; - case -1423054677: // friendly - this.getFriendly().add((FriendlyLanguageComponent) value); // FriendlyLanguageComponent - break; - case 102851257: // legal - this.getLegal().add((LegalLanguageComponent) value); // LegalLanguageComponent - break; - case 3512060: // rule - this.getRule().add((ComputableLanguageComponent) value); // ComputableLanguageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("issued")) - this.issued = castToDateTime(value); // DateTimeType - else if (name.equals("applies")) - this.applies = castToPeriod(value); // Period - else if (name.equals("subject")) - this.getSubject().add(castToReference(value)); - else if (name.equals("topic")) - this.getTopic().add(castToReference(value)); - else if (name.equals("authority")) - this.getAuthority().add(castToReference(value)); - else if (name.equals("domain")) - this.getDomain().add(castToReference(value)); - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subType")) - this.getSubType().add(castToCodeableConcept(value)); - else if (name.equals("action")) - this.getAction().add(castToCodeableConcept(value)); - else if (name.equals("actionReason")) - this.getActionReason().add(castToCodeableConcept(value)); - else if (name.equals("agent")) - this.getAgent().add((AgentComponent) value); - else if (name.equals("signer")) - this.getSigner().add((SignatoryComponent) value); - else if (name.equals("valuedItem")) - this.getValuedItem().add((ValuedItemComponent) value); - else if (name.equals("term")) - this.getTerm().add((TermComponent) value); - else if (name.equals("binding[x]")) - this.binding = (Type) value; // Type - else if (name.equals("friendly")) - this.getFriendly().add((FriendlyLanguageComponent) value); - else if (name.equals("legal")) - this.getLegal().add((LegalLanguageComponent) value); - else if (name.equals("rule")) - this.getRule().add((ComputableLanguageComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // DateTimeType - case -793235316: return getApplies(); // Period - case -1867885268: return addSubject(); // Reference - case 110546223: return addTopic(); // Reference - case 1475610435: return addAuthority(); // Reference - case -1326197564: return addDomain(); // Reference - case 3575610: return getType(); // CodeableConcept - case -1868521062: return addSubType(); // CodeableConcept - case -1422950858: return addAction(); // CodeableConcept - case 1465121818: return addActionReason(); // CodeableConcept - case 92750597: return addAgent(); // AgentComponent - case -902467798: return addSigner(); // SignatoryComponent - case 2046675654: return addValuedItem(); // ValuedItemComponent - case 3556460: return addTerm(); // TermComponent - case 1514826715: return getBinding(); // Type - case -1423054677: return addFriendly(); // FriendlyLanguageComponent - case 102851257: return addLegal(); // LegalLanguageComponent - case 3512060: return addRule(); // ComputableLanguageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("issued")) { - throw new FHIRException("Cannot call addChild on a primitive type Contract.issued"); - } - else if (name.equals("applies")) { - this.applies = new Period(); - return this.applies; - } - else if (name.equals("subject")) { - return addSubject(); - } - else if (name.equals("topic")) { - return addTopic(); - } - else if (name.equals("authority")) { - return addAuthority(); - } - else if (name.equals("domain")) { - return addDomain(); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("subType")) { - return addSubType(); - } - else if (name.equals("action")) { - return addAction(); - } - else if (name.equals("actionReason")) { - return addActionReason(); - } - else if (name.equals("agent")) { - return addAgent(); - } - else if (name.equals("signer")) { - return addSigner(); - } - else if (name.equals("valuedItem")) { - return addValuedItem(); - } - else if (name.equals("term")) { - return addTerm(); - } - else if (name.equals("bindingAttachment")) { - this.binding = new Attachment(); - return this.binding; - } - else if (name.equals("bindingReference")) { - this.binding = new Reference(); - return this.binding; - } - else if (name.equals("friendly")) { - return addFriendly(); - } - else if (name.equals("legal")) { - return addLegal(); - } - else if (name.equals("rule")) { - return addRule(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Contract"; - - } - - public Contract copy() { - Contract dst = new Contract(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.applies = applies == null ? null : applies.copy(); - if (subject != null) { - dst.subject = new ArrayList(); - for (Reference i : subject) - dst.subject.add(i.copy()); - }; - if (topic != null) { - dst.topic = new ArrayList(); - for (Reference i : topic) - dst.topic.add(i.copy()); - }; - if (authority != null) { - dst.authority = new ArrayList(); - for (Reference i : authority) - dst.authority.add(i.copy()); - }; - if (domain != null) { - dst.domain = new ArrayList(); - for (Reference i : domain) - dst.domain.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (subType != null) { - dst.subType = new ArrayList(); - for (CodeableConcept i : subType) - dst.subType.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (CodeableConcept i : action) - dst.action.add(i.copy()); - }; - if (actionReason != null) { - dst.actionReason = new ArrayList(); - for (CodeableConcept i : actionReason) - dst.actionReason.add(i.copy()); - }; - if (agent != null) { - dst.agent = new ArrayList(); - for (AgentComponent i : agent) - dst.agent.add(i.copy()); - }; - if (signer != null) { - dst.signer = new ArrayList(); - for (SignatoryComponent i : signer) - dst.signer.add(i.copy()); - }; - if (valuedItem != null) { - dst.valuedItem = new ArrayList(); - for (ValuedItemComponent i : valuedItem) - dst.valuedItem.add(i.copy()); - }; - if (term != null) { - dst.term = new ArrayList(); - for (TermComponent i : term) - dst.term.add(i.copy()); - }; - dst.binding = binding == null ? null : binding.copy(); - if (friendly != null) { - dst.friendly = new ArrayList(); - for (FriendlyLanguageComponent i : friendly) - dst.friendly.add(i.copy()); - }; - if (legal != null) { - dst.legal = new ArrayList(); - for (LegalLanguageComponent i : legal) - dst.legal.add(i.copy()); - }; - if (rule != null) { - dst.rule = new ArrayList(); - for (ComputableLanguageComponent i : rule) - dst.rule.add(i.copy()); - }; - return dst; - } - - protected Contract typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Contract)) - return false; - Contract o = (Contract) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(issued, o.issued, true) && compareDeep(applies, o.applies, true) - && compareDeep(subject, o.subject, true) && compareDeep(topic, o.topic, true) && compareDeep(authority, o.authority, true) - && compareDeep(domain, o.domain, true) && compareDeep(type, o.type, true) && compareDeep(subType, o.subType, true) - && compareDeep(action, o.action, true) && compareDeep(actionReason, o.actionReason, true) && compareDeep(agent, o.agent, true) - && compareDeep(signer, o.signer, true) && compareDeep(valuedItem, o.valuedItem, true) && compareDeep(term, o.term, true) - && compareDeep(binding, o.binding, true) && compareDeep(friendly, o.friendly, true) && compareDeep(legal, o.legal, true) - && compareDeep(rule, o.rule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Contract)) - return false; - Contract o = (Contract) other; - return compareValues(issued, o.issued, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (issued == null || issued.isEmpty()) - && (applies == null || applies.isEmpty()) && (subject == null || subject.isEmpty()) && (topic == null || topic.isEmpty()) - && (authority == null || authority.isEmpty()) && (domain == null || domain.isEmpty()) && (type == null || type.isEmpty()) - && (subType == null || subType.isEmpty()) && (action == null || action.isEmpty()) && (actionReason == null || actionReason.isEmpty()) - && (agent == null || agent.isEmpty()) && (signer == null || signer.isEmpty()) && (valuedItem == null || valuedItem.isEmpty()) - && (term == null || term.isEmpty()) && (binding == null || binding.isEmpty()) && (friendly == null || friendly.isEmpty()) - && (legal == null || legal.isEmpty()) && (rule == null || rule.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Contract; - } - - /** - * Search parameter: topic - *

- * Description: The identity of the topic of the contract
- * Type: reference
- * Path: Contract.topic
- *

- */ - @SearchParamDefinition(name="topic", path="Contract.topic", description="The identity of the topic of the contract", type="reference" ) - public static final String SP_TOPIC = "topic"; - /** - * Fluent Client search parameter constant for topic - *

- * Description: The identity of the topic of the contract
- * Type: reference
- * Path: Contract.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TOPIC = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TOPIC); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:topic". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TOPIC = new ca.uhn.fhir.model.api.Include("Contract:topic").toLocked(); - - /** - * Search parameter: authority - *

- * Description: The authority of the contract
- * Type: reference
- * Path: Contract.authority
- *

- */ - @SearchParamDefinition(name="authority", path="Contract.authority", description="The authority of the contract", type="reference" ) - public static final String SP_AUTHORITY = "authority"; - /** - * Fluent Client search parameter constant for authority - *

- * Description: The authority of the contract
- * Type: reference
- * Path: Contract.authority
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHORITY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHORITY); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:authority". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHORITY = new ca.uhn.fhir.model.api.Include("Contract:authority").toLocked(); - - /** - * Search parameter: signer - *

- * Description: Contract Signatory Party
- * Type: reference
- * Path: Contract.signer.party
- *

- */ - @SearchParamDefinition(name="signer", path="Contract.signer.party", description="Contract Signatory Party", type="reference" ) - public static final String SP_SIGNER = "signer"; - /** - * Fluent Client search parameter constant for signer - *

- * Description: Contract Signatory Party
- * Type: reference
- * Path: Contract.signer.party
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SIGNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SIGNER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:signer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SIGNER = new ca.uhn.fhir.model.api.Include("Contract:signer").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The identity of the subject of the contract (if a patient)
- * Type: reference
- * Path: Contract.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Contract.subject", description="The identity of the subject of the contract (if a patient)", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of the subject of the contract (if a patient)
- * Type: reference
- * Path: Contract.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Contract:patient").toLocked(); - - /** - * Search parameter: subject - *

- * Description: The identity of the subject of the contract
- * Type: reference
- * Path: Contract.subject
- *

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

- * Description: The identity of the subject of the contract
- * Type: reference
- * Path: Contract.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Contract:subject").toLocked(); - - /** - * Search parameter: issued - *

- * Description: The date/time the contract was issued
- * Type: date
- * Path: Contract.issued
- *

- */ - @SearchParamDefinition(name="issued", path="Contract.issued", description="The date/time the contract was issued", type="date" ) - public static final String SP_ISSUED = "issued"; - /** - * Fluent Client search parameter constant for issued - *

- * Description: The date/time the contract was issued
- * Type: date
- * Path: Contract.issued
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED); - - /** - * Search parameter: domain - *

- * Description: The domain of the contract
- * Type: reference
- * Path: Contract.domain
- *

- */ - @SearchParamDefinition(name="domain", path="Contract.domain", description="The domain of the contract", type="reference" ) - public static final String SP_DOMAIN = "domain"; - /** - * Fluent Client search parameter constant for domain - *

- * Description: The domain of the contract
- * Type: reference
- * Path: Contract.domain
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DOMAIN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DOMAIN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:domain". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DOMAIN = new ca.uhn.fhir.model.api.Include("Contract:domain").toLocked(); - - /** - * Search parameter: ttopic - *

- * Description: The identity of the topic of the contract terms
- * Type: reference
- * Path: Contract.term.topic
- *

- */ - @SearchParamDefinition(name="ttopic", path="Contract.term.topic", description="The identity of the topic of the contract terms", type="reference" ) - public static final String SP_TTOPIC = "ttopic"; - /** - * Fluent Client search parameter constant for ttopic - *

- * Description: The identity of the topic of the contract terms
- * Type: reference
- * Path: Contract.term.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TTOPIC = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TTOPIC); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:ttopic". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TTOPIC = new ca.uhn.fhir.model.api.Include("Contract:ttopic").toLocked(); - - /** - * Search parameter: agent - *

- * Description: Agent to the Contact
- * Type: reference
- * Path: Contract.agent.actor
- *

- */ - @SearchParamDefinition(name="agent", path="Contract.agent.actor", description="Agent to the Contact", type="reference" ) - public static final String SP_AGENT = "agent"; - /** - * Fluent Client search parameter constant for agent - *

- * Description: Agent to the Contact
- * Type: reference
- * Path: Contract.agent.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Contract:agent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("Contract:agent").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The identity of the contract
- * Type: token
- * Path: Contract.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Contract.identifier", description="The identity of the contract", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identity of the contract
- * Type: token
- * Path: Contract.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Count.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Count.java deleted file mode 100644 index 9c22997fd3d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Count.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Count", profileOf=Quantity.class) -public class Count extends Quantity { - - private static final long serialVersionUID = 1069574054L; - - public Count copy() { - Count dst = new Count(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Count typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Count)) - return false; - Count o = (Count) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Count)) - return false; - Count o = (Count) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Coverage.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Coverage.java deleted file mode 100644 index 36fdeb710ce..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Coverage.java +++ /dev/null @@ -1,1537 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Financial instrument which may be used to pay for or reimburse health care products and services. - */ -@ResourceDef(name="Coverage", profile="http://hl7.org/fhir/Profile/Coverage") -public class Coverage extends DomainResource { - - /** - * The program or plan underwriter or payor. - */ - @Child(name = "issuer", type = {Identifier.class, Organization.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier for the plan issuer", formalDefinition="The program or plan underwriter or payor." ) - protected Type issuer; - - /** - * Business Identification Number (BIN number) used to identify the routing of eClaims. - */ - @Child(name = "bin", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="BIN Number", formalDefinition="Business Identification Number (BIN number) used to identify the routing of eClaims." ) - protected StringType bin; - - /** - * 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. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Period period; - - /** - * The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health. - */ - @Child(name = "type", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of coverage", formalDefinition="The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health." ) - protected Coding type; - - /** - * The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due. - */ - @Child(name = "planholder", type = {Identifier.class, Patient.class, Organization.class}, order=4, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="Plan holder", formalDefinition="The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due." ) - protected Type planholder; - - /** - * The party who benefits from the insurance coverage. - */ - @Child(name = "beneficiary", type = {Identifier.class, Patient.class}, order=5, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="Plan Beneficiary", formalDefinition="The party who benefits from the insurance coverage." ) - protected Type beneficiary; - - /** - * The relationship of the patient to the planholdersubscriber). - */ - @Child(name = "relationship", type = {Coding.class}, order=6, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Patient relationship to planholder", formalDefinition="The relationship of the patient to the planholdersubscriber)." ) - protected Coding relationship; - - /** - * The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID. - */ - @Child(name = "identifier", type = {Identifier.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The primary coverage ID", formalDefinition="The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID." ) - protected List identifier; - - /** - * 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. - */ - @Child(name = "group", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="An identifier for the group", 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." ) - protected StringType group; - - /** - * 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. - */ - @Child(name = "plan", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType plan; - - /** - * 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. - */ - @Child(name = "subPlan", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType subPlan; - - /** - * A unique identifier for a dependent under the coverage. - */ - @Child(name = "dependent", type = {PositiveIntType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Dependent number", formalDefinition="A unique identifier for a dependent under the coverage." ) - protected PositiveIntType dependent; - - /** - * An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @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." ) - protected PositiveIntType sequence; - - /** - * Factors which may influence the applicability of coverage. - */ - @Child(name = "exception", type = {Coding.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Eligibility exceptions", formalDefinition="Factors which may influence the applicability of coverage." ) - protected List exception; - - /** - * Name of school for over-aged dependants. - */ - @Child(name = "school", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of School", formalDefinition="Name of school for over-aged dependants." ) - protected StringType school; - - /** - * The identifier for a community of providers. - */ - @Child(name = "network", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer network", formalDefinition="The identifier for a community of providers." ) - protected StringType network; - - /** - * The policy(s) which constitute this insurance coverage. - */ - @Child(name = "contract", type = {Contract.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contract details", formalDefinition="The policy(s) which constitute this insurance coverage." ) - protected List contract; - /** - * The actual objects that are the target of the reference (The policy(s) which constitute this insurance coverage.) - */ - protected List contractTarget; - - - private static final long serialVersionUID = -1269320450L; - - /** - * Constructor - */ - public Coverage() { - super(); - } - - /** - * Constructor - */ - public Coverage(Type issuer, Type planholder, Type beneficiary, Coding relationship) { - super(); - this.issuer = issuer; - this.planholder = planholder; - this.beneficiary = beneficiary; - this.relationship = relationship; - } - - /** - * @return {@link #issuer} (The program or plan underwriter or payor.) - */ - public Type getIssuer() { - return this.issuer; - } - - /** - * @return {@link #issuer} (The program or plan underwriter or payor.) - */ - public Identifier getIssuerIdentifier() throws FHIRException { - if (!(this.issuer instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.issuer.getClass().getName()+" was encountered"); - return (Identifier) this.issuer; - } - - public boolean hasIssuerIdentifier() { - return this.issuer instanceof Identifier; - } - - /** - * @return {@link #issuer} (The program or plan underwriter or payor.) - */ - public Reference getIssuerReference() throws FHIRException { - if (!(this.issuer instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.issuer.getClass().getName()+" was encountered"); - return (Reference) this.issuer; - } - - public boolean hasIssuerReference() { - return this.issuer instanceof Reference; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (The program or plan underwriter or payor.) - */ - public Coverage setIssuer(Type value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eClaims.). This is the underlying object with id, value and extensions. The accessor "getBin" gives direct access to the value - */ - public StringType getBinElement() { - if (this.bin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.bin"); - else if (Configuration.doAutoCreate()) - this.bin = new StringType(); // bb - return this.bin; - } - - public boolean hasBinElement() { - return this.bin != null && !this.bin.isEmpty(); - } - - public boolean hasBin() { - return this.bin != null && !this.bin.isEmpty(); - } - - /** - * @param value {@link #bin} (Business Identification Number (BIN number) used to identify the routing of eClaims.). This is the underlying object with id, value and extensions. The accessor "getBin" gives direct access to the value - */ - public Coverage setBinElement(StringType value) { - this.bin = value; - return this; - } - - /** - * @return Business Identification Number (BIN number) used to identify the routing of eClaims. - */ - public String getBin() { - return this.bin == null ? null : this.bin.getValue(); - } - - /** - * @param value Business Identification Number (BIN number) used to identify the routing of eClaims. - */ - public Coverage setBin(String value) { - if (Utilities.noString(value)) - this.bin = null; - else { - if (this.bin == null) - this.bin = new StringType(); - this.bin.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (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 Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (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(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.) - */ - public Coverage setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Type getPlanholder() { - return this.planholder; - } - - /** - * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Identifier getPlanholderIdentifier() throws FHIRException { - if (!(this.planholder instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.planholder.getClass().getName()+" was encountered"); - return (Identifier) this.planholder; - } - - public boolean hasPlanholderIdentifier() { - return this.planholder instanceof Identifier; - } - - /** - * @return {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Reference getPlanholderReference() throws FHIRException { - if (!(this.planholder instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.planholder.getClass().getName()+" was encountered"); - return (Reference) this.planholder; - } - - public boolean hasPlanholderReference() { - return this.planholder instanceof Reference; - } - - public boolean hasPlanholder() { - return this.planholder != null && !this.planholder.isEmpty(); - } - - /** - * @param value {@link #planholder} (The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.) - */ - public Coverage setPlanholder(Type value) { - this.planholder = value; - return this; - } - - /** - * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) - */ - public Type getBeneficiary() { - return this.beneficiary; - } - - /** - * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) - */ - public Identifier getBeneficiaryIdentifier() throws FHIRException { - if (!(this.beneficiary instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.beneficiary.getClass().getName()+" was encountered"); - return (Identifier) this.beneficiary; - } - - public boolean hasBeneficiaryIdentifier() { - return this.beneficiary instanceof Identifier; - } - - /** - * @return {@link #beneficiary} (The party who benefits from the insurance coverage.) - */ - public Reference getBeneficiaryReference() throws FHIRException { - if (!(this.beneficiary instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.beneficiary.getClass().getName()+" was encountered"); - return (Reference) this.beneficiary; - } - - public boolean hasBeneficiaryReference() { - return this.beneficiary instanceof Reference; - } - - public boolean hasBeneficiary() { - return this.beneficiary != null && !this.beneficiary.isEmpty(); - } - - /** - * @param value {@link #beneficiary} (The party who benefits from the insurance coverage.) - */ - public Coverage setBeneficiary(Type value) { - this.beneficiary = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the planholdersubscriber).) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the planholdersubscriber).) - */ - public Coverage setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Coverage addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #group} (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.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value - */ - public StringType getGroupElement() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.group"); - else if (Configuration.doAutoCreate()) - this.group = new StringType(); // bb - return this.group; - } - - public boolean hasGroupElement() { - return this.group != null && !this.group.isEmpty(); - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (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.). This is the underlying object with id, value and extensions. The accessor "getGroup" gives direct access to the value - */ - public Coverage setGroupElement(StringType value) { - this.group = value; - return this; - } - - /** - * @return 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 String getGroup() { - return this.group == null ? null : this.group.getValue(); - } - - /** - * @param value 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 setGroup(String value) { - if (Utilities.noString(value)) - this.group = null; - else { - if (this.group == null) - this.group = new StringType(); - this.group.setValue(value); - } - return this; - } - - /** - * @return {@link #plan} (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.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value - */ - public StringType getPlanElement() { - if (this.plan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.plan"); - else if (Configuration.doAutoCreate()) - this.plan = new StringType(); // bb - return this.plan; - } - - public boolean hasPlanElement() { - return this.plan != null && !this.plan.isEmpty(); - } - - public boolean hasPlan() { - return this.plan != null && !this.plan.isEmpty(); - } - - /** - * @param value {@link #plan} (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.). This is the underlying object with id, value and extensions. The accessor "getPlan" gives direct access to the value - */ - public Coverage setPlanElement(StringType value) { - this.plan = value; - return this; - } - - /** - * @return 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 String getPlan() { - return this.plan == null ? null : this.plan.getValue(); - } - - /** - * @param value 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 value) { - if (Utilities.noString(value)) - this.plan = null; - else { - if (this.plan == null) - this.plan = new StringType(); - this.plan.setValue(value); - } - return this; - } - - /** - * @return {@link #subPlan} (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.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value - */ - public StringType getSubPlanElement() { - if (this.subPlan == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.subPlan"); - else if (Configuration.doAutoCreate()) - this.subPlan = new StringType(); // bb - return this.subPlan; - } - - public boolean hasSubPlanElement() { - return this.subPlan != null && !this.subPlan.isEmpty(); - } - - public boolean hasSubPlan() { - return this.subPlan != null && !this.subPlan.isEmpty(); - } - - /** - * @param value {@link #subPlan} (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.). This is the underlying object with id, value and extensions. The accessor "getSubPlan" gives direct access to the value - */ - public Coverage setSubPlanElement(StringType value) { - this.subPlan = value; - return this; - } - - /** - * @return 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 String getSubPlan() { - return this.subPlan == null ? null : this.subPlan.getValue(); - } - - /** - * @param value 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 value) { - if (Utilities.noString(value)) - this.subPlan = null; - else { - if (this.subPlan == null) - this.subPlan = new StringType(); - this.subPlan.setValue(value); - } - return this; - } - - /** - * @return {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value - */ - public PositiveIntType getDependentElement() { - if (this.dependent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.dependent"); - else if (Configuration.doAutoCreate()) - this.dependent = new PositiveIntType(); // bb - return this.dependent; - } - - public boolean hasDependentElement() { - return this.dependent != null && !this.dependent.isEmpty(); - } - - public boolean hasDependent() { - return this.dependent != null && !this.dependent.isEmpty(); - } - - /** - * @param value {@link #dependent} (A unique identifier for a dependent under the coverage.). This is the underlying object with id, value and extensions. The accessor "getDependent" gives direct access to the value - */ - public Coverage setDependentElement(PositiveIntType value) { - this.dependent = value; - return this; - } - - /** - * @return A unique identifier for a dependent under the coverage. - */ - public int getDependent() { - return this.dependent == null || this.dependent.isEmpty() ? 0 : this.dependent.getValue(); - } - - /** - * @param value A unique identifier for a dependent under the coverage. - */ - public Coverage setDependent(int value) { - if (this.dependent == null) - this.dependent = new PositiveIntType(); - this.dependent.setValue(value); - return this; - } - - /** - * @return {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (An optional counter for a particular instance of the identified coverage which increments upon each renewal.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public Coverage setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value An optional counter for a particular instance of the identified coverage which increments upon each renewal. - */ - public Coverage setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - public List getException() { - if (this.exception == null) - this.exception = new ArrayList(); - return this.exception; - } - - public boolean hasException() { - if (this.exception == null) - return false; - for (Coding item : this.exception) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exception} (Factors which may influence the applicability of coverage.) - */ - // syntactic sugar - public Coding addException() { //3 - Coding t = new Coding(); - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return t; - } - - // syntactic sugar - public Coverage addException(Coding t) { //3 - if (t == null) - return this; - if (this.exception == null) - this.exception = new ArrayList(); - this.exception.add(t); - return this; - } - - /** - * @return {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public StringType getSchoolElement() { - if (this.school == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.school"); - else if (Configuration.doAutoCreate()) - this.school = new StringType(); // bb - return this.school; - } - - public boolean hasSchoolElement() { - return this.school != null && !this.school.isEmpty(); - } - - public boolean hasSchool() { - return this.school != null && !this.school.isEmpty(); - } - - /** - * @param value {@link #school} (Name of school for over-aged dependants.). This is the underlying object with id, value and extensions. The accessor "getSchool" gives direct access to the value - */ - public Coverage setSchoolElement(StringType value) { - this.school = value; - return this; - } - - /** - * @return Name of school for over-aged dependants. - */ - public String getSchool() { - return this.school == null ? null : this.school.getValue(); - } - - /** - * @param value Name of school for over-aged dependants. - */ - public Coverage setSchool(String value) { - if (Utilities.noString(value)) - this.school = null; - else { - if (this.school == null) - this.school = new StringType(); - this.school.setValue(value); - } - return this; - } - - /** - * @return {@link #network} (The identifier for a community of providers.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value - */ - public StringType getNetworkElement() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Coverage.network"); - else if (Configuration.doAutoCreate()) - this.network = new StringType(); // bb - return this.network; - } - - public boolean hasNetworkElement() { - return this.network != null && !this.network.isEmpty(); - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (The identifier for a community of providers.). This is the underlying object with id, value and extensions. The accessor "getNetwork" gives direct access to the value - */ - public Coverage setNetworkElement(StringType value) { - this.network = value; - return this; - } - - /** - * @return The identifier for a community of providers. - */ - public String getNetwork() { - return this.network == null ? null : this.network.getValue(); - } - - /** - * @param value The identifier for a community of providers. - */ - public Coverage setNetwork(String value) { - if (Utilities.noString(value)) - this.network = null; - else { - if (this.network == null) - this.network = new StringType(); - this.network.setValue(value); - } - return this; - } - - /** - * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) - */ - public List getContract() { - if (this.contract == null) - this.contract = new ArrayList(); - return this.contract; - } - - public boolean hasContract() { - if (this.contract == null) - return false; - for (Reference item : this.contract) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contract} (The policy(s) which constitute this insurance coverage.) - */ - // syntactic sugar - public Reference addContract() { //3 - Reference t = new Reference(); - if (this.contract == null) - this.contract = new ArrayList(); - this.contract.add(t); - return t; - } - - // syntactic sugar - public Coverage addContract(Reference t) { //3 - if (t == null) - return this; - if (this.contract == null) - this.contract = new ArrayList(); - this.contract.add(t); - return this; - } - - /** - * @return {@link #contract} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The policy(s) which constitute this insurance coverage.) - */ - public List getContractTarget() { - if (this.contractTarget == null) - this.contractTarget = new ArrayList(); - return this.contractTarget; - } - - // syntactic sugar - /** - * @return {@link #contract} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The policy(s) which constitute this insurance coverage.) - */ - public Contract addContractTarget() { - Contract r = new Contract(); - if (this.contractTarget == null) - this.contractTarget = new ArrayList(); - this.contractTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("issuer[x]", "Identifier|Reference(Organization)", "The program or plan underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, issuer)); - childrenList.add(new Property("bin", "string", "Business Identification Number (BIN number) used to identify the routing of eClaims.", 0, java.lang.Integer.MAX_VALUE, bin)); - childrenList.add(new Property("period", "Period", "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.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("type", "Coding", "The type of coverage: social program, medical plan, accident coverage (workers compensation, auto), group health.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("planholder[x]", "Identifier|Reference(Patient|Organization)", "The party who 'owns' the insurance contractual relationship to the policy or to whom the benefit of the policy is due.", 0, java.lang.Integer.MAX_VALUE, planholder)); - childrenList.add(new Property("beneficiary[x]", "Identifier|Reference(Patient)", "The party who benefits from the insurance coverage.", 0, java.lang.Integer.MAX_VALUE, beneficiary)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the planholdersubscriber).", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("identifier", "Identifier", "The main (and possibly only) identifier for the coverage - often referred to as a Member Id, Subscriber Id, Certificate number or Personal Health Number or Case ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("group", "string", "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.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("plan", "string", "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.", 0, java.lang.Integer.MAX_VALUE, plan)); - childrenList.add(new Property("subPlan", "string", "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.", 0, java.lang.Integer.MAX_VALUE, subPlan)); - childrenList.add(new Property("dependent", "positiveInt", "A unique identifier for a dependent under the coverage.", 0, java.lang.Integer.MAX_VALUE, dependent)); - childrenList.add(new Property("sequence", "positiveInt", "An optional counter for a particular instance of the identified coverage which increments upon each renewal.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("exception", "Coding", "Factors which may influence the applicability of coverage.", 0, java.lang.Integer.MAX_VALUE, exception)); - childrenList.add(new Property("school", "string", "Name of school for over-aged dependants.", 0, java.lang.Integer.MAX_VALUE, school)); - childrenList.add(new Property("network", "string", "The identifier for a community of providers.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("contract", "Reference(Contract)", "The policy(s) which constitute this insurance coverage.", 0, java.lang.Integer.MAX_VALUE, contract)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // Type - case 97543: /*bin*/ return this.bin == null ? new Base[0] : new Base[] {this.bin}; // StringType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1007064597: /*planholder*/ return this.planholder == null ? new Base[0] : new Base[] {this.planholder}; // Type - case -565102875: /*beneficiary*/ return this.beneficiary == null ? new Base[0] : new Base[] {this.beneficiary}; // Type - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // StringType - case 3443497: /*plan*/ return this.plan == null ? new Base[0] : new Base[] {this.plan}; // StringType - case -1868653175: /*subPlan*/ return this.subPlan == null ? new Base[0] : new Base[] {this.subPlan}; // StringType - case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : new Base[] {this.dependent}; // PositiveIntType - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1481625679: /*exception*/ return this.exception == null ? new Base[0] : this.exception.toArray(new Base[this.exception.size()]); // Coding - case -907977868: /*school*/ return this.school == null ? new Base[0] : new Base[] {this.school}; // StringType - case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // StringType - case -566947566: /*contract*/ return this.contract == null ? new Base[0] : this.contract.toArray(new Base[this.contract.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1179159879: // issuer - this.issuer = (Type) value; // Type - break; - case 97543: // bin - this.bin = castToString(value); // StringType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 1007064597: // planholder - this.planholder = (Type) value; // Type - break; - case -565102875: // beneficiary - this.beneficiary = (Type) value; // Type - break; - case -261851592: // relationship - this.relationship = castToCoding(value); // Coding - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 98629247: // group - this.group = castToString(value); // StringType - break; - case 3443497: // plan - this.plan = castToString(value); // StringType - break; - case -1868653175: // subPlan - this.subPlan = castToString(value); // StringType - break; - case -1109226753: // dependent - this.dependent = castToPositiveInt(value); // PositiveIntType - break; - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 1481625679: // exception - this.getException().add(castToCoding(value)); // Coding - break; - case -907977868: // school - this.school = castToString(value); // StringType - break; - case 1843485230: // network - this.network = castToString(value); // StringType - break; - case -566947566: // contract - this.getContract().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("issuer[x]")) - this.issuer = (Type) value; // Type - else if (name.equals("bin")) - this.bin = castToString(value); // StringType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("planholder[x]")) - this.planholder = (Type) value; // Type - else if (name.equals("beneficiary[x]")) - this.beneficiary = (Type) value; // Type - else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("group")) - this.group = castToString(value); // StringType - else if (name.equals("plan")) - this.plan = castToString(value); // StringType - else if (name.equals("subPlan")) - this.subPlan = castToString(value); // StringType - else if (name.equals("dependent")) - this.dependent = castToPositiveInt(value); // PositiveIntType - else if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("exception")) - this.getException().add(castToCoding(value)); - else if (name.equals("school")) - this.school = castToString(value); // StringType - else if (name.equals("network")) - this.network = castToString(value); // StringType - else if (name.equals("contract")) - this.getContract().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 185649959: return getIssuer(); // Type - case 97543: throw new FHIRException("Cannot make property bin as it is not a complex type"); // StringType - case -991726143: return getPeriod(); // Period - case 3575610: return getType(); // Coding - case 1114937931: return getPlanholder(); // Type - case 1292142459: return getBeneficiary(); // Type - case -261851592: return getRelationship(); // Coding - case -1618432855: return addIdentifier(); // Identifier - case 98629247: throw new FHIRException("Cannot make property group as it is not a complex type"); // StringType - case 3443497: throw new FHIRException("Cannot make property plan as it is not a complex type"); // StringType - case -1868653175: throw new FHIRException("Cannot make property subPlan as it is not a complex type"); // StringType - case -1109226753: throw new FHIRException("Cannot make property dependent as it is not a complex type"); // PositiveIntType - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1481625679: return addException(); // Coding - case -907977868: throw new FHIRException("Cannot make property school as it is not a complex type"); // StringType - case 1843485230: throw new FHIRException("Cannot make property network as it is not a complex type"); // StringType - case -566947566: return addContract(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("issuerIdentifier")) { - this.issuer = new Identifier(); - return this.issuer; - } - else if (name.equals("issuerReference")) { - this.issuer = new Reference(); - return this.issuer; - } - else if (name.equals("bin")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.bin"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("planholderIdentifier")) { - this.planholder = new Identifier(); - return this.planholder; - } - else if (name.equals("planholderReference")) { - this.planholder = new Reference(); - return this.planholder; - } - else if (name.equals("beneficiaryIdentifier")) { - this.beneficiary = new Identifier(); - return this.beneficiary; - } - else if (name.equals("beneficiaryReference")) { - this.beneficiary = new Reference(); - return this.beneficiary; - } - else if (name.equals("relationship")) { - this.relationship = new Coding(); - return this.relationship; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("group")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.group"); - } - else if (name.equals("plan")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.plan"); - } - else if (name.equals("subPlan")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.subPlan"); - } - else if (name.equals("dependent")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.dependent"); - } - else if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.sequence"); - } - else if (name.equals("exception")) { - return addException(); - } - else if (name.equals("school")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.school"); - } - else if (name.equals("network")) { - throw new FHIRException("Cannot call addChild on a primitive type Coverage.network"); - } - else if (name.equals("contract")) { - return addContract(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Coverage"; - - } - - public Coverage copy() { - Coverage dst = new Coverage(); - copyValues(dst); - dst.issuer = issuer == null ? null : issuer.copy(); - dst.bin = bin == null ? null : bin.copy(); - dst.period = period == null ? null : period.copy(); - dst.type = type == null ? null : type.copy(); - dst.planholder = planholder == null ? null : planholder.copy(); - dst.beneficiary = beneficiary == null ? null : beneficiary.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.group = group == null ? null : group.copy(); - dst.plan = plan == null ? null : plan.copy(); - dst.subPlan = subPlan == null ? null : subPlan.copy(); - dst.dependent = dependent == null ? null : dependent.copy(); - dst.sequence = sequence == null ? null : sequence.copy(); - if (exception != null) { - dst.exception = new ArrayList(); - for (Coding i : exception) - dst.exception.add(i.copy()); - }; - dst.school = school == null ? null : school.copy(); - dst.network = network == null ? null : network.copy(); - if (contract != null) { - dst.contract = new ArrayList(); - for (Reference i : contract) - dst.contract.add(i.copy()); - }; - return dst; - } - - protected Coverage typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Coverage)) - return false; - Coverage o = (Coverage) other; - return compareDeep(issuer, o.issuer, true) && compareDeep(bin, o.bin, true) && compareDeep(period, o.period, true) - && compareDeep(type, o.type, true) && compareDeep(planholder, o.planholder, true) && compareDeep(beneficiary, o.beneficiary, true) - && compareDeep(relationship, o.relationship, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(group, o.group, true) && compareDeep(plan, o.plan, true) && compareDeep(subPlan, o.subPlan, true) - && compareDeep(dependent, o.dependent, true) && compareDeep(sequence, o.sequence, true) && compareDeep(exception, o.exception, true) - && compareDeep(school, o.school, true) && compareDeep(network, o.network, true) && compareDeep(contract, o.contract, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Coverage)) - return false; - Coverage o = (Coverage) other; - return compareValues(bin, o.bin, true) && compareValues(group, o.group, true) && compareValues(plan, o.plan, true) - && compareValues(subPlan, o.subPlan, true) && compareValues(dependent, o.dependent, true) && compareValues(sequence, o.sequence, true) - && compareValues(school, o.school, true) && compareValues(network, o.network, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (issuer == null || issuer.isEmpty()) && (bin == null || bin.isEmpty()) - && (period == null || period.isEmpty()) && (type == null || type.isEmpty()) && (planholder == null || planholder.isEmpty()) - && (beneficiary == null || beneficiary.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) && (plan == null || plan.isEmpty()) - && (subPlan == null || subPlan.isEmpty()) && (dependent == null || dependent.isEmpty()) && (sequence == null || sequence.isEmpty()) - && (exception == null || exception.isEmpty()) && (school == null || school.isEmpty()) && (network == null || network.isEmpty()) - && (contract == null || contract.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Coverage; - } - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam DEPENDENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DEPENDENT); - - /** - * Search parameter: beneficiaryreference - *

- * Description: Covered party
- * Type: reference
- * Path: Coverage.beneficiaryReference
- *

- */ - @SearchParamDefinition(name="beneficiaryreference", path="Coverage.beneficiary.as(Reference)", description="Covered party", type="reference" ) - public static final String SP_BENEFICIARYREFERENCE = "beneficiaryreference"; - /** - * Fluent Client search parameter constant for beneficiaryreference - *

- * Description: Covered party
- * Type: reference
- * Path: Coverage.beneficiaryReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BENEFICIARYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BENEFICIARYREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Coverage:beneficiaryreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_BENEFICIARYREFERENCE = new ca.uhn.fhir.model.api.Include("Coverage:beneficiaryreference").toLocked(); - - /** - * Search parameter: planholderidentifier - *

- * Description: Reference to the planholder
- * Type: token
- * Path: Coverage.planholderIdentifier
- *

- */ - @SearchParamDefinition(name="planholderidentifier", path="Coverage.planholder.as(Identifier)", description="Reference to the planholder", type="token" ) - public static final String SP_PLANHOLDERIDENTIFIER = "planholderidentifier"; - /** - * Fluent Client search parameter constant for planholderidentifier - *

- * Description: Reference to the planholder
- * Type: token
- * Path: Coverage.planholderIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PLANHOLDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PLANHOLDERIDENTIFIER); - - /** - * Search parameter: type - *

- * Description: The kind of coverage (health plan, auto, Workers Compensation)
- * Type: token
- * Path: Coverage.type
- *

- */ - @SearchParamDefinition(name="type", path="Coverage.type", description="The kind of coverage (health plan, auto, Workers Compensation)", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: The kind of coverage (health plan, auto, Workers Compensation)
- * Type: token
- * Path: Coverage.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: issueridentifier - *

- * Description: The identity of the insurer
- * Type: token
- * Path: Coverage.issuerIdentifier
- *

- */ - @SearchParamDefinition(name="issueridentifier", path="Coverage.issuer.as(Identifier)", description="The identity of the insurer", type="token" ) - public static final String SP_ISSUERIDENTIFIER = "issueridentifier"; - /** - * Fluent Client search parameter constant for issueridentifier - *

- * Description: The identity of the insurer
- * Type: token
- * Path: Coverage.issuerIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ISSUERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ISSUERIDENTIFIER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam SUBPLAN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBPLAN); - - /** - * Search parameter: issuerreference - *

- * Description: The identity of the insurer
- * Type: reference
- * Path: Coverage.issuerReference
- *

- */ - @SearchParamDefinition(name="issuerreference", path="Coverage.issuer.as(Reference)", description="The identity of the insurer", type="reference" ) - public static final String SP_ISSUERREFERENCE = "issuerreference"; - /** - * Fluent Client search parameter constant for issuerreference - *

- * Description: The identity of the insurer
- * Type: reference
- * Path: Coverage.issuerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ISSUERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ISSUERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Coverage:issuerreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ISSUERREFERENCE = new ca.uhn.fhir.model.api.Include("Coverage:issuerreference").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam PLAN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PLAN); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam SEQUENCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SEQUENCE); - - /** - * Search parameter: beneficiaryidentifier - *

- * Description: Covered party
- * Type: token
- * Path: Coverage.beneficiaryIdentifier
- *

- */ - @SearchParamDefinition(name="beneficiaryidentifier", path="Coverage.beneficiary.as(Identifier)", description="Covered party", type="token" ) - public static final String SP_BENEFICIARYIDENTIFIER = "beneficiaryidentifier"; - /** - * Fluent Client search parameter constant for beneficiaryidentifier - *

- * Description: Covered party
- * Type: token
- * Path: Coverage.beneficiaryIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BENEFICIARYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BENEFICIARYIDENTIFIER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam GROUP = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GROUP); - - /** - * Search parameter: planholderreference - *

- * Description: Reference to the planholder
- * Type: reference
- * Path: Coverage.planholderReference
- *

- */ - @SearchParamDefinition(name="planholderreference", path="Coverage.planholder.as(Reference)", description="Reference to the planholder", type="reference" ) - public static final String SP_PLANHOLDERREFERENCE = "planholderreference"; - /** - * Fluent Client search parameter constant for planholderreference - *

- * Description: Reference to the planholder
- * Type: reference
- * Path: Coverage.planholderReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PLANHOLDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PLANHOLDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Coverage:planholderreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PLANHOLDERREFERENCE = new ca.uhn.fhir.model.api.Include("Coverage:planholderreference").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The primary identifier of the insured and the coverage
- * Type: token
- * Path: Coverage.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Coverage.identifier", description="The primary identifier of the insured and the coverage", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The primary identifier of the insured and the coverage
- * Type: token
- * Path: Coverage.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DataElement.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DataElement.java deleted file mode 100644 index 45043ebf7a6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DataElement.java +++ /dev/null @@ -1,2046 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The formal description of a single piece of information that can be gathered and reported. - */ -@ResourceDef(name="DataElement", profile="http://hl7.org/fhir/Profile/DataElement") -public class DataElement extends DomainResource { - - public enum DataElementStringency { - /** - * The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required). - */ - COMPARABLE, - /** - * The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully comparable. - */ - FULLYSPECIFIED, - /** - * The data element allows multiple units of measure having equivalent meaning; e.g. "cc" (cubic centimeter) and "mL" (milliliter). - */ - EQUIVALENT, - /** - * The data element allows multiple units of measure that are convertable between each other (e.g. inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning. - */ - CONVERTABLE, - /** - * A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg. - */ - SCALEABLE, - /** - * The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible. - */ - FLEXIBLE, - /** - * added to help the parsers - */ - NULL; - public static DataElementStringency fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("comparable".equals(codeString)) - return COMPARABLE; - if ("fully-specified".equals(codeString)) - return FULLYSPECIFIED; - if ("equivalent".equals(codeString)) - return EQUIVALENT; - if ("convertable".equals(codeString)) - return CONVERTABLE; - if ("scaleable".equals(codeString)) - return SCALEABLE; - if ("flexible".equals(codeString)) - return FLEXIBLE; - throw new FHIRException("Unknown DataElementStringency code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPARABLE: return "comparable"; - case FULLYSPECIFIED: return "fully-specified"; - case EQUIVALENT: return "equivalent"; - case CONVERTABLE: return "convertable"; - case SCALEABLE: return "scaleable"; - case FLEXIBLE: return "flexible"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPARABLE: return "http://hl7.org/fhir/dataelement-stringency"; - case FULLYSPECIFIED: return "http://hl7.org/fhir/dataelement-stringency"; - case EQUIVALENT: return "http://hl7.org/fhir/dataelement-stringency"; - case CONVERTABLE: return "http://hl7.org/fhir/dataelement-stringency"; - case SCALEABLE: return "http://hl7.org/fhir/dataelement-stringency"; - case FLEXIBLE: return "http://hl7.org/fhir/dataelement-stringency"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPARABLE: return "The data element is sufficiently well-constrained that multiple pieces of data captured according to the constraints of the data element will be comparable (though in some cases, a degree of automated conversion/normalization may be required)."; - case FULLYSPECIFIED: return "The data element is fully specified down to a single value set, single unit of measure, single data type, etc. Multiple pieces of data associated with this data element are fully comparable."; - case EQUIVALENT: return "The data element allows multiple units of measure having equivalent meaning; e.g. \"cc\" (cubic centimeter) and \"mL\" (milliliter)."; - case CONVERTABLE: return "The data element allows multiple units of measure that are convertable between each other (e.g. inches and centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing conversion of meaning."; - case SCALEABLE: return "A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg."; - case FLEXIBLE: return "The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated comparison of data captured using the data element is not possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPARABLE: return "Comparable"; - case FULLYSPECIFIED: return "Fully Specified"; - case EQUIVALENT: return "Equivalent"; - case CONVERTABLE: return "Convertable"; - case SCALEABLE: return "Scaleable"; - case FLEXIBLE: return "Flexible"; - default: return "?"; - } - } - } - - public static class DataElementStringencyEnumFactory implements EnumFactory { - public DataElementStringency fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("comparable".equals(codeString)) - return DataElementStringency.COMPARABLE; - if ("fully-specified".equals(codeString)) - return DataElementStringency.FULLYSPECIFIED; - if ("equivalent".equals(codeString)) - return DataElementStringency.EQUIVALENT; - if ("convertable".equals(codeString)) - return DataElementStringency.CONVERTABLE; - if ("scaleable".equals(codeString)) - return DataElementStringency.SCALEABLE; - if ("flexible".equals(codeString)) - return DataElementStringency.FLEXIBLE; - throw new IllegalArgumentException("Unknown DataElementStringency code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("comparable".equals(codeString)) - return new Enumeration(this, DataElementStringency.COMPARABLE); - if ("fully-specified".equals(codeString)) - return new Enumeration(this, DataElementStringency.FULLYSPECIFIED); - if ("equivalent".equals(codeString)) - return new Enumeration(this, DataElementStringency.EQUIVALENT); - if ("convertable".equals(codeString)) - return new Enumeration(this, DataElementStringency.CONVERTABLE); - if ("scaleable".equals(codeString)) - return new Enumeration(this, DataElementStringency.SCALEABLE); - if ("flexible".equals(codeString)) - return new Enumeration(this, DataElementStringency.FLEXIBLE); - throw new FHIRException("Unknown DataElementStringency code '"+codeString+"'"); - } - public String toCode(DataElementStringency code) { - if (code == DataElementStringency.COMPARABLE) - return "comparable"; - if (code == DataElementStringency.FULLYSPECIFIED) - return "fully-specified"; - if (code == DataElementStringency.EQUIVALENT) - return "equivalent"; - if (code == DataElementStringency.CONVERTABLE) - return "convertable"; - if (code == DataElementStringency.SCALEABLE) - return "scaleable"; - if (code == DataElementStringency.FLEXIBLE) - return "flexible"; - return "?"; - } - public String toSystem(DataElementStringency code) { - return code.getSystem(); - } - } - - @Block() - public static class DataElementContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the data element. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the data element." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public DataElementContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the data element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElementContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the data element. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the data element. - */ - public DataElementContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public DataElementContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the data element.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public DataElementContactComponent copy() { - DataElementContactComponent dst = new DataElementContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataElementContactComponent)) - return false; - DataElementContactComponent o = (DataElementContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataElementContactComponent)) - return false; - DataElementContactComponent o = (DataElementContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "DataElement.contact"; - - } - - } - - @Block() - public static class DataElementMappingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. - */ - @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis." ) - protected IdType identity; - - /** - * An absolute URI that identifies the specification that this mapping is expressed to. - */ - @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) - protected UriType uri; - - /** - * A name for the specification that is being mapped to. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) - protected StringType name; - - /** - * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - @Child(name = "comment", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Versions, Issues, Scope limitations etc.", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) - protected StringType comment; - - private static final long serialVersionUID = 9610265L; - - /** - * Constructor - */ - public DataElementMappingComponent() { - super(); - } - - /** - * Constructor - */ - public DataElementMappingComponent(IdType identity) { - super(); - this.identity = identity; - } - - /** - * @return {@link #identity} (An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); // bb - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public DataElementMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis. - */ - public DataElementMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); // bb - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public DataElementMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return An absolute URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value An absolute URI that identifies the specification that this mapping is expressed to. - */ - public DataElementMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElementMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public DataElementMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElementMappingComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public DataElementMappingComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public DataElementMappingComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An internal id that is used to identify this mapping set when specific mappings are made on a per-element basis.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); - childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("comment", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType - case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -135761730: // identity - this.identity = castToId(value); // IdType - break; - case 116076: // uri - this.uri = castToUri(value); // UriType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identity")) - this.identity = castToId(value); // IdType - else if (name.equals("uri")) - this.uri = castToUri(value); // UriType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -135761730: throw new FHIRException("Cannot make property identity as it is not a complex type"); // IdType - case 116076: throw new FHIRException("Cannot make property uri as it is not a complex type"); // UriType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identity")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.identity"); - } - else if (name.equals("uri")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.uri"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.name"); - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.comment"); - } - else - return super.addChild(name); - } - - public DataElementMappingComponent copy() { - DataElementMappingComponent dst = new DataElementMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.uri = uri == null ? null : uri.copy(); - dst.name = name == null ? null : name.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataElementMappingComponent)) - return false; - DataElementMappingComponent o = (DataElementMappingComponent) other; - return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) - && compareDeep(comment, o.comment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataElementMappingComponent)) - return false; - DataElementMappingComponent o = (DataElementMappingComponent) other; - return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) - && compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) - && (name == null || name.isEmpty()) && (comment == null || comment.isEmpty()); - } - - public String fhirType() { - return "DataElement.mapping"; - - } - - } - - /** - * An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Globally unique logical id for data element", formalDefinition="An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Logical id to reference this data element", formalDefinition="Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected List identifier; - - /** - * The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id for this version of the data element", formalDefinition="The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually." ) - protected StringType version; - - /** - * The status of the data element. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the data element." ) - protected Enumeration status; - - /** - * A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the data element. - */ - @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the data element." ) - protected StringType publisher; - - /** - * The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for this version of the data element", formalDefinition="The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes." ) - protected DateTimeType date; - - /** - * The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - @Child(name = "name", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Descriptive label for this element definition", formalDefinition="The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used." ) - protected StringType name; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions." ) - protected List useContext; - - /** - * A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. - */ - @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element." ) - protected StringType copyright; - - /** - * Identifies how precise the data element is in its definition. - */ - @Child(name = "stringency", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="comparable | fully-specified | equivalent | convertable | scaleable | flexible", formalDefinition="Identifies how precise the data element is in its definition." ) - protected Enumeration stringency; - - /** - * Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with. - */ - @Child(name = "mapping", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="External specification mapped to", formalDefinition="Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with." ) - protected List mapping; - - /** - * Defines the structure, type, allowed values and other constraining characteristics of the data element. - */ - @Child(name = "element", type = {ElementDefinition.class}, order=13, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Definition of element", formalDefinition="Defines the structure, type, allowed values and other constraining characteristics of the data element." ) - protected List element; - - private static final long serialVersionUID = 411433995L; - - /** - * Constructor - */ - public DataElement() { - super(); - } - - /** - * Constructor - */ - public DataElement(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public DataElement setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published. - */ - public DataElement setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DataElement addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public DataElement setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually. - */ - public DataElement setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the data element.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DataElement setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the data element. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the data element. - */ - public DataElement setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public DataElement setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public DataElement setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the data element.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public DataElement setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the data element. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the data element. - */ - public DataElement setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DataElement setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes. - */ - public DataElement setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public DataElement setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used. - */ - public DataElement setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (DataElementContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public DataElementContactComponent addContact() { //3 - DataElementContactComponent t = new DataElementContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public DataElement addContact(DataElementContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public DataElement addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public DataElement setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element. - */ - public DataElement setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #stringency} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getStringency" gives direct access to the value - */ - public Enumeration getStringencyElement() { - if (this.stringency == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataElement.stringency"); - else if (Configuration.doAutoCreate()) - this.stringency = new Enumeration(new DataElementStringencyEnumFactory()); // bb - return this.stringency; - } - - public boolean hasStringencyElement() { - return this.stringency != null && !this.stringency.isEmpty(); - } - - public boolean hasStringency() { - return this.stringency != null && !this.stringency.isEmpty(); - } - - /** - * @param value {@link #stringency} (Identifies how precise the data element is in its definition.). This is the underlying object with id, value and extensions. The accessor "getStringency" gives direct access to the value - */ - public DataElement setStringencyElement(Enumeration value) { - this.stringency = value; - return this; - } - - /** - * @return Identifies how precise the data element is in its definition. - */ - public DataElementStringency getStringency() { - return this.stringency == null ? null : this.stringency.getValue(); - } - - /** - * @param value Identifies how precise the data element is in its definition. - */ - public DataElement setStringency(DataElementStringency value) { - if (value == null) - this.stringency = null; - else { - if (this.stringency == null) - this.stringency = new Enumeration(new DataElementStringencyEnumFactory()); - this.stringency.setValue(value); - } - return this; - } - - /** - * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (DataElementMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.) - */ - // syntactic sugar - public DataElementMappingComponent addMapping() { //3 - DataElementMappingComponent t = new DataElementMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - // syntactic sugar - public DataElement addMapping(DataElementMappingComponent t) { //3 - if (t == null) - return this; - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return this; - } - - /** - * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Defines the structure, type, allowed values and other constraining characteristics of the data element.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public DataElement addElement(ElementDefinition t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this data element when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this data element is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this data element when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the data element when it is referenced in a StructureDefinition, Questionnaire or instance. This is an arbitrary value managed by the definition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("status", "code", "The status of the data element.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search data element definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the data element.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("date", "dateTime", "The date this version of the data element was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the data element changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("name", "string", "The term used by humans to refer to the data element. Should ideally be unique within the context in which the data element is expected to be used.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of data element definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the definition of the data element. Copyright statements are generally legal restrictions on the use and publishing of the details of the definition of the data element.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("stringency", "code", "Identifies how precise the data element is in its definition.", 0, java.lang.Integer.MAX_VALUE, stringency)); - childrenList.add(new Property("mapping", "", "Identifies a specification (other than a terminology) that the elements which make up the DataElement have some correspondence with.", 0, java.lang.Integer.MAX_VALUE, mapping)); - childrenList.add(new Property("element", "ElementDefinition", "Defines the structure, type, allowed values and other constraining characteristics of the data element.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // DataElementContactComponent - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case -1572568464: /*stringency*/ return this.stringency == null ? new Base[0] : new Base[] {this.stringency}; // Enumeration - case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // DataElementMappingComponent - case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((DataElementContactComponent) value); // DataElementContactComponent - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case -1572568464: // stringency - this.stringency = new DataElementStringencyEnumFactory().fromType(value); // Enumeration - break; - case 837556430: // mapping - this.getMapping().add((DataElementMappingComponent) value); // DataElementMappingComponent - break; - case -1662836996: // element - this.getElement().add(castToElementDefinition(value)); // ElementDefinition - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((DataElementContactComponent) value); - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("stringency")) - this.stringency = new DataElementStringencyEnumFactory().fromType(value); // Enumeration - else if (name.equals("mapping")) - this.getMapping().add((DataElementMappingComponent) value); - else if (name.equals("element")) - this.getElement().add(castToElementDefinition(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return addIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 951526432: return addContact(); // DataElementContactComponent - case -669707736: return addUseContext(); // CodeableConcept - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case -1572568464: throw new FHIRException("Cannot make property stringency as it is not a complex type"); // Enumeration - case 837556430: return addMapping(); // DataElementMappingComponent - case -1662836996: return addElement(); // ElementDefinition - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.url"); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.version"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.publisher"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.date"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.name"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.copyright"); - } - else if (name.equals("stringency")) { - throw new FHIRException("Cannot call addChild on a primitive type DataElement.stringency"); - } - else if (name.equals("mapping")) { - return addMapping(); - } - else if (name.equals("element")) { - return addElement(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DataElement"; - - } - - public DataElement copy() { - DataElement dst = new DataElement(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - dst.date = date == null ? null : date.copy(); - dst.name = name == null ? null : name.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (DataElementContactComponent i : contact) - dst.contact.add(i.copy()); - }; - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.copyright = copyright == null ? null : copyright.copy(); - dst.stringency = stringency == null ? null : stringency.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (DataElementMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - protected DataElement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataElement)) - return false; - DataElement o = (DataElement) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(date, o.date, true) && compareDeep(name, o.name, true) && compareDeep(contact, o.contact, true) - && compareDeep(useContext, o.useContext, true) && compareDeep(copyright, o.copyright, true) && compareDeep(stringency, o.stringency, true) - && compareDeep(mapping, o.mapping, true) && compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataElement)) - return false; - DataElement o = (DataElement) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(status, o.status, true) - && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(name, o.name, true) && compareValues(copyright, o.copyright, true) - && compareValues(stringency, o.stringency, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (date == null || date.isEmpty()) && (name == null || name.isEmpty()) - && (contact == null || contact.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (stringency == null || stringency.isEmpty()) - && (mapping == null || mapping.isEmpty()) && (element == null || element.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DataElement; - } - - /** - * Search parameter: stringency - *

- * Description: The stringency of the data element definition
- * Type: token
- * Path: DataElement.stringency
- *

- */ - @SearchParamDefinition(name="stringency", path="DataElement.stringency", description="The stringency of the data element definition", type="token" ) - public static final String SP_STRINGENCY = "stringency"; - /** - * Fluent Client search parameter constant for stringency - *

- * Description: The stringency of the data element definition
- * Type: token
- * Path: DataElement.stringency
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STRINGENCY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STRINGENCY); - - /** - * Search parameter: status - *

- * Description: The current status of the data element
- * Type: token
- * Path: DataElement.status
- *

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

- * Description: The current status of the data element
- * Type: token
- * Path: DataElement.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.
- * Type: string
- * Path: DataElement.element.definition
- *

- */ - @SearchParamDefinition(name="description", path="DataElement.element.definition", description="Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search in the description of the data element. This corresponds to the definition of the first DataElement.element.
- * Type: string
- * Path: DataElement.element.definition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: Name of the data element
- * Type: string
- * Path: DataElement.name
- *

- */ - @SearchParamDefinition(name="name", path="DataElement.name", description="Name of the data element", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Name of the data element
- * Type: string
- * Path: DataElement.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the data element
- * Type: token
- * Path: DataElement.useContext
- *

- */ - @SearchParamDefinition(name="context", path="DataElement.useContext", description="A use context assigned to the data element", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the data element
- * Type: token
- * Path: DataElement.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: code - *

- * Description: A code for the data element (server may choose to do subsumption)
- * Type: token
- * Path: DataElement.element.code
- *

- */ - @SearchParamDefinition(name="code", path="DataElement.element.code", description="A code for the data element (server may choose to do subsumption)", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: A code for the data element (server may choose to do subsumption)
- * Type: token
- * Path: DataElement.element.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: The data element publication date
- * Type: date
- * Path: DataElement.date
- *

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

- * Description: The data element publication date
- * Type: date
- * Path: DataElement.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: The identifier of the data element
- * Type: token
- * Path: DataElement.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DataElement.identifier", description="The identifier of the data element", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identifier of the data element
- * Type: token
- * Path: DataElement.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: url - *

- * Description: The official URL for the data element
- * Type: uri
- * Path: DataElement.url
- *

- */ - @SearchParamDefinition(name="url", path="DataElement.url", description="The official URL for the data element", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The official URL for the data element
- * Type: uri
- * Path: DataElement.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher of the data element
- * Type: string
- * Path: DataElement.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="DataElement.publisher", description="Name of the publisher of the data element", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher of the data element
- * Type: string
- * Path: DataElement.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: version - *

- * Description: The version identifier of the data element
- * Type: string
- * Path: DataElement.version
- *

- */ - @SearchParamDefinition(name="version", path="DataElement.version", description="The version identifier of the data element", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: The version identifier of the data element
- * Type: string
- * Path: DataElement.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DataRequirement.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DataRequirement.java deleted file mode 100644 index 977a7a2bcbb..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DataRequirement.java +++ /dev/null @@ -1,1153 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. - */ -@DatatypeDef(name="DataRequirement") -public class DataRequirement extends Type implements ICompositeType { - - @Block() - public static class DataRequirementCodeFilterComponent extends Element implements IBaseDatatypeElement { - /** - * The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. - */ - @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The code-valued attribute of the filter", formalDefinition="The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept." ) - protected StringType path; - - /** - * The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset. - */ - @Child(name = "valueSet", type = {StringType.class, ValueSet.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Valueset for the filter", formalDefinition="The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset." ) - protected Type valueSet; - - /** - * The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes. - */ - @Child(name = "valueCode", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Code value of the filter", formalDefinition="The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes." ) - protected List valueCode; - - /** - * The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings. - */ - @Child(name = "valueCoding", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Coding value of the filter", formalDefinition="The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings." ) - protected List valueCoding; - - /** - * The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts. - */ - @Child(name = "valueCodeableConcept", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="CodeableConcept value of the filter", formalDefinition="The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts." ) - protected List valueCodeableConcept; - - private static final long serialVersionUID = -888422840L; - - /** - * Constructor - */ - public DataRequirementCodeFilterComponent() { - super(); - } - - /** - * Constructor - */ - public DataRequirementCodeFilterComponent(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataRequirementCodeFilterComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public DataRequirementCodeFilterComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. - */ - public DataRequirementCodeFilterComponent setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public Type getValueSet() { - return this.valueSet; - } - - /** - * @return {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public StringType getValueSetStringType() throws FHIRException { - if (!(this.valueSet instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (StringType) this.valueSet; - } - - public boolean hasValueSetStringType() { - return this.valueSet instanceof StringType; - } - - /** - * @return {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public Reference getValueSetReference() throws FHIRException { - if (!(this.valueSet instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (Reference) this.valueSet; - } - - public boolean hasValueSetReference() { - return this.valueSet instanceof Reference; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public DataRequirementCodeFilterComponent setValueSet(Type value) { - this.valueSet = value; - return this; - } - - /** - * @return {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) - */ - public List getValueCode() { - if (this.valueCode == null) - this.valueCode = new ArrayList(); - return this.valueCode; - } - - public boolean hasValueCode() { - if (this.valueCode == null) - return false; - for (CodeType item : this.valueCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) - */ - // syntactic sugar - public CodeType addValueCodeElement() {//2 - CodeType t = new CodeType(); - if (this.valueCode == null) - this.valueCode = new ArrayList(); - this.valueCode.add(t); - return t; - } - - /** - * @param value {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) - */ - public DataRequirementCodeFilterComponent addValueCode(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.valueCode == null) - this.valueCode = new ArrayList(); - this.valueCode.add(t); - return this; - } - - /** - * @param value {@link #valueCode} (The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.) - */ - public boolean hasValueCode(String value) { - if (this.valueCode == null) - return false; - for (CodeType v : this.valueCode) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #valueCoding} (The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.) - */ - public List getValueCoding() { - if (this.valueCoding == null) - this.valueCoding = new ArrayList(); - return this.valueCoding; - } - - public boolean hasValueCoding() { - if (this.valueCoding == null) - return false; - for (Coding item : this.valueCoding) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueCoding} (The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.) - */ - // syntactic sugar - public Coding addValueCoding() { //3 - Coding t = new Coding(); - if (this.valueCoding == null) - this.valueCoding = new ArrayList(); - this.valueCoding.add(t); - return t; - } - - // syntactic sugar - public DataRequirementCodeFilterComponent addValueCoding(Coding t) { //3 - if (t == null) - return this; - if (this.valueCoding == null) - this.valueCoding = new ArrayList(); - this.valueCoding.add(t); - return this; - } - - /** - * @return {@link #valueCodeableConcept} (The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.) - */ - public List getValueCodeableConcept() { - if (this.valueCodeableConcept == null) - this.valueCodeableConcept = new ArrayList(); - return this.valueCodeableConcept; - } - - public boolean hasValueCodeableConcept() { - if (this.valueCodeableConcept == null) - return false; - for (CodeableConcept item : this.valueCodeableConcept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueCodeableConcept} (The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.) - */ - // syntactic sugar - public CodeableConcept addValueCodeableConcept() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.valueCodeableConcept == null) - this.valueCodeableConcept = new ArrayList(); - this.valueCodeableConcept.add(t); - return t; - } - - // syntactic sugar - public DataRequirementCodeFilterComponent addValueCodeableConcept(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.valueCodeableConcept == null) - this.valueCodeableConcept = new ArrayList(); - this.valueCodeableConcept.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("valueSet[x]", "string|Reference(ValueSet)", "The valueset for the code filter. The valueSet and value elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - childrenList.add(new Property("valueCode", "code", "The codes for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codes.", 0, java.lang.Integer.MAX_VALUE, valueCode)); - childrenList.add(new Property("valueCoding", "Coding", "The Codings for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified Codings.", 0, java.lang.Integer.MAX_VALUE, valueCoding)); - childrenList.add(new Property("valueCodeableConcept", "CodeableConcept", "The CodeableConcepts for the code filter. Only one of valueSet, valueCode, valueConding, or valueCodeableConcept may be specified. If values are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified CodeableConcepts.", 0, java.lang.Integer.MAX_VALUE, valueCodeableConcept)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type - case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // CodeType - case -1887705029: /*valueCoding*/ return this.valueCoding == null ? new Base[0] : this.valueCoding.toArray(new Base[this.valueCoding.size()]); // Coding - case 924902896: /*valueCodeableConcept*/ return this.valueCodeableConcept == null ? new Base[0] : this.valueCodeableConcept.toArray(new Base[this.valueCodeableConcept.size()]); // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case -1410174671: // valueSet - this.valueSet = (Type) value; // Type - break; - case -766209282: // valueCode - this.getValueCode().add(castToCode(value)); // CodeType - break; - case -1887705029: // valueCoding - this.getValueCoding().add(castToCoding(value)); // Coding - break; - case 924902896: // valueCodeableConcept - this.getValueCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("valueSet[x]")) - this.valueSet = (Type) value; // Type - else if (name.equals("valueCode")) - this.getValueCode().add(castToCode(value)); - else if (name.equals("valueCoding")) - this.getValueCoding().add(castToCoding(value)); - else if (name.equals("valueCodeableConcept")) - this.getValueCodeableConcept().add(castToCodeableConcept(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -1438410321: return getValueSet(); // Type - case -766209282: throw new FHIRException("Cannot make property valueCode as it is not a complex type"); // CodeType - case -1887705029: return addValueCoding(); // Coding - case 924902896: return addValueCodeableConcept(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.path"); - } - else if (name.equals("valueSetString")) { - this.valueSet = new StringType(); - return this.valueSet; - } - else if (name.equals("valueSetReference")) { - this.valueSet = new Reference(); - return this.valueSet; - } - else if (name.equals("valueCode")) { - throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.valueCode"); - } - else if (name.equals("valueCoding")) { - return addValueCoding(); - } - else if (name.equals("valueCodeableConcept")) { - return addValueCodeableConcept(); - } - else - return super.addChild(name); - } - - public DataRequirementCodeFilterComponent copy() { - DataRequirementCodeFilterComponent dst = new DataRequirementCodeFilterComponent(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - if (valueCode != null) { - dst.valueCode = new ArrayList(); - for (CodeType i : valueCode) - dst.valueCode.add(i.copy()); - }; - if (valueCoding != null) { - dst.valueCoding = new ArrayList(); - for (Coding i : valueCoding) - dst.valueCoding.add(i.copy()); - }; - if (valueCodeableConcept != null) { - dst.valueCodeableConcept = new ArrayList(); - for (CodeableConcept i : valueCodeableConcept) - dst.valueCodeableConcept.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataRequirementCodeFilterComponent)) - return false; - DataRequirementCodeFilterComponent o = (DataRequirementCodeFilterComponent) other; - return compareDeep(path, o.path, true) && compareDeep(valueSet, o.valueSet, true) && compareDeep(valueCode, o.valueCode, true) - && compareDeep(valueCoding, o.valueCoding, true) && compareDeep(valueCodeableConcept, o.valueCodeableConcept, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataRequirementCodeFilterComponent)) - return false; - DataRequirementCodeFilterComponent o = (DataRequirementCodeFilterComponent) other; - return compareValues(path, o.path, true) && compareValues(valueCode, o.valueCode, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (valueSet == null || valueSet.isEmpty()) - && (valueCode == null || valueCode.isEmpty()) && (valueCoding == null || valueCoding.isEmpty()) - && (valueCodeableConcept == null || valueCodeableConcept.isEmpty()); - } - - public String fhirType() { - return "DataRequirement.codeFilter"; - - } - - } - - @Block() - public static class DataRequirementDateFilterComponent extends Element implements IBaseDatatypeElement { - /** - * The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. - */ - @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The date-valued attribute of the filter", formalDefinition="The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing." ) - protected StringType path; - - /** - * The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. - */ - @Child(name = "value", type = {DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The value of the filter, as a Period or dateTime value", formalDefinition="The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime." ) - protected Type value; - - private static final long serialVersionUID = 1791957163L; - - /** - * Constructor - */ - public DataRequirementDateFilterComponent() { - super(); - } - - /** - * Constructor - */ - public DataRequirementDateFilterComponent(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataRequirementDateFilterComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public DataRequirementDateFilterComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. - */ - public DataRequirementDateFilterComponent setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public DateTimeType getValueDateTimeType() throws FHIRException { - if (!(this.value instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - public boolean hasValueDateTimeType() { - return this.value instanceof DateTimeType; - } - - /** - * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public Period getValuePeriod() throws FHIRException { - if (!(this.value instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Period) this.value; - } - - public boolean hasValuePeriod() { - return this.value instanceof Period; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public DataRequirementDateFilterComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("value[x]", "dateTime|Period", "The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.path"); - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else - return super.addChild(name); - } - - public DataRequirementDateFilterComponent copy() { - DataRequirementDateFilterComponent dst = new DataRequirementDateFilterComponent(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataRequirementDateFilterComponent)) - return false; - DataRequirementDateFilterComponent o = (DataRequirementDateFilterComponent) other; - return compareDeep(path, o.path, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataRequirementDateFilterComponent)) - return false; - DataRequirementDateFilterComponent o = (DataRequirementDateFilterComponent) other; - return compareValues(path, o.path, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "DataRequirement.dateFilter"; - - } - - } - - /** - * The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The type of the required data", formalDefinition="The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile." ) - protected CodeType type; - - /** - * The profile of the required data, specified as the uri of the profile definition. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The profile of the required data", formalDefinition="The profile of the required data, specified as the uri of the profile definition." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (The profile of the required data, specified as the uri of the profile definition.) - */ - protected StructureDefinition profileTarget; - - /** - * Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. - */ - @Child(name = "mustSupport", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Indicates that specific structure elements are referenced by the knowledge module", formalDefinition="Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available." ) - protected List mustSupport; - - /** - * Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data. - */ - @Child(name = "codeFilter", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Code filters for the data", formalDefinition="Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data." ) - protected List codeFilter; - - /** - * Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. - */ - @Child(name = "dateFilter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Date filters for the data", formalDefinition="Date filters specify additional constraints on the data in terms of the applicable date range for specific elements." ) - protected List dateFilter; - - private static final long serialVersionUID = 1768899744L; - - /** - * Constructor - */ - public DataRequirement() { - super(); - } - - /** - * Constructor - */ - public DataRequirement(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataRequirement.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public DataRequirement setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - */ - public DataRequirement setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataRequirement.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) - */ - public DataRequirement setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The profile of the required data, specified as the uri of the profile definition.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DataRequirement.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The profile of the required data, specified as the uri of the profile definition.) - */ - public DataRequirement setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - public List getMustSupport() { - if (this.mustSupport == null) - this.mustSupport = new ArrayList(); - return this.mustSupport; - } - - public boolean hasMustSupport() { - if (this.mustSupport == null) - return false; - for (StringType item : this.mustSupport) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - // syntactic sugar - public StringType addMustSupportElement() {//2 - StringType t = new StringType(); - if (this.mustSupport == null) - this.mustSupport = new ArrayList(); - this.mustSupport.add(t); - return t; - } - - /** - * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - public DataRequirement addMustSupport(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.mustSupport == null) - this.mustSupport = new ArrayList(); - this.mustSupport.add(t); - return this; - } - - /** - * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - public boolean hasMustSupport(String value) { - if (this.mustSupport == null) - return false; - for (StringType v : this.mustSupport) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #codeFilter} (Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.) - */ - public List getCodeFilter() { - if (this.codeFilter == null) - this.codeFilter = new ArrayList(); - return this.codeFilter; - } - - public boolean hasCodeFilter() { - if (this.codeFilter == null) - return false; - for (DataRequirementCodeFilterComponent item : this.codeFilter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeFilter} (Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.) - */ - // syntactic sugar - public DataRequirementCodeFilterComponent addCodeFilter() { //3 - DataRequirementCodeFilterComponent t = new DataRequirementCodeFilterComponent(); - if (this.codeFilter == null) - this.codeFilter = new ArrayList(); - this.codeFilter.add(t); - return t; - } - - // syntactic sugar - public DataRequirement addCodeFilter(DataRequirementCodeFilterComponent t) { //3 - if (t == null) - return this; - if (this.codeFilter == null) - this.codeFilter = new ArrayList(); - this.codeFilter.add(t); - return this; - } - - /** - * @return {@link #dateFilter} (Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.) - */ - public List getDateFilter() { - if (this.dateFilter == null) - this.dateFilter = new ArrayList(); - return this.dateFilter; - } - - public boolean hasDateFilter() { - if (this.dateFilter == null) - return false; - for (DataRequirementDateFilterComponent item : this.dateFilter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dateFilter} (Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.) - */ - // syntactic sugar - public DataRequirementDateFilterComponent addDateFilter() { //3 - DataRequirementDateFilterComponent t = new DataRequirementDateFilterComponent(); - if (this.dateFilter == null) - this.dateFilter = new ArrayList(); - this.dateFilter.add(t); - return t; - } - - // syntactic sugar - public DataRequirement addDateFilter(DataRequirementDateFilterComponent t) { //3 - if (t == null) - return this; - if (this.dateFilter == null) - this.dateFilter = new ArrayList(); - this.dateFilter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the required data, specified as the uri of the profile definition.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("mustSupport", "string", "Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); - childrenList.add(new Property("codeFilter", "", "Code filters specify additional constraints on the data, specifying the value set of interest for a particular element of the data.", 0, java.lang.Integer.MAX_VALUE, codeFilter)); - childrenList.add(new Property("dateFilter", "", "Date filters specify additional constraints on the data in terms of the applicable date range for specific elements.", 0, java.lang.Integer.MAX_VALUE, dateFilter)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : this.mustSupport.toArray(new Base[this.mustSupport.size()]); // StringType - case -1303674939: /*codeFilter*/ return this.codeFilter == null ? new Base[0] : this.codeFilter.toArray(new Base[this.codeFilter.size()]); // DataRequirementCodeFilterComponent - case 149531846: /*dateFilter*/ return this.dateFilter == null ? new Base[0] : this.dateFilter.toArray(new Base[this.dateFilter.size()]); // DataRequirementDateFilterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - case -1402857082: // mustSupport - this.getMustSupport().add(castToString(value)); // StringType - break; - case -1303674939: // codeFilter - this.getCodeFilter().add((DataRequirementCodeFilterComponent) value); // DataRequirementCodeFilterComponent - break; - case 149531846: // dateFilter - this.getDateFilter().add((DataRequirementDateFilterComponent) value); // DataRequirementDateFilterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else if (name.equals("mustSupport")) - this.getMustSupport().add(castToString(value)); - else if (name.equals("codeFilter")) - this.getCodeFilter().add((DataRequirementCodeFilterComponent) value); - else if (name.equals("dateFilter")) - this.getDateFilter().add((DataRequirementDateFilterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return getProfile(); // Reference - case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // StringType - case -1303674939: return addCodeFilter(); // DataRequirementCodeFilterComponent - case 149531846: return addDateFilter(); // DataRequirementDateFilterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.type"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else if (name.equals("mustSupport")) { - throw new FHIRException("Cannot call addChild on a primitive type DataRequirement.mustSupport"); - } - else if (name.equals("codeFilter")) { - return addCodeFilter(); - } - else if (name.equals("dateFilter")) { - return addDateFilter(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DataRequirement"; - - } - - public DataRequirement copy() { - DataRequirement dst = new DataRequirement(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (mustSupport != null) { - dst.mustSupport = new ArrayList(); - for (StringType i : mustSupport) - dst.mustSupport.add(i.copy()); - }; - if (codeFilter != null) { - dst.codeFilter = new ArrayList(); - for (DataRequirementCodeFilterComponent i : codeFilter) - dst.codeFilter.add(i.copy()); - }; - if (dateFilter != null) { - dst.dateFilter = new ArrayList(); - for (DataRequirementDateFilterComponent i : dateFilter) - dst.dateFilter.add(i.copy()); - }; - return dst; - } - - protected DataRequirement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DataRequirement)) - return false; - DataRequirement o = (DataRequirement) other; - return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(mustSupport, o.mustSupport, true) - && compareDeep(codeFilter, o.codeFilter, true) && compareDeep(dateFilter, o.dateFilter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DataRequirement)) - return false; - DataRequirement o = (DataRequirement) other; - return compareValues(type, o.type, true) && compareValues(mustSupport, o.mustSupport, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) - && (mustSupport == null || mustSupport.isEmpty()) && (codeFilter == null || codeFilter.isEmpty()) - && (dateFilter == null || dateFilter.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DateTimeType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DateTimeType.java deleted file mode 100644 index f9d4b2e2e33..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DateTimeType.java +++ /dev/null @@ -1,196 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -package org.hl7.fhir.dstu2016may.model; - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; -import java.util.zip.DataFormatException; - -import org.apache.commons.lang3.time.DateUtils; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Represents a FHIR dateTime datatype. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ -@DatatypeDef(name = "dateTime") -public class DateTimeType extends BaseDateTimeType { - - private static final long serialVersionUID = 3L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.SECOND; - - /** - * Constructor - */ - public DateTimeType() { - super(); - } - - /** - * Create a new DateTimeDt with seconds precision and the local time zone - */ - public DateTimeType(Date theDate) { - super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); - } - - /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision) { - super(theDate, thePrecision, TimeZone.getDefault()); - } - - /** - * Create a new instance using a string date/time - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public DateTimeType(String theValue) { - super(theValue); - } - - /** - * Constructor which accepts a date value, precision value, and time zone. Valid precisions values for this type - * are: - *
    - *
  • {@link TemporalPrecisionEnum#YEAR} - *
  • {@link TemporalPrecisionEnum#MONTH} - *
  • {@link TemporalPrecisionEnum#DAY} - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ - public DateTimeType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { - super(theDate, thePrecision, theTimezone); - } - - /** - * Constructor - */ - public DateTimeType(Calendar theCalendar) { - if (theCalendar != null) { - setValue(theCalendar.getTime()); - setPrecision(DEFAULT_PRECISION); - setTimeZone(theCalendar.getTimeZone()); - } - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case YEAR: - case MONTH: - case DAY: - case SECOND: - case MILLI: - return true; - default: - return false; - } - } - - /** - * Returns a new instance of DateTimeType with the current system time and SECOND precision and the system local time - * zone - */ - public static DateTimeType now() { - return new DateTimeType(new Date(), TemporalPrecisionEnum.SECOND, TimeZone.getDefault()); - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - @Override - public DateTimeType copy() { - return new DateTimeType(getValueAsString()); - } - - /** - * Creates a new instance by parsing an HL7 v3 format date time string - */ - public static DateTimeType parseV3(String theV3String) { - DateTimeType retVal = new DateTimeType(); - retVal.setValueAsV3String(theV3String); - return retVal; - } - - public static DateTimeType today() { - DateTimeType retVal = now(); - retVal.setPrecision(TemporalPrecisionEnum.DAY); - return retVal; - } - - public boolean getTzSign() { - return getTimeZone().getRawOffset() >= 0; - } - - public int getTzHour() { - return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) / 60; - } - - public int getTzMin() { - return (int) (getTimeZone().getRawOffset() / DateUtils.MILLIS_PER_MINUTE) % 60; - } - - - public String fhirType() { - return "dateTime"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DateType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DateType.java deleted file mode 100644 index 32148c05b18..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DateType.java +++ /dev/null @@ -1,171 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -package org.hl7.fhir.dstu2016may.model; - -import java.util.Calendar; - -/** - * Primitive type "date" in FHIR: any day in a gregorian calendar - */ - -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Represents a FHIR date datatype. Valid precisions values for this type are: - *
    - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} - *
- */ -@DatatypeDef(name = "date") -public class DateType extends BaseDateTimeType { - - private static final long serialVersionUID = 3L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.DAY; - - /** - * Constructor - */ - public DateType() { - super(); - } - - /** - * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type - */ - public DateType(Date theDate) { - super(theDate, DEFAULT_PRECISION); - } - - /** - * Constructor which accepts a date value and a precision value. Valid precisions values for this type are: - *
    - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#YEAR} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#MONTH} - *
  • {@link ca.uhn.fhir.model.api.TemporalPrecisionEnum#DAY} - *
- * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the specified precision is not allowed for this type - */ - public DateType(Date theDate, TemporalPrecisionEnum thePrecision) { - super(theDate, thePrecision); - } - - /** - * Constructor which accepts a date as a string in FHIR format - * - * @throws ca.uhn.fhir.parser.DataFormatException - * If the precision in the date string is not allowed for this type - */ - public DateType(String theDate) { - super(theDate); - } - - /** - * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type. - */ - public DateType(Calendar theCalendar) { - super(theCalendar.getTime(), DEFAULT_PRECISION); - setTimeZone(theCalendar.getTimeZone()); - } - - /** - * Constructor which accepts a date value and uses the {@link #DEFAULT_PRECISION} for this type. - * - * @param theYear The year, e.g. 2015 - * @param theMonth The month, e.g. 0 for January - * @param theDay The day (1 indexed) e.g. 1 for the first day of the month - */ - public DateType(int theYear, int theMonth, int theDay) { - this(toCalendarZulu(theYear, theMonth, theDay)); - } - - private static GregorianCalendar toCalendarZulu(int theYear, int theMonth, int theDay) { - GregorianCalendar retVal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); - retVal.set(Calendar.YEAR, theYear); - retVal.set(Calendar.MONTH, theMonth); - retVal.set(Calendar.DATE, theDay); - return retVal; - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case YEAR: - case MONTH: - case DAY: - return true; - default: - return false; - } - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - @Override - public DateType copy() { - return new DateType(getValueAsString()); - } - - public static InstantType today() { - return new InstantType(new Date(), TemporalPrecisionEnum.DAY, TimeZone.getDefault()); - } - - /** - * Creates a new instance by parsing an HL7 v3 format date time string - */ - public static DateType parseV3(String theV3String) { - DateType retVal = new DateType(); - retVal.setValueAsV3String(theV3String); - return retVal; - } - - public String fhirType() { - return "date"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecimalType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecimalType.java deleted file mode 100644 index e8c934e6bb4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecimalType.java +++ /dev/null @@ -1,177 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -/** - * - */ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; -import java.math.MathContext; -import java.math.RoundingMode; - -import org.hl7.fhir.instance.model.api.IBaseDecimalDatatype; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "decimal" in FHIR: A rational number - */ -@DatatypeDef(name = "decimal") -public class DecimalType extends PrimitiveType implements Comparable, IBaseDecimalDatatype { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public DecimalType() { - super(); - } - - /** - * Constructor - */ - public DecimalType(BigDecimal theValue) { - setValue(theValue); - } - - /** - * Constructor - */ - public DecimalType(double theValue) { - // Use the valueOf here because the constructor gives wacky precision - // changes due to the floating point conversion - setValue(BigDecimal.valueOf(theValue)); - } - - /** - * Constructor - */ - public DecimalType(long theValue) { - setValue(new BigDecimal(theValue)); - } - - /** - * Constructor - */ - public DecimalType(String theValue) { - setValue(new BigDecimal(theValue)); - } - - @Override - public int compareTo(DecimalType theObj) { - if (getValue() == null && theObj.getValue() == null) { - return 0; - } - if (getValue() != null && theObj.getValue() == null) { - return 1; - } - if (getValue() == null && theObj.getValue() != null) { - return -1; - } - return getValue().compareTo(theObj.getValue()); - } - - @Override - protected String encode(BigDecimal theValue) { - return getValue().toPlainString(); - } - - /** - * Gets the value as an integer, using {@link BigDecimal#intValue()} - */ - public int getValueAsInteger() { - return getValue().intValue(); - } - - public Number getValueAsNumber() { - return getValue(); - } - - @Override - protected BigDecimal parse(String theValue) { - return new BigDecimal(theValue); - } - - /** - * Rounds the value to the given prevision - * - * @see MathContext#getPrecision() - */ - public void round(int thePrecision) { - if (getValue() != null) { - BigDecimal newValue = getValue().round(new MathContext(thePrecision)); - setValue(newValue); - } - } - - /** - * Rounds the value to the given prevision - * - * @see MathContext#getPrecision() - * @see MathContext#getRoundingMode() - */ - public void round(int thePrecision, RoundingMode theRoundingMode) { - if (getValue() != null) { - BigDecimal newValue = getValue().round(new MathContext(thePrecision, theRoundingMode)); - setValue(newValue); - } - } - - /** - * Sets a new value using an integer - */ - public void setValueAsInteger(int theValue) { - setValue(new BigDecimal(theValue)); - } - - /** - * Sets a new value using a long - */ - public void setValue(long theValue) { - setValue(new BigDecimal(theValue)); - } - - /** - * Sets a new value using a double - */ - public void setValue(double theValue) { - setValue(new BigDecimal(theValue)); - } - - @Override - public DecimalType copy() { - return new DecimalType(getValue()); - } - - public String fhirType() { - return "decimal"; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java deleted file mode 100644 index 5d01e848b0d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecisionSupportRule.java +++ /dev/null @@ -1,595 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. - */ -@ResourceDef(name="DecisionSupportRule", profile="http://hl7.org/fhir/Profile/DecisionSupportRule") -public class DecisionSupportRule extends DomainResource { - - /** - * The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence. - */ - @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Module information for the rule", formalDefinition="The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence." ) - protected ModuleMetadata moduleMetadata; - - /** - * A reference to a Library containing the formal logic used by the rule. - */ - @Child(name = "library", type = {Library.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Logic used within the rule", formalDefinition="A reference to a Library containing the formal logic used by the rule." ) - protected List library; - /** - * The actual objects that are the target of the reference (A reference to a Library containing the formal logic used by the rule.) - */ - protected List libraryTarget; - - - /** - * The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow. - */ - @Child(name = "trigger", type = {TriggerDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="\"when\" the rule should be invoked", formalDefinition="The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow." ) - protected List trigger; - - /** - * The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library. - */ - @Child(name = "condition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="\"if\" some condition is true", formalDefinition="The condition element describes he \"if\" portion of the rule that determines whether or not the rule \"fires\". The condition must be the name of an expression in a referenced library." ) - protected StringType condition; - - /** - * The action element defines the "when" portion of the rule that determines what actions should be performed if the condition evaluates to true. - */ - @Child(name = "action", type = {ActionDefinition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="\"then\" perform these actions", formalDefinition="The action element defines the \"when\" portion of the rule that determines what actions should be performed if the condition evaluates to true." ) - protected List action; - - private static final long serialVersionUID = -810482843L; - - /** - * Constructor - */ - public DecisionSupportRule() { - super(); - } - - /** - * @return {@link #moduleMetadata} (The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public ModuleMetadata getModuleMetadata() { - if (this.moduleMetadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DecisionSupportRule.moduleMetadata"); - else if (Configuration.doAutoCreate()) - this.moduleMetadata = new ModuleMetadata(); // cc - return this.moduleMetadata; - } - - public boolean hasModuleMetadata() { - return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); - } - - /** - * @param value {@link #moduleMetadata} (The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public DecisionSupportRule setModuleMetadata(ModuleMetadata value) { - this.moduleMetadata = value; - return this; - } - - /** - * @return {@link #library} (A reference to a Library containing the formal logic used by the rule.) - */ - public List getLibrary() { - if (this.library == null) - this.library = new ArrayList(); - return this.library; - } - - public boolean hasLibrary() { - if (this.library == null) - return false; - for (Reference item : this.library) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #library} (A reference to a Library containing the formal logic used by the rule.) - */ - // syntactic sugar - public Reference addLibrary() { //3 - Reference t = new Reference(); - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return t; - } - - // syntactic sugar - public DecisionSupportRule addLibrary(Reference t) { //3 - if (t == null) - return this; - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return this; - } - - /** - * @return {@link #library} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A reference to a Library containing the formal logic used by the rule.) - */ - public List getLibraryTarget() { - if (this.libraryTarget == null) - this.libraryTarget = new ArrayList(); - return this.libraryTarget; - } - - // syntactic sugar - /** - * @return {@link #library} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A reference to a Library containing the formal logic used by the rule.) - */ - public Library addLibraryTarget() { - Library r = new Library(); - if (this.libraryTarget == null) - this.libraryTarget = new ArrayList(); - this.libraryTarget.add(r); - return r; - } - - /** - * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) - */ - public List getTrigger() { - if (this.trigger == null) - this.trigger = new ArrayList(); - return this.trigger; - } - - public boolean hasTrigger() { - if (this.trigger == null) - return false; - for (TriggerDefinition item : this.trigger) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) - */ - // syntactic sugar - public TriggerDefinition addTrigger() { //3 - TriggerDefinition t = new TriggerDefinition(); - if (this.trigger == null) - this.trigger = new ArrayList(); - this.trigger.add(t); - return t; - } - - // syntactic sugar - public DecisionSupportRule addTrigger(TriggerDefinition t) { //3 - if (t == null) - return this; - if (this.trigger == null) - this.trigger = new ArrayList(); - this.trigger.add(t); - return this; - } - - /** - * @return {@link #condition} (The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value - */ - public StringType getConditionElement() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DecisionSupportRule.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new StringType(); // bb - return this.condition; - } - - public boolean hasConditionElement() { - return this.condition != null && !this.condition.isEmpty(); - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value - */ - public DecisionSupportRule setConditionElement(StringType value) { - this.condition = value; - return this; - } - - /** - * @return The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library. - */ - public String getCondition() { - return this.condition == null ? null : this.condition.getValue(); - } - - /** - * @param value The condition element describes he "if" portion of the rule that determines whether or not the rule "fires". The condition must be the name of an expression in a referenced library. - */ - public DecisionSupportRule setCondition(String value) { - if (Utilities.noString(value)) - this.condition = null; - else { - if (this.condition == null) - this.condition = new StringType(); - this.condition.setValue(value); - } - return this; - } - - /** - * @return {@link #action} (The action element defines the "when" portion of the rule that determines what actions should be performed if the condition evaluates to true.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (ActionDefinition item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (The action element defines the "when" portion of the rule that determines what actions should be performed if the condition evaluates to true.) - */ - // syntactic sugar - public ActionDefinition addAction() { //3 - ActionDefinition t = new ActionDefinition(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public DecisionSupportRule addAction(ActionDefinition t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the decision support rule, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); - childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library containing the formal logic used by the rule.", 0, java.lang.Integer.MAX_VALUE, library)); - childrenList.add(new Property("trigger", "TriggerDefinition", "The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.", 0, java.lang.Integer.MAX_VALUE, trigger)); - childrenList.add(new Property("condition", "string", "The condition element describes he \"if\" portion of the rule that determines whether or not the rule \"fires\". The condition must be the name of an expression in a referenced library.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("action", "ActionDefinition", "The action element defines the \"when\" portion of the rule that determines what actions should be performed if the condition evaluates to true.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata - case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference - case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : this.trigger.toArray(new Base[this.trigger.size()]); // TriggerDefinition - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionDefinition - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 455891387: // moduleMetadata - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - break; - case 166208699: // library - this.getLibrary().add(castToReference(value)); // Reference - break; - case -1059891784: // trigger - this.getTrigger().add(castToTriggerDefinition(value)); // TriggerDefinition - break; - case -861311717: // condition - this.condition = castToString(value); // StringType - break; - case -1422950858: // action - this.getAction().add(castToActionDefinition(value)); // ActionDefinition - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("moduleMetadata")) - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - else if (name.equals("library")) - this.getLibrary().add(castToReference(value)); - else if (name.equals("trigger")) - this.getTrigger().add(castToTriggerDefinition(value)); - else if (name.equals("condition")) - this.condition = castToString(value); // StringType - else if (name.equals("action")) - this.getAction().add(castToActionDefinition(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 455891387: return getModuleMetadata(); // ModuleMetadata - case 166208699: return addLibrary(); // Reference - case -1059891784: return addTrigger(); // TriggerDefinition - case -861311717: throw new FHIRException("Cannot make property condition as it is not a complex type"); // StringType - case -1422950858: return addAction(); // ActionDefinition - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("moduleMetadata")) { - this.moduleMetadata = new ModuleMetadata(); - return this.moduleMetadata; - } - else if (name.equals("library")) { - return addLibrary(); - } - else if (name.equals("trigger")) { - return addTrigger(); - } - else if (name.equals("condition")) { - throw new FHIRException("Cannot call addChild on a primitive type DecisionSupportRule.condition"); - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DecisionSupportRule"; - - } - - public DecisionSupportRule copy() { - DecisionSupportRule dst = new DecisionSupportRule(); - copyValues(dst); - dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); - if (library != null) { - dst.library = new ArrayList(); - for (Reference i : library) - dst.library.add(i.copy()); - }; - if (trigger != null) { - dst.trigger = new ArrayList(); - for (TriggerDefinition i : trigger) - dst.trigger.add(i.copy()); - }; - dst.condition = condition == null ? null : condition.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (ActionDefinition i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - protected DecisionSupportRule typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DecisionSupportRule)) - return false; - DecisionSupportRule o = (DecisionSupportRule) other; - return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(library, o.library, true) - && compareDeep(trigger, o.trigger, true) && compareDeep(condition, o.condition, true) && compareDeep(action, o.action, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DecisionSupportRule)) - return false; - DecisionSupportRule o = (DecisionSupportRule) other; - return compareValues(condition, o.condition, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (library == null || library.isEmpty()) - && (trigger == null || trigger.isEmpty()) && (condition == null || condition.isEmpty()) && (action == null || action.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DecisionSupportRule; - } - - /** - * Search parameter: topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: DecisionSupportRule.moduleMetadata.topic
- *

- */ - @SearchParamDefinition(name="topic", path="DecisionSupportRule.moduleMetadata.topic", description="Topics associated with the module", type="token" ) - public static final String SP_TOPIC = "topic"; - /** - * Fluent Client search parameter constant for topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: DecisionSupportRule.moduleMetadata.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); - - /** - * Search parameter: title - *

- * Description: Text search against the title
- * Type: string
- * Path: DecisionSupportRule.moduleMetadata.title
- *

- */ - @SearchParamDefinition(name="title", path="DecisionSupportRule.moduleMetadata.title", description="Text search against the title", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Text search against the title
- * Type: string
- * Path: DecisionSupportRule.moduleMetadata.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: status - *

- * Description: Status of the module
- * Type: token
- * Path: DecisionSupportRule.moduleMetadata.status
- *

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

- * Description: Status of the module
- * Type: token
- * Path: DecisionSupportRule.moduleMetadata.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search against the description
- * Type: string
- * Path: DecisionSupportRule.moduleMetadata.description
- *

- */ - @SearchParamDefinition(name="description", path="DecisionSupportRule.moduleMetadata.description", description="Text search against the description", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search against the description
- * Type: string
- * Path: DecisionSupportRule.moduleMetadata.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: DecisionSupportRule.moduleMetadata.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DecisionSupportRule.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: DecisionSupportRule.moduleMetadata.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: DecisionSupportRule.moduleMetadata.version
- *

- */ - @SearchParamDefinition(name="version", path="DecisionSupportRule.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: DecisionSupportRule.moduleMetadata.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java deleted file mode 100644 index c18a59a5bc2..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DecisionSupportServiceModule.java +++ /dev/null @@ -1,500 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. - */ -@ResourceDef(name="DecisionSupportServiceModule", profile="http://hl7.org/fhir/Profile/DecisionSupportServiceModule") -public class DecisionSupportServiceModule extends DomainResource { - - /** - * The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence. - */ - @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Metadata for the service module", formalDefinition="The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence." ) - protected ModuleMetadata moduleMetadata; - - /** - * The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow. - */ - @Child(name = "trigger", type = {TriggerDefinition.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="\"when\" the module should be invoked", formalDefinition="The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow." ) - protected List trigger; - - /** - * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. - */ - @Child(name = "parameter", type = {ParameterDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Parameters to the module", formalDefinition="The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse." ) - protected List parameter; - - /** - * Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation. - */ - @Child(name = "dataRequirement", type = {DataRequirement.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Data requirements for the module", formalDefinition="Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation." ) - protected List dataRequirement; - - private static final long serialVersionUID = 1154664442L; - - /** - * Constructor - */ - public DecisionSupportServiceModule() { - super(); - } - - /** - * @return {@link #moduleMetadata} (The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public ModuleMetadata getModuleMetadata() { - if (this.moduleMetadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DecisionSupportServiceModule.moduleMetadata"); - else if (Configuration.doAutoCreate()) - this.moduleMetadata = new ModuleMetadata(); // cc - return this.moduleMetadata; - } - - public boolean hasModuleMetadata() { - return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); - } - - /** - * @param value {@link #moduleMetadata} (The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public DecisionSupportServiceModule setModuleMetadata(ModuleMetadata value) { - this.moduleMetadata = value; - return this; - } - - /** - * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) - */ - public List getTrigger() { - if (this.trigger == null) - this.trigger = new ArrayList(); - return this.trigger; - } - - public boolean hasTrigger() { - if (this.trigger == null) - return false; - for (TriggerDefinition item : this.trigger) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #trigger} (The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.) - */ - // syntactic sugar - public TriggerDefinition addTrigger() { //3 - TriggerDefinition t = new TriggerDefinition(); - if (this.trigger == null) - this.trigger = new ArrayList(); - this.trigger.add(t); - return t; - } - - // syntactic sugar - public DecisionSupportServiceModule addTrigger(TriggerDefinition t) { //3 - if (t == null) - return this; - if (this.trigger == null) - this.trigger = new ArrayList(); - this.trigger.add(t); - return this; - } - - /** - * @return {@link #parameter} (The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ParameterDefinition item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.) - */ - // syntactic sugar - public ParameterDefinition addParameter() { //3 - ParameterDefinition t = new ParameterDefinition(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public DecisionSupportServiceModule addParameter(ParameterDefinition t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - /** - * @return {@link #dataRequirement} (Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.) - */ - public List getDataRequirement() { - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - return this.dataRequirement; - } - - public boolean hasDataRequirement() { - if (this.dataRequirement == null) - return false; - for (DataRequirement item : this.dataRequirement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dataRequirement} (Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.) - */ - // syntactic sugar - public DataRequirement addDataRequirement() { //3 - DataRequirement t = new DataRequirement(); - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - this.dataRequirement.add(t); - return t; - } - - // syntactic sugar - public DecisionSupportServiceModule addDataRequirement(DataRequirement t) { //3 - if (t == null) - return this; - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - this.dataRequirement.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the decision support service module, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); - childrenList.add(new Property("trigger", "TriggerDefinition", "The trigger element defines when the rule should be invoked. This information is used by consumers of the rule to determine how to integrate the rule into a specific workflow.", 0, java.lang.Integer.MAX_VALUE, trigger)); - childrenList.add(new Property("parameter", "ParameterDefinition", "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("dataRequirement", "DataRequirement", "Data requirements are a machine processable description of the data required by the module in order to perform a successful evaluation.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata - case -1059891784: /*trigger*/ return this.trigger == null ? new Base[0] : this.trigger.toArray(new Base[this.trigger.size()]); // TriggerDefinition - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParameterDefinition - case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 455891387: // moduleMetadata - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - break; - case -1059891784: // trigger - this.getTrigger().add(castToTriggerDefinition(value)); // TriggerDefinition - break; - case 1954460585: // parameter - this.getParameter().add(castToParameterDefinition(value)); // ParameterDefinition - break; - case 629147193: // dataRequirement - this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("moduleMetadata")) - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - else if (name.equals("trigger")) - this.getTrigger().add(castToTriggerDefinition(value)); - else if (name.equals("parameter")) - this.getParameter().add(castToParameterDefinition(value)); - else if (name.equals("dataRequirement")) - this.getDataRequirement().add(castToDataRequirement(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 455891387: return getModuleMetadata(); // ModuleMetadata - case -1059891784: return addTrigger(); // TriggerDefinition - case 1954460585: return addParameter(); // ParameterDefinition - case 629147193: return addDataRequirement(); // DataRequirement - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("moduleMetadata")) { - this.moduleMetadata = new ModuleMetadata(); - return this.moduleMetadata; - } - else if (name.equals("trigger")) { - return addTrigger(); - } - else if (name.equals("parameter")) { - return addParameter(); - } - else if (name.equals("dataRequirement")) { - return addDataRequirement(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DecisionSupportServiceModule"; - - } - - public DecisionSupportServiceModule copy() { - DecisionSupportServiceModule dst = new DecisionSupportServiceModule(); - copyValues(dst); - dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); - if (trigger != null) { - dst.trigger = new ArrayList(); - for (TriggerDefinition i : trigger) - dst.trigger.add(i.copy()); - }; - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ParameterDefinition i : parameter) - dst.parameter.add(i.copy()); - }; - if (dataRequirement != null) { - dst.dataRequirement = new ArrayList(); - for (DataRequirement i : dataRequirement) - dst.dataRequirement.add(i.copy()); - }; - return dst; - } - - protected DecisionSupportServiceModule typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DecisionSupportServiceModule)) - return false; - DecisionSupportServiceModule o = (DecisionSupportServiceModule) other; - return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(trigger, o.trigger, true) - && compareDeep(parameter, o.parameter, true) && compareDeep(dataRequirement, o.dataRequirement, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DecisionSupportServiceModule)) - return false; - DecisionSupportServiceModule o = (DecisionSupportServiceModule) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (trigger == null || trigger.isEmpty()) - && (parameter == null || parameter.isEmpty()) && (dataRequirement == null || dataRequirement.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DecisionSupportServiceModule; - } - - /** - * Search parameter: topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: DecisionSupportServiceModule.moduleMetadata.topic
- *

- */ - @SearchParamDefinition(name="topic", path="DecisionSupportServiceModule.moduleMetadata.topic", description="Topics associated with the module", type="token" ) - public static final String SP_TOPIC = "topic"; - /** - * Fluent Client search parameter constant for topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: DecisionSupportServiceModule.moduleMetadata.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); - - /** - * Search parameter: title - *

- * Description: Text search against the title
- * Type: string
- * Path: DecisionSupportServiceModule.moduleMetadata.title
- *

- */ - @SearchParamDefinition(name="title", path="DecisionSupportServiceModule.moduleMetadata.title", description="Text search against the title", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Text search against the title
- * Type: string
- * Path: DecisionSupportServiceModule.moduleMetadata.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: status - *

- * Description: Status of the module
- * Type: token
- * Path: DecisionSupportServiceModule.moduleMetadata.status
- *

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

- * Description: Status of the module
- * Type: token
- * Path: DecisionSupportServiceModule.moduleMetadata.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search against the description
- * Type: string
- * Path: DecisionSupportServiceModule.moduleMetadata.description
- *

- */ - @SearchParamDefinition(name="description", path="DecisionSupportServiceModule.moduleMetadata.description", description="Text search against the description", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search against the description
- * Type: string
- * Path: DecisionSupportServiceModule.moduleMetadata.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: DecisionSupportServiceModule.moduleMetadata.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DecisionSupportServiceModule.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: DecisionSupportServiceModule.moduleMetadata.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: DecisionSupportServiceModule.moduleMetadata.version
- *

- */ - @SearchParamDefinition(name="version", path="DecisionSupportServiceModule.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: DecisionSupportServiceModule.moduleMetadata.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DetectedIssue.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DetectedIssue.java deleted file mode 100644 index 3ac2c3b35ba..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DetectedIssue.java +++ /dev/null @@ -1,1308 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ -@ResourceDef(name="DetectedIssue", profile="http://hl7.org/fhir/Profile/DetectedIssue") -public class DetectedIssue extends DomainResource { - - public enum DetectedIssueSeverity { - /** - * Indicates the issue may be life-threatening or has the potential to cause permanent injury. - */ - HIGH, - /** - * Indicates the issue may result in noticeable adverse consequences but is unlikely to be life-threatening or cause permanent injury. - */ - MODERATE, - /** - * Indicates the issue may result in some adverse consequences but is unlikely to substantially affect the situation of the subject. - */ - LOW, - /** - * added to help the parsers - */ - NULL; - public static DetectedIssueSeverity fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("high".equals(codeString)) - return HIGH; - if ("moderate".equals(codeString)) - return MODERATE; - if ("low".equals(codeString)) - return LOW; - throw new FHIRException("Unknown DetectedIssueSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HIGH: return "high"; - case MODERATE: return "moderate"; - case LOW: return "low"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HIGH: return "http://hl7.org/fhir/detectedissue-severity"; - case MODERATE: return "http://hl7.org/fhir/detectedissue-severity"; - case LOW: return "http://hl7.org/fhir/detectedissue-severity"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HIGH: return "Indicates the issue may be life-threatening or has the potential to cause permanent injury."; - case MODERATE: return "Indicates the issue may result in noticeable adverse consequences but is unlikely to be life-threatening or cause permanent injury."; - case LOW: return "Indicates the issue may result in some adverse consequences but is unlikely to substantially affect the situation of the subject."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HIGH: return "High"; - case MODERATE: return "Moderate"; - case LOW: return "Low"; - default: return "?"; - } - } - } - - public static class DetectedIssueSeverityEnumFactory implements EnumFactory { - public DetectedIssueSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("high".equals(codeString)) - return DetectedIssueSeverity.HIGH; - if ("moderate".equals(codeString)) - return DetectedIssueSeverity.MODERATE; - if ("low".equals(codeString)) - return DetectedIssueSeverity.LOW; - throw new IllegalArgumentException("Unknown DetectedIssueSeverity code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("high".equals(codeString)) - return new Enumeration(this, DetectedIssueSeverity.HIGH); - if ("moderate".equals(codeString)) - return new Enumeration(this, DetectedIssueSeverity.MODERATE); - if ("low".equals(codeString)) - return new Enumeration(this, DetectedIssueSeverity.LOW); - throw new FHIRException("Unknown DetectedIssueSeverity code '"+codeString+"'"); - } - public String toCode(DetectedIssueSeverity code) { - if (code == DetectedIssueSeverity.HIGH) - return "high"; - if (code == DetectedIssueSeverity.MODERATE) - return "moderate"; - if (code == DetectedIssueSeverity.LOW) - return "low"; - return "?"; - } - public String toSystem(DetectedIssueSeverity code) { - return code.getSystem(); - } - } - - @Block() - public static class DetectedIssueMitigationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="What mitigation?", formalDefinition="Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue." ) - protected CodeableConcept action; - - /** - * Indicates when the mitigating action was documented. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date committed", formalDefinition="Indicates when the mitigating action was documented." ) - protected DateTimeType date; - - /** - * Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring. - */ - @Child(name = "author", type = {Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who is committing?", formalDefinition="Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - protected Practitioner authorTarget; - - private static final long serialVersionUID = -1994768436L; - - /** - * Constructor - */ - public DetectedIssueMitigationComponent() { - super(); - } - - /** - * Constructor - */ - public DetectedIssueMitigationComponent(CodeableConcept action) { - super(); - this.action = action; - } - - /** - * @return {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.) - */ - public CodeableConcept getAction() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new CodeableConcept(); // cc - return this.action; - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.) - */ - public DetectedIssueMitigationComponent setAction(CodeableConcept value) { - this.action = value; - return this; - } - - /** - * @return {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Indicates when the mitigating action was documented.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DetectedIssueMitigationComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Indicates when the mitigating action was documented. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Indicates when the mitigating action was documented. - */ - public DetectedIssueMitigationComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public DetectedIssueMitigationComponent setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssueMitigationComponent.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); // aa - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.) - */ - public DetectedIssueMitigationComponent setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "CodeableConcept", "Describes the action that was taken or the observation that was made that reduces/eliminates the risk associated with the identified issue.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("date", "dateTime", "Indicates when the mitigating action was documented.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("author", "Reference(Practitioner)", "Identifies the practitioner who determined the mitigation and takes responsibility for the mitigation step occurring.", 0, java.lang.Integer.MAX_VALUE, author)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // CodeableConcept - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422950858: // action - this.action = castToCodeableConcept(value); // CodeableConcept - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("action")) - this.action = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422950858: return getAction(); // CodeableConcept - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1406328437: return getAuthor(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("action")) { - this.action = new CodeableConcept(); - return this.action; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.date"); - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else - return super.addChild(name); - } - - public DetectedIssueMitigationComponent copy() { - DetectedIssueMitigationComponent dst = new DetectedIssueMitigationComponent(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - dst.date = date == null ? null : date.copy(); - dst.author = author == null ? null : author.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetectedIssueMitigationComponent)) - return false; - DetectedIssueMitigationComponent o = (DetectedIssueMitigationComponent) other; - return compareDeep(action, o.action, true) && compareDeep(date, o.date, true) && compareDeep(author, o.author, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetectedIssueMitigationComponent)) - return false; - DetectedIssueMitigationComponent o = (DetectedIssueMitigationComponent) other; - return compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (date == null || date.isEmpty()) - && (author == null || author.isEmpty()); - } - - public String fhirType() { - return "DetectedIssue.mitigation"; - - } - - } - - /** - * Indicates the patient whose record the detected issue is associated with. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Associated patient", formalDefinition="Indicates the patient whose record the detected issue is associated with." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Indicates the patient whose record the detected issue is associated with.) - */ - protected Patient patientTarget; - - /** - * Identifies the general type of issue identified. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Issue Category, e.g. drug-drug, duplicate therapy, etc.", formalDefinition="Identifies the general type of issue identified." ) - protected CodeableConcept category; - - /** - * Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - @Child(name = "severity", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="high | moderate | low", formalDefinition="Indicates the degree of importance associated with the identified issue based on the potential impact on the patient." ) - protected Enumeration severity; - - /** - * Indicates the resource representing the current activity or proposed activity that is potentially problematic. - */ - @Child(name = "implicated", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Problem resource", formalDefinition="Indicates the resource representing the current activity or proposed activity that is potentially problematic." ) - protected List implicated; - /** - * The actual objects that are the target of the reference (Indicates the resource representing the current activity or proposed activity that is potentially problematic.) - */ - protected List implicatedTarget; - - - /** - * A textual explanation of the detected issue. - */ - @Child(name = "detail", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description and context", formalDefinition="A textual explanation of the detected issue." ) - protected StringType detail; - - /** - * The date or date-time when the detected issue was initially identified. - */ - @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When identified", formalDefinition="The date or date-time when the detected issue was initially identified." ) - protected DateTimeType date; - - /** - * Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review. - */ - @Child(name = "author", type = {Practitioner.class, Device.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The provider or device that identified the issue", formalDefinition="Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) - */ - protected Resource authorTarget; - - /** - * Business identifier associated with the detected issue record. - */ - @Child(name = "identifier", type = {Identifier.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique id for the detected issue", formalDefinition="Business identifier associated with the detected issue record." ) - protected Identifier identifier; - - /** - * The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. - */ - @Child(name = "reference", type = {UriType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Authority for issue", formalDefinition="The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified." ) - protected UriType reference; - - /** - * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action. - */ - @Child(name = "mitigation", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Step taken to address", formalDefinition="Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action." ) - protected List mitigation; - - private static final long serialVersionUID = -403732234L; - - /** - * Constructor - */ - public DetectedIssue() { - super(); - } - - /** - * @return {@link #patient} (Indicates the patient whose record the detected issue is associated with.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Indicates the patient whose record the detected issue is associated with.) - */ - public DetectedIssue setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the patient whose record the detected issue is associated with.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the patient whose record the detected issue is associated with.) - */ - public DetectedIssue setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #category} (Identifies the general type of issue identified.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Identifies the general type of issue identified.) - */ - public DetectedIssue setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new DetectedIssueSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public DetectedIssue setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - public DetectedIssueSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Indicates the degree of importance associated with the identified issue based on the potential impact on the patient. - */ - public DetectedIssue setSeverity(DetectedIssueSeverity value) { - if (value == null) - this.severity = null; - else { - if (this.severity == null) - this.severity = new Enumeration(new DetectedIssueSeverityEnumFactory()); - this.severity.setValue(value); - } - return this; - } - - /** - * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that is potentially problematic.) - */ - public List getImplicated() { - if (this.implicated == null) - this.implicated = new ArrayList(); - return this.implicated; - } - - public boolean hasImplicated() { - if (this.implicated == null) - return false; - for (Reference item : this.implicated) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #implicated} (Indicates the resource representing the current activity or proposed activity that is potentially problematic.) - */ - // syntactic sugar - public Reference addImplicated() { //3 - Reference t = new Reference(); - if (this.implicated == null) - this.implicated = new ArrayList(); - this.implicated.add(t); - return t; - } - - // syntactic sugar - public DetectedIssue addImplicated(Reference t) { //3 - if (t == null) - return this; - if (this.implicated == null) - this.implicated = new ArrayList(); - this.implicated.add(t); - return this; - } - - /** - * @return {@link #implicated} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the resource representing the current activity or proposed activity that is potentially problematic.) - */ - public List getImplicatedTarget() { - if (this.implicatedTarget == null) - this.implicatedTarget = new ArrayList(); - return this.implicatedTarget; - } - - /** - * @return {@link #detail} (A textual explanation of the detected issue.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public StringType getDetailElement() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new StringType(); // bb - return this.detail; - } - - public boolean hasDetailElement() { - return this.detail != null && !this.detail.isEmpty(); - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (A textual explanation of the detected issue.). This is the underlying object with id, value and extensions. The accessor "getDetail" gives direct access to the value - */ - public DetectedIssue setDetailElement(StringType value) { - this.detail = value; - return this; - } - - /** - * @return A textual explanation of the detected issue. - */ - public String getDetail() { - return this.detail == null ? null : this.detail.getValue(); - } - - /** - * @param value A textual explanation of the detected issue. - */ - public DetectedIssue setDetail(String value) { - if (Utilities.noString(value)) - this.detail = null; - else { - if (this.detail == null) - this.detail = new StringType(); - this.detail.setValue(value); - } - return this; - } - - /** - * @return {@link #date} (The date or date-time when the detected issue was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date or date-time when the detected issue was initially identified.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DetectedIssue setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date or date-time when the detected issue was initially identified. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date or date-time when the detected issue was initially identified. - */ - public DetectedIssue setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) - */ - public DetectedIssue setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.) - */ - public DetectedIssue setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Business identifier associated with the detected issue record.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Business identifier associated with the detected issue record.) - */ - public DetectedIssue setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetectedIssue.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public DetectedIssue setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified. - */ - public DetectedIssue setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) - */ - public List getMitigation() { - if (this.mitigation == null) - this.mitigation = new ArrayList(); - return this.mitigation; - } - - public boolean hasMitigation() { - if (this.mitigation == null) - return false; - for (DetectedIssueMitigationComponent item : this.mitigation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mitigation} (Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.) - */ - // syntactic sugar - public DetectedIssueMitigationComponent addMitigation() { //3 - DetectedIssueMitigationComponent t = new DetectedIssueMitigationComponent(); - if (this.mitigation == null) - this.mitigation = new ArrayList(); - this.mitigation.add(t); - return t; - } - - // syntactic sugar - public DetectedIssue addMitigation(DetectedIssueMitigationComponent t) { //3 - if (t == null) - return this; - if (this.mitigation == null) - this.mitigation = new ArrayList(); - this.mitigation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "Indicates the patient whose record the detected issue is associated with.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("category", "CodeableConcept", "Identifies the general type of issue identified.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("severity", "code", "Indicates the degree of importance associated with the identified issue based on the potential impact on the patient.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("implicated", "Reference(Any)", "Indicates the resource representing the current activity or proposed activity that is potentially problematic.", 0, java.lang.Integer.MAX_VALUE, implicated)); - childrenList.add(new Property("detail", "string", "A textual explanation of the detected issue.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("date", "dateTime", "The date or date-time when the detected issue was initially identified.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("author", "Reference(Practitioner|Device)", "Individual or device responsible for the issue being raised. For example, a decision support application or a pharmacist conducting a medication review.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("identifier", "Identifier", "Business identifier associated with the detected issue record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("reference", "uri", "The literature, knowledge-base or similar reference that describes the propensity for the detected issue identified.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("mitigation", "", "Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may reduce/eliminate the need for any action.", 0, java.lang.Integer.MAX_VALUE, mitigation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration - case -810216884: /*implicated*/ return this.implicated == null ? new Base[0] : this.implicated.toArray(new Base[this.implicated.size()]); // Reference - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // StringType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType - case 1293793087: /*mitigation*/ return this.mitigation == null ? new Base[0] : this.mitigation.toArray(new Base[this.mitigation.size()]); // DetectedIssueMitigationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case 1478300413: // severity - this.severity = new DetectedIssueSeverityEnumFactory().fromType(value); // Enumeration - break; - case -810216884: // implicated - this.getImplicated().add(castToReference(value)); // Reference - break; - case -1335224239: // detail - this.detail = castToString(value); // StringType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -925155509: // reference - this.reference = castToUri(value); // UriType - break; - case 1293793087: // mitigation - this.getMitigation().add((DetectedIssueMitigationComponent) value); // DetectedIssueMitigationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("severity")) - this.severity = new DetectedIssueSeverityEnumFactory().fromType(value); // Enumeration - else if (name.equals("implicated")) - this.getImplicated().add(castToReference(value)); - else if (name.equals("detail")) - this.detail = castToString(value); // StringType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("reference")) - this.reference = castToUri(value); // UriType - else if (name.equals("mitigation")) - this.getMitigation().add((DetectedIssueMitigationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -791418107: return getPatient(); // Reference - case 50511102: return getCategory(); // CodeableConcept - case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration - case -810216884: return addImplicated(); // Reference - case -1335224239: throw new FHIRException("Cannot make property detail as it is not a complex type"); // StringType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1406328437: return getAuthor(); // Reference - case -1618432855: return getIdentifier(); // Identifier - case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType - case 1293793087: return addMitigation(); // DetectedIssueMitigationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("severity")) { - throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.severity"); - } - else if (name.equals("implicated")) { - return addImplicated(); - } - else if (name.equals("detail")) { - throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.detail"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.date"); - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("reference")) { - throw new FHIRException("Cannot call addChild on a primitive type DetectedIssue.reference"); - } - else if (name.equals("mitigation")) { - return addMitigation(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DetectedIssue"; - - } - - public DetectedIssue copy() { - DetectedIssue dst = new DetectedIssue(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.category = category == null ? null : category.copy(); - dst.severity = severity == null ? null : severity.copy(); - if (implicated != null) { - dst.implicated = new ArrayList(); - for (Reference i : implicated) - dst.implicated.add(i.copy()); - }; - dst.detail = detail == null ? null : detail.copy(); - dst.date = date == null ? null : date.copy(); - dst.author = author == null ? null : author.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.reference = reference == null ? null : reference.copy(); - if (mitigation != null) { - dst.mitigation = new ArrayList(); - for (DetectedIssueMitigationComponent i : mitigation) - dst.mitigation.add(i.copy()); - }; - return dst; - } - - protected DetectedIssue typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetectedIssue)) - return false; - DetectedIssue o = (DetectedIssue) other; - return compareDeep(patient, o.patient, true) && compareDeep(category, o.category, true) && compareDeep(severity, o.severity, true) - && compareDeep(implicated, o.implicated, true) && compareDeep(detail, o.detail, true) && compareDeep(date, o.date, true) - && compareDeep(author, o.author, true) && compareDeep(identifier, o.identifier, true) && compareDeep(reference, o.reference, true) - && compareDeep(mitigation, o.mitigation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetectedIssue)) - return false; - DetectedIssue o = (DetectedIssue) other; - return compareValues(severity, o.severity, true) && compareValues(detail, o.detail, true) && compareValues(date, o.date, true) - && compareValues(reference, o.reference, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (category == null || category.isEmpty()) - && (severity == null || severity.isEmpty()) && (implicated == null || implicated.isEmpty()) - && (detail == null || detail.isEmpty()) && (date == null || date.isEmpty()) && (author == null || author.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (reference == null || reference.isEmpty()) - && (mitigation == null || mitigation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DetectedIssue; - } - - /** - * Search parameter: author - *

- * Description: The provider or device that identified the issue
- * Type: reference
- * Path: DetectedIssue.author
- *

- */ - @SearchParamDefinition(name="author", path="DetectedIssue.author", description="The provider or device that identified the issue", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: The provider or device that identified the issue
- * Type: reference
- * Path: DetectedIssue.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DetectedIssue:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DetectedIssue:author").toLocked(); - - /** - * Search parameter: category - *

- * Description: Issue Category, e.g. drug-drug, duplicate therapy, etc.
- * Type: token
- * Path: DetectedIssue.category
- *

- */ - @SearchParamDefinition(name="category", path="DetectedIssue.category", description="Issue Category, e.g. drug-drug, duplicate therapy, etc.", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: Issue Category, e.g. drug-drug, duplicate therapy, etc.
- * Type: token
- * Path: DetectedIssue.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: implicated - *

- * Description: Problem resource
- * Type: reference
- * Path: DetectedIssue.implicated
- *

- */ - @SearchParamDefinition(name="implicated", path="DetectedIssue.implicated", description="Problem resource", type="reference" ) - public static final String SP_IMPLICATED = "implicated"; - /** - * Fluent Client search parameter constant for implicated - *

- * Description: Problem resource
- * Type: reference
- * Path: DetectedIssue.implicated
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam IMPLICATED = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_IMPLICATED); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DetectedIssue:implicated". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_IMPLICATED = new ca.uhn.fhir.model.api.Include("DetectedIssue:implicated").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Associated patient
- * Type: reference
- * Path: DetectedIssue.patient
- *

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

- * Description: Associated patient
- * Type: reference
- * Path: DetectedIssue.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DetectedIssue:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DetectedIssue:patient").toLocked(); - - /** - * Search parameter: date - *

- * Description: When identified
- * Type: date
- * Path: DetectedIssue.date
- *

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

- * Description: When identified
- * Type: date
- * Path: DetectedIssue.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: Unique id for the detected issue
- * Type: token
- * Path: DetectedIssue.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DetectedIssue.identifier", description="Unique id for the detected issue", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique id for the detected issue
- * Type: token
- * Path: DetectedIssue.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Device.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Device.java deleted file mode 100644 index 9620d73de38..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Device.java +++ /dev/null @@ -1,1497 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. - */ -@ResourceDef(name="Device", profile="http://hl7.org/fhir/Profile/Device") -public class Device extends DomainResource { - - public enum DeviceStatus { - /** - * The Device is available for use. - */ - AVAILABLE, - /** - * The Device is no longer available for use (e.g. lost, expired, damaged). - */ - NOTAVAILABLE, - /** - * The Device was entered in error and voided. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DeviceStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return AVAILABLE; - if ("not-available".equals(codeString)) - return NOTAVAILABLE; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown DeviceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AVAILABLE: return "available"; - case NOTAVAILABLE: return "not-available"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AVAILABLE: return "http://hl7.org/fhir/devicestatus"; - case NOTAVAILABLE: return "http://hl7.org/fhir/devicestatus"; - case ENTEREDINERROR: return "http://hl7.org/fhir/devicestatus"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AVAILABLE: return "The Device is available for use."; - case NOTAVAILABLE: return "The Device is no longer available for use (e.g. lost, expired, damaged)."; - case ENTEREDINERROR: return "The Device was entered in error and voided."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AVAILABLE: return "Available"; - case NOTAVAILABLE: return "Not Available"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class DeviceStatusEnumFactory implements EnumFactory { - public DeviceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return DeviceStatus.AVAILABLE; - if ("not-available".equals(codeString)) - return DeviceStatus.NOTAVAILABLE; - if ("entered-in-error".equals(codeString)) - return DeviceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DeviceStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return new Enumeration(this, DeviceStatus.AVAILABLE); - if ("not-available".equals(codeString)) - return new Enumeration(this, DeviceStatus.NOTAVAILABLE); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, DeviceStatus.ENTEREDINERROR); - throw new FHIRException("Unknown DeviceStatus code '"+codeString+"'"); - } - public String toCode(DeviceStatus code) { - if (code == DeviceStatus.AVAILABLE) - return "available"; - if (code == DeviceStatus.NOTAVAILABLE) - return "not-available"; - if (code == DeviceStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(DeviceStatus code) { - return code.getSystem(); - } - } - - /** - * Unique instance identifiers assigned to a device by manufacturers other organizations or owners. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Instance identifier", formalDefinition="Unique instance identifiers assigned to a device by manufacturers other organizations or owners." ) - protected List identifier; - - /** - * [Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package. - */ - @Child(name = "udiCarrier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Unique Device Identifier (UDI) Barcode string", formalDefinition="[Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package." ) - protected Identifier udiCarrier; - - /** - * Status of the Device availability. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="available | not-available | entered-in-error", formalDefinition="Status of the Device availability." ) - protected Enumeration status; - - /** - * Code or identifier to identify a kind of device. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="What kind of device this is", formalDefinition="Code or identifier to identify a kind of device." ) - protected CodeableConcept type; - - /** - * Lot number assigned by the manufacturer. - */ - @Child(name = "lotNumber", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Lot number of manufacture", formalDefinition="Lot number assigned by the manufacturer." ) - protected StringType lotNumber; - - /** - * A name of the manufacturer. - */ - @Child(name = "manufacturer", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of device manufacturer", formalDefinition="A name of the manufacturer." ) - protected StringType manufacturer; - - /** - * The date and time when the device was manufactured. - */ - @Child(name = "manufactureDate", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date when the device was made", formalDefinition="The date and time when the device was manufactured." ) - protected DateTimeType manufactureDate; - - /** - * The date and time beyond which this device is no longer valid or should not be used (if applicable). - */ - @Child(name = "expirationDate", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date and time of expiry of this device (if applicable)", formalDefinition="The date and time beyond which this device is no longer valid or should not be used (if applicable)." ) - protected DateTimeType expirationDate; - - /** - * The "model" is 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. - */ - @Child(name = "model", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Model id assigned by the manufacturer", formalDefinition="The \"model\" is 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." ) - protected StringType model; - - /** - * The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware. - */ - @Child(name = "version", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @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." ) - protected StringType version; - - /** - * Patient information, If the device is affixed to a person. - */ - @Child(name = "patient", type = {Patient.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Patient to whom Device is affixed", formalDefinition="Patient information, If the device is affixed to a person." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Patient information, If the device is affixed to a person.) - */ - protected Patient patientTarget; - - /** - * An organization that is responsible for the provision and ongoing maintenance of the device. - */ - @Child(name = "owner", type = {Organization.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Organization responsible for device", formalDefinition="An organization that is responsible for the provision and ongoing maintenance of the device." ) - protected Reference owner; - - /** - * The actual object that is the target of the reference (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - protected Organization ownerTarget; - - /** - * Contact details for an organization or a particular human that is responsible for the device. - */ - @Child(name = "contact", type = {ContactPoint.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Details for human/organization for support", formalDefinition="Contact details for an organization or a particular human that is responsible for the device." ) - protected List contact; - - /** - * The place where the device can be found. - */ - @Child(name = "location", type = {Location.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Where the resource is found", formalDefinition="The place where the device can be found." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The place where the device can be found.) - */ - protected Location locationTarget; - - /** - * A network address on which the device may be contacted directly. - */ - @Child(name = "url", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Network address to contact device", formalDefinition="A network address on which the device may be contacted directly." ) - protected UriType url; - - /** - * Descriptive information, usage information or implantation information that is not captured in an existing element. - */ - @Child(name = "note", type = {Annotation.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Device notes and comments", formalDefinition="Descriptive information, usage information or implantation information that is not captured in an existing element." ) - protected List note; - - private static final long serialVersionUID = -710362206L; - - /** - * Constructor - */ - public Device() { - super(); - } - - /** - * Constructor - */ - public Device(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Unique instance identifiers assigned to a device by manufacturers other organizations or owners.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Device addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #udiCarrier} ([Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package.) - */ - public Identifier getUdiCarrier() { - if (this.udiCarrier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.udiCarrier"); - else if (Configuration.doAutoCreate()) - this.udiCarrier = new Identifier(); // cc - return this.udiCarrier; - } - - public boolean hasUdiCarrier() { - return this.udiCarrier != null && !this.udiCarrier.isEmpty(); - } - - /** - * @param value {@link #udiCarrier} ([Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package.) - */ - public Device setUdiCarrier(Identifier value) { - this.udiCarrier = value; - return this; - } - - /** - * @return {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DeviceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Status of the Device availability.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Device setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Status of the Device availability. - */ - public DeviceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Status of the Device availability. - */ - public Device setStatus(DeviceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DeviceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Code or identifier to identify a kind of device.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Code or identifier to identify a kind of device.) - */ - public Device setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); // bb - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (Lot number assigned by the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public Device setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return Lot number assigned by the manufacturer. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value Lot number assigned by the manufacturer. - */ - public Device setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value - */ - public StringType getManufacturerElement() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new StringType(); // bb - return this.manufacturer; - } - - public boolean hasManufacturerElement() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (A name of the manufacturer.). This is the underlying object with id, value and extensions. The accessor "getManufacturer" gives direct access to the value - */ - public Device setManufacturerElement(StringType value) { - this.manufacturer = value; - return this; - } - - /** - * @return A name of the manufacturer. - */ - public String getManufacturer() { - return this.manufacturer == null ? null : this.manufacturer.getValue(); - } - - /** - * @param value A name of the manufacturer. - */ - public Device setManufacturer(String value) { - if (Utilities.noString(value)) - this.manufacturer = null; - else { - if (this.manufacturer == null) - this.manufacturer = new StringType(); - this.manufacturer.setValue(value); - } - return this; - } - - /** - * @return {@link #manufactureDate} (The date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value - */ - public DateTimeType getManufactureDateElement() { - if (this.manufactureDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.manufactureDate"); - else if (Configuration.doAutoCreate()) - this.manufactureDate = new DateTimeType(); // bb - return this.manufactureDate; - } - - public boolean hasManufactureDateElement() { - return this.manufactureDate != null && !this.manufactureDate.isEmpty(); - } - - public boolean hasManufactureDate() { - return this.manufactureDate != null && !this.manufactureDate.isEmpty(); - } - - /** - * @param value {@link #manufactureDate} (The date and time when the device was manufactured.). This is the underlying object with id, value and extensions. The accessor "getManufactureDate" gives direct access to the value - */ - public Device setManufactureDateElement(DateTimeType value) { - this.manufactureDate = value; - return this; - } - - /** - * @return The date and time when the device was manufactured. - */ - public Date getManufactureDate() { - return this.manufactureDate == null ? null : this.manufactureDate.getValue(); - } - - /** - * @param value The date and time when the device was manufactured. - */ - public Device setManufactureDate(Date value) { - if (value == null) - this.manufactureDate = null; - else { - if (this.manufactureDate == null) - this.manufactureDate = new DateTimeType(); - this.manufactureDate.setValue(value); - } - return this; - } - - /** - * @return {@link #expirationDate} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public DateTimeType getExpirationDateElement() { - if (this.expirationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.expirationDate"); - else if (Configuration.doAutoCreate()) - this.expirationDate = new DateTimeType(); // bb - return this.expirationDate; - } - - public boolean hasExpirationDateElement() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - public boolean hasExpirationDate() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - /** - * @param value {@link #expirationDate} (The date and time beyond which this device is no longer valid or should not be used (if applicable).). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public Device setExpirationDateElement(DateTimeType value) { - this.expirationDate = value; - return this; - } - - /** - * @return The date and time beyond which this device is no longer valid or should not be used (if applicable). - */ - public Date getExpirationDate() { - return this.expirationDate == null ? null : this.expirationDate.getValue(); - } - - /** - * @param value The date and time beyond which this device is no longer valid or should not be used (if applicable). - */ - public Device setExpirationDate(Date value) { - if (value == null) - this.expirationDate = null; - else { - if (this.expirationDate == null) - this.expirationDate = new DateTimeType(); - this.expirationDate.setValue(value); - } - return this; - } - - /** - * @return {@link #model} (The "model" is 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.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value - */ - public StringType getModelElement() { - if (this.model == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.model"); - else if (Configuration.doAutoCreate()) - this.model = new StringType(); // bb - return this.model; - } - - public boolean hasModelElement() { - return this.model != null && !this.model.isEmpty(); - } - - public boolean hasModel() { - return this.model != null && !this.model.isEmpty(); - } - - /** - * @param value {@link #model} (The "model" is 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.). This is the underlying object with id, value and extensions. The accessor "getModel" gives direct access to the value - */ - public Device setModelElement(StringType value) { - this.model = value; - return this; - } - - /** - * @return The "model" is 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 String getModel() { - return this.model == null ? null : this.model.getValue(); - } - - /** - * @param value The "model" is 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 value) { - if (Utilities.noString(value)) - this.model = null; - else { - if (this.model == null) - this.model = new StringType(); - this.model.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Device setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return 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 String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value 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 value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (Patient information, If the device is affixed to a person.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient information, If the device is affixed to a person.) - */ - public Device setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient information, If the device is affixed to a person.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient information, If the device is affixed to a person.) - */ - public Device setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Reference getOwner() { - if (this.owner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.owner"); - else if (Configuration.doAutoCreate()) - this.owner = new Reference(); // cc - return this.owner; - } - - public boolean hasOwner() { - return this.owner != null && !this.owner.isEmpty(); - } - - /** - * @param value {@link #owner} (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Device setOwner(Reference value) { - this.owner = value; - return this; - } - - /** - * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Organization getOwnerTarget() { - if (this.ownerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.owner"); - else if (Configuration.doAutoCreate()) - this.ownerTarget = new Organization(); // aa - return this.ownerTarget; - } - - /** - * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is responsible for the provision and ongoing maintenance of the device.) - */ - public Device setOwnerTarget(Organization value) { - this.ownerTarget = value; - return this; - } - - /** - * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactPoint item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact details for an organization or a particular human that is responsible for the device.) - */ - // syntactic sugar - public ContactPoint addContact() { //3 - ContactPoint t = new ContactPoint(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Device addContact(ContactPoint t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #location} (The place where the device can be found.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The place where the device can be found.) - */ - public Device setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The place where the device can be found.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The place where the device can be found.) - */ - public Device setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Device.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (A network address on which the device may be contacted directly.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Device setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return A network address on which the device may be contacted directly. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value A network address on which the device may be contacted directly. - */ - public Device setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Descriptive information, usage information or implantation information that is not captured in an existing element.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public Device addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique instance identifiers assigned to a device by manufacturers other organizations or owners.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("udiCarrier", "Identifier", "[Unique device identifier (UDI)](device.html#5.11.3.2.2) barcode or rfid string assigned to device label or package.", 0, java.lang.Integer.MAX_VALUE, udiCarrier)); - childrenList.add(new Property("status", "code", "Status of the Device availability.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "Code or identifier to identify a kind of device.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("lotNumber", "string", "Lot number assigned by the manufacturer.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("manufacturer", "string", "A name of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("manufactureDate", "dateTime", "The date and time when the device was manufactured.", 0, java.lang.Integer.MAX_VALUE, manufactureDate)); - childrenList.add(new Property("expirationDate", "dateTime", "The date and time beyond which this device is no longer valid or should not be used (if applicable).", 0, java.lang.Integer.MAX_VALUE, expirationDate)); - childrenList.add(new Property("model", "string", "The \"model\" is 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.", 0, java.lang.Integer.MAX_VALUE, model)); - childrenList.add(new Property("version", "string", "The version of the device, if the device has multiple releases under the same model, or if the device is software or carries firmware.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("patient", "Reference(Patient)", "Patient information, If the device is affixed to a person.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("owner", "Reference(Organization)", "An organization that is responsible for the provision and ongoing maintenance of the device.", 0, java.lang.Integer.MAX_VALUE, owner)); - childrenList.add(new Property("contact", "ContactPoint", "Contact details for an organization or a particular human that is responsible for the device.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("location", "Reference(Location)", "The place where the device can be found.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("url", "uri", "A network address on which the device may be contacted directly.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("note", "Annotation", "Descriptive information, usage information or implantation information that is not captured in an existing element.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1343558178: /*udiCarrier*/ return this.udiCarrier == null ? new Base[0] : new Base[] {this.udiCarrier}; // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType - case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // StringType - case 416714767: /*manufactureDate*/ return this.manufactureDate == null ? new Base[0] : new Base[] {this.manufactureDate}; // DateTimeType - case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType - case 104069929: /*model*/ return this.model == null ? new Base[0] : new Base[] {this.model}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1343558178: // udiCarrier - this.udiCarrier = castToIdentifier(value); // Identifier - break; - case -892481550: // status - this.status = new DeviceStatusEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case 462547450: // lotNumber - this.lotNumber = castToString(value); // StringType - break; - case -1969347631: // manufacturer - this.manufacturer = castToString(value); // StringType - break; - case 416714767: // manufactureDate - this.manufactureDate = castToDateTime(value); // DateTimeType - break; - case -668811523: // expirationDate - this.expirationDate = castToDateTime(value); // DateTimeType - break; - case 104069929: // model - this.model = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 106164915: // owner - this.owner = castToReference(value); // Reference - break; - case 951526432: // contact - this.getContact().add(castToContactPoint(value)); // ContactPoint - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("udiCarrier")) - this.udiCarrier = castToIdentifier(value); // Identifier - else if (name.equals("status")) - this.status = new DeviceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("lotNumber")) - this.lotNumber = castToString(value); // StringType - else if (name.equals("manufacturer")) - this.manufacturer = castToString(value); // StringType - else if (name.equals("manufactureDate")) - this.manufactureDate = castToDateTime(value); // DateTimeType - else if (name.equals("expirationDate")) - this.expirationDate = castToDateTime(value); // DateTimeType - else if (name.equals("model")) - this.model = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("owner")) - this.owner = castToReference(value); // Reference - else if (name.equals("contact")) - this.getContact().add(castToContactPoint(value)); - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1343558178: return getUdiCarrier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3575610: return getType(); // CodeableConcept - case 462547450: throw new FHIRException("Cannot make property lotNumber as it is not a complex type"); // StringType - case -1969347631: throw new FHIRException("Cannot make property manufacturer as it is not a complex type"); // StringType - case 416714767: throw new FHIRException("Cannot make property manufactureDate as it is not a complex type"); // DateTimeType - case -668811523: throw new FHIRException("Cannot make property expirationDate as it is not a complex type"); // DateTimeType - case 104069929: throw new FHIRException("Cannot make property model as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case -791418107: return getPatient(); // Reference - case 106164915: return getOwner(); // Reference - case 951526432: return addContact(); // ContactPoint - case 1901043637: return getLocation(); // Reference - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 3387378: return addNote(); // Annotation - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("udiCarrier")) { - this.udiCarrier = new Identifier(); - return this.udiCarrier; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.status"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("lotNumber")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.lotNumber"); - } - else if (name.equals("manufacturer")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.manufacturer"); - } - else if (name.equals("manufactureDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.manufactureDate"); - } - else if (name.equals("expirationDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.expirationDate"); - } - else if (name.equals("model")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.model"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.version"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("owner")) { - this.owner = new Reference(); - return this.owner; - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Device.url"); - } - else if (name.equals("note")) { - return addNote(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Device"; - - } - - public Device copy() { - Device dst = new Device(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.udiCarrier = udiCarrier == null ? null : udiCarrier.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.manufactureDate = manufactureDate == null ? null : manufactureDate.copy(); - dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); - dst.model = model == null ? null : model.copy(); - dst.version = version == null ? null : version.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.owner = owner == null ? null : owner.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactPoint i : contact) - dst.contact.add(i.copy()); - }; - dst.location = location == null ? null : location.copy(); - dst.url = url == null ? null : url.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - protected Device typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Device)) - return false; - Device o = (Device) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(udiCarrier, o.udiCarrier, true) - && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) && compareDeep(lotNumber, o.lotNumber, true) - && compareDeep(manufacturer, o.manufacturer, true) && compareDeep(manufactureDate, o.manufactureDate, true) - && compareDeep(expirationDate, o.expirationDate, true) && compareDeep(model, o.model, true) && compareDeep(version, o.version, true) - && compareDeep(patient, o.patient, true) && compareDeep(owner, o.owner, true) && compareDeep(contact, o.contact, true) - && compareDeep(location, o.location, true) && compareDeep(url, o.url, true) && compareDeep(note, o.note, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Device)) - return false; - Device o = (Device) other; - return compareValues(status, o.status, true) && compareValues(lotNumber, o.lotNumber, true) && compareValues(manufacturer, o.manufacturer, true) - && compareValues(manufactureDate, o.manufactureDate, true) && compareValues(expirationDate, o.expirationDate, true) - && compareValues(model, o.model, true) && compareValues(version, o.version, true) && compareValues(url, o.url, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (udiCarrier == null || udiCarrier.isEmpty()) - && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) - && (manufacturer == null || manufacturer.isEmpty()) && (manufactureDate == null || manufactureDate.isEmpty()) - && (expirationDate == null || expirationDate.isEmpty()) && (model == null || model.isEmpty()) - && (version == null || version.isEmpty()) && (patient == null || patient.isEmpty()) && (owner == null || owner.isEmpty()) - && (contact == null || contact.isEmpty()) && (location == null || location.isEmpty()) && (url == null || url.isEmpty()) - && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Device; - } - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Device:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Device:organization").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam MODEL = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MODEL); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Device:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Device:patient").toLocked(); - - /** - * Search parameter: udicarrier - *

- * Description: Barcode string (udi)
- * Type: token
- * Path: Device.udiCarrier
- *

- */ - @SearchParamDefinition(name="udicarrier", path="Device.udiCarrier", description="Barcode string (udi)", type="token" ) - public static final String SP_UDICARRIER = "udicarrier"; - /** - * Fluent Client search parameter constant for udicarrier - *

- * Description: Barcode string (udi)
- * Type: token
- * Path: Device.udiCarrier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam UDICARRIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_UDICARRIER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Device:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Device:location").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_MANUFACTURER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: Instance id from manufacturer, owner, and others
- * Type: token
- * Path: Device.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Device.identifier", description="Instance id from manufacturer, owner, and others", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Instance id from manufacturer, owner, and others
- * Type: token
- * Path: Device.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: url - *

- * Description: Network address to contact device
- * Type: uri
- * Path: Device.url
- *

- */ - @SearchParamDefinition(name="url", path="Device.url", description="Network address to contact device", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Network address to contact device
- * Type: uri
- * Path: Device.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceComponent.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceComponent.java deleted file mode 100644 index d860f0e6448..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceComponent.java +++ /dev/null @@ -1,1288 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. - */ -@ResourceDef(name="DeviceComponent", profile="http://hl7.org/fhir/Profile/DeviceComponent") -public class DeviceComponent extends DomainResource { - - public enum MeasmntPrinciple { - /** - * Measurement principle isn't in the list. - */ - OTHER, - /** - * Measurement is done using the chemical principle. - */ - CHEMICAL, - /** - * Measurement is done using the electrical principle. - */ - ELECTRICAL, - /** - * Measurement is done using the impedance principle. - */ - IMPEDANCE, - /** - * Measurement is done using the nuclear principle. - */ - NUCLEAR, - /** - * Measurement is done using the optical principle. - */ - OPTICAL, - /** - * Measurement is done using the thermal principle. - */ - THERMAL, - /** - * Measurement is done using the biological principle. - */ - BIOLOGICAL, - /** - * Measurement is done using the mechanical principle. - */ - MECHANICAL, - /** - * Measurement is done using the acoustical principle. - */ - ACOUSTICAL, - /** - * Measurement is done using the manual principle. - */ - MANUAL, - /** - * added to help the parsers - */ - NULL; - public static MeasmntPrinciple fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("other".equals(codeString)) - return OTHER; - if ("chemical".equals(codeString)) - return CHEMICAL; - if ("electrical".equals(codeString)) - return ELECTRICAL; - if ("impedance".equals(codeString)) - return IMPEDANCE; - if ("nuclear".equals(codeString)) - return NUCLEAR; - if ("optical".equals(codeString)) - return OPTICAL; - if ("thermal".equals(codeString)) - return THERMAL; - if ("biological".equals(codeString)) - return BIOLOGICAL; - if ("mechanical".equals(codeString)) - return MECHANICAL; - if ("acoustical".equals(codeString)) - return ACOUSTICAL; - if ("manual".equals(codeString)) - return MANUAL; - throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OTHER: return "other"; - case CHEMICAL: return "chemical"; - case ELECTRICAL: return "electrical"; - case IMPEDANCE: return "impedance"; - case NUCLEAR: return "nuclear"; - case OPTICAL: return "optical"; - case THERMAL: return "thermal"; - case BIOLOGICAL: return "biological"; - case MECHANICAL: return "mechanical"; - case ACOUSTICAL: return "acoustical"; - case MANUAL: return "manual"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OTHER: return "http://hl7.org/fhir/measurement-principle"; - case CHEMICAL: return "http://hl7.org/fhir/measurement-principle"; - case ELECTRICAL: return "http://hl7.org/fhir/measurement-principle"; - case IMPEDANCE: return "http://hl7.org/fhir/measurement-principle"; - case NUCLEAR: return "http://hl7.org/fhir/measurement-principle"; - case OPTICAL: return "http://hl7.org/fhir/measurement-principle"; - case THERMAL: return "http://hl7.org/fhir/measurement-principle"; - case BIOLOGICAL: return "http://hl7.org/fhir/measurement-principle"; - case MECHANICAL: return "http://hl7.org/fhir/measurement-principle"; - case ACOUSTICAL: return "http://hl7.org/fhir/measurement-principle"; - case MANUAL: return "http://hl7.org/fhir/measurement-principle"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OTHER: return "Measurement principle isn't in the list."; - case CHEMICAL: return "Measurement is done using the chemical principle."; - case ELECTRICAL: return "Measurement is done using the electrical principle."; - case IMPEDANCE: return "Measurement is done using the impedance principle."; - case NUCLEAR: return "Measurement is done using the nuclear principle."; - case OPTICAL: return "Measurement is done using the optical principle."; - case THERMAL: return "Measurement is done using the thermal principle."; - case BIOLOGICAL: return "Measurement is done using the biological principle."; - case MECHANICAL: return "Measurement is done using the mechanical principle."; - case ACOUSTICAL: return "Measurement is done using the acoustical principle."; - case MANUAL: return "Measurement is done using the manual principle."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OTHER: return "MSP Other"; - case CHEMICAL: return "MSP Chemical"; - case ELECTRICAL: return "MSP Electrical"; - case IMPEDANCE: return "MSP Impedance"; - case NUCLEAR: return "MSP Nuclear"; - case OPTICAL: return "MSP Optical"; - case THERMAL: return "MSP Thermal"; - case BIOLOGICAL: return "MSP Biological"; - case MECHANICAL: return "MSP Mechanical"; - case ACOUSTICAL: return "MSP Acoustical"; - case MANUAL: return "MSP Manual"; - default: return "?"; - } - } - } - - public static class MeasmntPrincipleEnumFactory implements EnumFactory { - public MeasmntPrinciple fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("other".equals(codeString)) - return MeasmntPrinciple.OTHER; - if ("chemical".equals(codeString)) - return MeasmntPrinciple.CHEMICAL; - if ("electrical".equals(codeString)) - return MeasmntPrinciple.ELECTRICAL; - if ("impedance".equals(codeString)) - return MeasmntPrinciple.IMPEDANCE; - if ("nuclear".equals(codeString)) - return MeasmntPrinciple.NUCLEAR; - if ("optical".equals(codeString)) - return MeasmntPrinciple.OPTICAL; - if ("thermal".equals(codeString)) - return MeasmntPrinciple.THERMAL; - if ("biological".equals(codeString)) - return MeasmntPrinciple.BIOLOGICAL; - if ("mechanical".equals(codeString)) - return MeasmntPrinciple.MECHANICAL; - if ("acoustical".equals(codeString)) - return MeasmntPrinciple.ACOUSTICAL; - if ("manual".equals(codeString)) - return MeasmntPrinciple.MANUAL; - throw new IllegalArgumentException("Unknown MeasmntPrinciple code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("other".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.OTHER); - if ("chemical".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.CHEMICAL); - if ("electrical".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.ELECTRICAL); - if ("impedance".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.IMPEDANCE); - if ("nuclear".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.NUCLEAR); - if ("optical".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.OPTICAL); - if ("thermal".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.THERMAL); - if ("biological".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.BIOLOGICAL); - if ("mechanical".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.MECHANICAL); - if ("acoustical".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.ACOUSTICAL); - if ("manual".equals(codeString)) - return new Enumeration(this, MeasmntPrinciple.MANUAL); - throw new FHIRException("Unknown MeasmntPrinciple code '"+codeString+"'"); - } - public String toCode(MeasmntPrinciple code) { - if (code == MeasmntPrinciple.OTHER) - return "other"; - if (code == MeasmntPrinciple.CHEMICAL) - return "chemical"; - if (code == MeasmntPrinciple.ELECTRICAL) - return "electrical"; - if (code == MeasmntPrinciple.IMPEDANCE) - return "impedance"; - if (code == MeasmntPrinciple.NUCLEAR) - return "nuclear"; - if (code == MeasmntPrinciple.OPTICAL) - return "optical"; - if (code == MeasmntPrinciple.THERMAL) - return "thermal"; - if (code == MeasmntPrinciple.BIOLOGICAL) - return "biological"; - if (code == MeasmntPrinciple.MECHANICAL) - return "mechanical"; - if (code == MeasmntPrinciple.ACOUSTICAL) - return "acoustical"; - if (code == MeasmntPrinciple.MANUAL) - return "manual"; - return "?"; - } - public String toSystem(MeasmntPrinciple code) { - return code.getSystem(); - } - } - - @Block() - public static class DeviceComponentProductionSpecificationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc. - */ - @Child(name = "specType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specification type", formalDefinition="Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc." ) - protected CodeableConcept specType; - - /** - * Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of. - */ - @Child(name = "componentId", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Internal component unique identification", formalDefinition="Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of." ) - protected Identifier componentId; - - /** - * Describes the printable string defining the component. - */ - @Child(name = "productionSpec", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A printable string defining the component", formalDefinition="Describes the printable string defining the component." ) - protected StringType productionSpec; - - private static final long serialVersionUID = -1476597516L; - - /** - * Constructor - */ - public DeviceComponentProductionSpecificationComponent() { - super(); - } - - /** - * @return {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) - */ - public CodeableConcept getSpecType() { - if (this.specType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.specType"); - else if (Configuration.doAutoCreate()) - this.specType = new CodeableConcept(); // cc - return this.specType; - } - - public boolean hasSpecType() { - return this.specType != null && !this.specType.isEmpty(); - } - - /** - * @param value {@link #specType} (Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.) - */ - public DeviceComponentProductionSpecificationComponent setSpecType(CodeableConcept value) { - this.specType = value; - return this; - } - - /** - * @return {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) - */ - public Identifier getComponentId() { - if (this.componentId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.componentId"); - else if (Configuration.doAutoCreate()) - this.componentId = new Identifier(); // cc - return this.componentId; - } - - public boolean hasComponentId() { - return this.componentId != null && !this.componentId.isEmpty(); - } - - /** - * @param value {@link #componentId} (Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.) - */ - public DeviceComponentProductionSpecificationComponent setComponentId(Identifier value) { - this.componentId = value; - return this; - } - - /** - * @return {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value - */ - public StringType getProductionSpecElement() { - if (this.productionSpec == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponentProductionSpecificationComponent.productionSpec"); - else if (Configuration.doAutoCreate()) - this.productionSpec = new StringType(); // bb - return this.productionSpec; - } - - public boolean hasProductionSpecElement() { - return this.productionSpec != null && !this.productionSpec.isEmpty(); - } - - public boolean hasProductionSpec() { - return this.productionSpec != null && !this.productionSpec.isEmpty(); - } - - /** - * @param value {@link #productionSpec} (Describes the printable string defining the component.). This is the underlying object with id, value and extensions. The accessor "getProductionSpec" gives direct access to the value - */ - public DeviceComponentProductionSpecificationComponent setProductionSpecElement(StringType value) { - this.productionSpec = value; - return this; - } - - /** - * @return Describes the printable string defining the component. - */ - public String getProductionSpec() { - return this.productionSpec == null ? null : this.productionSpec.getValue(); - } - - /** - * @param value Describes the printable string defining the component. - */ - public DeviceComponentProductionSpecificationComponent setProductionSpec(String value) { - if (Utilities.noString(value)) - this.productionSpec = null; - else { - if (this.productionSpec == null) - this.productionSpec = new StringType(); - this.productionSpec.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("specType", "CodeableConcept", "Describes the specification type, such as, serial number, part number, hardware revision, software revision, etc.", 0, java.lang.Integer.MAX_VALUE, specType)); - childrenList.add(new Property("componentId", "Identifier", "Describes the internal component unique identification. This is a provision for manufacture specific standard components using a private OID. 11073-10101 has a partition for private OID semantic that the manufacture can make use of.", 0, java.lang.Integer.MAX_VALUE, componentId)); - childrenList.add(new Property("productionSpec", "string", "Describes the printable string defining the component.", 0, java.lang.Integer.MAX_VALUE, productionSpec)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -2133482091: /*specType*/ return this.specType == null ? new Base[0] : new Base[] {this.specType}; // CodeableConcept - case -985933064: /*componentId*/ return this.componentId == null ? new Base[0] : new Base[] {this.componentId}; // Identifier - case 182147092: /*productionSpec*/ return this.productionSpec == null ? new Base[0] : new Base[] {this.productionSpec}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -2133482091: // specType - this.specType = castToCodeableConcept(value); // CodeableConcept - break; - case -985933064: // componentId - this.componentId = castToIdentifier(value); // Identifier - break; - case 182147092: // productionSpec - this.productionSpec = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("specType")) - this.specType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("componentId")) - this.componentId = castToIdentifier(value); // Identifier - else if (name.equals("productionSpec")) - this.productionSpec = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -2133482091: return getSpecType(); // CodeableConcept - case -985933064: return getComponentId(); // Identifier - case 182147092: throw new FHIRException("Cannot make property productionSpec as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("specType")) { - this.specType = new CodeableConcept(); - return this.specType; - } - else if (name.equals("componentId")) { - this.componentId = new Identifier(); - return this.componentId; - } - else if (name.equals("productionSpec")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.productionSpec"); - } - else - return super.addChild(name); - } - - public DeviceComponentProductionSpecificationComponent copy() { - DeviceComponentProductionSpecificationComponent dst = new DeviceComponentProductionSpecificationComponent(); - copyValues(dst); - dst.specType = specType == null ? null : specType.copy(); - dst.componentId = componentId == null ? null : componentId.copy(); - dst.productionSpec = productionSpec == null ? null : productionSpec.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceComponentProductionSpecificationComponent)) - return false; - DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; - return compareDeep(specType, o.specType, true) && compareDeep(componentId, o.componentId, true) - && compareDeep(productionSpec, o.productionSpec, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceComponentProductionSpecificationComponent)) - return false; - DeviceComponentProductionSpecificationComponent o = (DeviceComponentProductionSpecificationComponent) other; - return compareValues(productionSpec, o.productionSpec, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (specType == null || specType.isEmpty()) && (componentId == null || componentId.isEmpty()) - && (productionSpec == null || productionSpec.isEmpty()); - } - - public String fhirType() { - return "DeviceComponent.productionSpecification"; - - } - - } - - /** - * Describes the specific component type as defined in the object-oriented or metric nomenclature partition. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="What kind of component it is", formalDefinition="Describes the specific component type as defined in the object-oriented or metric nomenclature partition." ) - protected CodeableConcept type; - - /** - * Describes the local assigned unique identification by the software. For example: handle ID. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Instance id assigned by the software stack", formalDefinition="Describes the local assigned unique identification by the software. For example: handle ID." ) - protected Identifier identifier; - - /** - * Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - @Child(name = "lastSystemChange", type = {InstantType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Recent system change timestamp", formalDefinition="Describes the timestamp for the most recent system change which includes device configuration or setting change." ) - protected InstantType lastSystemChange; - - /** - * Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc. - */ - @Child(name = "source", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A source device of this component", formalDefinition="Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - protected Device sourceTarget; - - /** - * Describes the link to the parent resource. For example: Channel is linked to its VMD parent. - */ - @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Parent resource link", formalDefinition="Describes the link to the parent resource. For example: Channel is linked to its VMD parent." ) - protected Reference parent; - - /** - * The actual object that is the target of the reference (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - protected DeviceComponent parentTarget; - - /** - * Indicates current operational status of the device. For example: On, Off, Standby, etc. - */ - @Child(name = "operationalStatus", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Component operational status", formalDefinition="Indicates current operational status of the device. For example: On, Off, Standby, etc." ) - protected List operationalStatus; - - /** - * Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular. - */ - @Child(name = "parameterGroup", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Current supported parameter group", formalDefinition="Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular." ) - protected CodeableConcept parameterGroup; - - /** - * Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - @Child(name = "measurementPrinciple", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+", formalDefinition="Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc." ) - protected Enumeration measurementPrinciple; - - /** - * Describes the production specification such as component revision, serial number, etc. - */ - @Child(name = "productionSpecification", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Production specification of the component", formalDefinition="Describes the production specification such as component revision, serial number, etc." ) - protected List productionSpecification; - - /** - * Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US. - */ - @Child(name = "languageCode", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Language code for the human-readable text strings produced by the device", formalDefinition="Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US." ) - protected CodeableConcept languageCode; - - private static final long serialVersionUID = -1742890034L; - - /** - * Constructor - */ - public DeviceComponent() { - super(); - } - - /** - * Constructor - */ - public DeviceComponent(CodeableConcept type, Identifier identifier, InstantType lastSystemChange) { - super(); - this.type = type; - this.identifier = identifier; - this.lastSystemChange = lastSystemChange; - } - - /** - * @return {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the specific component type as defined in the object-oriented or metric nomenclature partition.) - */ - public DeviceComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Describes the local assigned unique identification by the software. For example: handle ID.) - */ - public DeviceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value - */ - public InstantType getLastSystemChangeElement() { - if (this.lastSystemChange == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.lastSystemChange"); - else if (Configuration.doAutoCreate()) - this.lastSystemChange = new InstantType(); // bb - return this.lastSystemChange; - } - - public boolean hasLastSystemChangeElement() { - return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); - } - - public boolean hasLastSystemChange() { - return this.lastSystemChange != null && !this.lastSystemChange.isEmpty(); - } - - /** - * @param value {@link #lastSystemChange} (Describes the timestamp for the most recent system change which includes device configuration or setting change.). This is the underlying object with id, value and extensions. The accessor "getLastSystemChange" gives direct access to the value - */ - public DeviceComponent setLastSystemChangeElement(InstantType value) { - this.lastSystemChange = value; - return this; - } - - /** - * @return Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - public Date getLastSystemChange() { - return this.lastSystemChange == null ? null : this.lastSystemChange.getValue(); - } - - /** - * @param value Describes the timestamp for the most recent system change which includes device configuration or setting change. - */ - public DeviceComponent setLastSystemChange(Date value) { - if (this.lastSystemChange == null) - this.lastSystemChange = new InstantType(); - this.lastSystemChange.setValue(value); - return this; - } - - /** - * @return {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceComponent setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public Device getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Device(); // aa - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceComponent setSourceTarget(Device value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); // cc - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** - * @param value {@link #parent} (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent setParent(Reference value) { - this.parent = value; - return this; - } - - /** - * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new DeviceComponent(); // aa - return this.parentTarget; - } - - /** - * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the parent resource. For example: Channel is linked to its VMD parent.) - */ - public DeviceComponent setParentTarget(DeviceComponent value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) - */ - public List getOperationalStatus() { - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - return this.operationalStatus; - } - - public boolean hasOperationalStatus() { - if (this.operationalStatus == null) - return false; - for (CodeableConcept item : this.operationalStatus) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational status of the device. For example: On, Off, Standby, etc.) - */ - // syntactic sugar - public CodeableConcept addOperationalStatus() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - this.operationalStatus.add(t); - return t; - } - - // syntactic sugar - public DeviceComponent addOperationalStatus(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.operationalStatus == null) - this.operationalStatus = new ArrayList(); - this.operationalStatus.add(t); - return this; - } - - /** - * @return {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.) - */ - public CodeableConcept getParameterGroup() { - if (this.parameterGroup == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.parameterGroup"); - else if (Configuration.doAutoCreate()) - this.parameterGroup = new CodeableConcept(); // cc - return this.parameterGroup; - } - - public boolean hasParameterGroup() { - return this.parameterGroup != null && !this.parameterGroup.isEmpty(); - } - - /** - * @param value {@link #parameterGroup} (Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.) - */ - public DeviceComponent setParameterGroup(CodeableConcept value) { - this.parameterGroup = value; - return this; - } - - /** - * @return {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value - */ - public Enumeration getMeasurementPrincipleElement() { - if (this.measurementPrinciple == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.measurementPrinciple"); - else if (Configuration.doAutoCreate()) - this.measurementPrinciple = new Enumeration(new MeasmntPrincipleEnumFactory()); // bb - return this.measurementPrinciple; - } - - public boolean hasMeasurementPrincipleElement() { - return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); - } - - public boolean hasMeasurementPrinciple() { - return this.measurementPrinciple != null && !this.measurementPrinciple.isEmpty(); - } - - /** - * @param value {@link #measurementPrinciple} (Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.). This is the underlying object with id, value and extensions. The accessor "getMeasurementPrinciple" gives direct access to the value - */ - public DeviceComponent setMeasurementPrincipleElement(Enumeration value) { - this.measurementPrinciple = value; - return this; - } - - /** - * @return Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - public MeasmntPrinciple getMeasurementPrinciple() { - return this.measurementPrinciple == null ? null : this.measurementPrinciple.getValue(); - } - - /** - * @param value Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. - */ - public DeviceComponent setMeasurementPrinciple(MeasmntPrinciple value) { - if (value == null) - this.measurementPrinciple = null; - else { - if (this.measurementPrinciple == null) - this.measurementPrinciple = new Enumeration(new MeasmntPrincipleEnumFactory()); - this.measurementPrinciple.setValue(value); - } - return this; - } - - /** - * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) - */ - public List getProductionSpecification() { - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - return this.productionSpecification; - } - - public boolean hasProductionSpecification() { - if (this.productionSpecification == null) - return false; - for (DeviceComponentProductionSpecificationComponent item : this.productionSpecification) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #productionSpecification} (Describes the production specification such as component revision, serial number, etc.) - */ - // syntactic sugar - public DeviceComponentProductionSpecificationComponent addProductionSpecification() { //3 - DeviceComponentProductionSpecificationComponent t = new DeviceComponentProductionSpecificationComponent(); - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - this.productionSpecification.add(t); - return t; - } - - // syntactic sugar - public DeviceComponent addProductionSpecification(DeviceComponentProductionSpecificationComponent t) { //3 - if (t == null) - return this; - if (this.productionSpecification == null) - this.productionSpecification = new ArrayList(); - this.productionSpecification.add(t); - return this; - } - - /** - * @return {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) - */ - public CodeableConcept getLanguageCode() { - if (this.languageCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceComponent.languageCode"); - else if (Configuration.doAutoCreate()) - this.languageCode = new CodeableConcept(); // cc - return this.languageCode; - } - - public boolean hasLanguageCode() { - return this.languageCode != null && !this.languageCode.isEmpty(); - } - - /** - * @param value {@link #languageCode} (Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.) - */ - public DeviceComponent setLanguageCode(CodeableConcept value) { - this.languageCode = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Describes the specific component type as defined in the object-oriented or metric nomenclature partition.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "Describes the local assigned unique identification by the software. For example: handle ID.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("lastSystemChange", "instant", "Describes the timestamp for the most recent system change which includes device configuration or setting change.", 0, java.lang.Integer.MAX_VALUE, lastSystemChange)); - childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the source Device that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the parent resource. For example: Channel is linked to its VMD parent.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("operationalStatus", "CodeableConcept", "Indicates current operational status of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); - childrenList.add(new Property("parameterGroup", "CodeableConcept", "Describes the parameter group supported by the current device component that is based on some nomenclature, e.g. cardiovascular.", 0, java.lang.Integer.MAX_VALUE, parameterGroup)); - childrenList.add(new Property("measurementPrinciple", "code", "Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc.", 0, java.lang.Integer.MAX_VALUE, measurementPrinciple)); - childrenList.add(new Property("productionSpecification", "", "Describes the production specification such as component revision, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, productionSpecification)); - childrenList.add(new Property("languageCode", "CodeableConcept", "Describes the language code for the human-readable text string produced by the device. This language code will follow the IETF language tag. Example: en-US.", 0, java.lang.Integer.MAX_VALUE, languageCode)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -2072475531: /*lastSystemChange*/ return this.lastSystemChange == null ? new Base[0] : new Base[] {this.lastSystemChange}; // InstantType - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference - case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference - case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : this.operationalStatus.toArray(new Base[this.operationalStatus.size()]); // CodeableConcept - case 1111110742: /*parameterGroup*/ return this.parameterGroup == null ? new Base[0] : new Base[] {this.parameterGroup}; // CodeableConcept - case 24324384: /*measurementPrinciple*/ return this.measurementPrinciple == null ? new Base[0] : new Base[] {this.measurementPrinciple}; // Enumeration - case -455527222: /*productionSpecification*/ return this.productionSpecification == null ? new Base[0] : this.productionSpecification.toArray(new Base[this.productionSpecification.size()]); // DeviceComponentProductionSpecificationComponent - case -2092349083: /*languageCode*/ return this.languageCode == null ? new Base[0] : new Base[] {this.languageCode}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -2072475531: // lastSystemChange - this.lastSystemChange = castToInstant(value); // InstantType - break; - case -896505829: // source - this.source = castToReference(value); // Reference - break; - case -995424086: // parent - this.parent = castToReference(value); // Reference - break; - case -2103166364: // operationalStatus - this.getOperationalStatus().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1111110742: // parameterGroup - this.parameterGroup = castToCodeableConcept(value); // CodeableConcept - break; - case 24324384: // measurementPrinciple - this.measurementPrinciple = new MeasmntPrincipleEnumFactory().fromType(value); // Enumeration - break; - case -455527222: // productionSpecification - this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); // DeviceComponentProductionSpecificationComponent - break; - case -2092349083: // languageCode - this.languageCode = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("lastSystemChange")) - this.lastSystemChange = castToInstant(value); // InstantType - else if (name.equals("source")) - this.source = castToReference(value); // Reference - else if (name.equals("parent")) - this.parent = castToReference(value); // Reference - else if (name.equals("operationalStatus")) - this.getOperationalStatus().add(castToCodeableConcept(value)); - else if (name.equals("parameterGroup")) - this.parameterGroup = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("measurementPrinciple")) - this.measurementPrinciple = new MeasmntPrincipleEnumFactory().fromType(value); // Enumeration - else if (name.equals("productionSpecification")) - this.getProductionSpecification().add((DeviceComponentProductionSpecificationComponent) value); - else if (name.equals("languageCode")) - this.languageCode = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -1618432855: return getIdentifier(); // Identifier - case -2072475531: throw new FHIRException("Cannot make property lastSystemChange as it is not a complex type"); // InstantType - case -896505829: return getSource(); // Reference - case -995424086: return getParent(); // Reference - case -2103166364: return addOperationalStatus(); // CodeableConcept - case 1111110742: return getParameterGroup(); // CodeableConcept - case 24324384: throw new FHIRException("Cannot make property measurementPrinciple as it is not a complex type"); // Enumeration - case -455527222: return addProductionSpecification(); // DeviceComponentProductionSpecificationComponent - case -2092349083: return getLanguageCode(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("lastSystemChange")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.lastSystemChange"); - } - else if (name.equals("source")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("parent")) { - this.parent = new Reference(); - return this.parent; - } - else if (name.equals("operationalStatus")) { - return addOperationalStatus(); - } - else if (name.equals("parameterGroup")) { - this.parameterGroup = new CodeableConcept(); - return this.parameterGroup; - } - else if (name.equals("measurementPrinciple")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceComponent.measurementPrinciple"); - } - else if (name.equals("productionSpecification")) { - return addProductionSpecification(); - } - else if (name.equals("languageCode")) { - this.languageCode = new CodeableConcept(); - return this.languageCode; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DeviceComponent"; - - } - - public DeviceComponent copy() { - DeviceComponent dst = new DeviceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.lastSystemChange = lastSystemChange == null ? null : lastSystemChange.copy(); - dst.source = source == null ? null : source.copy(); - dst.parent = parent == null ? null : parent.copy(); - if (operationalStatus != null) { - dst.operationalStatus = new ArrayList(); - for (CodeableConcept i : operationalStatus) - dst.operationalStatus.add(i.copy()); - }; - dst.parameterGroup = parameterGroup == null ? null : parameterGroup.copy(); - dst.measurementPrinciple = measurementPrinciple == null ? null : measurementPrinciple.copy(); - if (productionSpecification != null) { - dst.productionSpecification = new ArrayList(); - for (DeviceComponentProductionSpecificationComponent i : productionSpecification) - dst.productionSpecification.add(i.copy()); - }; - dst.languageCode = languageCode == null ? null : languageCode.copy(); - return dst; - } - - protected DeviceComponent typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceComponent)) - return false; - DeviceComponent o = (DeviceComponent) other; - return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(lastSystemChange, o.lastSystemChange, true) - && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) - && compareDeep(parameterGroup, o.parameterGroup, true) && compareDeep(measurementPrinciple, o.measurementPrinciple, true) - && compareDeep(productionSpecification, o.productionSpecification, true) && compareDeep(languageCode, o.languageCode, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceComponent)) - return false; - DeviceComponent o = (DeviceComponent) other; - return compareValues(lastSystemChange, o.lastSystemChange, true) && compareValues(measurementPrinciple, o.measurementPrinciple, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (lastSystemChange == null || lastSystemChange.isEmpty()) && (source == null || source.isEmpty()) - && (parent == null || parent.isEmpty()) && (operationalStatus == null || operationalStatus.isEmpty()) - && (parameterGroup == null || parameterGroup.isEmpty()) && (measurementPrinciple == null || measurementPrinciple.isEmpty()) - && (productionSpecification == null || productionSpecification.isEmpty()) && (languageCode == null || languageCode.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceComponent; - } - - /** - * Search parameter: source - *

- * Description: The device source
- * Type: reference
- * Path: DeviceComponent.source
- *

- */ - @SearchParamDefinition(name="source", path="DeviceComponent.source", description="The device source", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: The device source
- * Type: reference
- * Path: DeviceComponent.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceComponent:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceComponent:source").toLocked(); - - /** - * Search parameter: parent - *

- * Description: The parent DeviceComponent resource
- * Type: reference
- * Path: DeviceComponent.parent
- *

- */ - @SearchParamDefinition(name="parent", path="DeviceComponent.parent", description="The parent DeviceComponent resource", type="reference" ) - public static final String SP_PARENT = "parent"; - /** - * Fluent Client search parameter constant for parent - *

- * Description: The parent DeviceComponent resource
- * Type: reference
- * Path: DeviceComponent.parent
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceComponent:parent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceComponent:parent").toLocked(); - - /** - * Search parameter: type - *

- * Description: The device component type
- * Type: token
- * Path: DeviceComponent.type
- *

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

- * Description: The device component type
- * Type: token
- * Path: DeviceComponent.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceMetric.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceMetric.java deleted file mode 100644 index 8bf346261e6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceMetric.java +++ /dev/null @@ -1,1791 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * Describes a measurement, calculation or setting capability of a medical device. - */ -@ResourceDef(name="DeviceMetric", profile="http://hl7.org/fhir/Profile/DeviceMetric") -public class DeviceMetric extends DomainResource { - - public enum DeviceMetricOperationalStatus { - /** - * The DeviceMetric is operating and will generate DeviceObservations. - */ - ON, - /** - * The DeviceMetric is not operating. - */ - OFF, - /** - * The DeviceMetric is operating, but will not generate any DeviceObservations. - */ - STANDBY, - /** - * added to help the parsers - */ - NULL; - public static DeviceMetricOperationalStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return ON; - if ("off".equals(codeString)) - return OFF; - if ("standby".equals(codeString)) - return STANDBY; - throw new FHIRException("Unknown DeviceMetricOperationalStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ON: return "on"; - case OFF: return "off"; - case STANDBY: return "standby"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ON: return "http://hl7.org/fhir/metric-operational-status"; - case OFF: return "http://hl7.org/fhir/metric-operational-status"; - case STANDBY: return "http://hl7.org/fhir/metric-operational-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ON: return "The DeviceMetric is operating and will generate DeviceObservations."; - case OFF: return "The DeviceMetric is not operating."; - case STANDBY: return "The DeviceMetric is operating, but will not generate any DeviceObservations."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ON: return "On"; - case OFF: return "Off"; - case STANDBY: return "Standby"; - default: return "?"; - } - } - } - - public static class DeviceMetricOperationalStatusEnumFactory implements EnumFactory { - public DeviceMetricOperationalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return DeviceMetricOperationalStatus.ON; - if ("off".equals(codeString)) - return DeviceMetricOperationalStatus.OFF; - if ("standby".equals(codeString)) - return DeviceMetricOperationalStatus.STANDBY; - throw new IllegalArgumentException("Unknown DeviceMetricOperationalStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("on".equals(codeString)) - return new Enumeration(this, DeviceMetricOperationalStatus.ON); - if ("off".equals(codeString)) - return new Enumeration(this, DeviceMetricOperationalStatus.OFF); - if ("standby".equals(codeString)) - return new Enumeration(this, DeviceMetricOperationalStatus.STANDBY); - throw new FHIRException("Unknown DeviceMetricOperationalStatus code '"+codeString+"'"); - } - public String toCode(DeviceMetricOperationalStatus code) { - if (code == DeviceMetricOperationalStatus.ON) - return "on"; - if (code == DeviceMetricOperationalStatus.OFF) - return "off"; - if (code == DeviceMetricOperationalStatus.STANDBY) - return "standby"; - return "?"; - } - public String toSystem(DeviceMetricOperationalStatus code) { - return code.getSystem(); - } - } - - public enum DeviceMetricColor { - /** - * Color for representation - black. - */ - BLACK, - /** - * Color for representation - red. - */ - RED, - /** - * Color for representation - green. - */ - GREEN, - /** - * Color for representation - yellow. - */ - YELLOW, - /** - * Color for representation - blue. - */ - BLUE, - /** - * Color for representation - magenta. - */ - MAGENTA, - /** - * Color for representation - cyan. - */ - CYAN, - /** - * Color for representation - white. - */ - WHITE, - /** - * added to help the parsers - */ - NULL; - public static DeviceMetricColor fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("black".equals(codeString)) - return BLACK; - if ("red".equals(codeString)) - return RED; - if ("green".equals(codeString)) - return GREEN; - if ("yellow".equals(codeString)) - return YELLOW; - if ("blue".equals(codeString)) - return BLUE; - if ("magenta".equals(codeString)) - return MAGENTA; - if ("cyan".equals(codeString)) - return CYAN; - if ("white".equals(codeString)) - return WHITE; - throw new FHIRException("Unknown DeviceMetricColor code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case BLACK: return "black"; - case RED: return "red"; - case GREEN: return "green"; - case YELLOW: return "yellow"; - case BLUE: return "blue"; - case MAGENTA: return "magenta"; - case CYAN: return "cyan"; - case WHITE: return "white"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BLACK: return "http://hl7.org/fhir/metric-color"; - case RED: return "http://hl7.org/fhir/metric-color"; - case GREEN: return "http://hl7.org/fhir/metric-color"; - case YELLOW: return "http://hl7.org/fhir/metric-color"; - case BLUE: return "http://hl7.org/fhir/metric-color"; - case MAGENTA: return "http://hl7.org/fhir/metric-color"; - case CYAN: return "http://hl7.org/fhir/metric-color"; - case WHITE: return "http://hl7.org/fhir/metric-color"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BLACK: return "Color for representation - black."; - case RED: return "Color for representation - red."; - case GREEN: return "Color for representation - green."; - case YELLOW: return "Color for representation - yellow."; - case BLUE: return "Color for representation - blue."; - case MAGENTA: return "Color for representation - magenta."; - case CYAN: return "Color for representation - cyan."; - case WHITE: return "Color for representation - white."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BLACK: return "Color Black"; - case RED: return "Color Red"; - case GREEN: return "Color Green"; - case YELLOW: return "Color Yellow"; - case BLUE: return "Color Blue"; - case MAGENTA: return "Color Magenta"; - case CYAN: return "Color Cyan"; - case WHITE: return "Color White"; - default: return "?"; - } - } - } - - public static class DeviceMetricColorEnumFactory implements EnumFactory { - public DeviceMetricColor fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("black".equals(codeString)) - return DeviceMetricColor.BLACK; - if ("red".equals(codeString)) - return DeviceMetricColor.RED; - if ("green".equals(codeString)) - return DeviceMetricColor.GREEN; - if ("yellow".equals(codeString)) - return DeviceMetricColor.YELLOW; - if ("blue".equals(codeString)) - return DeviceMetricColor.BLUE; - if ("magenta".equals(codeString)) - return DeviceMetricColor.MAGENTA; - if ("cyan".equals(codeString)) - return DeviceMetricColor.CYAN; - if ("white".equals(codeString)) - return DeviceMetricColor.WHITE; - throw new IllegalArgumentException("Unknown DeviceMetricColor code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("black".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.BLACK); - if ("red".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.RED); - if ("green".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.GREEN); - if ("yellow".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.YELLOW); - if ("blue".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.BLUE); - if ("magenta".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.MAGENTA); - if ("cyan".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.CYAN); - if ("white".equals(codeString)) - return new Enumeration(this, DeviceMetricColor.WHITE); - throw new FHIRException("Unknown DeviceMetricColor code '"+codeString+"'"); - } - public String toCode(DeviceMetricColor code) { - if (code == DeviceMetricColor.BLACK) - return "black"; - if (code == DeviceMetricColor.RED) - return "red"; - if (code == DeviceMetricColor.GREEN) - return "green"; - if (code == DeviceMetricColor.YELLOW) - return "yellow"; - if (code == DeviceMetricColor.BLUE) - return "blue"; - if (code == DeviceMetricColor.MAGENTA) - return "magenta"; - if (code == DeviceMetricColor.CYAN) - return "cyan"; - if (code == DeviceMetricColor.WHITE) - return "white"; - return "?"; - } - public String toSystem(DeviceMetricColor code) { - return code.getSystem(); - } - } - - public enum DeviceMetricCategory { - /** - * DeviceObservations generated for this DeviceMetric are measured. - */ - MEASUREMENT, - /** - * DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. - */ - SETTING, - /** - * DeviceObservations generated for this DeviceMetric are calculated. - */ - CALCULATION, - /** - * The category of this DeviceMetric is unspecified. - */ - UNSPECIFIED, - /** - * added to help the parsers - */ - NULL; - public static DeviceMetricCategory fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return MEASUREMENT; - if ("setting".equals(codeString)) - return SETTING; - if ("calculation".equals(codeString)) - return CALCULATION; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - throw new FHIRException("Unknown DeviceMetricCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MEASUREMENT: return "measurement"; - case SETTING: return "setting"; - case CALCULATION: return "calculation"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MEASUREMENT: return "http://hl7.org/fhir/metric-category"; - case SETTING: return "http://hl7.org/fhir/metric-category"; - case CALCULATION: return "http://hl7.org/fhir/metric-category"; - case UNSPECIFIED: return "http://hl7.org/fhir/metric-category"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MEASUREMENT: return "DeviceObservations generated for this DeviceMetric are measured."; - case SETTING: return "DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device."; - case CALCULATION: return "DeviceObservations generated for this DeviceMetric are calculated."; - case UNSPECIFIED: return "The category of this DeviceMetric is unspecified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MEASUREMENT: return "Measurement"; - case SETTING: return "Setting"; - case CALCULATION: return "Calculation"; - case UNSPECIFIED: return "Unspecified"; - default: return "?"; - } - } - } - - public static class DeviceMetricCategoryEnumFactory implements EnumFactory { - public DeviceMetricCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return DeviceMetricCategory.MEASUREMENT; - if ("setting".equals(codeString)) - return DeviceMetricCategory.SETTING; - if ("calculation".equals(codeString)) - return DeviceMetricCategory.CALCULATION; - if ("unspecified".equals(codeString)) - return DeviceMetricCategory.UNSPECIFIED; - throw new IllegalArgumentException("Unknown DeviceMetricCategory code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("measurement".equals(codeString)) - return new Enumeration(this, DeviceMetricCategory.MEASUREMENT); - if ("setting".equals(codeString)) - return new Enumeration(this, DeviceMetricCategory.SETTING); - if ("calculation".equals(codeString)) - return new Enumeration(this, DeviceMetricCategory.CALCULATION); - if ("unspecified".equals(codeString)) - return new Enumeration(this, DeviceMetricCategory.UNSPECIFIED); - throw new FHIRException("Unknown DeviceMetricCategory code '"+codeString+"'"); - } - public String toCode(DeviceMetricCategory code) { - if (code == DeviceMetricCategory.MEASUREMENT) - return "measurement"; - if (code == DeviceMetricCategory.SETTING) - return "setting"; - if (code == DeviceMetricCategory.CALCULATION) - return "calculation"; - if (code == DeviceMetricCategory.UNSPECIFIED) - return "unspecified"; - return "?"; - } - public String toSystem(DeviceMetricCategory code) { - return code.getSystem(); - } - } - - public enum DeviceMetricCalibrationType { - /** - * TODO - */ - UNSPECIFIED, - /** - * TODO - */ - OFFSET, - /** - * TODO - */ - GAIN, - /** - * TODO - */ - TWOPOINT, - /** - * added to help the parsers - */ - NULL; - public static DeviceMetricCalibrationType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - if ("offset".equals(codeString)) - return OFFSET; - if ("gain".equals(codeString)) - return GAIN; - if ("two-point".equals(codeString)) - return TWOPOINT; - throw new FHIRException("Unknown DeviceMetricCalibrationType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UNSPECIFIED: return "unspecified"; - case OFFSET: return "offset"; - case GAIN: return "gain"; - case TWOPOINT: return "two-point"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNSPECIFIED: return "http://hl7.org/fhir/metric-calibration-type"; - case OFFSET: return "http://hl7.org/fhir/metric-calibration-type"; - case GAIN: return "http://hl7.org/fhir/metric-calibration-type"; - case TWOPOINT: return "http://hl7.org/fhir/metric-calibration-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNSPECIFIED: return "TODO"; - case OFFSET: return "TODO"; - case GAIN: return "TODO"; - case TWOPOINT: return "TODO"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNSPECIFIED: return "Unspecified"; - case OFFSET: return "Offset"; - case GAIN: return "Gain"; - case TWOPOINT: return "Two Point"; - default: return "?"; - } - } - } - - public static class DeviceMetricCalibrationTypeEnumFactory implements EnumFactory { - public DeviceMetricCalibrationType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return DeviceMetricCalibrationType.UNSPECIFIED; - if ("offset".equals(codeString)) - return DeviceMetricCalibrationType.OFFSET; - if ("gain".equals(codeString)) - return DeviceMetricCalibrationType.GAIN; - if ("two-point".equals(codeString)) - return DeviceMetricCalibrationType.TWOPOINT; - throw new IllegalArgumentException("Unknown DeviceMetricCalibrationType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("unspecified".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationType.UNSPECIFIED); - if ("offset".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationType.OFFSET); - if ("gain".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationType.GAIN); - if ("two-point".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationType.TWOPOINT); - throw new FHIRException("Unknown DeviceMetricCalibrationType code '"+codeString+"'"); - } - public String toCode(DeviceMetricCalibrationType code) { - if (code == DeviceMetricCalibrationType.UNSPECIFIED) - return "unspecified"; - if (code == DeviceMetricCalibrationType.OFFSET) - return "offset"; - if (code == DeviceMetricCalibrationType.GAIN) - return "gain"; - if (code == DeviceMetricCalibrationType.TWOPOINT) - return "two-point"; - return "?"; - } - public String toSystem(DeviceMetricCalibrationType code) { - return code.getSystem(); - } - } - - public enum DeviceMetricCalibrationState { - /** - * The metric has not been calibrated. - */ - NOTCALIBRATED, - /** - * The metric needs to be calibrated. - */ - CALIBRATIONREQUIRED, - /** - * The metric has been calibrated. - */ - CALIBRATED, - /** - * The state of calibration of this metric is unspecified. - */ - UNSPECIFIED, - /** - * added to help the parsers - */ - NULL; - public static DeviceMetricCalibrationState fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return NOTCALIBRATED; - if ("calibration-required".equals(codeString)) - return CALIBRATIONREQUIRED; - if ("calibrated".equals(codeString)) - return CALIBRATED; - if ("unspecified".equals(codeString)) - return UNSPECIFIED; - throw new FHIRException("Unknown DeviceMetricCalibrationState code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NOTCALIBRATED: return "not-calibrated"; - case CALIBRATIONREQUIRED: return "calibration-required"; - case CALIBRATED: return "calibrated"; - case UNSPECIFIED: return "unspecified"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NOTCALIBRATED: return "http://hl7.org/fhir/metric-calibration-state"; - case CALIBRATIONREQUIRED: return "http://hl7.org/fhir/metric-calibration-state"; - case CALIBRATED: return "http://hl7.org/fhir/metric-calibration-state"; - case UNSPECIFIED: return "http://hl7.org/fhir/metric-calibration-state"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NOTCALIBRATED: return "The metric has not been calibrated."; - case CALIBRATIONREQUIRED: return "The metric needs to be calibrated."; - case CALIBRATED: return "The metric has been calibrated."; - case UNSPECIFIED: return "The state of calibration of this metric is unspecified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NOTCALIBRATED: return "Not Calibrated"; - case CALIBRATIONREQUIRED: return "Calibration Required"; - case CALIBRATED: return "Calibrated"; - case UNSPECIFIED: return "Unspecified"; - default: return "?"; - } - } - } - - public static class DeviceMetricCalibrationStateEnumFactory implements EnumFactory { - public DeviceMetricCalibrationState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return DeviceMetricCalibrationState.NOTCALIBRATED; - if ("calibration-required".equals(codeString)) - return DeviceMetricCalibrationState.CALIBRATIONREQUIRED; - if ("calibrated".equals(codeString)) - return DeviceMetricCalibrationState.CALIBRATED; - if ("unspecified".equals(codeString)) - return DeviceMetricCalibrationState.UNSPECIFIED; - throw new IllegalArgumentException("Unknown DeviceMetricCalibrationState code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("not-calibrated".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationState.NOTCALIBRATED); - if ("calibration-required".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationState.CALIBRATIONREQUIRED); - if ("calibrated".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationState.CALIBRATED); - if ("unspecified".equals(codeString)) - return new Enumeration(this, DeviceMetricCalibrationState.UNSPECIFIED); - throw new FHIRException("Unknown DeviceMetricCalibrationState code '"+codeString+"'"); - } - public String toCode(DeviceMetricCalibrationState code) { - if (code == DeviceMetricCalibrationState.NOTCALIBRATED) - return "not-calibrated"; - if (code == DeviceMetricCalibrationState.CALIBRATIONREQUIRED) - return "calibration-required"; - if (code == DeviceMetricCalibrationState.CALIBRATED) - return "calibrated"; - if (code == DeviceMetricCalibrationState.UNSPECIFIED) - return "unspecified"; - return "?"; - } - public String toSystem(DeviceMetricCalibrationState code) { - return code.getSystem(); - } - } - - @Block() - public static class DeviceMetricCalibrationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the type of the calibration method. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="unspecified | offset | gain | two-point", formalDefinition="Describes the type of the calibration method." ) - protected Enumeration type; - - /** - * Describes the state of the calibration. - */ - @Child(name = "state", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="not-calibrated | calibration-required | calibrated | unspecified", formalDefinition="Describes the state of the calibration." ) - protected Enumeration state; - - /** - * Describes the time last calibration has been performed. - */ - @Child(name = "time", type = {InstantType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Describes the time last calibration has been performed", formalDefinition="Describes the time last calibration has been performed." ) - protected InstantType time; - - private static final long serialVersionUID = 1163986578L; - - /** - * Constructor - */ - public DeviceMetricCalibrationComponent() { - super(); - } - - /** - * @return {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new DeviceMetricCalibrationTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the type of the calibration method.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public DeviceMetricCalibrationComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Describes the type of the calibration method. - */ - public DeviceMetricCalibrationType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Describes the type of the calibration method. - */ - public DeviceMetricCalibrationComponent setType(DeviceMetricCalibrationType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new DeviceMetricCalibrationTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public Enumeration getStateElement() { - if (this.state == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.state"); - else if (Configuration.doAutoCreate()) - this.state = new Enumeration(new DeviceMetricCalibrationStateEnumFactory()); // bb - return this.state; - } - - public boolean hasStateElement() { - return this.state != null && !this.state.isEmpty(); - } - - public boolean hasState() { - return this.state != null && !this.state.isEmpty(); - } - - /** - * @param value {@link #state} (Describes the state of the calibration.). This is the underlying object with id, value and extensions. The accessor "getState" gives direct access to the value - */ - public DeviceMetricCalibrationComponent setStateElement(Enumeration value) { - this.state = value; - return this; - } - - /** - * @return Describes the state of the calibration. - */ - public DeviceMetricCalibrationState getState() { - return this.state == null ? null : this.state.getValue(); - } - - /** - * @param value Describes the state of the calibration. - */ - public DeviceMetricCalibrationComponent setState(DeviceMetricCalibrationState value) { - if (value == null) - this.state = null; - else { - if (this.state == null) - this.state = new Enumeration(new DeviceMetricCalibrationStateEnumFactory()); - this.state.setValue(value); - } - return this; - } - - /** - * @return {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public InstantType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetricCalibrationComponent.time"); - else if (Configuration.doAutoCreate()) - this.time = new InstantType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (Describes the time last calibration has been performed.). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DeviceMetricCalibrationComponent setTimeElement(InstantType value) { - this.time = value; - return this; - } - - /** - * @return Describes the time last calibration has been performed. - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value Describes the time last calibration has been performed. - */ - public DeviceMetricCalibrationComponent setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new InstantType(); - this.time.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Describes the type of the calibration method.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("state", "code", "Describes the state of the calibration.", 0, java.lang.Integer.MAX_VALUE, state)); - childrenList.add(new Property("time", "instant", "Describes the time last calibration has been performed.", 0, java.lang.Integer.MAX_VALUE, time)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 109757585: /*state*/ return this.state == null ? new Base[0] : new Base[] {this.state}; // Enumeration - case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // InstantType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new DeviceMetricCalibrationTypeEnumFactory().fromType(value); // Enumeration - break; - case 109757585: // state - this.state = new DeviceMetricCalibrationStateEnumFactory().fromType(value); // Enumeration - break; - case 3560141: // time - this.time = castToInstant(value); // InstantType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new DeviceMetricCalibrationTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("state")) - this.state = new DeviceMetricCalibrationStateEnumFactory().fromType(value); // Enumeration - else if (name.equals("time")) - this.time = castToInstant(value); // InstantType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 109757585: throw new FHIRException("Cannot make property state as it is not a complex type"); // Enumeration - case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // InstantType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.type"); - } - else if (name.equals("state")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.state"); - } - else if (name.equals("time")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.time"); - } - else - return super.addChild(name); - } - - public DeviceMetricCalibrationComponent copy() { - DeviceMetricCalibrationComponent dst = new DeviceMetricCalibrationComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.state = state == null ? null : state.copy(); - dst.time = time == null ? null : time.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceMetricCalibrationComponent)) - return false; - DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; - return compareDeep(type, o.type, true) && compareDeep(state, o.state, true) && compareDeep(time, o.time, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceMetricCalibrationComponent)) - return false; - DeviceMetricCalibrationComponent o = (DeviceMetricCalibrationComponent) other; - return compareValues(type, o.type, true) && compareValues(state, o.state, true) && compareValues(time, o.time, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (state == null || state.isEmpty()) - && (time == null || time.isEmpty()); - } - - public String fhirType() { - return "DeviceMetric.calibration"; - - } - - } - - /** - * Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of metric", formalDefinition="Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc." ) - protected CodeableConcept type; - - /** - * Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier of this DeviceMetric", formalDefinition="Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device." ) - protected Identifier identifier; - - /** - * Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc. - */ - @Child(name = "unit", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unit of metric", formalDefinition="Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc." ) - protected CodeableConcept unit; - - /** - * Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc. - */ - @Child(name = "source", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Describes the link to the source Device", formalDefinition="Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - protected Device sourceTarget; - - /** - * Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location. - */ - @Child(name = "parent", type = {DeviceComponent.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Describes the link to the parent DeviceComponent", formalDefinition="Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location." ) - protected Reference parent; - - /** - * The actual object that is the target of the reference (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - protected DeviceComponent parentTarget; - - /** - * Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - @Child(name = "operationalStatus", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="on | off | standby", formalDefinition="Indicates current operational state of the device. For example: On, Off, Standby, etc." ) - protected Enumeration operationalStatus; - - /** - * Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. - */ - @Child(name = "color", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="black | red | green | yellow | blue | magenta | cyan | white", formalDefinition="Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta." ) - protected Enumeration color; - - /** - * Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - @Child(name = "category", type = {CodeType.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="measurement | setting | calculation | unspecified", formalDefinition="Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation." ) - protected Enumeration category; - - /** - * Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured. - */ - @Child(name = "measurementPeriod", type = {Timing.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Describes the measurement repetition time", formalDefinition="Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured." ) - protected Timing measurementPeriod; - - /** - * Describes the calibrations that have been performed or that are required to be performed. - */ - @Child(name = "calibration", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Describes the calibrations that have been performed or that are required to be performed", formalDefinition="Describes the calibrations that have been performed or that are required to be performed." ) - protected List calibration; - - private static final long serialVersionUID = 1786401018L; - - /** - * Constructor - */ - public DeviceMetric() { - super(); - } - - /** - * Constructor - */ - public DeviceMetric(CodeableConcept type, Identifier identifier, Enumeration category) { - super(); - this.type = type; - this.identifier = identifier; - this.category = category; - } - - /** - * @return {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.) - */ - public DeviceMetric setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.) - */ - public DeviceMetric setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) - */ - public CodeableConcept getUnit() { - if (this.unit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.unit"); - else if (Configuration.doAutoCreate()) - this.unit = new CodeableConcept(); // cc - return this.unit; - } - - public boolean hasUnit() { - return this.unit != null && !this.unit.isEmpty(); - } - - /** - * @param value {@link #unit} (Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.) - */ - public DeviceMetric setUnit(CodeableConcept value) { - this.unit = value; - return this; - } - - /** - * @return {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceMetric setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public Device getSourceTarget() { - if (this.sourceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.source"); - else if (Configuration.doAutoCreate()) - this.sourceTarget = new Device(); // aa - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.) - */ - public DeviceMetric setSourceTarget(Device value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); // cc - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** - * @param value {@link #parent} (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceMetric setParent(Reference value) { - this.parent = value; - return this; - } - - /** - * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceComponent getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new DeviceComponent(); // aa - return this.parentTarget; - } - - /** - * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.) - */ - public DeviceMetric setParentTarget(DeviceComponent value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #operationalStatus} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalStatus" gives direct access to the value - */ - public Enumeration getOperationalStatusElement() { - if (this.operationalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.operationalStatus"); - else if (Configuration.doAutoCreate()) - this.operationalStatus = new Enumeration(new DeviceMetricOperationalStatusEnumFactory()); // bb - return this.operationalStatus; - } - - public boolean hasOperationalStatusElement() { - return this.operationalStatus != null && !this.operationalStatus.isEmpty(); - } - - public boolean hasOperationalStatus() { - return this.operationalStatus != null && !this.operationalStatus.isEmpty(); - } - - /** - * @param value {@link #operationalStatus} (Indicates current operational state of the device. For example: On, Off, Standby, etc.). This is the underlying object with id, value and extensions. The accessor "getOperationalStatus" gives direct access to the value - */ - public DeviceMetric setOperationalStatusElement(Enumeration value) { - this.operationalStatus = value; - return this; - } - - /** - * @return Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - public DeviceMetricOperationalStatus getOperationalStatus() { - return this.operationalStatus == null ? null : this.operationalStatus.getValue(); - } - - /** - * @param value Indicates current operational state of the device. For example: On, Off, Standby, etc. - */ - public DeviceMetric setOperationalStatus(DeviceMetricOperationalStatus value) { - if (value == null) - this.operationalStatus = null; - else { - if (this.operationalStatus == null) - this.operationalStatus = new Enumeration(new DeviceMetricOperationalStatusEnumFactory()); - this.operationalStatus.setValue(value); - } - return this; - } - - /** - * @return {@link #color} (Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public Enumeration getColorElement() { - if (this.color == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.color"); - else if (Configuration.doAutoCreate()) - this.color = new Enumeration(new DeviceMetricColorEnumFactory()); // bb - return this.color; - } - - public boolean hasColorElement() { - return this.color != null && !this.color.isEmpty(); - } - - public boolean hasColor() { - return this.color != null && !this.color.isEmpty(); - } - - /** - * @param value {@link #color} (Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public DeviceMetric setColorElement(Enumeration value) { - this.color = value; - return this; - } - - /** - * @return Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. - */ - public DeviceMetricColor getColor() { - return this.color == null ? null : this.color.getValue(); - } - - /** - * @param value Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta. - */ - public DeviceMetric setColor(DeviceMetricColor value) { - if (value == null) - this.color = null; - else { - if (this.color == null) - this.color = new Enumeration(new DeviceMetricColorEnumFactory()); - this.color.setValue(value); - } - return this; - } - - /** - * @return {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new DeviceMetricCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public DeviceMetric setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - public DeviceMetricCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation. - */ - public DeviceMetric setCategory(DeviceMetricCategory value) { - if (this.category == null) - this.category = new Enumeration(new DeviceMetricCategoryEnumFactory()); - this.category.setValue(value); - return this; - } - - /** - * @return {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.) - */ - public Timing getMeasurementPeriod() { - if (this.measurementPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceMetric.measurementPeriod"); - else if (Configuration.doAutoCreate()) - this.measurementPeriod = new Timing(); // cc - return this.measurementPeriod; - } - - public boolean hasMeasurementPeriod() { - return this.measurementPeriod != null && !this.measurementPeriod.isEmpty(); - } - - /** - * @param value {@link #measurementPeriod} (Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.) - */ - public DeviceMetric setMeasurementPeriod(Timing value) { - this.measurementPeriod = value; - return this; - } - - /** - * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) - */ - public List getCalibration() { - if (this.calibration == null) - this.calibration = new ArrayList(); - return this.calibration; - } - - public boolean hasCalibration() { - if (this.calibration == null) - return false; - for (DeviceMetricCalibrationComponent item : this.calibration) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #calibration} (Describes the calibrations that have been performed or that are required to be performed.) - */ - // syntactic sugar - public DeviceMetricCalibrationComponent addCalibration() { //3 - DeviceMetricCalibrationComponent t = new DeviceMetricCalibrationComponent(); - if (this.calibration == null) - this.calibration = new ArrayList(); - this.calibration.add(t); - return t; - } - - // syntactic sugar - public DeviceMetric addCalibration(DeviceMetricCalibrationComponent t) { //3 - if (t == null) - return this; - if (this.calibration == null) - this.calibration = new ArrayList(); - this.calibration.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Describes the type of the metric. For example: Heart Rate, PEEP Setting, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "Describes the unique identification of this metric that has been assigned by the device or gateway software. For example: handle ID. It should be noted that in order to make the identifier unique, the system element of the identifier should be set to the unique identifier of the device.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("unit", "CodeableConcept", "Describes the unit that an observed value determined for this metric will have. For example: Percent, Seconds, etc.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("source", "Reference(Device)", "Describes the link to the Device that this DeviceMetric belongs to and that contains administrative device information such as manufacture, serial number, etc.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("parent", "Reference(DeviceComponent)", "Describes the link to the DeviceComponent that this DeviceMetric belongs to and that provide information about the location of this DeviceMetric in the containment structure of the parent Device. An example would be a DeviceComponent that represents a Channel. This reference can be used by a client application to distinguish DeviceMetrics that have the same type, but should be interpreted based on their containment location.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("operationalStatus", "code", "Indicates current operational state of the device. For example: On, Off, Standby, etc.", 0, java.lang.Integer.MAX_VALUE, operationalStatus)); - childrenList.add(new Property("color", "code", "Describes the color representation for the metric. This is often used to aid clinicians to track and identify parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- magenta.", 0, java.lang.Integer.MAX_VALUE, color)); - childrenList.add(new Property("category", "code", "Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, measurement, or calculation.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("measurementPeriod", "Timing", "Describes the measurement repetition time. This is not necessarily the same as the update period. The measurement repetition time can range from milliseconds up to hours. An example for a measurement repetition time in the range of milliseconds is the sampling rate of an ECG. An example for a measurement repetition time in the range of hours is a NIBP that is triggered automatically every hour. The update period may be different than the measurement repetition time, if the device does not update the published observed value with the same frequency as it was measured.", 0, java.lang.Integer.MAX_VALUE, measurementPeriod)); - childrenList.add(new Property("calibration", "", "Describes the calibrations that have been performed or that are required to be performed.", 0, java.lang.Integer.MAX_VALUE, calibration)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // CodeableConcept - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference - case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference - case -2103166364: /*operationalStatus*/ return this.operationalStatus == null ? new Base[0] : new Base[] {this.operationalStatus}; // Enumeration - case 94842723: /*color*/ return this.color == null ? new Base[0] : new Base[] {this.color}; // Enumeration - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration - case -1300332387: /*measurementPeriod*/ return this.measurementPeriod == null ? new Base[0] : new Base[] {this.measurementPeriod}; // Timing - case 1421318634: /*calibration*/ return this.calibration == null ? new Base[0] : this.calibration.toArray(new Base[this.calibration.size()]); // DeviceMetricCalibrationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 3594628: // unit - this.unit = castToCodeableConcept(value); // CodeableConcept - break; - case -896505829: // source - this.source = castToReference(value); // Reference - break; - case -995424086: // parent - this.parent = castToReference(value); // Reference - break; - case -2103166364: // operationalStatus - this.operationalStatus = new DeviceMetricOperationalStatusEnumFactory().fromType(value); // Enumeration - break; - case 94842723: // color - this.color = new DeviceMetricColorEnumFactory().fromType(value); // Enumeration - break; - case 50511102: // category - this.category = new DeviceMetricCategoryEnumFactory().fromType(value); // Enumeration - break; - case -1300332387: // measurementPeriod - this.measurementPeriod = castToTiming(value); // Timing - break; - case 1421318634: // calibration - this.getCalibration().add((DeviceMetricCalibrationComponent) value); // DeviceMetricCalibrationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("unit")) - this.unit = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("source")) - this.source = castToReference(value); // Reference - else if (name.equals("parent")) - this.parent = castToReference(value); // Reference - else if (name.equals("operationalStatus")) - this.operationalStatus = new DeviceMetricOperationalStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("color")) - this.color = new DeviceMetricColorEnumFactory().fromType(value); // Enumeration - else if (name.equals("category")) - this.category = new DeviceMetricCategoryEnumFactory().fromType(value); // Enumeration - else if (name.equals("measurementPeriod")) - this.measurementPeriod = castToTiming(value); // Timing - else if (name.equals("calibration")) - this.getCalibration().add((DeviceMetricCalibrationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -1618432855: return getIdentifier(); // Identifier - case 3594628: return getUnit(); // CodeableConcept - case -896505829: return getSource(); // Reference - case -995424086: return getParent(); // Reference - case -2103166364: throw new FHIRException("Cannot make property operationalStatus as it is not a complex type"); // Enumeration - case 94842723: throw new FHIRException("Cannot make property color as it is not a complex type"); // Enumeration - case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration - case -1300332387: return getMeasurementPeriod(); // Timing - case 1421318634: return addCalibration(); // DeviceMetricCalibrationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("unit")) { - this.unit = new CodeableConcept(); - return this.unit; - } - else if (name.equals("source")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("parent")) { - this.parent = new Reference(); - return this.parent; - } - else if (name.equals("operationalStatus")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.operationalStatus"); - } - else if (name.equals("color")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.color"); - } - else if (name.equals("category")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceMetric.category"); - } - else if (name.equals("measurementPeriod")) { - this.measurementPeriod = new Timing(); - return this.measurementPeriod; - } - else if (name.equals("calibration")) { - return addCalibration(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DeviceMetric"; - - } - - public DeviceMetric copy() { - DeviceMetric dst = new DeviceMetric(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.source = source == null ? null : source.copy(); - dst.parent = parent == null ? null : parent.copy(); - dst.operationalStatus = operationalStatus == null ? null : operationalStatus.copy(); - dst.color = color == null ? null : color.copy(); - dst.category = category == null ? null : category.copy(); - dst.measurementPeriod = measurementPeriod == null ? null : measurementPeriod.copy(); - if (calibration != null) { - dst.calibration = new ArrayList(); - for (DeviceMetricCalibrationComponent i : calibration) - dst.calibration.add(i.copy()); - }; - return dst; - } - - protected DeviceMetric typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceMetric)) - return false; - DeviceMetric o = (DeviceMetric) other; - return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(unit, o.unit, true) - && compareDeep(source, o.source, true) && compareDeep(parent, o.parent, true) && compareDeep(operationalStatus, o.operationalStatus, true) - && compareDeep(color, o.color, true) && compareDeep(category, o.category, true) && compareDeep(measurementPeriod, o.measurementPeriod, true) - && compareDeep(calibration, o.calibration, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceMetric)) - return false; - DeviceMetric o = (DeviceMetric) other; - return compareValues(operationalStatus, o.operationalStatus, true) && compareValues(color, o.color, true) - && compareValues(category, o.category, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (unit == null || unit.isEmpty()) && (source == null || source.isEmpty()) && (parent == null || parent.isEmpty()) - && (operationalStatus == null || operationalStatus.isEmpty()) && (color == null || color.isEmpty()) - && (category == null || category.isEmpty()) && (measurementPeriod == null || measurementPeriod.isEmpty()) - && (calibration == null || calibration.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceMetric; - } - - /** - * Search parameter: category - *

- * Description: The category of the metric
- * Type: token
- * Path: DeviceMetric.category
- *

- */ - @SearchParamDefinition(name="category", path="DeviceMetric.category", description="The category of the metric", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: The category of the metric
- * Type: token
- * Path: DeviceMetric.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: source - *

- * Description: The device resource
- * Type: reference
- * Path: DeviceMetric.source
- *

- */ - @SearchParamDefinition(name="source", path="DeviceMetric.source", description="The device resource", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: The device resource
- * Type: reference
- * Path: DeviceMetric.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceMetric:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("DeviceMetric:source").toLocked(); - - /** - * Search parameter: parent - *

- * Description: The parent DeviceMetric resource
- * Type: reference
- * Path: DeviceMetric.parent
- *

- */ - @SearchParamDefinition(name="parent", path="DeviceMetric.parent", description="The parent DeviceMetric resource", type="reference" ) - public static final String SP_PARENT = "parent"; - /** - * Fluent Client search parameter constant for parent - *

- * Description: The parent DeviceMetric resource
- * Type: reference
- * Path: DeviceMetric.parent
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceMetric:parent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("DeviceMetric:parent").toLocked(); - - /** - * Search parameter: type - *

- * Description: The component type
- * Type: token
- * Path: DeviceMetric.type
- *

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

- * Description: The component type
- * Type: token
- * Path: DeviceMetric.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: The identifier of the metric
- * Type: token
- * Path: DeviceMetric.identifier
- *

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

- * Description: The identifier of the metric
- * Type: token
- * Path: DeviceMetric.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java deleted file mode 100644 index b8940f172d1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceUseRequest.java +++ /dev/null @@ -1,1475 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. - */ -@ResourceDef(name="DeviceUseRequest", profile="http://hl7.org/fhir/Profile/DeviceUseRequest") -public class DeviceUseRequest extends DomainResource { - - public enum DeviceUseRequestStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the request but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work has been complete, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The request was attempted, but due to some procedural error, it could not be completed. - */ - ABORTED, - /** - * added to help the parsers - */ - NULL; - public static DeviceUseRequestStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("aborted".equals(codeString)) - return ABORTED; - throw new FHIRException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case ABORTED: return "aborted"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/device-use-request-status"; - case PLANNED: return "http://hl7.org/fhir/device-use-request-status"; - case REQUESTED: return "http://hl7.org/fhir/device-use-request-status"; - case RECEIVED: return "http://hl7.org/fhir/device-use-request-status"; - case ACCEPTED: return "http://hl7.org/fhir/device-use-request-status"; - case INPROGRESS: return "http://hl7.org/fhir/device-use-request-status"; - case COMPLETED: return "http://hl7.org/fhir/device-use-request-status"; - case SUSPENDED: return "http://hl7.org/fhir/device-use-request-status"; - case REJECTED: return "http://hl7.org/fhir/device-use-request-status"; - case ABORTED: return "http://hl7.org/fhir/device-use-request-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the request but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case COMPLETED: return "The work has been complete, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case ABORTED: return "Aborted"; - default: return "?"; - } - } - } - - public static class DeviceUseRequestStatusEnumFactory implements EnumFactory { - public DeviceUseRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return DeviceUseRequestStatus.PROPOSED; - if ("planned".equals(codeString)) - return DeviceUseRequestStatus.PLANNED; - if ("requested".equals(codeString)) - return DeviceUseRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return DeviceUseRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return DeviceUseRequestStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return DeviceUseRequestStatus.INPROGRESS; - if ("completed".equals(codeString)) - return DeviceUseRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return DeviceUseRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return DeviceUseRequestStatus.REJECTED; - if ("aborted".equals(codeString)) - return DeviceUseRequestStatus.ABORTED; - throw new IllegalArgumentException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.PROPOSED); - if ("planned".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.PLANNED); - if ("requested".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.REQUESTED); - if ("received".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.RECEIVED); - if ("accepted".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.ACCEPTED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.COMPLETED); - if ("suspended".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.SUSPENDED); - if ("rejected".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.REJECTED); - if ("aborted".equals(codeString)) - return new Enumeration(this, DeviceUseRequestStatus.ABORTED); - throw new FHIRException("Unknown DeviceUseRequestStatus code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestStatus code) { - if (code == DeviceUseRequestStatus.PROPOSED) - return "proposed"; - if (code == DeviceUseRequestStatus.PLANNED) - return "planned"; - if (code == DeviceUseRequestStatus.REQUESTED) - return "requested"; - if (code == DeviceUseRequestStatus.RECEIVED) - return "received"; - if (code == DeviceUseRequestStatus.ACCEPTED) - return "accepted"; - if (code == DeviceUseRequestStatus.INPROGRESS) - return "in-progress"; - if (code == DeviceUseRequestStatus.COMPLETED) - return "completed"; - if (code == DeviceUseRequestStatus.SUSPENDED) - return "suspended"; - if (code == DeviceUseRequestStatus.REJECTED) - return "rejected"; - if (code == DeviceUseRequestStatus.ABORTED) - return "aborted"; - return "?"; - } - public String toSystem(DeviceUseRequestStatus code) { - return code.getSystem(); - } - } - - public enum DeviceUseRequestPriority { - /** - * The request has a normal priority. - */ - ROUTINE, - /** - * The request should be done urgently. - */ - URGENT, - /** - * The request is time-critical. - */ - STAT, - /** - * The request should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - public static DeviceUseRequestPriority fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new FHIRException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return "http://hl7.org/fhir/device-use-request-priority"; - case URGENT: return "http://hl7.org/fhir/device-use-request-priority"; - case STAT: return "http://hl7.org/fhir/device-use-request-priority"; - case ASAP: return "http://hl7.org/fhir/device-use-request-priority"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The request has a normal priority."; - case URGENT: return "The request should be done urgently."; - case STAT: return "The request is time-critical."; - case ASAP: return "The request should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "ASAP"; - default: return "?"; - } - } - } - - public static class DeviceUseRequestPriorityEnumFactory implements EnumFactory { - public DeviceUseRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return DeviceUseRequestPriority.ROUTINE; - if ("urgent".equals(codeString)) - return DeviceUseRequestPriority.URGENT; - if ("stat".equals(codeString)) - return DeviceUseRequestPriority.STAT; - if ("asap".equals(codeString)) - return DeviceUseRequestPriority.ASAP; - throw new IllegalArgumentException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return new Enumeration(this, DeviceUseRequestPriority.ROUTINE); - if ("urgent".equals(codeString)) - return new Enumeration(this, DeviceUseRequestPriority.URGENT); - if ("stat".equals(codeString)) - return new Enumeration(this, DeviceUseRequestPriority.STAT); - if ("asap".equals(codeString)) - return new Enumeration(this, DeviceUseRequestPriority.ASAP); - throw new FHIRException("Unknown DeviceUseRequestPriority code '"+codeString+"'"); - } - public String toCode(DeviceUseRequestPriority code) { - if (code == DeviceUseRequestPriority.ROUTINE) - return "routine"; - if (code == DeviceUseRequestPriority.URGENT) - return "urgent"; - if (code == DeviceUseRequestPriority.STAT) - return "stat"; - if (code == DeviceUseRequestPriority.ASAP) - return "asap"; - return "?"; - } - public String toSystem(DeviceUseRequestPriority code) { - return code.getSystem(); - } - } - - /** - * Indicates the site on the subject's body where the device should be used ( i.e. the target site). - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device should be used ( i.e. the target site)." ) - protected Type bodySite; - - /** - * The status of the request. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the request." ) - protected Enumeration status; - - /** - * The details of the device to be used. - */ - @Child(name = "device", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Device requested", formalDefinition="The details of the device to be used." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The details of the device to be used.) - */ - protected Device deviceTarget; - - /** - * An encounter that provides additional context in which this request is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Encounter motivating request", formalDefinition="An encounter that provides additional context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * Identifiers assigned to this order by the orderer or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Request identifier", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) - protected List identifier; - - /** - * Reason or justification for the use of this device. - */ - @Child(name = "indication", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reason for request", formalDefinition="Reason or justification for the use of this device." ) - protected List indication; - - /** - * Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. - */ - @Child(name = "notes", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Notes or comments", formalDefinition="Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) - protected List notes; - - /** - * The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%. - */ - @Child(name = "prnReason", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="PRN", formalDefinition="The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%." ) - protected List prnReason; - - /** - * The time when the request was made. - */ - @Child(name = "orderedOn", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When ordered", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The time at which the request was made/recorded. - */ - @Child(name = "recordedOn", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When recorded", formalDefinition="The time at which the request was made/recorded." ) - protected DateTimeType recordedOn; - - /** - * The patient who will use the device. - */ - @Child(name = "subject", type = {Patient.class}, order=10, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Focus of request", formalDefinition="The patient who will use the device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who will use the device.) - */ - protected Patient subjectTarget; - - /** - * The timing schedule for the use of the device 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". - */ - @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Schedule for use", formalDefinition="The timing schedule for the use of the device 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\"." ) - protected Type timing; - - /** - * Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - @Child(name = "priority", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine." ) - protected Enumeration priority; - - private static final long serialVersionUID = 1208477058L; - - /** - * Constructor - */ - public DeviceUseRequest() { - super(); - } - - /** - * Constructor - */ - public DeviceUseRequest(Reference device, Reference subject) { - super(); - this.device = device; - this.subject = subject; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public CodeableConcept getBodySiteCodeableConcept() throws FHIRException { - if (!(this.bodySite instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - public boolean hasBodySiteCodeableConcept() { - return this.bodySite instanceof CodeableConcept; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public Reference getBodySiteReference() throws FHIRException { - if (!(this.bodySite instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySiteReference() { - return this.bodySite instanceof Reference; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the device should be used ( i.e. the target site).) - */ - public DeviceUseRequest setBodySite(Type value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DeviceUseRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the request. - */ - public DeviceUseRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the request. - */ - public DeviceUseRequest setStatus(DeviceUseRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DeviceUseRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #device} (The details of the device to be used.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The details of the device to be used.) - */ - public DeviceUseRequest setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the device to be used.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); // aa - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the device to be used.) - */ - public DeviceUseRequest setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (An encounter that provides additional context in which this request is made.) - */ - public DeviceUseRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional context in which this request is made.) - */ - public DeviceUseRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DeviceUseRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #indication} (Reason or justification for the use of this device.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (CodeableConcept item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (Reason or justification for the use of this device.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public DeviceUseRequest addIndication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public DeviceUseRequest addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) - */ - public List getPrnReason() { - if (this.prnReason == null) - this.prnReason = new ArrayList(); - return this.prnReason; - } - - public boolean hasPrnReason() { - if (this.prnReason == null) - return false; - for (CodeableConcept item : this.prnReason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prnReason} (The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.) - */ - // syntactic sugar - public CodeableConcept addPrnReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.prnReason == null) - this.prnReason = new ArrayList(); - this.prnReason.add(t); - return t; - } - - // syntactic sugar - public DeviceUseRequest addPrnReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.prnReason == null) - this.prnReason = new ArrayList(); - this.prnReason.add(t); - return this; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); // bb - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DeviceUseRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public DeviceUseRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DateTimeType getRecordedOnElement() { - if (this.recordedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.recordedOn"); - else if (Configuration.doAutoCreate()) - this.recordedOn = new DateTimeType(); // bb - return this.recordedOn; - } - - public boolean hasRecordedOnElement() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - public boolean hasRecordedOn() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - /** - * @param value {@link #recordedOn} (The time at which the request was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DeviceUseRequest setRecordedOnElement(DateTimeType value) { - this.recordedOn = value; - return this; - } - - /** - * @return The time at which the request was made/recorded. - */ - public Date getRecordedOn() { - return this.recordedOn == null ? null : this.recordedOn.getValue(); - } - - /** - * @param value The time at which the request was made/recorded. - */ - public DeviceUseRequest setRecordedOn(Date value) { - if (value == null) - this.recordedOn = null; - else { - if (this.recordedOn == null) - this.recordedOn = new DateTimeType(); - this.recordedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who will use the device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who will use the device.) - */ - public DeviceUseRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who will use the device.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who will use the device.) - */ - public DeviceUseRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device 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 Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device 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 Timing getTimingTiming() throws FHIRException { - if (!(this.timing instanceof Timing)) - throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - public boolean hasTimingTiming() { - return this.timing instanceof Timing; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device 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 Period getTimingPeriod() throws FHIRException { - if (!(this.timing instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - public boolean hasTimingPeriod() { - return this.timing instanceof Period; - } - - /** - * @return {@link #timing} (The timing schedule for the use of the device 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 DateTimeType getTimingDateTimeType() throws FHIRException { - if (!(this.timing instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - public boolean hasTimingDateTimeType() { - return this.timing instanceof DateTimeType; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The timing schedule for the use of the device 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 DeviceUseRequest setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public DeviceUseRequest setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - public DeviceUseRequestPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine. - */ - public DeviceUseRequest setPriority(DeviceUseRequestPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new DeviceUseRequestPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device should be used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("status", "code", "The status of the request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("device", "Reference(Device)", "The details of the device to be used.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of this device.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("notes", "string", "Details about this request that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("prnReason", "CodeableConcept", "The proposed act must be performed if the indicated conditions occur, e.g.., shortness of breath, SpO2 less than x%.", 0, java.lang.Integer.MAX_VALUE, prnReason)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("recordedOn", "dateTime", "The time at which the request was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who will use the device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "The timing schedule for the use of the device 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\".", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("priority", "code", "Characterizes how quickly the use of device must be initiated. Includes concepts such as stat, urgent, routine.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Type - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // CodeableConcept - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // StringType - case 1825472528: /*prnReason*/ return this.prnReason == null ? new Base[0] : this.prnReason.toArray(new Base[this.prnReason.size()]); // CodeableConcept - case -391079124: /*orderedOn*/ return this.orderedOn == null ? new Base[0] : new Base[] {this.orderedOn}; // DateTimeType - case 735397551: /*recordedOn*/ return this.recordedOn == null ? new Base[0] : new Base[] {this.recordedOn}; // DateTimeType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1702620169: // bodySite - this.bodySite = (Type) value; // Type - break; - case -892481550: // status - this.status = new DeviceUseRequestStatusEnumFactory().fromType(value); // Enumeration - break; - case -1335157162: // device - this.device = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -597168804: // indication - this.getIndication().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 105008833: // notes - this.getNotes().add(castToString(value)); // StringType - break; - case 1825472528: // prnReason - this.getPrnReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -391079124: // orderedOn - this.orderedOn = castToDateTime(value); // DateTimeType - break; - case 735397551: // recordedOn - this.recordedOn = castToDateTime(value); // DateTimeType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -873664438: // timing - this.timing = (Type) value; // Type - break; - case -1165461084: // priority - this.priority = new DeviceUseRequestPriorityEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("bodySite[x]")) - this.bodySite = (Type) value; // Type - else if (name.equals("status")) - this.status = new DeviceUseRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("device")) - this.device = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("indication")) - this.getIndication().add(castToCodeableConcept(value)); - else if (name.equals("notes")) - this.getNotes().add(castToString(value)); - else if (name.equals("prnReason")) - this.getPrnReason().add(castToCodeableConcept(value)); - else if (name.equals("orderedOn")) - this.orderedOn = castToDateTime(value); // DateTimeType - else if (name.equals("recordedOn")) - this.recordedOn = castToDateTime(value); // DateTimeType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("timing[x]")) - this.timing = (Type) value; // Type - else if (name.equals("priority")) - this.priority = new DeviceUseRequestPriorityEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -806219817: return getBodySite(); // Type - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1335157162: return getDevice(); // Reference - case 1524132147: return getEncounter(); // Reference - case -1618432855: return addIdentifier(); // Identifier - case -597168804: return addIndication(); // CodeableConcept - case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType - case 1825472528: return addPrnReason(); // CodeableConcept - case -391079124: throw new FHIRException("Cannot make property orderedOn as it is not a complex type"); // DateTimeType - case 735397551: throw new FHIRException("Cannot make property recordedOn as it is not a complex type"); // DateTimeType - case -1867885268: return getSubject(); // Reference - case 164632566: return getTiming(); // Type - case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("bodySiteCodeableConcept")) { - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - else if (name.equals("bodySiteReference")) { - this.bodySite = new Reference(); - return this.bodySite; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.status"); - } - else if (name.equals("device")) { - this.device = new Reference(); - return this.device; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("indication")) { - return addIndication(); - } - else if (name.equals("notes")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.notes"); - } - else if (name.equals("prnReason")) { - return addPrnReason(); - } - else if (name.equals("orderedOn")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.orderedOn"); - } - else if (name.equals("recordedOn")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.recordedOn"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("timingTiming")) { - this.timing = new Timing(); - return this.timing; - } - else if (name.equals("timingPeriod")) { - this.timing = new Period(); - return this.timing; - } - else if (name.equals("timingDateTime")) { - this.timing = new DateTimeType(); - return this.timing; - } - else if (name.equals("priority")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseRequest.priority"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DeviceUseRequest"; - - } - - public DeviceUseRequest copy() { - DeviceUseRequest dst = new DeviceUseRequest(); - copyValues(dst); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.status = status == null ? null : status.copy(); - dst.device = device == null ? null : device.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - if (prnReason != null) { - dst.prnReason = new ArrayList(); - for (CodeableConcept i : prnReason) - dst.prnReason.add(i.copy()); - }; - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected DeviceUseRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceUseRequest)) - return false; - DeviceUseRequest o = (DeviceUseRequest) other; - return compareDeep(bodySite, o.bodySite, true) && compareDeep(status, o.status, true) && compareDeep(device, o.device, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) - && compareDeep(notes, o.notes, true) && compareDeep(prnReason, o.prnReason, true) && compareDeep(orderedOn, o.orderedOn, true) - && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) - && compareDeep(priority, o.priority, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceUseRequest)) - return false; - DeviceUseRequest o = (DeviceUseRequest) other; - return compareValues(status, o.status, true) && compareValues(notes, o.notes, true) && compareValues(orderedOn, o.orderedOn, true) - && compareValues(recordedOn, o.recordedOn, true) && compareValues(priority, o.priority, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) - && (device == null || device.isEmpty()) && (encounter == null || encounter.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (indication == null || indication.isEmpty()) && (notes == null || notes.isEmpty()) && (prnReason == null || prnReason.isEmpty()) - && (orderedOn == null || orderedOn.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) - && (subject == null || subject.isEmpty()) && (timing == null || timing.isEmpty()) && (priority == null || priority.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceUseRequest; - } - - /** - * Search parameter: patient - *

- * Description: Search by subject - a patient
- * Type: reference
- * Path: DeviceUseRequest.subject
- *

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

- * Description: Search by subject - a patient
- * Type: reference
- * Path: DeviceUseRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceUseRequest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceUseRequest:patient").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Search by subject
- * Type: reference
- * Path: DeviceUseRequest.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DeviceUseRequest.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Search by subject
- * Type: reference
- * Path: DeviceUseRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceUseRequest:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceUseRequest:subject").toLocked(); - - /** - * Search parameter: device - *

- * Description: Device requested
- * Type: reference
- * Path: DeviceUseRequest.device
- *

- */ - @SearchParamDefinition(name="device", path="DeviceUseRequest.device", description="Device requested", type="reference" ) - public static final String SP_DEVICE = "device"; - /** - * Fluent Client search parameter constant for device - *

- * Description: Device requested
- * Type: reference
- * Path: DeviceUseRequest.device
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceUseRequest:device". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceUseRequest:device").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java deleted file mode 100644 index d760b5e79ae..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DeviceUseStatement.java +++ /dev/null @@ -1,845 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. - */ -@ResourceDef(name="DeviceUseStatement", profile="http://hl7.org/fhir/Profile/DeviceUseStatement") -public class DeviceUseStatement extends DomainResource { - - /** - * Indicates the site on the subject's body where the device was used ( i.e. the target site). - */ - @Child(name = "bodySite", type = {CodeableConcept.class, BodySite.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Target body site", formalDefinition="Indicates the site on the subject's body where the device was used ( i.e. the target site)." ) - protected Type bodySite; - - /** - * The time period over which the device was used. - */ - @Child(name = "whenUsed", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="The time period over which the device was used." ) - protected Period whenUsed; - - /** - * The details of the device used. - */ - @Child(name = "device", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="The details of the device used." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The details of the device used.) - */ - protected Device deviceTarget; - - /** - * An external identifier for this statement such as an IRI. - */ - @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="An external identifier for this statement such as an IRI." ) - protected List identifier; - - /** - * Reason or justification for the use of the device. - */ - @Child(name = "indication", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="Reason or justification for the use of the device." ) - protected List indication; - - /** - * Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement. - */ - @Child(name = "notes", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement." ) - protected List notes; - - /** - * The time at which the statement was made/recorded. - */ - @Child(name = "recordedOn", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="The time at which the statement was made/recorded." ) - protected DateTimeType recordedOn; - - /** - * The patient who used the device. - */ - @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="The patient who used the device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient who used the device.) - */ - protected Patient subjectTarget; - - /** - * How often the device was used. - */ - @Child(name = "timing", type = {Timing.class, Period.class, DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="How often the device was used." ) - protected Type timing; - - private static final long serialVersionUID = -1668571635L; - - /** - * Constructor - */ - public DeviceUseStatement() { - super(); - } - - /** - * Constructor - */ - public DeviceUseStatement(Reference device, Reference subject) { - super(); - this.device = device; - this.subject = subject; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public Type getBodySite() { - return this.bodySite; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public CodeableConcept getBodySiteCodeableConcept() throws FHIRException { - if (!(this.bodySite instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (CodeableConcept) this.bodySite; - } - - public boolean hasBodySiteCodeableConcept() { - return this.bodySite instanceof CodeableConcept; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public Reference getBodySiteReference() throws FHIRException { - if (!(this.bodySite instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.bodySite.getClass().getName()+" was encountered"); - return (Reference) this.bodySite; - } - - public boolean hasBodySiteReference() { - return this.bodySite instanceof Reference; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the device was used ( i.e. the target site).) - */ - public DeviceUseStatement setBodySite(Type value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #whenUsed} (The time period over which the device was used.) - */ - public Period getWhenUsed() { - if (this.whenUsed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.whenUsed"); - else if (Configuration.doAutoCreate()) - this.whenUsed = new Period(); // cc - return this.whenUsed; - } - - public boolean hasWhenUsed() { - return this.whenUsed != null && !this.whenUsed.isEmpty(); - } - - /** - * @param value {@link #whenUsed} (The time period over which the device was used.) - */ - public DeviceUseStatement setWhenUsed(Period value) { - this.whenUsed = value; - return this; - } - - /** - * @return {@link #device} (The details of the device used.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The details of the device used.) - */ - public DeviceUseStatement setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The details of the device used.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); // aa - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The details of the device used.) - */ - public DeviceUseStatement setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #identifier} (An external identifier for this statement such as an IRI.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An external identifier for this statement such as an IRI.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DeviceUseStatement addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #indication} (Reason or justification for the use of the device.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (CodeableConcept item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (Reason or justification for the use of the device.) - */ - // syntactic sugar - public CodeableConcept addIndication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public DeviceUseStatement addIndication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (StringType item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - // syntactic sugar - public StringType addNotesElement() {//2 - StringType t = new StringType(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - /** - * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public DeviceUseStatement addNotes(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @param value {@link #notes} (Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.) - */ - public boolean hasNotes(String value) { - if (this.notes == null) - return false; - for (StringType v : this.notes) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DateTimeType getRecordedOnElement() { - if (this.recordedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.recordedOn"); - else if (Configuration.doAutoCreate()) - this.recordedOn = new DateTimeType(); // bb - return this.recordedOn; - } - - public boolean hasRecordedOnElement() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - public boolean hasRecordedOn() { - return this.recordedOn != null && !this.recordedOn.isEmpty(); - } - - /** - * @param value {@link #recordedOn} (The time at which the statement was made/recorded.). This is the underlying object with id, value and extensions. The accessor "getRecordedOn" gives direct access to the value - */ - public DeviceUseStatement setRecordedOnElement(DateTimeType value) { - this.recordedOn = value; - return this; - } - - /** - * @return The time at which the statement was made/recorded. - */ - public Date getRecordedOn() { - return this.recordedOn == null ? null : this.recordedOn.getValue(); - } - - /** - * @param value The time at which the statement was made/recorded. - */ - public DeviceUseStatement setRecordedOn(Date value) { - if (value == null) - this.recordedOn = null; - else { - if (this.recordedOn == null) - this.recordedOn = new DateTimeType(); - this.recordedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (The patient who used the device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient who used the device.) - */ - public DeviceUseStatement setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who used the device.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DeviceUseStatement.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who used the device.) - */ - public DeviceUseStatement setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Timing getTimingTiming() throws FHIRException { - if (!(this.timing instanceof Timing)) - throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - public boolean hasTimingTiming() { - return this.timing instanceof Timing; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public Period getTimingPeriod() throws FHIRException { - if (!(this.timing instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Period) this.timing; - } - - public boolean hasTimingPeriod() { - return this.timing instanceof Period; - } - - /** - * @return {@link #timing} (How often the device was used.) - */ - public DateTimeType getTimingDateTimeType() throws FHIRException { - if (!(this.timing instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (DateTimeType) this.timing; - } - - public boolean hasTimingDateTimeType() { - return this.timing instanceof DateTimeType; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (How often the device was used.) - */ - public DeviceUseStatement setTiming(Type value) { - this.timing = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bodySite[x]", "CodeableConcept|Reference(BodySite)", "Indicates the site on the subject's body where the device was used ( i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("whenUsed", "Period", "The time period over which the device was used.", 0, java.lang.Integer.MAX_VALUE, whenUsed)); - childrenList.add(new Property("device", "Reference(Device)", "The details of the device used.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("identifier", "Identifier", "An external identifier for this statement such as an IRI.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("indication", "CodeableConcept", "Reason or justification for the use of the device.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("notes", "string", "Details about the device statement that were not represented at all or sufficiently in one of the attributes provided in a class. These may include for example a comment, an instruction, or a note associated with the statement.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("recordedOn", "dateTime", "The time at which the statement was made/recorded.", 0, java.lang.Integer.MAX_VALUE, recordedOn)); - childrenList.add(new Property("subject", "Reference(Patient)", "The patient who used the device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("timing[x]", "Timing|Period|dateTime", "How often the device was used.", 0, java.lang.Integer.MAX_VALUE, timing)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Type - case 2042879511: /*whenUsed*/ return this.whenUsed == null ? new Base[0] : new Base[] {this.whenUsed}; // Period - case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // CodeableConcept - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // StringType - case 735397551: /*recordedOn*/ return this.recordedOn == null ? new Base[0] : new Base[] {this.recordedOn}; // DateTimeType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1702620169: // bodySite - this.bodySite = (Type) value; // Type - break; - case 2042879511: // whenUsed - this.whenUsed = castToPeriod(value); // Period - break; - case -1335157162: // device - this.device = castToReference(value); // Reference - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -597168804: // indication - this.getIndication().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 105008833: // notes - this.getNotes().add(castToString(value)); // StringType - break; - case 735397551: // recordedOn - this.recordedOn = castToDateTime(value); // DateTimeType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -873664438: // timing - this.timing = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("bodySite[x]")) - this.bodySite = (Type) value; // Type - else if (name.equals("whenUsed")) - this.whenUsed = castToPeriod(value); // Period - else if (name.equals("device")) - this.device = castToReference(value); // Reference - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("indication")) - this.getIndication().add(castToCodeableConcept(value)); - else if (name.equals("notes")) - this.getNotes().add(castToString(value)); - else if (name.equals("recordedOn")) - this.recordedOn = castToDateTime(value); // DateTimeType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("timing[x]")) - this.timing = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -806219817: return getBodySite(); // Type - case 2042879511: return getWhenUsed(); // Period - case -1335157162: return getDevice(); // Reference - case -1618432855: return addIdentifier(); // Identifier - case -597168804: return addIndication(); // CodeableConcept - case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType - case 735397551: throw new FHIRException("Cannot make property recordedOn as it is not a complex type"); // DateTimeType - case -1867885268: return getSubject(); // Reference - case 164632566: return getTiming(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("bodySiteCodeableConcept")) { - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - else if (name.equals("bodySiteReference")) { - this.bodySite = new Reference(); - return this.bodySite; - } - else if (name.equals("whenUsed")) { - this.whenUsed = new Period(); - return this.whenUsed; - } - else if (name.equals("device")) { - this.device = new Reference(); - return this.device; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("indication")) { - return addIndication(); - } - else if (name.equals("notes")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseStatement.notes"); - } - else if (name.equals("recordedOn")) { - throw new FHIRException("Cannot call addChild on a primitive type DeviceUseStatement.recordedOn"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("timingTiming")) { - this.timing = new Timing(); - return this.timing; - } - else if (name.equals("timingPeriod")) { - this.timing = new Period(); - return this.timing; - } - else if (name.equals("timingDateTime")) { - this.timing = new DateTimeType(); - return this.timing; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DeviceUseStatement"; - - } - - public DeviceUseStatement copy() { - DeviceUseStatement dst = new DeviceUseStatement(); - copyValues(dst); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.whenUsed = whenUsed == null ? null : whenUsed.copy(); - dst.device = device == null ? null : device.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (CodeableConcept i : indication) - dst.indication.add(i.copy()); - }; - if (notes != null) { - dst.notes = new ArrayList(); - for (StringType i : notes) - dst.notes.add(i.copy()); - }; - dst.recordedOn = recordedOn == null ? null : recordedOn.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.timing = timing == null ? null : timing.copy(); - return dst; - } - - protected DeviceUseStatement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DeviceUseStatement)) - return false; - DeviceUseStatement o = (DeviceUseStatement) other; - return compareDeep(bodySite, o.bodySite, true) && compareDeep(whenUsed, o.whenUsed, true) && compareDeep(device, o.device, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(indication, o.indication, true) && compareDeep(notes, o.notes, true) - && compareDeep(recordedOn, o.recordedOn, true) && compareDeep(subject, o.subject, true) && compareDeep(timing, o.timing, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DeviceUseStatement)) - return false; - DeviceUseStatement o = (DeviceUseStatement) other; - return compareValues(notes, o.notes, true) && compareValues(recordedOn, o.recordedOn, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (bodySite == null || bodySite.isEmpty()) && (whenUsed == null || whenUsed.isEmpty()) - && (device == null || device.isEmpty()) && (identifier == null || identifier.isEmpty()) && (indication == null || indication.isEmpty()) - && (notes == null || notes.isEmpty()) && (recordedOn == null || recordedOn.isEmpty()) && (subject == null || subject.isEmpty()) - && (timing == null || timing.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DeviceUseStatement; - } - - /** - * Search parameter: patient - *

- * Description: Search by subject - a patient
- * Type: reference
- * Path: DeviceUseStatement.subject
- *

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

- * Description: Search by subject - a patient
- * Type: reference
- * Path: DeviceUseStatement.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceUseStatement:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:patient").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Search by subject
- * Type: reference
- * Path: DeviceUseStatement.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DeviceUseStatement.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Search by subject
- * Type: reference
- * Path: DeviceUseStatement.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceUseStatement:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:subject").toLocked(); - - /** - * Search parameter: device - *

- * Description: Search by device
- * Type: reference
- * Path: DeviceUseStatement.device
- *

- */ - @SearchParamDefinition(name="device", path="DeviceUseStatement.device", description="Search by device", type="reference" ) - public static final String SP_DEVICE = "device"; - /** - * Fluent Client search parameter constant for device - *

- * Description: Search by device
- * Type: reference
- * Path: DeviceUseStatement.device
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DeviceUseStatement:device". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("DeviceUseStatement:device").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java deleted file mode 100644 index 33372a38a05..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DiagnosticOrder.java +++ /dev/null @@ -1,2497 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * A record of a request for a diagnostic investigation service to be performed. - */ -@ResourceDef(name="DiagnosticOrder", profile="http://hl7.org/fhir/Profile/DiagnosticOrder") -public class DiagnosticOrder extends DomainResource { - - public enum DiagnosticOrderStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request is in preliminary form prior to being sent. - */ - DRAFT, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the order, but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the order, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the order is happening. - */ - INPROGRESS, - /** - * The work is complete, and the outcomes are being reviewed for approval. - */ - REVIEW, - /** - * The work has been completed, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been withdrawn. - */ - CANCELLED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The diagnostic investigation was attempted, but due to some procedural error, it could not be completed. - */ - FAILED, - /** - * The request was entered in error and voided. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DiagnosticOrderStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("review".equals(codeString)) - return REVIEW; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("failed".equals(codeString)) - return FAILED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case REVIEW: return "review"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case FAILED: return "failed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/diagnostic-order-status"; - case DRAFT: return "http://hl7.org/fhir/diagnostic-order-status"; - case PLANNED: return "http://hl7.org/fhir/diagnostic-order-status"; - case REQUESTED: return "http://hl7.org/fhir/diagnostic-order-status"; - case RECEIVED: return "http://hl7.org/fhir/diagnostic-order-status"; - case ACCEPTED: return "http://hl7.org/fhir/diagnostic-order-status"; - case INPROGRESS: return "http://hl7.org/fhir/diagnostic-order-status"; - case REVIEW: return "http://hl7.org/fhir/diagnostic-order-status"; - case COMPLETED: return "http://hl7.org/fhir/diagnostic-order-status"; - case CANCELLED: return "http://hl7.org/fhir/diagnostic-order-status"; - case SUSPENDED: return "http://hl7.org/fhir/diagnostic-order-status"; - case REJECTED: return "http://hl7.org/fhir/diagnostic-order-status"; - case FAILED: return "http://hl7.org/fhir/diagnostic-order-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-order-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case DRAFT: return "The request is in preliminary form prior to being sent."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the order, but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the order, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the order is happening."; - case REVIEW: return "The work is complete, and the outcomes are being reviewed for approval."; - case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; - case CANCELLED: return "The request has been withdrawn."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case FAILED: return "The diagnostic investigation was attempted, but due to some procedural error, it could not be completed."; - case ENTEREDINERROR: return "The request was entered in error and voided."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Draft"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In-Progress"; - case REVIEW: return "Review"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case FAILED: return "Failed"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class DiagnosticOrderStatusEnumFactory implements EnumFactory { - public DiagnosticOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return DiagnosticOrderStatus.PROPOSED; - if ("draft".equals(codeString)) - return DiagnosticOrderStatus.DRAFT; - if ("planned".equals(codeString)) - return DiagnosticOrderStatus.PLANNED; - if ("requested".equals(codeString)) - return DiagnosticOrderStatus.REQUESTED; - if ("received".equals(codeString)) - return DiagnosticOrderStatus.RECEIVED; - if ("accepted".equals(codeString)) - return DiagnosticOrderStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return DiagnosticOrderStatus.INPROGRESS; - if ("review".equals(codeString)) - return DiagnosticOrderStatus.REVIEW; - if ("completed".equals(codeString)) - return DiagnosticOrderStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return DiagnosticOrderStatus.CANCELLED; - if ("suspended".equals(codeString)) - return DiagnosticOrderStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return DiagnosticOrderStatus.REJECTED; - if ("failed".equals(codeString)) - return DiagnosticOrderStatus.FAILED; - if ("entered-in-error".equals(codeString)) - return DiagnosticOrderStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.PROPOSED); - if ("draft".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.DRAFT); - if ("planned".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.PLANNED); - if ("requested".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.REQUESTED); - if ("received".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.RECEIVED); - if ("accepted".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.ACCEPTED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.INPROGRESS); - if ("review".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.REVIEW); - if ("completed".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.COMPLETED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.CANCELLED); - if ("suspended".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.SUSPENDED); - if ("rejected".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.REJECTED); - if ("failed".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.FAILED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, DiagnosticOrderStatus.ENTEREDINERROR); - throw new FHIRException("Unknown DiagnosticOrderStatus code '"+codeString+"'"); - } - public String toCode(DiagnosticOrderStatus code) { - if (code == DiagnosticOrderStatus.PROPOSED) - return "proposed"; - if (code == DiagnosticOrderStatus.DRAFT) - return "draft"; - if (code == DiagnosticOrderStatus.PLANNED) - return "planned"; - if (code == DiagnosticOrderStatus.REQUESTED) - return "requested"; - if (code == DiagnosticOrderStatus.RECEIVED) - return "received"; - if (code == DiagnosticOrderStatus.ACCEPTED) - return "accepted"; - if (code == DiagnosticOrderStatus.INPROGRESS) - return "in-progress"; - if (code == DiagnosticOrderStatus.REVIEW) - return "review"; - if (code == DiagnosticOrderStatus.COMPLETED) - return "completed"; - if (code == DiagnosticOrderStatus.CANCELLED) - return "cancelled"; - if (code == DiagnosticOrderStatus.SUSPENDED) - return "suspended"; - if (code == DiagnosticOrderStatus.REJECTED) - return "rejected"; - if (code == DiagnosticOrderStatus.FAILED) - return "failed"; - if (code == DiagnosticOrderStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(DiagnosticOrderStatus code) { - return code.getSystem(); - } - } - - public enum DiagnosticOrderPriority { - /** - * The order has a normal priority . - */ - ROUTINE, - /** - * The order should be urgently. - */ - URGENT, - /** - * The order is time-critical. - */ - STAT, - /** - * The order should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - public static DiagnosticOrderPriority fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new FHIRException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return "http://hl7.org/fhir/diagnostic-order-priority"; - case URGENT: return "http://hl7.org/fhir/diagnostic-order-priority"; - case STAT: return "http://hl7.org/fhir/diagnostic-order-priority"; - case ASAP: return "http://hl7.org/fhir/diagnostic-order-priority"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The order has a normal priority ."; - case URGENT: return "The order should be urgently."; - case STAT: return "The order is time-critical."; - case ASAP: return "The order should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "ASAP"; - default: return "?"; - } - } - } - - public static class DiagnosticOrderPriorityEnumFactory implements EnumFactory { - public DiagnosticOrderPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return DiagnosticOrderPriority.ROUTINE; - if ("urgent".equals(codeString)) - return DiagnosticOrderPriority.URGENT; - if ("stat".equals(codeString)) - return DiagnosticOrderPriority.STAT; - if ("asap".equals(codeString)) - return DiagnosticOrderPriority.ASAP; - throw new IllegalArgumentException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return new Enumeration(this, DiagnosticOrderPriority.ROUTINE); - if ("urgent".equals(codeString)) - return new Enumeration(this, DiagnosticOrderPriority.URGENT); - if ("stat".equals(codeString)) - return new Enumeration(this, DiagnosticOrderPriority.STAT); - if ("asap".equals(codeString)) - return new Enumeration(this, DiagnosticOrderPriority.ASAP); - throw new FHIRException("Unknown DiagnosticOrderPriority code '"+codeString+"'"); - } - public String toCode(DiagnosticOrderPriority code) { - if (code == DiagnosticOrderPriority.ROUTINE) - return "routine"; - if (code == DiagnosticOrderPriority.URGENT) - return "urgent"; - if (code == DiagnosticOrderPriority.STAT) - return "stat"; - if (code == DiagnosticOrderPriority.ASAP) - return "asap"; - return "?"; - } - public String toSystem(DiagnosticOrderPriority code) { - return code.getSystem(); - } - } - - @Block() - public static class DiagnosticOrderEventComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The status for the event. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", formalDefinition="The status for the event." ) - protected Enumeration status; - - /** - * Additional information about the event that occurred - e.g. if the status remained unchanged. - */ - @Child(name = "description", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="More information about the event and its context", formalDefinition="Additional information about the event that occurred - e.g. if the status remained unchanged." ) - protected CodeableConcept description; - - /** - * The date/time at which the event occurred. - */ - @Child(name = "dateTime", type = {DateTimeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The date at which the event happened", formalDefinition="The date/time at which the event occurred." ) - protected DateTimeType dateTime; - - /** - * The person responsible for performing or recording the action. - */ - @Child(name = "actor", type = {Practitioner.class, Device.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who recorded or did this", formalDefinition="The person responsible for performing or recording the action." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The person responsible for performing or recording the action.) - */ - protected Resource actorTarget; - - private static final long serialVersionUID = -370793723L; - - /** - * Constructor - */ - public DiagnosticOrderEventComponent() { - super(); - } - - /** - * Constructor - */ - public DiagnosticOrderEventComponent(Enumeration status, DateTimeType dateTime) { - super(); - this.status = status; - this.dateTime = dateTime; - } - - /** - * @return {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status for the event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrderEventComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status for the event. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status for the event. - */ - public DiagnosticOrderEventComponent setStatus(DiagnosticOrderStatus value) { - if (this.status == null) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) - */ - public CodeableConcept getDescription() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new CodeableConcept(); // cc - return this.description; - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Additional information about the event that occurred - e.g. if the status remained unchanged.) - */ - public DiagnosticOrderEventComponent setDescription(CodeableConcept value) { - this.description = value; - return this; - } - - /** - * @return {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); // bb - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date/time at which the event occurred.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DiagnosticOrderEventComponent setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date/time at which the event occurred. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date/time at which the event occurred. - */ - public DiagnosticOrderEventComponent setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #actor} (The person responsible for performing or recording the action.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderEventComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The person responsible for performing or recording the action.) - */ - public DiagnosticOrderEventComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person responsible for performing or recording the action.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person responsible for performing or recording the action.) - */ - public DiagnosticOrderEventComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "The status for the event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("description", "CodeableConcept", "Additional information about the event that occurred - e.g. if the status remained unchanged.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("dateTime", "dateTime", "The date/time at which the event occurred.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("actor", "Reference(Practitioner|Device)", "The person responsible for performing or recording the action.", 0, java.lang.Integer.MAX_VALUE, actor)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // CodeableConcept - case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -892481550: // status - this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration - break; - case -1724546052: // description - this.description = castToCodeableConcept(value); // CodeableConcept - break; - case 1792749467: // dateTime - this.dateTime = castToDateTime(value); // DateTimeType - break; - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("status")) - this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("description")) - this.description = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("dateTime")) - this.dateTime = castToDateTime(value); // DateTimeType - else if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1724546052: return getDescription(); // CodeableConcept - case 1792749467: throw new FHIRException("Cannot make property dateTime as it is not a complex type"); // DateTimeType - case 92645877: return getActor(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.status"); - } - else if (name.equals("description")) { - this.description = new CodeableConcept(); - return this.description; - } - else if (name.equals("dateTime")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.dateTime"); - } - else if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else - return super.addChild(name); - } - - public DiagnosticOrderEventComponent copy() { - DiagnosticOrderEventComponent dst = new DiagnosticOrderEventComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.description = description == null ? null : description.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.actor = actor == null ? null : actor.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticOrderEventComponent)) - return false; - DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; - return compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(dateTime, o.dateTime, true) - && compareDeep(actor, o.actor, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticOrderEventComponent)) - return false; - DiagnosticOrderEventComponent o = (DiagnosticOrderEventComponent) other; - return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) - && (dateTime == null || dateTime.isEmpty()) && (actor == null || actor.isEmpty()); - } - - public String fhirType() { - return "DiagnosticOrder.event"; - - } - - } - - @Block() - public static class DiagnosticOrderItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept code; - - /** - * If the item is related to a specific specimen. - */ - @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="If this item relates to specific specimens", formalDefinition="If the item is related to a specific specimen." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (If the item is related to a specific specimen.) - */ - protected List specimenTarget; - - - /** - * Anatomical location where the request test should be performed. This is the target site. - */ - @Child(name = "bodySite", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Location of requested test (if applicable)", formalDefinition="Anatomical location where the request test should be performed. This is the target site." ) - protected CodeableConcept bodySite; - - /** - * The status of this individual item within the order. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", formalDefinition="The status of this individual item within the order." ) - protected Enumeration status; - - /** - * A summary of the events of interest that have occurred as this item of the request is processed. - */ - @Child(name = "event", type = {DiagnosticOrderEventComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List event; - - private static final long serialVersionUID = 381238192L; - - /** - * Constructor - */ - public DiagnosticOrderItemComponent() { - super(); - } - - /** - * Constructor - */ - public DiagnosticOrderItemComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.) - */ - public DiagnosticOrderItemComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #specimen} (If the item is related to a specific specimen.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (If the item is related to a specific specimen.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrderItemComponent addSpecimen(Reference t) { //3 - if (t == null) - return this; - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return this; - } - - /** - * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. If the item is related to a specific specimen.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. If the item is related to a specific specimen.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) - */ - public CodeableConcept getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new CodeableConcept(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Anatomical location where the request test should be performed. This is the target site.) - */ - public DiagnosticOrderItemComponent setBodySite(CodeableConcept value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrderItemComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this individual item within the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrderItemComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this individual item within the order. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this individual item within the order. - */ - public DiagnosticOrderItemComponent setStatus(DiagnosticOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DiagnosticOrderEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (A summary of the events of interest that have occurred as this item of the request is processed.) - */ - // syntactic sugar - public DiagnosticOrderEventComponent addEvent() { //3 - DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrderItemComponent addEvent(DiagnosticOrderEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code that identifies a particular diagnostic investigation, or panel of investigations, that have been requested.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "If the item is related to a specific specimen.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Anatomical location where the request test should be performed. This is the target site.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("status", "code", "The status of this individual item within the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("event", "@DiagnosticOrder.event", "A summary of the events of interest that have occurred as this item of the request is processed.", 0, java.lang.Integer.MAX_VALUE, event)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DiagnosticOrderEventComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -2132868344: // specimen - this.getSpecimen().add(castToReference(value)); // Reference - break; - case 1702620169: // bodySite - this.bodySite = castToCodeableConcept(value); // CodeableConcept - break; - case -892481550: // status - this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration - break; - case 96891546: // event - this.getEvent().add((DiagnosticOrderEventComponent) value); // DiagnosticOrderEventComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("specimen")) - this.getSpecimen().add(castToReference(value)); - else if (name.equals("bodySite")) - this.bodySite = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("status")) - this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("event")) - this.getEvent().add((DiagnosticOrderEventComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -2132868344: return addSpecimen(); // Reference - case 1702620169: return getBodySite(); // CodeableConcept - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 96891546: return addEvent(); // DiagnosticOrderEventComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("specimen")) { - return addSpecimen(); - } - else if (name.equals("bodySite")) { - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.status"); - } - else if (name.equals("event")) { - return addEvent(); - } - else - return super.addChild(name); - } - - public DiagnosticOrderItemComponent copy() { - DiagnosticOrderItemComponent dst = new DiagnosticOrderItemComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.status = status == null ? null : status.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (DiagnosticOrderEventComponent i : event) - dst.event.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticOrderItemComponent)) - return false; - DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; - return compareDeep(code, o.code, true) && compareDeep(specimen, o.specimen, true) && compareDeep(bodySite, o.bodySite, true) - && compareDeep(status, o.status, true) && compareDeep(event, o.event, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticOrderItemComponent)) - return false; - DiagnosticOrderItemComponent o = (DiagnosticOrderItemComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (specimen == null || specimen.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (status == null || status.isEmpty()) && (event == null || event.isEmpty()) - ; - } - - public String fhirType() { - return "DiagnosticOrder.item"; - - } - - } - - /** - * Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller." ) - protected List identifier; - - /** - * The status of the order. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", formalDefinition="The status of the order." ) - protected Enumeration status; - - /** - * The clinical priority associated with this order. - */ - @Child(name = "priority", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) - protected Enumeration priority; - - /** - * On whom or what the investigation is to be performed. 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). - */ - @Child(name = "subject", type = {Patient.class, Group.class, Location.class, Device.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who and/or what test is about", formalDefinition="On whom or what the investigation is to be performed. 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)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (On whom or what the investigation is to be performed. 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).) - */ - protected Resource subjectTarget; - - /** - * An encounter that provides additional information about the healthcare context in which this request is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The encounter that this diagnostic order is associated with", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * The practitioner that holds legal responsibility for ordering the investigation. - */ - @Child(name = "orderer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who ordered the test", formalDefinition="The practitioner that holds legal responsibility for ordering the investigation." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the investigation.) - */ - protected Practitioner ordererTarget; - - /** - * An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Explanation/Justification for test", formalDefinition="An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation." ) - protected List reason; - - /** - * Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order. - */ - @Child(name = "supportingInformation", type = {Observation.class, Condition.class, DocumentReference.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional clinical information", formalDefinition="Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) - */ - protected List supportingInformationTarget; - - - /** - * One or more specimens that the diagnostic investigation is about. - */ - @Child(name = "specimen", type = {Specimen.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="If the whole order relates to specific specimens", formalDefinition="One or more specimens that the diagnostic investigation is about." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (One or more specimens that the diagnostic investigation is about.) - */ - protected List specimenTarget; - - - /** - * 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. - */ - @Child(name = "event", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List event; - - /** - * 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. - */ - @Child(name = "item", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List item; - - /** - * Any other notes associated with this patient, specimen or order (e.g. "patient hates needles"). - */ - @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Other notes and comments", formalDefinition="Any other notes associated with this patient, specimen or order (e.g. \"patient hates needles\")." ) - protected List note; - - private static final long serialVersionUID = 1170289657L; - - /** - * Constructor - */ - public DiagnosticOrder() { - super(); - } - - /** - * Constructor - */ - public DiagnosticOrder(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the order. - */ - public DiagnosticOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the order. - */ - public DiagnosticOrder setStatus(DiagnosticOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new DiagnosticOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public DiagnosticOrder setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The clinical priority associated with this order. - */ - public DiagnosticOrderPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The clinical priority associated with this order. - */ - public DiagnosticOrder setPriority(DiagnosticOrderPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new DiagnosticOrderPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (On whom or what the investigation is to be performed. 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 Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (On whom or what the investigation is to be performed. 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(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (On whom or what the investigation is to be performed. 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 Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (On whom or what the investigation is to be performed. 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 setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public DiagnosticOrder setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public DiagnosticOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); // cc - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public DiagnosticOrder setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public Practitioner getOrdererTarget() { - if (this.ordererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.ordererTarget = new Practitioner(); // aa - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the investigation.) - */ - public DiagnosticOrder setOrdererTarget(Practitioner value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #reason} (An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addSupportingInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - /** - * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (One or more specimens that the diagnostic investigation is about.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addSpecimen(Reference t) { //3 - if (t == null) - return this; - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return this; - } - - /** - * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. One or more specimens that the diagnostic investigation is about.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. One or more specimens that the diagnostic investigation is about.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #event} (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 List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DiagnosticOrderEventComponent item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (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.) - */ - // syntactic sugar - public DiagnosticOrderEventComponent addEvent() { //3 - DiagnosticOrderEventComponent t = new DiagnosticOrderEventComponent(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addEvent(DiagnosticOrderEventComponent t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @return {@link #item} (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 List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (DiagnosticOrderItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (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.) - */ - // syntactic sugar - public DiagnosticOrderItemComponent addItem() { //3 - DiagnosticOrderItemComponent t = new DiagnosticOrderItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addItem(DiagnosticOrderItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #note} (Any other notes associated with this patient, specimen or order (e.g. "patient hates needles").) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Any other notes associated with this patient, specimen or order (e.g. "patient hates needles").) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public DiagnosticOrder addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order instance by the orderer and/or the receiver and/or order fulfiller.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Location|Device)", "On whom or what the investigation is to be performed. 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).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the investigation.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("reason", "CodeableConcept", "An explanation or justification for why this diagnostic investigation is being requested. This is often for billing purposes. May relate to the resources referred to in supportingInformation.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("supportingInformation", "Reference(Observation|Condition|DocumentReference)", "Additional clinical information about the patient or specimen that may influence test interpretations. This includes observations explicitly requested by the producer(filler) to provide context or supporting information needed to complete the order.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "One or more specimens that the diagnostic investigation is about.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("event", "", "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.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("item", "", "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.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("note", "Annotation", "Any other notes associated with this patient, specimen or order (e.g. \"patient hates needles\").", 0, java.lang.Integer.MAX_VALUE, note)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept - case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference - case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference - case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DiagnosticOrderEventComponent - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // DiagnosticOrderItemComponent - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration - break; - case -1165461084: // priority - this.priority = new DiagnosticOrderPriorityEnumFactory().fromType(value); // Enumeration - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1207109509: // orderer - this.orderer = castToReference(value); // Reference - break; - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1248768647: // supportingInformation - this.getSupportingInformation().add(castToReference(value)); // Reference - break; - case -2132868344: // specimen - this.getSpecimen().add(castToReference(value)); // Reference - break; - case 96891546: // event - this.getEvent().add((DiagnosticOrderEventComponent) value); // DiagnosticOrderEventComponent - break; - case 3242771: // item - this.getItem().add((DiagnosticOrderItemComponent) value); // DiagnosticOrderItemComponent - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new DiagnosticOrderStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("priority")) - this.priority = new DiagnosticOrderPriorityEnumFactory().fromType(value); // Enumeration - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("orderer")) - this.orderer = castToReference(value); // Reference - else if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); - else if (name.equals("supportingInformation")) - this.getSupportingInformation().add(castToReference(value)); - else if (name.equals("specimen")) - this.getSpecimen().add(castToReference(value)); - else if (name.equals("event")) - this.getEvent().add((DiagnosticOrderEventComponent) value); - else if (name.equals("item")) - this.getItem().add((DiagnosticOrderItemComponent) value); - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration - case -1867885268: return getSubject(); // Reference - case 1524132147: return getEncounter(); // Reference - case -1207109509: return getOrderer(); // Reference - case -934964668: return addReason(); // CodeableConcept - case -1248768647: return addSupportingInformation(); // Reference - case -2132868344: return addSpecimen(); // Reference - case 96891546: return addEvent(); // DiagnosticOrderEventComponent - case 3242771: return addItem(); // DiagnosticOrderItemComponent - case 3387378: return addNote(); // Annotation - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.status"); - } - else if (name.equals("priority")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticOrder.priority"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("orderer")) { - this.orderer = new Reference(); - return this.orderer; - } - else if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("supportingInformation")) { - return addSupportingInformation(); - } - else if (name.equals("specimen")) { - return addSpecimen(); - } - else if (name.equals("event")) { - return addEvent(); - } - else if (name.equals("item")) { - return addItem(); - } - else if (name.equals("note")) { - return addNote(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DiagnosticOrder"; - - } - - public DiagnosticOrder copy() { - DiagnosticOrder dst = new DiagnosticOrder(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - if (event != null) { - dst.event = new ArrayList(); - for (DiagnosticOrderEventComponent i : event) - dst.event.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (DiagnosticOrderItemComponent i : item) - dst.item.add(i.copy()); - }; - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - protected DiagnosticOrder typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticOrder)) - return false; - DiagnosticOrder o = (DiagnosticOrder) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(priority, o.priority, true) - && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) && compareDeep(orderer, o.orderer, true) - && compareDeep(reason, o.reason, true) && compareDeep(supportingInformation, o.supportingInformation, true) - && compareDeep(specimen, o.specimen, true) && compareDeep(event, o.event, true) && compareDeep(item, o.item, true) - && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticOrder)) - return false; - DiagnosticOrder o = (DiagnosticOrder) other; - return compareValues(status, o.status, true) && compareValues(priority, o.priority, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (priority == null || priority.isEmpty()) && (subject == null || subject.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (orderer == null || orderer.isEmpty()) && (reason == null || reason.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (event == null || event.isEmpty()) && (item == null || item.isEmpty()) - && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DiagnosticOrder; - } - - /** - * Search parameter: orderer - *

- * Description: Who ordered the test
- * Type: reference
- * Path: DiagnosticOrder.orderer
- *

- */ - @SearchParamDefinition(name="orderer", path="DiagnosticOrder.orderer", description="Who ordered the test", type="reference" ) - public static final String SP_ORDERER = "orderer"; - /** - * Fluent Client search parameter constant for orderer - *

- * Description: Who ordered the test
- * Type: reference
- * Path: DiagnosticOrder.orderer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORDERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORDERER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder:orderer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORDERER = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:orderer").toLocked(); - - /** - * Search parameter: status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.status
- *

- */ - @SearchParamDefinition(name="status", path="DiagnosticOrder.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: Who and/or what test is about
- * Type: reference
- * Path: DiagnosticOrder.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who and/or what test is about
- * Type: reference
- * Path: DiagnosticOrder.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:subject").toLocked(); - - /** - * Search parameter: item-status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.item.status
- *

- */ - @SearchParamDefinition(name="item-status", path="DiagnosticOrder.item.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) - public static final String SP_ITEM_STATUS = "item-status"; - /** - * Fluent Client search parameter constant for item-status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.item.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ITEM_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ITEM_STATUS); - - /** - * Search parameter: event-status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.event.status
- *

- */ - @SearchParamDefinition(name="event-status", path="DiagnosticOrder.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) - public static final String SP_EVENT_STATUS = "event-status"; - /** - * Fluent Client search parameter constant for event-status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.event.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT_STATUS); - - /** - * Search parameter: actor - *

- * Description: Who recorded or did this
- * Type: reference
- * Path: DiagnosticOrder.event.actor, DiagnosticOrder.item.event.actor
- *

- */ - @SearchParamDefinition(name="actor", path="DiagnosticOrder.event.actor | DiagnosticOrder.item.event.actor", description="Who recorded or did this", type="reference" ) - public static final String SP_ACTOR = "actor"; - /** - * Fluent Client search parameter constant for actor - *

- * Description: Who recorded or did this
- * Type: reference
- * Path: DiagnosticOrder.event.actor, DiagnosticOrder.item.event.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder:actor". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:actor").toLocked(); - - /** - * Search parameter: code - *

- * Description: Code to indicate the item (test or panel) being ordered
- * Type: token
- * Path: DiagnosticOrder.item.code
- *

- */ - @SearchParamDefinition(name="code", path="DiagnosticOrder.item.code", description="Code to indicate the item (test or panel) being ordered", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Code to indicate the item (test or panel) being ordered
- * Type: token
- * Path: DiagnosticOrder.item.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: encounter - *

- * Description: The encounter that this diagnostic order is associated with
- * Type: reference
- * Path: DiagnosticOrder.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="DiagnosticOrder.encounter", description="The encounter that this diagnostic order is associated with", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: The encounter that this diagnostic order is associated with
- * Type: reference
- * Path: DiagnosticOrder.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:encounter").toLocked(); - - /** - * Search parameter: item-past-status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.item.event.status
- *

- */ - @SearchParamDefinition(name="item-past-status", path="DiagnosticOrder.item.event.status", description="proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error", type="token" ) - public static final String SP_ITEM_PAST_STATUS = "item-past-status"; - /** - * Fluent Client search parameter constant for item-past-status - *

- * Description: proposed | draft | planned | requested | received | accepted | in-progress | review | completed | cancelled | suspended | rejected | failed | entered-in-error
- * Type: token
- * Path: DiagnosticOrder.item.event.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ITEM_PAST_STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ITEM_PAST_STATUS); - - /** - * Search parameter: patient - *

- * Description: Who and/or what test is about
- * Type: reference
- * Path: DiagnosticOrder.subject
- *

- */ - @SearchParamDefinition(name="patient", path="DiagnosticOrder.subject", description="Who and/or what test is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Who and/or what test is about
- * Type: reference
- * Path: DiagnosticOrder.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:patient").toLocked(); - - /** - * Search parameter: bodysite - *

- * Description: Location of requested test (if applicable)
- * Type: token
- * Path: DiagnosticOrder.item.bodySite
- *

- */ - @SearchParamDefinition(name="bodysite", path="DiagnosticOrder.item.bodySite", description="Location of requested test (if applicable)", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - /** - * Fluent Client search parameter constant for bodysite - *

- * Description: Location of requested test (if applicable)
- * Type: token
- * Path: DiagnosticOrder.item.bodySite
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODYSITE); - - /** - * Search parameter: item-date - *

- * Description: The date at which the event happened
- * Type: date
- * Path: DiagnosticOrder.item.event.dateTime
- *

- */ - @SearchParamDefinition(name="item-date", path="DiagnosticOrder.item.event.dateTime", description="The date at which the event happened", type="date" ) - public static final String SP_ITEM_DATE = "item-date"; - /** - * Fluent Client search parameter constant for item-date - *

- * Description: The date at which the event happened
- * Type: date
- * Path: DiagnosticOrder.item.event.dateTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam ITEM_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ITEM_DATE); - - /** - * Search parameter: specimen - *

- * Description: If the whole order relates to specific specimens
- * Type: reference
- * Path: DiagnosticOrder.specimen, DiagnosticOrder.item.specimen
- *

- */ - @SearchParamDefinition(name="specimen", path="DiagnosticOrder.specimen | DiagnosticOrder.item.specimen", description="If the whole order relates to specific specimens", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - /** - * Fluent Client search parameter constant for specimen - *

- * Description: If the whole order relates to specific specimens
- * Type: reference
- * Path: DiagnosticOrder.specimen, DiagnosticOrder.item.specimen
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticOrder:specimen". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticOrder:specimen").toLocked(); - - /** - * Search parameter: event-status-date - *

- * Description: A combination of past-status and date
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="event-status-date", path="", description="A combination of past-status and date", type="composite", compositeOf={"event-status", "event-date"} ) - public static final String SP_EVENT_STATUS_DATE = "event-status-date"; - /** - * Fluent Client search parameter constant for event-status-date - *

- * Description: A combination of past-status and date
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam EVENT_STATUS_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_EVENT_STATUS_DATE); - - /** - * Search parameter: event-date - *

- * Description: The date at which the event happened
- * Type: date
- * Path: DiagnosticOrder.event.dateTime
- *

- */ - @SearchParamDefinition(name="event-date", path="DiagnosticOrder.event.dateTime", description="The date at which the event happened", type="date" ) - public static final String SP_EVENT_DATE = "event-date"; - /** - * Fluent Client search parameter constant for event-date - *

- * Description: The date at which the event happened
- * Type: date
- * Path: DiagnosticOrder.event.dateTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam EVENT_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EVENT_DATE); - - /** - * Search parameter: identifier - *

- * Description: Identifiers assigned to this order
- * Type: token
- * Path: DiagnosticOrder.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DiagnosticOrder.identifier", description="Identifiers assigned to this order", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Identifiers assigned to this order
- * Type: token
- * Path: DiagnosticOrder.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: item-status-date - *

- * Description: A combination of item-past-status and item-date
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="item-status-date", path="", description="A combination of item-past-status and item-date", type="composite", compositeOf={"item-past-status", "item-date"} ) - public static final String SP_ITEM_STATUS_DATE = "item-status-date"; - /** - * Fluent Client search parameter constant for item-status-date - *

- * Description: A combination of item-past-status and item-date
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam ITEM_STATUS_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_ITEM_STATUS_DATE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java deleted file mode 100644 index a7c162756e2..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DiagnosticReport.java +++ /dev/null @@ -1,2056 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * 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 interpretations, and formatted representation of diagnostic reports. - */ -@ResourceDef(name="DiagnosticReport", profile="http://hl7.org/fhir/Profile/DiagnosticReport") -public class DiagnosticReport extends DomainResource { - - public enum DiagnosticReportStatus { - /** - * The existence of the report is registered, but there is nothing yet available. - */ - REGISTERED, - /** - * This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified. - */ - PARTIAL, - /** - * The report is complete and verified by an authorized person. - */ - FINAL, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person - */ - CORRECTED, - /** - * The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed. - */ - APPENDED, - /** - * The report is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). - */ - CANCELLED, - /** - * The report has been withdrawn following a previous final release. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DiagnosticReportStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return REGISTERED; - if ("partial".equals(codeString)) - return PARTIAL; - if ("final".equals(codeString)) - return FINAL; - if ("corrected".equals(codeString)) - return CORRECTED; - if ("appended".equals(codeString)) - return APPENDED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REGISTERED: return "registered"; - case PARTIAL: return "partial"; - case FINAL: return "final"; - case CORRECTED: return "corrected"; - case APPENDED: return "appended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REGISTERED: return "http://hl7.org/fhir/diagnostic-report-status"; - case PARTIAL: return "http://hl7.org/fhir/diagnostic-report-status"; - case FINAL: return "http://hl7.org/fhir/diagnostic-report-status"; - case CORRECTED: return "http://hl7.org/fhir/diagnostic-report-status"; - case APPENDED: return "http://hl7.org/fhir/diagnostic-report-status"; - case CANCELLED: return "http://hl7.org/fhir/diagnostic-report-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/diagnostic-report-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REGISTERED: return "The existence of the report is registered, but there is nothing yet available."; - case PARTIAL: return "This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or unverified."; - case FINAL: return "The report is complete and verified by an authorized person."; - case CORRECTED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person"; - case APPENDED: return "The report has been modified subsequent to being Final, and is complete and verified by an authorized person. New content has been added, but existing content hasn't changed."; - case CANCELLED: return "The report is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\")."; - case ENTEREDINERROR: return "The report has been withdrawn following a previous final release."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REGISTERED: return "Registered"; - case PARTIAL: return "Partial"; - case FINAL: return "Final"; - case CORRECTED: return "Corrected"; - case APPENDED: return "Appended"; - case CANCELLED: return "Cancelled"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class DiagnosticReportStatusEnumFactory implements EnumFactory { - public DiagnosticReportStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return DiagnosticReportStatus.REGISTERED; - if ("partial".equals(codeString)) - return DiagnosticReportStatus.PARTIAL; - if ("final".equals(codeString)) - return DiagnosticReportStatus.FINAL; - if ("corrected".equals(codeString)) - return DiagnosticReportStatus.CORRECTED; - if ("appended".equals(codeString)) - return DiagnosticReportStatus.APPENDED; - if ("cancelled".equals(codeString)) - return DiagnosticReportStatus.CANCELLED; - if ("entered-in-error".equals(codeString)) - return DiagnosticReportStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.REGISTERED); - if ("partial".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.PARTIAL); - if ("final".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.FINAL); - if ("corrected".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.CORRECTED); - if ("appended".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.APPENDED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.CANCELLED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, DiagnosticReportStatus.ENTEREDINERROR); - throw new FHIRException("Unknown DiagnosticReportStatus code '"+codeString+"'"); - } - public String toCode(DiagnosticReportStatus code) { - if (code == DiagnosticReportStatus.REGISTERED) - return "registered"; - if (code == DiagnosticReportStatus.PARTIAL) - return "partial"; - if (code == DiagnosticReportStatus.FINAL) - return "final"; - if (code == DiagnosticReportStatus.CORRECTED) - return "corrected"; - if (code == DiagnosticReportStatus.APPENDED) - return "appended"; - if (code == DiagnosticReportStatus.CANCELLED) - return "cancelled"; - if (code == DiagnosticReportStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(DiagnosticReportStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class DiagnosticReportImageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 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. - */ - @Child(name = "comment", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @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." ) - protected StringType comment; - - /** - * Reference to the image source. - */ - @Child(name = "link", type = {Media.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to the image source", formalDefinition="Reference to the image source." ) - protected Reference link; - - /** - * The actual object that is the target of the reference (Reference to the image source.) - */ - protected Media linkTarget; - - private static final long serialVersionUID = 935791940L; - - /** - * Constructor - */ - public DiagnosticReportImageComponent() { - super(); - } - - /** - * Constructor - */ - public DiagnosticReportImageComponent(Reference link) { - super(); - this.link = link; - } - - /** - * @return {@link #comment} (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.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (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.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public DiagnosticReportImageComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return 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 String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value 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 DiagnosticReportImageComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #link} (Reference to the image source.) - */ - public Reference getLink() { - if (this.link == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); - else if (Configuration.doAutoCreate()) - this.link = new Reference(); // cc - return this.link; - } - - public boolean hasLink() { - return this.link != null && !this.link.isEmpty(); - } - - /** - * @param value {@link #link} (Reference to the image source.) - */ - public DiagnosticReportImageComponent setLink(Reference value) { - this.link = value; - return this; - } - - /** - * @return {@link #link} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the image source.) - */ - public Media getLinkTarget() { - if (this.linkTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReportImageComponent.link"); - else if (Configuration.doAutoCreate()) - this.linkTarget = new Media(); // aa - return this.linkTarget; - } - - /** - * @param value {@link #link} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the image source.) - */ - public DiagnosticReportImageComponent setLinkTarget(Media value) { - this.linkTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("comment", "string", "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.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("link", "Reference(Media)", "Reference to the image source.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - case 3321850: /*link*/ return this.link == null ? new Base[0] : new Base[] {this.link}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - case 3321850: // link - this.link = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("comment")) - this.comment = castToString(value); // StringType - else if (name.equals("link")) - this.link = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - case 3321850: return getLink(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.comment"); - } - else if (name.equals("link")) { - this.link = new Reference(); - return this.link; - } - else - return super.addChild(name); - } - - public DiagnosticReportImageComponent copy() { - DiagnosticReportImageComponent dst = new DiagnosticReportImageComponent(); - copyValues(dst); - dst.comment = comment == null ? null : comment.copy(); - dst.link = link == null ? null : link.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticReportImageComponent)) - return false; - DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; - return compareDeep(comment, o.comment, true) && compareDeep(link, o.link, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticReportImageComponent)) - return false; - DiagnosticReportImageComponent o = (DiagnosticReportImageComponent) other; - return compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (comment == null || comment.isEmpty()) && (link == null || link.isEmpty()) - ; - } - - public String fhirType() { - return "DiagnosticReport.image"; - - } - - } - - /** - * The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List identifier; - - /** - * The status of the diagnostic report as a whole. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="registered | partial | final | corrected | appended | cancelled | entered-in-error", formalDefinition="The status of the diagnostic report as a whole." ) - protected Enumeration status; - - /** - * A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service category", formalDefinition="A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes." ) - protected CodeableConcept category; - - /** - * A code or name that describes this diagnostic report. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name/Code for this diagnostic report", formalDefinition="A code or name that describes this diagnostic report." ) - protected CodeableConcept code; - - /** - * 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. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=1, max=1, modifier=false, summary=true) - @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." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (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.) - */ - protected Resource subjectTarget; - - /** - * The link to the health care event (encounter) when the order was made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Health care event when test ordered", formalDefinition="The link to the health care event (encounter) when the order was made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The link to the health care event (encounter) when the order was made.) - */ - protected Encounter encounterTarget; - - /** - * The time or time-period the observed values are related to. When the subject of the report is a patient, 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. - */ - @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Clinically Relevant time/time-period for report", formalDefinition="The time or time-period the observed values are related to. When the subject of the report is a patient, 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." ) - protected Type effective; - - /** - * The date and time that this version of the report was released from the source diagnostic service. - */ - @Child(name = "issued", type = {InstantType.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="DateTime this version was released", formalDefinition="The date and time that this version of the report was released from the source diagnostic service." ) - protected InstantType issued; - - /** - * The diagnostic service that is responsible for issuing the report. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class}, order=8, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible Diagnostic Service", formalDefinition="The diagnostic service that is responsible for issuing the report." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (The diagnostic service that is responsible for issuing the report.) - */ - protected Resource performerTarget; - - /** - * Details concerning a test or procedure requested. - */ - @Child(name = "request", type = {DiagnosticOrder.class, ProcedureRequest.class, ReferralRequest.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="What was requested", formalDefinition="Details concerning a test or procedure requested." ) - protected List request; - /** - * The actual objects that are the target of the reference (Details concerning a test or procedure requested.) - */ - protected List requestTarget; - - - /** - * Details about the specimens on which this diagnostic report is based. - */ - @Child(name = "specimen", type = {Specimen.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Specimens this report is based on", formalDefinition="Details about the specimens on which this diagnostic report is based." ) - protected List specimen; - /** - * The actual objects that are the target of the reference (Details about the specimens on which this diagnostic report is based.) - */ - protected List specimenTarget; - - - /** - * 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"). - */ - @Child(name = "result", type = {Observation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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\")." ) - protected List result; - /** - * The actual objects that are the target of the reference (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").) - */ - protected List resultTarget; - - - /** - * 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. - */ - @Child(name = "imagingStudy", type = {ImagingStudy.class, ImagingObjectSelection.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List imagingStudy; - /** - * The actual objects that are the target of the reference (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.) - */ - protected List imagingStudyTarget; - - - /** - * 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). - */ - @Child(name = "image", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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)." ) - protected List image; - - /** - * Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - @Child(name = "conclusion", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Clinical Interpretation of test results", formalDefinition="Concise and clinically contextualized narrative interpretation of the diagnostic report." ) - protected StringType conclusion; - - /** - * Codes for the conclusion. - */ - @Child(name = "codedDiagnosis", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Codes for the conclusion", formalDefinition="Codes for the conclusion." ) - protected List codedDiagnosis; - - /** - * Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent. - */ - @Child(name = "presentedForm", type = {Attachment.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Entire report as issued", formalDefinition="Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent." ) - protected List presentedForm; - - private static final long serialVersionUID = 920334551L; - - /** - * Constructor - */ - public DiagnosticReport() { - super(); - } - - /** - * Constructor - */ - public DiagnosticReport(Enumeration status, CodeableConcept code, Reference subject, Type effective, InstantType issued, Reference performer) { - super(); - this.status = status; - this.code = code; - this.subject = subject; - this.effective = effective; - this.issued = issued; - this.performer = performer; - } - - /** - * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the diagnostic report as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DiagnosticReport setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the diagnostic report as a whole. - */ - public DiagnosticReportStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the diagnostic report as a whole. - */ - public DiagnosticReport setStatus(DiagnosticReportStatus value) { - if (this.status == null) - this.status = new Enumeration(new DiagnosticReportStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #category} (A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.) - */ - public DiagnosticReport setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #code} (A code or name that describes this diagnostic report.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code or name that describes this diagnostic report.) - */ - public DiagnosticReport setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (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 Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (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(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (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 Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (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 setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The link to the health care event (encounter) when the order was made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The link to the health care event (encounter) when the order was made.) - */ - public DiagnosticReport setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The link to the health care event (encounter) when the order was made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The link to the health care event (encounter) when the order was made.) - */ - public DiagnosticReport setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, 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 Type getEffective() { - return this.effective; - } - - /** - * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, 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 DateTimeType getEffectiveDateTimeType() throws FHIRException { - if (!(this.effective instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (DateTimeType) this.effective; - } - - public boolean hasEffectiveDateTimeType() { - return this.effective instanceof DateTimeType; - } - - /** - * @return {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, 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 Period getEffectivePeriod() throws FHIRException { - if (!(this.effective instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (Period) this.effective; - } - - public boolean hasEffectivePeriod() { - return this.effective instanceof Period; - } - - public boolean hasEffective() { - return this.effective != null && !this.effective.isEmpty(); - } - - /** - * @param value {@link #effective} (The time or time-period the observed values are related to. When the subject of the report is a patient, 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 setEffective(Type value) { - this.effective = value; - return this; - } - - /** - * @return {@link #issued} (The date and time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public InstantType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new InstantType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (The date and time that this version of the report was released from the source diagnostic service.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public DiagnosticReport setIssuedElement(InstantType value) { - this.issued = value; - return this; - } - - /** - * @return The date and time that this version of the report was released from the source diagnostic service. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value The date and time that this version of the report was released from the source diagnostic service. - */ - public DiagnosticReport setIssued(Date value) { - if (this.issued == null) - this.issued = new InstantType(); - this.issued.setValue(value); - return this; - } - - /** - * @return {@link #performer} (The diagnostic service that is responsible for issuing the report.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (The diagnostic service that is responsible for issuing the report.) - */ - public DiagnosticReport setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The diagnostic service that is responsible for issuing the report.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The diagnostic service that is responsible for issuing the report.) - */ - public DiagnosticReport setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #request} (Details concerning a test or procedure requested.) - */ - public List getRequest() { - if (this.request == null) - this.request = new ArrayList(); - return this.request; - } - - public boolean hasRequest() { - if (this.request == null) - return false; - for (Reference item : this.request) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #request} (Details concerning a test or procedure requested.) - */ - // syntactic sugar - public Reference addRequest() { //3 - Reference t = new Reference(); - if (this.request == null) - this.request = new ArrayList(); - this.request.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addRequest(Reference t) { //3 - if (t == null) - return this; - if (this.request == null) - this.request = new ArrayList(); - this.request.add(t); - return this; - } - - /** - * @return {@link #request} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details concerning a test or procedure requested.) - */ - public List getRequestTarget() { - if (this.requestTarget == null) - this.requestTarget = new ArrayList(); - return this.requestTarget; - } - - /** - * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) - */ - public List getSpecimen() { - if (this.specimen == null) - this.specimen = new ArrayList(); - return this.specimen; - } - - public boolean hasSpecimen() { - if (this.specimen == null) - return false; - for (Reference item : this.specimen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specimen} (Details about the specimens on which this diagnostic report is based.) - */ - // syntactic sugar - public Reference addSpecimen() { //3 - Reference t = new Reference(); - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addSpecimen(Reference t) { //3 - if (t == null) - return this; - if (this.specimen == null) - this.specimen = new ArrayList(); - this.specimen.add(t); - return this; - } - - /** - * @return {@link #specimen} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.) - */ - public List getSpecimenTarget() { - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - return this.specimenTarget; - } - - // syntactic sugar - /** - * @return {@link #specimen} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Details about the specimens on which this diagnostic report is based.) - */ - public Specimen addSpecimenTarget() { - Specimen r = new Specimen(); - if (this.specimenTarget == null) - this.specimenTarget = new ArrayList(); - this.specimenTarget.add(r); - return r; - } - - /** - * @return {@link #result} (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 List getResult() { - if (this.result == null) - this.result = new ArrayList(); - return this.result; - } - - public boolean hasResult() { - if (this.result == null) - return false; - for (Reference item : this.result) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #result} (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").) - */ - // syntactic sugar - public Reference addResult() { //3 - Reference t = new Reference(); - if (this.result == null) - this.result = new ArrayList(); - this.result.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addResult(Reference t) { //3 - if (t == null) - return this; - if (this.result == null) - this.result = new ArrayList(); - this.result.add(t); - return this; - } - - /** - * @return {@link #result} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. 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 List getResultTarget() { - if (this.resultTarget == null) - this.resultTarget = new ArrayList(); - return this.resultTarget; - } - - // syntactic sugar - /** - * @return {@link #result} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. 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 Observation addResultTarget() { - Observation r = new Observation(); - if (this.resultTarget == null) - this.resultTarget = new ArrayList(); - this.resultTarget.add(r); - return r; - } - - /** - * @return {@link #imagingStudy} (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 List getImagingStudy() { - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - return this.imagingStudy; - } - - public boolean hasImagingStudy() { - if (this.imagingStudy == null) - return false; - for (Reference item : this.imagingStudy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #imagingStudy} (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.) - */ - // syntactic sugar - public Reference addImagingStudy() { //3 - Reference t = new Reference(); - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - this.imagingStudy.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addImagingStudy(Reference t) { //3 - if (t == null) - return this; - if (this.imagingStudy == null) - this.imagingStudy = new ArrayList(); - this.imagingStudy.add(t); - return this; - } - - /** - * @return {@link #imagingStudy} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. 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 List getImagingStudyTarget() { - if (this.imagingStudyTarget == null) - this.imagingStudyTarget = new ArrayList(); - return this.imagingStudyTarget; - } - - /** - * @return {@link #image} (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 List getImage() { - if (this.image == null) - this.image = new ArrayList(); - return this.image; - } - - public boolean hasImage() { - if (this.image == null) - return false; - for (DiagnosticReportImageComponent item : this.image) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #image} (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).) - */ - // syntactic sugar - public DiagnosticReportImageComponent addImage() { //3 - DiagnosticReportImageComponent t = new DiagnosticReportImageComponent(); - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addImage(DiagnosticReportImageComponent t) { //3 - if (t == null) - return this; - if (this.image == null) - this.image = new ArrayList(); - this.image.add(t); - return this; - } - - /** - * @return {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value - */ - public StringType getConclusionElement() { - if (this.conclusion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosticReport.conclusion"); - else if (Configuration.doAutoCreate()) - this.conclusion = new StringType(); // bb - return this.conclusion; - } - - public boolean hasConclusionElement() { - return this.conclusion != null && !this.conclusion.isEmpty(); - } - - public boolean hasConclusion() { - return this.conclusion != null && !this.conclusion.isEmpty(); - } - - /** - * @param value {@link #conclusion} (Concise and clinically contextualized narrative interpretation of the diagnostic report.). This is the underlying object with id, value and extensions. The accessor "getConclusion" gives direct access to the value - */ - public DiagnosticReport setConclusionElement(StringType value) { - this.conclusion = value; - return this; - } - - /** - * @return Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - public String getConclusion() { - return this.conclusion == null ? null : this.conclusion.getValue(); - } - - /** - * @param value Concise and clinically contextualized narrative interpretation of the diagnostic report. - */ - public DiagnosticReport setConclusion(String value) { - if (Utilities.noString(value)) - this.conclusion = null; - else { - if (this.conclusion == null) - this.conclusion = new StringType(); - this.conclusion.setValue(value); - } - return this; - } - - /** - * @return {@link #codedDiagnosis} (Codes for the conclusion.) - */ - public List getCodedDiagnosis() { - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - return this.codedDiagnosis; - } - - public boolean hasCodedDiagnosis() { - if (this.codedDiagnosis == null) - return false; - for (CodeableConcept item : this.codedDiagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codedDiagnosis} (Codes for the conclusion.) - */ - // syntactic sugar - public CodeableConcept addCodedDiagnosis() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - this.codedDiagnosis.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addCodedDiagnosis(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.codedDiagnosis == null) - this.codedDiagnosis = new ArrayList(); - this.codedDiagnosis.add(t); - return this; - } - - /** - * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) - */ - public List getPresentedForm() { - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - return this.presentedForm; - } - - public boolean hasPresentedForm() { - if (this.presentedForm == null) - return false; - for (Attachment item : this.presentedForm) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #presentedForm} (Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.) - */ - // syntactic sugar - public Attachment addPresentedForm() { //3 - Attachment t = new Attachment(); - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - this.presentedForm.add(t); - return t; - } - - // syntactic sugar - public DiagnosticReport addPresentedForm(Attachment t) { //3 - if (t == null) - return this; - if (this.presentedForm == null) - this.presentedForm = new ArrayList(); - this.presentedForm.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The local ID assigned to the report by the order filler, usually by the Information System of the diagnostic service provider.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "The status of the diagnostic report as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "A code or name that describes this diagnostic report.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "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.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The link to the health care event (encounter) when the order was made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("effective[x]", "dateTime|Period", "The time or time-period the observed values are related to. When the subject of the report is a patient, 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.", 0, java.lang.Integer.MAX_VALUE, effective)); - childrenList.add(new Property("issued", "instant", "The date and time that this version of the report was released from the source diagnostic service.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization)", "The diagnostic service that is responsible for issuing the report.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("request", "Reference(DiagnosticOrder|ProcedureRequest|ReferralRequest)", "Details concerning a test or procedure requested.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "Details about the specimens on which this diagnostic report is based.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("result", "Reference(Observation)", "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\").", 0, java.lang.Integer.MAX_VALUE, result)); - childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy|ImagingObjectSelection)", "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.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); - childrenList.add(new Property("image", "", "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).", 0, java.lang.Integer.MAX_VALUE, image)); - childrenList.add(new Property("conclusion", "string", "Concise and clinically contextualized narrative interpretation of the diagnostic report.", 0, java.lang.Integer.MAX_VALUE, conclusion)); - childrenList.add(new Property("codedDiagnosis", "CodeableConcept", "Codes for the conclusion.", 0, java.lang.Integer.MAX_VALUE, codedDiagnosis)); - childrenList.add(new Property("presentedForm", "Attachment", "Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.", 0, java.lang.Integer.MAX_VALUE, presentedForm)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type - case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference - case 1095692943: /*request*/ return this.request == null ? new Base[0] : this.request.toArray(new Base[this.request.size()]); // Reference - case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : this.specimen.toArray(new Base[this.specimen.size()]); // Reference - case -934426595: /*result*/ return this.result == null ? new Base[0] : this.result.toArray(new Base[this.result.size()]); // Reference - case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : this.imagingStudy.toArray(new Base[this.imagingStudy.size()]); // Reference - case 100313435: /*image*/ return this.image == null ? new Base[0] : this.image.toArray(new Base[this.image.size()]); // DiagnosticReportImageComponent - case -1731259873: /*conclusion*/ return this.conclusion == null ? new Base[0] : new Base[] {this.conclusion}; // StringType - case -1364269926: /*codedDiagnosis*/ return this.codedDiagnosis == null ? new Base[0] : this.codedDiagnosis.toArray(new Base[this.codedDiagnosis.size()]); // CodeableConcept - case 230090366: /*presentedForm*/ return this.presentedForm == null ? new Base[0] : this.presentedForm.toArray(new Base[this.presentedForm.size()]); // Attachment - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new DiagnosticReportStatusEnumFactory().fromType(value); // Enumeration - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1468651097: // effective - this.effective = (Type) value; // Type - break; - case -1179159893: // issued - this.issued = castToInstant(value); // InstantType - break; - case 481140686: // performer - this.performer = castToReference(value); // Reference - break; - case 1095692943: // request - this.getRequest().add(castToReference(value)); // Reference - break; - case -2132868344: // specimen - this.getSpecimen().add(castToReference(value)); // Reference - break; - case -934426595: // result - this.getResult().add(castToReference(value)); // Reference - break; - case -814900911: // imagingStudy - this.getImagingStudy().add(castToReference(value)); // Reference - break; - case 100313435: // image - this.getImage().add((DiagnosticReportImageComponent) value); // DiagnosticReportImageComponent - break; - case -1731259873: // conclusion - this.conclusion = castToString(value); // StringType - break; - case -1364269926: // codedDiagnosis - this.getCodedDiagnosis().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 230090366: // presentedForm - this.getPresentedForm().add(castToAttachment(value)); // Attachment - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new DiagnosticReportStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("effective[x]")) - this.effective = (Type) value; // Type - else if (name.equals("issued")) - this.issued = castToInstant(value); // InstantType - else if (name.equals("performer")) - this.performer = castToReference(value); // Reference - else if (name.equals("request")) - this.getRequest().add(castToReference(value)); - else if (name.equals("specimen")) - this.getSpecimen().add(castToReference(value)); - else if (name.equals("result")) - this.getResult().add(castToReference(value)); - else if (name.equals("imagingStudy")) - this.getImagingStudy().add(castToReference(value)); - else if (name.equals("image")) - this.getImage().add((DiagnosticReportImageComponent) value); - else if (name.equals("conclusion")) - this.conclusion = castToString(value); // StringType - else if (name.equals("codedDiagnosis")) - this.getCodedDiagnosis().add(castToCodeableConcept(value)); - else if (name.equals("presentedForm")) - this.getPresentedForm().add(castToAttachment(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 50511102: return getCategory(); // CodeableConcept - case 3059181: return getCode(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case 1524132147: return getEncounter(); // Reference - case 247104889: return getEffective(); // Type - case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // InstantType - case 481140686: return getPerformer(); // Reference - case 1095692943: return addRequest(); // Reference - case -2132868344: return addSpecimen(); // Reference - case -934426595: return addResult(); // Reference - case -814900911: return addImagingStudy(); // Reference - case 100313435: return addImage(); // DiagnosticReportImageComponent - case -1731259873: throw new FHIRException("Cannot make property conclusion as it is not a complex type"); // StringType - case -1364269926: return addCodedDiagnosis(); // CodeableConcept - case 230090366: return addPresentedForm(); // Attachment - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.status"); - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("effectiveDateTime")) { - this.effective = new DateTimeType(); - return this.effective; - } - else if (name.equals("effectivePeriod")) { - this.effective = new Period(); - return this.effective; - } - else if (name.equals("issued")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.issued"); - } - else if (name.equals("performer")) { - this.performer = new Reference(); - return this.performer; - } - else if (name.equals("request")) { - return addRequest(); - } - else if (name.equals("specimen")) { - return addSpecimen(); - } - else if (name.equals("result")) { - return addResult(); - } - else if (name.equals("imagingStudy")) { - return addImagingStudy(); - } - else if (name.equals("image")) { - return addImage(); - } - else if (name.equals("conclusion")) { - throw new FHIRException("Cannot call addChild on a primitive type DiagnosticReport.conclusion"); - } - else if (name.equals("codedDiagnosis")) { - return addCodedDiagnosis(); - } - else if (name.equals("presentedForm")) { - return addPresentedForm(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DiagnosticReport"; - - } - - public DiagnosticReport copy() { - DiagnosticReport dst = new DiagnosticReport(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.effective = effective == null ? null : effective.copy(); - dst.issued = issued == null ? null : issued.copy(); - dst.performer = performer == null ? null : performer.copy(); - if (request != null) { - dst.request = new ArrayList(); - for (Reference i : request) - dst.request.add(i.copy()); - }; - if (specimen != null) { - dst.specimen = new ArrayList(); - for (Reference i : specimen) - dst.specimen.add(i.copy()); - }; - if (result != null) { - dst.result = new ArrayList(); - for (Reference i : result) - dst.result.add(i.copy()); - }; - if (imagingStudy != null) { - dst.imagingStudy = new ArrayList(); - for (Reference i : imagingStudy) - dst.imagingStudy.add(i.copy()); - }; - if (image != null) { - dst.image = new ArrayList(); - for (DiagnosticReportImageComponent i : image) - dst.image.add(i.copy()); - }; - dst.conclusion = conclusion == null ? null : conclusion.copy(); - if (codedDiagnosis != null) { - dst.codedDiagnosis = new ArrayList(); - for (CodeableConcept i : codedDiagnosis) - dst.codedDiagnosis.add(i.copy()); - }; - if (presentedForm != null) { - dst.presentedForm = new ArrayList(); - for (Attachment i : presentedForm) - dst.presentedForm.add(i.copy()); - }; - return dst; - } - - protected DiagnosticReport typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosticReport)) - return false; - DiagnosticReport o = (DiagnosticReport) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) - && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true) - && compareDeep(request, o.request, true) && compareDeep(specimen, o.specimen, true) && compareDeep(result, o.result, true) - && compareDeep(imagingStudy, o.imagingStudy, true) && compareDeep(image, o.image, true) && compareDeep(conclusion, o.conclusion, true) - && compareDeep(codedDiagnosis, o.codedDiagnosis, true) && compareDeep(presentedForm, o.presentedForm, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosticReport)) - return false; - DiagnosticReport o = (DiagnosticReport) other; - return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(conclusion, o.conclusion, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (effective == null || effective.isEmpty()) - && (issued == null || issued.isEmpty()) && (performer == null || performer.isEmpty()) && (request == null || request.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (result == null || result.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) - && (image == null || image.isEmpty()) && (conclusion == null || conclusion.isEmpty()) && (codedDiagnosis == null || codedDiagnosis.isEmpty()) - && (presentedForm == null || presentedForm.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DiagnosticReport; - } - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam RESULT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESULT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:result". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RESULT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:result").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:subject").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.DateClientParam ISSUED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_ISSUED); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam DIAGNOSIS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DIAGNOSIS); - - /** - * Search parameter: image - *

- * Description: A reference to the image source.
- * Type: reference
- * Path: DiagnosticReport.image.link
- *

- */ - @SearchParamDefinition(name="image", path="DiagnosticReport.image.link", description="A reference to the image source.", type="reference" ) - public static final String SP_IMAGE = "image"; - /** - * Fluent Client search parameter constant for image - *

- * Description: A reference to the image source.
- * Type: reference
- * Path: DiagnosticReport.image.link
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam IMAGE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_IMAGE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:image". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_IMAGE = new ca.uhn.fhir.model.api.Include("DiagnosticReport:image").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: The Encounter when the order was made
- * Type: reference
- * Path: DiagnosticReport.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="DiagnosticReport.encounter", description="The Encounter when the order was made", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: The Encounter when the order was made
- * Type: reference
- * Path: DiagnosticReport.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:encounter").toLocked(); - - /** - * Search parameter: code - *

- * Description: 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.code
- *

- */ - @SearchParamDefinition(name="code", path="DiagnosticReport.code", description="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_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: 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.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: The clinically relevant time of the report
- * Type: date
- * Path: DiagnosticReport.effective[x]
- *

- */ - @SearchParamDefinition(name="date", path="DiagnosticReport.effective", 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.effective[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: category - *

- * Description: Which diagnostic discipline/department created the report
- * Type: token
- * Path: DiagnosticReport.category
- *

- */ - @SearchParamDefinition(name="category", path="DiagnosticReport.category", description="Which diagnostic discipline/department created the report", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: Which diagnostic discipline/department created the report
- * Type: token
- * Path: DiagnosticReport.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: patient - *

- * Description: The subject of the report if a patient
- * Type: reference
- * Path: DiagnosticReport.subject
- *

- */ - @SearchParamDefinition(name="patient", path="DiagnosticReport.subject", description="The subject of the report if a patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The subject of the report if a patient
- * Type: reference
- * Path: DiagnosticReport.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DiagnosticReport:patient").toLocked(); - - /** - * Search parameter: request - *

- * Description: Reference to the test or procedure request.
- * Type: reference
- * Path: DiagnosticReport.request
- *

- */ - @SearchParamDefinition(name="request", path="DiagnosticReport.request", description="Reference to the test or procedure request.", type="reference" ) - public static final String SP_REQUEST = "request"; - /** - * Fluent Client search parameter constant for request - *

- * Description: Reference to the test or procedure request.
- * Type: reference
- * Path: DiagnosticReport.request
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:request". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("DiagnosticReport:request").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:specimen". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("DiagnosticReport:specimen").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DiagnosticReport:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("DiagnosticReport:performer").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Distance.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Distance.java deleted file mode 100644 index 5826150550e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Distance.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Distance", profileOf=Quantity.class) -public class Distance extends Quantity { - - private static final long serialVersionUID = 1069574054L; - - public Distance copy() { - Distance dst = new Distance(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Distance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Distance)) - return false; - Distance o = (Distance) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Distance)) - return false; - Distance o = (Distance) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DocumentManifest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DocumentManifest.java deleted file mode 100644 index cf8c1ab23bf..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DocumentManifest.java +++ /dev/null @@ -1,1587 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A manifest that defines a set of documents. - */ -@ResourceDef(name="DocumentManifest", profile="http://hl7.org/fhir/Profile/DocumentManifest") -public class DocumentManifest extends DomainResource { - - @Block() - public static class DocumentManifestContentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed. - */ - @Child(name = "p", type = {Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contents of this set of documents", formalDefinition="The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed." ) - protected Type p; - - private static final long serialVersionUID = -347538500L; - - /** - * Constructor - */ - public DocumentManifestContentComponent() { - super(); - } - - /** - * Constructor - */ - public DocumentManifestContentComponent(Type p) { - super(); - this.p = p; - } - - /** - * @return {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public Type getP() { - return this.p; - } - - /** - * @return {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public Attachment getPAttachment() throws FHIRException { - if (!(this.p instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.p.getClass().getName()+" was encountered"); - return (Attachment) this.p; - } - - public boolean hasPAttachment() { - return this.p instanceof Attachment; - } - - /** - * @return {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public Reference getPReference() throws FHIRException { - if (!(this.p instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.p.getClass().getName()+" was encountered"); - return (Reference) this.p; - } - - public boolean hasPReference() { - return this.p instanceof Reference; - } - - public boolean hasP() { - return this.p != null && !this.p.isEmpty(); - } - - /** - * @param value {@link #p} (The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.) - */ - public DocumentManifestContentComponent setP(Type value) { - this.p = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("p[x]", "Attachment|Reference(Any)", "The list of references to document content, or Attachment that consist of the parts of this document manifest. Usually, these would be document references, but direct references to Media or Attachments are also allowed.", 0, java.lang.Integer.MAX_VALUE, p)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 112: /*p*/ return this.p == null ? new Base[0] : new Base[] {this.p}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 112: // p - this.p = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("p[x]")) - this.p = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3427856: return getP(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("pAttachment")) { - this.p = new Attachment(); - return this.p; - } - else if (name.equals("pReference")) { - this.p = new Reference(); - return this.p; - } - else - return super.addChild(name); - } - - public DocumentManifestContentComponent copy() { - DocumentManifestContentComponent dst = new DocumentManifestContentComponent(); - copyValues(dst); - dst.p = p == null ? null : p.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentManifestContentComponent)) - return false; - DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; - return compareDeep(p, o.p, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentManifestContentComponent)) - return false; - DocumentManifestContentComponent o = (DocumentManifestContentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (p == null || p.isEmpty()); - } - - public String fhirType() { - return "DocumentManifest.content"; - - } - - } - - @Block() - public static class DocumentManifestRelatedComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifiers of things that are related", formalDefinition="Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers." ) - protected Identifier identifier; - - /** - * Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc. - */ - @Child(name = "ref", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc." ) - protected Reference ref; - - /** - * The actual object that is the target of the reference (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) - */ - protected Resource refTarget; - - private static final long serialVersionUID = -1670123330L; - - /** - * Constructor - */ - public DocumentManifestRelatedComponent() { - super(); - } - - /** - * @return {@link #identifier} (Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers.) - */ - public DocumentManifestRelatedComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #ref} (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) - */ - public Reference getRef() { - if (this.ref == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifestRelatedComponent.ref"); - else if (Configuration.doAutoCreate()) - this.ref = new Reference(); // cc - return this.ref; - } - - public boolean hasRef() { - return this.ref != null && !this.ref.isEmpty(); - } - - /** - * @param value {@link #ref} (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) - */ - public DocumentManifestRelatedComponent setRef(Reference value) { - this.ref = value; - return this; - } - - /** - * @return {@link #ref} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) - */ - public Resource getRefTarget() { - return this.refTarget; - } - - /** - * @param value {@link #ref} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.) - */ - public DocumentManifestRelatedComponent setRefTarget(Resource value) { - this.refTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentManifest. For example, Order numbers, accession numbers, XDW workflow numbers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentManifest. For example, Order, DiagnosticOrder, Procedure, EligibilityRequest, etc.", 0, java.lang.Integer.MAX_VALUE, ref)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 112787: /*ref*/ return this.ref == null ? new Base[0] : new Base[] {this.ref}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 112787: // ref - this.ref = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("ref")) - this.ref = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 112787: return getRef(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("ref")) { - this.ref = new Reference(); - return this.ref; - } - else - return super.addChild(name); - } - - public DocumentManifestRelatedComponent copy() { - DocumentManifestRelatedComponent dst = new DocumentManifestRelatedComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.ref = ref == null ? null : ref.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentManifestRelatedComponent)) - return false; - DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentManifestRelatedComponent)) - return false; - DocumentManifestRelatedComponent o = (DocumentManifestRelatedComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) - ; - } - - public String fhirType() { - return "DocumentManifest.related"; - - } - - } - - /** - * A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts. - */ - @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Identifier masterIdentifier; - - /** - * Other identifiers associated with the document manifest, including version independent identifiers. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other identifiers for the manifest", formalDefinition="Other identifiers associated with the document manifest, including version independent identifiers." ) - protected List identifier; - - /** - * 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). - */ - @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (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).) - */ - protected Resource subjectTarget; - - /** - * A patient, practitioner, or organization for which this set of documents is intended. - */ - @Child(name = "recipient", type = {Patient.class, Practitioner.class, RelatedPerson.class, Organization.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (A patient, practitioner, or organization for which this set of documents is intended.) - */ - protected List recipientTarget; - - - /** - * 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. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Kind of document set", 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." ) - protected CodeableConcept type; - - /** - * Identifies who is responsible for creating the manifest, and adding documents to it. - */ - @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who and/or what authored the manifest", formalDefinition="Identifies who is responsible for creating the manifest, and adding documents to it." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for creating the manifest, and adding documents to it.) - */ - protected List authorTarget; - - - /** - * 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.). - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @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.)." ) - protected DateTimeType created; - - /** - * Identifies the source system, application, or software that produced the document manifest. - */ - @Child(name = "source", type = {UriType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The source system/application/software", formalDefinition="Identifies the source system, application, or software that produced the document manifest." ) - protected UriType source; - - /** - * The status of this document manifest. - */ - @Child(name = "status", type = {CodeType.class}, order=8, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="current | superseded | entered-in-error", formalDefinition="The status of this document manifest." ) - protected Enumeration status; - - /** - * Human-readable description of the source document. This is sometimes known as the "title". - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\"." ) - protected StringType description; - - /** - * The list of Documents included in the manifest. - */ - @Child(name = "content", type = {}, order=10, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The items included", formalDefinition="The list of Documents included in the manifest." ) - protected List content; - - /** - * Related identifiers or resources associated with the DocumentManifest. - */ - @Child(name = "related", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Related things", formalDefinition="Related identifiers or resources associated with the DocumentManifest." ) - protected List related; - - private static final long serialVersionUID = -2056683927L; - - /** - * Constructor - */ - public DocumentManifest() { - super(); - } - - /** - * Constructor - */ - public DocumentManifest(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) - */ - public Identifier getMasterIdentifier() { - if (this.masterIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.masterIdentifier"); - else if (Configuration.doAutoCreate()) - this.masterIdentifier = new Identifier(); // cc - return this.masterIdentifier; - } - - public boolean hasMasterIdentifier() { - return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); - } - - /** - * @param value {@link #masterIdentifier} (A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.) - */ - public DocumentManifest setMasterIdentifier(Identifier value) { - this.masterIdentifier = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document manifest, including version independent identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (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 Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (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(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (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 Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (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 setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (A patient, practitioner, or organization for which this set of documents is intended.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A patient, practitioner, or organization for which this set of documents is intended.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #type} (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 CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (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(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for creating the manifest, and adding documents to it.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for creating the manifest, and adding documents to it.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for creating the manifest, and adding documents to it.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #created} (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.).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (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.).). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DocumentManifest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return 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 Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value 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 value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public UriType getSourceElement() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.source"); - else if (Configuration.doAutoCreate()) - this.source = new UriType(); // bb - return this.source; - } - - public boolean hasSourceElement() { - return this.source != null && !this.source.isEmpty(); - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Identifies the source system, application, or software that produced the document manifest.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public DocumentManifest setSourceElement(UriType value) { - this.source = value; - return this; - } - - /** - * @return Identifies the source system, application, or software that produced the document manifest. - */ - public String getSource() { - return this.source == null ? null : this.source.getValue(); - } - - /** - * @param value Identifies the source system, application, or software that produced the document manifest. - */ - public DocumentManifest setSource(String value) { - if (Utilities.noString(value)) - this.source = null; - else { - if (this.source == null) - this.source = new UriType(); - this.source.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this document manifest.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DocumentManifest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this document manifest. - */ - public DocumentReferenceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this document manifest. - */ - public DocumentManifest setStatus(DocumentReferenceStatus value) { - if (this.status == null) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentManifest.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DocumentManifest setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the source document. This is sometimes known as the "title". - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the source document. This is sometimes known as the "title". - */ - public DocumentManifest setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #content} (The list of Documents included in the manifest.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (DocumentManifestContentComponent item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (The list of Documents included in the manifest.) - */ - // syntactic sugar - public DocumentManifestContentComponent addContent() { //3 - DocumentManifestContentComponent t = new DocumentManifestContentComponent(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addContent(DocumentManifestContentComponent t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (DocumentManifestRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentManifest.) - */ - // syntactic sugar - public DocumentManifestRelatedComponent addRelated() { //3 - DocumentManifestRelatedComponent t = new DocumentManifestRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public DocumentManifest addRelated(DocumentManifestRelatedComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("masterIdentifier", "Identifier", "A single identifier that uniquely identifies this manifest. Principally used to refer to the manifest in non-FHIR contexts.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document manifest, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "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).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("recipient", "Reference(Patient|Practitioner|RelatedPerson|Organization)", "A patient, practitioner, or organization for which this set of documents is intended.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("type", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for creating the manifest, and adding documents to it.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("created", "dateTime", "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.).", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("source", "uri", "Identifies the source system, application, or software that produced the document manifest.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("status", "code", "The status of this document manifest.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the \"title\".", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("content", "", "The list of Documents included in the manifest.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentManifest.", 0, java.lang.Integer.MAX_VALUE, related)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 243769515: /*masterIdentifier*/ return this.masterIdentifier == null ? new Base[0] : new Base[] {this.masterIdentifier}; // Identifier - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // DocumentManifestContentComponent - case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // DocumentManifestRelatedComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 243769515: // masterIdentifier - this.masterIdentifier = castToIdentifier(value); // Identifier - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 820081177: // recipient - this.getRecipient().add(castToReference(value)); // Reference - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1406328437: // author - this.getAuthor().add(castToReference(value)); // Reference - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -896505829: // source - this.source = castToUri(value); // UriType - break; - case -892481550: // status - this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 951530617: // content - this.getContent().add((DocumentManifestContentComponent) value); // DocumentManifestContentComponent - break; - case 1090493483: // related - this.getRelated().add((DocumentManifestRelatedComponent) value); // DocumentManifestRelatedComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("masterIdentifier")) - this.masterIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("recipient")) - this.getRecipient().add(castToReference(value)); - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("author")) - this.getAuthor().add(castToReference(value)); - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("source")) - this.source = castToUri(value); // UriType - else if (name.equals("status")) - this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("content")) - this.getContent().add((DocumentManifestContentComponent) value); - else if (name.equals("related")) - this.getRelated().add((DocumentManifestRelatedComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 243769515: return getMasterIdentifier(); // Identifier - case -1618432855: return addIdentifier(); // Identifier - case -1867885268: return getSubject(); // Reference - case 820081177: return addRecipient(); // Reference - case 3575610: return getType(); // CodeableConcept - case -1406328437: return addAuthor(); // Reference - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -896505829: throw new FHIRException("Cannot make property source as it is not a complex type"); // UriType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 951530617: return addContent(); // DocumentManifestContentComponent - case 1090493483: return addRelated(); // DocumentManifestRelatedComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("masterIdentifier")) { - this.masterIdentifier = new Identifier(); - return this.masterIdentifier; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("recipient")) { - return addRecipient(); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("author")) { - return addAuthor(); - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.created"); - } - else if (name.equals("source")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.source"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.status"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentManifest.description"); - } - else if (name.equals("content")) { - return addContent(); - } - else if (name.equals("related")) { - return addRelated(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DocumentManifest"; - - } - - public DocumentManifest copy() { - DocumentManifest dst = new DocumentManifest(); - copyValues(dst); - dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.created = created == null ? null : created.copy(); - dst.source = source == null ? null : source.copy(); - dst.status = status == null ? null : status.copy(); - dst.description = description == null ? null : description.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (DocumentManifestContentComponent i : content) - dst.content.add(i.copy()); - }; - if (related != null) { - dst.related = new ArrayList(); - for (DocumentManifestRelatedComponent i : related) - dst.related.add(i.copy()); - }; - return dst; - } - - protected DocumentManifest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentManifest)) - return false; - DocumentManifest o = (DocumentManifest) other; - return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(subject, o.subject, true) && compareDeep(recipient, o.recipient, true) && compareDeep(type, o.type, true) - && compareDeep(author, o.author, true) && compareDeep(created, o.created, true) && compareDeep(source, o.source, true) - && compareDeep(status, o.status, true) && compareDeep(description, o.description, true) && compareDeep(content, o.content, true) - && compareDeep(related, o.related, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentManifest)) - return false; - DocumentManifest o = (DocumentManifest) other; - return compareValues(created, o.created, true) && compareValues(source, o.source, true) && compareValues(status, o.status, true) - && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (recipient == null || recipient.isEmpty()) && (type == null || type.isEmpty()) - && (author == null || author.isEmpty()) && (created == null || created.isEmpty()) && (source == null || source.isEmpty()) - && (status == null || status.isEmpty()) && (description == null || description.isEmpty()) - && (content == null || content.isEmpty()) && (related == null || related.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DocumentManifest; - } - - /** - * Search parameter: related-ref - *

- * Description: Related Resource
- * Type: reference
- * Path: DocumentManifest.related.ref
- *

- */ - @SearchParamDefinition(name="related-ref", path="DocumentManifest.related.ref", description="Related Resource", type="reference" ) - public static final String SP_RELATED_REF = "related-ref"; - /** - * Fluent Client search parameter constant for related-ref - *

- * Description: Related Resource
- * Type: reference
- * Path: DocumentManifest.related.ref
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_REF); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest:related-ref". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_REF = new ca.uhn.fhir.model.api.Include("DocumentManifest:related-ref").toLocked(); - - /** - * Search parameter: related-id - *

- * Description: Identifiers of things that are related
- * Type: token
- * Path: DocumentManifest.related.identifier
- *

- */ - @SearchParamDefinition(name="related-id", path="DocumentManifest.related.identifier", description="Identifiers of things that are related", type="token" ) - public static final String SP_RELATED_ID = "related-id"; - /** - * Fluent Client search parameter constant for related-id - *

- * Description: Identifiers of things that are related
- * Type: token
- * Path: DocumentManifest.related.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_ID); - - /** - * Search parameter: content-ref - *

- * Description: Contents of this set of documents
- * Type: reference
- * Path: DocumentManifest.content.pReference
- *

- */ - @SearchParamDefinition(name="content-ref", path="DocumentManifest.content.p.as(Reference)", description="Contents of this set of documents", type="reference" ) - public static final String SP_CONTENT_REF = "content-ref"; - /** - * Fluent Client search parameter constant for content-ref - *

- * Description: Contents of this set of documents
- * Type: reference
- * Path: DocumentManifest.content.pReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTENT_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTENT_REF); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest:content-ref". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTENT_REF = new ca.uhn.fhir.model.api.Include("DocumentManifest:content-ref").toLocked(); - - /** - * Search parameter: status - *

- * Description: current | superseded | entered-in-error
- * Type: token
- * Path: DocumentManifest.status
- *

- */ - @SearchParamDefinition(name="status", path="DocumentManifest.status", description="current | superseded | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: current | superseded | entered-in-error
- * Type: token
- * Path: DocumentManifest.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: The subject of the set of documents
- * Type: reference
- * Path: DocumentManifest.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: The subject of the set of documents
- * Type: reference
- * Path: DocumentManifest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DocumentManifest:subject").toLocked(); - - /** - * Search parameter: type - *

- * Description: Kind of document set
- * Type: token
- * Path: DocumentManifest.type
- *

- */ - @SearchParamDefinition(name="type", path="DocumentManifest.type", description="Kind of document set", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Kind of document set
- * Type: token
- * Path: DocumentManifest.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: recipient - *

- * Description: Intended to get notified about this set of documents
- * Type: reference
- * Path: DocumentManifest.recipient
- *

- */ - @SearchParamDefinition(name="recipient", path="DocumentManifest.recipient", description="Intended to get notified about this set of documents", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - /** - * Fluent Client search parameter constant for recipient - *

- * Description: Intended to get notified about this set of documents
- * Type: reference
- * Path: DocumentManifest.recipient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest:recipient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("DocumentManifest:recipient").toLocked(); - - /** - * Search parameter: author - *

- * Description: Who and/or what authored the manifest
- * Type: reference
- * Path: DocumentManifest.author
- *

- */ - @SearchParamDefinition(name="author", path="DocumentManifest.author", description="Who and/or what authored the manifest", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Who and/or what authored the manifest
- * Type: reference
- * Path: DocumentManifest.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DocumentManifest:author").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The subject of the set of documents
- * Type: reference
- * Path: DocumentManifest.subject
- *

- */ - @SearchParamDefinition(name="patient", path="DocumentManifest.subject", description="The subject of the set of documents", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The subject of the set of documents
- * Type: reference
- * Path: DocumentManifest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentManifest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DocumentManifest:patient").toLocked(); - - /** - * Search parameter: source - *

- * Description: The source system/application/software
- * Type: uri
- * Path: DocumentManifest.source
- *

- */ - @SearchParamDefinition(name="source", path="DocumentManifest.source", description="The source system/application/software", type="uri" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: The source system/application/software
- * Type: uri
- * Path: DocumentManifest.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SOURCE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SOURCE); - - /** - * Search parameter: created - *

- * Description: When this document manifest created
- * Type: date
- * Path: DocumentManifest.created
- *

- */ - @SearchParamDefinition(name="created", path="DocumentManifest.created", description="When this document manifest created", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: When this document manifest created
- * Type: date
- * Path: DocumentManifest.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: description - *

- * Description: Human-readable description (title)
- * Type: string
- * Path: DocumentManifest.description
- *

- */ - @SearchParamDefinition(name="description", path="DocumentManifest.description", description="Human-readable description (title)", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Human-readable description (title)
- * Type: string
- * Path: DocumentManifest.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: identifier - *

- * Description: Unique Identifier for the set of documents
- * Type: token
- * Path: DocumentManifest.masterIdentifier, DocumentManifest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DocumentManifest.masterIdentifier | DocumentManifest.identifier", description="Unique Identifier for the set of documents", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique Identifier for the set of documents
- * Type: token
- * Path: DocumentManifest.masterIdentifier, DocumentManifest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DocumentReference.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DocumentReference.java deleted file mode 100644 index 741b44e8cbd..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DocumentReference.java +++ /dev/null @@ -1,2991 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.DocumentReferenceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A reference to a document . - */ -@ResourceDef(name="DocumentReference", profile="http://hl7.org/fhir/Profile/DocumentReference") -public class DocumentReference extends DomainResource { - - public enum DocumentRelationshipType { - /** - * This document logically replaces or supersedes the target document. - */ - REPLACES, - /** - * This document was generated by transforming the target document (e.g. format or language conversion). - */ - TRANSFORMS, - /** - * This document is a signature of the target document. - */ - SIGNS, - /** - * This document adds additional information to the target document. - */ - APPENDS, - /** - * added to help the parsers - */ - NULL; - public static DocumentRelationshipType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("replaces".equals(codeString)) - return REPLACES; - if ("transforms".equals(codeString)) - return TRANSFORMS; - if ("signs".equals(codeString)) - return SIGNS; - if ("appends".equals(codeString)) - return APPENDS; - throw new FHIRException("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REPLACES: return "replaces"; - case TRANSFORMS: return "transforms"; - case SIGNS: return "signs"; - case APPENDS: return "appends"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REPLACES: return "http://hl7.org/fhir/document-relationship-type"; - case TRANSFORMS: return "http://hl7.org/fhir/document-relationship-type"; - case SIGNS: return "http://hl7.org/fhir/document-relationship-type"; - case APPENDS: return "http://hl7.org/fhir/document-relationship-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REPLACES: return "This document logically replaces or supersedes the target document."; - case TRANSFORMS: return "This document was generated by transforming the target document (e.g. format or language conversion)."; - case SIGNS: return "This document is a signature of the target document."; - case APPENDS: return "This document adds additional information to the target document."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REPLACES: return "Replaces"; - case TRANSFORMS: return "Transforms"; - case SIGNS: return "Signs"; - case APPENDS: return "Appends"; - default: return "?"; - } - } - } - - public static class DocumentRelationshipTypeEnumFactory implements EnumFactory { - public DocumentRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("replaces".equals(codeString)) - return DocumentRelationshipType.REPLACES; - if ("transforms".equals(codeString)) - return DocumentRelationshipType.TRANSFORMS; - if ("signs".equals(codeString)) - return DocumentRelationshipType.SIGNS; - if ("appends".equals(codeString)) - return DocumentRelationshipType.APPENDS; - throw new IllegalArgumentException("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("replaces".equals(codeString)) - return new Enumeration(this, DocumentRelationshipType.REPLACES); - if ("transforms".equals(codeString)) - return new Enumeration(this, DocumentRelationshipType.TRANSFORMS); - if ("signs".equals(codeString)) - return new Enumeration(this, DocumentRelationshipType.SIGNS); - if ("appends".equals(codeString)) - return new Enumeration(this, DocumentRelationshipType.APPENDS); - throw new FHIRException("Unknown DocumentRelationshipType code '"+codeString+"'"); - } - public String toCode(DocumentRelationshipType code) { - if (code == DocumentRelationshipType.REPLACES) - return "replaces"; - if (code == DocumentRelationshipType.TRANSFORMS) - return "transforms"; - if (code == DocumentRelationshipType.SIGNS) - return "signs"; - if (code == DocumentRelationshipType.APPENDS) - return "appends"; - return "?"; - } - public String toSystem(DocumentRelationshipType code) { - return code.getSystem(); - } - } - - @Block() - public static class DocumentReferenceRelatesToComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of relationship that this document has with anther document. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="replaces | transforms | signs | appends", formalDefinition="The type of relationship that this document has with anther document." ) - protected Enumeration code; - - /** - * The target document of this relationship. - */ - @Child(name = "target", type = {DocumentReference.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Target of the relationship", formalDefinition="The target document of this relationship." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The target document of this relationship.) - */ - protected DocumentReference targetTarget; - - private static final long serialVersionUID = -347257495L; - - /** - * Constructor - */ - public DocumentReferenceRelatesToComponent() { - super(); - } - - /** - * Constructor - */ - public DocumentReferenceRelatesToComponent(Enumeration code, Reference target) { - super(); - this.code = code; - this.target = target; - } - - /** - * @return {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The type of relationship that this document has with anther document.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public DocumentReferenceRelatesToComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return The type of relationship that this document has with anther document. - */ - public DocumentRelationshipType getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The type of relationship that this document has with anther document. - */ - public DocumentReferenceRelatesToComponent setCode(DocumentRelationshipType value) { - if (this.code == null) - this.code = new Enumeration(new DocumentRelationshipTypeEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #target} (The target document of this relationship.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The target document of this relationship.) - */ - public DocumentReferenceRelatesToComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The target document of this relationship.) - */ - public DocumentReference getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceRelatesToComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new DocumentReference(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The target document of this relationship.) - */ - public DocumentReferenceRelatesToComponent setTargetTarget(DocumentReference value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "The type of relationship that this document has with anther document.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("target", "Reference(DocumentReference)", "The target document of this relationship.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = new DocumentRelationshipTypeEnumFactory().fromType(value); // Enumeration - break; - case -880905839: // target - this.target = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = new DocumentRelationshipTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("target")) - this.target = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case -880905839: return getTarget(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.code"); - } - else if (name.equals("target")) { - this.target = new Reference(); - return this.target; - } - else - return super.addChild(name); - } - - public DocumentReferenceRelatesToComponent copy() { - DocumentReferenceRelatesToComponent dst = new DocumentReferenceRelatesToComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceRelatesToComponent)) - return false; - DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; - return compareDeep(code, o.code, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceRelatesToComponent)) - return false; - DocumentReferenceRelatesToComponent o = (DocumentReferenceRelatesToComponent) other; - return compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - public String fhirType() { - return "DocumentReference.relatesTo"; - - } - - } - - @Block() - public static class DocumentReferenceContentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The document or url of the document along with critical metadata to prove content has integrity. - */ - @Child(name = "attachment", type = {Attachment.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where to access the document", formalDefinition="The document or url of the document along with critical metadata to prove content has integrity." ) - protected Attachment attachment; - - /** - * An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType. - */ - @Child(name = "format", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Format/content rules for the document", formalDefinition="An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType." ) - protected List format; - - private static final long serialVersionUID = -1412643085L; - - /** - * Constructor - */ - public DocumentReferenceContentComponent() { - super(); - } - - /** - * Constructor - */ - public DocumentReferenceContentComponent(Attachment attachment) { - super(); - this.attachment = attachment; - } - - /** - * @return {@link #attachment} (The document or url of the document along with critical metadata to prove content has integrity.) - */ - public Attachment getAttachment() { - if (this.attachment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContentComponent.attachment"); - else if (Configuration.doAutoCreate()) - this.attachment = new Attachment(); // cc - return this.attachment; - } - - public boolean hasAttachment() { - return this.attachment != null && !this.attachment.isEmpty(); - } - - /** - * @param value {@link #attachment} (The document or url of the document along with critical metadata to prove content has integrity.) - */ - public DocumentReferenceContentComponent setAttachment(Attachment value) { - this.attachment = value; - return this; - } - - /** - * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) - */ - public List getFormat() { - if (this.format == null) - this.format = new ArrayList(); - return this.format; - } - - public boolean hasFormat() { - if (this.format == null) - return false; - for (Coding item : this.format) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #format} (An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.) - */ - // syntactic sugar - public Coding addFormat() { //3 - Coding t = new Coding(); - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return t; - } - - // syntactic sugar - public DocumentReferenceContentComponent addFormat(Coding t) { //3 - if (t == null) - return this; - if (this.format == null) - this.format = new ArrayList(); - this.format.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("attachment", "Attachment", "The document or url of the document along with critical metadata to prove content has integrity.", 0, java.lang.Integer.MAX_VALUE, attachment)); - childrenList.add(new Property("format", "Coding", "An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.", 0, java.lang.Integer.MAX_VALUE, format)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1963501277: /*attachment*/ return this.attachment == null ? new Base[0] : new Base[] {this.attachment}; // Attachment - case -1268779017: /*format*/ return this.format == null ? new Base[0] : this.format.toArray(new Base[this.format.size()]); // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1963501277: // attachment - this.attachment = castToAttachment(value); // Attachment - break; - case -1268779017: // format - this.getFormat().add(castToCoding(value)); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("attachment")) - this.attachment = castToAttachment(value); // Attachment - else if (name.equals("format")) - this.getFormat().add(castToCoding(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1963501277: return getAttachment(); // Attachment - case -1268779017: return addFormat(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("attachment")) { - this.attachment = new Attachment(); - return this.attachment; - } - else if (name.equals("format")) { - return addFormat(); - } - else - return super.addChild(name); - } - - public DocumentReferenceContentComponent copy() { - DocumentReferenceContentComponent dst = new DocumentReferenceContentComponent(); - copyValues(dst); - dst.attachment = attachment == null ? null : attachment.copy(); - if (format != null) { - dst.format = new ArrayList(); - for (Coding i : format) - dst.format.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceContentComponent)) - return false; - DocumentReferenceContentComponent o = (DocumentReferenceContentComponent) other; - return compareDeep(attachment, o.attachment, true) && compareDeep(format, o.format, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceContentComponent)) - return false; - DocumentReferenceContentComponent o = (DocumentReferenceContentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (attachment == null || attachment.isEmpty()) && (format == null || format.isEmpty()) - ; - } - - public String fhirType() { - return "DocumentReference.content"; - - } - - } - - @Block() - public static class DocumentReferenceContextComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the clinical encounter or type of care that the document content is associated with. - */ - @Child(name = "encounter", type = {Encounter.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Context of the document content", formalDefinition="Describes the clinical encounter or type of care that the document content is associated with." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Describes the clinical encounter or type of care that the document content is associated with.) - */ - protected Encounter encounterTarget; - - /** - * 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. - */ - @Child(name = "event", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List event; - - /** - * The time period over which the service that is described by the document was provided. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Period period; - - /** - * The kind of facility where the patient was seen. - */ - @Child(name = "facilityType", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Kind of facility where patient was seen", formalDefinition="The kind of facility where the patient was seen." ) - protected CodeableConcept facilityType; - - /** - * This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty. - */ - @Child(name = "practiceSetting", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional details about where the content was created (e.g. clinical specialty)", formalDefinition="This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty." ) - protected CodeableConcept practiceSetting; - - /** - * The Patient Information as known when the document was published. May be a reference to a version specific, or contained. - */ - @Child(name = "sourcePatientInfo", type = {Patient.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient demographics from source", formalDefinition="The Patient Information as known when the document was published. May be a reference to a version specific, or contained." ) - protected Reference sourcePatientInfo; - - /** - * The actual object that is the target of the reference (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - protected Patient sourcePatientInfoTarget; - - /** - * Related identifiers or resources associated with the DocumentReference. - */ - @Child(name = "related", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Related identifiers or resources", formalDefinition="Related identifiers or resources associated with the DocumentReference." ) - protected List related; - - private static final long serialVersionUID = 994799273L; - - /** - * Constructor - */ - public DocumentReferenceContextComponent() { - super(); - } - - /** - * @return {@link #encounter} (Describes the clinical encounter or type of care that the document content is associated with.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Describes the clinical encounter or type of care that the document content is associated with.) - */ - public DocumentReferenceContextComponent setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care that the document content is associated with.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the clinical encounter or type of care that the document content is associated with.) - */ - public DocumentReferenceContextComponent setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #event} (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 List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (CodeableConcept item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (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.) - */ - // syntactic sugar - public CodeableConcept addEvent() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - // syntactic sugar - public DocumentReferenceContextComponent addEvent(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @return {@link #period} (The time period over which the service that is described by the document was provided.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The time period over which the service that is described by the document was provided.) - */ - public DocumentReferenceContextComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #facilityType} (The kind of facility where the patient was seen.) - */ - public CodeableConcept getFacilityType() { - if (this.facilityType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.facilityType"); - else if (Configuration.doAutoCreate()) - this.facilityType = new CodeableConcept(); // cc - return this.facilityType; - } - - public boolean hasFacilityType() { - return this.facilityType != null && !this.facilityType.isEmpty(); - } - - /** - * @param value {@link #facilityType} (The kind of facility where the patient was seen.) - */ - public DocumentReferenceContextComponent setFacilityType(CodeableConcept value) { - this.facilityType = value; - return this; - } - - /** - * @return {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) - */ - public CodeableConcept getPracticeSetting() { - if (this.practiceSetting == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.practiceSetting"); - else if (Configuration.doAutoCreate()) - this.practiceSetting = new CodeableConcept(); // cc - return this.practiceSetting; - } - - public boolean hasPracticeSetting() { - return this.practiceSetting != null && !this.practiceSetting.isEmpty(); - } - - /** - * @param value {@link #practiceSetting} (This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.) - */ - public DocumentReferenceContextComponent setPracticeSetting(CodeableConcept value) { - this.practiceSetting = value; - return this; - } - - /** - * @return {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public Reference getSourcePatientInfo() { - if (this.sourcePatientInfo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); - else if (Configuration.doAutoCreate()) - this.sourcePatientInfo = new Reference(); // cc - return this.sourcePatientInfo; - } - - public boolean hasSourcePatientInfo() { - return this.sourcePatientInfo != null && !this.sourcePatientInfo.isEmpty(); - } - - /** - * @param value {@link #sourcePatientInfo} (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public DocumentReferenceContextComponent setSourcePatientInfo(Reference value) { - this.sourcePatientInfo = value; - return this; - } - - /** - * @return {@link #sourcePatientInfo} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public Patient getSourcePatientInfoTarget() { - if (this.sourcePatientInfoTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextComponent.sourcePatientInfo"); - else if (Configuration.doAutoCreate()) - this.sourcePatientInfoTarget = new Patient(); // aa - return this.sourcePatientInfoTarget; - } - - /** - * @param value {@link #sourcePatientInfo} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Patient Information as known when the document was published. May be a reference to a version specific, or contained.) - */ - public DocumentReferenceContextComponent setSourcePatientInfoTarget(Patient value) { - this.sourcePatientInfoTarget = value; - return this; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (DocumentReferenceContextRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Related identifiers or resources associated with the DocumentReference.) - */ - // syntactic sugar - public DocumentReferenceContextRelatedComponent addRelated() { //3 - DocumentReferenceContextRelatedComponent t = new DocumentReferenceContextRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public DocumentReferenceContextComponent addRelated(DocumentReferenceContextRelatedComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care that the document content is associated with.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("event", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("period", "Period", "The time period over which the service that is described by the document was provided.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("facilityType", "CodeableConcept", "The kind of facility where the patient was seen.", 0, java.lang.Integer.MAX_VALUE, facilityType)); - childrenList.add(new Property("practiceSetting", "CodeableConcept", "This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.", 0, java.lang.Integer.MAX_VALUE, practiceSetting)); - childrenList.add(new Property("sourcePatientInfo", "Reference(Patient)", "The Patient Information as known when the document was published. May be a reference to a version specific, or contained.", 0, java.lang.Integer.MAX_VALUE, sourcePatientInfo)); - childrenList.add(new Property("related", "", "Related identifiers or resources associated with the DocumentReference.", 0, java.lang.Integer.MAX_VALUE, related)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // CodeableConcept - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 370698365: /*facilityType*/ return this.facilityType == null ? new Base[0] : new Base[] {this.facilityType}; // CodeableConcept - case 331373717: /*practiceSetting*/ return this.practiceSetting == null ? new Base[0] : new Base[] {this.practiceSetting}; // CodeableConcept - case 2031381048: /*sourcePatientInfo*/ return this.sourcePatientInfo == null ? new Base[0] : new Base[] {this.sourcePatientInfo}; // Reference - case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // DocumentReferenceContextRelatedComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 96891546: // event - this.getEvent().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 370698365: // facilityType - this.facilityType = castToCodeableConcept(value); // CodeableConcept - break; - case 331373717: // practiceSetting - this.practiceSetting = castToCodeableConcept(value); // CodeableConcept - break; - case 2031381048: // sourcePatientInfo - this.sourcePatientInfo = castToReference(value); // Reference - break; - case 1090493483: // related - this.getRelated().add((DocumentReferenceContextRelatedComponent) value); // DocumentReferenceContextRelatedComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("event")) - this.getEvent().add(castToCodeableConcept(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("facilityType")) - this.facilityType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("practiceSetting")) - this.practiceSetting = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("sourcePatientInfo")) - this.sourcePatientInfo = castToReference(value); // Reference - else if (name.equals("related")) - this.getRelated().add((DocumentReferenceContextRelatedComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1524132147: return getEncounter(); // Reference - case 96891546: return addEvent(); // CodeableConcept - case -991726143: return getPeriod(); // Period - case 370698365: return getFacilityType(); // CodeableConcept - case 331373717: return getPracticeSetting(); // CodeableConcept - case 2031381048: return getSourcePatientInfo(); // Reference - case 1090493483: return addRelated(); // DocumentReferenceContextRelatedComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("event")) { - return addEvent(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("facilityType")) { - this.facilityType = new CodeableConcept(); - return this.facilityType; - } - else if (name.equals("practiceSetting")) { - this.practiceSetting = new CodeableConcept(); - return this.practiceSetting; - } - else if (name.equals("sourcePatientInfo")) { - this.sourcePatientInfo = new Reference(); - return this.sourcePatientInfo; - } - else if (name.equals("related")) { - return addRelated(); - } - else - return super.addChild(name); - } - - public DocumentReferenceContextComponent copy() { - DocumentReferenceContextComponent dst = new DocumentReferenceContextComponent(); - copyValues(dst); - dst.encounter = encounter == null ? null : encounter.copy(); - if (event != null) { - dst.event = new ArrayList(); - for (CodeableConcept i : event) - dst.event.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.facilityType = facilityType == null ? null : facilityType.copy(); - dst.practiceSetting = practiceSetting == null ? null : practiceSetting.copy(); - dst.sourcePatientInfo = sourcePatientInfo == null ? null : sourcePatientInfo.copy(); - if (related != null) { - dst.related = new ArrayList(); - for (DocumentReferenceContextRelatedComponent i : related) - dst.related.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceContextComponent)) - return false; - DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; - return compareDeep(encounter, o.encounter, true) && compareDeep(event, o.event, true) && compareDeep(period, o.period, true) - && compareDeep(facilityType, o.facilityType, true) && compareDeep(practiceSetting, o.practiceSetting, true) - && compareDeep(sourcePatientInfo, o.sourcePatientInfo, true) && compareDeep(related, o.related, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceContextComponent)) - return false; - DocumentReferenceContextComponent o = (DocumentReferenceContextComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (encounter == null || encounter.isEmpty()) && (event == null || event.isEmpty()) - && (period == null || period.isEmpty()) && (facilityType == null || facilityType.isEmpty()) - && (practiceSetting == null || practiceSetting.isEmpty()) && (sourcePatientInfo == null || sourcePatientInfo.isEmpty()) - && (related == null || related.isEmpty()); - } - - public String fhirType() { - return "DocumentReference.context"; - - } - - } - - @Block() - public static class DocumentReferenceContextRelatedComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of related objects or events", formalDefinition="Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) - protected Identifier identifier; - - /** - * Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing. - */ - @Child(name = "ref", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Related Resource", formalDefinition="Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing." ) - protected Reference ref; - - /** - * The actual object that is the target of the reference (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - protected Resource refTarget; - - private static final long serialVersionUID = -1670123330L; - - /** - * Constructor - */ - public DocumentReferenceContextRelatedComponent() { - super(); - } - - /** - * @return {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentReferenceContextRelatedComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public Reference getRef() { - if (this.ref == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReferenceContextRelatedComponent.ref"); - else if (Configuration.doAutoCreate()) - this.ref = new Reference(); // cc - return this.ref; - } - - public boolean hasRef() { - return this.ref != null && !this.ref.isEmpty(); - } - - /** - * @param value {@link #ref} (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentReferenceContextRelatedComponent setRef(Reference value) { - this.ref = value; - return this; - } - - /** - * @return {@link #ref} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public Resource getRefTarget() { - return this.refTarget; - } - - /** - * @param value {@link #ref} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.) - */ - public DocumentReferenceContextRelatedComponent setRefTarget(Resource value) { - this.refTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Related identifier to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ref", "Reference(Any)", "Related Resource to this DocumentReference. If both id and ref are present they shall refer to the same thing.", 0, java.lang.Integer.MAX_VALUE, ref)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 112787: /*ref*/ return this.ref == null ? new Base[0] : new Base[] {this.ref}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 112787: // ref - this.ref = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("ref")) - this.ref = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 112787: return getRef(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("ref")) { - this.ref = new Reference(); - return this.ref; - } - else - return super.addChild(name); - } - - public DocumentReferenceContextRelatedComponent copy() { - DocumentReferenceContextRelatedComponent dst = new DocumentReferenceContextRelatedComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.ref = ref == null ? null : ref.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReferenceContextRelatedComponent)) - return false; - DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ref, o.ref, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReferenceContextRelatedComponent)) - return false; - DocumentReferenceContextRelatedComponent o = (DocumentReferenceContextRelatedComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ref == null || ref.isEmpty()) - ; - } - - public String fhirType() { - return "DocumentReference.context.related"; - - } - - } - - /** - * 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. - */ - @Child(name = "masterIdentifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Identifier masterIdentifier; - - /** - * Other identifiers associated with the document, including version independent identifiers. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other identifiers for the document", formalDefinition="Other identifiers associated with the document, including version independent identifiers." ) - protected List identifier; - - /** - * Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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). - */ - @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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 (e.g. a 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)." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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).) - */ - protected Resource subjectTarget; - - /** - * Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Kind of document (LOINC if possible)", formalDefinition="Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced." ) - protected CodeableConcept type; - - /** - * A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type. - */ - @Child(name = "class", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Categorization of document", formalDefinition="A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type." ) - protected CodeableConcept class_; - - /** - * Identifies who is responsible for adding the information to the document. - */ - @Child(name = "author", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who and/or what authored the document", formalDefinition="Identifies who is responsible for adding the information to the document." ) - protected List author; - /** - * The actual objects that are the target of the reference (Identifies who is responsible for adding the information to the document.) - */ - protected List authorTarget; - - - /** - * Identifies the organization or group who is responsible for ongoing maintenance of and access to the document. - */ - @Child(name = "custodian", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization which maintains the document", formalDefinition="Identifies the organization or group who is responsible for ongoing maintenance of and access to the document." ) - protected Reference custodian; - - /** - * The actual object that is the target of the reference (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - protected Organization custodianTarget; - - /** - * Which person or organization authenticates that this document is valid. - */ - @Child(name = "authenticator", type = {Practitioner.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who/what authenticated the document", formalDefinition="Which person or organization authenticates that this document is valid." ) - protected Reference authenticator; - - /** - * The actual object that is the target of the reference (Which person or organization authenticates that this document is valid.) - */ - protected Resource authenticatorTarget; - - /** - * When the document was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Document creation time", formalDefinition="When the document was created." ) - protected DateTimeType created; - - /** - * When the document reference was created. - */ - @Child(name = "indexed", type = {InstantType.class}, order=9, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="When this document reference created", formalDefinition="When the document reference was created." ) - protected InstantType indexed; - - /** - * The status of this document reference. - */ - @Child(name = "status", type = {CodeType.class}, order=10, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="current | superseded | entered-in-error", formalDefinition="The status of this document reference." ) - protected Enumeration status; - - /** - * The status of the underlying document. - */ - @Child(name = "docStatus", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="preliminary | final | appended | amended | entered-in-error", formalDefinition="The status of the underlying document." ) - protected CodeableConcept docStatus; - - /** - * Relationships that this document has with other document references that already exist. - */ - @Child(name = "relatesTo", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) - @Description(shortDefinition="Relationships to other documents", formalDefinition="Relationships that this document has with other document references that already exist." ) - protected List relatesTo; - - /** - * Human-readable description of the source document. This is sometimes known as the "title". - */ - @Child(name = "description", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human-readable description (title)", formalDefinition="Human-readable description of the source document. This is sometimes known as the \"title\"." ) - protected StringType description; - - /** - * A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to. - */ - @Child(name = "securityLabel", type = {CodeableConcept.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Document security-tags", formalDefinition="A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to." ) - protected List securityLabel; - - /** - * The document and format referenced. There may be multiple content element repetitions, each with a different format. - */ - @Child(name = "content", type = {}, order=15, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Document referenced", formalDefinition="The document and format referenced. There may be multiple content element repetitions, each with a different format." ) - protected List content; - - /** - * The clinical context in which the document was prepared. - */ - @Child(name = "context", type = {}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Clinical context of document", formalDefinition="The clinical context in which the document was prepared." ) - protected DocumentReferenceContextComponent context; - - private static final long serialVersionUID = -1009325322L; - - /** - * Constructor - */ - public DocumentReference() { - super(); - } - - /** - * Constructor - */ - public DocumentReference(CodeableConcept type, InstantType indexed, Enumeration status) { - super(); - this.type = type; - this.indexed = indexed; - this.status = status; - } - - /** - * @return {@link #masterIdentifier} (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 Identifier getMasterIdentifier() { - if (this.masterIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.masterIdentifier"); - else if (Configuration.doAutoCreate()) - this.masterIdentifier = new Identifier(); // cc - return this.masterIdentifier; - } - - public boolean hasMasterIdentifier() { - return this.masterIdentifier != null && !this.masterIdentifier.isEmpty(); - } - - /** - * @param value {@link #masterIdentifier} (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(Identifier value) { - this.masterIdentifier = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Other identifiers associated with the document, including version independent identifiers.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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 Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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 Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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 setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #type} (Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.) - */ - public DocumentReference setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #class_} (A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.) - */ - public CodeableConcept getClass_() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new CodeableConcept(); // cc - return this.class_; - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.) - */ - public DocumentReference setClass_(CodeableConcept value) { - this.class_ = value; - return this; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - public List getAuthor() { - if (this.author == null) - this.author = new ArrayList(); - return this.author; - } - - public boolean hasAuthor() { - if (this.author == null) - return false; - for (Reference item : this.author) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #author} (Identifies who is responsible for adding the information to the document.) - */ - // syntactic sugar - public Reference addAuthor() { //3 - Reference t = new Reference(); - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addAuthor(Reference t) { //3 - if (t == null) - return this; - if (this.author == null) - this.author = new ArrayList(); - this.author.add(t); - return this; - } - - /** - * @return {@link #author} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who is responsible for adding the information to the document.) - */ - public List getAuthorTarget() { - if (this.authorTarget == null) - this.authorTarget = new ArrayList(); - return this.authorTarget; - } - - /** - * @return {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public Reference getCustodian() { - if (this.custodian == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.custodian"); - else if (Configuration.doAutoCreate()) - this.custodian = new Reference(); // cc - return this.custodian; - } - - public boolean hasCustodian() { - return this.custodian != null && !this.custodian.isEmpty(); - } - - /** - * @param value {@link #custodian} (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public DocumentReference setCustodian(Reference value) { - this.custodian = value; - return this; - } - - /** - * @return {@link #custodian} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public Organization getCustodianTarget() { - if (this.custodianTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.custodian"); - else if (Configuration.doAutoCreate()) - this.custodianTarget = new Organization(); // aa - return this.custodianTarget; - } - - /** - * @param value {@link #custodian} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.) - */ - public DocumentReference setCustodianTarget(Organization value) { - this.custodianTarget = value; - return this; - } - - /** - * @return {@link #authenticator} (Which person or organization authenticates that this document is valid.) - */ - public Reference getAuthenticator() { - if (this.authenticator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.authenticator"); - else if (Configuration.doAutoCreate()) - this.authenticator = new Reference(); // cc - return this.authenticator; - } - - public boolean hasAuthenticator() { - return this.authenticator != null && !this.authenticator.isEmpty(); - } - - /** - * @param value {@link #authenticator} (Which person or organization authenticates that this document is valid.) - */ - public DocumentReference setAuthenticator(Reference value) { - this.authenticator = value; - return this; - } - - /** - * @return {@link #authenticator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Which person or organization authenticates that this document is valid.) - */ - public Resource getAuthenticatorTarget() { - return this.authenticatorTarget; - } - - /** - * @param value {@link #authenticator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Which person or organization authenticates that this document is valid.) - */ - public DocumentReference setAuthenticatorTarget(Resource value) { - this.authenticatorTarget = value; - return this; - } - - /** - * @return {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (When the document was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DocumentReference setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return When the document was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value When the document was created. - */ - public DocumentReference setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value - */ - public InstantType getIndexedElement() { - if (this.indexed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.indexed"); - else if (Configuration.doAutoCreate()) - this.indexed = new InstantType(); // bb - return this.indexed; - } - - public boolean hasIndexedElement() { - return this.indexed != null && !this.indexed.isEmpty(); - } - - public boolean hasIndexed() { - return this.indexed != null && !this.indexed.isEmpty(); - } - - /** - * @param value {@link #indexed} (When the document reference was created.). This is the underlying object with id, value and extensions. The accessor "getIndexed" gives direct access to the value - */ - public DocumentReference setIndexedElement(InstantType value) { - this.indexed = value; - return this; - } - - /** - * @return When the document reference was created. - */ - public Date getIndexed() { - return this.indexed == null ? null : this.indexed.getValue(); - } - - /** - * @param value When the document reference was created. - */ - public DocumentReference setIndexed(Date value) { - if (this.indexed == null) - this.indexed = new InstantType(); - this.indexed.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this document reference.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public DocumentReference setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this document reference. - */ - public DocumentReferenceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this document reference. - */ - public DocumentReference setStatus(DocumentReferenceStatus value) { - if (this.status == null) - this.status = new Enumeration(new DocumentReferenceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #docStatus} (The status of the underlying document.) - */ - public CodeableConcept getDocStatus() { - if (this.docStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.docStatus"); - else if (Configuration.doAutoCreate()) - this.docStatus = new CodeableConcept(); // cc - return this.docStatus; - } - - public boolean hasDocStatus() { - return this.docStatus != null && !this.docStatus.isEmpty(); - } - - /** - * @param value {@link #docStatus} (The status of the underlying document.) - */ - public DocumentReference setDocStatus(CodeableConcept value) { - this.docStatus = value; - return this; - } - - /** - * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) - */ - public List getRelatesTo() { - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - return this.relatesTo; - } - - public boolean hasRelatesTo() { - if (this.relatesTo == null) - return false; - for (DocumentReferenceRelatesToComponent item : this.relatesTo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatesTo} (Relationships that this document has with other document references that already exist.) - */ - // syntactic sugar - public DocumentReferenceRelatesToComponent addRelatesTo() { //3 - DocumentReferenceRelatesToComponent t = new DocumentReferenceRelatesToComponent(); - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - this.relatesTo.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addRelatesTo(DocumentReferenceRelatesToComponent t) { //3 - if (t == null) - return this; - if (this.relatesTo == null) - this.relatesTo = new ArrayList(); - this.relatesTo.add(t); - return this; - } - - /** - * @return {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of the source document. This is sometimes known as the "title".). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public DocumentReference setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the source document. This is sometimes known as the "title". - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the source document. This is sometimes known as the "title". - */ - public DocumentReference setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #securityLabel} (A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.) - */ - public List getSecurityLabel() { - if (this.securityLabel == null) - this.securityLabel = new ArrayList(); - return this.securityLabel; - } - - public boolean hasSecurityLabel() { - if (this.securityLabel == null) - return false; - for (CodeableConcept item : this.securityLabel) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #securityLabel} (A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the "reference" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.) - */ - // syntactic sugar - public CodeableConcept addSecurityLabel() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.securityLabel == null) - this.securityLabel = new ArrayList(); - this.securityLabel.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addSecurityLabel(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.securityLabel == null) - this.securityLabel = new ArrayList(); - this.securityLabel.add(t); - return this; - } - - /** - * @return {@link #content} (The document and format referenced. There may be multiple content element repetitions, each with a different format.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (DocumentReferenceContentComponent item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (The document and format referenced. There may be multiple content element repetitions, each with a different format.) - */ - // syntactic sugar - public DocumentReferenceContentComponent addContent() { //3 - DocumentReferenceContentComponent t = new DocumentReferenceContentComponent(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public DocumentReference addContent(DocumentReferenceContentComponent t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - /** - * @return {@link #context} (The clinical context in which the document was prepared.) - */ - public DocumentReferenceContextComponent getContext() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DocumentReference.context"); - else if (Configuration.doAutoCreate()) - this.context = new DocumentReferenceContextComponent(); // cc - return this.context; - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (The clinical context in which the document was prepared.) - */ - public DocumentReference setContext(DocumentReferenceContextComponent value) { - this.context = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("masterIdentifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, masterIdentifier)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers associated with the document, including version independent identifiers.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device)", "Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a 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).", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("type", "CodeableConcept", "Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("class", "CodeableConcept", "A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("author", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Identifies who is responsible for adding the information to the document.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("custodian", "Reference(Organization)", "Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.", 0, java.lang.Integer.MAX_VALUE, custodian)); - childrenList.add(new Property("authenticator", "Reference(Practitioner|Organization)", "Which person or organization authenticates that this document is valid.", 0, java.lang.Integer.MAX_VALUE, authenticator)); - childrenList.add(new Property("created", "dateTime", "When the document was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("indexed", "instant", "When the document reference was created.", 0, java.lang.Integer.MAX_VALUE, indexed)); - childrenList.add(new Property("status", "code", "The status of this document reference.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("docStatus", "CodeableConcept", "The status of the underlying document.", 0, java.lang.Integer.MAX_VALUE, docStatus)); - childrenList.add(new Property("relatesTo", "", "Relationships that this document has with other document references that already exist.", 0, java.lang.Integer.MAX_VALUE, relatesTo)); - childrenList.add(new Property("description", "string", "Human-readable description of the source document. This is sometimes known as the \"title\".", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("securityLabel", "CodeableConcept", "A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.", 0, java.lang.Integer.MAX_VALUE, securityLabel)); - childrenList.add(new Property("content", "", "The document and format referenced. There may be multiple content element repetitions, each with a different format.", 0, java.lang.Integer.MAX_VALUE, content)); - childrenList.add(new Property("context", "", "The clinical context in which the document was prepared.", 0, java.lang.Integer.MAX_VALUE, context)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 243769515: /*masterIdentifier*/ return this.masterIdentifier == null ? new Base[0] : new Base[] {this.masterIdentifier}; // Identifier - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // CodeableConcept - case -1406328437: /*author*/ return this.author == null ? new Base[0] : this.author.toArray(new Base[this.author.size()]); // Reference - case 1611297262: /*custodian*/ return this.custodian == null ? new Base[0] : new Base[] {this.custodian}; // Reference - case 1815000435: /*authenticator*/ return this.authenticator == null ? new Base[0] : new Base[] {this.authenticator}; // Reference - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1943292145: /*indexed*/ return this.indexed == null ? new Base[0] : new Base[] {this.indexed}; // InstantType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -23496886: /*docStatus*/ return this.docStatus == null ? new Base[0] : new Base[] {this.docStatus}; // CodeableConcept - case -7765931: /*relatesTo*/ return this.relatesTo == null ? new Base[0] : this.relatesTo.toArray(new Base[this.relatesTo.size()]); // DocumentReferenceRelatesToComponent - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -722296940: /*securityLabel*/ return this.securityLabel == null ? new Base[0] : this.securityLabel.toArray(new Base[this.securityLabel.size()]); // CodeableConcept - case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // DocumentReferenceContentComponent - case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // DocumentReferenceContextComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 243769515: // masterIdentifier - this.masterIdentifier = castToIdentifier(value); // Identifier - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case 94742904: // class - this.class_ = castToCodeableConcept(value); // CodeableConcept - break; - case -1406328437: // author - this.getAuthor().add(castToReference(value)); // Reference - break; - case 1611297262: // custodian - this.custodian = castToReference(value); // Reference - break; - case 1815000435: // authenticator - this.authenticator = castToReference(value); // Reference - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 1943292145: // indexed - this.indexed = castToInstant(value); // InstantType - break; - case -892481550: // status - this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration - break; - case -23496886: // docStatus - this.docStatus = castToCodeableConcept(value); // CodeableConcept - break; - case -7765931: // relatesTo - this.getRelatesTo().add((DocumentReferenceRelatesToComponent) value); // DocumentReferenceRelatesToComponent - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -722296940: // securityLabel - this.getSecurityLabel().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 951530617: // content - this.getContent().add((DocumentReferenceContentComponent) value); // DocumentReferenceContentComponent - break; - case 951530927: // context - this.context = (DocumentReferenceContextComponent) value; // DocumentReferenceContextComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("masterIdentifier")) - this.masterIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("class")) - this.class_ = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("author")) - this.getAuthor().add(castToReference(value)); - else if (name.equals("custodian")) - this.custodian = castToReference(value); // Reference - else if (name.equals("authenticator")) - this.authenticator = castToReference(value); // Reference - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("indexed")) - this.indexed = castToInstant(value); // InstantType - else if (name.equals("status")) - this.status = new DocumentReferenceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("docStatus")) - this.docStatus = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("relatesTo")) - this.getRelatesTo().add((DocumentReferenceRelatesToComponent) value); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("securityLabel")) - this.getSecurityLabel().add(castToCodeableConcept(value)); - else if (name.equals("content")) - this.getContent().add((DocumentReferenceContentComponent) value); - else if (name.equals("context")) - this.context = (DocumentReferenceContextComponent) value; // DocumentReferenceContextComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 243769515: return getMasterIdentifier(); // Identifier - case -1618432855: return addIdentifier(); // Identifier - case -1867885268: return getSubject(); // Reference - case 3575610: return getType(); // CodeableConcept - case 94742904: return getClass_(); // CodeableConcept - case -1406328437: return addAuthor(); // Reference - case 1611297262: return getCustodian(); // Reference - case 1815000435: return getAuthenticator(); // Reference - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1943292145: throw new FHIRException("Cannot make property indexed as it is not a complex type"); // InstantType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -23496886: return getDocStatus(); // CodeableConcept - case -7765931: return addRelatesTo(); // DocumentReferenceRelatesToComponent - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -722296940: return addSecurityLabel(); // CodeableConcept - case 951530617: return addContent(); // DocumentReferenceContentComponent - case 951530927: return getContext(); // DocumentReferenceContextComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("masterIdentifier")) { - this.masterIdentifier = new Identifier(); - return this.masterIdentifier; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("class")) { - this.class_ = new CodeableConcept(); - return this.class_; - } - else if (name.equals("author")) { - return addAuthor(); - } - else if (name.equals("custodian")) { - this.custodian = new Reference(); - return this.custodian; - } - else if (name.equals("authenticator")) { - this.authenticator = new Reference(); - return this.authenticator; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.created"); - } - else if (name.equals("indexed")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.indexed"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.status"); - } - else if (name.equals("docStatus")) { - this.docStatus = new CodeableConcept(); - return this.docStatus; - } - else if (name.equals("relatesTo")) { - return addRelatesTo(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type DocumentReference.description"); - } - else if (name.equals("securityLabel")) { - return addSecurityLabel(); - } - else if (name.equals("content")) { - return addContent(); - } - else if (name.equals("context")) { - this.context = new DocumentReferenceContextComponent(); - return this.context; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DocumentReference"; - - } - - public DocumentReference copy() { - DocumentReference dst = new DocumentReference(); - copyValues(dst); - dst.masterIdentifier = masterIdentifier == null ? null : masterIdentifier.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.type = type == null ? null : type.copy(); - dst.class_ = class_ == null ? null : class_.copy(); - if (author != null) { - dst.author = new ArrayList(); - for (Reference i : author) - dst.author.add(i.copy()); - }; - dst.custodian = custodian == null ? null : custodian.copy(); - dst.authenticator = authenticator == null ? null : authenticator.copy(); - dst.created = created == null ? null : created.copy(); - dst.indexed = indexed == null ? null : indexed.copy(); - dst.status = status == null ? null : status.copy(); - dst.docStatus = docStatus == null ? null : docStatus.copy(); - if (relatesTo != null) { - dst.relatesTo = new ArrayList(); - for (DocumentReferenceRelatesToComponent i : relatesTo) - dst.relatesTo.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (securityLabel != null) { - dst.securityLabel = new ArrayList(); - for (CodeableConcept i : securityLabel) - dst.securityLabel.add(i.copy()); - }; - if (content != null) { - dst.content = new ArrayList(); - for (DocumentReferenceContentComponent i : content) - dst.content.add(i.copy()); - }; - dst.context = context == null ? null : context.copy(); - return dst; - } - - protected DocumentReference typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DocumentReference)) - return false; - DocumentReference o = (DocumentReference) other; - return compareDeep(masterIdentifier, o.masterIdentifier, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(subject, o.subject, true) && compareDeep(type, o.type, true) && compareDeep(class_, o.class_, true) - && compareDeep(author, o.author, true) && compareDeep(custodian, o.custodian, true) && compareDeep(authenticator, o.authenticator, true) - && compareDeep(created, o.created, true) && compareDeep(indexed, o.indexed, true) && compareDeep(status, o.status, true) - && compareDeep(docStatus, o.docStatus, true) && compareDeep(relatesTo, o.relatesTo, true) && compareDeep(description, o.description, true) - && compareDeep(securityLabel, o.securityLabel, true) && compareDeep(content, o.content, true) && compareDeep(context, o.context, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DocumentReference)) - return false; - DocumentReference o = (DocumentReference) other; - return compareValues(created, o.created, true) && compareValues(indexed, o.indexed, true) && compareValues(status, o.status, true) - && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (masterIdentifier == null || masterIdentifier.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (subject == null || subject.isEmpty()) && (type == null || type.isEmpty()) && (class_ == null || class_.isEmpty()) - && (author == null || author.isEmpty()) && (custodian == null || custodian.isEmpty()) && (authenticator == null || authenticator.isEmpty()) - && (created == null || created.isEmpty()) && (indexed == null || indexed.isEmpty()) && (status == null || status.isEmpty()) - && (docStatus == null || docStatus.isEmpty()) && (relatesTo == null || relatesTo.isEmpty()) - && (description == null || description.isEmpty()) && (securityLabel == null || securityLabel.isEmpty()) - && (content == null || content.isEmpty()) && (context == null || context.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.DocumentReference; - } - - /** - * Search parameter: related-ref - *

- * Description: Related Resource
- * Type: reference
- * Path: DocumentReference.context.related.ref
- *

- */ - @SearchParamDefinition(name="related-ref", path="DocumentReference.context.related.ref", description="Related Resource", type="reference" ) - public static final String SP_RELATED_REF = "related-ref"; - /** - * Fluent Client search parameter constant for related-ref - *

- * Description: Related Resource
- * Type: reference
- * Path: DocumentReference.context.related.ref
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_REF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATED_REF); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:related-ref". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATED_REF = new ca.uhn.fhir.model.api.Include("DocumentReference:related-ref").toLocked(); - - /** - * Search parameter: related-id - *

- * Description: Identifier of related objects or events
- * Type: token
- * Path: DocumentReference.context.related.identifier
- *

- */ - @SearchParamDefinition(name="related-id", path="DocumentReference.context.related.identifier", description="Identifier of related objects or events", type="token" ) - public static final String SP_RELATED_ID = "related-id"; - /** - * Fluent Client search parameter constant for related-id - *

- * Description: Identifier of related objects or events
- * Type: token
- * Path: DocumentReference.context.related.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_ID); - - /** - * Search parameter: indexed - *

- * Description: When this document reference created
- * Type: date
- * Path: DocumentReference.indexed
- *

- */ - @SearchParamDefinition(name="indexed", path="DocumentReference.indexed", description="When this document reference created", type="date" ) - public static final String SP_INDEXED = "indexed"; - /** - * Fluent Client search parameter constant for indexed - *

- * Description: When this document reference created
- * Type: date
- * Path: DocumentReference.indexed
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam INDEXED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_INDEXED); - - /** - * Search parameter: location - *

- * Description: Uri where the data can be found
- * Type: uri
- * Path: DocumentReference.content.attachment.url
- *

- */ - @SearchParamDefinition(name="location", path="DocumentReference.content.attachment.url", description="Uri where the data can be found", type="uri" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: Uri where the data can be found
- * Type: uri
- * Path: DocumentReference.content.attachment.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam LOCATION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_LOCATION); - - /** - * Search parameter: relatesto - *

- * Description: Target of the relationship
- * Type: reference
- * Path: DocumentReference.relatesTo.target
- *

- */ - @SearchParamDefinition(name="relatesto", path="DocumentReference.relatesTo.target", description="Target of the relationship", type="reference" ) - public static final String SP_RELATESTO = "relatesto"; - /** - * Fluent Client search parameter constant for relatesto - *

- * Description: Target of the relationship
- * Type: reference
- * Path: DocumentReference.relatesTo.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATESTO = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATESTO); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:relatesto". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATESTO = new ca.uhn.fhir.model.api.Include("DocumentReference:relatesto").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Who/what is the subject of the document
- * Type: reference
- * Path: DocumentReference.subject
- *

- */ - @SearchParamDefinition(name="subject", path="DocumentReference.subject", description="Who/what is the subject of the document", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who/what is the subject of the document
- * Type: reference
- * Path: DocumentReference.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("DocumentReference:subject").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Context of the document content
- * Type: reference
- * Path: DocumentReference.context.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="DocumentReference.context.encounter", description="Context of the document content", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Context of the document content
- * Type: reference
- * Path: DocumentReference.context.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("DocumentReference:encounter").toLocked(); - - /** - * Search parameter: type - *

- * Description: Kind of document (LOINC if possible)
- * Type: token
- * Path: DocumentReference.type
- *

- */ - @SearchParamDefinition(name="type", path="DocumentReference.type", description="Kind of document (LOINC if possible)", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Kind of document (LOINC if possible)
- * Type: token
- * Path: DocumentReference.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: securitylabel - *

- * Description: Document security-tags
- * Type: token
- * Path: DocumentReference.securityLabel
- *

- */ - @SearchParamDefinition(name="securitylabel", path="DocumentReference.securityLabel", description="Document security-tags", type="token" ) - public static final String SP_SECURITYLABEL = "securitylabel"; - /** - * Fluent Client search parameter constant for securitylabel - *

- * Description: Document security-tags
- * Type: token
- * Path: DocumentReference.securityLabel
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SECURITYLABEL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SECURITYLABEL); - - /** - * Search parameter: setting - *

- * Description: Additional details about where the content was created (e.g. clinical specialty)
- * Type: token
- * Path: DocumentReference.context.practiceSetting
- *

- */ - @SearchParamDefinition(name="setting", path="DocumentReference.context.practiceSetting", description="Additional details about where the content was created (e.g. clinical specialty)", type="token" ) - public static final String SP_SETTING = "setting"; - /** - * Fluent Client search parameter constant for setting - *

- * Description: Additional details about where the content was created (e.g. clinical specialty)
- * Type: token
- * Path: DocumentReference.context.practiceSetting
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SETTING = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SETTING); - - /** - * Search parameter: author - *

- * Description: Who and/or what authored the document
- * Type: reference
- * Path: DocumentReference.author
- *

- */ - @SearchParamDefinition(name="author", path="DocumentReference.author", description="Who and/or what authored the document", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Who and/or what authored the document
- * Type: reference
- * Path: DocumentReference.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("DocumentReference:author").toLocked(); - - /** - * Search parameter: custodian - *

- * Description: Organization which maintains the document
- * Type: reference
- * Path: DocumentReference.custodian
- *

- */ - @SearchParamDefinition(name="custodian", path="DocumentReference.custodian", description="Organization which maintains the document", type="reference" ) - public static final String SP_CUSTODIAN = "custodian"; - /** - * Fluent Client search parameter constant for custodian - *

- * Description: Organization which maintains the document
- * Type: reference
- * Path: DocumentReference.custodian
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CUSTODIAN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CUSTODIAN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:custodian". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CUSTODIAN = new ca.uhn.fhir.model.api.Include("DocumentReference:custodian").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Who/what is the subject of the document
- * Type: reference
- * Path: DocumentReference.subject
- *

- */ - @SearchParamDefinition(name="patient", path="DocumentReference.subject", description="Who/what is the subject of the document", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Who/what is the subject of the document
- * Type: reference
- * Path: DocumentReference.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("DocumentReference:patient").toLocked(); - - /** - * Search parameter: facility - *

- * Description: Kind of facility where patient was seen
- * Type: token
- * Path: DocumentReference.context.facilityType
- *

- */ - @SearchParamDefinition(name="facility", path="DocumentReference.context.facilityType", description="Kind of facility where patient was seen", type="token" ) - public static final String SP_FACILITY = "facility"; - /** - * Fluent Client search parameter constant for facility - *

- * Description: Kind of facility where patient was seen
- * Type: token
- * Path: DocumentReference.context.facilityType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITY); - - /** - * Search parameter: created - *

- * Description: Document creation time
- * Type: date
- * Path: DocumentReference.created
- *

- */ - @SearchParamDefinition(name="created", path="DocumentReference.created", description="Document creation time", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: Document creation time
- * Type: date
- * Path: DocumentReference.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: description - *

- * Description: Human-readable description (title)
- * Type: string
- * Path: DocumentReference.description
- *

- */ - @SearchParamDefinition(name="description", path="DocumentReference.description", description="Human-readable description (title)", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Human-readable description (title)
- * Type: string
- * Path: DocumentReference.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: event - *

- * Description: Main Clinical Acts Documented
- * Type: token
- * Path: DocumentReference.context.event
- *

- */ - @SearchParamDefinition(name="event", path="DocumentReference.context.event", description="Main Clinical Acts Documented", type="token" ) - public static final String SP_EVENT = "event"; - /** - * Fluent Client search parameter constant for event - *

- * Description: Main Clinical Acts Documented
- * Type: token
- * Path: DocumentReference.context.event
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); - - /** - * Search parameter: status - *

- * Description: current | superseded | entered-in-error
- * Type: token
- * Path: DocumentReference.status
- *

- */ - @SearchParamDefinition(name="status", path="DocumentReference.status", description="current | superseded | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: current | superseded | entered-in-error
- * Type: token
- * Path: DocumentReference.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: relation - *

- * Description: replaces | transforms | signs | appends
- * Type: token
- * Path: DocumentReference.relatesTo.code
- *

- */ - @SearchParamDefinition(name="relation", path="DocumentReference.relatesTo.code", description="replaces | transforms | signs | appends", type="token" ) - public static final String SP_RELATION = "relation"; - /** - * Fluent Client search parameter constant for relation - *

- * Description: replaces | transforms | signs | appends
- * Type: token
- * Path: DocumentReference.relatesTo.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATION); - - /** - * Search parameter: class - *

- * Description: Categorization of document
- * Type: token
- * Path: DocumentReference.class
- *

- */ - @SearchParamDefinition(name="class", path="DocumentReference.class", description="Categorization of document", type="token" ) - public static final String SP_CLASS = "class"; - /** - * Fluent Client search parameter constant for class - *

- * Description: Categorization of document
- * Type: token
- * Path: DocumentReference.class
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLASS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLASS); - - /** - * Search parameter: format - *

- * Description: Format/content rules for the document
- * Type: token
- * Path: DocumentReference.content.format
- *

- */ - @SearchParamDefinition(name="format", path="DocumentReference.content.format", description="Format/content rules for the document", type="token" ) - public static final String SP_FORMAT = "format"; - /** - * Fluent Client search parameter constant for format - *

- * Description: Format/content rules for the document
- * Type: token
- * Path: DocumentReference.content.format
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMAT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMAT); - - /** - * Search parameter: period - *

- * Description: Time of service that is being documented
- * Type: date
- * Path: DocumentReference.context.period
- *

- */ - @SearchParamDefinition(name="period", path="DocumentReference.context.period", description="Time of service that is being documented", type="date" ) - public static final String SP_PERIOD = "period"; - /** - * Fluent Client search parameter constant for period - *

- * Description: Time of service that is being documented
- * Type: date
- * Path: DocumentReference.context.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); - - /** - * Search parameter: authenticator - *

- * Description: Who/what authenticated the document
- * Type: reference
- * Path: DocumentReference.authenticator
- *

- */ - @SearchParamDefinition(name="authenticator", path="DocumentReference.authenticator", description="Who/what authenticated the document", type="reference" ) - public static final String SP_AUTHENTICATOR = "authenticator"; - /** - * Fluent Client search parameter constant for authenticator - *

- * Description: Who/what authenticated the document
- * Type: reference
- * Path: DocumentReference.authenticator
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHENTICATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHENTICATOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "DocumentReference:authenticator". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHENTICATOR = new ca.uhn.fhir.model.api.Include("DocumentReference:authenticator").toLocked(); - - /** - * Search parameter: relationship - *

- * Description: Combination of relation and relatesTo
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="relationship", path="", description="Combination of relation and relatesTo", type="composite", compositeOf={"relatesto", "relation"} ) - public static final String SP_RELATIONSHIP = "relationship"; - /** - * Fluent Client search parameter constant for relationship - *

- * Description: Combination of relation and relatesTo
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATIONSHIP = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATIONSHIP); - - /** - * Search parameter: language - *

- * Description: Human language of the content (BCP-47)
- * Type: token
- * Path: DocumentReference.content.attachment.language
- *

- */ - @SearchParamDefinition(name="language", path="DocumentReference.content.attachment.language", description="Human language of the content (BCP-47)", type="token" ) - public static final String SP_LANGUAGE = "language"; - /** - * Fluent Client search parameter constant for language - *

- * Description: Human language of the content (BCP-47)
- * Type: token
- * Path: DocumentReference.content.attachment.language
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE); - - /** - * Search parameter: identifier - *

- * Description: Master Version Specific Identifier
- * Type: token
- * Path: DocumentReference.masterIdentifier, DocumentReference.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="DocumentReference.masterIdentifier | DocumentReference.identifier", description="Master Version Specific Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Master Version Specific Identifier
- * Type: token
- * Path: DocumentReference.masterIdentifier, DocumentReference.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DomainResource.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DomainResource.java deleted file mode 100644 index 2c243fef9d4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/DomainResource.java +++ /dev/null @@ -1,391 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseHasExtensions; -import org.hl7.fhir.instance.model.api.IBaseHasModifierExtensions; -import org.hl7.fhir.instance.model.api.IDomainResource; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A resource that includes narrative, extensions, and contained resources. - */ -public abstract class DomainResource extends Resource implements IBaseHasExtensions, IBaseHasModifierExtensions, IDomainResource { - - /** - * A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety. - */ - @Child(name = "text", type = {Narrative.class}, order=0, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Text summary of the resource, for human interpretation", formalDefinition="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." ) - protected Narrative text; - - /** - * These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope. - */ - @Child(name = "contained", type = {Resource.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contained, inline Resources", formalDefinition="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." ) - protected List contained; - - /** - * May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. - */ - @Child(name = "extension", type = {Extension.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) - protected List extension; - - /** - * May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. - */ - @Child(name = "modifierExtension", type = {Extension.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) - @Description(shortDefinition="Extensions that cannot be ignored", formalDefinition="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." ) - protected List modifierExtension; - - private static final long serialVersionUID = -970285559L; - - /** - * Constructor - */ - public DomainResource() { - super(); - } - - /** - * @return {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) - */ - public Narrative getText() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DomainResource.text"); - else if (Configuration.doAutoCreate()) - this.text = new Narrative(); // cc - return this.text; - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.) - */ - public DomainResource setText(Narrative value) { - this.text = value; - return this; - } - - /** - * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) - */ - public List getContained() { - if (this.contained == null) - this.contained = new ArrayList(); - return this.contained; - } - - public boolean hasContained() { - if (this.contained == null) - return false; - for (Resource item : this.contained) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contained} (These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.) - */ - // syntactic sugar - public DomainResource addContained(Resource t) { //3 - if (t == null) - return this; - if (this.contained == null) - this.contained = new ArrayList(); - this.contained.add(t); - return this; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - public List getExtension() { - if (this.extension == null) - this.extension = new ArrayList(); - return this.extension; - } - - public boolean hasExtension() { - if (this.extension == null) - return false; - for (Extension item : this.extension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - // syntactic sugar - public Extension addExtension() { //3 - Extension t = new Extension(); - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return t; - } - - // syntactic sugar - public DomainResource addExtension(Extension t) { //3 - if (t == null) - return this; - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return this; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - public List getModifierExtension() { - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - return this.modifierExtension; - } - - public boolean hasModifierExtension() { - if (this.modifierExtension == null) - return false; - for (Extension item : this.modifierExtension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifierExtension} (May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.) - */ - // syntactic sugar - public Extension addModifierExtension() { //3 - Extension t = new Extension(); - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return t; - } - - // syntactic sugar - public DomainResource addModifierExtension(Extension t) { //3 - if (t == null) - return this; - if (this.modifierExtension == null) - this.modifierExtension = new ArrayList(); - this.modifierExtension.add(t); - return this; - } - - /** - * Returns a list of extensions from this element which have the given URL. Note that - * this list may not be modified (you can not add or remove elements from it) - */ - public List getExtensionsByUrl(String theUrl) { - org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must be provided with a value"); - ArrayList retVal = new ArrayList(); - for (Extension next : getExtension()) { - if (theUrl.equals(next.getUrl())) { - retVal.add(next); - } - } - return Collections.unmodifiableList(retVal); - } - - /** - * Returns a list of modifier extensions from this element which have the given URL. Note that - * this list may not be modified (you can not add or remove elements from it) - */ - public List getModifierExtensionsByUrl(String theUrl) { - org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must be provided with a value"); - ArrayList retVal = new ArrayList(); - for (Extension next : getModifierExtension()) { - if (theUrl.equals(next.getUrl())) { - retVal.add(next); - } - } - return Collections.unmodifiableList(retVal); - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("text", "Narrative", "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("contained", "Resource", "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.", 0, java.lang.Integer.MAX_VALUE, contained)); - childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); - childrenList.add(new Property("modifierExtension", "Extension", "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.", 0, java.lang.Integer.MAX_VALUE, modifierExtension)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // Narrative - case -410956685: /*contained*/ return this.contained == null ? new Base[0] : this.contained.toArray(new Base[this.contained.size()]); // Resource - case -612557761: /*extension*/ return this.extension == null ? new Base[0] : this.extension.toArray(new Base[this.extension.size()]); // Extension - case -298878168: /*modifierExtension*/ return this.modifierExtension == null ? new Base[0] : this.modifierExtension.toArray(new Base[this.modifierExtension.size()]); // Extension - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3556653: // text - this.text = castToNarrative(value); // Narrative - break; - case -410956685: // contained - this.getContained().add(castToResource(value)); // Resource - break; - case -612557761: // extension - this.getExtension().add(castToExtension(value)); // Extension - break; - case -298878168: // modifierExtension - this.getModifierExtension().add(castToExtension(value)); // Extension - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("text")) - this.text = castToNarrative(value); // Narrative - else if (name.equals("contained")) - this.getContained().add(castToResource(value)); - else if (name.equals("extension")) - this.getExtension().add(castToExtension(value)); - else if (name.equals("modifierExtension")) - this.getModifierExtension().add(castToExtension(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3556653: return getText(); // Narrative - case -410956685: throw new FHIRException("Cannot make property contained as it is not a complex type"); // Resource - case -612557761: return addExtension(); // Extension - case -298878168: return addModifierExtension(); // Extension - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("text")) { - this.text = new Narrative(); - return this.text; - } - else if (name.equals("contained")) { - throw new FHIRException("Cannot call addChild on an abstract type DomainResource.contained"); - } - else if (name.equals("extension")) { - return addExtension(); - } - else if (name.equals("modifierExtension")) { - return addModifierExtension(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "DomainResource"; - - } - - public abstract DomainResource copy(); - - public void copyValues(DomainResource dst) { - super.copyValues(dst); - dst.text = text == null ? null : text.copy(); - if (contained != null) { - dst.contained = new ArrayList(); - for (Resource i : contained) - dst.contained.add(i.copy()); - }; - if (extension != null) { - dst.extension = new ArrayList(); - for (Extension i : extension) - dst.extension.add(i.copy()); - }; - if (modifierExtension != null) { - dst.modifierExtension = new ArrayList(); - for (Extension i : modifierExtension) - dst.modifierExtension.add(i.copy()); - }; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DomainResource)) - return false; - DomainResource o = (DomainResource) other; - return compareDeep(text, o.text, true) && compareDeep(contained, o.contained, true) && compareDeep(extension, o.extension, true) - && compareDeep(modifierExtension, o.modifierExtension, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DomainResource)) - return false; - DomainResource o = (DomainResource) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (contained == null || contained.isEmpty()) - && (extension == null || extension.isEmpty()) && (modifierExtension == null || modifierExtension.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Duration.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Duration.java deleted file mode 100644 index cacf0291421..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Duration.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Duration", profileOf=Quantity.class) -public class Duration extends Quantity { - - private static final long serialVersionUID = 1069574054L; - - public Duration copy() { - Duration dst = new Duration(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Duration typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Duration)) - return false; - Duration o = (Duration) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Duration)) - return false; - Duration o = (Duration) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Element.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Element.java deleted file mode 100644 index 1aac6d3fb1f..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Element.java +++ /dev/null @@ -1,298 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseElement; -import org.hl7.fhir.instance.model.api.IBaseHasExtensions; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Base definition for all elements in a resource. - */ -public abstract class Element extends Base implements IBaseHasExtensions, IBaseElement { - - /** - * unique id for the element within a resource (for internal references). - */ - @Child(name = "id", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="xml:id (or equivalent in JSON)", formalDefinition="unique id for the element within a resource (for internal references)." ) - protected IdType id; - - /** - * May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. - */ - @Child(name = "extension", type = {Extension.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional Content defined by implementations", formalDefinition="May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." ) - protected List extension; - - private static final long serialVersionUID = -158027598L; - - /** - * Constructor - */ - public Element() { - super(); - } - - /** - * @return {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public IdType getIdElement() { - if (this.id == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Element.id"); - else if (Configuration.doAutoCreate()) - this.id = new IdType(); // bb - return this.id; - } - - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); - } - - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); - } - - /** - * @param value {@link #id} (unique id for the element within a resource (for internal references).). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public Element setIdElement(IdType value) { - this.id = value; - return this; - } - - /** - * @return unique id for the element within a resource (for internal references). - */ - public String getId() { - return this.id == null ? null : this.id.getValue(); - } - - /** - * @param value unique id for the element within a resource (for internal references). - */ - public Element setId(String value) { - if (Utilities.noString(value)) - this.id = null; - else { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); - } - return this; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - public List getExtension() { - if (this.extension == null) - this.extension = new ArrayList(); - return this.extension; - } - - public boolean hasExtension() { - if (this.extension == null) - return false; - for (Extension item : this.extension) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #extension} (May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.) - */ - // syntactic sugar - public Extension addExtension() { //3 - Extension t = new Extension(); - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return t; - } - - // syntactic sugar - public Element addExtension(Extension t) { //3 - if (t == null) - return this; - if (this.extension == null) - this.extension = new ArrayList(); - this.extension.add(t); - return this; - } - - /** - * Returns an unmodifiable list containing all extensions on this element which - * match the given URL. - * - * @param theUrl The URL. Must not be blank or null. - * @return an unmodifiable list containing all extensions on this element which - * match the given URL - */ - public List getExtensionsByUrl(String theUrl) { - org.apache.commons.lang3.Validate.notBlank(theUrl, "theUrl must not be blank or null"); - ArrayList retVal = new ArrayList(); - for (Extension next : getExtension()) { - if (theUrl.equals(next.getUrl())) { - retVal.add(next); - } - } - return java.util.Collections.unmodifiableList(retVal); - } - public boolean hasExtension(String theUrl) { - return !getExtensionsByUrl(theUrl).isEmpty(); - } - - public String getExtensionString(String theUrl) throws FHIRException { - List ext = getExtensionsByUrl(theUrl); - if (ext.isEmpty()) - return null; - if (ext.size() > 1) - throw new FHIRException("Multiple matching extensions found"); - if (!ext.get(0).getValue().isPrimitive()) - throw new FHIRException("Extension could not be converted to a string"); - return ext.get(0).getValue().primitiveValue(); - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("id", "id", "unique id for the element within a resource (for internal references).", 0, java.lang.Integer.MAX_VALUE, id)); - childrenList.add(new Property("extension", "Extension", "May be used to represent additional information that is not part of the basic definition of the element. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.", 0, java.lang.Integer.MAX_VALUE, extension)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3355: /*id*/ return this.id == null ? new Base[0] : new Base[] {this.id}; // IdType - case -612557761: /*extension*/ return this.extension == null ? new Base[0] : this.extension.toArray(new Base[this.extension.size()]); // Extension - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3355: // id - this.id = castToId(value); // IdType - break; - case -612557761: // extension - this.getExtension().add(castToExtension(value)); // Extension - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("id")) - this.id = castToId(value); // IdType - else if (name.equals("extension")) - this.getExtension().add(castToExtension(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3355: throw new FHIRException("Cannot make property id as it is not a complex type"); // IdType - case -612557761: return addExtension(); // Extension - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("id")) { - throw new FHIRException("Cannot call addChild on a primitive type Element.id"); - } - else if (name.equals("extension")) { - return addExtension(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Element"; - - } - - public abstract Element copy(); - - public void copyValues(Element dst) { - dst.id = id == null ? null : id.copy(); - if (extension != null) { - dst.extension = new ArrayList(); - for (Extension i : extension) - dst.extension.add(i.copy()); - }; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Element)) - return false; - Element o = (Element) other; - return compareDeep(id, o.id, true) && compareDeep(extension, o.extension, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Element)) - return false; - Element o = (Element) other; - return compareValues(id, o.id, true); - } - - public boolean isEmpty() { - boolean retVal = super.isEmpty() && (id == null || id.isEmpty()) && (extension == null || extension.isEmpty()); - return retVal - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ElementDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ElementDefinition.java deleted file mode 100644 index fcf50a3be48..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ElementDefinition.java +++ /dev/null @@ -1,5451 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength; -import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Captures constraints on each element within the resource, profile, or extension. - */ -@DatatypeDef(name="ElementDefinition") -public class ElementDefinition extends Type implements ICompositeType { - - public enum PropertyRepresentation { - /** - * In XML, this property is represented as an attribute not an element. - */ - XMLATTR, - /** - * This element is represented using the XML text attribute (primitives only) - */ - XMLTEXT, - /** - * The type of this element is indicated using xsi:type - */ - TYPEATTR, - /** - * Use CDA narrative instead of XHTML - */ - CDATEXT, - /** - * added to help the parsers - */ - NULL; - public static PropertyRepresentation fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("xmlAttr".equals(codeString)) - return XMLATTR; - if ("xmlText".equals(codeString)) - return XMLTEXT; - if ("typeAttr".equals(codeString)) - return TYPEATTR; - if ("cdaText".equals(codeString)) - return CDATEXT; - throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case XMLATTR: return "xmlAttr"; - case XMLTEXT: return "xmlText"; - case TYPEATTR: return "typeAttr"; - case CDATEXT: return "cdaText"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case XMLATTR: return "http://hl7.org/fhir/property-representation"; - case XMLTEXT: return "http://hl7.org/fhir/property-representation"; - case TYPEATTR: return "http://hl7.org/fhir/property-representation"; - case CDATEXT: return "http://hl7.org/fhir/property-representation"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case XMLATTR: return "In XML, this property is represented as an attribute not an element."; - case XMLTEXT: return "This element is represented using the XML text attribute (primitives only)"; - case TYPEATTR: return "The type of this element is indicated using xsi:type"; - case CDATEXT: return "Use CDA narrative instead of XHTML"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case XMLATTR: return "XML Attribute"; - case XMLTEXT: return "XML Text"; - case TYPEATTR: return "Type Attribute"; - case CDATEXT: return "CDA Text Format"; - default: return "?"; - } - } - } - - public static class PropertyRepresentationEnumFactory implements EnumFactory { - public PropertyRepresentation fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("xmlAttr".equals(codeString)) - return PropertyRepresentation.XMLATTR; - if ("xmlText".equals(codeString)) - return PropertyRepresentation.XMLTEXT; - if ("typeAttr".equals(codeString)) - return PropertyRepresentation.TYPEATTR; - if ("cdaText".equals(codeString)) - return PropertyRepresentation.CDATEXT; - throw new IllegalArgumentException("Unknown PropertyRepresentation code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("xmlAttr".equals(codeString)) - return new Enumeration(this, PropertyRepresentation.XMLATTR); - if ("xmlText".equals(codeString)) - return new Enumeration(this, PropertyRepresentation.XMLTEXT); - if ("typeAttr".equals(codeString)) - return new Enumeration(this, PropertyRepresentation.TYPEATTR); - if ("cdaText".equals(codeString)) - return new Enumeration(this, PropertyRepresentation.CDATEXT); - throw new FHIRException("Unknown PropertyRepresentation code '"+codeString+"'"); - } - public String toCode(PropertyRepresentation code) { - if (code == PropertyRepresentation.XMLATTR) - return "xmlAttr"; - if (code == PropertyRepresentation.XMLTEXT) - return "xmlText"; - if (code == PropertyRepresentation.TYPEATTR) - return "typeAttr"; - if (code == PropertyRepresentation.CDATEXT) - return "cdaText"; - return "?"; - } - public String toSystem(PropertyRepresentation code) { - return code.getSystem(); - } - } - - public enum SlicingRules { - /** - * No additional content is allowed other than that described by the slices in this profile. - */ - CLOSED, - /** - * Additional content is allowed anywhere in the list. - */ - OPEN, - /** - * Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required. - */ - OPENATEND, - /** - * added to help the parsers - */ - NULL; - public static SlicingRules fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("closed".equals(codeString)) - return CLOSED; - if ("open".equals(codeString)) - return OPEN; - if ("openAtEnd".equals(codeString)) - return OPENATEND; - throw new FHIRException("Unknown SlicingRules code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CLOSED: return "closed"; - case OPEN: return "open"; - case OPENATEND: return "openAtEnd"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CLOSED: return "http://hl7.org/fhir/resource-slicing-rules"; - case OPEN: return "http://hl7.org/fhir/resource-slicing-rules"; - case OPENATEND: return "http://hl7.org/fhir/resource-slicing-rules"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CLOSED: return "No additional content is allowed other than that described by the slices in this profile."; - case OPEN: return "Additional content is allowed anywhere in the list."; - case OPENATEND: return "Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be ordered, which makes it hard to share uses. This should only be done where absolutely required."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CLOSED: return "Closed"; - case OPEN: return "Open"; - case OPENATEND: return "Open at End"; - default: return "?"; - } - } - } - - public static class SlicingRulesEnumFactory implements EnumFactory { - public SlicingRules fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("closed".equals(codeString)) - return SlicingRules.CLOSED; - if ("open".equals(codeString)) - return SlicingRules.OPEN; - if ("openAtEnd".equals(codeString)) - return SlicingRules.OPENATEND; - throw new IllegalArgumentException("Unknown SlicingRules code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("closed".equals(codeString)) - return new Enumeration(this, SlicingRules.CLOSED); - if ("open".equals(codeString)) - return new Enumeration(this, SlicingRules.OPEN); - if ("openAtEnd".equals(codeString)) - return new Enumeration(this, SlicingRules.OPENATEND); - throw new FHIRException("Unknown SlicingRules code '"+codeString+"'"); - } - public String toCode(SlicingRules code) { - if (code == SlicingRules.CLOSED) - return "closed"; - if (code == SlicingRules.OPEN) - return "open"; - if (code == SlicingRules.OPENATEND) - return "openAtEnd"; - return "?"; - } - public String toSystem(SlicingRules code) { - return code.getSystem(); - } - } - - public enum AggregationMode { - /** - * The reference is a local reference to a contained resource. - */ - CONTAINED, - /** - * The reference to a resource that has to be resolved externally to the resource that includes the reference. - */ - REFERENCED, - /** - * The resource the reference points to will be found in the same bundle as the resource that includes the reference. - */ - BUNDLED, - /** - * added to help the parsers - */ - NULL; - public static AggregationMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("contained".equals(codeString)) - return CONTAINED; - if ("referenced".equals(codeString)) - return REFERENCED; - if ("bundled".equals(codeString)) - return BUNDLED; - throw new FHIRException("Unknown AggregationMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CONTAINED: return "contained"; - case REFERENCED: return "referenced"; - case BUNDLED: return "bundled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONTAINED: return "http://hl7.org/fhir/resource-aggregation-mode"; - case REFERENCED: return "http://hl7.org/fhir/resource-aggregation-mode"; - case BUNDLED: return "http://hl7.org/fhir/resource-aggregation-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONTAINED: return "The reference is a local reference to a contained resource."; - case REFERENCED: return "The reference to a resource that has to be resolved externally to the resource that includes the reference."; - case BUNDLED: return "The resource the reference points to will be found in the same bundle as the resource that includes the reference."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONTAINED: return "Contained"; - case REFERENCED: return "Referenced"; - case BUNDLED: return "Bundled"; - default: return "?"; - } - } - } - - public static class AggregationModeEnumFactory implements EnumFactory { - public AggregationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("contained".equals(codeString)) - return AggregationMode.CONTAINED; - if ("referenced".equals(codeString)) - return AggregationMode.REFERENCED; - if ("bundled".equals(codeString)) - return AggregationMode.BUNDLED; - throw new IllegalArgumentException("Unknown AggregationMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("contained".equals(codeString)) - return new Enumeration(this, AggregationMode.CONTAINED); - if ("referenced".equals(codeString)) - return new Enumeration(this, AggregationMode.REFERENCED); - if ("bundled".equals(codeString)) - return new Enumeration(this, AggregationMode.BUNDLED); - throw new FHIRException("Unknown AggregationMode code '"+codeString+"'"); - } - public String toCode(AggregationMode code) { - if (code == AggregationMode.CONTAINED) - return "contained"; - if (code == AggregationMode.REFERENCED) - return "referenced"; - if (code == AggregationMode.BUNDLED) - return "bundled"; - return "?"; - } - public String toSystem(AggregationMode code) { - return code.getSystem(); - } - } - - public enum ReferenceVersionRules { - /** - * The reference may be either version independent or version specific - */ - EITHER, - /** - * The reference must be version independent - */ - INDEPENDENT, - /** - * The reference must be version specific - */ - SPECIFIC, - /** - * added to help the parsers - */ - NULL; - public static ReferenceVersionRules fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("either".equals(codeString)) - return EITHER; - if ("independent".equals(codeString)) - return INDEPENDENT; - if ("specific".equals(codeString)) - return SPECIFIC; - throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case EITHER: return "either"; - case INDEPENDENT: return "independent"; - case SPECIFIC: return "specific"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EITHER: return "http://hl7.org/fhir/reference-version-rules"; - case INDEPENDENT: return "http://hl7.org/fhir/reference-version-rules"; - case SPECIFIC: return "http://hl7.org/fhir/reference-version-rules"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EITHER: return "The reference may be either version independent or version specific"; - case INDEPENDENT: return "The reference must be version independent"; - case SPECIFIC: return "The reference must be version specific"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EITHER: return "Either Specific or independent"; - case INDEPENDENT: return "Version independent"; - case SPECIFIC: return "Version Specific"; - default: return "?"; - } - } - } - - public static class ReferenceVersionRulesEnumFactory implements EnumFactory { - public ReferenceVersionRules fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("either".equals(codeString)) - return ReferenceVersionRules.EITHER; - if ("independent".equals(codeString)) - return ReferenceVersionRules.INDEPENDENT; - if ("specific".equals(codeString)) - return ReferenceVersionRules.SPECIFIC; - throw new IllegalArgumentException("Unknown ReferenceVersionRules code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("either".equals(codeString)) - return new Enumeration(this, ReferenceVersionRules.EITHER); - if ("independent".equals(codeString)) - return new Enumeration(this, ReferenceVersionRules.INDEPENDENT); - if ("specific".equals(codeString)) - return new Enumeration(this, ReferenceVersionRules.SPECIFIC); - throw new FHIRException("Unknown ReferenceVersionRules code '"+codeString+"'"); - } - public String toCode(ReferenceVersionRules code) { - if (code == ReferenceVersionRules.EITHER) - return "either"; - if (code == ReferenceVersionRules.INDEPENDENT) - return "independent"; - if (code == ReferenceVersionRules.SPECIFIC) - return "specific"; - return "?"; - } - public String toSystem(ReferenceVersionRules code) { - return code.getSystem(); - } - } - - public enum ConstraintSeverity { - /** - * If the constraint is violated, the resource is not conformant. - */ - ERROR, - /** - * If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. - */ - WARNING, - /** - * added to help the parsers - */ - NULL; - public static ConstraintSeverity fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("error".equals(codeString)) - return ERROR; - if ("warning".equals(codeString)) - return WARNING; - throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ERROR: return "error"; - case WARNING: return "warning"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ERROR: return "http://hl7.org/fhir/constraint-severity"; - case WARNING: return "http://hl7.org/fhir/constraint-severity"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ERROR: return "If the constraint is violated, the resource is not conformant."; - case WARNING: return "If the constraint is violated, the resource is conformant, but it is not necessarily following best practice."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ERROR: return "Error"; - case WARNING: return "Warning"; - default: return "?"; - } - } - } - - public static class ConstraintSeverityEnumFactory implements EnumFactory { - public ConstraintSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("error".equals(codeString)) - return ConstraintSeverity.ERROR; - if ("warning".equals(codeString)) - return ConstraintSeverity.WARNING; - throw new IllegalArgumentException("Unknown ConstraintSeverity code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("error".equals(codeString)) - return new Enumeration(this, ConstraintSeverity.ERROR); - if ("warning".equals(codeString)) - return new Enumeration(this, ConstraintSeverity.WARNING); - throw new FHIRException("Unknown ConstraintSeverity code '"+codeString+"'"); - } - public String toCode(ConstraintSeverity code) { - if (code == ConstraintSeverity.ERROR) - return "error"; - if (code == ConstraintSeverity.WARNING) - return "warning"; - return "?"; - } - public String toSystem(ConstraintSeverity code) { - return code.getSystem(); - } - } - - @Block() - public static class ElementDefinitionSlicingComponent extends Element implements IBaseDatatypeElement { - /** - * Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices. - */ - @Child(name = "discriminator", type = {StringType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Element values that are used to distinguish the slices", formalDefinition="Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices." ) - protected List discriminator; - - /** - * A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Text description of how slicing works (or not)", formalDefinition="A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated." ) - protected StringType description; - - /** - * If the matching elements have to occur in the same order as defined in the profile. - */ - @Child(name = "ordered", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If elements must be in same order as slices", formalDefinition="If the matching elements have to occur in the same order as defined in the profile." ) - protected BooleanType ordered; - - /** - * Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - @Child(name = "rules", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="closed | open | openAtEnd", formalDefinition="Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end." ) - protected Enumeration rules; - - private static final long serialVersionUID = 233544215L; - - /** - * Constructor - */ - public ElementDefinitionSlicingComponent() { - super(); - } - - /** - * Constructor - */ - public ElementDefinitionSlicingComponent(Enumeration rules) { - super(); - this.rules = rules; - } - - /** - * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public List getDiscriminator() { - if (this.discriminator == null) - this.discriminator = new ArrayList(); - return this.discriminator; - } - - public boolean hasDiscriminator() { - if (this.discriminator == null) - return false; - for (StringType item : this.discriminator) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - // syntactic sugar - public StringType addDiscriminatorElement() {//2 - StringType t = new StringType(); - if (this.discriminator == null) - this.discriminator = new ArrayList(); - this.discriminator.add(t); - return t; - } - - /** - * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public ElementDefinitionSlicingComponent addDiscriminator(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.discriminator == null) - this.discriminator = new ArrayList(); - this.discriminator.add(t); - return this; - } - - /** - * @param value {@link #discriminator} (Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.) - */ - public boolean hasDiscriminator(String value) { - if (this.discriminator == null) - return false; - for (StringType v : this.discriminator) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated. - */ - public ElementDefinitionSlicingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public BooleanType getOrderedElement() { - if (this.ordered == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.ordered"); - else if (Configuration.doAutoCreate()) - this.ordered = new BooleanType(); // bb - return this.ordered; - } - - public boolean hasOrderedElement() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - public boolean hasOrdered() { - return this.ordered != null && !this.ordered.isEmpty(); - } - - /** - * @param value {@link #ordered} (If the matching elements have to occur in the same order as defined in the profile.). This is the underlying object with id, value and extensions. The accessor "getOrdered" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setOrderedElement(BooleanType value) { - this.ordered = value; - return this; - } - - /** - * @return If the matching elements have to occur in the same order as defined in the profile. - */ - public boolean getOrdered() { - return this.ordered == null || this.ordered.isEmpty() ? false : this.ordered.getValue(); - } - - /** - * @param value If the matching elements have to occur in the same order as defined in the profile. - */ - public ElementDefinitionSlicingComponent setOrdered(boolean value) { - if (this.ordered == null) - this.ordered = new BooleanType(); - this.ordered.setValue(value); - return this; - } - - /** - * @return {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value - */ - public Enumeration getRulesElement() { - if (this.rules == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionSlicingComponent.rules"); - else if (Configuration.doAutoCreate()) - this.rules = new Enumeration(new SlicingRulesEnumFactory()); // bb - return this.rules; - } - - public boolean hasRulesElement() { - return this.rules != null && !this.rules.isEmpty(); - } - - public boolean hasRules() { - return this.rules != null && !this.rules.isEmpty(); - } - - /** - * @param value {@link #rules} (Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.). This is the underlying object with id, value and extensions. The accessor "getRules" gives direct access to the value - */ - public ElementDefinitionSlicingComponent setRulesElement(Enumeration value) { - this.rules = value; - return this; - } - - /** - * @return Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - public SlicingRules getRules() { - return this.rules == null ? null : this.rules.getValue(); - } - - /** - * @param value Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end. - */ - public ElementDefinitionSlicingComponent setRules(SlicingRules value) { - if (this.rules == null) - this.rules = new Enumeration(new SlicingRulesEnumFactory()); - this.rules.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("discriminator", "string", "Designates which child elements are used to discriminate between the slices when processing an instance. If one or more discriminators are provided, the value of the child elements in the instance data SHALL completely distinguish which slice the element in the resource matches based on the allowed values for those elements in each of the slices.", 0, java.lang.Integer.MAX_VALUE, discriminator)); - childrenList.add(new Property("description", "string", "A human-readable text description of how the slicing works. If there is no discriminator, this is required to be present to provide whatever information is possible about how the slices can be differentiated.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("ordered", "boolean", "If the matching elements have to occur in the same order as defined in the profile.", 0, java.lang.Integer.MAX_VALUE, ordered)); - childrenList.add(new Property("rules", "code", "Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that additional slices are only allowed at the end.", 0, java.lang.Integer.MAX_VALUE, rules)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1888270692: /*discriminator*/ return this.discriminator == null ? new Base[0] : this.discriminator.toArray(new Base[this.discriminator.size()]); // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1207109523: /*ordered*/ return this.ordered == null ? new Base[0] : new Base[] {this.ordered}; // BooleanType - case 108873975: /*rules*/ return this.rules == null ? new Base[0] : new Base[] {this.rules}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1888270692: // discriminator - this.getDiscriminator().add(castToString(value)); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1207109523: // ordered - this.ordered = castToBoolean(value); // BooleanType - break; - case 108873975: // rules - this.rules = new SlicingRulesEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("discriminator")) - this.getDiscriminator().add(castToString(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("ordered")) - this.ordered = castToBoolean(value); // BooleanType - else if (name.equals("rules")) - this.rules = new SlicingRulesEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1888270692: throw new FHIRException("Cannot make property discriminator as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1207109523: throw new FHIRException("Cannot make property ordered as it is not a complex type"); // BooleanType - case 108873975: throw new FHIRException("Cannot make property rules as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("discriminator")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.discriminator"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description"); - } - else if (name.equals("ordered")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.ordered"); - } - else if (name.equals("rules")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.rules"); - } - else - return super.addChild(name); - } - - public ElementDefinitionSlicingComponent copy() { - ElementDefinitionSlicingComponent dst = new ElementDefinitionSlicingComponent(); - copyValues(dst); - if (discriminator != null) { - dst.discriminator = new ArrayList(); - for (StringType i : discriminator) - dst.discriminator.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.ordered = ordered == null ? null : ordered.copy(); - dst.rules = rules == null ? null : rules.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionSlicingComponent)) - return false; - ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; - return compareDeep(discriminator, o.discriminator, true) && compareDeep(description, o.description, true) - && compareDeep(ordered, o.ordered, true) && compareDeep(rules, o.rules, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionSlicingComponent)) - return false; - ElementDefinitionSlicingComponent o = (ElementDefinitionSlicingComponent) other; - return compareValues(discriminator, o.discriminator, true) && compareValues(description, o.description, true) - && compareValues(ordered, o.ordered, true) && compareValues(rules, o.rules, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (discriminator == null || discriminator.isEmpty()) && (description == null || description.isEmpty()) - && (ordered == null || ordered.isEmpty()) && (rules == null || rules.isEmpty()); - } - - public String fhirType() { - return "ElementDefinition.slicing"; - - } - - } - - @Block() - public static class ElementDefinitionBaseComponent extends Element implements IBaseDatatypeElement { - /** - * The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. - */ - @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Path that identifies the base element", formalDefinition="The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base." ) - protected StringType path; - - /** - * Minimum cardinality of the base element identified by the path. - */ - @Child(name = "min", type = {IntegerType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Min cardinality of the base element", formalDefinition="Minimum cardinality of the base element identified by the path." ) - protected IntegerType min; - - /** - * Maximum cardinality of the base element identified by the path. - */ - @Child(name = "max", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Max cardinality of the base element", formalDefinition="Maximum cardinality of the base element identified by the path." ) - protected StringType max; - - private static final long serialVersionUID = 232204455L; - - /** - * Constructor - */ - public ElementDefinitionBaseComponent() { - super(); - } - - /** - * Constructor - */ - public ElementDefinitionBaseComponent(StringType path, IntegerType min, StringType max) { - super(); - this.path = path; - this.min = min; - this.max = max; - } - - /** - * @return {@link #path} (The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ElementDefinitionBaseComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base. - */ - public ElementDefinitionBaseComponent setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #min} (Minimum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public IntegerType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.min"); - else if (Configuration.doAutoCreate()) - this.min = new IntegerType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (Minimum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public ElementDefinitionBaseComponent setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return Minimum cardinality of the base element identified by the path. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value Minimum cardinality of the base element identified by the path. - */ - public ElementDefinitionBaseComponent setMin(int value) { - if (this.min == null) - this.min = new IntegerType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (Maximum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBaseComponent.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (Maximum cardinality of the base element identified by the path.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public ElementDefinitionBaseComponent setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return Maximum cardinality of the base element identified by the path. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value Maximum cardinality of the base element identified by the path. - */ - public ElementDefinitionBaseComponent setMax(String value) { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The Path that identifies the base element - this matches the ElementDefinition.path for that element. Across FHIR, there is only one base definition of any element - that is, an element definition on a [[[StructureDefinition]]] without a StructureDefinition.base.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("min", "integer", "Minimum cardinality of the base element identified by the path.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "Maximum cardinality of the base element identified by the path.", 0, java.lang.Integer.MAX_VALUE, max)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType - case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case 108114: // min - this.min = castToInteger(value); // IntegerType - break; - case 107876: // max - this.max = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("min")) - this.min = castToInteger(value); // IntegerType - else if (name.equals("max")) - this.max = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType - case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path"); - } - else if (name.equals("min")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min"); - } - else if (name.equals("max")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max"); - } - else - return super.addChild(name); - } - - public ElementDefinitionBaseComponent copy() { - ElementDefinitionBaseComponent dst = new ElementDefinitionBaseComponent(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionBaseComponent)) - return false; - ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other; - return compareDeep(path, o.path, true) && compareDeep(min, o.min, true) && compareDeep(max, o.max, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionBaseComponent)) - return false; - ElementDefinitionBaseComponent o = (ElementDefinitionBaseComponent) other; - return compareValues(path, o.path, true) && compareValues(min, o.min, true) && compareValues(max, o.max, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (min == null || min.isEmpty()) - && (max == null || max.isEmpty()); - } - - public String fhirType() { - return "ElementDefinition.base"; - - } - - } - - @Block() - public static class TypeRefComponent extends Element implements IBaseDatatypeElement { - /** - * Name of Data type or Resource that is a(or the) type used for this element. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of Data type or Resource", formalDefinition="Name of Data type or Resource that is a(or the) type used for this element." ) - protected CodeType code; - - /** - * Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide. - */ - @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Profile (StructureDefinition) to apply (or IG)", formalDefinition="Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide." ) - protected List profile; - - /** - * If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle. - */ - @Child(name = "aggregation", type = {CodeType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="contained | referenced | bundled - how aggregated", formalDefinition="If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle." ) - protected List> aggregation; - - /** - * Whether this reference needs to be version specific or version independent, or whetehr either can be used. - */ - @Child(name = "versioning", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="either | independent | specific", formalDefinition="Whether this reference needs to be version specific or version independent, or whetehr either can be used." ) - protected Enumeration versioning; - - private static final long serialVersionUID = -829583924L; - - /** - * Constructor - */ - public TypeRefComponent() { - super(); - } - - /** - * Constructor - */ - public TypeRefComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TypeRefComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Name of Data type or Resource that is a(or the) type used for this element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public TypeRefComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Name of Data type or Resource that is a(or the) type used for this element. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Name of Data type or Resource that is a(or the) type used for this element. - */ - public TypeRefComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (UriType item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) - */ - // syntactic sugar - public UriType addProfileElement() {//2 - UriType t = new UriType(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - /** - * @param value {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) - */ - public TypeRefComponent addProfile(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @param value {@link #profile} (Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.) - */ - public boolean hasProfile(String value) { - if (this.profile == null) - return false; - for (UriType v : this.profile) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public List> getAggregation() { - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - return this.aggregation; - } - - public boolean hasAggregation() { - if (this.aggregation == null) - return false; - for (Enumeration item : this.aggregation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - // syntactic sugar - public Enumeration addAggregationElement() {//2 - Enumeration t = new Enumeration(new AggregationModeEnumFactory()); - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - this.aggregation.add(t); - return t; - } - - /** - * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public TypeRefComponent addAggregation(AggregationMode value) { //1 - Enumeration t = new Enumeration(new AggregationModeEnumFactory()); - t.setValue(value); - if (this.aggregation == null) - this.aggregation = new ArrayList>(); - this.aggregation.add(t); - return this; - } - - /** - * @param value {@link #aggregation} (If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.) - */ - public boolean hasAggregation(AggregationMode value) { - if (this.aggregation == null) - return false; - for (Enumeration v : this.aggregation) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #versioning} (Whether this reference needs to be version specific or version independent, or whetehr either can be used.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public Enumeration getVersioningElement() { - if (this.versioning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TypeRefComponent.versioning"); - else if (Configuration.doAutoCreate()) - this.versioning = new Enumeration(new ReferenceVersionRulesEnumFactory()); // bb - return this.versioning; - } - - public boolean hasVersioningElement() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - public boolean hasVersioning() { - return this.versioning != null && !this.versioning.isEmpty(); - } - - /** - * @param value {@link #versioning} (Whether this reference needs to be version specific or version independent, or whetehr either can be used.). This is the underlying object with id, value and extensions. The accessor "getVersioning" gives direct access to the value - */ - public TypeRefComponent setVersioningElement(Enumeration value) { - this.versioning = value; - return this; - } - - /** - * @return Whether this reference needs to be version specific or version independent, or whetehr either can be used. - */ - public ReferenceVersionRules getVersioning() { - return this.versioning == null ? null : this.versioning.getValue(); - } - - /** - * @param value Whether this reference needs to be version specific or version independent, or whetehr either can be used. - */ - public TypeRefComponent setVersioning(ReferenceVersionRules value) { - if (value == null) - this.versioning = null; - else { - if (this.versioning == null) - this.versioning = new Enumeration(new ReferenceVersionRulesEnumFactory()); - this.versioning.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Name of Data type or Resource that is a(or the) type used for this element.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("profile", "uri", "Identifies a profile structure or implementation Guide that SHALL hold for resources or datatypes referenced as the type of this element. Can be a local reference - to another structure in this profile, or a reference to a structure in another profile. When more than one profile is specified, the content must conform to all of them. When an implementation guide is specified, the resource SHALL conform to at least one profile defined in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("aggregation", "code", "If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained resource, or a reference, and if the context is a bundle, is it included in the bundle.", 0, java.lang.Integer.MAX_VALUE, aggregation)); - childrenList.add(new Property("versioning", "code", "Whether this reference needs to be version specific or version independent, or whetehr either can be used.", 0, java.lang.Integer.MAX_VALUE, versioning)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // UriType - case 841524962: /*aggregation*/ return this.aggregation == null ? new Base[0] : this.aggregation.toArray(new Base[this.aggregation.size()]); // Enumeration - case -670487542: /*versioning*/ return this.versioning == null ? new Base[0] : new Base[] {this.versioning}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case -309425751: // profile - this.getProfile().add(castToUri(value)); // UriType - break; - case 841524962: // aggregation - this.getAggregation().add(new AggregationModeEnumFactory().fromType(value)); // Enumeration - break; - case -670487542: // versioning - this.versioning = new ReferenceVersionRulesEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("profile")) - this.getProfile().add(castToUri(value)); - else if (name.equals("aggregation")) - this.getAggregation().add(new AggregationModeEnumFactory().fromType(value)); - else if (name.equals("versioning")) - this.versioning = new ReferenceVersionRulesEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case -309425751: throw new FHIRException("Cannot make property profile as it is not a complex type"); // UriType - case 841524962: throw new FHIRException("Cannot make property aggregation as it is not a complex type"); // Enumeration - case -670487542: throw new FHIRException("Cannot make property versioning as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.code"); - } - else if (name.equals("profile")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.profile"); - } - else if (name.equals("aggregation")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.aggregation"); - } - else if (name.equals("versioning")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.versioning"); - } - else - return super.addChild(name); - } - - public TypeRefComponent copy() { - TypeRefComponent dst = new TypeRefComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - if (profile != null) { - dst.profile = new ArrayList(); - for (UriType i : profile) - dst.profile.add(i.copy()); - }; - if (aggregation != null) { - dst.aggregation = new ArrayList>(); - for (Enumeration i : aggregation) - dst.aggregation.add(i.copy()); - }; - dst.versioning = versioning == null ? null : versioning.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TypeRefComponent)) - return false; - TypeRefComponent o = (TypeRefComponent) other; - return compareDeep(code, o.code, true) && compareDeep(profile, o.profile, true) && compareDeep(aggregation, o.aggregation, true) - && compareDeep(versioning, o.versioning, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TypeRefComponent)) - return false; - TypeRefComponent o = (TypeRefComponent) other; - return compareValues(code, o.code, true) && compareValues(profile, o.profile, true) && compareValues(aggregation, o.aggregation, true) - && compareValues(versioning, o.versioning, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (profile == null || profile.isEmpty()) - && (aggregation == null || aggregation.isEmpty()) && (versioning == null || versioning.isEmpty()) - ; - } - - public String fhirType() { - return "ElementDefinition.type"; - - } - - } - - @Block() - public static class ElementDefinitionConstraintComponent extends Element implements IBaseDatatypeElement { - /** - * Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - @Child(name = "key", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Target of 'condition' reference above", formalDefinition="Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality." ) - protected IdType key; - - /** - * Description of why this constraint is necessary or appropriate. - */ - @Child(name = "requirements", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why this constraint is necessary or appropriate", formalDefinition="Description of why this constraint is necessary or appropriate." ) - protected StringType requirements; - - /** - * Identifies the impact constraint violation has on the conformance of the instance. - */ - @Child(name = "severity", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="error | warning", formalDefinition="Identifies the impact constraint violation has on the conformance of the instance." ) - protected Enumeration severity; - - /** - * Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - @Child(name = "human", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human description of constraint", formalDefinition="Text that can be used to describe the constraint in messages identifying that the constraint has been violated." ) - protected StringType human; - - /** - * A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met. - */ - @Child(name = "expression", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FluentPath expression of constraint", formalDefinition="A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met." ) - protected StringType expression; - - /** - * An XPath expression of constraint that can be executed to see if this constraint is met. - */ - @Child(name = "xpath", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="XPath expression of constraint", formalDefinition="An XPath expression of constraint that can be executed to see if this constraint is met." ) - protected StringType xpath; - - private static final long serialVersionUID = -1412249932L; - - /** - * Constructor - */ - public ElementDefinitionConstraintComponent() { - super(); - } - - /** - * Constructor - */ - public ElementDefinitionConstraintComponent(IdType key, Enumeration severity, StringType human, StringType xpath) { - super(); - this.key = key; - this.severity = severity; - this.human = human; - this.xpath = xpath; - } - - /** - * @return {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value - */ - public IdType getKeyElement() { - if (this.key == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.key"); - else if (Configuration.doAutoCreate()) - this.key = new IdType(); // bb - return this.key; - } - - public boolean hasKeyElement() { - return this.key != null && !this.key.isEmpty(); - } - - public boolean hasKey() { - return this.key != null && !this.key.isEmpty(); - } - - /** - * @param value {@link #key} (Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.). This is the underlying object with id, value and extensions. The accessor "getKey" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setKeyElement(IdType value) { - this.key = value; - return this; - } - - /** - * @return Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - public String getKey() { - return this.key == null ? null : this.key.getValue(); - } - - /** - * @param value Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality. - */ - public ElementDefinitionConstraintComponent setKey(String value) { - if (this.key == null) - this.key = new IdType(); - this.key.setValue(value); - return this; - } - - /** - * @return {@link #requirements} (Description of why this constraint is necessary or appropriate.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Description of why this constraint is necessary or appropriate.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Description of why this constraint is necessary or appropriate. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Description of why this constraint is necessary or appropriate. - */ - public ElementDefinitionConstraintComponent setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Identifies the impact constraint violation has on the conformance of the instance.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Identifies the impact constraint violation has on the conformance of the instance. - */ - public ConstraintSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Identifies the impact constraint violation has on the conformance of the instance. - */ - public ElementDefinitionConstraintComponent setSeverity(ConstraintSeverity value) { - if (this.severity == null) - this.severity = new Enumeration(new ConstraintSeverityEnumFactory()); - this.severity.setValue(value); - return this; - } - - /** - * @return {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value - */ - public StringType getHumanElement() { - if (this.human == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.human"); - else if (Configuration.doAutoCreate()) - this.human = new StringType(); // bb - return this.human; - } - - public boolean hasHumanElement() { - return this.human != null && !this.human.isEmpty(); - } - - public boolean hasHuman() { - return this.human != null && !this.human.isEmpty(); - } - - /** - * @param value {@link #human} (Text that can be used to describe the constraint in messages identifying that the constraint has been violated.). This is the underlying object with id, value and extensions. The accessor "getHuman" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setHumanElement(StringType value) { - this.human = value; - return this; - } - - /** - * @return Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - public String getHuman() { - return this.human == null ? null : this.human.getValue(); - } - - /** - * @param value Text that can be used to describe the constraint in messages identifying that the constraint has been violated. - */ - public ElementDefinitionConstraintComponent setHuman(String value) { - if (this.human == null) - this.human = new StringType(); - this.human.setValue(value); - return this; - } - - /** - * @return {@link #expression} (A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value - */ - public StringType getExpressionElement() { - if (this.expression == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.expression"); - else if (Configuration.doAutoCreate()) - this.expression = new StringType(); // bb - return this.expression; - } - - public boolean hasExpressionElement() { - return this.expression != null && !this.expression.isEmpty(); - } - - public boolean hasExpression() { - return this.expression != null && !this.expression.isEmpty(); - } - - /** - * @param value {@link #expression} (A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setExpressionElement(StringType value) { - this.expression = value; - return this; - } - - /** - * @return A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met. - */ - public String getExpression() { - return this.expression == null ? null : this.expression.getValue(); - } - - /** - * @param value A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met. - */ - public ElementDefinitionConstraintComponent setExpression(String value) { - if (Utilities.noString(value)) - this.expression = null; - else { - if (this.expression == null) - this.expression = new StringType(); - this.expression.setValue(value); - } - return this; - } - - /** - * @return {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public StringType getXpathElement() { - if (this.xpath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionConstraintComponent.xpath"); - else if (Configuration.doAutoCreate()) - this.xpath = new StringType(); // bb - return this.xpath; - } - - public boolean hasXpathElement() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - public boolean hasXpath() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - /** - * @param value {@link #xpath} (An XPath expression of constraint that can be executed to see if this constraint is met.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public ElementDefinitionConstraintComponent setXpathElement(StringType value) { - this.xpath = value; - return this; - } - - /** - * @return An XPath expression of constraint that can be executed to see if this constraint is met. - */ - public String getXpath() { - return this.xpath == null ? null : this.xpath.getValue(); - } - - /** - * @param value An XPath expression of constraint that can be executed to see if this constraint is met. - */ - public ElementDefinitionConstraintComponent setXpath(String value) { - if (this.xpath == null) - this.xpath = new StringType(); - this.xpath.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("key", "id", "Allows identification of which elements have their cardinalities impacted by the constraint. Will not be referenced for constraints that do not affect cardinality.", 0, java.lang.Integer.MAX_VALUE, key)); - childrenList.add(new Property("requirements", "string", "Description of why this constraint is necessary or appropriate.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("severity", "code", "Identifies the impact constraint violation has on the conformance of the instance.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("human", "string", "Text that can be used to describe the constraint in messages identifying that the constraint has been violated.", 0, java.lang.Integer.MAX_VALUE, human)); - childrenList.add(new Property("expression", "string", "A [FluentPath](fluentpath.html) expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, expression)); - childrenList.add(new Property("xpath", "string", "An XPath expression of constraint that can be executed to see if this constraint is met.", 0, java.lang.Integer.MAX_VALUE, xpath)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 106079: /*key*/ return this.key == null ? new Base[0] : new Base[] {this.key}; // IdType - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration - case 99639597: /*human*/ return this.human == null ? new Base[0] : new Base[] {this.human}; // StringType - case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType - case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 106079: // key - this.key = castToId(value); // IdType - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1478300413: // severity - this.severity = new ConstraintSeverityEnumFactory().fromType(value); // Enumeration - break; - case 99639597: // human - this.human = castToString(value); // StringType - break; - case -1795452264: // expression - this.expression = castToString(value); // StringType - break; - case 114256029: // xpath - this.xpath = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("key")) - this.key = castToId(value); // IdType - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("severity")) - this.severity = new ConstraintSeverityEnumFactory().fromType(value); // Enumeration - else if (name.equals("human")) - this.human = castToString(value); // StringType - else if (name.equals("expression")) - this.expression = castToString(value); // StringType - else if (name.equals("xpath")) - this.xpath = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 106079: throw new FHIRException("Cannot make property key as it is not a complex type"); // IdType - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration - case 99639597: throw new FHIRException("Cannot make property human as it is not a complex type"); // StringType - case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType - case 114256029: throw new FHIRException("Cannot make property xpath as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("key")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.key"); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements"); - } - else if (name.equals("severity")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.severity"); - } - else if (name.equals("human")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.human"); - } - else if (name.equals("expression")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.expression"); - } - else if (name.equals("xpath")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.xpath"); - } - else - return super.addChild(name); - } - - public ElementDefinitionConstraintComponent copy() { - ElementDefinitionConstraintComponent dst = new ElementDefinitionConstraintComponent(); - copyValues(dst); - dst.key = key == null ? null : key.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.severity = severity == null ? null : severity.copy(); - dst.human = human == null ? null : human.copy(); - dst.expression = expression == null ? null : expression.copy(); - dst.xpath = xpath == null ? null : xpath.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionConstraintComponent)) - return false; - ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; - return compareDeep(key, o.key, true) && compareDeep(requirements, o.requirements, true) && compareDeep(severity, o.severity, true) - && compareDeep(human, o.human, true) && compareDeep(expression, o.expression, true) && compareDeep(xpath, o.xpath, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionConstraintComponent)) - return false; - ElementDefinitionConstraintComponent o = (ElementDefinitionConstraintComponent) other; - return compareValues(key, o.key, true) && compareValues(requirements, o.requirements, true) && compareValues(severity, o.severity, true) - && compareValues(human, o.human, true) && compareValues(expression, o.expression, true) && compareValues(xpath, o.xpath, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (key == null || key.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (severity == null || severity.isEmpty()) && (human == null || human.isEmpty()) && (expression == null || expression.isEmpty()) - && (xpath == null || xpath.isEmpty()); - } - - public String fhirType() { - return "ElementDefinition.constraint"; - - } - - } - - @Block() - public static class ElementDefinitionBindingComponent extends Element implements IBaseDatatypeElement { - /** - * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." ) - protected Enumeration strength; - - /** - * Describes the intended use of this particular set of codes. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human explanation of the value set", formalDefinition="Describes the intended use of this particular set of codes." ) - protected StringType description; - - /** - * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. - */ - @Child(name = "valueSet", type = {UriType.class, ValueSet.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used." ) - protected Type valueSet; - - private static final long serialVersionUID = 1355538460L; - - /** - * Constructor - */ - public ElementDefinitionBindingComponent() { - super(); - } - - /** - * Constructor - */ - public ElementDefinitionBindingComponent(Enumeration strength) { - super(); - this.strength = strength; - } - - /** - * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value - */ - public Enumeration getStrengthElement() { - if (this.strength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.strength"); - else if (Configuration.doAutoCreate()) - this.strength = new Enumeration(new BindingStrengthEnumFactory()); // bb - return this.strength; - } - - public boolean hasStrengthElement() { - return this.strength != null && !this.strength.isEmpty(); - } - - public boolean hasStrength() { - return this.strength != null && !this.strength.isEmpty(); - } - - /** - * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value - */ - public ElementDefinitionBindingComponent setStrengthElement(Enumeration value) { - this.strength = value; - return this; - } - - /** - * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - public BindingStrength getStrength() { - return this.strength == null ? null : this.strength.getValue(); - } - - /** - * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - public ElementDefinitionBindingComponent setStrength(BindingStrength value) { - if (this.strength == null) - this.strength = new Enumeration(new BindingStrengthEnumFactory()); - this.strength.setValue(value); - return this; - } - - /** - * @return {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionBindingComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Describes the intended use of this particular set of codes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ElementDefinitionBindingComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Describes the intended use of this particular set of codes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Describes the intended use of this particular set of codes. - */ - public ElementDefinitionBindingComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public Type getValueSet() { - return this.valueSet; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public UriType getValueSetUriType() throws FHIRException { - if (!(this.valueSet instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (UriType) this.valueSet; - } - - public boolean hasValueSetUriType() { - return this.valueSet instanceof UriType; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public Reference getValueSetReference() throws FHIRException { - if (!(this.valueSet instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (Reference) this.valueSet; - } - - public boolean hasValueSetReference() { - return this.valueSet instanceof Reference; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public ElementDefinitionBindingComponent setValueSet(Type value) { - this.valueSet = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, java.lang.Integer.MAX_VALUE, strength)); - childrenList.add(new Property("description", "string", "Describes the intended use of this particular set of codes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("valueSet[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1791316033: // strength - this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1410174671: // valueSet - this.valueSet = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("strength")) - this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("valueSet[x]")) - this.valueSet = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1791316033: throw new FHIRException("Cannot make property strength as it is not a complex type"); // Enumeration - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1438410321: return getValueSet(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("strength")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.strength"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.description"); - } - else if (name.equals("valueSetUri")) { - this.valueSet = new UriType(); - return this.valueSet; - } - else if (name.equals("valueSetReference")) { - this.valueSet = new Reference(); - return this.valueSet; - } - else - return super.addChild(name); - } - - public ElementDefinitionBindingComponent copy() { - ElementDefinitionBindingComponent dst = new ElementDefinitionBindingComponent(); - copyValues(dst); - dst.strength = strength == null ? null : strength.copy(); - dst.description = description == null ? null : description.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionBindingComponent)) - return false; - ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; - return compareDeep(strength, o.strength, true) && compareDeep(description, o.description, true) - && compareDeep(valueSet, o.valueSet, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionBindingComponent)) - return false; - ElementDefinitionBindingComponent o = (ElementDefinitionBindingComponent) other; - return compareValues(strength, o.strength, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (strength == null || strength.isEmpty()) && (description == null || description.isEmpty()) - && (valueSet == null || valueSet.isEmpty()); - } - - public String fhirType() { - return "ElementDefinition.binding"; - - } - - } - - @Block() - public static class ElementDefinitionMappingComponent extends Element implements IBaseDatatypeElement { - /** - * An internal reference to the definition of a mapping. - */ - @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to mapping declaration", formalDefinition="An internal reference to the definition of a mapping." ) - protected IdType identity; - - /** - * Identifies the computable language in which mapping.map is expressed. - */ - @Child(name = "language", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Computable language of mapping", formalDefinition="Identifies the computable language in which mapping.map is expressed." ) - protected CodeType language; - - /** - * Expresses what part of the target specification corresponds to this element. - */ - @Child(name = "map", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Details of the mapping", formalDefinition="Expresses what part of the target specification corresponds to this element." ) - protected StringType map; - - private static final long serialVersionUID = -669205371L; - - /** - * Constructor - */ - public ElementDefinitionMappingComponent() { - super(); - } - - /** - * Constructor - */ - public ElementDefinitionMappingComponent(IdType identity, StringType map) { - super(); - this.identity = identity; - this.map = map; - } - - /** - * @return {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); // bb - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An internal reference to the definition of a mapping.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public ElementDefinitionMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An internal reference to the definition of a mapping. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An internal reference to the definition of a mapping. - */ - public ElementDefinitionMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (Identifies the computable language in which mapping.map is expressed.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public ElementDefinitionMappingComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return Identifies the computable language in which mapping.map is expressed. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value Identifies the computable language in which mapping.map is expressed. - */ - public ElementDefinitionMappingComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public StringType getMapElement() { - if (this.map == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinitionMappingComponent.map"); - else if (Configuration.doAutoCreate()) - this.map = new StringType(); // bb - return this.map; - } - - public boolean hasMapElement() { - return this.map != null && !this.map.isEmpty(); - } - - public boolean hasMap() { - return this.map != null && !this.map.isEmpty(); - } - - /** - * @param value {@link #map} (Expresses what part of the target specification corresponds to this element.). This is the underlying object with id, value and extensions. The accessor "getMap" gives direct access to the value - */ - public ElementDefinitionMappingComponent setMapElement(StringType value) { - this.map = value; - return this; - } - - /** - * @return Expresses what part of the target specification corresponds to this element. - */ - public String getMap() { - return this.map == null ? null : this.map.getValue(); - } - - /** - * @param value Expresses what part of the target specification corresponds to this element. - */ - public ElementDefinitionMappingComponent setMap(String value) { - if (this.map == null) - this.map = new StringType(); - this.map.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An internal reference to the definition of a mapping.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("language", "code", "Identifies the computable language in which mapping.map is expressed.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("map", "string", "Expresses what part of the target specification corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, map)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - case 107868: /*map*/ return this.map == null ? new Base[0] : new Base[] {this.map}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -135761730: // identity - this.identity = castToId(value); // IdType - break; - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - case 107868: // map - this.map = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identity")) - this.identity = castToId(value); // IdType - else if (name.equals("language")) - this.language = castToCode(value); // CodeType - else if (name.equals("map")) - this.map = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -135761730: throw new FHIRException("Cannot make property identity as it is not a complex type"); // IdType - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - case 107868: throw new FHIRException("Cannot make property map as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identity")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.identity"); - } - else if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.language"); - } - else if (name.equals("map")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.map"); - } - else - return super.addChild(name); - } - - public ElementDefinitionMappingComponent copy() { - ElementDefinitionMappingComponent dst = new ElementDefinitionMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.language = language == null ? null : language.copy(); - dst.map = map == null ? null : map.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinitionMappingComponent)) - return false; - ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; - return compareDeep(identity, o.identity, true) && compareDeep(language, o.language, true) && compareDeep(map, o.map, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinitionMappingComponent)) - return false; - ElementDefinitionMappingComponent o = (ElementDefinitionMappingComponent) other; - return compareValues(identity, o.identity, true) && compareValues(language, o.language, true) && compareValues(map, o.map, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (language == null || language.isEmpty()) - && (map == null || map.isEmpty()); - } - - public String fhirType() { - return "ElementDefinition.mapping"; - - } - - } - - /** - * The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - @Child(name = "path", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The path of the element (see the Detailed Descriptions)", formalDefinition="The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension." ) - protected StringType path; - - /** - * Codes that define how this element is represented in instances, when the deviation varies from the normal case. - */ - @Child(name = "representation", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="xmlAttr | xmlText | typeAttr | cdaText", formalDefinition="Codes that define how this element is represented in instances, when the deviation varies from the normal case." ) - protected List> representation; - - /** - * The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name for this particular element definition (reference target)", formalDefinition="The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element." ) - protected StringType name; - - /** - * The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. - */ - @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name for element to display with or prompt for element", formalDefinition="The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form." ) - protected StringType label; - - /** - * A code that provides the meaning for the element according to a particular terminology. - */ - @Child(name = "code", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Defining code", formalDefinition="A code that provides the meaning for the element according to a particular terminology." ) - protected List code; - - /** - * Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set). - */ - @Child(name = "slicing", type = {}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="This element is sliced - slices follow", formalDefinition="Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set)." ) - protected ElementDefinitionSlicingComponent slicing; - - /** - * A concise description of what this element means (e.g. for use in autogenerated summaries). - */ - @Child(name = "short", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Concise definition for xml presentation", formalDefinition="A concise description of what this element means (e.g. for use in autogenerated summaries)." ) - protected StringType short_; - - /** - * Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - @Child(name = "definition", type = {MarkdownType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Full formal definition as narrative text", formalDefinition="Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource." ) - protected MarkdownType definition; - - /** - * Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - @Child(name = "comments", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Comments about the use of this element", formalDefinition="Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc." ) - protected MarkdownType comments; - - /** - * This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. - */ - @Child(name = "requirements", type = {MarkdownType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why this resource has been created", formalDefinition="This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element." ) - protected MarkdownType requirements; - - /** - * Identifies additional names by which this element might also be known. - */ - @Child(name = "alias", type = {StringType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other names", formalDefinition="Identifies additional names by which this element might also be known." ) - protected List alias; - - /** - * The minimum number of times this element SHALL appear in the instance. - */ - @Child(name = "min", type = {IntegerType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this element SHALL appear in the instance." ) - protected IntegerType min; - - /** - * The maximum number of times this element is permitted to appear in the instance. - */ - @Child(name = "max", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the instance." ) - protected StringType max; - - /** - * Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition. - */ - @Child(name = "base", type = {}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Base definition information for tools", formalDefinition="Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition." ) - protected ElementDefinitionBaseComponent base; - - /** - * Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element. - */ - @Child(name = "contentReference", type = {UriType.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to definition of content for the element", formalDefinition="Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element." ) - protected UriType contentReference; - - /** - * The data type or resource that the value of this element is permitted to be. - */ - @Child(name = "type", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Data type and Profile for this element", formalDefinition="The data type or resource that the value of this element is permitted to be." ) - protected List type; - - /** - * The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false'). - */ - @Child(name = "defaultValue", type = {}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specified value if missing from instance", formalDefinition="The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false')." ) - protected org.hl7.fhir.dstu2016may.model.Type defaultValue; - - /** - * The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'. - */ - @Child(name = "meaningWhenMissing", type = {MarkdownType.class}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Implicit meaning when this element is missing", formalDefinition="The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'." ) - protected MarkdownType meaningWhenMissing; - - /** - * Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing. - */ - @Child(name = "fixed", type = {}, order=18, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Value must be exactly this", formalDefinition="Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing." ) - protected org.hl7.fhir.dstu2016may.model.Type fixed; - - /** - * Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.). - */ - @Child(name = "pattern", type = {}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Value must have at least these property values", formalDefinition="Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.)." ) - protected org.hl7.fhir.dstu2016may.model.Type pattern; - - /** - * A sample value for this element demonstrating the type of information that would typically be captured. - */ - @Child(name = "example", type = {}, order=20, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Example value (as defined for type)", formalDefinition="A sample value for this element demonstrating the type of information that would typically be captured." ) - protected org.hl7.fhir.dstu2016may.model.Type example; - - /** - * The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. - */ - @Child(name = "minValue", type = {}, order=21, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Minimum Allowed Value (for some types)", formalDefinition="The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity." ) - protected org.hl7.fhir.dstu2016may.model.Type minValue; - - /** - * The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity. - */ - @Child(name = "maxValue", type = {}, order=22, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Maximum Allowed Value (for some types)", formalDefinition="The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity." ) - protected org.hl7.fhir.dstu2016may.model.Type maxValue; - - /** - * Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - @Child(name = "maxLength", type = {IntegerType.class}, order=23, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Max length for strings", formalDefinition="Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element." ) - protected IntegerType maxLength; - - /** - * A reference to an invariant that may make additional statements about the cardinality or value in the instance. - */ - @Child(name = "condition", type = {IdType.class}, order=24, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reference to invariant about presence", formalDefinition="A reference to an invariant that may make additional statements about the cardinality or value in the instance." ) - protected List condition; - - /** - * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance. - */ - @Child(name = "constraint", type = {}, order=25, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Condition that must evaluate to true", formalDefinition="Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance." ) - protected List constraint; - - /** - * If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. - */ - @Child(name = "mustSupport", type = {BooleanType.class}, order=26, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If the element must supported", formalDefinition="If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way. If false, the element may be ignored and not supported." ) - protected BooleanType mustSupport; - - /** - * If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - @Child(name = "isModifier", type = {BooleanType.class}, order=27, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If this modifies the meaning of other elements", formalDefinition="If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system." ) - protected BooleanType isModifier; - - /** - * Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - @Child(name = "isSummary", type = {BooleanType.class}, order=28, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include when _summary = true?", formalDefinition="Whether the element should be included if a client requests a search with the parameter _summary=true." ) - protected BooleanType isSummary; - - /** - * Binds to a value set if this element is coded (code, Coding, CodeableConcept). - */ - @Child(name = "binding", type = {}, order=29, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this element is coded (code, Coding, CodeableConcept)." ) - protected ElementDefinitionBindingComponent binding; - - /** - * Identifies a concept from an external specification that roughly corresponds to this element. - */ - @Child(name = "mapping", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Map element to another set of definitions", formalDefinition="Identifies a concept from an external specification that roughly corresponds to this element." ) - protected List mapping; - - private static final long serialVersionUID = -904637873L; - - /** - * Constructor - */ - public ElementDefinition() { - super(); - } - - /** - * Constructor - */ - public ElementDefinition(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ElementDefinition setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The path identifies the element and is expressed as a "."-separated list of ancestor elements, beginning with the name of the resource or extension. - */ - public ElementDefinition setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public List> getRepresentation() { - if (this.representation == null) - this.representation = new ArrayList>(); - return this.representation; - } - - public boolean hasRepresentation() { - if (this.representation == null) - return false; - for (Enumeration item : this.representation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - // syntactic sugar - public Enumeration addRepresentationElement() {//2 - Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); - if (this.representation == null) - this.representation = new ArrayList>(); - this.representation.add(t); - return t; - } - - /** - * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public ElementDefinition addRepresentation(PropertyRepresentation value) { //1 - Enumeration t = new Enumeration(new PropertyRepresentationEnumFactory()); - t.setValue(value); - if (this.representation == null) - this.representation = new ArrayList>(); - this.representation.add(t); - return this; - } - - /** - * @param value {@link #representation} (Codes that define how this element is represented in instances, when the deviation varies from the normal case.) - */ - public boolean hasRepresentation(PropertyRepresentation value) { - if (this.representation == null) - return false; - for (Enumeration v : this.representation) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #name} (The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ElementDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element. - */ - public ElementDefinition setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); // bb - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public ElementDefinition setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form. - */ - public ElementDefinition setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A code that provides the meaning for the element according to a particular terminology.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addCode(Coding t) { //3 - if (t == null) - return this; - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return this; - } - - /** - * @return {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) - */ - public ElementDefinitionSlicingComponent getSlicing() { - if (this.slicing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.slicing"); - else if (Configuration.doAutoCreate()) - this.slicing = new ElementDefinitionSlicingComponent(); // cc - return this.slicing; - } - - public boolean hasSlicing() { - return this.slicing != null && !this.slicing.isEmpty(); - } - - /** - * @param value {@link #slicing} (Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).) - */ - public ElementDefinition setSlicing(ElementDefinitionSlicingComponent value) { - this.slicing = value; - return this; - } - - /** - * @return {@link #short_} (A concise description of what this element means (e.g. for use in autogenerated summaries).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value - */ - public StringType getShortElement() { - if (this.short_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.short_"); - else if (Configuration.doAutoCreate()) - this.short_ = new StringType(); // bb - return this.short_; - } - - public boolean hasShortElement() { - return this.short_ != null && !this.short_.isEmpty(); - } - - public boolean hasShort() { - return this.short_ != null && !this.short_.isEmpty(); - } - - /** - * @param value {@link #short_} (A concise description of what this element means (e.g. for use in autogenerated summaries).). This is the underlying object with id, value and extensions. The accessor "getShort" gives direct access to the value - */ - public ElementDefinition setShortElement(StringType value) { - this.short_ = value; - return this; - } - - /** - * @return A concise description of what this element means (e.g. for use in autogenerated summaries). - */ - public String getShort() { - return this.short_ == null ? null : this.short_.getValue(); - } - - /** - * @param value A concise description of what this element means (e.g. for use in autogenerated summaries). - */ - public ElementDefinition setShort(String value) { - if (Utilities.noString(value)) - this.short_ = null; - else { - if (this.short_ == null) - this.short_ = new StringType(); - this.short_.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public MarkdownType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new MarkdownType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public ElementDefinition setDefinitionElement(MarkdownType value) { - this.definition = value; - return this; - } - - /** - * @return Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource. - */ - public ElementDefinition setDefinition(String value) { - if (value == null) - this.definition = null; - else { - if (this.definition == null) - this.definition = new MarkdownType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public MarkdownType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new MarkdownType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public ElementDefinition setCommentsElement(MarkdownType value) { - this.comments = value; - return this; - } - - /** - * @return Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc. - */ - public ElementDefinition setComments(String value) { - if (value == null) - this.comments = null; - else { - if (this.comments == null) - this.comments = new MarkdownType(); - this.comments.setValue(value); - } - return this; - } - - /** - * @return {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public MarkdownType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new MarkdownType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ElementDefinition setRequirementsElement(MarkdownType value) { - this.requirements = value; - return this; - } - - /** - * @return This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element. - */ - public ElementDefinition setRequirements(String value) { - if (value == null) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new MarkdownType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #alias} (Identifies additional names by which this element might also be known.) - */ - public List getAlias() { - if (this.alias == null) - this.alias = new ArrayList(); - return this.alias; - } - - public boolean hasAlias() { - if (this.alias == null) - return false; - for (StringType item : this.alias) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #alias} (Identifies additional names by which this element might also be known.) - */ - // syntactic sugar - public StringType addAliasElement() {//2 - StringType t = new StringType(); - if (this.alias == null) - this.alias = new ArrayList(); - this.alias.add(t); - return t; - } - - /** - * @param value {@link #alias} (Identifies additional names by which this element might also be known.) - */ - public ElementDefinition addAlias(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.alias == null) - this.alias = new ArrayList(); - this.alias.add(t); - return this; - } - - /** - * @param value {@link #alias} (Identifies additional names by which this element might also be known.) - */ - public boolean hasAlias(String value) { - if (this.alias == null) - return false; - for (StringType v : this.alias) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public IntegerType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.min"); - else if (Configuration.doAutoCreate()) - this.min = new IntegerType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (The minimum number of times this element SHALL appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public ElementDefinition setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this element SHALL appear in the instance. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value The minimum number of times this element SHALL appear in the instance. - */ - public ElementDefinition setMin(int value) { - if (this.min == null) - this.min = new IntegerType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (The maximum number of times this element is permitted to appear in the instance.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public ElementDefinition setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the instance. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value The maximum number of times this element is permitted to appear in the instance. - */ - public ElementDefinition setMax(String value) { - if (Utilities.noString(value)) - this.max = null; - else { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - } - return this; - } - - /** - * @return {@link #base} (Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition.) - */ - public ElementDefinitionBaseComponent getBase() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.base"); - else if (Configuration.doAutoCreate()) - this.base = new ElementDefinitionBaseComponent(); // cc - return this.base; - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition.) - */ - public ElementDefinition setBase(ElementDefinitionBaseComponent value) { - this.base = value; - return this; - } - - /** - * @return {@link #contentReference} (Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value - */ - public UriType getContentReferenceElement() { - if (this.contentReference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.contentReference"); - else if (Configuration.doAutoCreate()) - this.contentReference = new UriType(); // bb - return this.contentReference; - } - - public boolean hasContentReferenceElement() { - return this.contentReference != null && !this.contentReference.isEmpty(); - } - - public boolean hasContentReference() { - return this.contentReference != null && !this.contentReference.isEmpty(); - } - - /** - * @param value {@link #contentReference} (Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.). This is the underlying object with id, value and extensions. The accessor "getContentReference" gives direct access to the value - */ - public ElementDefinition setContentReferenceElement(UriType value) { - this.contentReference = value; - return this; - } - - /** - * @return Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element. - */ - public String getContentReference() { - return this.contentReference == null ? null : this.contentReference.getValue(); - } - - /** - * @param value Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element. - */ - public ElementDefinition setContentReference(String value) { - if (Utilities.noString(value)) - this.contentReference = null; - else { - if (this.contentReference == null) - this.contentReference = new UriType(); - this.contentReference.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (TypeRefComponent item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The data type or resource that the value of this element is permitted to be.) - */ - // syntactic sugar - public TypeRefComponent addType() { //3 - TypeRefComponent t = new TypeRefComponent(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addType(TypeRefComponent t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #defaultValue} (The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').) - */ - public org.hl7.fhir.dstu2016may.model.Type getDefaultValue() { - return this.defaultValue; - } - - public boolean hasDefaultValue() { - return this.defaultValue != null && !this.defaultValue.isEmpty(); - } - - /** - * @param value {@link #defaultValue} (The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').) - */ - public ElementDefinition setDefaultValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.defaultValue = value; - return this; - } - - /** - * @return {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value - */ - public MarkdownType getMeaningWhenMissingElement() { - if (this.meaningWhenMissing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.meaningWhenMissing"); - else if (Configuration.doAutoCreate()) - this.meaningWhenMissing = new MarkdownType(); // bb - return this.meaningWhenMissing; - } - - public boolean hasMeaningWhenMissingElement() { - return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); - } - - public boolean hasMeaningWhenMissing() { - return this.meaningWhenMissing != null && !this.meaningWhenMissing.isEmpty(); - } - - /** - * @param value {@link #meaningWhenMissing} (The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.). This is the underlying object with id, value and extensions. The accessor "getMeaningWhenMissing" gives direct access to the value - */ - public ElementDefinition setMeaningWhenMissingElement(MarkdownType value) { - this.meaningWhenMissing = value; - return this; - } - - /** - * @return The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'. - */ - public String getMeaningWhenMissing() { - return this.meaningWhenMissing == null ? null : this.meaningWhenMissing.getValue(); - } - - /** - * @param value The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'. - */ - public ElementDefinition setMeaningWhenMissing(String value) { - if (value == null) - this.meaningWhenMissing = null; - else { - if (this.meaningWhenMissing == null) - this.meaningWhenMissing = new MarkdownType(); - this.meaningWhenMissing.setValue(value); - } - return this; - } - - /** - * @return {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) - */ - public org.hl7.fhir.dstu2016may.model.Type getFixed() { - return this.fixed; - } - - public boolean hasFixed() { - return this.fixed != null && !this.fixed.isEmpty(); - } - - /** - * @param value {@link #fixed} (Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.) - */ - public ElementDefinition setFixed(org.hl7.fhir.dstu2016may.model.Type value) { - this.fixed = value; - return this; - } - - /** - * @return {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).) - */ - public org.hl7.fhir.dstu2016may.model.Type getPattern() { - return this.pattern; - } - - public boolean hasPattern() { - return this.pattern != null && !this.pattern.isEmpty(); - } - - /** - * @param value {@link #pattern} (Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).) - */ - public ElementDefinition setPattern(org.hl7.fhir.dstu2016may.model.Type value) { - this.pattern = value; - return this; - } - - /** - * @return {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) - */ - public org.hl7.fhir.dstu2016may.model.Type getExample() { - return this.example; - } - - public boolean hasExample() { - return this.example != null && !this.example.isEmpty(); - } - - /** - * @param value {@link #example} (A sample value for this element demonstrating the type of information that would typically be captured.) - */ - public ElementDefinition setExample(org.hl7.fhir.dstu2016may.model.Type value) { - this.example = value; - return this; - } - - /** - * @return {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) - */ - public org.hl7.fhir.dstu2016may.model.Type getMinValue() { - return this.minValue; - } - - public boolean hasMinValue() { - return this.minValue != null && !this.minValue.isEmpty(); - } - - /** - * @param value {@link #minValue} (The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) - */ - public ElementDefinition setMinValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.minValue = value; - return this; - } - - /** - * @return {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) - */ - public org.hl7.fhir.dstu2016may.model.Type getMaxValue() { - return this.maxValue; - } - - public boolean hasMaxValue() { - return this.maxValue != null && !this.maxValue.isEmpty(); - } - - /** - * @param value {@link #maxValue} (The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.) - */ - public ElementDefinition setMaxValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.maxValue = value; - return this; - } - - /** - * @return {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public IntegerType getMaxLengthElement() { - if (this.maxLength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.maxLength"); - else if (Configuration.doAutoCreate()) - this.maxLength = new IntegerType(); // bb - return this.maxLength; - } - - public boolean hasMaxLengthElement() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - public boolean hasMaxLength() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - /** - * @param value {@link #maxLength} (Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public ElementDefinition setMaxLengthElement(IntegerType value) { - this.maxLength = value; - return this; - } - - /** - * @return Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - public int getMaxLength() { - return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue(); - } - - /** - * @param value Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element. - */ - public ElementDefinition setMaxLength(int value) { - if (this.maxLength == null) - this.maxLength = new IntegerType(); - this.maxLength.setValue(value); - return this; - } - - /** - * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (IdType item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - // syntactic sugar - public IdType addConditionElement() {//2 - IdType t = new IdType(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - /** - * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public ElementDefinition addCondition(String value) { //1 - IdType t = new IdType(); - t.setValue(value); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - /** - * @param value {@link #condition} (A reference to an invariant that may make additional statements about the cardinality or value in the instance.) - */ - public boolean hasCondition(String value) { - if (this.condition == null) - return false; - for (IdType v : this.condition) - if (v.equals(value)) // id - return true; - return false; - } - - /** - * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) - */ - public List getConstraint() { - if (this.constraint == null) - this.constraint = new ArrayList(); - return this.constraint; - } - - public boolean hasConstraint() { - if (this.constraint == null) - return false; - for (ElementDefinitionConstraintComponent item : this.constraint) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #constraint} (Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.) - */ - // syntactic sugar - public ElementDefinitionConstraintComponent addConstraint() { //3 - ElementDefinitionConstraintComponent t = new ElementDefinitionConstraintComponent(); - if (this.constraint == null) - this.constraint = new ArrayList(); - this.constraint.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addConstraint(ElementDefinitionConstraintComponent t) { //3 - if (t == null) - return this; - if (this.constraint == null) - this.constraint = new ArrayList(); - this.constraint.add(t); - return this; - } - - /** - * @return {@link #mustSupport} (If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value - */ - public BooleanType getMustSupportElement() { - if (this.mustSupport == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.mustSupport"); - else if (Configuration.doAutoCreate()) - this.mustSupport = new BooleanType(); // bb - return this.mustSupport; - } - - public boolean hasMustSupportElement() { - return this.mustSupport != null && !this.mustSupport.isEmpty(); - } - - public boolean hasMustSupport() { - return this.mustSupport != null && !this.mustSupport.isEmpty(); - } - - /** - * @param value {@link #mustSupport} (If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported.). This is the underlying object with id, value and extensions. The accessor "getMustSupport" gives direct access to the value - */ - public ElementDefinition setMustSupportElement(BooleanType value) { - this.mustSupport = value; - return this; - } - - /** - * @return If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. - */ - public boolean getMustSupport() { - return this.mustSupport == null || this.mustSupport.isEmpty() ? false : this.mustSupport.getValue(); - } - - /** - * @param value If true, implementations that produce or consume resources SHALL provide "support" for the element in some meaningful way. If false, the element may be ignored and not supported. - */ - public ElementDefinition setMustSupport(boolean value) { - if (this.mustSupport == null) - this.mustSupport = new BooleanType(); - this.mustSupport.setValue(value); - return this; - } - - /** - * @return {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value - */ - public BooleanType getIsModifierElement() { - if (this.isModifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.isModifier"); - else if (Configuration.doAutoCreate()) - this.isModifier = new BooleanType(); // bb - return this.isModifier; - } - - public boolean hasIsModifierElement() { - return this.isModifier != null && !this.isModifier.isEmpty(); - } - - public boolean hasIsModifier() { - return this.isModifier != null && !this.isModifier.isEmpty(); - } - - /** - * @param value {@link #isModifier} (If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.). This is the underlying object with id, value and extensions. The accessor "getIsModifier" gives direct access to the value - */ - public ElementDefinition setIsModifierElement(BooleanType value) { - this.isModifier = value; - return this; - } - - /** - * @return If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - public boolean getIsModifier() { - return this.isModifier == null || this.isModifier.isEmpty() ? false : this.isModifier.getValue(); - } - - /** - * @param value If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system. - */ - public ElementDefinition setIsModifier(boolean value) { - if (this.isModifier == null) - this.isModifier = new BooleanType(); - this.isModifier.setValue(value); - return this; - } - - /** - * @return {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value - */ - public BooleanType getIsSummaryElement() { - if (this.isSummary == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.isSummary"); - else if (Configuration.doAutoCreate()) - this.isSummary = new BooleanType(); // bb - return this.isSummary; - } - - public boolean hasIsSummaryElement() { - return this.isSummary != null && !this.isSummary.isEmpty(); - } - - public boolean hasIsSummary() { - return this.isSummary != null && !this.isSummary.isEmpty(); - } - - /** - * @param value {@link #isSummary} (Whether the element should be included if a client requests a search with the parameter _summary=true.). This is the underlying object with id, value and extensions. The accessor "getIsSummary" gives direct access to the value - */ - public ElementDefinition setIsSummaryElement(BooleanType value) { - this.isSummary = value; - return this; - } - - /** - * @return Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - public boolean getIsSummary() { - return this.isSummary == null || this.isSummary.isEmpty() ? false : this.isSummary.getValue(); - } - - /** - * @param value Whether the element should be included if a client requests a search with the parameter _summary=true. - */ - public ElementDefinition setIsSummary(boolean value) { - if (this.isSummary == null) - this.isSummary = new BooleanType(); - this.isSummary.setValue(value); - return this; - } - - /** - * @return {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public ElementDefinitionBindingComponent getBinding() { - if (this.binding == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ElementDefinition.binding"); - else if (Configuration.doAutoCreate()) - this.binding = new ElementDefinitionBindingComponent(); // cc - return this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Binds to a value set if this element is coded (code, Coding, CodeableConcept).) - */ - public ElementDefinition setBinding(ElementDefinitionBindingComponent value) { - this.binding = value; - return this; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (ElementDefinitionMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (Identifies a concept from an external specification that roughly corresponds to this element.) - */ - // syntactic sugar - public ElementDefinitionMappingComponent addMapping() { //3 - ElementDefinitionMappingComponent t = new ElementDefinitionMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - // syntactic sugar - public ElementDefinition addMapping(ElementDefinitionMappingComponent t) { //3 - if (t == null) - return this; - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The path identifies the element and is expressed as a \".\"-separated list of ancestor elements, beginning with the name of the resource or extension.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("representation", "code", "Codes that define how this element is represented in instances, when the deviation varies from the normal case.", 0, java.lang.Integer.MAX_VALUE, representation)); - childrenList.add(new Property("name", "string", "The name of this element definition. This is a unique name referring to a specific set of constraints applied to this element, used to provide a name to different slices of the same element.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("label", "string", "The text to display beside the element indicating its meaning or to use to prompt for the element in a user display or form.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("code", "Coding", "A code that provides the meaning for the element according to a particular terminology.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("slicing", "", "Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path terminates the set).", 0, java.lang.Integer.MAX_VALUE, slicing)); - childrenList.add(new Property("short", "string", "A concise description of what this element means (e.g. for use in autogenerated summaries).", 0, java.lang.Integer.MAX_VALUE, short_)); - childrenList.add(new Property("definition", "markdown", "Provides a complete explanation of the meaning of the data element for human readability. For the case of elements derived from existing elements (e.g. constraints), the definition SHALL be consistent with the base definition, but convey the meaning of the element in the particular context of use of the resource.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("comments", "markdown", "Explanatory notes and implementation guidance about the data element, including notes about how to use the data properly, exceptions to proper use, etc.", 0, java.lang.Integer.MAX_VALUE, comments)); - childrenList.add(new Property("requirements", "markdown", "This element is for traceability of why the element was created and why the constraints exist as they do. This may be used to point to source materials or specifications that drove the structure of this element.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("alias", "string", "Identifies additional names by which this element might also be known.", 0, java.lang.Integer.MAX_VALUE, alias)); - childrenList.add(new Property("min", "integer", "The minimum number of times this element SHALL appear in the instance.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the instance.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("base", "", "Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation of the element through the derived and related profiles. This information is only provided where the element definition represents a constraint on another element definition, and must be present if there is a base element definition.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("contentReference", "uri", "Identifies the identity of an element defined elsewhere in the profile whose content rules should be applied to the current element.", 0, java.lang.Integer.MAX_VALUE, contentReference)); - childrenList.add(new Property("type", "", "The data type or resource that the value of this element is permitted to be.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("defaultValue[x]", "*", "The value that should be used if there is no value stated in the instance (e.g. 'if not otherwise specified, the abstract is false').", 0, java.lang.Integer.MAX_VALUE, defaultValue)); - childrenList.add(new Property("meaningWhenMissing", "markdown", "The Implicit meaning that is to be understood when this element is missing (e.g. 'when this element is missing, the period is ongoing'.", 0, java.lang.Integer.MAX_VALUE, meaningWhenMissing)); - childrenList.add(new Property("fixed[x]", "*", "Specifies a value that SHALL be exactly the value for this element in the instance. For purposes of comparison, non-significant whitespace is ignored, and all values must be an exact match (case and accent sensitive). Missing elements/attributes must also be missing.", 0, java.lang.Integer.MAX_VALUE, fixed)); - childrenList.add(new Property("pattern[x]", "*", "Specifies a value that the value in the instance SHALL follow - that is, any value in the pattern must be found in the instance. Other additional values may be found too. This is effectively constraint by example. The values of elements present in the pattern must match exactly (case-sensitive, accent-sensitive, etc.).", 0, java.lang.Integer.MAX_VALUE, pattern)); - childrenList.add(new Property("example[x]", "*", "A sample value for this element demonstrating the type of information that would typically be captured.", 0, java.lang.Integer.MAX_VALUE, example)); - childrenList.add(new Property("minValue[x]", "*", "The minimum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, java.lang.Integer.MAX_VALUE, minValue)); - childrenList.add(new Property("maxValue[x]", "*", "The maximum allowed value for the element. The value is inclusive. This is allowed for the types date, dateTime, instant, time, decimal, integer, and Quantity.", 0, java.lang.Integer.MAX_VALUE, maxValue)); - childrenList.add(new Property("maxLength", "integer", "Indicates the maximum length in characters that is permitted to be present in conformant instances and which is expected to be supported by conformant consumers that support the element.", 0, java.lang.Integer.MAX_VALUE, maxLength)); - childrenList.add(new Property("condition", "id", "A reference to an invariant that may make additional statements about the cardinality or value in the instance.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("constraint", "", "Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context of the instance.", 0, java.lang.Integer.MAX_VALUE, constraint)); - childrenList.add(new Property("mustSupport", "boolean", "If true, implementations that produce or consume resources SHALL provide \"support\" for the element in some meaningful way. If false, the element may be ignored and not supported.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); - childrenList.add(new Property("isModifier", "boolean", "If true, the value of this element affects the interpretation of the element or resource that contains it, and the value of the element cannot be ignored. Typically, this is used for status, negation and qualification codes. The effect of this is that the element cannot be ignored by systems: they SHALL either recognize the element and process it, and/or a pre-determination has been made that it is not relevant to their particular system.", 0, java.lang.Integer.MAX_VALUE, isModifier)); - childrenList.add(new Property("isSummary", "boolean", "Whether the element should be included if a client requests a search with the parameter _summary=true.", 0, java.lang.Integer.MAX_VALUE, isSummary)); - childrenList.add(new Property("binding", "", "Binds to a value set if this element is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding)); - childrenList.add(new Property("mapping", "", "Identifies a concept from an external specification that roughly corresponds to this element.", 0, java.lang.Integer.MAX_VALUE, mapping)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case -671065907: /*representation*/ return this.representation == null ? new Base[0] : this.representation.toArray(new Base[this.representation.size()]); // Enumeration - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding - case -2119287345: /*slicing*/ return this.slicing == null ? new Base[0] : new Base[] {this.slicing}; // ElementDefinitionSlicingComponent - case 109413500: /*short*/ return this.short_ == null ? new Base[0] : new Base[] {this.short_}; // StringType - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType - case -602415628: /*comments*/ return this.comments == null ? new Base[0] : new Base[] {this.comments}; // MarkdownType - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // MarkdownType - case 92902992: /*alias*/ return this.alias == null ? new Base[0] : this.alias.toArray(new Base[this.alias.size()]); // StringType - case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType - case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType - case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // ElementDefinitionBaseComponent - case 1193747154: /*contentReference*/ return this.contentReference == null ? new Base[0] : new Base[] {this.contentReference}; // UriType - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // TypeRefComponent - case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // org.hl7.fhir.dstu2016may.model.Type - case 1857257103: /*meaningWhenMissing*/ return this.meaningWhenMissing == null ? new Base[0] : new Base[] {this.meaningWhenMissing}; // MarkdownType - case 97445748: /*fixed*/ return this.fixed == null ? new Base[0] : new Base[] {this.fixed}; // org.hl7.fhir.dstu2016may.model.Type - case -791090288: /*pattern*/ return this.pattern == null ? new Base[0] : new Base[] {this.pattern}; // org.hl7.fhir.dstu2016may.model.Type - case -1322970774: /*example*/ return this.example == null ? new Base[0] : new Base[] {this.example}; // org.hl7.fhir.dstu2016may.model.Type - case -1376969153: /*minValue*/ return this.minValue == null ? new Base[0] : new Base[] {this.minValue}; // org.hl7.fhir.dstu2016may.model.Type - case 399227501: /*maxValue*/ return this.maxValue == null ? new Base[0] : new Base[] {this.maxValue}; // org.hl7.fhir.dstu2016may.model.Type - case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // IdType - case -190376483: /*constraint*/ return this.constraint == null ? new Base[0] : this.constraint.toArray(new Base[this.constraint.size()]); // ElementDefinitionConstraintComponent - case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : new Base[] {this.mustSupport}; // BooleanType - case -1408783839: /*isModifier*/ return this.isModifier == null ? new Base[0] : new Base[] {this.isModifier}; // BooleanType - case 1857548060: /*isSummary*/ return this.isSummary == null ? new Base[0] : new Base[] {this.isSummary}; // BooleanType - case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // ElementDefinitionBindingComponent - case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // ElementDefinitionMappingComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case -671065907: // representation - this.getRepresentation().add(new PropertyRepresentationEnumFactory().fromType(value)); // Enumeration - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 102727412: // label - this.label = castToString(value); // StringType - break; - case 3059181: // code - this.getCode().add(castToCoding(value)); // Coding - break; - case -2119287345: // slicing - this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent - break; - case 109413500: // short - this.short_ = castToString(value); // StringType - break; - case -1014418093: // definition - this.definition = castToMarkdown(value); // MarkdownType - break; - case -602415628: // comments - this.comments = castToMarkdown(value); // MarkdownType - break; - case -1619874672: // requirements - this.requirements = castToMarkdown(value); // MarkdownType - break; - case 92902992: // alias - this.getAlias().add(castToString(value)); // StringType - break; - case 108114: // min - this.min = castToInteger(value); // IntegerType - break; - case 107876: // max - this.max = castToString(value); // StringType - break; - case 3016401: // base - this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent - break; - case 1193747154: // contentReference - this.contentReference = castToUri(value); // UriType - break; - case 3575610: // type - this.getType().add((TypeRefComponent) value); // TypeRefComponent - break; - case -659125328: // defaultValue - this.defaultValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case 1857257103: // meaningWhenMissing - this.meaningWhenMissing = castToMarkdown(value); // MarkdownType - break; - case 97445748: // fixed - this.fixed = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case -791090288: // pattern - this.pattern = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case -1322970774: // example - this.example = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case -1376969153: // minValue - this.minValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case 399227501: // maxValue - this.maxValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case -791400086: // maxLength - this.maxLength = castToInteger(value); // IntegerType - break; - case -861311717: // condition - this.getCondition().add(castToId(value)); // IdType - break; - case -190376483: // constraint - this.getConstraint().add((ElementDefinitionConstraintComponent) value); // ElementDefinitionConstraintComponent - break; - case -1402857082: // mustSupport - this.mustSupport = castToBoolean(value); // BooleanType - break; - case -1408783839: // isModifier - this.isModifier = castToBoolean(value); // BooleanType - break; - case 1857548060: // isSummary - this.isSummary = castToBoolean(value); // BooleanType - break; - case -108220795: // binding - this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent - break; - case 837556430: // mapping - this.getMapping().add((ElementDefinitionMappingComponent) value); // ElementDefinitionMappingComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("representation")) - this.getRepresentation().add(new PropertyRepresentationEnumFactory().fromType(value)); - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("label")) - this.label = castToString(value); // StringType - else if (name.equals("code")) - this.getCode().add(castToCoding(value)); - else if (name.equals("slicing")) - this.slicing = (ElementDefinitionSlicingComponent) value; // ElementDefinitionSlicingComponent - else if (name.equals("short")) - this.short_ = castToString(value); // StringType - else if (name.equals("definition")) - this.definition = castToMarkdown(value); // MarkdownType - else if (name.equals("comments")) - this.comments = castToMarkdown(value); // MarkdownType - else if (name.equals("requirements")) - this.requirements = castToMarkdown(value); // MarkdownType - else if (name.equals("alias")) - this.getAlias().add(castToString(value)); - else if (name.equals("min")) - this.min = castToInteger(value); // IntegerType - else if (name.equals("max")) - this.max = castToString(value); // StringType - else if (name.equals("base")) - this.base = (ElementDefinitionBaseComponent) value; // ElementDefinitionBaseComponent - else if (name.equals("contentReference")) - this.contentReference = castToUri(value); // UriType - else if (name.equals("type")) - this.getType().add((TypeRefComponent) value); - else if (name.equals("defaultValue[x]")) - this.defaultValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("meaningWhenMissing")) - this.meaningWhenMissing = castToMarkdown(value); // MarkdownType - else if (name.equals("fixed[x]")) - this.fixed = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("pattern[x]")) - this.pattern = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("example[x]")) - this.example = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("minValue[x]")) - this.minValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("maxValue[x]")) - this.maxValue = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("maxLength")) - this.maxLength = castToInteger(value); // IntegerType - else if (name.equals("condition")) - this.getCondition().add(castToId(value)); - else if (name.equals("constraint")) - this.getConstraint().add((ElementDefinitionConstraintComponent) value); - else if (name.equals("mustSupport")) - this.mustSupport = castToBoolean(value); // BooleanType - else if (name.equals("isModifier")) - this.isModifier = castToBoolean(value); // BooleanType - else if (name.equals("isSummary")) - this.isSummary = castToBoolean(value); // BooleanType - else if (name.equals("binding")) - this.binding = (ElementDefinitionBindingComponent) value; // ElementDefinitionBindingComponent - else if (name.equals("mapping")) - this.getMapping().add((ElementDefinitionMappingComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -671065907: throw new FHIRException("Cannot make property representation as it is not a complex type"); // Enumeration - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType - case 3059181: return addCode(); // Coding - case -2119287345: return getSlicing(); // ElementDefinitionSlicingComponent - case 109413500: throw new FHIRException("Cannot make property short as it is not a complex type"); // StringType - case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // MarkdownType - case -602415628: throw new FHIRException("Cannot make property comments as it is not a complex type"); // MarkdownType - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // MarkdownType - case 92902992: throw new FHIRException("Cannot make property alias as it is not a complex type"); // StringType - case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType - case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType - case 3016401: return getBase(); // ElementDefinitionBaseComponent - case 1193747154: throw new FHIRException("Cannot make property contentReference as it is not a complex type"); // UriType - case 3575610: return addType(); // TypeRefComponent - case 587922128: return getDefaultValue(); // org.hl7.fhir.dstu2016may.model.Type - case 1857257103: throw new FHIRException("Cannot make property meaningWhenMissing as it is not a complex type"); // MarkdownType - case -391522164: return getFixed(); // org.hl7.fhir.dstu2016may.model.Type - case -885125392: return getPattern(); // org.hl7.fhir.dstu2016may.model.Type - case -2002328874: return getExample(); // org.hl7.fhir.dstu2016may.model.Type - case -55301663: return getMinValue(); // org.hl7.fhir.dstu2016may.model.Type - case 622130931: return getMaxValue(); // org.hl7.fhir.dstu2016may.model.Type - case -791400086: throw new FHIRException("Cannot make property maxLength as it is not a complex type"); // IntegerType - case -861311717: throw new FHIRException("Cannot make property condition as it is not a complex type"); // IdType - case -190376483: return addConstraint(); // ElementDefinitionConstraintComponent - case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // BooleanType - case -1408783839: throw new FHIRException("Cannot make property isModifier as it is not a complex type"); // BooleanType - case 1857548060: throw new FHIRException("Cannot make property isSummary as it is not a complex type"); // BooleanType - case -108220795: return getBinding(); // ElementDefinitionBindingComponent - case 837556430: return addMapping(); // ElementDefinitionMappingComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.path"); - } - else if (name.equals("representation")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.representation"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.name"); - } - else if (name.equals("label")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.label"); - } - else if (name.equals("code")) { - return addCode(); - } - else if (name.equals("slicing")) { - this.slicing = new ElementDefinitionSlicingComponent(); - return this.slicing; - } - else if (name.equals("short")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.short"); - } - else if (name.equals("definition")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.definition"); - } - else if (name.equals("comments")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.comments"); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.requirements"); - } - else if (name.equals("alias")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.alias"); - } - else if (name.equals("min")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.min"); - } - else if (name.equals("max")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.max"); - } - else if (name.equals("base")) { - this.base = new ElementDefinitionBaseComponent(); - return this.base; - } - else if (name.equals("contentReference")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.contentReference"); - } - else if (name.equals("type")) { - return addType(); - } - else if (name.equals("defaultValueBoolean")) { - this.defaultValue = new BooleanType(); - return this.defaultValue; - } - else if (name.equals("defaultValueInteger")) { - this.defaultValue = new IntegerType(); - return this.defaultValue; - } - else if (name.equals("defaultValueDecimal")) { - this.defaultValue = new DecimalType(); - return this.defaultValue; - } - else if (name.equals("defaultValueBase64Binary")) { - this.defaultValue = new Base64BinaryType(); - return this.defaultValue; - } - else if (name.equals("defaultValueInstant")) { - this.defaultValue = new InstantType(); - return this.defaultValue; - } - else if (name.equals("defaultValueString")) { - this.defaultValue = new StringType(); - return this.defaultValue; - } - else if (name.equals("defaultValueUri")) { - this.defaultValue = new UriType(); - return this.defaultValue; - } - else if (name.equals("defaultValueDate")) { - this.defaultValue = new DateType(); - return this.defaultValue; - } - else if (name.equals("defaultValueDateTime")) { - this.defaultValue = new DateTimeType(); - return this.defaultValue; - } - else if (name.equals("defaultValueTime")) { - this.defaultValue = new TimeType(); - return this.defaultValue; - } - else if (name.equals("defaultValueCode")) { - this.defaultValue = new CodeType(); - return this.defaultValue; - } - else if (name.equals("defaultValueOid")) { - this.defaultValue = new OidType(); - return this.defaultValue; - } - else if (name.equals("defaultValueId")) { - this.defaultValue = new IdType(); - return this.defaultValue; - } - else if (name.equals("defaultValueUnsignedInt")) { - this.defaultValue = new UnsignedIntType(); - return this.defaultValue; - } - else if (name.equals("defaultValuePositiveInt")) { - this.defaultValue = new PositiveIntType(); - return this.defaultValue; - } - else if (name.equals("defaultValueMarkdown")) { - this.defaultValue = new MarkdownType(); - return this.defaultValue; - } - else if (name.equals("defaultValueAnnotation")) { - this.defaultValue = new Annotation(); - return this.defaultValue; - } - else if (name.equals("defaultValueAttachment")) { - this.defaultValue = new Attachment(); - return this.defaultValue; - } - else if (name.equals("defaultValueIdentifier")) { - this.defaultValue = new Identifier(); - return this.defaultValue; - } - else if (name.equals("defaultValueCodeableConcept")) { - this.defaultValue = new CodeableConcept(); - return this.defaultValue; - } - else if (name.equals("defaultValueCoding")) { - this.defaultValue = new Coding(); - return this.defaultValue; - } - else if (name.equals("defaultValueQuantity")) { - this.defaultValue = new Quantity(); - return this.defaultValue; - } - else if (name.equals("defaultValueRange")) { - this.defaultValue = new Range(); - return this.defaultValue; - } - else if (name.equals("defaultValuePeriod")) { - this.defaultValue = new Period(); - return this.defaultValue; - } - else if (name.equals("defaultValueRatio")) { - this.defaultValue = new Ratio(); - return this.defaultValue; - } - else if (name.equals("defaultValueSampledData")) { - this.defaultValue = new SampledData(); - return this.defaultValue; - } - else if (name.equals("defaultValueSignature")) { - this.defaultValue = new Signature(); - return this.defaultValue; - } - else if (name.equals("defaultValueHumanName")) { - this.defaultValue = new HumanName(); - return this.defaultValue; - } - else if (name.equals("defaultValueAddress")) { - this.defaultValue = new Address(); - return this.defaultValue; - } - else if (name.equals("defaultValueContactPoint")) { - this.defaultValue = new ContactPoint(); - return this.defaultValue; - } - else if (name.equals("defaultValueTiming")) { - this.defaultValue = new Timing(); - return this.defaultValue; - } - else if (name.equals("defaultValueReference")) { - this.defaultValue = new Reference(); - return this.defaultValue; - } - else if (name.equals("defaultValueMeta")) { - this.defaultValue = new Meta(); - return this.defaultValue; - } - else if (name.equals("meaningWhenMissing")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.meaningWhenMissing"); - } - else if (name.equals("fixedBoolean")) { - this.fixed = new BooleanType(); - return this.fixed; - } - else if (name.equals("fixedInteger")) { - this.fixed = new IntegerType(); - return this.fixed; - } - else if (name.equals("fixedDecimal")) { - this.fixed = new DecimalType(); - return this.fixed; - } - else if (name.equals("fixedBase64Binary")) { - this.fixed = new Base64BinaryType(); - return this.fixed; - } - else if (name.equals("fixedInstant")) { - this.fixed = new InstantType(); - return this.fixed; - } - else if (name.equals("fixedString")) { - this.fixed = new StringType(); - return this.fixed; - } - else if (name.equals("fixedUri")) { - this.fixed = new UriType(); - return this.fixed; - } - else if (name.equals("fixedDate")) { - this.fixed = new DateType(); - return this.fixed; - } - else if (name.equals("fixedDateTime")) { - this.fixed = new DateTimeType(); - return this.fixed; - } - else if (name.equals("fixedTime")) { - this.fixed = new TimeType(); - return this.fixed; - } - else if (name.equals("fixedCode")) { - this.fixed = new CodeType(); - return this.fixed; - } - else if (name.equals("fixedOid")) { - this.fixed = new OidType(); - return this.fixed; - } - else if (name.equals("fixedId")) { - this.fixed = new IdType(); - return this.fixed; - } - else if (name.equals("fixedUnsignedInt")) { - this.fixed = new UnsignedIntType(); - return this.fixed; - } - else if (name.equals("fixedPositiveInt")) { - this.fixed = new PositiveIntType(); - return this.fixed; - } - else if (name.equals("fixedMarkdown")) { - this.fixed = new MarkdownType(); - return this.fixed; - } - else if (name.equals("fixedAnnotation")) { - this.fixed = new Annotation(); - return this.fixed; - } - else if (name.equals("fixedAttachment")) { - this.fixed = new Attachment(); - return this.fixed; - } - else if (name.equals("fixedIdentifier")) { - this.fixed = new Identifier(); - return this.fixed; - } - else if (name.equals("fixedCodeableConcept")) { - this.fixed = new CodeableConcept(); - return this.fixed; - } - else if (name.equals("fixedCoding")) { - this.fixed = new Coding(); - return this.fixed; - } - else if (name.equals("fixedQuantity")) { - this.fixed = new Quantity(); - return this.fixed; - } - else if (name.equals("fixedRange")) { - this.fixed = new Range(); - return this.fixed; - } - else if (name.equals("fixedPeriod")) { - this.fixed = new Period(); - return this.fixed; - } - else if (name.equals("fixedRatio")) { - this.fixed = new Ratio(); - return this.fixed; - } - else if (name.equals("fixedSampledData")) { - this.fixed = new SampledData(); - return this.fixed; - } - else if (name.equals("fixedSignature")) { - this.fixed = new Signature(); - return this.fixed; - } - else if (name.equals("fixedHumanName")) { - this.fixed = new HumanName(); - return this.fixed; - } - else if (name.equals("fixedAddress")) { - this.fixed = new Address(); - return this.fixed; - } - else if (name.equals("fixedContactPoint")) { - this.fixed = new ContactPoint(); - return this.fixed; - } - else if (name.equals("fixedTiming")) { - this.fixed = new Timing(); - return this.fixed; - } - else if (name.equals("fixedReference")) { - this.fixed = new Reference(); - return this.fixed; - } - else if (name.equals("fixedMeta")) { - this.fixed = new Meta(); - return this.fixed; - } - else if (name.equals("patternBoolean")) { - this.pattern = new BooleanType(); - return this.pattern; - } - else if (name.equals("patternInteger")) { - this.pattern = new IntegerType(); - return this.pattern; - } - else if (name.equals("patternDecimal")) { - this.pattern = new DecimalType(); - return this.pattern; - } - else if (name.equals("patternBase64Binary")) { - this.pattern = new Base64BinaryType(); - return this.pattern; - } - else if (name.equals("patternInstant")) { - this.pattern = new InstantType(); - return this.pattern; - } - else if (name.equals("patternString")) { - this.pattern = new StringType(); - return this.pattern; - } - else if (name.equals("patternUri")) { - this.pattern = new UriType(); - return this.pattern; - } - else if (name.equals("patternDate")) { - this.pattern = new DateType(); - return this.pattern; - } - else if (name.equals("patternDateTime")) { - this.pattern = new DateTimeType(); - return this.pattern; - } - else if (name.equals("patternTime")) { - this.pattern = new TimeType(); - return this.pattern; - } - else if (name.equals("patternCode")) { - this.pattern = new CodeType(); - return this.pattern; - } - else if (name.equals("patternOid")) { - this.pattern = new OidType(); - return this.pattern; - } - else if (name.equals("patternId")) { - this.pattern = new IdType(); - return this.pattern; - } - else if (name.equals("patternUnsignedInt")) { - this.pattern = new UnsignedIntType(); - return this.pattern; - } - else if (name.equals("patternPositiveInt")) { - this.pattern = new PositiveIntType(); - return this.pattern; - } - else if (name.equals("patternMarkdown")) { - this.pattern = new MarkdownType(); - return this.pattern; - } - else if (name.equals("patternAnnotation")) { - this.pattern = new Annotation(); - return this.pattern; - } - else if (name.equals("patternAttachment")) { - this.pattern = new Attachment(); - return this.pattern; - } - else if (name.equals("patternIdentifier")) { - this.pattern = new Identifier(); - return this.pattern; - } - else if (name.equals("patternCodeableConcept")) { - this.pattern = new CodeableConcept(); - return this.pattern; - } - else if (name.equals("patternCoding")) { - this.pattern = new Coding(); - return this.pattern; - } - else if (name.equals("patternQuantity")) { - this.pattern = new Quantity(); - return this.pattern; - } - else if (name.equals("patternRange")) { - this.pattern = new Range(); - return this.pattern; - } - else if (name.equals("patternPeriod")) { - this.pattern = new Period(); - return this.pattern; - } - else if (name.equals("patternRatio")) { - this.pattern = new Ratio(); - return this.pattern; - } - else if (name.equals("patternSampledData")) { - this.pattern = new SampledData(); - return this.pattern; - } - else if (name.equals("patternSignature")) { - this.pattern = new Signature(); - return this.pattern; - } - else if (name.equals("patternHumanName")) { - this.pattern = new HumanName(); - return this.pattern; - } - else if (name.equals("patternAddress")) { - this.pattern = new Address(); - return this.pattern; - } - else if (name.equals("patternContactPoint")) { - this.pattern = new ContactPoint(); - return this.pattern; - } - else if (name.equals("patternTiming")) { - this.pattern = new Timing(); - return this.pattern; - } - else if (name.equals("patternReference")) { - this.pattern = new Reference(); - return this.pattern; - } - else if (name.equals("patternMeta")) { - this.pattern = new Meta(); - return this.pattern; - } - else if (name.equals("exampleBoolean")) { - this.example = new BooleanType(); - return this.example; - } - else if (name.equals("exampleInteger")) { - this.example = new IntegerType(); - return this.example; - } - else if (name.equals("exampleDecimal")) { - this.example = new DecimalType(); - return this.example; - } - else if (name.equals("exampleBase64Binary")) { - this.example = new Base64BinaryType(); - return this.example; - } - else if (name.equals("exampleInstant")) { - this.example = new InstantType(); - return this.example; - } - else if (name.equals("exampleString")) { - this.example = new StringType(); - return this.example; - } - else if (name.equals("exampleUri")) { - this.example = new UriType(); - return this.example; - } - else if (name.equals("exampleDate")) { - this.example = new DateType(); - return this.example; - } - else if (name.equals("exampleDateTime")) { - this.example = new DateTimeType(); - return this.example; - } - else if (name.equals("exampleTime")) { - this.example = new TimeType(); - return this.example; - } - else if (name.equals("exampleCode")) { - this.example = new CodeType(); - return this.example; - } - else if (name.equals("exampleOid")) { - this.example = new OidType(); - return this.example; - } - else if (name.equals("exampleId")) { - this.example = new IdType(); - return this.example; - } - else if (name.equals("exampleUnsignedInt")) { - this.example = new UnsignedIntType(); - return this.example; - } - else if (name.equals("examplePositiveInt")) { - this.example = new PositiveIntType(); - return this.example; - } - else if (name.equals("exampleMarkdown")) { - this.example = new MarkdownType(); - return this.example; - } - else if (name.equals("exampleAnnotation")) { - this.example = new Annotation(); - return this.example; - } - else if (name.equals("exampleAttachment")) { - this.example = new Attachment(); - return this.example; - } - else if (name.equals("exampleIdentifier")) { - this.example = new Identifier(); - return this.example; - } - else if (name.equals("exampleCodeableConcept")) { - this.example = new CodeableConcept(); - return this.example; - } - else if (name.equals("exampleCoding")) { - this.example = new Coding(); - return this.example; - } - else if (name.equals("exampleQuantity")) { - this.example = new Quantity(); - return this.example; - } - else if (name.equals("exampleRange")) { - this.example = new Range(); - return this.example; - } - else if (name.equals("examplePeriod")) { - this.example = new Period(); - return this.example; - } - else if (name.equals("exampleRatio")) { - this.example = new Ratio(); - return this.example; - } - else if (name.equals("exampleSampledData")) { - this.example = new SampledData(); - return this.example; - } - else if (name.equals("exampleSignature")) { - this.example = new Signature(); - return this.example; - } - else if (name.equals("exampleHumanName")) { - this.example = new HumanName(); - return this.example; - } - else if (name.equals("exampleAddress")) { - this.example = new Address(); - return this.example; - } - else if (name.equals("exampleContactPoint")) { - this.example = new ContactPoint(); - return this.example; - } - else if (name.equals("exampleTiming")) { - this.example = new Timing(); - return this.example; - } - else if (name.equals("exampleReference")) { - this.example = new Reference(); - return this.example; - } - else if (name.equals("exampleMeta")) { - this.example = new Meta(); - return this.example; - } - else if (name.equals("minValueBoolean")) { - this.minValue = new BooleanType(); - return this.minValue; - } - else if (name.equals("minValueInteger")) { - this.minValue = new IntegerType(); - return this.minValue; - } - else if (name.equals("minValueDecimal")) { - this.minValue = new DecimalType(); - return this.minValue; - } - else if (name.equals("minValueBase64Binary")) { - this.minValue = new Base64BinaryType(); - return this.minValue; - } - else if (name.equals("minValueInstant")) { - this.minValue = new InstantType(); - return this.minValue; - } - else if (name.equals("minValueString")) { - this.minValue = new StringType(); - return this.minValue; - } - else if (name.equals("minValueUri")) { - this.minValue = new UriType(); - return this.minValue; - } - else if (name.equals("minValueDate")) { - this.minValue = new DateType(); - return this.minValue; - } - else if (name.equals("minValueDateTime")) { - this.minValue = new DateTimeType(); - return this.minValue; - } - else if (name.equals("minValueTime")) { - this.minValue = new TimeType(); - return this.minValue; - } - else if (name.equals("minValueCode")) { - this.minValue = new CodeType(); - return this.minValue; - } - else if (name.equals("minValueOid")) { - this.minValue = new OidType(); - return this.minValue; - } - else if (name.equals("minValueId")) { - this.minValue = new IdType(); - return this.minValue; - } - else if (name.equals("minValueUnsignedInt")) { - this.minValue = new UnsignedIntType(); - return this.minValue; - } - else if (name.equals("minValuePositiveInt")) { - this.minValue = new PositiveIntType(); - return this.minValue; - } - else if (name.equals("minValueMarkdown")) { - this.minValue = new MarkdownType(); - return this.minValue; - } - else if (name.equals("minValueAnnotation")) { - this.minValue = new Annotation(); - return this.minValue; - } - else if (name.equals("minValueAttachment")) { - this.minValue = new Attachment(); - return this.minValue; - } - else if (name.equals("minValueIdentifier")) { - this.minValue = new Identifier(); - return this.minValue; - } - else if (name.equals("minValueCodeableConcept")) { - this.minValue = new CodeableConcept(); - return this.minValue; - } - else if (name.equals("minValueCoding")) { - this.minValue = new Coding(); - return this.minValue; - } - else if (name.equals("minValueQuantity")) { - this.minValue = new Quantity(); - return this.minValue; - } - else if (name.equals("minValueRange")) { - this.minValue = new Range(); - return this.minValue; - } - else if (name.equals("minValuePeriod")) { - this.minValue = new Period(); - return this.minValue; - } - else if (name.equals("minValueRatio")) { - this.minValue = new Ratio(); - return this.minValue; - } - else if (name.equals("minValueSampledData")) { - this.minValue = new SampledData(); - return this.minValue; - } - else if (name.equals("minValueSignature")) { - this.minValue = new Signature(); - return this.minValue; - } - else if (name.equals("minValueHumanName")) { - this.minValue = new HumanName(); - return this.minValue; - } - else if (name.equals("minValueAddress")) { - this.minValue = new Address(); - return this.minValue; - } - else if (name.equals("minValueContactPoint")) { - this.minValue = new ContactPoint(); - return this.minValue; - } - else if (name.equals("minValueTiming")) { - this.minValue = new Timing(); - return this.minValue; - } - else if (name.equals("minValueReference")) { - this.minValue = new Reference(); - return this.minValue; - } - else if (name.equals("minValueMeta")) { - this.minValue = new Meta(); - return this.minValue; - } - else if (name.equals("maxValueBoolean")) { - this.maxValue = new BooleanType(); - return this.maxValue; - } - else if (name.equals("maxValueInteger")) { - this.maxValue = new IntegerType(); - return this.maxValue; - } - else if (name.equals("maxValueDecimal")) { - this.maxValue = new DecimalType(); - return this.maxValue; - } - else if (name.equals("maxValueBase64Binary")) { - this.maxValue = new Base64BinaryType(); - return this.maxValue; - } - else if (name.equals("maxValueInstant")) { - this.maxValue = new InstantType(); - return this.maxValue; - } - else if (name.equals("maxValueString")) { - this.maxValue = new StringType(); - return this.maxValue; - } - else if (name.equals("maxValueUri")) { - this.maxValue = new UriType(); - return this.maxValue; - } - else if (name.equals("maxValueDate")) { - this.maxValue = new DateType(); - return this.maxValue; - } - else if (name.equals("maxValueDateTime")) { - this.maxValue = new DateTimeType(); - return this.maxValue; - } - else if (name.equals("maxValueTime")) { - this.maxValue = new TimeType(); - return this.maxValue; - } - else if (name.equals("maxValueCode")) { - this.maxValue = new CodeType(); - return this.maxValue; - } - else if (name.equals("maxValueOid")) { - this.maxValue = new OidType(); - return this.maxValue; - } - else if (name.equals("maxValueId")) { - this.maxValue = new IdType(); - return this.maxValue; - } - else if (name.equals("maxValueUnsignedInt")) { - this.maxValue = new UnsignedIntType(); - return this.maxValue; - } - else if (name.equals("maxValuePositiveInt")) { - this.maxValue = new PositiveIntType(); - return this.maxValue; - } - else if (name.equals("maxValueMarkdown")) { - this.maxValue = new MarkdownType(); - return this.maxValue; - } - else if (name.equals("maxValueAnnotation")) { - this.maxValue = new Annotation(); - return this.maxValue; - } - else if (name.equals("maxValueAttachment")) { - this.maxValue = new Attachment(); - return this.maxValue; - } - else if (name.equals("maxValueIdentifier")) { - this.maxValue = new Identifier(); - return this.maxValue; - } - else if (name.equals("maxValueCodeableConcept")) { - this.maxValue = new CodeableConcept(); - return this.maxValue; - } - else if (name.equals("maxValueCoding")) { - this.maxValue = new Coding(); - return this.maxValue; - } - else if (name.equals("maxValueQuantity")) { - this.maxValue = new Quantity(); - return this.maxValue; - } - else if (name.equals("maxValueRange")) { - this.maxValue = new Range(); - return this.maxValue; - } - else if (name.equals("maxValuePeriod")) { - this.maxValue = new Period(); - return this.maxValue; - } - else if (name.equals("maxValueRatio")) { - this.maxValue = new Ratio(); - return this.maxValue; - } - else if (name.equals("maxValueSampledData")) { - this.maxValue = new SampledData(); - return this.maxValue; - } - else if (name.equals("maxValueSignature")) { - this.maxValue = new Signature(); - return this.maxValue; - } - else if (name.equals("maxValueHumanName")) { - this.maxValue = new HumanName(); - return this.maxValue; - } - else if (name.equals("maxValueAddress")) { - this.maxValue = new Address(); - return this.maxValue; - } - else if (name.equals("maxValueContactPoint")) { - this.maxValue = new ContactPoint(); - return this.maxValue; - } - else if (name.equals("maxValueTiming")) { - this.maxValue = new Timing(); - return this.maxValue; - } - else if (name.equals("maxValueReference")) { - this.maxValue = new Reference(); - return this.maxValue; - } - else if (name.equals("maxValueMeta")) { - this.maxValue = new Meta(); - return this.maxValue; - } - else if (name.equals("maxLength")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.maxLength"); - } - else if (name.equals("condition")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.condition"); - } - else if (name.equals("constraint")) { - return addConstraint(); - } - else if (name.equals("mustSupport")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.mustSupport"); - } - else if (name.equals("isModifier")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isModifier"); - } - else if (name.equals("isSummary")) { - throw new FHIRException("Cannot call addChild on a primitive type ElementDefinition.isSummary"); - } - else if (name.equals("binding")) { - this.binding = new ElementDefinitionBindingComponent(); - return this.binding; - } - else if (name.equals("mapping")) { - return addMapping(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ElementDefinition"; - - } - - public ElementDefinition copy() { - ElementDefinition dst = new ElementDefinition(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - if (representation != null) { - dst.representation = new ArrayList>(); - for (Enumeration i : representation) - dst.representation.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - dst.label = label == null ? null : label.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.slicing = slicing == null ? null : slicing.copy(); - dst.short_ = short_ == null ? null : short_.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.comments = comments == null ? null : comments.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - if (alias != null) { - dst.alias = new ArrayList(); - for (StringType i : alias) - dst.alias.add(i.copy()); - }; - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - dst.base = base == null ? null : base.copy(); - dst.contentReference = contentReference == null ? null : contentReference.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (TypeRefComponent i : type) - dst.type.add(i.copy()); - }; - dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); - dst.meaningWhenMissing = meaningWhenMissing == null ? null : meaningWhenMissing.copy(); - dst.fixed = fixed == null ? null : fixed.copy(); - dst.pattern = pattern == null ? null : pattern.copy(); - dst.example = example == null ? null : example.copy(); - dst.minValue = minValue == null ? null : minValue.copy(); - dst.maxValue = maxValue == null ? null : maxValue.copy(); - dst.maxLength = maxLength == null ? null : maxLength.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (IdType i : condition) - dst.condition.add(i.copy()); - }; - if (constraint != null) { - dst.constraint = new ArrayList(); - for (ElementDefinitionConstraintComponent i : constraint) - dst.constraint.add(i.copy()); - }; - dst.mustSupport = mustSupport == null ? null : mustSupport.copy(); - dst.isModifier = isModifier == null ? null : isModifier.copy(); - dst.isSummary = isSummary == null ? null : isSummary.copy(); - dst.binding = binding == null ? null : binding.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (ElementDefinitionMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - return dst; - } - - protected ElementDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ElementDefinition)) - return false; - ElementDefinition o = (ElementDefinition) other; - return compareDeep(path, o.path, true) && compareDeep(representation, o.representation, true) && compareDeep(name, o.name, true) - && compareDeep(label, o.label, true) && compareDeep(code, o.code, true) && compareDeep(slicing, o.slicing, true) - && compareDeep(short_, o.short_, true) && compareDeep(definition, o.definition, true) && compareDeep(comments, o.comments, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(alias, o.alias, true) && compareDeep(min, o.min, true) - && compareDeep(max, o.max, true) && compareDeep(base, o.base, true) && compareDeep(contentReference, o.contentReference, true) - && compareDeep(type, o.type, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(meaningWhenMissing, o.meaningWhenMissing, true) - && compareDeep(fixed, o.fixed, true) && compareDeep(pattern, o.pattern, true) && compareDeep(example, o.example, true) - && compareDeep(minValue, o.minValue, true) && compareDeep(maxValue, o.maxValue, true) && compareDeep(maxLength, o.maxLength, true) - && compareDeep(condition, o.condition, true) && compareDeep(constraint, o.constraint, true) && compareDeep(mustSupport, o.mustSupport, true) - && compareDeep(isModifier, o.isModifier, true) && compareDeep(isSummary, o.isSummary, true) && compareDeep(binding, o.binding, true) - && compareDeep(mapping, o.mapping, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ElementDefinition)) - return false; - ElementDefinition o = (ElementDefinition) other; - return compareValues(path, o.path, true) && compareValues(representation, o.representation, true) && compareValues(name, o.name, true) - && compareValues(label, o.label, true) && compareValues(short_, o.short_, true) && compareValues(definition, o.definition, true) - && compareValues(comments, o.comments, true) && compareValues(requirements, o.requirements, true) && compareValues(alias, o.alias, true) - && compareValues(min, o.min, true) && compareValues(max, o.max, true) && compareValues(contentReference, o.contentReference, true) - && compareValues(meaningWhenMissing, o.meaningWhenMissing, true) && compareValues(maxLength, o.maxLength, true) - && compareValues(condition, o.condition, true) && compareValues(mustSupport, o.mustSupport, true) && compareValues(isModifier, o.isModifier, true) - && compareValues(isSummary, o.isSummary, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (representation == null || representation.isEmpty()) - && (name == null || name.isEmpty()) && (label == null || label.isEmpty()) && (code == null || code.isEmpty()) - && (slicing == null || slicing.isEmpty()) && (short_ == null || short_.isEmpty()) && (definition == null || definition.isEmpty()) - && (comments == null || comments.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (alias == null || alias.isEmpty()) && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) - && (base == null || base.isEmpty()) && (contentReference == null || contentReference.isEmpty()) - && (type == null || type.isEmpty()) && (defaultValue == null || defaultValue.isEmpty()) && (meaningWhenMissing == null || meaningWhenMissing.isEmpty()) - && (fixed == null || fixed.isEmpty()) && (pattern == null || pattern.isEmpty()) && (example == null || example.isEmpty()) - && (minValue == null || minValue.isEmpty()) && (maxValue == null || maxValue.isEmpty()) && (maxLength == null || maxLength.isEmpty()) - && (condition == null || condition.isEmpty()) && (constraint == null || constraint.isEmpty()) - && (mustSupport == null || mustSupport.isEmpty()) && (isModifier == null || isModifier.isEmpty()) - && (isSummary == null || isSummary.isEmpty()) && (binding == null || binding.isEmpty()) && (mapping == null || mapping.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java deleted file mode 100644 index be4f6646317..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EligibilityRequest.java +++ /dev/null @@ -1,1353 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. - */ -@ResourceDef(name="EligibilityRequest", profile="http://hl7.org/fhir/Profile/EligibilityRequest") -public class EligibilityRequest extends DomainResource { - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Type target; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type provider; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type organization; - - /** - * Immediate (STAT), best effort (NORMAL), deferred (DEFER). - */ - @Child(name = "priority", type = {Coding.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Desired processing priority", formalDefinition="Immediate (STAT), best effort (NORMAL), deferred (DEFER)." ) - protected Coding priority; - - /** - * Person who created the invoice/claim/pre-determination or pre-authorization. - */ - @Child(name = "enterer", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Author", formalDefinition="Person who created the invoice/claim/pre-determination or pre-authorization." ) - protected Type enterer; - - /** - * Facility where the services were provided. - */ - @Child(name = "facility", type = {Identifier.class, Location.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Type facility; - - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Identifier.class, Patient.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Type patient; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected Type coverage; - - /** - * The contract number of a business agreement which describes the terms and conditions. - */ - @Child(name = "businessArrangement", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." ) - protected StringType businessArrangement; - - /** - * The date or dates when the enclosed suite of services were performed or completed. - */ - @Child(name = "serviced", type = {DateType.class, Period.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Estimated date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) - protected Type serviced; - - /** - * Dental, Vision, Medical, Pharmacy, Rehab etc. - */ - @Child(name = "benefitCategory", type = {Coding.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) - protected Coding benefitCategory; - - /** - * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. - */ - @Child(name = "benefitSubCategory", type = {Coding.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) - protected Coding benefitSubCategory; - - private static final long serialVersionUID = 313969968L; - - /** - * Constructor - */ - public EligibilityRequest() { - super(); - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EligibilityRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EligibilityRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EligibilityRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EligibilityRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public EligibilityRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Identifier getTargetIdentifier() throws FHIRException { - if (!(this.target instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Identifier) this.target; - } - - public boolean hasTargetIdentifier() { - return this.target instanceof Identifier; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTargetReference() throws FHIRException { - if (!(this.target instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTargetReference() { - return this.target instanceof Reference; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public EligibilityRequest setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EligibilityRequest setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityRequest setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public Coding getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Coding(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Immediate (STAT), best effort (NORMAL), deferred (DEFER).) - */ - public EligibilityRequest setPriority(Coding value) { - this.priority = value; - return this; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Type getEnterer() { - return this.enterer; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Identifier getEntererIdentifier() throws FHIRException { - if (!(this.enterer instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.enterer.getClass().getName()+" was encountered"); - return (Identifier) this.enterer; - } - - public boolean hasEntererIdentifier() { - return this.enterer instanceof Identifier; - } - - /** - * @return {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public Reference getEntererReference() throws FHIRException { - if (!(this.enterer instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.enterer.getClass().getName()+" was encountered"); - return (Reference) this.enterer; - } - - public boolean hasEntererReference() { - return this.enterer instanceof Reference; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (Person who created the invoice/claim/pre-determination or pre-authorization.) - */ - public EligibilityRequest setEnterer(Type value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Type getFacility() { - return this.facility; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Identifier getFacilityIdentifier() throws FHIRException { - if (!(this.facility instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered"); - return (Identifier) this.facility; - } - - public boolean hasFacilityIdentifier() { - return this.facility instanceof Identifier; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacilityReference() throws FHIRException { - if (!(this.facility instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered"); - return (Reference) this.facility; - } - - public boolean hasFacilityReference() { - return this.facility instanceof Reference; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public EligibilityRequest setFacility(Type value) { - this.facility = value; - return this; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Type getPatient() { - return this.patient; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Identifier getPatientIdentifier() throws FHIRException { - if (!(this.patient instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered"); - return (Identifier) this.patient; - } - - public boolean hasPatientIdentifier() { - return this.patient instanceof Identifier; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatientReference() throws FHIRException { - if (!(this.patient instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered"); - return (Reference) this.patient; - } - - public boolean hasPatientReference() { - return this.patient instanceof Reference; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public EligibilityRequest setPatient(Type value) { - this.patient = value; - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public Type getCoverage() { - return this.coverage; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public Identifier getCoverageIdentifier() throws FHIRException { - if (!(this.coverage instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Identifier) this.coverage; - } - - public boolean hasCoverageIdentifier() { - return this.coverage instanceof Identifier; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public Reference getCoverageReference() throws FHIRException { - if (!(this.coverage instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Reference) this.coverage; - } - - public boolean hasCoverageReference() { - return this.coverage instanceof Reference; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public EligibilityRequest setCoverage(Type value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public StringType getBusinessArrangementElement() { - if (this.businessArrangement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.businessArrangement"); - else if (Configuration.doAutoCreate()) - this.businessArrangement = new StringType(); // bb - return this.businessArrangement; - } - - public boolean hasBusinessArrangementElement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - public boolean hasBusinessArrangement() { - return this.businessArrangement != null && !this.businessArrangement.isEmpty(); - } - - /** - * @param value {@link #businessArrangement} (The contract number of a business agreement which describes the terms and conditions.). This is the underlying object with id, value and extensions. The accessor "getBusinessArrangement" gives direct access to the value - */ - public EligibilityRequest setBusinessArrangementElement(StringType value) { - this.businessArrangement = value; - return this; - } - - /** - * @return The contract number of a business agreement which describes the terms and conditions. - */ - public String getBusinessArrangement() { - return this.businessArrangement == null ? null : this.businessArrangement.getValue(); - } - - /** - * @param value The contract number of a business agreement which describes the terms and conditions. - */ - public EligibilityRequest setBusinessArrangement(String value) { - if (Utilities.noString(value)) - this.businessArrangement = null; - else { - if (this.businessArrangement == null) - this.businessArrangement = new StringType(); - this.businessArrangement.setValue(value); - } - return this; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Type getServiced() { - return this.serviced; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public DateType getServicedDateType() throws FHIRException { - if (!(this.serviced instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (DateType) this.serviced; - } - - public boolean hasServicedDateType() { - return this.serviced instanceof DateType; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Period getServicedPeriod() throws FHIRException { - if (!(this.serviced instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (Period) this.serviced; - } - - public boolean hasServicedPeriod() { - return this.serviced instanceof Period; - } - - public boolean hasServiced() { - return this.serviced != null && !this.serviced.isEmpty(); - } - - /** - * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public EligibilityRequest setServiced(Type value) { - this.serviced = value; - return this; - } - - /** - * @return {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.) - */ - public Coding getBenefitCategory() { - if (this.benefitCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.benefitCategory"); - else if (Configuration.doAutoCreate()) - this.benefitCategory = new Coding(); // cc - return this.benefitCategory; - } - - public boolean hasBenefitCategory() { - return this.benefitCategory != null && !this.benefitCategory.isEmpty(); - } - - /** - * @param value {@link #benefitCategory} (Dental, Vision, Medical, Pharmacy, Rehab etc.) - */ - public EligibilityRequest setBenefitCategory(Coding value) { - this.benefitCategory = value; - return this; - } - - /** - * @return {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) - */ - public Coding getBenefitSubCategory() { - if (this.benefitSubCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityRequest.benefitSubCategory"); - else if (Configuration.doAutoCreate()) - this.benefitSubCategory = new Coding(); // cc - return this.benefitSubCategory; - } - - public boolean hasBenefitSubCategory() { - return this.benefitSubCategory != null && !this.benefitSubCategory.isEmpty(); - } - - /** - * @param value {@link #benefitSubCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) - */ - public EligibilityRequest setBenefitSubCategory(Coding value) { - this.benefitSubCategory = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("priority", "Coding", "Immediate (STAT), best effort (NORMAL), deferred (DEFER).", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("enterer[x]", "Identifier|Reference(Practitioner)", "Person who created the invoice/claim/pre-determination or pre-authorization.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("facility[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("patient[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, java.lang.Integer.MAX_VALUE, businessArrangement)); - childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); - childrenList.add(new Property("benefitCategory", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, benefitCategory)); - childrenList.add(new Property("benefitSubCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, benefitSubCategory)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Coding - case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Type - case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type - case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType - case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type - case -1023390027: /*benefitCategory*/ return this.benefitCategory == null ? new Base[0] : new Base[] {this.benefitCategory}; // Coding - case 1987878471: /*benefitSubCategory*/ return this.benefitSubCategory == null ? new Base[0] : new Base[] {this.benefitSubCategory}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -880905839: // target - this.target = (Type) value; // Type - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case -1165461084: // priority - this.priority = castToCoding(value); // Coding - break; - case -1591951995: // enterer - this.enterer = (Type) value; // Type - break; - case 501116579: // facility - this.facility = (Type) value; // Type - break; - case -791418107: // patient - this.patient = (Type) value; // Type - break; - case -351767064: // coverage - this.coverage = (Type) value; // Type - break; - case 259920682: // businessArrangement - this.businessArrangement = castToString(value); // StringType - break; - case 1379209295: // serviced - this.serviced = (Type) value; // Type - break; - case -1023390027: // benefitCategory - this.benefitCategory = castToCoding(value); // Coding - break; - case 1987878471: // benefitSubCategory - this.benefitSubCategory = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("target[x]")) - this.target = (Type) value; // Type - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("priority")) - this.priority = castToCoding(value); // Coding - else if (name.equals("enterer[x]")) - this.enterer = (Type) value; // Type - else if (name.equals("facility[x]")) - this.facility = (Type) value; // Type - else if (name.equals("patient[x]")) - this.patient = (Type) value; // Type - else if (name.equals("coverage[x]")) - this.coverage = (Type) value; // Type - else if (name.equals("businessArrangement")) - this.businessArrangement = castToString(value); // StringType - else if (name.equals("serviced[x]")) - this.serviced = (Type) value; // Type - else if (name.equals("benefitCategory")) - this.benefitCategory = castToCoding(value); // Coding - else if (name.equals("benefitSubCategory")) - this.benefitSubCategory = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -815579825: return getTarget(); // Type - case 2064698607: return getProvider(); // Type - case 1326483053: return getOrganization(); // Type - case -1165461084: return getPriority(); // Coding - case -812909349: return getEnterer(); // Type - case -542224643: return getFacility(); // Type - case -2061246629: return getPatient(); // Type - case 227689880: return getCoverage(); // Type - case 259920682: throw new FHIRException("Cannot make property businessArrangement as it is not a complex type"); // StringType - case -1927922223: return getServiced(); // Type - case -1023390027: return getBenefitCategory(); // Coding - case 1987878471: return getBenefitSubCategory(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.created"); - } - else if (name.equals("targetIdentifier")) { - this.target = new Identifier(); - return this.target; - } - else if (name.equals("targetReference")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("priority")) { - this.priority = new Coding(); - return this.priority; - } - else if (name.equals("entererIdentifier")) { - this.enterer = new Identifier(); - return this.enterer; - } - else if (name.equals("entererReference")) { - this.enterer = new Reference(); - return this.enterer; - } - else if (name.equals("facilityIdentifier")) { - this.facility = new Identifier(); - return this.facility; - } - else if (name.equals("facilityReference")) { - this.facility = new Reference(); - return this.facility; - } - else if (name.equals("patientIdentifier")) { - this.patient = new Identifier(); - return this.patient; - } - else if (name.equals("patientReference")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("coverageIdentifier")) { - this.coverage = new Identifier(); - return this.coverage; - } - else if (name.equals("coverageReference")) { - this.coverage = new Reference(); - return this.coverage; - } - else if (name.equals("businessArrangement")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityRequest.businessArrangement"); - } - else if (name.equals("servicedDate")) { - this.serviced = new DateType(); - return this.serviced; - } - else if (name.equals("servicedPeriod")) { - this.serviced = new Period(); - return this.serviced; - } - else if (name.equals("benefitCategory")) { - this.benefitCategory = new Coding(); - return this.benefitCategory; - } - else if (name.equals("benefitSubCategory")) { - this.benefitSubCategory = new Coding(); - return this.benefitSubCategory; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "EligibilityRequest"; - - } - - public EligibilityRequest copy() { - EligibilityRequest dst = new EligibilityRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.enterer = enterer == null ? null : enterer.copy(); - dst.facility = facility == null ? null : facility.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy(); - dst.serviced = serviced == null ? null : serviced.copy(); - dst.benefitCategory = benefitCategory == null ? null : benefitCategory.copy(); - dst.benefitSubCategory = benefitSubCategory == null ? null : benefitSubCategory.copy(); - return dst; - } - - protected EligibilityRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EligibilityRequest)) - return false; - EligibilityRequest o = (EligibilityRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true) && compareDeep(priority, o.priority, true) && compareDeep(enterer, o.enterer, true) - && compareDeep(facility, o.facility, true) && compareDeep(patient, o.patient, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(serviced, o.serviced, true) - && compareDeep(benefitCategory, o.benefitCategory, true) && compareDeep(benefitSubCategory, o.benefitSubCategory, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EligibilityRequest)) - return false; - EligibilityRequest o = (EligibilityRequest) other; - return compareValues(created, o.created, true) && compareValues(businessArrangement, o.businessArrangement, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (priority == null || priority.isEmpty()) && (enterer == null || enterer.isEmpty()) && (facility == null || facility.isEmpty()) - && (patient == null || patient.isEmpty()) && (coverage == null || coverage.isEmpty()) && (businessArrangement == null || businessArrangement.isEmpty()) - && (serviced == null || serviced.isEmpty()) && (benefitCategory == null || benefitCategory.isEmpty()) - && (benefitSubCategory == null || benefitSubCategory.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EligibilityRequest; - } - - /** - * Search parameter: patientidentifier - *

- * Description: The reference to the patient
- * Type: token
- * Path: EligibilityRequest.patientIdentifier
- *

- */ - @SearchParamDefinition(name="patientidentifier", path="EligibilityRequest.patient.as(Identifier)", description="The reference to the patient", type="token" ) - public static final String SP_PATIENTIDENTIFIER = "patientidentifier"; - /** - * Fluent Client search parameter constant for patientidentifier - *

- * Description: The reference to the patient
- * Type: token
- * Path: EligibilityRequest.patientIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER); - - /** - * Search parameter: created - *

- * Description: The creation date for the EOB
- * Type: date
- * Path: EligibilityRequest.created
- *

- */ - @SearchParamDefinition(name="created", path="EligibilityRequest.created", description="The creation date for the EOB", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: The creation date for the EOB
- * Type: date
- * Path: EligibilityRequest.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: facilityidentifier - *

- * Description: Facility responsible for the goods and services
- * Type: token
- * Path: EligibilityRequest.facilityidentifier
- *

- */ - @SearchParamDefinition(name="facilityidentifier", path="EligibilityRequest.facility.as(identifier)", description="Facility responsible for the goods and services", type="token" ) - public static final String SP_FACILITYIDENTIFIER = "facilityidentifier"; - /** - * Fluent Client search parameter constant for facilityidentifier - *

- * Description: Facility responsible for the goods and services
- * Type: token
- * Path: EligibilityRequest.facilityidentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER); - - /** - * Search parameter: facilityreference - *

- * Description: Facility responsible for the goods and services
- * Type: reference
- * Path: EligibilityRequest.facilityReference
- *

- */ - @SearchParamDefinition(name="facilityreference", path="EligibilityRequest.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" ) - public static final String SP_FACILITYREFERENCE = "facilityreference"; - /** - * Fluent Client search parameter constant for facilityreference - *

- * Description: Facility responsible for the goods and services
- * Type: reference
- * Path: EligibilityRequest.facilityReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityRequest:facilityreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:facilityreference").toLocked(); - - /** - * Search parameter: providerreference - *

- * Description: The reference to the provider
- * Type: reference
- * Path: EligibilityRequest.providerReference
- *

- */ - @SearchParamDefinition(name="providerreference", path="EligibilityRequest.provider.as(Reference)", description="The reference to the provider", type="reference" ) - public static final String SP_PROVIDERREFERENCE = "providerreference"; - /** - * Fluent Client search parameter constant for providerreference - *

- * Description: The reference to the provider
- * Type: reference
- * Path: EligibilityRequest.providerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityRequest:providerreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:providerreference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The reference to the providing organization
- * Type: token
- * Path: EligibilityRequest.organizationidentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="EligibilityRequest.organization.as(identifier)", description="The reference to the providing organization", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The reference to the providing organization
- * Type: token
- * Path: EligibilityRequest.organizationidentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: organizationreference - *

- * Description: The reference to the providing organization
- * Type: reference
- * Path: EligibilityRequest.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="EligibilityRequest.organization.as(Reference)", description="The reference to the providing organization", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The reference to the providing organization
- * Type: reference
- * Path: EligibilityRequest.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityRequest:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:organizationreference").toLocked(); - - /** - * Search parameter: patientreference - *

- * Description: The reference to the patient
- * Type: reference
- * Path: EligibilityRequest.patientReference
- *

- */ - @SearchParamDefinition(name="patientreference", path="EligibilityRequest.patient.as(Reference)", description="The reference to the patient", type="reference" ) - public static final String SP_PATIENTREFERENCE = "patientreference"; - /** - * Fluent Client search parameter constant for patientreference - *

- * Description: The reference to the patient
- * Type: reference
- * Path: EligibilityRequest.patientReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityRequest:patientreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityRequest:patientreference").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the Eligibility
- * Type: token
- * Path: EligibilityRequest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="EligibilityRequest.identifier", description="The business identifier of the Eligibility", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the Eligibility
- * Type: token
- * Path: EligibilityRequest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: provideridentifier - *

- * Description: The reference to the provider
- * Type: token
- * Path: EligibilityRequest.provideridentifier
- *

- */ - @SearchParamDefinition(name="provideridentifier", path="EligibilityRequest.provider.as(identifier)", description="The reference to the provider", type="token" ) - public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; - /** - * Fluent Client search parameter constant for provideridentifier - *

- * Description: The reference to the provider
- * Type: token
- * Path: EligibilityRequest.provideridentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java deleted file mode 100644 index b2655686fc9..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EligibilityResponse.java +++ /dev/null @@ -1,2163 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ -@ResourceDef(name="EligibilityResponse", profile="http://hl7.org/fhir/Profile/EligibilityResponse") -public class EligibilityResponse extends DomainResource { - - @Block() - public static class BenefitsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Dental, Vision, Medical, Pharmacy, Rehab etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) - protected Coding category; - - /** - * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. - */ - @Child(name = "subCategory", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) - protected Coding subCategory; - - /** - * Network designation. - */ - @Child(name = "network", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="In or out of network", formalDefinition="Network designation." ) - protected Coding network; - - /** - * Unit designation: individual or family. - */ - @Child(name = "unit", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." ) - protected Coding unit; - - /** - * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. - */ - @Child(name = "term", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'." ) - protected Coding term; - - /** - * Benefits Used to date. - */ - @Child(name = "financial", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits Used to date." ) - protected List financial; - - private static final long serialVersionUID = 1708176773L; - - /** - * Constructor - */ - public BenefitsComponent() { - super(); - } - - /** - * Constructor - */ - public BenefitsComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitsComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) - */ - public BenefitsComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) - */ - public Coding getSubCategory() { - if (this.subCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitsComponent.subCategory"); - else if (Configuration.doAutoCreate()) - this.subCategory = new Coding(); // cc - return this.subCategory; - } - - public boolean hasSubCategory() { - return this.subCategory != null && !this.subCategory.isEmpty(); - } - - /** - * @param value {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) - */ - public BenefitsComponent setSubCategory(Coding value) { - this.subCategory = value; - return this; - } - - /** - * @return {@link #network} (Network designation.) - */ - public Coding getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitsComponent.network"); - else if (Configuration.doAutoCreate()) - this.network = new Coding(); // cc - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (Network designation.) - */ - public BenefitsComponent setNetwork(Coding value) { - this.network = value; - return this; - } - - /** - * @return {@link #unit} (Unit designation: individual or family.) - */ - public Coding getUnit() { - if (this.unit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitsComponent.unit"); - else if (Configuration.doAutoCreate()) - this.unit = new Coding(); // cc - return this.unit; - } - - public boolean hasUnit() { - return this.unit != null && !this.unit.isEmpty(); - } - - /** - * @param value {@link #unit} (Unit designation: individual or family.) - */ - public BenefitsComponent setUnit(Coding value) { - this.unit = value; - return this; - } - - /** - * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) - */ - public Coding getTerm() { - if (this.term == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitsComponent.term"); - else if (Configuration.doAutoCreate()) - this.term = new Coding(); // cc - return this.term; - } - - public boolean hasTerm() { - return this.term != null && !this.term.isEmpty(); - } - - /** - * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) - */ - public BenefitsComponent setTerm(Coding value) { - this.term = value; - return this; - } - - /** - * @return {@link #financial} (Benefits Used to date.) - */ - public List getFinancial() { - if (this.financial == null) - this.financial = new ArrayList(); - return this.financial; - } - - public boolean hasFinancial() { - if (this.financial == null) - return false; - for (BenefitComponent item : this.financial) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #financial} (Benefits Used to date.) - */ - // syntactic sugar - public BenefitComponent addFinancial() { //3 - BenefitComponent t = new BenefitComponent(); - if (this.financial == null) - this.financial = new ArrayList(); - this.financial.add(t); - return t; - } - - // syntactic sugar - public BenefitsComponent addFinancial(BenefitComponent t) { //3 - if (t == null) - return this; - if (this.financial == null) - this.financial = new ArrayList(); - this.financial.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("subCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); - childrenList.add(new Property("network", "Coding", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("unit", "Coding", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("term", "Coding", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); - childrenList.add(new Property("financial", "", "Benefits Used to date.", 0, java.lang.Integer.MAX_VALUE, financial)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // Coding - case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // Coding - case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // Coding - case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // Coding - case 357555337: /*financial*/ return this.financial == null ? new Base[0] : this.financial.toArray(new Base[this.financial.size()]); // BenefitComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case 1365024606: // subCategory - this.subCategory = castToCoding(value); // Coding - break; - case 1843485230: // network - this.network = castToCoding(value); // Coding - break; - case 3594628: // unit - this.unit = castToCoding(value); // Coding - break; - case 3556460: // term - this.term = castToCoding(value); // Coding - break; - case 357555337: // financial - this.getFinancial().add((BenefitComponent) value); // BenefitComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("subCategory")) - this.subCategory = castToCoding(value); // Coding - else if (name.equals("network")) - this.network = castToCoding(value); // Coding - else if (name.equals("unit")) - this.unit = castToCoding(value); // Coding - else if (name.equals("term")) - this.term = castToCoding(value); // Coding - else if (name.equals("financial")) - this.getFinancial().add((BenefitComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case 1365024606: return getSubCategory(); // Coding - case 1843485230: return getNetwork(); // Coding - case 3594628: return getUnit(); // Coding - case 3556460: return getTerm(); // Coding - case 357555337: return addFinancial(); // BenefitComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("subCategory")) { - this.subCategory = new Coding(); - return this.subCategory; - } - else if (name.equals("network")) { - this.network = new Coding(); - return this.network; - } - else if (name.equals("unit")) { - this.unit = new Coding(); - return this.unit; - } - else if (name.equals("term")) { - this.term = new Coding(); - return this.term; - } - else if (name.equals("financial")) { - return addFinancial(); - } - else - return super.addChild(name); - } - - public BenefitsComponent copy() { - BenefitsComponent dst = new BenefitsComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.subCategory = subCategory == null ? null : subCategory.copy(); - dst.network = network == null ? null : network.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.term = term == null ? null : term.copy(); - if (financial != null) { - dst.financial = new ArrayList(); - for (BenefitComponent i : financial) - dst.financial.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BenefitsComponent)) - return false; - BenefitsComponent o = (BenefitsComponent) other; - return compareDeep(category, o.category, true) && compareDeep(subCategory, o.subCategory, true) - && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) - && compareDeep(financial, o.financial, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BenefitsComponent)) - return false; - BenefitsComponent o = (BenefitsComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (subCategory == null || subCategory.isEmpty()) - && (network == null || network.isEmpty()) && (unit == null || unit.isEmpty()) && (term == null || term.isEmpty()) - && (financial == null || financial.isEmpty()); - } - - public String fhirType() { - return "EligibilityResponse.benefitBalance"; - - } - - } - - @Block() - public static class BenefitComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Deductable, visits, benefit amount. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Deductable, visits, benefit amount", formalDefinition="Deductable, visits, benefit amount." ) - protected Coding type; - - /** - * Benefits allowed. - */ - @Child(name = "benefit", type = {UnsignedIntType.class, Money.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefits allowed", formalDefinition="Benefits allowed." ) - protected Type benefit; - - /** - * Benefits used. - */ - @Child(name = "benefitUsed", type = {UnsignedIntType.class, Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." ) - protected Type benefitUsed; - - private static final long serialVersionUID = 1742418909L; - - /** - * Constructor - */ - public BenefitComponent() { - super(); - } - - /** - * Constructor - */ - public BenefitComponent(Coding type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Deductable, visits, benefit amount.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Deductable, visits, benefit amount.) - */ - public BenefitComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #benefit} (Benefits allowed.) - */ - public Type getBenefit() { - return this.benefit; - } - - /** - * @return {@link #benefit} (Benefits allowed.) - */ - public UnsignedIntType getBenefitUnsignedIntType() throws FHIRException { - if (!(this.benefit instanceof UnsignedIntType)) - throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefit.getClass().getName()+" was encountered"); - return (UnsignedIntType) this.benefit; - } - - public boolean hasBenefitUnsignedIntType() { - return this.benefit instanceof UnsignedIntType; - } - - /** - * @return {@link #benefit} (Benefits allowed.) - */ - public Money getBenefitMoney() throws FHIRException { - if (!(this.benefit instanceof Money)) - throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefit.getClass().getName()+" was encountered"); - return (Money) this.benefit; - } - - public boolean hasBenefitMoney() { - return this.benefit instanceof Money; - } - - public boolean hasBenefit() { - return this.benefit != null && !this.benefit.isEmpty(); - } - - /** - * @param value {@link #benefit} (Benefits allowed.) - */ - public BenefitComponent setBenefit(Type value) { - this.benefit = value; - return this; - } - - /** - * @return {@link #benefitUsed} (Benefits used.) - */ - public Type getBenefitUsed() { - return this.benefitUsed; - } - - /** - * @return {@link #benefitUsed} (Benefits used.) - */ - public UnsignedIntType getBenefitUsedUnsignedIntType() throws FHIRException { - if (!(this.benefitUsed instanceof UnsignedIntType)) - throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); - return (UnsignedIntType) this.benefitUsed; - } - - public boolean hasBenefitUsedUnsignedIntType() { - return this.benefitUsed instanceof UnsignedIntType; - } - - /** - * @return {@link #benefitUsed} (Benefits used.) - */ - public Money getBenefitUsedMoney() throws FHIRException { - if (!(this.benefitUsed instanceof Money)) - throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); - return (Money) this.benefitUsed; - } - - public boolean hasBenefitUsedMoney() { - return this.benefitUsed instanceof Money; - } - - public boolean hasBenefitUsed() { - return this.benefitUsed != null && !this.benefitUsed.isEmpty(); - } - - /** - * @param value {@link #benefitUsed} (Benefits used.) - */ - public BenefitComponent setBenefitUsed(Type value) { - this.benefitUsed = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("benefit[x]", "unsignedInt|Money", "Benefits allowed.", 0, java.lang.Integer.MAX_VALUE, benefit)); - childrenList.add(new Property("benefitUsed[x]", "unsignedInt|Money", "Benefits used.", 0, java.lang.Integer.MAX_VALUE, benefitUsed)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : new Base[] {this.benefit}; // Type - case -549981964: /*benefitUsed*/ return this.benefitUsed == null ? new Base[0] : new Base[] {this.benefitUsed}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -222710633: // benefit - this.benefit = (Type) value; // Type - break; - case -549981964: // benefitUsed - this.benefitUsed = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("benefit[x]")) - this.benefit = (Type) value; // Type - else if (name.equals("benefitUsed[x]")) - this.benefitUsed = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 952095881: return getBenefit(); // Type - case 787635980: return getBenefitUsed(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("benefitUnsignedInt")) { - this.benefit = new UnsignedIntType(); - return this.benefit; - } - else if (name.equals("benefitMoney")) { - this.benefit = new Money(); - return this.benefit; - } - else if (name.equals("benefitUsedUnsignedInt")) { - this.benefitUsed = new UnsignedIntType(); - return this.benefitUsed; - } - else if (name.equals("benefitUsedMoney")) { - this.benefitUsed = new Money(); - return this.benefitUsed; - } - else - return super.addChild(name); - } - - public BenefitComponent copy() { - BenefitComponent dst = new BenefitComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.benefit = benefit == null ? null : benefit.copy(); - dst.benefitUsed = benefitUsed == null ? null : benefitUsed.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BenefitComponent)) - return false; - BenefitComponent o = (BenefitComponent) other; - return compareDeep(type, o.type, true) && compareDeep(benefit, o.benefit, true) && compareDeep(benefitUsed, o.benefitUsed, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BenefitComponent)) - return false; - BenefitComponent o = (BenefitComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (benefit == null || benefit.isEmpty()) - && (benefitUsed == null || benefitUsed.isEmpty()); - } - - public String fhirType() { - return "EligibilityResponse.benefitBalance.financial"; - - } - - } - - @Block() - public static class ErrorsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An error code,from a specified code system, which details why the eligibility check could not be performed. - */ - @Child(name = "code", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Error code detailing processing issues", formalDefinition="An error code,from a specified code system, which details why the eligibility check could not be performed." ) - protected Coding code; - - private static final long serialVersionUID = -739538393L; - - /** - * Constructor - */ - public ErrorsComponent() { - super(); - } - - /** - * Constructor - */ - public ErrorsComponent(Coding code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.) - */ - public Coding getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ErrorsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Coding(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (An error code,from a specified code system, which details why the eligibility check could not be performed.) - */ - public ErrorsComponent setCode(Coding value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "Coding", "An error code,from a specified code system, which details why the eligibility check could not be performed.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new Coding(); - return this.code; - } - else - return super.addChild(name); - } - - public ErrorsComponent copy() { - ErrorsComponent dst = new ErrorsComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ErrorsComponent)) - return false; - ErrorsComponent o = (ErrorsComponent) other; - return compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ErrorsComponent)) - return false; - ErrorsComponent o = (ErrorsComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()); - } - - public String fhirType() { - return "EligibilityResponse.error"; - - } - - } - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {Identifier.class, EligibilityRequest.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Type request; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Type organization; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type requestProvider; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type requestOrganization; - - /** - * Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. - */ - @Child(name = "inforce", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Coverage inforce", formalDefinition="Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates." ) - protected BooleanType inforce; - - /** - * The contract resource which may provide more detailed information. - */ - @Child(name = "contract", type = {Contract.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contract details", formalDefinition="The contract resource which may provide more detailed information." ) - protected Reference contract; - - /** - * The actual object that is the target of the reference (The contract resource which may provide more detailed information.) - */ - protected Contract contractTarget; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Benefits and optionally current balances by Category. - */ - @Child(name = "benefitBalance", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Benefits by Category", formalDefinition="Benefits and optionally current balances by Category." ) - protected List benefitBalance; - - /** - * Mutually exclusive with Services Provided (Item). - */ - @Child(name = "error", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Processing errors", formalDefinition="Mutually exclusive with Services Provided (Item)." ) - protected List error; - - private static final long serialVersionUID = -674605791L; - - /** - * Constructor - */ - public EligibilityResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EligibilityResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public EligibilityResponse setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EligibilityResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EligibilityResponse setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EligibilityResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EligibilityResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EligibilityResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EligibilityResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EligibilityResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public EligibilityResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EligibilityResponse setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getRequestProvider() { - return this.requestProvider; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getRequestProviderIdentifier() throws FHIRException { - if (!(this.requestProvider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Identifier) this.requestProvider; - } - - public boolean hasRequestProviderIdentifier() { - return this.requestProvider instanceof Identifier; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProviderReference() throws FHIRException { - if (!(this.requestProvider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Reference) this.requestProvider; - } - - public boolean hasRequestProviderReference() { - return this.requestProvider instanceof Reference; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestProvider(Type value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Type getRequestOrganization() { - return this.requestOrganization; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getRequestOrganizationIdentifier() throws FHIRException { - if (!(this.requestOrganization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Identifier) this.requestOrganization; - } - - public boolean hasRequestOrganizationIdentifier() { - return this.requestOrganization instanceof Identifier; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganizationReference() throws FHIRException { - if (!(this.requestOrganization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Reference) this.requestOrganization; - } - - public boolean hasRequestOrganizationReference() { - return this.requestOrganization instanceof Reference; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public EligibilityResponse setRequestOrganization(Type value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #inforce} (Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value - */ - public BooleanType getInforceElement() { - if (this.inforce == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.inforce"); - else if (Configuration.doAutoCreate()) - this.inforce = new BooleanType(); // bb - return this.inforce; - } - - public boolean hasInforceElement() { - return this.inforce != null && !this.inforce.isEmpty(); - } - - public boolean hasInforce() { - return this.inforce != null && !this.inforce.isEmpty(); - } - - /** - * @param value {@link #inforce} (Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.). This is the underlying object with id, value and extensions. The accessor "getInforce" gives direct access to the value - */ - public EligibilityResponse setInforceElement(BooleanType value) { - this.inforce = value; - return this; - } - - /** - * @return Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. - */ - public boolean getInforce() { - return this.inforce == null || this.inforce.isEmpty() ? false : this.inforce.getValue(); - } - - /** - * @param value Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates. - */ - public EligibilityResponse setInforce(boolean value) { - if (this.inforce == null) - this.inforce = new BooleanType(); - this.inforce.setValue(value); - return this; - } - - /** - * @return {@link #contract} (The contract resource which may provide more detailed information.) - */ - public Reference getContract() { - if (this.contract == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.contract"); - else if (Configuration.doAutoCreate()) - this.contract = new Reference(); // cc - return this.contract; - } - - public boolean hasContract() { - return this.contract != null && !this.contract.isEmpty(); - } - - /** - * @param value {@link #contract} (The contract resource which may provide more detailed information.) - */ - public EligibilityResponse setContract(Reference value) { - this.contract = value; - return this; - } - - /** - * @return {@link #contract} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The contract resource which may provide more detailed information.) - */ - public Contract getContractTarget() { - if (this.contractTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.contract"); - else if (Configuration.doAutoCreate()) - this.contractTarget = new Contract(); // aa - return this.contractTarget; - } - - /** - * @param value {@link #contract} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The contract resource which may provide more detailed information.) - */ - public EligibilityResponse setContractTarget(Contract value) { - this.contractTarget = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EligibilityResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public EligibilityResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #benefitBalance} (Benefits and optionally current balances by Category.) - */ - public List getBenefitBalance() { - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - return this.benefitBalance; - } - - public boolean hasBenefitBalance() { - if (this.benefitBalance == null) - return false; - for (BenefitsComponent item : this.benefitBalance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #benefitBalance} (Benefits and optionally current balances by Category.) - */ - // syntactic sugar - public BenefitsComponent addBenefitBalance() { //3 - BenefitsComponent t = new BenefitsComponent(); - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - this.benefitBalance.add(t); - return t; - } - - // syntactic sugar - public EligibilityResponse addBenefitBalance(BenefitsComponent t) { //3 - if (t == null) - return this; - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - this.benefitBalance.add(t); - return this; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (ErrorsComponent item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Mutually exclusive with Services Provided (Item).) - */ - // syntactic sugar - public ErrorsComponent addError() { //3 - ErrorsComponent t = new ErrorsComponent(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - // syntactic sugar - public EligibilityResponse addError(ErrorsComponent t) { //3 - if (t == null) - return this; - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request[x]", "Identifier|Reference(EligibilityRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("inforce", "boolean", "Flag indicating if the coverage provided is inforce currently if no service date(s) specified or for the whole duration of the service dates.", 0, java.lang.Integer.MAX_VALUE, inforce)); - childrenList.add(new Property("contract", "Reference(Contract)", "The contract resource which may provide more detailed information.", 0, java.lang.Integer.MAX_VALUE, contract)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("benefitBalance", "", "Benefits and optionally current balances by Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); - childrenList.add(new Property("error", "", "Mutually exclusive with Services Provided (Item).", 0, java.lang.Integer.MAX_VALUE, error)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type - case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type - case 1945431270: /*inforce*/ return this.inforce == null ? new Base[0] : new Base[] {this.inforce}; // BooleanType - case -566947566: /*contract*/ return this.contract == null ? new Base[0] : new Base[] {this.contract}; // Reference - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitsComponent - case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // ErrorsComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 1601527200: // requestProvider - this.requestProvider = (Type) value; // Type - break; - case 599053666: // requestOrganization - this.requestOrganization = (Type) value; // Type - break; - case 1945431270: // inforce - this.inforce = castToBoolean(value); // BooleanType - break; - case -566947566: // contract - this.contract = castToReference(value); // Reference - break; - case 3148996: // form - this.form = castToCoding(value); // Coding - break; - case 596003397: // benefitBalance - this.getBenefitBalance().add((BenefitsComponent) value); // BenefitsComponent - break; - case 96784904: // error - this.getError().add((ErrorsComponent) value); // ErrorsComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("requestProvider[x]")) - this.requestProvider = (Type) value; // Type - else if (name.equals("requestOrganization[x]")) - this.requestOrganization = (Type) value; // Type - else if (name.equals("inforce")) - this.inforce = castToBoolean(value); // BooleanType - else if (name.equals("contract")) - this.contract = castToReference(value); // Reference - else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("benefitBalance")) - this.getBenefitBalance().add((BenefitsComponent) value); - else if (name.equals("error")) - this.getError().add((ErrorsComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 37106577: return getRequest(); // Type - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1326483053: return getOrganization(); // Type - case -1694784800: return getRequestProvider(); // Type - case 818740190: return getRequestOrganization(); // Type - case 1945431270: throw new FHIRException("Cannot make property inforce as it is not a complex type"); // BooleanType - case -566947566: return getContract(); // Reference - case 3148996: return getForm(); // Coding - case 596003397: return addBenefitBalance(); // BenefitsComponent - case 96784904: return addError(); // ErrorsComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.outcome"); - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.disposition"); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.created"); - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestProviderIdentifier")) { - this.requestProvider = new Identifier(); - return this.requestProvider; - } - else if (name.equals("requestProviderReference")) { - this.requestProvider = new Reference(); - return this.requestProvider; - } - else if (name.equals("requestOrganizationIdentifier")) { - this.requestOrganization = new Identifier(); - return this.requestOrganization; - } - else if (name.equals("requestOrganizationReference")) { - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - else if (name.equals("inforce")) { - throw new FHIRException("Cannot call addChild on a primitive type EligibilityResponse.inforce"); - } - else if (name.equals("contract")) { - this.contract = new Reference(); - return this.contract; - } - else if (name.equals("form")) { - this.form = new Coding(); - return this.form; - } - else if (name.equals("benefitBalance")) { - return addBenefitBalance(); - } - else if (name.equals("error")) { - return addError(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "EligibilityResponse"; - - } - - public EligibilityResponse copy() { - EligibilityResponse dst = new EligibilityResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - dst.inforce = inforce == null ? null : inforce.copy(); - dst.contract = contract == null ? null : contract.copy(); - dst.form = form == null ? null : form.copy(); - if (benefitBalance != null) { - dst.benefitBalance = new ArrayList(); - for (BenefitsComponent i : benefitBalance) - dst.benefitBalance.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (ErrorsComponent i : error) - dst.error.add(i.copy()); - }; - return dst; - } - - protected EligibilityResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EligibilityResponse)) - return false; - EligibilityResponse o = (EligibilityResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(inforce, o.inforce, true) - && compareDeep(contract, o.contract, true) && compareDeep(form, o.form, true) && compareDeep(benefitBalance, o.benefitBalance, true) - && compareDeep(error, o.error, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EligibilityResponse)) - return false; - EligibilityResponse o = (EligibilityResponse) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - && compareValues(inforce, o.inforce, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (inforce == null || inforce.isEmpty()) && (contract == null || contract.isEmpty()) && (form == null || form.isEmpty()) - && (benefitBalance == null || benefitBalance.isEmpty()) && (error == null || error.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EligibilityResponse; - } - - /** - * Search parameter: requestorganizationreference - *

- * Description: The EligibilityRequest organization
- * Type: reference
- * Path: EligibilityResponse.requestOrganizationReference
- *

- */ - @SearchParamDefinition(name="requestorganizationreference", path="EligibilityResponse.requestOrganization.as(Reference)", description="The EligibilityRequest organization", type="reference" ) - public static final String SP_REQUESTORGANIZATIONREFERENCE = "requestorganizationreference"; - /** - * Fluent Client search parameter constant for requestorganizationreference - *

- * Description: The EligibilityRequest organization
- * Type: reference
- * Path: EligibilityResponse.requestOrganizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityResponse:requestorganizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:requestorganizationreference").toLocked(); - - /** - * Search parameter: created - *

- * Description: The creation date
- * Type: date
- * Path: EligibilityResponse.created
- *

- */ - @SearchParamDefinition(name="created", path="EligibilityResponse.created", description="The creation date", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: The creation date
- * Type: date
- * Path: EligibilityResponse.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: requestorganizationidentifier - *

- * Description: The EligibilityRequest organization
- * Type: token
- * Path: EligibilityResponse.requestOrganizationIdentifier
- *

- */ - @SearchParamDefinition(name="requestorganizationidentifier", path="EligibilityResponse.requestOrganization.as(Identifier)", description="The EligibilityRequest organization", type="token" ) - public static final String SP_REQUESTORGANIZATIONIDENTIFIER = "requestorganizationidentifier"; - /** - * Fluent Client search parameter constant for requestorganizationidentifier - *

- * Description: The EligibilityRequest organization
- * Type: token
- * Path: EligibilityResponse.requestOrganizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTORGANIZATIONIDENTIFIER); - - /** - * Search parameter: requestprovideridentifier - *

- * Description: The EligibilityRequest provider
- * Type: token
- * Path: EligibilityResponse.requestProviderIdentifier
- *

- */ - @SearchParamDefinition(name="requestprovideridentifier", path="EligibilityResponse.requestProvider.as(Identifier)", description="The EligibilityRequest provider", type="token" ) - public static final String SP_REQUESTPROVIDERIDENTIFIER = "requestprovideridentifier"; - /** - * Fluent Client search parameter constant for requestprovideridentifier - *

- * Description: The EligibilityRequest provider
- * Type: token
- * Path: EligibilityResponse.requestProviderIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTPROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTPROVIDERIDENTIFIER); - - /** - * Search parameter: requestidentifier - *

- * Description: The EligibilityRequest reference
- * Type: token
- * Path: EligibilityResponse.requestIdentifier
- *

- */ - @SearchParamDefinition(name="requestidentifier", path="EligibilityResponse.request.as(Identifier)", description="The EligibilityRequest reference", type="token" ) - public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; - /** - * Fluent Client search parameter constant for requestidentifier - *

- * Description: The EligibilityRequest reference
- * Type: token
- * Path: EligibilityResponse.requestIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); - - /** - * Search parameter: requestreference - *

- * Description: The EligibilityRequest reference
- * Type: reference
- * Path: EligibilityResponse.requestReference
- *

- */ - @SearchParamDefinition(name="requestreference", path="EligibilityResponse.request.as(Reference)", description="The EligibilityRequest reference", type="reference" ) - public static final String SP_REQUESTREFERENCE = "requestreference"; - /** - * Fluent Client search parameter constant for requestreference - *

- * Description: The EligibilityRequest reference
- * Type: reference
- * Path: EligibilityResponse.requestReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityResponse:requestreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:requestreference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The organization which generated this resource
- * Type: token
- * Path: EligibilityResponse.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="EligibilityResponse.organization.as(Identifier)", description="The organization which generated this resource", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The organization which generated this resource
- * Type: token
- * Path: EligibilityResponse.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: requestproviderreference - *

- * Description: The EligibilityRequest provider
- * Type: reference
- * Path: EligibilityResponse.requestProviderReference
- *

- */ - @SearchParamDefinition(name="requestproviderreference", path="EligibilityResponse.requestProvider.as(Reference)", description="The EligibilityRequest provider", type="reference" ) - public static final String SP_REQUESTPROVIDERREFERENCE = "requestproviderreference"; - /** - * Fluent Client search parameter constant for requestproviderreference - *

- * Description: The EligibilityRequest provider
- * Type: reference
- * Path: EligibilityResponse.requestProviderReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTPROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityResponse:requestproviderreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:requestproviderreference").toLocked(); - - /** - * Search parameter: organizationreference - *

- * Description: The organization which generated this resource
- * Type: reference
- * Path: EligibilityResponse.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="EligibilityResponse.organization.as(Reference)", description="The organization which generated this resource", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The organization which generated this resource
- * Type: reference
- * Path: EligibilityResponse.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EligibilityResponse:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("EligibilityResponse:organizationreference").toLocked(); - - /** - * Search parameter: outcome - *

- * Description: The processing outcome
- * Type: token
- * Path: EligibilityResponse.outcome
- *

- */ - @SearchParamDefinition(name="outcome", path="EligibilityResponse.outcome", description="The processing outcome", type="token" ) - public static final String SP_OUTCOME = "outcome"; - /** - * Fluent Client search parameter constant for outcome - *

- * Description: The processing outcome
- * Type: token
- * Path: EligibilityResponse.outcome
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME); - - /** - * Search parameter: identifier - *

- * Description: The business identifier
- * Type: token
- * Path: EligibilityResponse.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="EligibilityResponse.identifier", description="The business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier
- * Type: token
- * Path: EligibilityResponse.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: EligibilityResponse.disposition
- *

- */ - @SearchParamDefinition(name="disposition", path="EligibilityResponse.disposition", description="The contents of the disposition message", type="string" ) - public static final String SP_DISPOSITION = "disposition"; - /** - * Fluent Client search parameter constant for disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: EligibilityResponse.disposition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Encounter.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Encounter.java deleted file mode 100644 index 940d9d1332c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Encounter.java +++ /dev/null @@ -1,3850 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * 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. - */ -@ResourceDef(name="Encounter", profile="http://hl7.org/fhir/Profile/Encounter") -public class Encounter extends DomainResource { - - public enum EncounterState { - /** - * The Encounter has not yet started. - */ - PLANNED, - /** - * The Patient is present for the encounter, however is not currently meeting with a practitioner. - */ - ARRIVED, - /** - * The Encounter has begun and the patient is present / the practitioner and the patient are meeting. - */ - INPROGRESS, - /** - * The Encounter has begun, but the patient is temporarily on leave. - */ - ONLEAVE, - /** - * The Encounter has ended. - */ - FINISHED, - /** - * The Encounter has ended before it has begun. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static EncounterState fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("arrived".equals(codeString)) - return ARRIVED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("onleave".equals(codeString)) - return ONLEAVE; - if ("finished".equals(codeString)) - return FINISHED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new FHIRException("Unknown EncounterState code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case ARRIVED: return "arrived"; - case INPROGRESS: return "in-progress"; - case ONLEAVE: return "onleave"; - case FINISHED: return "finished"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return "http://hl7.org/fhir/encounter-state"; - case ARRIVED: return "http://hl7.org/fhir/encounter-state"; - case INPROGRESS: return "http://hl7.org/fhir/encounter-state"; - case ONLEAVE: return "http://hl7.org/fhir/encounter-state"; - case FINISHED: return "http://hl7.org/fhir/encounter-state"; - case CANCELLED: return "http://hl7.org/fhir/encounter-state"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "The Encounter has not yet started."; - case ARRIVED: return "The Patient is present for the encounter, however is not currently meeting with a practitioner."; - case INPROGRESS: return "The Encounter has begun and the patient is present / the practitioner and the patient are meeting."; - case ONLEAVE: return "The Encounter has begun, but the patient is temporarily on leave."; - case FINISHED: return "The Encounter has ended."; - case CANCELLED: return "The Encounter has ended before it has begun."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case ARRIVED: return "Arrived"; - case INPROGRESS: return "in Progress"; - case ONLEAVE: return "On Leave"; - case FINISHED: return "Finished"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class EncounterStateEnumFactory implements EnumFactory { - public EncounterState fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EncounterState.PLANNED; - if ("arrived".equals(codeString)) - return EncounterState.ARRIVED; - if ("in-progress".equals(codeString)) - return EncounterState.INPROGRESS; - if ("onleave".equals(codeString)) - return EncounterState.ONLEAVE; - if ("finished".equals(codeString)) - return EncounterState.FINISHED; - if ("cancelled".equals(codeString)) - return EncounterState.CANCELLED; - throw new IllegalArgumentException("Unknown EncounterState code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return new Enumeration(this, EncounterState.PLANNED); - if ("arrived".equals(codeString)) - return new Enumeration(this, EncounterState.ARRIVED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, EncounterState.INPROGRESS); - if ("onleave".equals(codeString)) - return new Enumeration(this, EncounterState.ONLEAVE); - if ("finished".equals(codeString)) - return new Enumeration(this, EncounterState.FINISHED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, EncounterState.CANCELLED); - throw new FHIRException("Unknown EncounterState code '"+codeString+"'"); - } - public String toCode(EncounterState code) { - if (code == EncounterState.PLANNED) - return "planned"; - if (code == EncounterState.ARRIVED) - return "arrived"; - if (code == EncounterState.INPROGRESS) - return "in-progress"; - if (code == EncounterState.ONLEAVE) - return "onleave"; - if (code == EncounterState.FINISHED) - return "finished"; - if (code == EncounterState.CANCELLED) - return "cancelled"; - return "?"; - } - public String toSystem(EncounterState code) { - return code.getSystem(); - } - } - - public enum EncounterClass { - /** - * An encounter during which the patient is hospitalized and stays overnight. - */ - INPATIENT, - /** - * An encounter during which the patient is not hospitalized overnight. - */ - OUTPATIENT, - /** - * An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit. - */ - AMBULATORY, - /** - * An encounter in the Emergency Care Department. - */ - EMERGENCY, - /** - * An encounter where the practitioner visits the patient at his/her home. - */ - HOME, - /** - * An encounter taking place outside the regular environment for giving care. - */ - FIELD, - /** - * An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight. - */ - DAYTIME, - /** - * An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact. - */ - VIRTUAL, - /** - * Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static EncounterClass fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("inpatient".equals(codeString)) - return INPATIENT; - if ("outpatient".equals(codeString)) - return OUTPATIENT; - if ("ambulatory".equals(codeString)) - return AMBULATORY; - if ("emergency".equals(codeString)) - return EMERGENCY; - if ("home".equals(codeString)) - return HOME; - if ("field".equals(codeString)) - return FIELD; - if ("daytime".equals(codeString)) - return DAYTIME; - if ("virtual".equals(codeString)) - return VIRTUAL; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown EncounterClass code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPATIENT: return "inpatient"; - case OUTPATIENT: return "outpatient"; - case AMBULATORY: return "ambulatory"; - case EMERGENCY: return "emergency"; - case HOME: return "home"; - case FIELD: return "field"; - case DAYTIME: return "daytime"; - case VIRTUAL: return "virtual"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPATIENT: return "http://hl7.org/fhir/encounter-class"; - case OUTPATIENT: return "http://hl7.org/fhir/encounter-class"; - case AMBULATORY: return "http://hl7.org/fhir/encounter-class"; - case EMERGENCY: return "http://hl7.org/fhir/encounter-class"; - case HOME: return "http://hl7.org/fhir/encounter-class"; - case FIELD: return "http://hl7.org/fhir/encounter-class"; - case DAYTIME: return "http://hl7.org/fhir/encounter-class"; - case VIRTUAL: return "http://hl7.org/fhir/encounter-class"; - case OTHER: return "http://hl7.org/fhir/encounter-class"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPATIENT: return "An encounter during which the patient is hospitalized and stays overnight."; - case OUTPATIENT: return "An encounter during which the patient is not hospitalized overnight."; - case AMBULATORY: return "An encounter where the patient visits the practitioner in his/her office, e.g. a G.P. visit."; - case EMERGENCY: return "An encounter in the Emergency Care Department."; - case HOME: return "An encounter where the practitioner visits the patient at his/her home."; - case FIELD: return "An encounter taking place outside the regular environment for giving care."; - case DAYTIME: return "An encounter where the patient needs more prolonged treatment or investigations than outpatients, but who do not need to stay in the hospital overnight."; - case VIRTUAL: return "An encounter that takes place where the patient and practitioner do not physically meet but use electronic means for contact."; - case OTHER: return "Any other encounter type that is not described by one of the other values. Where this is used it is expected that an implementer will include an extension value to define what the actual other type is."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPATIENT: return "Inpatient"; - case OUTPATIENT: return "Outpatient"; - case AMBULATORY: return "Ambulatory"; - case EMERGENCY: return "Emergency"; - case HOME: return "Home"; - case FIELD: return "Field"; - case DAYTIME: return "Daytime"; - case VIRTUAL: return "Virtual"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class EncounterClassEnumFactory implements EnumFactory { - public EncounterClass fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("inpatient".equals(codeString)) - return EncounterClass.INPATIENT; - if ("outpatient".equals(codeString)) - return EncounterClass.OUTPATIENT; - if ("ambulatory".equals(codeString)) - return EncounterClass.AMBULATORY; - if ("emergency".equals(codeString)) - return EncounterClass.EMERGENCY; - if ("home".equals(codeString)) - return EncounterClass.HOME; - if ("field".equals(codeString)) - return EncounterClass.FIELD; - if ("daytime".equals(codeString)) - return EncounterClass.DAYTIME; - if ("virtual".equals(codeString)) - return EncounterClass.VIRTUAL; - if ("other".equals(codeString)) - return EncounterClass.OTHER; - throw new IllegalArgumentException("Unknown EncounterClass code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("inpatient".equals(codeString)) - return new Enumeration(this, EncounterClass.INPATIENT); - if ("outpatient".equals(codeString)) - return new Enumeration(this, EncounterClass.OUTPATIENT); - if ("ambulatory".equals(codeString)) - return new Enumeration(this, EncounterClass.AMBULATORY); - if ("emergency".equals(codeString)) - return new Enumeration(this, EncounterClass.EMERGENCY); - if ("home".equals(codeString)) - return new Enumeration(this, EncounterClass.HOME); - if ("field".equals(codeString)) - return new Enumeration(this, EncounterClass.FIELD); - if ("daytime".equals(codeString)) - return new Enumeration(this, EncounterClass.DAYTIME); - if ("virtual".equals(codeString)) - return new Enumeration(this, EncounterClass.VIRTUAL); - if ("other".equals(codeString)) - return new Enumeration(this, EncounterClass.OTHER); - throw new FHIRException("Unknown EncounterClass code '"+codeString+"'"); - } - public String toCode(EncounterClass code) { - if (code == EncounterClass.INPATIENT) - return "inpatient"; - if (code == EncounterClass.OUTPATIENT) - return "outpatient"; - if (code == EncounterClass.AMBULATORY) - return "ambulatory"; - if (code == EncounterClass.EMERGENCY) - return "emergency"; - if (code == EncounterClass.HOME) - return "home"; - if (code == EncounterClass.FIELD) - return "field"; - if (code == EncounterClass.DAYTIME) - return "daytime"; - if (code == EncounterClass.VIRTUAL) - return "virtual"; - if (code == EncounterClass.OTHER) - return "other"; - return "?"; - } - public String toSystem(EncounterClass code) { - return code.getSystem(); - } - } - - public enum EncounterLocationStatus { - /** - * The patient is planned to be moved to this location at some point in the future. - */ - PLANNED, - /** - * The patient is currently at this location, or was between the period specified. - -A system may update these records when the patient leaves the location to either reserved, or completed - */ - ACTIVE, - /** - * This location is held empty for this patient. - */ - RESERVED, - /** - * The patient was at this location during the period specified. - -Not to be used when the patient is currently at the location - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - public static EncounterLocationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("active".equals(codeString)) - return ACTIVE; - if ("reserved".equals(codeString)) - return RESERVED; - if ("completed".equals(codeString)) - return COMPLETED; - throw new FHIRException("Unknown EncounterLocationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case ACTIVE: return "active"; - case RESERVED: return "reserved"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return "http://hl7.org/fhir/encounter-location-status"; - case ACTIVE: return "http://hl7.org/fhir/encounter-location-status"; - case RESERVED: return "http://hl7.org/fhir/encounter-location-status"; - case COMPLETED: return "http://hl7.org/fhir/encounter-location-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "The patient is planned to be moved to this location at some point in the future."; - case ACTIVE: return "The patient is currently at this location, or was between the period specified.\n\nA system may update these records when the patient leaves the location to either reserved, or completed"; - case RESERVED: return "This location is held empty for this patient."; - case COMPLETED: return "The patient was at this location during the period specified.\n\nNot to be used when the patient is currently at the location"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case ACTIVE: return "Active"; - case RESERVED: return "Reserved"; - case COMPLETED: return "Completed"; - default: return "?"; - } - } - } - - public static class EncounterLocationStatusEnumFactory implements EnumFactory { - public EncounterLocationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EncounterLocationStatus.PLANNED; - if ("active".equals(codeString)) - return EncounterLocationStatus.ACTIVE; - if ("reserved".equals(codeString)) - return EncounterLocationStatus.RESERVED; - if ("completed".equals(codeString)) - return EncounterLocationStatus.COMPLETED; - throw new IllegalArgumentException("Unknown EncounterLocationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return new Enumeration(this, EncounterLocationStatus.PLANNED); - if ("active".equals(codeString)) - return new Enumeration(this, EncounterLocationStatus.ACTIVE); - if ("reserved".equals(codeString)) - return new Enumeration(this, EncounterLocationStatus.RESERVED); - if ("completed".equals(codeString)) - return new Enumeration(this, EncounterLocationStatus.COMPLETED); - throw new FHIRException("Unknown EncounterLocationStatus code '"+codeString+"'"); - } - public String toCode(EncounterLocationStatus code) { - if (code == EncounterLocationStatus.PLANNED) - return "planned"; - if (code == EncounterLocationStatus.ACTIVE) - return "active"; - if (code == EncounterLocationStatus.RESERVED) - return "reserved"; - if (code == EncounterLocationStatus.COMPLETED) - return "completed"; - return "?"; - } - public String toSystem(EncounterLocationStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class EncounterStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * planned | arrived | in-progress | onleave | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) - protected Enumeration status; - - /** - * The time that the episode was in the specified status. - */ - @Child(name = "period", type = {Period.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The time that the episode was in the specified status", formalDefinition="The time that the episode was in the specified status." ) - protected Period period; - - private static final long serialVersionUID = 919229161L; - - /** - * Constructor - */ - public EncounterStatusHistoryComponent() { - super(); - } - - /** - * Constructor - */ - public EncounterStatusHistoryComponent(Enumeration status, Period period) { - super(); - this.status = status; - this.period = period; - } - - /** - * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EncounterStateEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EncounterStatusHistoryComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | arrived | in-progress | onleave | finished | cancelled. - */ - public EncounterState getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | arrived | in-progress | onleave | finished | cancelled. - */ - public EncounterStatusHistoryComponent setStatus(EncounterState value) { - if (this.status == null) - this.status = new Enumeration(new EncounterStateEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (The time that the episode was in the specified status.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterStatusHistoryComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The time that the episode was in the specified status.) - */ - public EncounterStatusHistoryComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "The time that the episode was in the specified status.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -892481550: // status - this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("status")) - this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Encounter.status"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public EncounterStatusHistoryComponent copy() { - EncounterStatusHistoryComponent dst = new EncounterStatusHistoryComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterStatusHistoryComponent)) - return false; - EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; - return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterStatusHistoryComponent)) - return false; - EncounterStatusHistoryComponent o = (EncounterStatusHistoryComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - public String fhirType() { - return "Encounter.statusHistory"; - - } - - } - - @Block() - public static class EncounterParticipantComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Role of participant in encounter. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Role of participant in encounter", formalDefinition="Role of participant in encounter." ) - protected List type; - - /** - * The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Period of time during the encounter participant was present", formalDefinition="The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period." ) - protected Period period; - - /** - * Persons involved in the encounter other than the patient. - */ - @Child(name = "individual", type = {Practitioner.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Persons involved in the encounter other than the patient", formalDefinition="Persons involved in the encounter other than the patient." ) - protected Reference individual; - - /** - * The actual object that is the target of the reference (Persons involved in the encounter other than the patient.) - */ - protected Resource individualTarget; - - private static final long serialVersionUID = 317095765L; - - /** - * Constructor - */ - public EncounterParticipantComponent() { - super(); - } - - /** - * @return {@link #type} (Role of participant in encounter.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Role of participant in encounter.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public EncounterParticipantComponent addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterParticipantComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.) - */ - public EncounterParticipantComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #individual} (Persons involved in the encounter other than the patient.) - */ - public Reference getIndividual() { - if (this.individual == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterParticipantComponent.individual"); - else if (Configuration.doAutoCreate()) - this.individual = new Reference(); // cc - return this.individual; - } - - public boolean hasIndividual() { - return this.individual != null && !this.individual.isEmpty(); - } - - /** - * @param value {@link #individual} (Persons involved in the encounter other than the patient.) - */ - public EncounterParticipantComponent setIndividual(Reference value) { - this.individual = value; - return this; - } - - /** - * @return {@link #individual} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Persons involved in the encounter other than the patient.) - */ - public Resource getIndividualTarget() { - return this.individualTarget; - } - - /** - * @param value {@link #individual} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Persons involved in the encounter other than the patient.) - */ - public EncounterParticipantComponent setIndividualTarget(Resource value) { - this.individualTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "Role of participant in encounter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("period", "Period", "The period of time that the specified participant was present during the encounter. These can overlap or be sub-sets of the overall encounters period.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("individual", "Reference(Practitioner|RelatedPerson)", "Persons involved in the encounter other than the patient.", 0, java.lang.Integer.MAX_VALUE, individual)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -46292327: /*individual*/ return this.individual == null ? new Base[0] : new Base[] {this.individual}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.getType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -46292327: // individual - this.individual = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.getType().add(castToCodeableConcept(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("individual")) - this.individual = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return addType(); // CodeableConcept - case -991726143: return getPeriod(); // Period - case -46292327: return getIndividual(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - return addType(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("individual")) { - this.individual = new Reference(); - return this.individual; - } - else - return super.addChild(name); - } - - public EncounterParticipantComponent copy() { - EncounterParticipantComponent dst = new EncounterParticipantComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.individual = individual == null ? null : individual.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterParticipantComponent)) - return false; - EncounterParticipantComponent o = (EncounterParticipantComponent) other; - return compareDeep(type, o.type, true) && compareDeep(period, o.period, true) && compareDeep(individual, o.individual, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterParticipantComponent)) - return false; - EncounterParticipantComponent o = (EncounterParticipantComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (period == null || period.isEmpty()) - && (individual == null || individual.isEmpty()); - } - - public String fhirType() { - return "Encounter.participant"; - - } - - } - - @Block() - public static class EncounterHospitalizationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Pre-admission identifier. - */ - @Child(name = "preAdmissionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Pre-admission identifier", formalDefinition="Pre-admission identifier." ) - protected Identifier preAdmissionIdentifier; - - /** - * The location from which the patient came before admission. - */ - @Child(name = "origin", type = {Location.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The location from which the patient came before admission", formalDefinition="The location from which the patient came before admission." ) - protected Reference origin; - - /** - * The actual object that is the target of the reference (The location from which the patient came before admission.) - */ - protected Location originTarget; - - /** - * From where patient was admitted (physician referral, transfer). - */ - @Child(name = "admitSource", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="From where patient was admitted (physician referral, transfer)", formalDefinition="From where patient was admitted (physician referral, transfer)." ) - protected CodeableConcept admitSource; - - /** - * The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter. - */ - @Child(name = "admittingDiagnosis", type = {Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The admitting diagnosis as reported by admitting practitioner", formalDefinition="The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter." ) - protected List admittingDiagnosis; - /** - * The actual objects that are the target of the reference (The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) - */ - protected List admittingDiagnosisTarget; - - - /** - * Whether this hospitalization is a readmission and why if known. - */ - @Child(name = "reAdmission", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The type of hospital re-admission that has occurred (if any). If the value is absent, then this is not identified as a readmission", formalDefinition="Whether this hospitalization is a readmission and why if known." ) - protected CodeableConcept reAdmission; - - /** - * Diet preferences reported by the patient. - */ - @Child(name = "dietPreference", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Diet preferences reported by the patient", formalDefinition="Diet preferences reported by the patient." ) - protected List dietPreference; - - /** - * Special courtesies (VIP, board member). - */ - @Child(name = "specialCourtesy", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Special courtesies (VIP, board member)", formalDefinition="Special courtesies (VIP, board member)." ) - protected List specialCourtesy; - - /** - * Wheelchair, translator, stretcher, etc. - */ - @Child(name = "specialArrangement", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Wheelchair, translator, stretcher, etc.", formalDefinition="Wheelchair, translator, stretcher, etc." ) - protected List specialArrangement; - - /** - * Location to which the patient is discharged. - */ - @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Location to which the patient is discharged", formalDefinition="Location to which the patient is discharged." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Location to which the patient is discharged.) - */ - protected Location destinationTarget; - - /** - * Category or kind of location after discharge. - */ - @Child(name = "dischargeDisposition", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Category or kind of location after discharge", formalDefinition="Category or kind of location after discharge." ) - protected CodeableConcept dischargeDisposition; - - /** - * The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. - */ - @Child(name = "dischargeDiagnosis", type = {Condition.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete", formalDefinition="The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete." ) - protected List dischargeDiagnosis; - /** - * The actual objects that are the target of the reference (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - protected List dischargeDiagnosisTarget; - - - private static final long serialVersionUID = 164618034L; - - /** - * Constructor - */ - public EncounterHospitalizationComponent() { - super(); - } - - /** - * @return {@link #preAdmissionIdentifier} (Pre-admission identifier.) - */ - public Identifier getPreAdmissionIdentifier() { - if (this.preAdmissionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.preAdmissionIdentifier"); - else if (Configuration.doAutoCreate()) - this.preAdmissionIdentifier = new Identifier(); // cc - return this.preAdmissionIdentifier; - } - - public boolean hasPreAdmissionIdentifier() { - return this.preAdmissionIdentifier != null && !this.preAdmissionIdentifier.isEmpty(); - } - - /** - * @param value {@link #preAdmissionIdentifier} (Pre-admission identifier.) - */ - public EncounterHospitalizationComponent setPreAdmissionIdentifier(Identifier value) { - this.preAdmissionIdentifier = value; - return this; - } - - /** - * @return {@link #origin} (The location from which the patient came before admission.) - */ - public Reference getOrigin() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new Reference(); // cc - return this.origin; - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The location from which the patient came before admission.) - */ - public EncounterHospitalizationComponent setOrigin(Reference value) { - this.origin = value; - return this; - } - - /** - * @return {@link #origin} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location from which the patient came before admission.) - */ - public Location getOriginTarget() { - if (this.originTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.originTarget = new Location(); // aa - return this.originTarget; - } - - /** - * @param value {@link #origin} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location from which the patient came before admission.) - */ - public EncounterHospitalizationComponent setOriginTarget(Location value) { - this.originTarget = value; - return this; - } - - /** - * @return {@link #admitSource} (From where patient was admitted (physician referral, transfer).) - */ - public CodeableConcept getAdmitSource() { - if (this.admitSource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.admitSource"); - else if (Configuration.doAutoCreate()) - this.admitSource = new CodeableConcept(); // cc - return this.admitSource; - } - - public boolean hasAdmitSource() { - return this.admitSource != null && !this.admitSource.isEmpty(); - } - - /** - * @param value {@link #admitSource} (From where patient was admitted (physician referral, transfer).) - */ - public EncounterHospitalizationComponent setAdmitSource(CodeableConcept value) { - this.admitSource = value; - return this; - } - - /** - * @return {@link #admittingDiagnosis} (The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) - */ - public List getAdmittingDiagnosis() { - if (this.admittingDiagnosis == null) - this.admittingDiagnosis = new ArrayList(); - return this.admittingDiagnosis; - } - - public boolean hasAdmittingDiagnosis() { - if (this.admittingDiagnosis == null) - return false; - for (Reference item : this.admittingDiagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #admittingDiagnosis} (The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) - */ - // syntactic sugar - public Reference addAdmittingDiagnosis() { //3 - Reference t = new Reference(); - if (this.admittingDiagnosis == null) - this.admittingDiagnosis = new ArrayList(); - this.admittingDiagnosis.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addAdmittingDiagnosis(Reference t) { //3 - if (t == null) - return this; - if (this.admittingDiagnosis == null) - this.admittingDiagnosis = new ArrayList(); - this.admittingDiagnosis.add(t); - return this; - } - - /** - * @return {@link #admittingDiagnosis} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) - */ - public List getAdmittingDiagnosisTarget() { - if (this.admittingDiagnosisTarget == null) - this.admittingDiagnosisTarget = new ArrayList(); - return this.admittingDiagnosisTarget; - } - - // syntactic sugar - /** - * @return {@link #admittingDiagnosis} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.) - */ - public Condition addAdmittingDiagnosisTarget() { - Condition r = new Condition(); - if (this.admittingDiagnosisTarget == null) - this.admittingDiagnosisTarget = new ArrayList(); - this.admittingDiagnosisTarget.add(r); - return r; - } - - /** - * @return {@link #reAdmission} (Whether this hospitalization is a readmission and why if known.) - */ - public CodeableConcept getReAdmission() { - if (this.reAdmission == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.reAdmission"); - else if (Configuration.doAutoCreate()) - this.reAdmission = new CodeableConcept(); // cc - return this.reAdmission; - } - - public boolean hasReAdmission() { - return this.reAdmission != null && !this.reAdmission.isEmpty(); - } - - /** - * @param value {@link #reAdmission} (Whether this hospitalization is a readmission and why if known.) - */ - public EncounterHospitalizationComponent setReAdmission(CodeableConcept value) { - this.reAdmission = value; - return this; - } - - /** - * @return {@link #dietPreference} (Diet preferences reported by the patient.) - */ - public List getDietPreference() { - if (this.dietPreference == null) - this.dietPreference = new ArrayList(); - return this.dietPreference; - } - - public boolean hasDietPreference() { - if (this.dietPreference == null) - return false; - for (CodeableConcept item : this.dietPreference) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dietPreference} (Diet preferences reported by the patient.) - */ - // syntactic sugar - public CodeableConcept addDietPreference() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.dietPreference == null) - this.dietPreference = new ArrayList(); - this.dietPreference.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addDietPreference(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.dietPreference == null) - this.dietPreference = new ArrayList(); - this.dietPreference.add(t); - return this; - } - - /** - * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) - */ - public List getSpecialCourtesy() { - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - return this.specialCourtesy; - } - - public boolean hasSpecialCourtesy() { - if (this.specialCourtesy == null) - return false; - for (CodeableConcept item : this.specialCourtesy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialCourtesy} (Special courtesies (VIP, board member).) - */ - // syntactic sugar - public CodeableConcept addSpecialCourtesy() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - this.specialCourtesy.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addSpecialCourtesy(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialCourtesy == null) - this.specialCourtesy = new ArrayList(); - this.specialCourtesy.add(t); - return this; - } - - /** - * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) - */ - public List getSpecialArrangement() { - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - return this.specialArrangement; - } - - public boolean hasSpecialArrangement() { - if (this.specialArrangement == null) - return false; - for (CodeableConcept item : this.specialArrangement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialArrangement} (Wheelchair, translator, stretcher, etc.) - */ - // syntactic sugar - public CodeableConcept addSpecialArrangement() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - this.specialArrangement.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addSpecialArrangement(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialArrangement == null) - this.specialArrangement = new ArrayList(); - this.specialArrangement.add(t); - return this; - } - - /** - * @return {@link #destination} (Location to which the patient is discharged.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Location to which the patient is discharged.) - */ - public EncounterHospitalizationComponent setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Location to which the patient is discharged.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Location to which the patient is discharged.) - */ - public EncounterHospitalizationComponent setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #dischargeDisposition} (Category or kind of location after discharge.) - */ - public CodeableConcept getDischargeDisposition() { - if (this.dischargeDisposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterHospitalizationComponent.dischargeDisposition"); - else if (Configuration.doAutoCreate()) - this.dischargeDisposition = new CodeableConcept(); // cc - return this.dischargeDisposition; - } - - public boolean hasDischargeDisposition() { - return this.dischargeDisposition != null && !this.dischargeDisposition.isEmpty(); - } - - /** - * @param value {@link #dischargeDisposition} (Category or kind of location after discharge.) - */ - public EncounterHospitalizationComponent setDischargeDisposition(CodeableConcept value) { - this.dischargeDisposition = value; - return this; - } - - /** - * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public List getDischargeDiagnosis() { - if (this.dischargeDiagnosis == null) - this.dischargeDiagnosis = new ArrayList(); - return this.dischargeDiagnosis; - } - - public boolean hasDischargeDiagnosis() { - if (this.dischargeDiagnosis == null) - return false; - for (Reference item : this.dischargeDiagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dischargeDiagnosis} (The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - // syntactic sugar - public Reference addDischargeDiagnosis() { //3 - Reference t = new Reference(); - if (this.dischargeDiagnosis == null) - this.dischargeDiagnosis = new ArrayList(); - this.dischargeDiagnosis.add(t); - return t; - } - - // syntactic sugar - public EncounterHospitalizationComponent addDischargeDiagnosis(Reference t) { //3 - if (t == null) - return this; - if (this.dischargeDiagnosis == null) - this.dischargeDiagnosis = new ArrayList(); - this.dischargeDiagnosis.add(t); - return this; - } - - /** - * @return {@link #dischargeDiagnosis} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public List getDischargeDiagnosisTarget() { - if (this.dischargeDiagnosisTarget == null) - this.dischargeDiagnosisTarget = new ArrayList(); - return this.dischargeDiagnosisTarget; - } - - // syntactic sugar - /** - * @return {@link #dischargeDiagnosis} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.) - */ - public Condition addDischargeDiagnosisTarget() { - Condition r = new Condition(); - if (this.dischargeDiagnosisTarget == null) - this.dischargeDiagnosisTarget = new ArrayList(); - this.dischargeDiagnosisTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("preAdmissionIdentifier", "Identifier", "Pre-admission identifier.", 0, java.lang.Integer.MAX_VALUE, preAdmissionIdentifier)); - childrenList.add(new Property("origin", "Reference(Location)", "The location from which the patient came before admission.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("admitSource", "CodeableConcept", "From where patient was admitted (physician referral, transfer).", 0, java.lang.Integer.MAX_VALUE, admitSource)); - childrenList.add(new Property("admittingDiagnosis", "Reference(Condition)", "The admitting diagnosis field is used to record the diagnosis codes as reported by admitting practitioner. This could be different or in addition to the conditions reported as reason-condition(s) for the encounter.", 0, java.lang.Integer.MAX_VALUE, admittingDiagnosis)); - childrenList.add(new Property("reAdmission", "CodeableConcept", "Whether this hospitalization is a readmission and why if known.", 0, java.lang.Integer.MAX_VALUE, reAdmission)); - childrenList.add(new Property("dietPreference", "CodeableConcept", "Diet preferences reported by the patient.", 0, java.lang.Integer.MAX_VALUE, dietPreference)); - childrenList.add(new Property("specialCourtesy", "CodeableConcept", "Special courtesies (VIP, board member).", 0, java.lang.Integer.MAX_VALUE, specialCourtesy)); - childrenList.add(new Property("specialArrangement", "CodeableConcept", "Wheelchair, translator, stretcher, etc.", 0, java.lang.Integer.MAX_VALUE, specialArrangement)); - childrenList.add(new Property("destination", "Reference(Location)", "Location to which the patient is discharged.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("dischargeDisposition", "CodeableConcept", "Category or kind of location after discharge.", 0, java.lang.Integer.MAX_VALUE, dischargeDisposition)); - childrenList.add(new Property("dischargeDiagnosis", "Reference(Condition)", "The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete.", 0, java.lang.Integer.MAX_VALUE, dischargeDiagnosis)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -965394961: /*preAdmissionIdentifier*/ return this.preAdmissionIdentifier == null ? new Base[0] : new Base[] {this.preAdmissionIdentifier}; // Identifier - case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // Reference - case 538887120: /*admitSource*/ return this.admitSource == null ? new Base[0] : new Base[] {this.admitSource}; // CodeableConcept - case 2048045678: /*admittingDiagnosis*/ return this.admittingDiagnosis == null ? new Base[0] : this.admittingDiagnosis.toArray(new Base[this.admittingDiagnosis.size()]); // Reference - case 669348630: /*reAdmission*/ return this.reAdmission == null ? new Base[0] : new Base[] {this.reAdmission}; // CodeableConcept - case -1360641041: /*dietPreference*/ return this.dietPreference == null ? new Base[0] : this.dietPreference.toArray(new Base[this.dietPreference.size()]); // CodeableConcept - case 1583588345: /*specialCourtesy*/ return this.specialCourtesy == null ? new Base[0] : this.specialCourtesy.toArray(new Base[this.specialCourtesy.size()]); // CodeableConcept - case 47410321: /*specialArrangement*/ return this.specialArrangement == null ? new Base[0] : this.specialArrangement.toArray(new Base[this.specialArrangement.size()]); // CodeableConcept - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference - case 528065941: /*dischargeDisposition*/ return this.dischargeDisposition == null ? new Base[0] : new Base[] {this.dischargeDisposition}; // CodeableConcept - case -1985183665: /*dischargeDiagnosis*/ return this.dischargeDiagnosis == null ? new Base[0] : this.dischargeDiagnosis.toArray(new Base[this.dischargeDiagnosis.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -965394961: // preAdmissionIdentifier - this.preAdmissionIdentifier = castToIdentifier(value); // Identifier - break; - case -1008619738: // origin - this.origin = castToReference(value); // Reference - break; - case 538887120: // admitSource - this.admitSource = castToCodeableConcept(value); // CodeableConcept - break; - case 2048045678: // admittingDiagnosis - this.getAdmittingDiagnosis().add(castToReference(value)); // Reference - break; - case 669348630: // reAdmission - this.reAdmission = castToCodeableConcept(value); // CodeableConcept - break; - case -1360641041: // dietPreference - this.getDietPreference().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1583588345: // specialCourtesy - this.getSpecialCourtesy().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 47410321: // specialArrangement - this.getSpecialArrangement().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1429847026: // destination - this.destination = castToReference(value); // Reference - break; - case 528065941: // dischargeDisposition - this.dischargeDisposition = castToCodeableConcept(value); // CodeableConcept - break; - case -1985183665: // dischargeDiagnosis - this.getDischargeDiagnosis().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("preAdmissionIdentifier")) - this.preAdmissionIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("origin")) - this.origin = castToReference(value); // Reference - else if (name.equals("admitSource")) - this.admitSource = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("admittingDiagnosis")) - this.getAdmittingDiagnosis().add(castToReference(value)); - else if (name.equals("reAdmission")) - this.reAdmission = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("dietPreference")) - this.getDietPreference().add(castToCodeableConcept(value)); - else if (name.equals("specialCourtesy")) - this.getSpecialCourtesy().add(castToCodeableConcept(value)); - else if (name.equals("specialArrangement")) - this.getSpecialArrangement().add(castToCodeableConcept(value)); - else if (name.equals("destination")) - this.destination = castToReference(value); // Reference - else if (name.equals("dischargeDisposition")) - this.dischargeDisposition = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("dischargeDiagnosis")) - this.getDischargeDiagnosis().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -965394961: return getPreAdmissionIdentifier(); // Identifier - case -1008619738: return getOrigin(); // Reference - case 538887120: return getAdmitSource(); // CodeableConcept - case 2048045678: return addAdmittingDiagnosis(); // Reference - case 669348630: return getReAdmission(); // CodeableConcept - case -1360641041: return addDietPreference(); // CodeableConcept - case 1583588345: return addSpecialCourtesy(); // CodeableConcept - case 47410321: return addSpecialArrangement(); // CodeableConcept - case -1429847026: return getDestination(); // Reference - case 528065941: return getDischargeDisposition(); // CodeableConcept - case -1985183665: return addDischargeDiagnosis(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("preAdmissionIdentifier")) { - this.preAdmissionIdentifier = new Identifier(); - return this.preAdmissionIdentifier; - } - else if (name.equals("origin")) { - this.origin = new Reference(); - return this.origin; - } - else if (name.equals("admitSource")) { - this.admitSource = new CodeableConcept(); - return this.admitSource; - } - else if (name.equals("admittingDiagnosis")) { - return addAdmittingDiagnosis(); - } - else if (name.equals("reAdmission")) { - this.reAdmission = new CodeableConcept(); - return this.reAdmission; - } - else if (name.equals("dietPreference")) { - return addDietPreference(); - } - else if (name.equals("specialCourtesy")) { - return addSpecialCourtesy(); - } - else if (name.equals("specialArrangement")) { - return addSpecialArrangement(); - } - else if (name.equals("destination")) { - this.destination = new Reference(); - return this.destination; - } - else if (name.equals("dischargeDisposition")) { - this.dischargeDisposition = new CodeableConcept(); - return this.dischargeDisposition; - } - else if (name.equals("dischargeDiagnosis")) { - return addDischargeDiagnosis(); - } - else - return super.addChild(name); - } - - public EncounterHospitalizationComponent copy() { - EncounterHospitalizationComponent dst = new EncounterHospitalizationComponent(); - copyValues(dst); - dst.preAdmissionIdentifier = preAdmissionIdentifier == null ? null : preAdmissionIdentifier.copy(); - dst.origin = origin == null ? null : origin.copy(); - dst.admitSource = admitSource == null ? null : admitSource.copy(); - if (admittingDiagnosis != null) { - dst.admittingDiagnosis = new ArrayList(); - for (Reference i : admittingDiagnosis) - dst.admittingDiagnosis.add(i.copy()); - }; - dst.reAdmission = reAdmission == null ? null : reAdmission.copy(); - if (dietPreference != null) { - dst.dietPreference = new ArrayList(); - for (CodeableConcept i : dietPreference) - dst.dietPreference.add(i.copy()); - }; - if (specialCourtesy != null) { - dst.specialCourtesy = new ArrayList(); - for (CodeableConcept i : specialCourtesy) - dst.specialCourtesy.add(i.copy()); - }; - if (specialArrangement != null) { - dst.specialArrangement = new ArrayList(); - for (CodeableConcept i : specialArrangement) - dst.specialArrangement.add(i.copy()); - }; - dst.destination = destination == null ? null : destination.copy(); - dst.dischargeDisposition = dischargeDisposition == null ? null : dischargeDisposition.copy(); - if (dischargeDiagnosis != null) { - dst.dischargeDiagnosis = new ArrayList(); - for (Reference i : dischargeDiagnosis) - dst.dischargeDiagnosis.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterHospitalizationComponent)) - return false; - EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; - return compareDeep(preAdmissionIdentifier, o.preAdmissionIdentifier, true) && compareDeep(origin, o.origin, true) - && compareDeep(admitSource, o.admitSource, true) && compareDeep(admittingDiagnosis, o.admittingDiagnosis, true) - && compareDeep(reAdmission, o.reAdmission, true) && compareDeep(dietPreference, o.dietPreference, true) - && compareDeep(specialCourtesy, o.specialCourtesy, true) && compareDeep(specialArrangement, o.specialArrangement, true) - && compareDeep(destination, o.destination, true) && compareDeep(dischargeDisposition, o.dischargeDisposition, true) - && compareDeep(dischargeDiagnosis, o.dischargeDiagnosis, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterHospitalizationComponent)) - return false; - EncounterHospitalizationComponent o = (EncounterHospitalizationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (preAdmissionIdentifier == null || preAdmissionIdentifier.isEmpty()) - && (origin == null || origin.isEmpty()) && (admitSource == null || admitSource.isEmpty()) - && (admittingDiagnosis == null || admittingDiagnosis.isEmpty()) && (reAdmission == null || reAdmission.isEmpty()) - && (dietPreference == null || dietPreference.isEmpty()) && (specialCourtesy == null || specialCourtesy.isEmpty()) - && (specialArrangement == null || specialArrangement.isEmpty()) && (destination == null || destination.isEmpty()) - && (dischargeDisposition == null || dischargeDisposition.isEmpty()) && (dischargeDiagnosis == null || dischargeDiagnosis.isEmpty()) - ; - } - - public String fhirType() { - return "Encounter.hospitalization"; - - } - - } - - @Block() - public static class EncounterLocationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The location where the encounter takes place. - */ - @Child(name = "location", type = {Location.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Location the encounter takes place", formalDefinition="The location where the encounter takes place." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where the encounter takes place.) - */ - protected Location locationTarget; - - /** - * The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="planned | active | reserved | completed", formalDefinition="The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time." ) - protected Enumeration status; - - /** - * Time period during which the patient was present at the location. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Time period during which the patient was present at the location", formalDefinition="Time period during which the patient was present at the location." ) - protected Period period; - - private static final long serialVersionUID = -322984880L; - - /** - * Constructor - */ - public EncounterLocationComponent() { - super(); - } - - /** - * Constructor - */ - public EncounterLocationComponent(Reference location) { - super(); - this.location = location; - } - - /** - * @return {@link #location} (The location where the encounter takes place.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where the encounter takes place.) - */ - public EncounterLocationComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the encounter takes place.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the encounter takes place.) - */ - public EncounterLocationComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EncounterLocationComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. - */ - public EncounterLocationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time. - */ - public EncounterLocationComponent setStatus(EncounterLocationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new EncounterLocationStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period during which the patient was present at the location.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EncounterLocationComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period during which the patient was present at the location.) - */ - public EncounterLocationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("location", "Reference(Location)", "The location where the encounter takes place.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("status", "code", "The status of the participants' presence at the specified location during the period specified. If the participant is is no longer at the location, then the period will have an end date/time.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "Time period during which the patient was present at the location.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new EncounterLocationStatusEnumFactory().fromType(value); // Enumeration - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new EncounterLocationStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1901043637: return getLocation(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Encounter.status"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public EncounterLocationComponent copy() { - EncounterLocationComponent dst = new EncounterLocationComponent(); - copyValues(dst); - dst.location = location == null ? null : location.copy(); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EncounterLocationComponent)) - return false; - EncounterLocationComponent o = (EncounterLocationComponent) other; - return compareDeep(location, o.location, true) && compareDeep(status, o.status, true) && compareDeep(period, o.period, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EncounterLocationComponent)) - return false; - EncounterLocationComponent o = (EncounterLocationComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (location == null || location.isEmpty()) && (status == null || status.isEmpty()) - && (period == null || period.isEmpty()); - } - - public String fhirType() { - return "Encounter.location"; - - } - - } - - /** - * Identifier(s) by which this encounter is known. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Identifier(s) by which this encounter is known", formalDefinition="Identifier(s) by which this encounter is known." ) - protected List identifier; - - /** - * planned | arrived | in-progress | onleave | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="planned | arrived | in-progress | onleave | finished | cancelled", formalDefinition="planned | arrived | in-progress | onleave | finished | cancelled." ) - protected Enumeration status; - - /** - * The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them. - */ - @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="List of past encounter statuses", formalDefinition="The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them." ) - protected List statusHistory; - - /** - * inpatient | outpatient | ambulatory | emergency +. - */ - @Child(name = "class", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="inpatient | outpatient | ambulatory | emergency +", formalDefinition="inpatient | outpatient | ambulatory | emergency +." ) - protected Enumeration class_; - - /** - * Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation). - */ - @Child(name = "type", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Specific type of encounter", formalDefinition="Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation)." ) - protected List type; - - /** - * Indicates the urgency of the encounter. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates the urgency of the encounter", formalDefinition="Indicates the urgency of the encounter." ) - protected CodeableConcept priority; - - /** - * The patient present at the encounter. - */ - @Child(name = "patient", type = {Patient.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The patient present at the encounter", formalDefinition="The patient present at the encounter." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient present at the encounter.) - */ - protected Patient patientTarget; - - /** - * Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years). - */ - @Child(name = "episodeOfCare", type = {EpisodeOfCare.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Episode(s) of care that this encounter should be recorded against", formalDefinition="Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years)." ) - protected List episodeOfCare; - /** - * The actual objects that are the target of the reference (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) - */ - protected List episodeOfCareTarget; - - - /** - * The referral request this encounter satisfies (incoming referral). - */ - @Child(name = "incomingReferral", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The ReferralRequest that initiated this encounter", formalDefinition="The referral request this encounter satisfies (incoming referral)." ) - protected List incomingReferral; - /** - * The actual objects that are the target of the reference (The referral request this encounter satisfies (incoming referral).) - */ - protected List incomingReferralTarget; - - - /** - * The list of people responsible for providing the service. - */ - @Child(name = "participant", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of participants involved in the encounter", formalDefinition="The list of people responsible for providing the service." ) - protected List participant; - - /** - * The appointment that scheduled this encounter. - */ - @Child(name = "appointment", type = {Appointment.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The appointment that scheduled this encounter", formalDefinition="The appointment that scheduled this encounter." ) - protected Reference appointment; - - /** - * The actual object that is the target of the reference (The appointment that scheduled this encounter.) - */ - protected Appointment appointmentTarget; - - /** - * The start and end time of the encounter. - */ - @Child(name = "period", type = {Period.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The start and end time of the encounter", formalDefinition="The start and end time of the encounter." ) - protected Period period; - - /** - * Quantity of time the encounter lasted. This excludes the time during leaves of absence. - */ - @Child(name = "length", type = {Duration.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Quantity of time the encounter lasted (less time absent)", formalDefinition="Quantity of time the encounter lasted. This excludes the time during leaves of absence." ) - protected Duration length; - - /** - * Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List reason; - - /** - * Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. - */ - @Child(name = "indication", type = {Condition.class, Procedure.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure." ) - protected List indication; - /** - * The actual objects that are the target of the reference (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - protected List indicationTarget; - - - /** - * Details about the admission to a healthcare service. - */ - @Child(name = "hospitalization", type = {}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Details about the admission to a healthcare service", formalDefinition="Details about the admission to a healthcare service." ) - protected EncounterHospitalizationComponent hospitalization; - - /** - * List of locations where the patient has been during this encounter. - */ - @Child(name = "location", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="List of locations where the patient has been", formalDefinition="List of locations where the patient has been during this encounter." ) - protected List location; - - /** - * An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization. - */ - @Child(name = "serviceProvider", type = {Organization.class}, order=17, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The custodian organization of this Encounter record", formalDefinition="An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization." ) - protected Reference serviceProvider; - - /** - * The actual object that is the target of the reference (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - protected Organization serviceProviderTarget; - - /** - * Another Encounter of which this encounter is a part of (administratively or in time). - */ - @Child(name = "partOf", type = {Encounter.class}, order=18, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Another Encounter this encounter is part of", formalDefinition="Another Encounter of which this encounter is a part of (administratively or in time)." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - protected Encounter partOfTarget; - - private static final long serialVersionUID = 929562300L; - - /** - * Constructor - */ - public Encounter() { - super(); - } - - /** - * Constructor - */ - public Encounter(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this encounter is known.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this encounter is known.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Encounter addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EncounterStateEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | arrived | in-progress | onleave | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Encounter setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | arrived | in-progress | onleave | finished | cancelled. - */ - public EncounterState getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | arrived | in-progress | onleave | finished | cancelled. - */ - public Encounter setStatus(EncounterState value) { - if (this.status == null) - this.status = new Enumeration(new EncounterStateEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #statusHistory} (The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.) - */ - public List getStatusHistory() { - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - return this.statusHistory; - } - - public boolean hasStatusHistory() { - if (this.statusHistory == null) - return false; - for (EncounterStatusHistoryComponent item : this.statusHistory) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #statusHistory} (The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.) - */ - // syntactic sugar - public EncounterStatusHistoryComponent addStatusHistory() { //3 - EncounterStatusHistoryComponent t = new EncounterStatusHistoryComponent(); - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return t; - } - - // syntactic sugar - public Encounter addStatusHistory(EncounterStatusHistoryComponent t) { //3 - if (t == null) - return this; - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return this; - } - - /** - * @return {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value - */ - public Enumeration getClass_Element() { - if (this.class_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.class_"); - else if (Configuration.doAutoCreate()) - this.class_ = new Enumeration(new EncounterClassEnumFactory()); // bb - return this.class_; - } - - public boolean hasClass_Element() { - return this.class_ != null && !this.class_.isEmpty(); - } - - public boolean hasClass_() { - return this.class_ != null && !this.class_.isEmpty(); - } - - /** - * @param value {@link #class_} (inpatient | outpatient | ambulatory | emergency +.). This is the underlying object with id, value and extensions. The accessor "getClass_" gives direct access to the value - */ - public Encounter setClass_Element(Enumeration value) { - this.class_ = value; - return this; - } - - /** - * @return inpatient | outpatient | ambulatory | emergency +. - */ - public EncounterClass getClass_() { - return this.class_ == null ? null : this.class_.getValue(); - } - - /** - * @param value inpatient | outpatient | ambulatory | emergency +. - */ - public Encounter setClass_(EncounterClass value) { - if (value == null) - this.class_ = null; - else { - if (this.class_ == null) - this.class_ = new Enumeration(new EncounterClassEnumFactory()); - this.class_.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public Encounter addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #priority} (Indicates the urgency of the encounter.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Indicates the urgency of the encounter.) - */ - public Encounter setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #patient} (The patient present at the encounter.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient present at the encounter.) - */ - public Encounter setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient present at the encounter.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient present at the encounter.) - */ - public Encounter setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) - */ - public List getEpisodeOfCare() { - if (this.episodeOfCare == null) - this.episodeOfCare = new ArrayList(); - return this.episodeOfCare; - } - - public boolean hasEpisodeOfCare() { - if (this.episodeOfCare == null) - return false; - for (Reference item : this.episodeOfCare) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #episodeOfCare} (Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) - */ - // syntactic sugar - public Reference addEpisodeOfCare() { //3 - Reference t = new Reference(); - if (this.episodeOfCare == null) - this.episodeOfCare = new ArrayList(); - this.episodeOfCare.add(t); - return t; - } - - // syntactic sugar - public Encounter addEpisodeOfCare(Reference t) { //3 - if (t == null) - return this; - if (this.episodeOfCare == null) - this.episodeOfCare = new ArrayList(); - this.episodeOfCare.add(t); - return this; - } - - /** - * @return {@link #episodeOfCare} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) - */ - public List getEpisodeOfCareTarget() { - if (this.episodeOfCareTarget == null) - this.episodeOfCareTarget = new ArrayList(); - return this.episodeOfCareTarget; - } - - // syntactic sugar - /** - * @return {@link #episodeOfCare} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).) - */ - public EpisodeOfCare addEpisodeOfCareTarget() { - EpisodeOfCare r = new EpisodeOfCare(); - if (this.episodeOfCareTarget == null) - this.episodeOfCareTarget = new ArrayList(); - this.episodeOfCareTarget.add(r); - return r; - } - - /** - * @return {@link #incomingReferral} (The referral request this encounter satisfies (incoming referral).) - */ - public List getIncomingReferral() { - if (this.incomingReferral == null) - this.incomingReferral = new ArrayList(); - return this.incomingReferral; - } - - public boolean hasIncomingReferral() { - if (this.incomingReferral == null) - return false; - for (Reference item : this.incomingReferral) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #incomingReferral} (The referral request this encounter satisfies (incoming referral).) - */ - // syntactic sugar - public Reference addIncomingReferral() { //3 - Reference t = new Reference(); - if (this.incomingReferral == null) - this.incomingReferral = new ArrayList(); - this.incomingReferral.add(t); - return t; - } - - // syntactic sugar - public Encounter addIncomingReferral(Reference t) { //3 - if (t == null) - return this; - if (this.incomingReferral == null) - this.incomingReferral = new ArrayList(); - this.incomingReferral.add(t); - return this; - } - - /** - * @return {@link #incomingReferral} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The referral request this encounter satisfies (incoming referral).) - */ - public List getIncomingReferralTarget() { - if (this.incomingReferralTarget == null) - this.incomingReferralTarget = new ArrayList(); - return this.incomingReferralTarget; - } - - // syntactic sugar - /** - * @return {@link #incomingReferral} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The referral request this encounter satisfies (incoming referral).) - */ - public ReferralRequest addIncomingReferralTarget() { - ReferralRequest r = new ReferralRequest(); - if (this.incomingReferralTarget == null) - this.incomingReferralTarget = new ArrayList(); - this.incomingReferralTarget.add(r); - return r; - } - - /** - * @return {@link #participant} (The list of people responsible for providing the service.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (EncounterParticipantComponent item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (The list of people responsible for providing the service.) - */ - // syntactic sugar - public EncounterParticipantComponent addParticipant() { //3 - EncounterParticipantComponent t = new EncounterParticipantComponent(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public Encounter addParticipant(EncounterParticipantComponent t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #appointment} (The appointment that scheduled this encounter.) - */ - public Reference getAppointment() { - if (this.appointment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.appointment"); - else if (Configuration.doAutoCreate()) - this.appointment = new Reference(); // cc - return this.appointment; - } - - public boolean hasAppointment() { - return this.appointment != null && !this.appointment.isEmpty(); - } - - /** - * @param value {@link #appointment} (The appointment that scheduled this encounter.) - */ - public Encounter setAppointment(Reference value) { - this.appointment = value; - return this; - } - - /** - * @return {@link #appointment} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The appointment that scheduled this encounter.) - */ - public Appointment getAppointmentTarget() { - if (this.appointmentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.appointment"); - else if (Configuration.doAutoCreate()) - this.appointmentTarget = new Appointment(); // aa - return this.appointmentTarget; - } - - /** - * @param value {@link #appointment} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The appointment that scheduled this encounter.) - */ - public Encounter setAppointmentTarget(Appointment value) { - this.appointmentTarget = value; - return this; - } - - /** - * @return {@link #period} (The start and end time of the encounter.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The start and end time of the encounter.) - */ - public Encounter setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) - */ - public Duration getLength() { - if (this.length == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.length"); - else if (Configuration.doAutoCreate()) - this.length = new Duration(); // cc - return this.length; - } - - public boolean hasLength() { - return this.length != null && !this.length.isEmpty(); - } - - /** - * @param value {@link #length} (Quantity of time the encounter lasted. This excludes the time during leaves of absence.) - */ - public Encounter setLength(Duration value) { - this.length = value; - return this; - } - - /** - * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public Encounter addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - public List getIndication() { - if (this.indication == null) - this.indication = new ArrayList(); - return this.indication; - } - - public boolean hasIndication() { - if (this.indication == null) - return false; - for (Reference item : this.indication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #indication} (Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - // syntactic sugar - public Reference addIndication() { //3 - Reference t = new Reference(); - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return t; - } - - // syntactic sugar - public Encounter addIndication(Reference t) { //3 - if (t == null) - return this; - if (this.indication == null) - this.indication = new ArrayList(); - this.indication.add(t); - return this; - } - - /** - * @return {@link #indication} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.) - */ - public List getIndicationTarget() { - if (this.indicationTarget == null) - this.indicationTarget = new ArrayList(); - return this.indicationTarget; - } - - /** - * @return {@link #hospitalization} (Details about the admission to a healthcare service.) - */ - public EncounterHospitalizationComponent getHospitalization() { - if (this.hospitalization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.hospitalization"); - else if (Configuration.doAutoCreate()) - this.hospitalization = new EncounterHospitalizationComponent(); // cc - return this.hospitalization; - } - - public boolean hasHospitalization() { - return this.hospitalization != null && !this.hospitalization.isEmpty(); - } - - /** - * @param value {@link #hospitalization} (Details about the admission to a healthcare service.) - */ - public Encounter setHospitalization(EncounterHospitalizationComponent value) { - this.hospitalization = value; - return this; - } - - /** - * @return {@link #location} (List of locations where the patient has been during this encounter.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (EncounterLocationComponent item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (List of locations where the patient has been during this encounter.) - */ - // syntactic sugar - public EncounterLocationComponent addLocation() { //3 - EncounterLocationComponent t = new EncounterLocationComponent(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public Encounter addLocation(EncounterLocationComponent t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Reference getServiceProvider() { - if (this.serviceProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.serviceProvider"); - else if (Configuration.doAutoCreate()) - this.serviceProvider = new Reference(); // cc - return this.serviceProvider; - } - - public boolean hasServiceProvider() { - return this.serviceProvider != null && !this.serviceProvider.isEmpty(); - } - - /** - * @param value {@link #serviceProvider} (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Encounter setServiceProvider(Reference value) { - this.serviceProvider = value; - return this; - } - - /** - * @return {@link #serviceProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Organization getServiceProviderTarget() { - if (this.serviceProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.serviceProvider"); - else if (Configuration.doAutoCreate()) - this.serviceProviderTarget = new Organization(); // aa - return this.serviceProviderTarget; - } - - /** - * @param value {@link #serviceProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.) - */ - public Encounter setServiceProviderTarget(Organization value) { - this.serviceProviderTarget = value; - return this; - } - - /** - * @return {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); // cc - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Encounter.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Encounter(); // aa - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Encounter of which this encounter is a part of (administratively or in time).) - */ - public Encounter setPartOfTarget(Encounter value) { - this.partOfTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this encounter is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "planned | arrived | in-progress | onleave | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusHistory", "", "The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.", 0, java.lang.Integer.MAX_VALUE, statusHistory)); - childrenList.add(new Property("class", "code", "inpatient | outpatient | ambulatory | emergency +.", 0, java.lang.Integer.MAX_VALUE, class_)); - childrenList.add(new Property("type", "CodeableConcept", "Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("priority", "CodeableConcept", "Indicates the urgency of the encounter.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient present at the encounter.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("episodeOfCare", "Reference(EpisodeOfCare)", "Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care, and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).", 0, java.lang.Integer.MAX_VALUE, episodeOfCare)); - childrenList.add(new Property("incomingReferral", "Reference(ReferralRequest)", "The referral request this encounter satisfies (incoming referral).", 0, java.lang.Integer.MAX_VALUE, incomingReferral)); - childrenList.add(new Property("participant", "", "The list of people responsible for providing the service.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("appointment", "Reference(Appointment)", "The appointment that scheduled this encounter.", 0, java.lang.Integer.MAX_VALUE, appointment)); - childrenList.add(new Property("period", "Period", "The start and end time of the encounter.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("length", "Duration", "Quantity of time the encounter lasted. This excludes the time during leaves of absence.", 0, java.lang.Integer.MAX_VALUE, length)); - childrenList.add(new Property("reason", "CodeableConcept", "Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("indication", "Reference(Condition|Procedure)", "Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.", 0, java.lang.Integer.MAX_VALUE, indication)); - childrenList.add(new Property("hospitalization", "", "Details about the admission to a healthcare service.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); - childrenList.add(new Property("location", "", "List of locations where the patient has been during this encounter.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("serviceProvider", "Reference(Organization)", "An organization that is in charge of maintaining the information of this Encounter (e.g. who maintains the report or the master service catalog item, etc.). This MAY be the same as the organization on the Patient record, however it could be different. This MAY not be not the Service Delivery Location's Organization.", 0, java.lang.Integer.MAX_VALUE, serviceProvider)); - childrenList.add(new Property("partOf", "Reference(Encounter)", "Another Encounter of which this encounter is a part of (administratively or in time).", 0, java.lang.Integer.MAX_VALUE, partOf)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EncounterStatusHistoryComponent - case 94742904: /*class*/ return this.class_ == null ? new Base[0] : new Base[] {this.class_}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1892140189: /*episodeOfCare*/ return this.episodeOfCare == null ? new Base[0] : this.episodeOfCare.toArray(new Base[this.episodeOfCare.size()]); // Reference - case -1258204701: /*incomingReferral*/ return this.incomingReferral == null ? new Base[0] : this.incomingReferral.toArray(new Base[this.incomingReferral.size()]); // Reference - case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // EncounterParticipantComponent - case -1474995297: /*appointment*/ return this.appointment == null ? new Base[0] : new Base[] {this.appointment}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // Duration - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept - case -597168804: /*indication*/ return this.indication == null ? new Base[0] : this.indication.toArray(new Base[this.indication.size()]); // Reference - case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // EncounterHospitalizationComponent - case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // EncounterLocationComponent - case 243182534: /*serviceProvider*/ return this.serviceProvider == null ? new Base[0] : new Base[] {this.serviceProvider}; // Reference - case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration - break; - case -986695614: // statusHistory - this.getStatusHistory().add((EncounterStatusHistoryComponent) value); // EncounterStatusHistoryComponent - break; - case 94742904: // class - this.class_ = new EncounterClassEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.getType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1165461084: // priority - this.priority = castToCodeableConcept(value); // CodeableConcept - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1892140189: // episodeOfCare - this.getEpisodeOfCare().add(castToReference(value)); // Reference - break; - case -1258204701: // incomingReferral - this.getIncomingReferral().add(castToReference(value)); // Reference - break; - case 767422259: // participant - this.getParticipant().add((EncounterParticipantComponent) value); // EncounterParticipantComponent - break; - case -1474995297: // appointment - this.appointment = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -1106363674: // length - this.length = castToDuration(value); // Duration - break; - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -597168804: // indication - this.getIndication().add(castToReference(value)); // Reference - break; - case 1057894634: // hospitalization - this.hospitalization = (EncounterHospitalizationComponent) value; // EncounterHospitalizationComponent - break; - case 1901043637: // location - this.getLocation().add((EncounterLocationComponent) value); // EncounterLocationComponent - break; - case 243182534: // serviceProvider - this.serviceProvider = castToReference(value); // Reference - break; - case -995410646: // partOf - this.partOf = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new EncounterStateEnumFactory().fromType(value); // Enumeration - else if (name.equals("statusHistory")) - this.getStatusHistory().add((EncounterStatusHistoryComponent) value); - else if (name.equals("class")) - this.class_ = new EncounterClassEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.getType().add(castToCodeableConcept(value)); - else if (name.equals("priority")) - this.priority = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("episodeOfCare")) - this.getEpisodeOfCare().add(castToReference(value)); - else if (name.equals("incomingReferral")) - this.getIncomingReferral().add(castToReference(value)); - else if (name.equals("participant")) - this.getParticipant().add((EncounterParticipantComponent) value); - else if (name.equals("appointment")) - this.appointment = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("length")) - this.length = castToDuration(value); // Duration - else if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); - else if (name.equals("indication")) - this.getIndication().add(castToReference(value)); - else if (name.equals("hospitalization")) - this.hospitalization = (EncounterHospitalizationComponent) value; // EncounterHospitalizationComponent - else if (name.equals("location")) - this.getLocation().add((EncounterLocationComponent) value); - else if (name.equals("serviceProvider")) - this.serviceProvider = castToReference(value); // Reference - else if (name.equals("partOf")) - this.partOf = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -986695614: return addStatusHistory(); // EncounterStatusHistoryComponent - case 94742904: throw new FHIRException("Cannot make property class as it is not a complex type"); // Enumeration - case 3575610: return addType(); // CodeableConcept - case -1165461084: return getPriority(); // CodeableConcept - case -791418107: return getPatient(); // Reference - case -1892140189: return addEpisodeOfCare(); // Reference - case -1258204701: return addIncomingReferral(); // Reference - case 767422259: return addParticipant(); // EncounterParticipantComponent - case -1474995297: return getAppointment(); // Reference - case -991726143: return getPeriod(); // Period - case -1106363674: return getLength(); // Duration - case -934964668: return addReason(); // CodeableConcept - case -597168804: return addIndication(); // Reference - case 1057894634: return getHospitalization(); // EncounterHospitalizationComponent - case 1901043637: return addLocation(); // EncounterLocationComponent - case 243182534: return getServiceProvider(); // Reference - case -995410646: return getPartOf(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Encounter.status"); - } - else if (name.equals("statusHistory")) { - return addStatusHistory(); - } - else if (name.equals("class")) { - throw new FHIRException("Cannot call addChild on a primitive type Encounter.class"); - } - else if (name.equals("type")) { - return addType(); - } - else if (name.equals("priority")) { - this.priority = new CodeableConcept(); - return this.priority; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("episodeOfCare")) { - return addEpisodeOfCare(); - } - else if (name.equals("incomingReferral")) { - return addIncomingReferral(); - } - else if (name.equals("participant")) { - return addParticipant(); - } - else if (name.equals("appointment")) { - this.appointment = new Reference(); - return this.appointment; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("length")) { - this.length = new Duration(); - return this.length; - } - else if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("indication")) { - return addIndication(); - } - else if (name.equals("hospitalization")) { - this.hospitalization = new EncounterHospitalizationComponent(); - return this.hospitalization; - } - else if (name.equals("location")) { - return addLocation(); - } - else if (name.equals("serviceProvider")) { - this.serviceProvider = new Reference(); - return this.serviceProvider; - } - else if (name.equals("partOf")) { - this.partOf = new Reference(); - return this.partOf; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Encounter"; - - } - - public Encounter copy() { - Encounter dst = new Encounter(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - if (statusHistory != null) { - dst.statusHistory = new ArrayList(); - for (EncounterStatusHistoryComponent i : statusHistory) - dst.statusHistory.add(i.copy()); - }; - dst.class_ = class_ == null ? null : class_.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - dst.priority = priority == null ? null : priority.copy(); - dst.patient = patient == null ? null : patient.copy(); - if (episodeOfCare != null) { - dst.episodeOfCare = new ArrayList(); - for (Reference i : episodeOfCare) - dst.episodeOfCare.add(i.copy()); - }; - if (incomingReferral != null) { - dst.incomingReferral = new ArrayList(); - for (Reference i : incomingReferral) - dst.incomingReferral.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (EncounterParticipantComponent i : participant) - dst.participant.add(i.copy()); - }; - dst.appointment = appointment == null ? null : appointment.copy(); - dst.period = period == null ? null : period.copy(); - dst.length = length == null ? null : length.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (indication != null) { - dst.indication = new ArrayList(); - for (Reference i : indication) - dst.indication.add(i.copy()); - }; - dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (EncounterLocationComponent i : location) - dst.location.add(i.copy()); - }; - dst.serviceProvider = serviceProvider == null ? null : serviceProvider.copy(); - dst.partOf = partOf == null ? null : partOf.copy(); - return dst; - } - - protected Encounter typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Encounter)) - return false; - Encounter o = (Encounter) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) - && compareDeep(class_, o.class_, true) && compareDeep(type, o.type, true) && compareDeep(priority, o.priority, true) - && compareDeep(patient, o.patient, true) && compareDeep(episodeOfCare, o.episodeOfCare, true) && compareDeep(incomingReferral, o.incomingReferral, true) - && compareDeep(participant, o.participant, true) && compareDeep(appointment, o.appointment, true) - && compareDeep(period, o.period, true) && compareDeep(length, o.length, true) && compareDeep(reason, o.reason, true) - && compareDeep(indication, o.indication, true) && compareDeep(hospitalization, o.hospitalization, true) - && compareDeep(location, o.location, true) && compareDeep(serviceProvider, o.serviceProvider, true) - && compareDeep(partOf, o.partOf, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Encounter)) - return false; - Encounter o = (Encounter) other; - return compareValues(status, o.status, true) && compareValues(class_, o.class_, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (statusHistory == null || statusHistory.isEmpty()) && (class_ == null || class_.isEmpty()) - && (type == null || type.isEmpty()) && (priority == null || priority.isEmpty()) && (patient == null || patient.isEmpty()) - && (episodeOfCare == null || episodeOfCare.isEmpty()) && (incomingReferral == null || incomingReferral.isEmpty()) - && (participant == null || participant.isEmpty()) && (appointment == null || appointment.isEmpty()) - && (period == null || period.isEmpty()) && (length == null || length.isEmpty()) && (reason == null || reason.isEmpty()) - && (indication == null || indication.isEmpty()) && (hospitalization == null || hospitalization.isEmpty()) - && (location == null || location.isEmpty()) && (serviceProvider == null || serviceProvider.isEmpty()) - && (partOf == null || partOf.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Encounter; - } - - /** - * Search parameter: participant-type - *

- * Description: Role of participant in encounter
- * Type: token
- * Path: Encounter.participant.type
- *

- */ - @SearchParamDefinition(name="participant-type", path="Encounter.participant.type", description="Role of participant in encounter", type="token" ) - public static final String SP_PARTICIPANT_TYPE = "participant-type"; - /** - * Fluent Client search parameter constant for participant-type - *

- * Description: Role of participant in encounter
- * Type: token
- * Path: Encounter.participant.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PARTICIPANT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PARTICIPANT_TYPE); - - /** - * Search parameter: episodeofcare - *

- * Description: Episode(s) of care that this encounter should be recorded against
- * Type: reference
- * Path: Encounter.episodeOfCare
- *

- */ - @SearchParamDefinition(name="episodeofcare", path="Encounter.episodeOfCare", description="Episode(s) of care that this encounter should be recorded against", type="reference" ) - public static final String SP_EPISODEOFCARE = "episodeofcare"; - /** - * Fluent Client search parameter constant for episodeofcare - *

- * Description: Episode(s) of care that this encounter should be recorded against
- * Type: reference
- * Path: Encounter.episodeOfCare
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam EPISODEOFCARE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_EPISODEOFCARE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:episodeofcare". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_EPISODEOFCARE = new ca.uhn.fhir.model.api.Include("Encounter:episodeofcare").toLocked(); - - /** - * Search parameter: status - *

- * Description: planned | arrived | in-progress | onleave | finished | cancelled
- * Type: token
- * Path: Encounter.status
- *

- */ - @SearchParamDefinition(name="status", path="Encounter.status", description="planned | arrived | in-progress | onleave | finished | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: planned | arrived | in-progress | onleave | finished | cancelled
- * Type: token
- * Path: Encounter.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: reason - *

- * Description: Reason the encounter takes place (code)
- * Type: token
- * Path: Encounter.reason
- *

- */ - @SearchParamDefinition(name="reason", path="Encounter.reason", description="Reason the encounter takes place (code)", type="token" ) - public static final String SP_REASON = "reason"; - /** - * Fluent Client search parameter constant for reason - *

- * Description: Reason the encounter takes place (code)
- * Type: token
- * Path: Encounter.reason
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON); - - /** - * Search parameter: condition - *

- * Description: Reason the encounter takes place (resource)
- * Type: reference
- * Path: Encounter.indication
- *

- */ - @SearchParamDefinition(name="condition", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) - public static final String SP_CONDITION = "condition"; - /** - * Fluent Client search parameter constant for condition - *

- * Description: Reason the encounter takes place (resource)
- * Type: reference
- * Path: Encounter.indication
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:condition". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("Encounter:condition").toLocked(); - - /** - * Search parameter: location - *

- * Description: Location the encounter takes place
- * Type: reference
- * Path: Encounter.location.location
- *

- */ - @SearchParamDefinition(name="location", path="Encounter.location.location", description="Location the encounter takes place", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: Location the encounter takes place
- * Type: reference
- * Path: Encounter.location.location
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Encounter:location").toLocked(); - - /** - * Search parameter: indication - *

- * Description: Reason the encounter takes place (resource)
- * Type: reference
- * Path: Encounter.indication
- *

- */ - @SearchParamDefinition(name="indication", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) - public static final String SP_INDICATION = "indication"; - /** - * Fluent Client search parameter constant for indication - *

- * Description: Reason the encounter takes place (resource)
- * Type: reference
- * Path: Encounter.indication
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INDICATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:indication". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_INDICATION = new ca.uhn.fhir.model.api.Include("Encounter:indication").toLocked(); - - /** - * Search parameter: type - *

- * Description: Specific type of encounter
- * Type: token
- * Path: Encounter.type
- *

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

- * Description: Specific type of encounter
- * Type: token
- * Path: Encounter.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: special-arrangement - *

- * Description: Wheelchair, translator, stretcher, etc.
- * Type: token
- * Path: Encounter.hospitalization.specialArrangement
- *

- */ - @SearchParamDefinition(name="special-arrangement", path="Encounter.hospitalization.specialArrangement", description="Wheelchair, translator, stretcher, etc.", type="token" ) - public static final String SP_SPECIAL_ARRANGEMENT = "special-arrangement"; - /** - * Fluent Client search parameter constant for special-arrangement - *

- * Description: Wheelchair, translator, stretcher, etc.
- * Type: token
- * Path: Encounter.hospitalization.specialArrangement
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIAL_ARRANGEMENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIAL_ARRANGEMENT); - - /** - * Search parameter: part-of - *

- * Description: Another Encounter this encounter is part of
- * Type: reference
- * Path: Encounter.partOf
- *

- */ - @SearchParamDefinition(name="part-of", path="Encounter.partOf", description="Another Encounter this encounter is part of", type="reference" ) - public static final String SP_PART_OF = "part-of"; - /** - * Fluent Client search parameter constant for part-of - *

- * Description: Another Encounter this encounter is part of
- * Type: reference
- * Path: Encounter.partOf
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PART_OF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PART_OF); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:part-of". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PART_OF = new ca.uhn.fhir.model.api.Include("Encounter:part-of").toLocked(); - - /** - * Search parameter: appointment - *

- * Description: The appointment that scheduled this encounter
- * Type: reference
- * Path: Encounter.appointment
- *

- */ - @SearchParamDefinition(name="appointment", path="Encounter.appointment", description="The appointment that scheduled this encounter", type="reference" ) - public static final String SP_APPOINTMENT = "appointment"; - /** - * Fluent Client search parameter constant for appointment - *

- * Description: The appointment that scheduled this encounter
- * Type: reference
- * Path: Encounter.appointment
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam APPOINTMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_APPOINTMENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:appointment". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_APPOINTMENT = new ca.uhn.fhir.model.api.Include("Encounter:appointment").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The patient present at the encounter
- * Type: reference
- * Path: Encounter.patient
- *

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

- * Description: The patient present at the encounter
- * Type: reference
- * Path: Encounter.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Encounter:patient").toLocked(); - - /** - * Search parameter: practitioner - *

- * Description: Persons involved in the encounter other than the patient
- * Type: reference
- * Path: Encounter.participant.individual
- *

- */ - @SearchParamDefinition(name="practitioner", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - /** - * Fluent Client search parameter constant for practitioner - *

- * Description: Persons involved in the encounter other than the patient
- * Type: reference
- * Path: Encounter.participant.individual
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:practitioner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Encounter:practitioner").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.NumberClientParam LENGTH = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_LENGTH); - - /** - * Search parameter: participant - *

- * Description: Persons involved in the encounter other than the patient
- * Type: reference
- * Path: Encounter.participant.individual
- *

- */ - @SearchParamDefinition(name="participant", path="Encounter.participant.individual", description="Persons involved in the encounter other than the patient", type="reference" ) - public static final String SP_PARTICIPANT = "participant"; - /** - * Fluent Client search parameter constant for participant - *

- * Description: Persons involved in the encounter other than the patient
- * Type: reference
- * Path: Encounter.participant.individual
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTICIPANT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTICIPANT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:participant". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTICIPANT = new ca.uhn.fhir.model.api.Include("Encounter:participant").toLocked(); - - /** - * Search parameter: incomingreferral - *

- * Description: The ReferralRequest that initiated this encounter
- * Type: reference
- * Path: Encounter.incomingReferral
- *

- */ - @SearchParamDefinition(name="incomingreferral", path="Encounter.incomingReferral", description="The ReferralRequest that initiated this encounter", type="reference" ) - public static final String SP_INCOMINGREFERRAL = "incomingreferral"; - /** - * Fluent Client search parameter constant for incomingreferral - *

- * Description: The ReferralRequest that initiated this encounter
- * Type: reference
- * Path: Encounter.incomingReferral
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMINGREFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMINGREFERRAL); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:incomingreferral". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMINGREFERRAL = new ca.uhn.fhir.model.api.Include("Encounter:incomingreferral").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Identifier(s) by which this encounter is known
- * Type: token
- * Path: Encounter.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Encounter.identifier", description="Identifier(s) by which this encounter is known", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Identifier(s) by which this encounter is known
- * Type: token
- * Path: Encounter.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: procedure - *

- * Description: Reason the encounter takes place (resource)
- * Type: reference
- * Path: Encounter.indication
- *

- */ - @SearchParamDefinition(name="procedure", path="Encounter.indication", description="Reason the encounter takes place (resource)", type="reference" ) - public static final String SP_PROCEDURE = "procedure"; - /** - * Fluent Client search parameter constant for procedure - *

- * Description: Reason the encounter takes place (resource)
- * Type: reference
- * Path: Encounter.indication
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROCEDURE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROCEDURE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Encounter:procedure". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROCEDURE = new ca.uhn.fhir.model.api.Include("Encounter:procedure").toLocked(); - - /** - * Search parameter: location-period - *

- * Description: Time period during which the patient was present at the location
- * Type: date
- * Path: Encounter.location.period
- *

- */ - @SearchParamDefinition(name="location-period", path="Encounter.location.period", description="Time period during which the patient was present at the location", type="date" ) - public static final String SP_LOCATION_PERIOD = "location-period"; - /** - * Fluent Client search parameter constant for location-period - *

- * Description: Time period during which the patient was present at the location
- * Type: date
- * Path: Encounter.location.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam LOCATION_PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_LOCATION_PERIOD); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java deleted file mode 100644 index 720e7aef7d5..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnrollmentRequest.java +++ /dev/null @@ -1,841 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. - */ -@ResourceDef(name="EnrollmentRequest", profile="http://hl7.org/fhir/Profile/EnrollmentRequest") -public class EnrollmentRequest extends DomainResource { - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who is target of the request." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The Insurer who is target of the request.) - */ - protected Organization targetTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference provider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner providerTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization organizationTarget; - - /** - * Patient Resource. - */ - @Child(name = "subject", type = {Patient.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Patient Resource.) - */ - protected Patient subjectTarget; - - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Coverage.class}, order=8, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Reference coverage; - - /** - * The actual object that is the target of the reference (Reference to the program or plan identification, underwriter or payor.) - */ - protected Coverage coverageTarget; - - /** - * The relationship of the patient to the subscriber. - */ - @Child(name = "relationship", type = {Coding.class}, order=9, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient relationship to subscriber", formalDefinition="The relationship of the patient to the subscriber." ) - protected Coding relationship; - - private static final long serialVersionUID = -1656505325L; - - /** - * Constructor - */ - public EnrollmentRequest() { - super(); - } - - /** - * Constructor - */ - public EnrollmentRequest(Reference subject, Reference coverage, Coding relationship) { - super(); - this.subject = subject; - this.coverage = coverage; - this.relationship = relationship; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EnrollmentRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EnrollmentRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EnrollmentRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EnrollmentRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public EnrollmentRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public EnrollmentRequest setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) - */ - public Organization getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Organization(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who is target of the request.) - */ - public EnrollmentRequest setTargetTarget(Organization value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProvider() { - if (this.provider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.provider"); - else if (Configuration.doAutoCreate()) - this.provider = new Reference(); // cc - return this.provider; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setProvider(Reference value) { - this.provider = value; - return this; - } - - /** - * @return {@link #provider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getProviderTarget() { - if (this.providerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.provider"); - else if (Configuration.doAutoCreate()) - this.providerTarget = new Practitioner(); // aa - return this.providerTarget; - } - - /** - * @param value {@link #provider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setProviderTarget(Practitioner value) { - this.providerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentRequest setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #subject} (Patient Resource.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Patient Resource.) - */ - public EnrollmentRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient Resource.) - */ - public Patient getSubjectTarget() { - if (this.subjectTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subjectTarget = new Patient(); // aa - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient Resource.) - */ - public EnrollmentRequest setSubjectTarget(Patient value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new Reference(); // cc - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public EnrollmentRequest setCoverage(Reference value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #coverage} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public Coverage getCoverageTarget() { - if (this.coverageTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.coverage"); - else if (Configuration.doAutoCreate()) - this.coverageTarget = new Coverage(); // aa - return this.coverageTarget; - } - - /** - * @param value {@link #coverage} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the program or plan identification, underwriter or payor.) - */ - public EnrollmentRequest setCoverageTarget(Coverage value) { - this.coverageTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentRequest.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of the patient to the subscriber.) - */ - public EnrollmentRequest setRelationship(Coding value) { - this.relationship = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target", "Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("subject", "Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("relationship", "Coding", "The relationship of the patient to the subscriber.", 0, java.lang.Integer.MAX_VALUE, relationship)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Reference - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -880905839: // target - this.target = castToReference(value); // Reference - break; - case -987494927: // provider - this.provider = castToReference(value); // Reference - break; - case 1178922291: // organization - this.organization = castToReference(value); // Reference - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -351767064: // coverage - this.coverage = castToReference(value); // Reference - break; - case -261851592: // relationship - this.relationship = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("target")) - this.target = castToReference(value); // Reference - else if (name.equals("provider")) - this.provider = castToReference(value); // Reference - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("coverage")) - this.coverage = castToReference(value); // Reference - else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -880905839: return getTarget(); // Reference - case -987494927: return getProvider(); // Reference - case 1178922291: return getOrganization(); // Reference - case -1867885268: return getSubject(); // Reference - case -351767064: return getCoverage(); // Reference - case -261851592: return getRelationship(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type EnrollmentRequest.created"); - } - else if (name.equals("target")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("provider")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("coverage")) { - this.coverage = new Reference(); - return this.coverage; - } - else if (name.equals("relationship")) { - this.relationship = new Coding(); - return this.relationship; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "EnrollmentRequest"; - - } - - public EnrollmentRequest copy() { - EnrollmentRequest dst = new EnrollmentRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - return dst; - } - - protected EnrollmentRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EnrollmentRequest)) - return false; - EnrollmentRequest o = (EnrollmentRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true) && compareDeep(subject, o.subject, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(relationship, o.relationship, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EnrollmentRequest)) - return false; - EnrollmentRequest o = (EnrollmentRequest) other; - return compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (subject == null || subject.isEmpty()) && (coverage == null || coverage.isEmpty()) && (relationship == null || relationship.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EnrollmentRequest; - } - - /** - * Search parameter: patient - *

- * Description: The party to be enrolled
- * Type: reference
- * Path: EnrollmentRequest.subject
- *

- */ - @SearchParamDefinition(name="patient", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The party to be enrolled
- * Type: reference
- * Path: EnrollmentRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EnrollmentRequest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:patient").toLocked(); - - /** - * Search parameter: subject - *

- * Description: The party to be enrolled
- * Type: reference
- * Path: EnrollmentRequest.subject
- *

- */ - @SearchParamDefinition(name="subject", path="EnrollmentRequest.subject", description="The party to be enrolled", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: The party to be enrolled
- * Type: reference
- * Path: EnrollmentRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EnrollmentRequest:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("EnrollmentRequest:subject").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the Enrollment
- * Type: token
- * Path: EnrollmentRequest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="EnrollmentRequest.identifier", description="The business identifier of the Enrollment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the Enrollment
- * Type: token
- * Path: EnrollmentRequest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java deleted file mode 100644 index 9bfcc33ab81..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnrollmentResponse.java +++ /dev/null @@ -1,807 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides enrollment and plan details from the processing of an Enrollment resource. - */ -@ResourceDef(name="EnrollmentResponse", profile="http://hl7.org/fhir/Profile/EnrollmentResponse") -public class EnrollmentResponse extends DomainResource { - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {EnrollmentRequest.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (Original request resource reference.) - */ - protected EnrollmentRequest requestTarget; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The Insurer who produced this adjudicated response.) - */ - protected Organization organizationTarget; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Reference requestProvider; - - /** - * The actual object that is the target of the reference (The practitioner who is responsible for the services rendered to the patient.) - */ - protected Practitioner requestProviderTarget; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Reference requestOrganization; - - /** - * The actual object that is the target of the reference (The organization which is responsible for the services rendered to the patient.) - */ - protected Organization requestOrganizationTarget; - - private static final long serialVersionUID = -1740067108L; - - /** - * Constructor - */ - public EnrollmentResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EnrollmentResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public EnrollmentResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public EnrollmentRequest getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new EnrollmentRequest(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Original request resource reference.) - */ - public EnrollmentResponse setRequestTarget(EnrollmentRequest value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public EnrollmentResponse setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public EnrollmentResponse setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public EnrollmentResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public EnrollmentResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public EnrollmentResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public EnrollmentResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public EnrollmentResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public EnrollmentResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public EnrollmentResponse setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Insurer who produced this adjudicated response.) - */ - public EnrollmentResponse setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProvider() { - if (this.requestProvider == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProvider = new Reference(); // cc - return this.requestProvider; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestProvider(Reference value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public Practitioner getRequestProviderTarget() { - if (this.requestProviderTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestProvider"); - else if (Configuration.doAutoCreate()) - this.requestProviderTarget = new Practitioner(); // aa - return this.requestProviderTarget; - } - - /** - * @param value {@link #requestProvider} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestProviderTarget(Practitioner value) { - this.requestProviderTarget = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganization() { - if (this.requestOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganization = new Reference(); // cc - return this.requestOrganization; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestOrganization(Reference value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public Organization getRequestOrganizationTarget() { - if (this.requestOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EnrollmentResponse.requestOrganization"); - else if (Configuration.doAutoCreate()) - this.requestOrganizationTarget = new Organization(); // aa - return this.requestOrganizationTarget; - } - - /** - * @param value {@link #requestOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization which is responsible for the services rendered to the patient.) - */ - public EnrollmentResponse setRequestOrganizationTarget(Organization value) { - this.requestOrganizationTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(EnrollmentRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization", "Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference - case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 1178922291: // organization - this.organization = castToReference(value); // Reference - break; - case 1601527200: // requestProvider - this.requestProvider = castToReference(value); // Reference - break; - case 599053666: // requestOrganization - this.requestOrganization = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference - else if (name.equals("requestProvider")) - this.requestProvider = castToReference(value); // Reference - else if (name.equals("requestOrganization")) - this.requestOrganization = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1095692943: return getRequest(); // Reference - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1178922291: return getOrganization(); // Reference - case 1601527200: return getRequestProvider(); // Reference - case 599053666: return getRequestOrganization(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.outcome"); - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.disposition"); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type EnrollmentResponse.created"); - } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestProvider")) { - this.requestProvider = new Reference(); - return this.requestProvider; - } - else if (name.equals("requestOrganization")) { - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "EnrollmentResponse"; - - } - - public EnrollmentResponse copy() { - EnrollmentResponse dst = new EnrollmentResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - return dst; - } - - protected EnrollmentResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EnrollmentResponse)) - return false; - EnrollmentResponse o = (EnrollmentResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EnrollmentResponse)) - return false; - EnrollmentResponse o = (EnrollmentResponse) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EnrollmentResponse; - } - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: EnrollmentResponse.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="EnrollmentResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: EnrollmentResponse.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnumFactory.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnumFactory.java deleted file mode 100644 index 45dcd4d0868..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EnumFactory.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IBaseEnumFactory; - - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -/** - * Helper class to help manage generic enumerated types - */ -public interface EnumFactory> extends IBaseEnumFactory { - - /** - * Read an enumeration value from the string that represents it on the XML or JSON - * @param codeString the value found in the XML or JSON - * @return the enumeration value - * @throws Exception is the value is not known - */ - public T fromCode(String codeString) throws IllegalArgumentException; - - /** - * Get the XML/JSON representation for an enumerated value - * @param code - the enumeration value - * @return the XML/JSON representation - */ - public String toCode(T code); - - /** - * Get the XML/JSON representation for an enumerated value - * @param code - the enumeration value - * @return the XML/JSON representation - */ - public String toSystem(T code); - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Enumeration.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Enumeration.java deleted file mode 100644 index 46866e756a1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Enumeration.java +++ /dev/null @@ -1,134 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - -import org.hl7.fhir.instance.model.api.IBaseEnumeration; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -/** - * Primitive type "code" in FHIR, where the code is tied to an enumerated list of possible values - * - */ -@DatatypeDef(name = "code", isSpecialization = true) -public class Enumeration> extends PrimitiveType implements IBaseEnumeration { - - private static final long serialVersionUID = 1L; - private EnumFactory myEnumFactory; - - /** - * Constructor - * - * @deprecated This no-arg constructor is provided for serialization only - Do not use - */ - @Deprecated - public Enumeration() { - // nothing - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory) { - if (theEnumFactory == null) - throw new IllegalArgumentException("An enumeration factory must be provided"); - myEnumFactory = theEnumFactory; - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory, String theValue) { - if (theEnumFactory == null) - throw new IllegalArgumentException("An enumeration factory must be provided"); - myEnumFactory = theEnumFactory; - setValueAsString(theValue); - } - - /** - * Constructor - */ - public Enumeration(EnumFactory theEnumFactory, T theValue) { - if (theEnumFactory == null) - throw new IllegalArgumentException("An enumeration factory must be provided"); - myEnumFactory = theEnumFactory; - setValue(theValue); - } - - @Override - public Enumeration copy() { - return new Enumeration(myEnumFactory, getValue()); - } - - @Override - protected String encode(T theValue) { - return myEnumFactory.toCode(theValue); - } - - public String fhirType() { - return "code"; - } - - /** - * Provides the enum factory which binds this enumeration to a specific ValueSet - */ - public EnumFactory getEnumFactory() { - return myEnumFactory; - } - - @Override - protected T parse(String theValue) { - if (myEnumFactory != null) { - return myEnumFactory.fromCode(theValue); - } - return null; - } - - @SuppressWarnings("unchecked") - @Override - public void readExternal(ObjectInput theIn) throws IOException, ClassNotFoundException { - myEnumFactory = (EnumFactory) theIn.readObject(); - super.readExternal(theIn); - } - - public String toSystem() { - return getEnumFactory().toSystem(getValue()); - } - - @Override - public void writeExternal(ObjectOutput theOut) throws IOException { - theOut.writeObject(myEnumFactory); - super.writeExternal(theOut); - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Enumerations.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Enumerations.java deleted file mode 100644 index 42b59557c44..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Enumerations.java +++ /dev/null @@ -1,10084 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.exceptions.FHIRException; - -public class Enumerations { - -// In here: -// AbstractType: A type defined by FHIR that is an abstract type -// AdministrativeGender: The gender of a person used for administrative purposes. -// AgeUnits: A valueSet of UCUM codes for representing age value units. -// BindingStrength: Indication of the degree of conformance expectations associated with a binding. -// ConceptMapEquivalence: The degree of equivalence between concepts. -// ConformanceResourceStatus: The lifecycle status of a Value Set or Concept Map. -// DataAbsentReason: Used to specify why the normally expected content of the data element is missing. -// DataType: The type of an element - one of the FHIR data types. -// DocumentReferenceStatus: The status of the document reference. -// FHIRAllTypes: Either an abstract type, a resource or a data type. -// FHIRDefinedType: Either a resource or a data type. -// MessageEvent: One of the message events defined as part of FHIR. -// NoteType: The presentation types of notes. -// RemittanceOutcome: The outcome of the processing. -// ResourceType: One of the resource types defined as part of FHIR. -// SearchParamType: Data types allowed to be used for search parameters. -// SpecialValues: A set of generally useful codes defined so they can be included in value sets. - - - public enum AbstractType { - /** - * A place holder that means any kind of data type - */ - TYPE, - /** - * A place holder that means any kind of resource - */ - ANY, - /** - * added to help the parsers - */ - NULL; - public static AbstractType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("Type".equals(codeString)) - return TYPE; - if ("Any".equals(codeString)) - return ANY; - throw new FHIRException("Unknown AbstractType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case TYPE: return "Type"; - case ANY: return "Any"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TYPE: return "http://hl7.org/fhir/abstract-types"; - case ANY: return "http://hl7.org/fhir/abstract-types"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TYPE: return "A place holder that means any kind of data type"; - case ANY: return "A place holder that means any kind of resource"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TYPE: return "Type"; - case ANY: return "Any"; - default: return "?"; - } - } - } - - public static class AbstractTypeEnumFactory implements EnumFactory { - public AbstractType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("Type".equals(codeString)) - return AbstractType.TYPE; - if ("Any".equals(codeString)) - return AbstractType.ANY; - throw new IllegalArgumentException("Unknown AbstractType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("Type".equals(codeString)) - return new Enumeration(this, AbstractType.TYPE); - if ("Any".equals(codeString)) - return new Enumeration(this, AbstractType.ANY); - throw new FHIRException("Unknown AbstractType code '"+codeString+"'"); - } - public String toCode(AbstractType code) { - if (code == AbstractType.TYPE) - return "Type"; - if (code == AbstractType.ANY) - return "Any"; - return "?"; - } - public String toSystem(AbstractType code) { - return code.getSystem(); - } - } - - public enum AdministrativeGender { - /** - * Male - */ - MALE, - /** - * Female - */ - FEMALE, - /** - * Other - */ - OTHER, - /** - * Unknown - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static AdministrativeGender fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return MALE; - if ("female".equals(codeString)) - return FEMALE; - if ("other".equals(codeString)) - return OTHER; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MALE: return "male"; - case FEMALE: return "female"; - case OTHER: return "other"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MALE: return "http://hl7.org/fhir/administrative-gender"; - case FEMALE: return "http://hl7.org/fhir/administrative-gender"; - case OTHER: return "http://hl7.org/fhir/administrative-gender"; - case UNKNOWN: return "http://hl7.org/fhir/administrative-gender"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MALE: return "Male"; - case FEMALE: return "Female"; - case OTHER: return "Other"; - case UNKNOWN: return "Unknown"; - default: return "?"; - } - } - } - - public static class AdministrativeGenderEnumFactory implements EnumFactory { - public AdministrativeGender fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return AdministrativeGender.MALE; - if ("female".equals(codeString)) - return AdministrativeGender.FEMALE; - if ("other".equals(codeString)) - return AdministrativeGender.OTHER; - if ("unknown".equals(codeString)) - return AdministrativeGender.UNKNOWN; - throw new IllegalArgumentException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("male".equals(codeString)) - return new Enumeration(this, AdministrativeGender.MALE); - if ("female".equals(codeString)) - return new Enumeration(this, AdministrativeGender.FEMALE); - if ("other".equals(codeString)) - return new Enumeration(this, AdministrativeGender.OTHER); - if ("unknown".equals(codeString)) - return new Enumeration(this, AdministrativeGender.UNKNOWN); - throw new FHIRException("Unknown AdministrativeGender code '"+codeString+"'"); - } - public String toCode(AdministrativeGender code) { - if (code == AdministrativeGender.MALE) - return "male"; - if (code == AdministrativeGender.FEMALE) - return "female"; - if (code == AdministrativeGender.OTHER) - return "other"; - if (code == AdministrativeGender.UNKNOWN) - return "unknown"; - return "?"; - } - public String toSystem(AdministrativeGender code) { - return code.getSystem(); - } - } - - public enum AgeUnits { - /** - * null - */ - MIN, - /** - * null - */ - H, - /** - * null - */ - D, - /** - * null - */ - WK, - /** - * null - */ - MO, - /** - * null - */ - A, - /** - * added to help the parsers - */ - NULL; - public static AgeUnits fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("min".equals(codeString)) - return MIN; - if ("h".equals(codeString)) - return H; - if ("d".equals(codeString)) - return D; - if ("wk".equals(codeString)) - return WK; - if ("mo".equals(codeString)) - return MO; - if ("a".equals(codeString)) - return A; - throw new FHIRException("Unknown AgeUnits code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MIN: return "min"; - case H: return "h"; - case D: return "d"; - case WK: return "wk"; - case MO: return "mo"; - case A: return "a"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MIN: return "http://unitsofmeasure.org"; - case H: return "http://unitsofmeasure.org"; - case D: return "http://unitsofmeasure.org"; - case WK: return "http://unitsofmeasure.org"; - case MO: return "http://unitsofmeasure.org"; - case A: return "http://unitsofmeasure.org"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MIN: return ""; - case H: return ""; - case D: return ""; - case WK: return ""; - case MO: return ""; - case A: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MIN: return "Minute"; - case H: return "Hour"; - case D: return "Day"; - case WK: return "Week"; - case MO: return "Month"; - case A: return "Year"; - default: return "?"; - } - } - } - - public static class AgeUnitsEnumFactory implements EnumFactory { - public AgeUnits fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("min".equals(codeString)) - return AgeUnits.MIN; - if ("h".equals(codeString)) - return AgeUnits.H; - if ("d".equals(codeString)) - return AgeUnits.D; - if ("wk".equals(codeString)) - return AgeUnits.WK; - if ("mo".equals(codeString)) - return AgeUnits.MO; - if ("a".equals(codeString)) - return AgeUnits.A; - throw new IllegalArgumentException("Unknown AgeUnits code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("min".equals(codeString)) - return new Enumeration(this, AgeUnits.MIN); - if ("h".equals(codeString)) - return new Enumeration(this, AgeUnits.H); - if ("d".equals(codeString)) - return new Enumeration(this, AgeUnits.D); - if ("wk".equals(codeString)) - return new Enumeration(this, AgeUnits.WK); - if ("mo".equals(codeString)) - return new Enumeration(this, AgeUnits.MO); - if ("a".equals(codeString)) - return new Enumeration(this, AgeUnits.A); - throw new FHIRException("Unknown AgeUnits code '"+codeString+"'"); - } - public String toCode(AgeUnits code) { - if (code == AgeUnits.MIN) - return "min"; - if (code == AgeUnits.H) - return "h"; - if (code == AgeUnits.D) - return "d"; - if (code == AgeUnits.WK) - return "wk"; - if (code == AgeUnits.MO) - return "mo"; - if (code == AgeUnits.A) - return "a"; - return "?"; - } - public String toSystem(AgeUnits code) { - return code.getSystem(); - } - } - - public enum BindingStrength { - /** - * To be conformant, instances of this element SHALL include a code from the specified value set. - */ - REQUIRED, - /** - * To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the value set does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead. - */ - EXTENSIBLE, - /** - * Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant. - */ - PREFERRED, - /** - * Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included. - */ - EXAMPLE, - /** - * added to help the parsers - */ - NULL; - public static BindingStrength fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return REQUIRED; - if ("extensible".equals(codeString)) - return EXTENSIBLE; - if ("preferred".equals(codeString)) - return PREFERRED; - if ("example".equals(codeString)) - return EXAMPLE; - throw new FHIRException("Unknown BindingStrength code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUIRED: return "required"; - case EXTENSIBLE: return "extensible"; - case PREFERRED: return "preferred"; - case EXAMPLE: return "example"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUIRED: return "http://hl7.org/fhir/binding-strength"; - case EXTENSIBLE: return "http://hl7.org/fhir/binding-strength"; - case PREFERRED: return "http://hl7.org/fhir/binding-strength"; - case EXAMPLE: return "http://hl7.org/fhir/binding-strength"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUIRED: return "To be conformant, instances of this element SHALL include a code from the specified value set."; - case EXTENSIBLE: return "To be conformant, instances of this element SHALL include a code from the specified value set if any of the codes within the value set can apply to the concept being communicated. If the value set does not cover the concept (based on human review), alternate codings (or, data type allowing, text) may be included instead."; - case PREFERRED: return "Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to do so to be considered conformant."; - case EXAMPLE: return "Instances are not expected or even encouraged to draw from the specified value set. The value set merely provides examples of the types of concepts intended to be included."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUIRED: return "Required"; - case EXTENSIBLE: return "Extensible"; - case PREFERRED: return "Preferred"; - case EXAMPLE: return "Example"; - default: return "?"; - } - } - } - - public static class BindingStrengthEnumFactory implements EnumFactory { - public BindingStrength fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return BindingStrength.REQUIRED; - if ("extensible".equals(codeString)) - return BindingStrength.EXTENSIBLE; - if ("preferred".equals(codeString)) - return BindingStrength.PREFERRED; - if ("example".equals(codeString)) - return BindingStrength.EXAMPLE; - throw new IllegalArgumentException("Unknown BindingStrength code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("required".equals(codeString)) - return new Enumeration(this, BindingStrength.REQUIRED); - if ("extensible".equals(codeString)) - return new Enumeration(this, BindingStrength.EXTENSIBLE); - if ("preferred".equals(codeString)) - return new Enumeration(this, BindingStrength.PREFERRED); - if ("example".equals(codeString)) - return new Enumeration(this, BindingStrength.EXAMPLE); - throw new FHIRException("Unknown BindingStrength code '"+codeString+"'"); - } - public String toCode(BindingStrength code) { - if (code == BindingStrength.REQUIRED) - return "required"; - if (code == BindingStrength.EXTENSIBLE) - return "extensible"; - if (code == BindingStrength.PREFERRED) - return "preferred"; - if (code == BindingStrength.EXAMPLE) - return "example"; - return "?"; - } - public String toSystem(BindingStrength code) { - return code.getSystem(); - } - } - - public enum ConceptMapEquivalence { - /** - * The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical). - */ - EQUIVALENT, - /** - * The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identical or irrelevant (i.e. intentionally identical). - */ - EQUAL, - /** - * The target mapping is wider in meaning than the source concept. - */ - WIDER, - /** - * The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). - */ - SUBSUMES, - /** - * The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally. - */ - NARROWER, - /** - * The target mapping specializes the meaning of the source concept (e.g. the target is-a source). - */ - SPECIALIZES, - /** - * The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally. - */ - INEXACT, - /** - * There is no match for this concept in the destination concept system. - */ - UNMATCHED, - /** - * This is an explicit assertion that there is no mapping between the source and target concept. - */ - DISJOINT, - /** - * added to help the parsers - */ - NULL; - public static ConceptMapEquivalence fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("equivalent".equals(codeString)) - return EQUIVALENT; - if ("equal".equals(codeString)) - return EQUAL; - if ("wider".equals(codeString)) - return WIDER; - if ("subsumes".equals(codeString)) - return SUBSUMES; - if ("narrower".equals(codeString)) - return NARROWER; - if ("specializes".equals(codeString)) - return SPECIALIZES; - if ("inexact".equals(codeString)) - return INEXACT; - if ("unmatched".equals(codeString)) - return UNMATCHED; - if ("disjoint".equals(codeString)) - return DISJOINT; - throw new FHIRException("Unknown ConceptMapEquivalence code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case EQUIVALENT: return "equivalent"; - case EQUAL: return "equal"; - case WIDER: return "wider"; - case SUBSUMES: return "subsumes"; - case NARROWER: return "narrower"; - case SPECIALIZES: return "specializes"; - case INEXACT: return "inexact"; - case UNMATCHED: return "unmatched"; - case DISJOINT: return "disjoint"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUIVALENT: return "http://hl7.org/fhir/concept-map-equivalence"; - case EQUAL: return "http://hl7.org/fhir/concept-map-equivalence"; - case WIDER: return "http://hl7.org/fhir/concept-map-equivalence"; - case SUBSUMES: return "http://hl7.org/fhir/concept-map-equivalence"; - case NARROWER: return "http://hl7.org/fhir/concept-map-equivalence"; - case SPECIALIZES: return "http://hl7.org/fhir/concept-map-equivalence"; - case INEXACT: return "http://hl7.org/fhir/concept-map-equivalence"; - case UNMATCHED: return "http://hl7.org/fhir/concept-map-equivalence"; - case DISJOINT: return "http://hl7.org/fhir/concept-map-equivalence"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EQUIVALENT: return "The definitions of the concepts mean the same thing (including when structural implications of meaning are considered) (i.e. extensionally identical)."; - case EQUAL: return "The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural implications of meaning are identical or irrelevant (i.e. intentionally identical)."; - case WIDER: return "The target mapping is wider in meaning than the source concept."; - case SUBSUMES: return "The target mapping subsumes the meaning of the source concept (e.g. the source is-a target)."; - case NARROWER: return "The target mapping is narrower in meaning that the source concept. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally."; - case SPECIALIZES: return "The target mapping specializes the meaning of the source concept (e.g. the target is-a source)."; - case INEXACT: return "The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense in which the mapping is narrower SHALL be described in the comments in this case, and applications should be careful when attempting to use these mappings operationally."; - case UNMATCHED: return "There is no match for this concept in the destination concept system."; - case DISJOINT: return "This is an explicit assertion that there is no mapping between the source and target concept."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUIVALENT: return "Equivalent"; - case EQUAL: return "Equal"; - case WIDER: return "Wider"; - case SUBSUMES: return "Subsumes"; - case NARROWER: return "Narrower"; - case SPECIALIZES: return "Specializes"; - case INEXACT: return "Inexact"; - case UNMATCHED: return "Unmatched"; - case DISJOINT: return "Disjoint"; - default: return "?"; - } - } - } - - public static class ConceptMapEquivalenceEnumFactory implements EnumFactory { - public ConceptMapEquivalence fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("equivalent".equals(codeString)) - return ConceptMapEquivalence.EQUIVALENT; - if ("equal".equals(codeString)) - return ConceptMapEquivalence.EQUAL; - if ("wider".equals(codeString)) - return ConceptMapEquivalence.WIDER; - if ("subsumes".equals(codeString)) - return ConceptMapEquivalence.SUBSUMES; - if ("narrower".equals(codeString)) - return ConceptMapEquivalence.NARROWER; - if ("specializes".equals(codeString)) - return ConceptMapEquivalence.SPECIALIZES; - if ("inexact".equals(codeString)) - return ConceptMapEquivalence.INEXACT; - if ("unmatched".equals(codeString)) - return ConceptMapEquivalence.UNMATCHED; - if ("disjoint".equals(codeString)) - return ConceptMapEquivalence.DISJOINT; - throw new IllegalArgumentException("Unknown ConceptMapEquivalence code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("equivalent".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.EQUIVALENT); - if ("equal".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.EQUAL); - if ("wider".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.WIDER); - if ("subsumes".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.SUBSUMES); - if ("narrower".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.NARROWER); - if ("specializes".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.SPECIALIZES); - if ("inexact".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.INEXACT); - if ("unmatched".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.UNMATCHED); - if ("disjoint".equals(codeString)) - return new Enumeration(this, ConceptMapEquivalence.DISJOINT); - throw new FHIRException("Unknown ConceptMapEquivalence code '"+codeString+"'"); - } - public String toCode(ConceptMapEquivalence code) { - if (code == ConceptMapEquivalence.EQUIVALENT) - return "equivalent"; - if (code == ConceptMapEquivalence.EQUAL) - return "equal"; - if (code == ConceptMapEquivalence.WIDER) - return "wider"; - if (code == ConceptMapEquivalence.SUBSUMES) - return "subsumes"; - if (code == ConceptMapEquivalence.NARROWER) - return "narrower"; - if (code == ConceptMapEquivalence.SPECIALIZES) - return "specializes"; - if (code == ConceptMapEquivalence.INEXACT) - return "inexact"; - if (code == ConceptMapEquivalence.UNMATCHED) - return "unmatched"; - if (code == ConceptMapEquivalence.DISJOINT) - return "disjoint"; - return "?"; - } - public String toSystem(ConceptMapEquivalence code) { - return code.getSystem(); - } - } - - public enum ConformanceResourceStatus { - /** - * This resource is still under development. - */ - DRAFT, - /** - * This resource is ready for normal use. - */ - ACTIVE, - /** - * This resource has been withdrawn or superseded and should no longer be used. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - public static ConformanceResourceStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("retired".equals(codeString)) - return RETIRED; - throw new FHIRException("Unknown ConformanceResourceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return "http://hl7.org/fhir/conformance-resource-status"; - case ACTIVE: return "http://hl7.org/fhir/conformance-resource-status"; - case RETIRED: return "http://hl7.org/fhir/conformance-resource-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This resource is still under development."; - case ACTIVE: return "This resource is ready for normal use."; - case RETIRED: return "This resource has been withdrawn or superseded and should no longer be used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case ACTIVE: return "Active"; - case RETIRED: return "Retired"; - default: return "?"; - } - } - } - - public static class ConformanceResourceStatusEnumFactory implements EnumFactory { - public ConformanceResourceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ConformanceResourceStatus.DRAFT; - if ("active".equals(codeString)) - return ConformanceResourceStatus.ACTIVE; - if ("retired".equals(codeString)) - return ConformanceResourceStatus.RETIRED; - throw new IllegalArgumentException("Unknown ConformanceResourceStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return new Enumeration(this, ConformanceResourceStatus.DRAFT); - if ("active".equals(codeString)) - return new Enumeration(this, ConformanceResourceStatus.ACTIVE); - if ("retired".equals(codeString)) - return new Enumeration(this, ConformanceResourceStatus.RETIRED); - throw new FHIRException("Unknown ConformanceResourceStatus code '"+codeString+"'"); - } - public String toCode(ConformanceResourceStatus code) { - if (code == ConformanceResourceStatus.DRAFT) - return "draft"; - if (code == ConformanceResourceStatus.ACTIVE) - return "active"; - if (code == ConformanceResourceStatus.RETIRED) - return "retired"; - return "?"; - } - public String toSystem(ConformanceResourceStatus code) { - return code.getSystem(); - } - } - - public enum DataAbsentReason { - /** - * The value is not known. - */ - UNKNOWN, - /** - * The source human does not know the value. - */ - ASKED, - /** - * There is reason to expect (from the workflow) that the value may become known. - */ - TEMP, - /** - * The workflow didn't lead to this value being known. - */ - NOTASKED, - /** - * The information is not available due to security, privacy or related reasons. - */ - MASKED, - /** - * The source system wasn't capable of supporting this element. - */ - UNSUPPORTED, - /** - * The content of the data is represented in the resource narrative. - */ - ASTEXT, - /** - * Some system or workflow process error means that the information is not available. - */ - ERROR, - /** - * NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value. - */ - NAN, - /** - * added to help the parsers - */ - NULL; - public static DataAbsentReason fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("unknown".equals(codeString)) - return UNKNOWN; - if ("asked".equals(codeString)) - return ASKED; - if ("temp".equals(codeString)) - return TEMP; - if ("not-asked".equals(codeString)) - return NOTASKED; - if ("masked".equals(codeString)) - return MASKED; - if ("unsupported".equals(codeString)) - return UNSUPPORTED; - if ("astext".equals(codeString)) - return ASTEXT; - if ("error".equals(codeString)) - return ERROR; - if ("NaN".equals(codeString)) - return NAN; - throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UNKNOWN: return "unknown"; - case ASKED: return "asked"; - case TEMP: return "temp"; - case NOTASKED: return "not-asked"; - case MASKED: return "masked"; - case UNSUPPORTED: return "unsupported"; - case ASTEXT: return "astext"; - case ERROR: return "error"; - case NAN: return "NaN"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UNKNOWN: return "http://hl7.org/fhir/data-absent-reason"; - case ASKED: return "http://hl7.org/fhir/data-absent-reason"; - case TEMP: return "http://hl7.org/fhir/data-absent-reason"; - case NOTASKED: return "http://hl7.org/fhir/data-absent-reason"; - case MASKED: return "http://hl7.org/fhir/data-absent-reason"; - case UNSUPPORTED: return "http://hl7.org/fhir/data-absent-reason"; - case ASTEXT: return "http://hl7.org/fhir/data-absent-reason"; - case ERROR: return "http://hl7.org/fhir/data-absent-reason"; - case NAN: return "http://hl7.org/fhir/data-absent-reason"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UNKNOWN: return "The value is not known."; - case ASKED: return "The source human does not know the value."; - case TEMP: return "There is reason to expect (from the workflow) that the value may become known."; - case NOTASKED: return "The workflow didn't lead to this value being known."; - case MASKED: return "The information is not available due to security, privacy or related reasons."; - case UNSUPPORTED: return "The source system wasn't capable of supporting this element."; - case ASTEXT: return "The content of the data is represented in the resource narrative."; - case ERROR: return "Some system or workflow process error means that the information is not available."; - case NAN: return "NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UNKNOWN: return "Unknown"; - case ASKED: return "Asked"; - case TEMP: return "Temp"; - case NOTASKED: return "Not Asked"; - case MASKED: return "Masked"; - case UNSUPPORTED: return "Unsupported"; - case ASTEXT: return "As Text"; - case ERROR: return "Error"; - case NAN: return "Not a Number"; - default: return "?"; - } - } - } - - public static class DataAbsentReasonEnumFactory implements EnumFactory { - public DataAbsentReason fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("unknown".equals(codeString)) - return DataAbsentReason.UNKNOWN; - if ("asked".equals(codeString)) - return DataAbsentReason.ASKED; - if ("temp".equals(codeString)) - return DataAbsentReason.TEMP; - if ("not-asked".equals(codeString)) - return DataAbsentReason.NOTASKED; - if ("masked".equals(codeString)) - return DataAbsentReason.MASKED; - if ("unsupported".equals(codeString)) - return DataAbsentReason.UNSUPPORTED; - if ("astext".equals(codeString)) - return DataAbsentReason.ASTEXT; - if ("error".equals(codeString)) - return DataAbsentReason.ERROR; - if ("NaN".equals(codeString)) - return DataAbsentReason.NAN; - throw new IllegalArgumentException("Unknown DataAbsentReason code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("unknown".equals(codeString)) - return new Enumeration(this, DataAbsentReason.UNKNOWN); - if ("asked".equals(codeString)) - return new Enumeration(this, DataAbsentReason.ASKED); - if ("temp".equals(codeString)) - return new Enumeration(this, DataAbsentReason.TEMP); - if ("not-asked".equals(codeString)) - return new Enumeration(this, DataAbsentReason.NOTASKED); - if ("masked".equals(codeString)) - return new Enumeration(this, DataAbsentReason.MASKED); - if ("unsupported".equals(codeString)) - return new Enumeration(this, DataAbsentReason.UNSUPPORTED); - if ("astext".equals(codeString)) - return new Enumeration(this, DataAbsentReason.ASTEXT); - if ("error".equals(codeString)) - return new Enumeration(this, DataAbsentReason.ERROR); - if ("NaN".equals(codeString)) - return new Enumeration(this, DataAbsentReason.NAN); - throw new FHIRException("Unknown DataAbsentReason code '"+codeString+"'"); - } - public String toCode(DataAbsentReason code) { - if (code == DataAbsentReason.UNKNOWN) - return "unknown"; - if (code == DataAbsentReason.ASKED) - return "asked"; - if (code == DataAbsentReason.TEMP) - return "temp"; - if (code == DataAbsentReason.NOTASKED) - return "not-asked"; - if (code == DataAbsentReason.MASKED) - return "masked"; - if (code == DataAbsentReason.UNSUPPORTED) - return "unsupported"; - if (code == DataAbsentReason.ASTEXT) - return "astext"; - if (code == DataAbsentReason.ERROR) - return "error"; - if (code == DataAbsentReason.NAN) - return "NaN"; - return "?"; - } - public String toSystem(DataAbsentReason code) { - return code.getSystem(); - } - } - - public enum DataType { - /** - * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. - */ - ACTIONDEFINITION, - /** - * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. - */ - ADDRESS, - /** - * null - */ - AGE, - /** - * A text note which also contains information about who made the statement and when. - */ - ANNOTATION, - /** - * For referring to data content defined in other formats. - */ - ATTACHMENT, - /** - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ - BACKBONEELEMENT, - /** - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ - CODEABLECONCEPT, - /** - * A reference to a code defined by a terminology system. - */ - CODING, - /** - * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - */ - CONTACTPOINT, - /** - * null - */ - COUNT, - /** - * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. - */ - DATAREQUIREMENT, - /** - * null - */ - DISTANCE, - /** - * null - */ - DURATION, - /** - * Base definition for all elements in a resource. - */ - ELEMENT, - /** - * Captures constraints on each element within the resource, profile, or extension. - */ - ELEMENTDEFINITION, - /** - * Optional Extensions Element - found in all resources. - */ - EXTENSION, - /** - * A human's name with the ability to identify parts and usage. - */ - HUMANNAME, - /** - * A technical identifier - identifies some entity uniquely and unambiguously. - */ - IDENTIFIER, - /** - * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ - META, - /** - * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. - */ - MODULEMETADATA, - /** - * null - */ - MONEY, - /** - * A human-readable formatted text, including images. - */ - NARRATIVE, - /** - * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. - */ - PARAMETERDEFINITION, - /** - * A time period defined by a start and end date and optionally time. - */ - PERIOD, - /** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ - QUANTITY, - /** - * A set of ordered Quantities defined by a low and high limit. - */ - RANGE, - /** - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ - RATIO, - /** - * A reference from one resource to another. - */ - REFERENCE, - /** - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - */ - SAMPLEDDATA, - /** - * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. - */ - SIGNATURE, - /** - * null - */ - SIMPLEQUANTITY, - /** - * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. - */ - TIMING, - /** - * A description of a triggering event. - */ - TRIGGERDEFINITION, - /** - * A stream of bytes - */ - BASE64BINARY, - /** - * Value of "true" or "false" - */ - BOOLEAN, - /** - * A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents - */ - CODE, - /** - * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. - */ - DATE, - /** - * A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. - */ - DATETIME, - /** - * A rational number with implicit precision - */ - DECIMAL, - /** - * Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. - */ - ID, - /** - * An instant in time - known at least to the second - */ - INSTANT, - /** - * A whole number - */ - INTEGER, - /** - * A string that may contain markdown syntax for optional processing by a mark down presentation engine - */ - MARKDOWN, - /** - * An oid represented as a URI - */ - OID, - /** - * An integer with a value that is positive (e.g. >0) - */ - POSITIVEINT, - /** - * A sequence of Unicode characters - */ - STRING, - /** - * A time during the day, with no date specified - */ - TIME, - /** - * An integer with a value that is not negative (e.g. >= 0) - */ - UNSIGNEDINT, - /** - * String of characters used to identify a name or a resource - */ - URI, - /** - * A UUID, represented as a URI - */ - UUID, - /** - * XHTML format, as defined by W3C, but restricted usage (mainly, no active content) - */ - XHTML, - /** - * added to help the parsers - */ - NULL; - public static DataType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return ACTIONDEFINITION; - if ("Address".equals(codeString)) - return ADDRESS; - if ("Age".equals(codeString)) - return AGE; - if ("Annotation".equals(codeString)) - return ANNOTATION; - if ("Attachment".equals(codeString)) - return ATTACHMENT; - if ("BackboneElement".equals(codeString)) - return BACKBONEELEMENT; - if ("CodeableConcept".equals(codeString)) - return CODEABLECONCEPT; - if ("Coding".equals(codeString)) - return CODING; - if ("ContactPoint".equals(codeString)) - return CONTACTPOINT; - if ("Count".equals(codeString)) - return COUNT; - if ("DataRequirement".equals(codeString)) - return DATAREQUIREMENT; - if ("Distance".equals(codeString)) - return DISTANCE; - if ("Duration".equals(codeString)) - return DURATION; - if ("Element".equals(codeString)) - return ELEMENT; - if ("ElementDefinition".equals(codeString)) - return ELEMENTDEFINITION; - if ("Extension".equals(codeString)) - return EXTENSION; - if ("HumanName".equals(codeString)) - return HUMANNAME; - if ("Identifier".equals(codeString)) - return IDENTIFIER; - if ("Meta".equals(codeString)) - return META; - if ("ModuleMetadata".equals(codeString)) - return MODULEMETADATA; - if ("Money".equals(codeString)) - return MONEY; - if ("Narrative".equals(codeString)) - return NARRATIVE; - if ("ParameterDefinition".equals(codeString)) - return PARAMETERDEFINITION; - if ("Period".equals(codeString)) - return PERIOD; - if ("Quantity".equals(codeString)) - return QUANTITY; - if ("Range".equals(codeString)) - return RANGE; - if ("Ratio".equals(codeString)) - return RATIO; - if ("Reference".equals(codeString)) - return REFERENCE; - if ("SampledData".equals(codeString)) - return SAMPLEDDATA; - if ("Signature".equals(codeString)) - return SIGNATURE; - if ("SimpleQuantity".equals(codeString)) - return SIMPLEQUANTITY; - if ("Timing".equals(codeString)) - return TIMING; - if ("TriggerDefinition".equals(codeString)) - return TRIGGERDEFINITION; - if ("base64Binary".equals(codeString)) - return BASE64BINARY; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("code".equals(codeString)) - return CODE; - if ("date".equals(codeString)) - return DATE; - if ("dateTime".equals(codeString)) - return DATETIME; - if ("decimal".equals(codeString)) - return DECIMAL; - if ("id".equals(codeString)) - return ID; - if ("instant".equals(codeString)) - return INSTANT; - if ("integer".equals(codeString)) - return INTEGER; - if ("markdown".equals(codeString)) - return MARKDOWN; - if ("oid".equals(codeString)) - return OID; - if ("positiveInt".equals(codeString)) - return POSITIVEINT; - if ("string".equals(codeString)) - return STRING; - if ("time".equals(codeString)) - return TIME; - if ("unsignedInt".equals(codeString)) - return UNSIGNEDINT; - if ("uri".equals(codeString)) - return URI; - if ("uuid".equals(codeString)) - return UUID; - if ("xhtml".equals(codeString)) - return XHTML; - throw new FHIRException("Unknown DataType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIONDEFINITION: return "ActionDefinition"; - case ADDRESS: return "Address"; - case AGE: return "Age"; - case ANNOTATION: return "Annotation"; - case ATTACHMENT: return "Attachment"; - case BACKBONEELEMENT: return "BackboneElement"; - case CODEABLECONCEPT: return "CodeableConcept"; - case CODING: return "Coding"; - case CONTACTPOINT: return "ContactPoint"; - case COUNT: return "Count"; - case DATAREQUIREMENT: return "DataRequirement"; - case DISTANCE: return "Distance"; - case DURATION: return "Duration"; - case ELEMENT: return "Element"; - case ELEMENTDEFINITION: return "ElementDefinition"; - case EXTENSION: return "Extension"; - case HUMANNAME: return "HumanName"; - case IDENTIFIER: return "Identifier"; - case META: return "Meta"; - case MODULEMETADATA: return "ModuleMetadata"; - case MONEY: return "Money"; - case NARRATIVE: return "Narrative"; - case PARAMETERDEFINITION: return "ParameterDefinition"; - case PERIOD: return "Period"; - case QUANTITY: return "Quantity"; - case RANGE: return "Range"; - case RATIO: return "Ratio"; - case REFERENCE: return "Reference"; - case SAMPLEDDATA: return "SampledData"; - case SIGNATURE: return "Signature"; - case SIMPLEQUANTITY: return "SimpleQuantity"; - case TIMING: return "Timing"; - case TRIGGERDEFINITION: return "TriggerDefinition"; - case BASE64BINARY: return "base64Binary"; - case BOOLEAN: return "boolean"; - case CODE: return "code"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case DECIMAL: return "decimal"; - case ID: return "id"; - case INSTANT: return "instant"; - case INTEGER: return "integer"; - case MARKDOWN: return "markdown"; - case OID: return "oid"; - case POSITIVEINT: return "positiveInt"; - case STRING: return "string"; - case TIME: return "time"; - case UNSIGNEDINT: return "unsignedInt"; - case URI: return "uri"; - case UUID: return "uuid"; - case XHTML: return "xhtml"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIONDEFINITION: return "http://hl7.org/fhir/data-types"; - case ADDRESS: return "http://hl7.org/fhir/data-types"; - case AGE: return "http://hl7.org/fhir/data-types"; - case ANNOTATION: return "http://hl7.org/fhir/data-types"; - case ATTACHMENT: return "http://hl7.org/fhir/data-types"; - case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types"; - case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types"; - case CODING: return "http://hl7.org/fhir/data-types"; - case CONTACTPOINT: return "http://hl7.org/fhir/data-types"; - case COUNT: return "http://hl7.org/fhir/data-types"; - case DATAREQUIREMENT: return "http://hl7.org/fhir/data-types"; - case DISTANCE: return "http://hl7.org/fhir/data-types"; - case DURATION: return "http://hl7.org/fhir/data-types"; - case ELEMENT: return "http://hl7.org/fhir/data-types"; - case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types"; - case EXTENSION: return "http://hl7.org/fhir/data-types"; - case HUMANNAME: return "http://hl7.org/fhir/data-types"; - case IDENTIFIER: return "http://hl7.org/fhir/data-types"; - case META: return "http://hl7.org/fhir/data-types"; - case MODULEMETADATA: return "http://hl7.org/fhir/data-types"; - case MONEY: return "http://hl7.org/fhir/data-types"; - case NARRATIVE: return "http://hl7.org/fhir/data-types"; - case PARAMETERDEFINITION: return "http://hl7.org/fhir/data-types"; - case PERIOD: return "http://hl7.org/fhir/data-types"; - case QUANTITY: return "http://hl7.org/fhir/data-types"; - case RANGE: return "http://hl7.org/fhir/data-types"; - case RATIO: return "http://hl7.org/fhir/data-types"; - case REFERENCE: return "http://hl7.org/fhir/data-types"; - case SAMPLEDDATA: return "http://hl7.org/fhir/data-types"; - case SIGNATURE: return "http://hl7.org/fhir/data-types"; - case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types"; - case TIMING: return "http://hl7.org/fhir/data-types"; - case TRIGGERDEFINITION: return "http://hl7.org/fhir/data-types"; - case BASE64BINARY: return "http://hl7.org/fhir/data-types"; - case BOOLEAN: return "http://hl7.org/fhir/data-types"; - case CODE: return "http://hl7.org/fhir/data-types"; - case DATE: return "http://hl7.org/fhir/data-types"; - case DATETIME: return "http://hl7.org/fhir/data-types"; - case DECIMAL: return "http://hl7.org/fhir/data-types"; - case ID: return "http://hl7.org/fhir/data-types"; - case INSTANT: return "http://hl7.org/fhir/data-types"; - case INTEGER: return "http://hl7.org/fhir/data-types"; - case MARKDOWN: return "http://hl7.org/fhir/data-types"; - case OID: return "http://hl7.org/fhir/data-types"; - case POSITIVEINT: return "http://hl7.org/fhir/data-types"; - case STRING: return "http://hl7.org/fhir/data-types"; - case TIME: return "http://hl7.org/fhir/data-types"; - case UNSIGNEDINT: return "http://hl7.org/fhir/data-types"; - case URI: return "http://hl7.org/fhir/data-types"; - case UUID: return "http://hl7.org/fhir/data-types"; - case XHTML: return "http://hl7.org/fhir/data-types"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIONDEFINITION: return "The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library."; - case ADDRESS: return "An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world."; - case AGE: return ""; - case ANNOTATION: return "A text note which also contains information about who made the statement and when."; - case ATTACHMENT: return "For referring to data content defined in other formats."; - case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type."; - case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."; - case CODING: return "A reference to a code defined by a terminology system."; - case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."; - case COUNT: return ""; - case DATAREQUIREMENT: return "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data."; - case DISTANCE: return ""; - case DURATION: return ""; - case ELEMENT: return "Base definition for all elements in a resource."; - case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension."; - case EXTENSION: return "Optional Extensions Element - found in all resources."; - case HUMANNAME: return "A human's name with the ability to identify parts and usage."; - case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously."; - case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."; - case MODULEMETADATA: return "The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information."; - case MONEY: return ""; - case NARRATIVE: return "A human-readable formatted text, including images."; - case PARAMETERDEFINITION: return "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse."; - case PERIOD: return "A time period defined by a start and end date and optionally time."; - case QUANTITY: return "A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies."; - case RANGE: return "A set of ordered Quantities defined by a low and high limit."; - case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator."; - case REFERENCE: return "A reference from one resource to another."; - case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."; - case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities."; - case SIMPLEQUANTITY: return ""; - case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds."; - case TRIGGERDEFINITION: return "A description of a triggering event."; - case BASE64BINARY: return "A stream of bytes"; - case BOOLEAN: return "Value of \"true\" or \"false\""; - case CODE: return "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"; - case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates."; - case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates."; - case DECIMAL: return "A rational number with implicit precision"; - case ID: return "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive."; - case INSTANT: return "An instant in time - known at least to the second"; - case INTEGER: return "A whole number"; - case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine"; - case OID: return "An oid represented as a URI"; - case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)"; - case STRING: return "A sequence of Unicode characters"; - case TIME: return "A time during the day, with no date specified"; - case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)"; - case URI: return "String of characters used to identify a name or a resource"; - case UUID: return "A UUID, represented as a URI"; - case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIONDEFINITION: return "ActionDefinition"; - case ADDRESS: return "Address"; - case AGE: return "Age"; - case ANNOTATION: return "Annotation"; - case ATTACHMENT: return "Attachment"; - case BACKBONEELEMENT: return "BackboneElement"; - case CODEABLECONCEPT: return "CodeableConcept"; - case CODING: return "Coding"; - case CONTACTPOINT: return "ContactPoint"; - case COUNT: return "Count"; - case DATAREQUIREMENT: return "DataRequirement"; - case DISTANCE: return "Distance"; - case DURATION: return "Duration"; - case ELEMENT: return "Element"; - case ELEMENTDEFINITION: return "ElementDefinition"; - case EXTENSION: return "Extension"; - case HUMANNAME: return "HumanName"; - case IDENTIFIER: return "Identifier"; - case META: return "Meta"; - case MODULEMETADATA: return "ModuleMetadata"; - case MONEY: return "Money"; - case NARRATIVE: return "Narrative"; - case PARAMETERDEFINITION: return "ParameterDefinition"; - case PERIOD: return "Period"; - case QUANTITY: return "Quantity"; - case RANGE: return "Range"; - case RATIO: return "Ratio"; - case REFERENCE: return "Reference"; - case SAMPLEDDATA: return "SampledData"; - case SIGNATURE: return "Signature"; - case SIMPLEQUANTITY: return "SimpleQuantity"; - case TIMING: return "Timing"; - case TRIGGERDEFINITION: return "TriggerDefinition"; - case BASE64BINARY: return "base64Binary"; - case BOOLEAN: return "boolean"; - case CODE: return "code"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case DECIMAL: return "decimal"; - case ID: return "id"; - case INSTANT: return "instant"; - case INTEGER: return "integer"; - case MARKDOWN: return "markdown"; - case OID: return "oid"; - case POSITIVEINT: return "positiveInt"; - case STRING: return "string"; - case TIME: return "time"; - case UNSIGNEDINT: return "unsignedInt"; - case URI: return "uri"; - case UUID: return "uuid"; - case XHTML: return "XHTML"; - default: return "?"; - } - } - } - - public static class DataTypeEnumFactory implements EnumFactory { - public DataType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return DataType.ACTIONDEFINITION; - if ("Address".equals(codeString)) - return DataType.ADDRESS; - if ("Age".equals(codeString)) - return DataType.AGE; - if ("Annotation".equals(codeString)) - return DataType.ANNOTATION; - if ("Attachment".equals(codeString)) - return DataType.ATTACHMENT; - if ("BackboneElement".equals(codeString)) - return DataType.BACKBONEELEMENT; - if ("CodeableConcept".equals(codeString)) - return DataType.CODEABLECONCEPT; - if ("Coding".equals(codeString)) - return DataType.CODING; - if ("ContactPoint".equals(codeString)) - return DataType.CONTACTPOINT; - if ("Count".equals(codeString)) - return DataType.COUNT; - if ("DataRequirement".equals(codeString)) - return DataType.DATAREQUIREMENT; - if ("Distance".equals(codeString)) - return DataType.DISTANCE; - if ("Duration".equals(codeString)) - return DataType.DURATION; - if ("Element".equals(codeString)) - return DataType.ELEMENT; - if ("ElementDefinition".equals(codeString)) - return DataType.ELEMENTDEFINITION; - if ("Extension".equals(codeString)) - return DataType.EXTENSION; - if ("HumanName".equals(codeString)) - return DataType.HUMANNAME; - if ("Identifier".equals(codeString)) - return DataType.IDENTIFIER; - if ("Meta".equals(codeString)) - return DataType.META; - if ("ModuleMetadata".equals(codeString)) - return DataType.MODULEMETADATA; - if ("Money".equals(codeString)) - return DataType.MONEY; - if ("Narrative".equals(codeString)) - return DataType.NARRATIVE; - if ("ParameterDefinition".equals(codeString)) - return DataType.PARAMETERDEFINITION; - if ("Period".equals(codeString)) - return DataType.PERIOD; - if ("Quantity".equals(codeString)) - return DataType.QUANTITY; - if ("Range".equals(codeString)) - return DataType.RANGE; - if ("Ratio".equals(codeString)) - return DataType.RATIO; - if ("Reference".equals(codeString)) - return DataType.REFERENCE; - if ("SampledData".equals(codeString)) - return DataType.SAMPLEDDATA; - if ("Signature".equals(codeString)) - return DataType.SIGNATURE; - if ("SimpleQuantity".equals(codeString)) - return DataType.SIMPLEQUANTITY; - if ("Timing".equals(codeString)) - return DataType.TIMING; - if ("TriggerDefinition".equals(codeString)) - return DataType.TRIGGERDEFINITION; - if ("base64Binary".equals(codeString)) - return DataType.BASE64BINARY; - if ("boolean".equals(codeString)) - return DataType.BOOLEAN; - if ("code".equals(codeString)) - return DataType.CODE; - if ("date".equals(codeString)) - return DataType.DATE; - if ("dateTime".equals(codeString)) - return DataType.DATETIME; - if ("decimal".equals(codeString)) - return DataType.DECIMAL; - if ("id".equals(codeString)) - return DataType.ID; - if ("instant".equals(codeString)) - return DataType.INSTANT; - if ("integer".equals(codeString)) - return DataType.INTEGER; - if ("markdown".equals(codeString)) - return DataType.MARKDOWN; - if ("oid".equals(codeString)) - return DataType.OID; - if ("positiveInt".equals(codeString)) - return DataType.POSITIVEINT; - if ("string".equals(codeString)) - return DataType.STRING; - if ("time".equals(codeString)) - return DataType.TIME; - if ("unsignedInt".equals(codeString)) - return DataType.UNSIGNEDINT; - if ("uri".equals(codeString)) - return DataType.URI; - if ("uuid".equals(codeString)) - return DataType.UUID; - if ("xhtml".equals(codeString)) - return DataType.XHTML; - throw new IllegalArgumentException("Unknown DataType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return new Enumeration(this, DataType.ACTIONDEFINITION); - if ("Address".equals(codeString)) - return new Enumeration(this, DataType.ADDRESS); - if ("Age".equals(codeString)) - return new Enumeration(this, DataType.AGE); - if ("Annotation".equals(codeString)) - return new Enumeration(this, DataType.ANNOTATION); - if ("Attachment".equals(codeString)) - return new Enumeration(this, DataType.ATTACHMENT); - if ("BackboneElement".equals(codeString)) - return new Enumeration(this, DataType.BACKBONEELEMENT); - if ("CodeableConcept".equals(codeString)) - return new Enumeration(this, DataType.CODEABLECONCEPT); - if ("Coding".equals(codeString)) - return new Enumeration(this, DataType.CODING); - if ("ContactPoint".equals(codeString)) - return new Enumeration(this, DataType.CONTACTPOINT); - if ("Count".equals(codeString)) - return new Enumeration(this, DataType.COUNT); - if ("DataRequirement".equals(codeString)) - return new Enumeration(this, DataType.DATAREQUIREMENT); - if ("Distance".equals(codeString)) - return new Enumeration(this, DataType.DISTANCE); - if ("Duration".equals(codeString)) - return new Enumeration(this, DataType.DURATION); - if ("Element".equals(codeString)) - return new Enumeration(this, DataType.ELEMENT); - if ("ElementDefinition".equals(codeString)) - return new Enumeration(this, DataType.ELEMENTDEFINITION); - if ("Extension".equals(codeString)) - return new Enumeration(this, DataType.EXTENSION); - if ("HumanName".equals(codeString)) - return new Enumeration(this, DataType.HUMANNAME); - if ("Identifier".equals(codeString)) - return new Enumeration(this, DataType.IDENTIFIER); - if ("Meta".equals(codeString)) - return new Enumeration(this, DataType.META); - if ("ModuleMetadata".equals(codeString)) - return new Enumeration(this, DataType.MODULEMETADATA); - if ("Money".equals(codeString)) - return new Enumeration(this, DataType.MONEY); - if ("Narrative".equals(codeString)) - return new Enumeration(this, DataType.NARRATIVE); - if ("ParameterDefinition".equals(codeString)) - return new Enumeration(this, DataType.PARAMETERDEFINITION); - if ("Period".equals(codeString)) - return new Enumeration(this, DataType.PERIOD); - if ("Quantity".equals(codeString)) - return new Enumeration(this, DataType.QUANTITY); - if ("Range".equals(codeString)) - return new Enumeration(this, DataType.RANGE); - if ("Ratio".equals(codeString)) - return new Enumeration(this, DataType.RATIO); - if ("Reference".equals(codeString)) - return new Enumeration(this, DataType.REFERENCE); - if ("SampledData".equals(codeString)) - return new Enumeration(this, DataType.SAMPLEDDATA); - if ("Signature".equals(codeString)) - return new Enumeration(this, DataType.SIGNATURE); - if ("SimpleQuantity".equals(codeString)) - return new Enumeration(this, DataType.SIMPLEQUANTITY); - if ("Timing".equals(codeString)) - return new Enumeration(this, DataType.TIMING); - if ("TriggerDefinition".equals(codeString)) - return new Enumeration(this, DataType.TRIGGERDEFINITION); - if ("base64Binary".equals(codeString)) - return new Enumeration(this, DataType.BASE64BINARY); - if ("boolean".equals(codeString)) - return new Enumeration(this, DataType.BOOLEAN); - if ("code".equals(codeString)) - return new Enumeration(this, DataType.CODE); - if ("date".equals(codeString)) - return new Enumeration(this, DataType.DATE); - if ("dateTime".equals(codeString)) - return new Enumeration(this, DataType.DATETIME); - if ("decimal".equals(codeString)) - return new Enumeration(this, DataType.DECIMAL); - if ("id".equals(codeString)) - return new Enumeration(this, DataType.ID); - if ("instant".equals(codeString)) - return new Enumeration(this, DataType.INSTANT); - if ("integer".equals(codeString)) - return new Enumeration(this, DataType.INTEGER); - if ("markdown".equals(codeString)) - return new Enumeration(this, DataType.MARKDOWN); - if ("oid".equals(codeString)) - return new Enumeration(this, DataType.OID); - if ("positiveInt".equals(codeString)) - return new Enumeration(this, DataType.POSITIVEINT); - if ("string".equals(codeString)) - return new Enumeration(this, DataType.STRING); - if ("time".equals(codeString)) - return new Enumeration(this, DataType.TIME); - if ("unsignedInt".equals(codeString)) - return new Enumeration(this, DataType.UNSIGNEDINT); - if ("uri".equals(codeString)) - return new Enumeration(this, DataType.URI); - if ("uuid".equals(codeString)) - return new Enumeration(this, DataType.UUID); - if ("xhtml".equals(codeString)) - return new Enumeration(this, DataType.XHTML); - throw new FHIRException("Unknown DataType code '"+codeString+"'"); - } - public String toCode(DataType code) { - if (code == DataType.ACTIONDEFINITION) - return "ActionDefinition"; - if (code == DataType.ADDRESS) - return "Address"; - if (code == DataType.AGE) - return "Age"; - if (code == DataType.ANNOTATION) - return "Annotation"; - if (code == DataType.ATTACHMENT) - return "Attachment"; - if (code == DataType.BACKBONEELEMENT) - return "BackboneElement"; - if (code == DataType.CODEABLECONCEPT) - return "CodeableConcept"; - if (code == DataType.CODING) - return "Coding"; - if (code == DataType.CONTACTPOINT) - return "ContactPoint"; - if (code == DataType.COUNT) - return "Count"; - if (code == DataType.DATAREQUIREMENT) - return "DataRequirement"; - if (code == DataType.DISTANCE) - return "Distance"; - if (code == DataType.DURATION) - return "Duration"; - if (code == DataType.ELEMENT) - return "Element"; - if (code == DataType.ELEMENTDEFINITION) - return "ElementDefinition"; - if (code == DataType.EXTENSION) - return "Extension"; - if (code == DataType.HUMANNAME) - return "HumanName"; - if (code == DataType.IDENTIFIER) - return "Identifier"; - if (code == DataType.META) - return "Meta"; - if (code == DataType.MODULEMETADATA) - return "ModuleMetadata"; - if (code == DataType.MONEY) - return "Money"; - if (code == DataType.NARRATIVE) - return "Narrative"; - if (code == DataType.PARAMETERDEFINITION) - return "ParameterDefinition"; - if (code == DataType.PERIOD) - return "Period"; - if (code == DataType.QUANTITY) - return "Quantity"; - if (code == DataType.RANGE) - return "Range"; - if (code == DataType.RATIO) - return "Ratio"; - if (code == DataType.REFERENCE) - return "Reference"; - if (code == DataType.SAMPLEDDATA) - return "SampledData"; - if (code == DataType.SIGNATURE) - return "Signature"; - if (code == DataType.SIMPLEQUANTITY) - return "SimpleQuantity"; - if (code == DataType.TIMING) - return "Timing"; - if (code == DataType.TRIGGERDEFINITION) - return "TriggerDefinition"; - if (code == DataType.BASE64BINARY) - return "base64Binary"; - if (code == DataType.BOOLEAN) - return "boolean"; - if (code == DataType.CODE) - return "code"; - if (code == DataType.DATE) - return "date"; - if (code == DataType.DATETIME) - return "dateTime"; - if (code == DataType.DECIMAL) - return "decimal"; - if (code == DataType.ID) - return "id"; - if (code == DataType.INSTANT) - return "instant"; - if (code == DataType.INTEGER) - return "integer"; - if (code == DataType.MARKDOWN) - return "markdown"; - if (code == DataType.OID) - return "oid"; - if (code == DataType.POSITIVEINT) - return "positiveInt"; - if (code == DataType.STRING) - return "string"; - if (code == DataType.TIME) - return "time"; - if (code == DataType.UNSIGNEDINT) - return "unsignedInt"; - if (code == DataType.URI) - return "uri"; - if (code == DataType.UUID) - return "uuid"; - if (code == DataType.XHTML) - return "xhtml"; - return "?"; - } - public String toSystem(DataType code) { - return code.getSystem(); - } - } - - public enum DocumentReferenceStatus { - /** - * This is the current reference for this document. - */ - CURRENT, - /** - * This reference has been superseded by another reference. - */ - SUPERSEDED, - /** - * This reference was created in error. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static DocumentReferenceStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return CURRENT; - if ("superseded".equals(codeString)) - return SUPERSEDED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case SUPERSEDED: return "superseded"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return "http://hl7.org/fhir/document-reference-status"; - case SUPERSEDED: return "http://hl7.org/fhir/document-reference-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/document-reference-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "This is the current reference for this document."; - case SUPERSEDED: return "This reference has been superseded by another reference."; - case ENTEREDINERROR: return "This reference was created in error."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "Current"; - case SUPERSEDED: return "Superseded"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class DocumentReferenceStatusEnumFactory implements EnumFactory { - public DocumentReferenceStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return DocumentReferenceStatus.CURRENT; - if ("superseded".equals(codeString)) - return DocumentReferenceStatus.SUPERSEDED; - if ("entered-in-error".equals(codeString)) - return DocumentReferenceStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return new Enumeration(this, DocumentReferenceStatus.CURRENT); - if ("superseded".equals(codeString)) - return new Enumeration(this, DocumentReferenceStatus.SUPERSEDED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, DocumentReferenceStatus.ENTEREDINERROR); - throw new FHIRException("Unknown DocumentReferenceStatus code '"+codeString+"'"); - } - public String toCode(DocumentReferenceStatus code) { - if (code == DocumentReferenceStatus.CURRENT) - return "current"; - if (code == DocumentReferenceStatus.SUPERSEDED) - return "superseded"; - if (code == DocumentReferenceStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(DocumentReferenceStatus code) { - return code.getSystem(); - } - } - - public enum FHIRAllTypes { - /** - * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. - */ - ACTIONDEFINITION, - /** - * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. - */ - ADDRESS, - /** - * null - */ - AGE, - /** - * A text note which also contains information about who made the statement and when. - */ - ANNOTATION, - /** - * For referring to data content defined in other formats. - */ - ATTACHMENT, - /** - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ - BACKBONEELEMENT, - /** - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ - CODEABLECONCEPT, - /** - * A reference to a code defined by a terminology system. - */ - CODING, - /** - * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - */ - CONTACTPOINT, - /** - * null - */ - COUNT, - /** - * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. - */ - DATAREQUIREMENT, - /** - * null - */ - DISTANCE, - /** - * null - */ - DURATION, - /** - * Base definition for all elements in a resource. - */ - ELEMENT, - /** - * Captures constraints on each element within the resource, profile, or extension. - */ - ELEMENTDEFINITION, - /** - * Optional Extensions Element - found in all resources. - */ - EXTENSION, - /** - * A human's name with the ability to identify parts and usage. - */ - HUMANNAME, - /** - * A technical identifier - identifies some entity uniquely and unambiguously. - */ - IDENTIFIER, - /** - * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ - META, - /** - * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. - */ - MODULEMETADATA, - /** - * null - */ - MONEY, - /** - * A human-readable formatted text, including images. - */ - NARRATIVE, - /** - * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. - */ - PARAMETERDEFINITION, - /** - * A time period defined by a start and end date and optionally time. - */ - PERIOD, - /** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ - QUANTITY, - /** - * A set of ordered Quantities defined by a low and high limit. - */ - RANGE, - /** - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ - RATIO, - /** - * A reference from one resource to another. - */ - REFERENCE, - /** - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - */ - SAMPLEDDATA, - /** - * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. - */ - SIGNATURE, - /** - * null - */ - SIMPLEQUANTITY, - /** - * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. - */ - TIMING, - /** - * A description of a triggering event. - */ - TRIGGERDEFINITION, - /** - * A stream of bytes - */ - BASE64BINARY, - /** - * Value of "true" or "false" - */ - BOOLEAN, - /** - * A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents - */ - CODE, - /** - * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. - */ - DATE, - /** - * A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. - */ - DATETIME, - /** - * A rational number with implicit precision - */ - DECIMAL, - /** - * Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. - */ - ID, - /** - * An instant in time - known at least to the second - */ - INSTANT, - /** - * A whole number - */ - INTEGER, - /** - * A string that may contain markdown syntax for optional processing by a mark down presentation engine - */ - MARKDOWN, - /** - * An oid represented as a URI - */ - OID, - /** - * An integer with a value that is positive (e.g. >0) - */ - POSITIVEINT, - /** - * A sequence of Unicode characters - */ - STRING, - /** - * A time during the day, with no date specified - */ - TIME, - /** - * An integer with a value that is not negative (e.g. >= 0) - */ - UNSIGNEDINT, - /** - * String of characters used to identify a name or a resource - */ - URI, - /** - * A UUID, represented as a URI - */ - UUID, - /** - * XHTML format, as defined by W3C, but restricted usage (mainly, no active content) - */ - XHTML, - /** - * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. - */ - ACCOUNT, - /** - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. - */ - ALLERGYINTOLERANCE, - /** - * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). - */ - APPOINTMENT, - /** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ - APPOINTMENTRESPONSE, - /** - * 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. - */ - AUDITEVENT, - /** - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ - BASIC, - /** - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ - BINARY, - /** - * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. - */ - BODYSITE, - /** - * A container for a collection of resources. - */ - BUNDLE, - /** - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. - */ - CAREPLAN, - /** - * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. - */ - CARETEAM, - /** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ - CLAIM, - /** - * This resource provides the adjudication details from the processing of a Claim resource. - */ - CLAIMRESPONSE, - /** - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. - */ - CLINICALIMPRESSION, - /** - * A code system resource specifies a set of codes drawn from one or more code systems. - */ - CODESYSTEM, - /** - * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. - */ - COMMUNICATION, - /** - * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. - */ - COMMUNICATIONREQUEST, - /** - * A compartment definition that defines how resources are accessed on a server. - */ - COMPARTMENTDEFINITION, - /** - * 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. - */ - COMPOSITION, - /** - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. - */ - CONCEPTMAP, - /** - * 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. - */ - CONDITION, - /** - * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. - */ - CONFORMANCE, - /** - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ - CONTRACT, - /** - * Financial instrument which may be used to pay for or reimburse health care products and services. - */ - COVERAGE, - /** - * The formal description of a single piece of information that can be gathered and reported. - */ - DATAELEMENT, - /** - * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. - */ - DECISIONSUPPORTRULE, - /** - * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. - */ - DECISIONSUPPORTSERVICEMODULE, - /** - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ - DETECTEDISSUE, - /** - * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. - */ - DEVICE, - /** - * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. - */ - DEVICECOMPONENT, - /** - * Describes a measurement, calculation or setting capability of a medical device. - */ - DEVICEMETRIC, - /** - * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. - */ - DEVICEUSEREQUEST, - /** - * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. - */ - DEVICEUSESTATEMENT, - /** - * A record of a request for a diagnostic investigation service to be performed. - */ - DIAGNOSTICORDER, - /** - * 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 interpretations, and formatted representation of diagnostic reports. - */ - DIAGNOSTICREPORT, - /** - * A manifest that defines a set of documents. - */ - DOCUMENTMANIFEST, - /** - * A reference to a document . - */ - DOCUMENTREFERENCE, - /** - * A resource that includes narrative, extensions, and contained resources. - */ - DOMAINRESOURCE, - /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. - */ - ELIGIBILITYREQUEST, - /** - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ - ELIGIBILITYRESPONSE, - /** - * 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. - */ - ENCOUNTER, - /** - * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. - */ - ENROLLMENTREQUEST, - /** - * This resource provides enrollment and plan details from the processing of an Enrollment resource. - */ - ENROLLMENTRESPONSE, - /** - * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. - */ - EPISODEOFCARE, - /** - * Resource to define constraints on the Expansion of a FHIR ValueSet. - */ - EXPANSIONPROFILE, - /** - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - */ - EXPLANATIONOFBENEFIT, - /** - * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. - */ - FAMILYMEMBERHISTORY, - /** - * Prospective warnings of potential issues when providing care to the patient. - */ - FLAG, - /** - * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. - */ - GOAL, - /** - * 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. - */ - GROUP, - /** - * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. - */ - GUIDANCERESPONSE, - /** - * The details of a healthcare service available at a location. - */ - HEALTHCARESERVICE, - /** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ - IMAGINGEXCERPT, - /** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ - IMAGINGOBJECTSELECTION, - /** - * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. - */ - IMAGINGSTUDY, - /** - * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. - */ - IMMUNIZATION, - /** - * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. - */ - IMMUNIZATIONRECOMMENDATION, - /** - * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. - */ - IMPLEMENTATIONGUIDE, - /** - * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. - */ - LIBRARY, - /** - * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". - */ - LINKAGE, - /** - * A set of information summarized from a list of other resources. - */ - LIST, - /** - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. - */ - LOCATION, - /** - * The Measure resource provides the definition of a quality measure. - */ - MEASURE, - /** - * The MeasureReport resource contains the results of evaluating a measure. - */ - MEASUREREPORT, - /** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. - */ - MEDIA, - /** - * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. - */ - MEDICATION, - /** - * Describes the event of a patient consuming or otherwise being administered 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. - */ - MEDICATIONADMINISTRATION, - /** - * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. - */ - MEDICATIONDISPENSE, - /** - * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. - */ - MEDICATIONORDER, - /** - * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. - */ - MEDICATIONSTATEMENT, - /** - * The header for a message exchange that is either requesting or responding to an action. The reference(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. - */ - MESSAGEHEADER, - /** - * The ModuleDefinition resource defines the data requirements for a quality artifact. - */ - MODULEDEFINITION, - /** - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ - NAMINGSYSTEM, - /** - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ - NUTRITIONORDER, - /** - * Measurements and simple assertions made about a patient, device or other subject. - */ - OBSERVATION, - /** - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). - */ - OPERATIONDEFINITION, - /** - * A collection of error, warning or information messages that result from a system action. - */ - OPERATIONOUTCOME, - /** - * A request to perform an action. - */ - ORDER, - /** - * A response to an order. - */ - ORDERRESPONSE, - /** - * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. - */ - ORDERSET, - /** - * 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. - */ - ORGANIZATION, - /** - * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. - */ - PARAMETERS, - /** - * Demographics and other administrative information about an individual or animal receiving care or other health-related services. - */ - PATIENT, - /** - * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. - */ - PAYMENTNOTICE, - /** - * This resource provides payment details and claim references supporting a bulk payment. - */ - PAYMENTRECONCILIATION, - /** - * Demographics and administrative information about a person independent of a specific health-related context. - */ - PERSON, - /** - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ - PRACTITIONER, - /** - * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. - */ - PRACTITIONERROLE, - /** - * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. - */ - PROCEDURE, - /** - * A request for a procedure to be performed. May be a proposal or an order. - */ - PROCEDUREREQUEST, - /** - * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. - */ - PROCESSREQUEST, - /** - * This resource provides processing status, errors and notes from the processing of a resource. - */ - PROCESSRESPONSE, - /** - * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. - */ - PROTOCOL, - /** - * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. - */ - PROVENANCE, - /** - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ - QUESTIONNAIRE, - /** - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ - QUESTIONNAIRERESPONSE, - /** - * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. - */ - REFERRALREQUEST, - /** - * 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. - */ - RELATEDPERSON, - /** - * This is the base resource type for everything. - */ - RESOURCE, - /** - * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ - RISKASSESSMENT, - /** - * A container for slot(s) of time that may be available for booking appointments. - */ - SCHEDULE, - /** - * A search parameter that defines a named search item that can be used to search/filter on a resource. - */ - SEARCHPARAMETER, - /** - * Variation and Sequence data. - */ - SEQUENCE, - /** - * A slot of time on a schedule that may be available for booking appointments. - */ - SLOT, - /** - * A sample to be used for analysis. - */ - SPECIMEN, - /** - * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. - */ - STRUCTUREDEFINITION, - /** - * A Map of relationships between 2 structures that can be used to transform data. - */ - STRUCTUREMAP, - /** - * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. - */ - SUBSCRIPTION, - /** - * A homogeneous material with a definite composition. - */ - SUBSTANCE, - /** - * Record of delivery of what is supplied. - */ - SUPPLYDELIVERY, - /** - * A record of a request for a medication, substance or device used in the healthcare setting. - */ - SUPPLYREQUEST, - /** - * A task to be performed. - */ - TASK, - /** - * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. - */ - TESTSCRIPT, - /** - * A value set specifies a set of codes drawn from one or more code systems. - */ - VALUESET, - /** - * An authorization for the supply of glasses and/or contact lenses to a patient. - */ - VISIONPRESCRIPTION, - /** - * A place holder that means any kind of data type - */ - TYPE, - /** - * A place holder that means any kind of resource - */ - ANY, - /** - * added to help the parsers - */ - NULL; - public static FHIRAllTypes fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return ACTIONDEFINITION; - if ("Address".equals(codeString)) - return ADDRESS; - if ("Age".equals(codeString)) - return AGE; - if ("Annotation".equals(codeString)) - return ANNOTATION; - if ("Attachment".equals(codeString)) - return ATTACHMENT; - if ("BackboneElement".equals(codeString)) - return BACKBONEELEMENT; - if ("CodeableConcept".equals(codeString)) - return CODEABLECONCEPT; - if ("Coding".equals(codeString)) - return CODING; - if ("ContactPoint".equals(codeString)) - return CONTACTPOINT; - if ("Count".equals(codeString)) - return COUNT; - if ("DataRequirement".equals(codeString)) - return DATAREQUIREMENT; - if ("Distance".equals(codeString)) - return DISTANCE; - if ("Duration".equals(codeString)) - return DURATION; - if ("Element".equals(codeString)) - return ELEMENT; - if ("ElementDefinition".equals(codeString)) - return ELEMENTDEFINITION; - if ("Extension".equals(codeString)) - return EXTENSION; - if ("HumanName".equals(codeString)) - return HUMANNAME; - if ("Identifier".equals(codeString)) - return IDENTIFIER; - if ("Meta".equals(codeString)) - return META; - if ("ModuleMetadata".equals(codeString)) - return MODULEMETADATA; - if ("Money".equals(codeString)) - return MONEY; - if ("Narrative".equals(codeString)) - return NARRATIVE; - if ("ParameterDefinition".equals(codeString)) - return PARAMETERDEFINITION; - if ("Period".equals(codeString)) - return PERIOD; - if ("Quantity".equals(codeString)) - return QUANTITY; - if ("Range".equals(codeString)) - return RANGE; - if ("Ratio".equals(codeString)) - return RATIO; - if ("Reference".equals(codeString)) - return REFERENCE; - if ("SampledData".equals(codeString)) - return SAMPLEDDATA; - if ("Signature".equals(codeString)) - return SIGNATURE; - if ("SimpleQuantity".equals(codeString)) - return SIMPLEQUANTITY; - if ("Timing".equals(codeString)) - return TIMING; - if ("TriggerDefinition".equals(codeString)) - return TRIGGERDEFINITION; - if ("base64Binary".equals(codeString)) - return BASE64BINARY; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("code".equals(codeString)) - return CODE; - if ("date".equals(codeString)) - return DATE; - if ("dateTime".equals(codeString)) - return DATETIME; - if ("decimal".equals(codeString)) - return DECIMAL; - if ("id".equals(codeString)) - return ID; - if ("instant".equals(codeString)) - return INSTANT; - if ("integer".equals(codeString)) - return INTEGER; - if ("markdown".equals(codeString)) - return MARKDOWN; - if ("oid".equals(codeString)) - return OID; - if ("positiveInt".equals(codeString)) - return POSITIVEINT; - if ("string".equals(codeString)) - return STRING; - if ("time".equals(codeString)) - return TIME; - if ("unsignedInt".equals(codeString)) - return UNSIGNEDINT; - if ("uri".equals(codeString)) - return URI; - if ("uuid".equals(codeString)) - return UUID; - if ("xhtml".equals(codeString)) - return XHTML; - if ("Account".equals(codeString)) - return ACCOUNT; - if ("AllergyIntolerance".equals(codeString)) - return ALLERGYINTOLERANCE; - if ("Appointment".equals(codeString)) - return APPOINTMENT; - if ("AppointmentResponse".equals(codeString)) - return APPOINTMENTRESPONSE; - if ("AuditEvent".equals(codeString)) - return AUDITEVENT; - if ("Basic".equals(codeString)) - return BASIC; - if ("Binary".equals(codeString)) - return BINARY; - if ("BodySite".equals(codeString)) - return BODYSITE; - if ("Bundle".equals(codeString)) - return BUNDLE; - if ("CarePlan".equals(codeString)) - return CAREPLAN; - if ("CareTeam".equals(codeString)) - return CARETEAM; - if ("Claim".equals(codeString)) - return CLAIM; - if ("ClaimResponse".equals(codeString)) - return CLAIMRESPONSE; - if ("ClinicalImpression".equals(codeString)) - return CLINICALIMPRESSION; - if ("CodeSystem".equals(codeString)) - return CODESYSTEM; - if ("Communication".equals(codeString)) - return COMMUNICATION; - if ("CommunicationRequest".equals(codeString)) - return COMMUNICATIONREQUEST; - if ("CompartmentDefinition".equals(codeString)) - return COMPARTMENTDEFINITION; - if ("Composition".equals(codeString)) - return COMPOSITION; - if ("ConceptMap".equals(codeString)) - return CONCEPTMAP; - if ("Condition".equals(codeString)) - return CONDITION; - if ("Conformance".equals(codeString)) - return CONFORMANCE; - if ("Contract".equals(codeString)) - return CONTRACT; - if ("Coverage".equals(codeString)) - return COVERAGE; - if ("DataElement".equals(codeString)) - return DATAELEMENT; - if ("DecisionSupportRule".equals(codeString)) - return DECISIONSUPPORTRULE; - if ("DecisionSupportServiceModule".equals(codeString)) - return DECISIONSUPPORTSERVICEMODULE; - if ("DetectedIssue".equals(codeString)) - return DETECTEDISSUE; - if ("Device".equals(codeString)) - return DEVICE; - if ("DeviceComponent".equals(codeString)) - return DEVICECOMPONENT; - if ("DeviceMetric".equals(codeString)) - return DEVICEMETRIC; - if ("DeviceUseRequest".equals(codeString)) - return DEVICEUSEREQUEST; - if ("DeviceUseStatement".equals(codeString)) - return DEVICEUSESTATEMENT; - if ("DiagnosticOrder".equals(codeString)) - return DIAGNOSTICORDER; - if ("DiagnosticReport".equals(codeString)) - return DIAGNOSTICREPORT; - if ("DocumentManifest".equals(codeString)) - return DOCUMENTMANIFEST; - if ("DocumentReference".equals(codeString)) - return DOCUMENTREFERENCE; - if ("DomainResource".equals(codeString)) - return DOMAINRESOURCE; - if ("EligibilityRequest".equals(codeString)) - return ELIGIBILITYREQUEST; - if ("EligibilityResponse".equals(codeString)) - return ELIGIBILITYRESPONSE; - if ("Encounter".equals(codeString)) - return ENCOUNTER; - if ("EnrollmentRequest".equals(codeString)) - return ENROLLMENTREQUEST; - if ("EnrollmentResponse".equals(codeString)) - return ENROLLMENTRESPONSE; - if ("EpisodeOfCare".equals(codeString)) - return EPISODEOFCARE; - if ("ExpansionProfile".equals(codeString)) - return EXPANSIONPROFILE; - if ("ExplanationOfBenefit".equals(codeString)) - return EXPLANATIONOFBENEFIT; - if ("FamilyMemberHistory".equals(codeString)) - return FAMILYMEMBERHISTORY; - if ("Flag".equals(codeString)) - return FLAG; - if ("Goal".equals(codeString)) - return GOAL; - if ("Group".equals(codeString)) - return GROUP; - if ("GuidanceResponse".equals(codeString)) - return GUIDANCERESPONSE; - if ("HealthcareService".equals(codeString)) - return HEALTHCARESERVICE; - if ("ImagingExcerpt".equals(codeString)) - return IMAGINGEXCERPT; - if ("ImagingObjectSelection".equals(codeString)) - return IMAGINGOBJECTSELECTION; - if ("ImagingStudy".equals(codeString)) - return IMAGINGSTUDY; - if ("Immunization".equals(codeString)) - return IMMUNIZATION; - if ("ImmunizationRecommendation".equals(codeString)) - return IMMUNIZATIONRECOMMENDATION; - if ("ImplementationGuide".equals(codeString)) - return IMPLEMENTATIONGUIDE; - if ("Library".equals(codeString)) - return LIBRARY; - if ("Linkage".equals(codeString)) - return LINKAGE; - if ("List".equals(codeString)) - return LIST; - if ("Location".equals(codeString)) - return LOCATION; - if ("Measure".equals(codeString)) - return MEASURE; - if ("MeasureReport".equals(codeString)) - return MEASUREREPORT; - if ("Media".equals(codeString)) - return MEDIA; - if ("Medication".equals(codeString)) - return MEDICATION; - if ("MedicationAdministration".equals(codeString)) - return MEDICATIONADMINISTRATION; - if ("MedicationDispense".equals(codeString)) - return MEDICATIONDISPENSE; - if ("MedicationOrder".equals(codeString)) - return MEDICATIONORDER; - if ("MedicationStatement".equals(codeString)) - return MEDICATIONSTATEMENT; - if ("MessageHeader".equals(codeString)) - return MESSAGEHEADER; - if ("ModuleDefinition".equals(codeString)) - return MODULEDEFINITION; - if ("NamingSystem".equals(codeString)) - return NAMINGSYSTEM; - if ("NutritionOrder".equals(codeString)) - return NUTRITIONORDER; - if ("Observation".equals(codeString)) - return OBSERVATION; - if ("OperationDefinition".equals(codeString)) - return OPERATIONDEFINITION; - if ("OperationOutcome".equals(codeString)) - return OPERATIONOUTCOME; - if ("Order".equals(codeString)) - return ORDER; - if ("OrderResponse".equals(codeString)) - return ORDERRESPONSE; - if ("OrderSet".equals(codeString)) - return ORDERSET; - if ("Organization".equals(codeString)) - return ORGANIZATION; - if ("Parameters".equals(codeString)) - return PARAMETERS; - if ("Patient".equals(codeString)) - return PATIENT; - if ("PaymentNotice".equals(codeString)) - return PAYMENTNOTICE; - if ("PaymentReconciliation".equals(codeString)) - return PAYMENTRECONCILIATION; - if ("Person".equals(codeString)) - return PERSON; - if ("Practitioner".equals(codeString)) - return PRACTITIONER; - if ("PractitionerRole".equals(codeString)) - return PRACTITIONERROLE; - if ("Procedure".equals(codeString)) - return PROCEDURE; - if ("ProcedureRequest".equals(codeString)) - return PROCEDUREREQUEST; - if ("ProcessRequest".equals(codeString)) - return PROCESSREQUEST; - if ("ProcessResponse".equals(codeString)) - return PROCESSRESPONSE; - if ("Protocol".equals(codeString)) - return PROTOCOL; - if ("Provenance".equals(codeString)) - return PROVENANCE; - if ("Questionnaire".equals(codeString)) - return QUESTIONNAIRE; - if ("QuestionnaireResponse".equals(codeString)) - return QUESTIONNAIRERESPONSE; - if ("ReferralRequest".equals(codeString)) - return REFERRALREQUEST; - if ("RelatedPerson".equals(codeString)) - return RELATEDPERSON; - if ("Resource".equals(codeString)) - return RESOURCE; - if ("RiskAssessment".equals(codeString)) - return RISKASSESSMENT; - if ("Schedule".equals(codeString)) - return SCHEDULE; - if ("SearchParameter".equals(codeString)) - return SEARCHPARAMETER; - if ("Sequence".equals(codeString)) - return SEQUENCE; - if ("Slot".equals(codeString)) - return SLOT; - if ("Specimen".equals(codeString)) - return SPECIMEN; - if ("StructureDefinition".equals(codeString)) - return STRUCTUREDEFINITION; - if ("StructureMap".equals(codeString)) - return STRUCTUREMAP; - if ("Subscription".equals(codeString)) - return SUBSCRIPTION; - if ("Substance".equals(codeString)) - return SUBSTANCE; - if ("SupplyDelivery".equals(codeString)) - return SUPPLYDELIVERY; - if ("SupplyRequest".equals(codeString)) - return SUPPLYREQUEST; - if ("Task".equals(codeString)) - return TASK; - if ("TestScript".equals(codeString)) - return TESTSCRIPT; - if ("ValueSet".equals(codeString)) - return VALUESET; - if ("VisionPrescription".equals(codeString)) - return VISIONPRESCRIPTION; - if ("Type".equals(codeString)) - return TYPE; - if ("Any".equals(codeString)) - return ANY; - throw new FHIRException("Unknown FHIRAllTypes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIONDEFINITION: return "ActionDefinition"; - case ADDRESS: return "Address"; - case AGE: return "Age"; - case ANNOTATION: return "Annotation"; - case ATTACHMENT: return "Attachment"; - case BACKBONEELEMENT: return "BackboneElement"; - case CODEABLECONCEPT: return "CodeableConcept"; - case CODING: return "Coding"; - case CONTACTPOINT: return "ContactPoint"; - case COUNT: return "Count"; - case DATAREQUIREMENT: return "DataRequirement"; - case DISTANCE: return "Distance"; - case DURATION: return "Duration"; - case ELEMENT: return "Element"; - case ELEMENTDEFINITION: return "ElementDefinition"; - case EXTENSION: return "Extension"; - case HUMANNAME: return "HumanName"; - case IDENTIFIER: return "Identifier"; - case META: return "Meta"; - case MODULEMETADATA: return "ModuleMetadata"; - case MONEY: return "Money"; - case NARRATIVE: return "Narrative"; - case PARAMETERDEFINITION: return "ParameterDefinition"; - case PERIOD: return "Period"; - case QUANTITY: return "Quantity"; - case RANGE: return "Range"; - case RATIO: return "Ratio"; - case REFERENCE: return "Reference"; - case SAMPLEDDATA: return "SampledData"; - case SIGNATURE: return "Signature"; - case SIMPLEQUANTITY: return "SimpleQuantity"; - case TIMING: return "Timing"; - case TRIGGERDEFINITION: return "TriggerDefinition"; - case BASE64BINARY: return "base64Binary"; - case BOOLEAN: return "boolean"; - case CODE: return "code"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case DECIMAL: return "decimal"; - case ID: return "id"; - case INSTANT: return "instant"; - case INTEGER: return "integer"; - case MARKDOWN: return "markdown"; - case OID: return "oid"; - case POSITIVEINT: return "positiveInt"; - case STRING: return "string"; - case TIME: return "time"; - case UNSIGNEDINT: return "unsignedInt"; - case URI: return "uri"; - case UUID: return "uuid"; - case XHTML: return "xhtml"; - case ACCOUNT: return "Account"; - case ALLERGYINTOLERANCE: return "AllergyIntolerance"; - case APPOINTMENT: return "Appointment"; - case APPOINTMENTRESPONSE: return "AppointmentResponse"; - case AUDITEVENT: return "AuditEvent"; - case BASIC: return "Basic"; - case BINARY: return "Binary"; - case BODYSITE: return "BodySite"; - case BUNDLE: return "Bundle"; - case CAREPLAN: return "CarePlan"; - case CARETEAM: return "CareTeam"; - case CLAIM: return "Claim"; - case CLAIMRESPONSE: return "ClaimResponse"; - case CLINICALIMPRESSION: return "ClinicalImpression"; - case CODESYSTEM: return "CodeSystem"; - case COMMUNICATION: return "Communication"; - case COMMUNICATIONREQUEST: return "CommunicationRequest"; - case COMPARTMENTDEFINITION: return "CompartmentDefinition"; - case COMPOSITION: return "Composition"; - case CONCEPTMAP: return "ConceptMap"; - case CONDITION: return "Condition"; - case CONFORMANCE: return "Conformance"; - case CONTRACT: return "Contract"; - case COVERAGE: return "Coverage"; - case DATAELEMENT: return "DataElement"; - case DECISIONSUPPORTRULE: return "DecisionSupportRule"; - case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; - case DETECTEDISSUE: return "DetectedIssue"; - case DEVICE: return "Device"; - case DEVICECOMPONENT: return "DeviceComponent"; - case DEVICEMETRIC: return "DeviceMetric"; - case DEVICEUSEREQUEST: return "DeviceUseRequest"; - case DEVICEUSESTATEMENT: return "DeviceUseStatement"; - case DIAGNOSTICORDER: return "DiagnosticOrder"; - case DIAGNOSTICREPORT: return "DiagnosticReport"; - case DOCUMENTMANIFEST: return "DocumentManifest"; - case DOCUMENTREFERENCE: return "DocumentReference"; - case DOMAINRESOURCE: return "DomainResource"; - case ELIGIBILITYREQUEST: return "EligibilityRequest"; - case ELIGIBILITYRESPONSE: return "EligibilityResponse"; - case ENCOUNTER: return "Encounter"; - case ENROLLMENTREQUEST: return "EnrollmentRequest"; - case ENROLLMENTRESPONSE: return "EnrollmentResponse"; - case EPISODEOFCARE: return "EpisodeOfCare"; - case EXPANSIONPROFILE: return "ExpansionProfile"; - case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; - case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; - case FLAG: return "Flag"; - case GOAL: return "Goal"; - case GROUP: return "Group"; - case GUIDANCERESPONSE: return "GuidanceResponse"; - case HEALTHCARESERVICE: return "HealthcareService"; - case IMAGINGEXCERPT: return "ImagingExcerpt"; - case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; - case IMAGINGSTUDY: return "ImagingStudy"; - case IMMUNIZATION: return "Immunization"; - case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; - case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; - case LIBRARY: return "Library"; - case LINKAGE: return "Linkage"; - case LIST: return "List"; - case LOCATION: return "Location"; - case MEASURE: return "Measure"; - case MEASUREREPORT: return "MeasureReport"; - case MEDIA: return "Media"; - case MEDICATION: return "Medication"; - case MEDICATIONADMINISTRATION: return "MedicationAdministration"; - case MEDICATIONDISPENSE: return "MedicationDispense"; - case MEDICATIONORDER: return "MedicationOrder"; - case MEDICATIONSTATEMENT: return "MedicationStatement"; - case MESSAGEHEADER: return "MessageHeader"; - case MODULEDEFINITION: return "ModuleDefinition"; - case NAMINGSYSTEM: return "NamingSystem"; - case NUTRITIONORDER: return "NutritionOrder"; - case OBSERVATION: return "Observation"; - case OPERATIONDEFINITION: return "OperationDefinition"; - case OPERATIONOUTCOME: return "OperationOutcome"; - case ORDER: return "Order"; - case ORDERRESPONSE: return "OrderResponse"; - case ORDERSET: return "OrderSet"; - case ORGANIZATION: return "Organization"; - case PARAMETERS: return "Parameters"; - case PATIENT: return "Patient"; - case PAYMENTNOTICE: return "PaymentNotice"; - case PAYMENTRECONCILIATION: return "PaymentReconciliation"; - case PERSON: return "Person"; - case PRACTITIONER: return "Practitioner"; - case PRACTITIONERROLE: return "PractitionerRole"; - case PROCEDURE: return "Procedure"; - case PROCEDUREREQUEST: return "ProcedureRequest"; - case PROCESSREQUEST: return "ProcessRequest"; - case PROCESSRESPONSE: return "ProcessResponse"; - case PROTOCOL: return "Protocol"; - case PROVENANCE: return "Provenance"; - case QUESTIONNAIRE: return "Questionnaire"; - case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; - case REFERRALREQUEST: return "ReferralRequest"; - case RELATEDPERSON: return "RelatedPerson"; - case RESOURCE: return "Resource"; - case RISKASSESSMENT: return "RiskAssessment"; - case SCHEDULE: return "Schedule"; - case SEARCHPARAMETER: return "SearchParameter"; - case SEQUENCE: return "Sequence"; - case SLOT: return "Slot"; - case SPECIMEN: return "Specimen"; - case STRUCTUREDEFINITION: return "StructureDefinition"; - case STRUCTUREMAP: return "StructureMap"; - case SUBSCRIPTION: return "Subscription"; - case SUBSTANCE: return "Substance"; - case SUPPLYDELIVERY: return "SupplyDelivery"; - case SUPPLYREQUEST: return "SupplyRequest"; - case TASK: return "Task"; - case TESTSCRIPT: return "TestScript"; - case VALUESET: return "ValueSet"; - case VISIONPRESCRIPTION: return "VisionPrescription"; - case TYPE: return "Type"; - case ANY: return "Any"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIONDEFINITION: return "http://hl7.org/fhir/data-types"; - case ADDRESS: return "http://hl7.org/fhir/data-types"; - case AGE: return "http://hl7.org/fhir/data-types"; - case ANNOTATION: return "http://hl7.org/fhir/data-types"; - case ATTACHMENT: return "http://hl7.org/fhir/data-types"; - case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types"; - case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types"; - case CODING: return "http://hl7.org/fhir/data-types"; - case CONTACTPOINT: return "http://hl7.org/fhir/data-types"; - case COUNT: return "http://hl7.org/fhir/data-types"; - case DATAREQUIREMENT: return "http://hl7.org/fhir/data-types"; - case DISTANCE: return "http://hl7.org/fhir/data-types"; - case DURATION: return "http://hl7.org/fhir/data-types"; - case ELEMENT: return "http://hl7.org/fhir/data-types"; - case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types"; - case EXTENSION: return "http://hl7.org/fhir/data-types"; - case HUMANNAME: return "http://hl7.org/fhir/data-types"; - case IDENTIFIER: return "http://hl7.org/fhir/data-types"; - case META: return "http://hl7.org/fhir/data-types"; - case MODULEMETADATA: return "http://hl7.org/fhir/data-types"; - case MONEY: return "http://hl7.org/fhir/data-types"; - case NARRATIVE: return "http://hl7.org/fhir/data-types"; - case PARAMETERDEFINITION: return "http://hl7.org/fhir/data-types"; - case PERIOD: return "http://hl7.org/fhir/data-types"; - case QUANTITY: return "http://hl7.org/fhir/data-types"; - case RANGE: return "http://hl7.org/fhir/data-types"; - case RATIO: return "http://hl7.org/fhir/data-types"; - case REFERENCE: return "http://hl7.org/fhir/data-types"; - case SAMPLEDDATA: return "http://hl7.org/fhir/data-types"; - case SIGNATURE: return "http://hl7.org/fhir/data-types"; - case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types"; - case TIMING: return "http://hl7.org/fhir/data-types"; - case TRIGGERDEFINITION: return "http://hl7.org/fhir/data-types"; - case BASE64BINARY: return "http://hl7.org/fhir/data-types"; - case BOOLEAN: return "http://hl7.org/fhir/data-types"; - case CODE: return "http://hl7.org/fhir/data-types"; - case DATE: return "http://hl7.org/fhir/data-types"; - case DATETIME: return "http://hl7.org/fhir/data-types"; - case DECIMAL: return "http://hl7.org/fhir/data-types"; - case ID: return "http://hl7.org/fhir/data-types"; - case INSTANT: return "http://hl7.org/fhir/data-types"; - case INTEGER: return "http://hl7.org/fhir/data-types"; - case MARKDOWN: return "http://hl7.org/fhir/data-types"; - case OID: return "http://hl7.org/fhir/data-types"; - case POSITIVEINT: return "http://hl7.org/fhir/data-types"; - case STRING: return "http://hl7.org/fhir/data-types"; - case TIME: return "http://hl7.org/fhir/data-types"; - case UNSIGNEDINT: return "http://hl7.org/fhir/data-types"; - case URI: return "http://hl7.org/fhir/data-types"; - case UUID: return "http://hl7.org/fhir/data-types"; - case XHTML: return "http://hl7.org/fhir/data-types"; - case ACCOUNT: return "http://hl7.org/fhir/resource-types"; - case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types"; - case APPOINTMENT: return "http://hl7.org/fhir/resource-types"; - case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; - case AUDITEVENT: return "http://hl7.org/fhir/resource-types"; - case BASIC: return "http://hl7.org/fhir/resource-types"; - case BINARY: return "http://hl7.org/fhir/resource-types"; - case BODYSITE: return "http://hl7.org/fhir/resource-types"; - case BUNDLE: return "http://hl7.org/fhir/resource-types"; - case CAREPLAN: return "http://hl7.org/fhir/resource-types"; - case CARETEAM: return "http://hl7.org/fhir/resource-types"; - case CLAIM: return "http://hl7.org/fhir/resource-types"; - case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types"; - case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types"; - case CODESYSTEM: return "http://hl7.org/fhir/resource-types"; - case COMMUNICATION: return "http://hl7.org/fhir/resource-types"; - case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; - case COMPARTMENTDEFINITION: return "http://hl7.org/fhir/resource-types"; - case COMPOSITION: return "http://hl7.org/fhir/resource-types"; - case CONCEPTMAP: return "http://hl7.org/fhir/resource-types"; - case CONDITION: return "http://hl7.org/fhir/resource-types"; - case CONFORMANCE: return "http://hl7.org/fhir/resource-types"; - case CONTRACT: return "http://hl7.org/fhir/resource-types"; - case COVERAGE: return "http://hl7.org/fhir/resource-types"; - case DATAELEMENT: return "http://hl7.org/fhir/resource-types"; - case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/resource-types"; - case DECISIONSUPPORTSERVICEMODULE: return "http://hl7.org/fhir/resource-types"; - case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types"; - case DEVICE: return "http://hl7.org/fhir/resource-types"; - case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types"; - case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types"; - case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types"; - case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types"; - case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types"; - case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types"; - case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types"; - case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types"; - case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types"; - case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types"; - case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types"; - case ENCOUNTER: return "http://hl7.org/fhir/resource-types"; - case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types"; - case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; - case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types"; - case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types"; - case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types"; - case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types"; - case FLAG: return "http://hl7.org/fhir/resource-types"; - case GOAL: return "http://hl7.org/fhir/resource-types"; - case GROUP: return "http://hl7.org/fhir/resource-types"; - case GUIDANCERESPONSE: return "http://hl7.org/fhir/resource-types"; - case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types"; - case IMAGINGEXCERPT: return "http://hl7.org/fhir/resource-types"; - case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types"; - case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types"; - case IMMUNIZATION: return "http://hl7.org/fhir/resource-types"; - case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types"; - case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types"; - case LIBRARY: return "http://hl7.org/fhir/resource-types"; - case LINKAGE: return "http://hl7.org/fhir/resource-types"; - case LIST: return "http://hl7.org/fhir/resource-types"; - case LOCATION: return "http://hl7.org/fhir/resource-types"; - case MEASURE: return "http://hl7.org/fhir/resource-types"; - case MEASUREREPORT: return "http://hl7.org/fhir/resource-types"; - case MEDIA: return "http://hl7.org/fhir/resource-types"; - case MEDICATION: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; - case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; - case MODULEDEFINITION: return "http://hl7.org/fhir/resource-types"; - case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; - case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types"; - case OBSERVATION: return "http://hl7.org/fhir/resource-types"; - case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types"; - case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types"; - case ORDER: return "http://hl7.org/fhir/resource-types"; - case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types"; - case ORDERSET: return "http://hl7.org/fhir/resource-types"; - case ORGANIZATION: return "http://hl7.org/fhir/resource-types"; - case PARAMETERS: return "http://hl7.org/fhir/resource-types"; - case PATIENT: return "http://hl7.org/fhir/resource-types"; - case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types"; - case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types"; - case PERSON: return "http://hl7.org/fhir/resource-types"; - case PRACTITIONER: return "http://hl7.org/fhir/resource-types"; - case PRACTITIONERROLE: return "http://hl7.org/fhir/resource-types"; - case PROCEDURE: return "http://hl7.org/fhir/resource-types"; - case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types"; - case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types"; - case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types"; - case PROTOCOL: return "http://hl7.org/fhir/resource-types"; - case PROVENANCE: return "http://hl7.org/fhir/resource-types"; - case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types"; - case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types"; - case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; - case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; - case RESOURCE: return "http://hl7.org/fhir/resource-types"; - case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; - case SCHEDULE: return "http://hl7.org/fhir/resource-types"; - case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types"; - case SEQUENCE: return "http://hl7.org/fhir/resource-types"; - case SLOT: return "http://hl7.org/fhir/resource-types"; - case SPECIMEN: return "http://hl7.org/fhir/resource-types"; - case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types"; - case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types"; - case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types"; - case SUBSTANCE: return "http://hl7.org/fhir/resource-types"; - case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types"; - case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types"; - case TASK: return "http://hl7.org/fhir/resource-types"; - case TESTSCRIPT: return "http://hl7.org/fhir/resource-types"; - case VALUESET: return "http://hl7.org/fhir/resource-types"; - case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types"; - case TYPE: return "http://hl7.org/fhir/abstract-types"; - case ANY: return "http://hl7.org/fhir/abstract-types"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIONDEFINITION: return "The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library."; - case ADDRESS: return "An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world."; - case AGE: return ""; - case ANNOTATION: return "A text note which also contains information about who made the statement and when."; - case ATTACHMENT: return "For referring to data content defined in other formats."; - case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type."; - case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."; - case CODING: return "A reference to a code defined by a terminology system."; - case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."; - case COUNT: return ""; - case DATAREQUIREMENT: return "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data."; - case DISTANCE: return ""; - case DURATION: return ""; - case ELEMENT: return "Base definition for all elements in a resource."; - case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension."; - case EXTENSION: return "Optional Extensions Element - found in all resources."; - case HUMANNAME: return "A human's name with the ability to identify parts and usage."; - case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously."; - case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."; - case MODULEMETADATA: return "The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information."; - case MONEY: return ""; - case NARRATIVE: return "A human-readable formatted text, including images."; - case PARAMETERDEFINITION: return "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse."; - case PERIOD: return "A time period defined by a start and end date and optionally time."; - case QUANTITY: return "A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies."; - case RANGE: return "A set of ordered Quantities defined by a low and high limit."; - case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator."; - case REFERENCE: return "A reference from one resource to another."; - case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."; - case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities."; - case SIMPLEQUANTITY: return ""; - case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds."; - case TRIGGERDEFINITION: return "A description of a triggering event."; - case BASE64BINARY: return "A stream of bytes"; - case BOOLEAN: return "Value of \"true\" or \"false\""; - case CODE: return "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"; - case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates."; - case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates."; - case DECIMAL: return "A rational number with implicit precision"; - case ID: return "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive."; - case INSTANT: return "An instant in time - known at least to the second"; - case INTEGER: return "A whole number"; - case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine"; - case OID: return "An oid represented as a URI"; - case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)"; - case STRING: return "A sequence of Unicode characters"; - case TIME: return "A time during the day, with no date specified"; - case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)"; - case URI: return "String of characters used to identify a name or a resource"; - case UUID: return "A UUID, represented as a URI"; - case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)"; - case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc."; - case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance."; - case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s)."; - case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection."; - case AUDITEVENT: return "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."; - case BASIC: return "Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification."; - case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc."; - case BODYSITE: return "Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case."; - case BUNDLE: return "A container for a collection of resources."; - case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions."; - case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient."; - case CLAIM: return "A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery."; - case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource."; - case CLINICALIMPRESSION: return "A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion with the recording of assessment tools such as Apgar score."; - case CODESYSTEM: return "A code system resource specifies a set of codes drawn from one or more code systems."; - case COMMUNICATION: return "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition."; - case COMMUNICATIONREQUEST: return "A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition."; - case COMPARTMENTDEFINITION: return "A compartment definition that defines how resources are accessed on a server."; - case COMPOSITION: return "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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained."; - case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models."; - case CONDITION: return "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."; - case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation."; - case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters."; - case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services."; - case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported."; - case DECISIONSUPPORTRULE: return "This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events."; - case DECISIONSUPPORTSERVICEMODULE: return "The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking."; - case DETECTEDISSUE: return "Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc."; - case DEVICE: return "This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc."; - case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device."; - case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device."; - case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker."; - case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician."; - case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed."; - case DIAGNOSTICREPORT: return "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 interpretations, and formatted representation of diagnostic reports."; - case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; - case DOCUMENTREFERENCE: return "A reference to a document ."; - case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; - case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; - case ENCOUNTER: return "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."; - case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage."; - case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource."; - case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time."; - case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet."; - case EXPLANATIONOFBENEFIT: return "This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided."; - case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient."; - case FLAG: return "Prospective warnings of potential issues when providing care to the patient."; - case GOAL: return "Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc."; - case GROUP: return "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."; - case GUIDANCERESPONSE: return "A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken."; - case HEALTHCARESERVICE: return "The details of a healthcare service available at a location."; - case IMAGINGEXCERPT: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; - case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; - case IMAGINGSTUDY: return "Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities."; - case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed."; - case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification."; - case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts."; - case LIBRARY: return "The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library."; - case LINKAGE: return "Identifies two or more records (resource instances) that are referring to the same real-world \"occurrence\"."; - case LIST: return "A set of information summarized from a list of other resources."; - case LOCATION: return "Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated."; - case MEASURE: return "The Measure resource provides the definition of a quality measure."; - case MEASUREREPORT: return "The MeasureReport resource contains the results of evaluating a measure."; - case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."; - case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication."; - case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered 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."; - case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; - case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc."; - case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; - case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(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."; - case MODULEDEFINITION: return "The ModuleDefinition resource defines the data requirements for a quality artifact."; - case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; - case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; - case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject."; - case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction)."; - case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action."; - case ORDER: return "A request to perform an action."; - case ORDERRESPONSE: return "A response to an order."; - case ORDERSET: return "This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support."; - case ORGANIZATION: return "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."; - case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it."; - case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services."; - case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references."; - case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment."; - case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context."; - case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare."; - case PRACTITIONERROLE: return "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time."; - case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy."; - case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order."; - case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources."; - case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource."; - case PROTOCOL: return "A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points."; - case PROVENANCE: return "Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies."; - case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; - case QUESTIONNAIRERESPONSE: return "A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; - case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; - case RELATEDPERSON: return "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."; - case RESOURCE: return "This is the base resource type for everything."; - case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; - case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; - case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource."; - case SEQUENCE: return "Variation and Sequence data."; - case SLOT: return "A slot of time on a schedule that may be available for booking appointments."; - case SPECIMEN: return "A sample to be used for analysis."; - case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types."; - case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data."; - case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action."; - case SUBSTANCE: return "A homogeneous material with a definite composition."; - case SUPPLYDELIVERY: return "Record of delivery of what is supplied."; - case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting."; - case TASK: return "A task to be performed."; - case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification."; - case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems."; - case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient."; - case TYPE: return "A place holder that means any kind of data type"; - case ANY: return "A place holder that means any kind of resource"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIONDEFINITION: return "ActionDefinition"; - case ADDRESS: return "Address"; - case AGE: return "Age"; - case ANNOTATION: return "Annotation"; - case ATTACHMENT: return "Attachment"; - case BACKBONEELEMENT: return "BackboneElement"; - case CODEABLECONCEPT: return "CodeableConcept"; - case CODING: return "Coding"; - case CONTACTPOINT: return "ContactPoint"; - case COUNT: return "Count"; - case DATAREQUIREMENT: return "DataRequirement"; - case DISTANCE: return "Distance"; - case DURATION: return "Duration"; - case ELEMENT: return "Element"; - case ELEMENTDEFINITION: return "ElementDefinition"; - case EXTENSION: return "Extension"; - case HUMANNAME: return "HumanName"; - case IDENTIFIER: return "Identifier"; - case META: return "Meta"; - case MODULEMETADATA: return "ModuleMetadata"; - case MONEY: return "Money"; - case NARRATIVE: return "Narrative"; - case PARAMETERDEFINITION: return "ParameterDefinition"; - case PERIOD: return "Period"; - case QUANTITY: return "Quantity"; - case RANGE: return "Range"; - case RATIO: return "Ratio"; - case REFERENCE: return "Reference"; - case SAMPLEDDATA: return "SampledData"; - case SIGNATURE: return "Signature"; - case SIMPLEQUANTITY: return "SimpleQuantity"; - case TIMING: return "Timing"; - case TRIGGERDEFINITION: return "TriggerDefinition"; - case BASE64BINARY: return "base64Binary"; - case BOOLEAN: return "boolean"; - case CODE: return "code"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case DECIMAL: return "decimal"; - case ID: return "id"; - case INSTANT: return "instant"; - case INTEGER: return "integer"; - case MARKDOWN: return "markdown"; - case OID: return "oid"; - case POSITIVEINT: return "positiveInt"; - case STRING: return "string"; - case TIME: return "time"; - case UNSIGNEDINT: return "unsignedInt"; - case URI: return "uri"; - case UUID: return "uuid"; - case XHTML: return "XHTML"; - case ACCOUNT: return "Account"; - case ALLERGYINTOLERANCE: return "AllergyIntolerance"; - case APPOINTMENT: return "Appointment"; - case APPOINTMENTRESPONSE: return "AppointmentResponse"; - case AUDITEVENT: return "AuditEvent"; - case BASIC: return "Basic"; - case BINARY: return "Binary"; - case BODYSITE: return "BodySite"; - case BUNDLE: return "Bundle"; - case CAREPLAN: return "CarePlan"; - case CARETEAM: return "CareTeam"; - case CLAIM: return "Claim"; - case CLAIMRESPONSE: return "ClaimResponse"; - case CLINICALIMPRESSION: return "ClinicalImpression"; - case CODESYSTEM: return "CodeSystem"; - case COMMUNICATION: return "Communication"; - case COMMUNICATIONREQUEST: return "CommunicationRequest"; - case COMPARTMENTDEFINITION: return "CompartmentDefinition"; - case COMPOSITION: return "Composition"; - case CONCEPTMAP: return "ConceptMap"; - case CONDITION: return "Condition"; - case CONFORMANCE: return "Conformance"; - case CONTRACT: return "Contract"; - case COVERAGE: return "Coverage"; - case DATAELEMENT: return "DataElement"; - case DECISIONSUPPORTRULE: return "DecisionSupportRule"; - case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; - case DETECTEDISSUE: return "DetectedIssue"; - case DEVICE: return "Device"; - case DEVICECOMPONENT: return "DeviceComponent"; - case DEVICEMETRIC: return "DeviceMetric"; - case DEVICEUSEREQUEST: return "DeviceUseRequest"; - case DEVICEUSESTATEMENT: return "DeviceUseStatement"; - case DIAGNOSTICORDER: return "DiagnosticOrder"; - case DIAGNOSTICREPORT: return "DiagnosticReport"; - case DOCUMENTMANIFEST: return "DocumentManifest"; - case DOCUMENTREFERENCE: return "DocumentReference"; - case DOMAINRESOURCE: return "DomainResource"; - case ELIGIBILITYREQUEST: return "EligibilityRequest"; - case ELIGIBILITYRESPONSE: return "EligibilityResponse"; - case ENCOUNTER: return "Encounter"; - case ENROLLMENTREQUEST: return "EnrollmentRequest"; - case ENROLLMENTRESPONSE: return "EnrollmentResponse"; - case EPISODEOFCARE: return "EpisodeOfCare"; - case EXPANSIONPROFILE: return "ExpansionProfile"; - case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; - case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; - case FLAG: return "Flag"; - case GOAL: return "Goal"; - case GROUP: return "Group"; - case GUIDANCERESPONSE: return "GuidanceResponse"; - case HEALTHCARESERVICE: return "HealthcareService"; - case IMAGINGEXCERPT: return "ImagingExcerpt"; - case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; - case IMAGINGSTUDY: return "ImagingStudy"; - case IMMUNIZATION: return "Immunization"; - case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; - case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; - case LIBRARY: return "Library"; - case LINKAGE: return "Linkage"; - case LIST: return "List"; - case LOCATION: return "Location"; - case MEASURE: return "Measure"; - case MEASUREREPORT: return "MeasureReport"; - case MEDIA: return "Media"; - case MEDICATION: return "Medication"; - case MEDICATIONADMINISTRATION: return "MedicationAdministration"; - case MEDICATIONDISPENSE: return "MedicationDispense"; - case MEDICATIONORDER: return "MedicationOrder"; - case MEDICATIONSTATEMENT: return "MedicationStatement"; - case MESSAGEHEADER: return "MessageHeader"; - case MODULEDEFINITION: return "ModuleDefinition"; - case NAMINGSYSTEM: return "NamingSystem"; - case NUTRITIONORDER: return "NutritionOrder"; - case OBSERVATION: return "Observation"; - case OPERATIONDEFINITION: return "OperationDefinition"; - case OPERATIONOUTCOME: return "OperationOutcome"; - case ORDER: return "Order"; - case ORDERRESPONSE: return "OrderResponse"; - case ORDERSET: return "OrderSet"; - case ORGANIZATION: return "Organization"; - case PARAMETERS: return "Parameters"; - case PATIENT: return "Patient"; - case PAYMENTNOTICE: return "PaymentNotice"; - case PAYMENTRECONCILIATION: return "PaymentReconciliation"; - case PERSON: return "Person"; - case PRACTITIONER: return "Practitioner"; - case PRACTITIONERROLE: return "PractitionerRole"; - case PROCEDURE: return "Procedure"; - case PROCEDUREREQUEST: return "ProcedureRequest"; - case PROCESSREQUEST: return "ProcessRequest"; - case PROCESSRESPONSE: return "ProcessResponse"; - case PROTOCOL: return "Protocol"; - case PROVENANCE: return "Provenance"; - case QUESTIONNAIRE: return "Questionnaire"; - case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; - case REFERRALREQUEST: return "ReferralRequest"; - case RELATEDPERSON: return "RelatedPerson"; - case RESOURCE: return "Resource"; - case RISKASSESSMENT: return "RiskAssessment"; - case SCHEDULE: return "Schedule"; - case SEARCHPARAMETER: return "SearchParameter"; - case SEQUENCE: return "Sequence"; - case SLOT: return "Slot"; - case SPECIMEN: return "Specimen"; - case STRUCTUREDEFINITION: return "StructureDefinition"; - case STRUCTUREMAP: return "StructureMap"; - case SUBSCRIPTION: return "Subscription"; - case SUBSTANCE: return "Substance"; - case SUPPLYDELIVERY: return "SupplyDelivery"; - case SUPPLYREQUEST: return "SupplyRequest"; - case TASK: return "Task"; - case TESTSCRIPT: return "TestScript"; - case VALUESET: return "ValueSet"; - case VISIONPRESCRIPTION: return "VisionPrescription"; - case TYPE: return "Type"; - case ANY: return "Any"; - default: return "?"; - } - } - } - - public static class FHIRAllTypesEnumFactory implements EnumFactory { - public FHIRAllTypes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return FHIRAllTypes.ACTIONDEFINITION; - if ("Address".equals(codeString)) - return FHIRAllTypes.ADDRESS; - if ("Age".equals(codeString)) - return FHIRAllTypes.AGE; - if ("Annotation".equals(codeString)) - return FHIRAllTypes.ANNOTATION; - if ("Attachment".equals(codeString)) - return FHIRAllTypes.ATTACHMENT; - if ("BackboneElement".equals(codeString)) - return FHIRAllTypes.BACKBONEELEMENT; - if ("CodeableConcept".equals(codeString)) - return FHIRAllTypes.CODEABLECONCEPT; - if ("Coding".equals(codeString)) - return FHIRAllTypes.CODING; - if ("ContactPoint".equals(codeString)) - return FHIRAllTypes.CONTACTPOINT; - if ("Count".equals(codeString)) - return FHIRAllTypes.COUNT; - if ("DataRequirement".equals(codeString)) - return FHIRAllTypes.DATAREQUIREMENT; - if ("Distance".equals(codeString)) - return FHIRAllTypes.DISTANCE; - if ("Duration".equals(codeString)) - return FHIRAllTypes.DURATION; - if ("Element".equals(codeString)) - return FHIRAllTypes.ELEMENT; - if ("ElementDefinition".equals(codeString)) - return FHIRAllTypes.ELEMENTDEFINITION; - if ("Extension".equals(codeString)) - return FHIRAllTypes.EXTENSION; - if ("HumanName".equals(codeString)) - return FHIRAllTypes.HUMANNAME; - if ("Identifier".equals(codeString)) - return FHIRAllTypes.IDENTIFIER; - if ("Meta".equals(codeString)) - return FHIRAllTypes.META; - if ("ModuleMetadata".equals(codeString)) - return FHIRAllTypes.MODULEMETADATA; - if ("Money".equals(codeString)) - return FHIRAllTypes.MONEY; - if ("Narrative".equals(codeString)) - return FHIRAllTypes.NARRATIVE; - if ("ParameterDefinition".equals(codeString)) - return FHIRAllTypes.PARAMETERDEFINITION; - if ("Period".equals(codeString)) - return FHIRAllTypes.PERIOD; - if ("Quantity".equals(codeString)) - return FHIRAllTypes.QUANTITY; - if ("Range".equals(codeString)) - return FHIRAllTypes.RANGE; - if ("Ratio".equals(codeString)) - return FHIRAllTypes.RATIO; - if ("Reference".equals(codeString)) - return FHIRAllTypes.REFERENCE; - if ("SampledData".equals(codeString)) - return FHIRAllTypes.SAMPLEDDATA; - if ("Signature".equals(codeString)) - return FHIRAllTypes.SIGNATURE; - if ("SimpleQuantity".equals(codeString)) - return FHIRAllTypes.SIMPLEQUANTITY; - if ("Timing".equals(codeString)) - return FHIRAllTypes.TIMING; - if ("TriggerDefinition".equals(codeString)) - return FHIRAllTypes.TRIGGERDEFINITION; - if ("base64Binary".equals(codeString)) - return FHIRAllTypes.BASE64BINARY; - if ("boolean".equals(codeString)) - return FHIRAllTypes.BOOLEAN; - if ("code".equals(codeString)) - return FHIRAllTypes.CODE; - if ("date".equals(codeString)) - return FHIRAllTypes.DATE; - if ("dateTime".equals(codeString)) - return FHIRAllTypes.DATETIME; - if ("decimal".equals(codeString)) - return FHIRAllTypes.DECIMAL; - if ("id".equals(codeString)) - return FHIRAllTypes.ID; - if ("instant".equals(codeString)) - return FHIRAllTypes.INSTANT; - if ("integer".equals(codeString)) - return FHIRAllTypes.INTEGER; - if ("markdown".equals(codeString)) - return FHIRAllTypes.MARKDOWN; - if ("oid".equals(codeString)) - return FHIRAllTypes.OID; - if ("positiveInt".equals(codeString)) - return FHIRAllTypes.POSITIVEINT; - if ("string".equals(codeString)) - return FHIRAllTypes.STRING; - if ("time".equals(codeString)) - return FHIRAllTypes.TIME; - if ("unsignedInt".equals(codeString)) - return FHIRAllTypes.UNSIGNEDINT; - if ("uri".equals(codeString)) - return FHIRAllTypes.URI; - if ("uuid".equals(codeString)) - return FHIRAllTypes.UUID; - if ("xhtml".equals(codeString)) - return FHIRAllTypes.XHTML; - if ("Account".equals(codeString)) - return FHIRAllTypes.ACCOUNT; - if ("AllergyIntolerance".equals(codeString)) - return FHIRAllTypes.ALLERGYINTOLERANCE; - if ("Appointment".equals(codeString)) - return FHIRAllTypes.APPOINTMENT; - if ("AppointmentResponse".equals(codeString)) - return FHIRAllTypes.APPOINTMENTRESPONSE; - if ("AuditEvent".equals(codeString)) - return FHIRAllTypes.AUDITEVENT; - if ("Basic".equals(codeString)) - return FHIRAllTypes.BASIC; - if ("Binary".equals(codeString)) - return FHIRAllTypes.BINARY; - if ("BodySite".equals(codeString)) - return FHIRAllTypes.BODYSITE; - if ("Bundle".equals(codeString)) - return FHIRAllTypes.BUNDLE; - if ("CarePlan".equals(codeString)) - return FHIRAllTypes.CAREPLAN; - if ("CareTeam".equals(codeString)) - return FHIRAllTypes.CARETEAM; - if ("Claim".equals(codeString)) - return FHIRAllTypes.CLAIM; - if ("ClaimResponse".equals(codeString)) - return FHIRAllTypes.CLAIMRESPONSE; - if ("ClinicalImpression".equals(codeString)) - return FHIRAllTypes.CLINICALIMPRESSION; - if ("CodeSystem".equals(codeString)) - return FHIRAllTypes.CODESYSTEM; - if ("Communication".equals(codeString)) - return FHIRAllTypes.COMMUNICATION; - if ("CommunicationRequest".equals(codeString)) - return FHIRAllTypes.COMMUNICATIONREQUEST; - if ("CompartmentDefinition".equals(codeString)) - return FHIRAllTypes.COMPARTMENTDEFINITION; - if ("Composition".equals(codeString)) - return FHIRAllTypes.COMPOSITION; - if ("ConceptMap".equals(codeString)) - return FHIRAllTypes.CONCEPTMAP; - if ("Condition".equals(codeString)) - return FHIRAllTypes.CONDITION; - if ("Conformance".equals(codeString)) - return FHIRAllTypes.CONFORMANCE; - if ("Contract".equals(codeString)) - return FHIRAllTypes.CONTRACT; - if ("Coverage".equals(codeString)) - return FHIRAllTypes.COVERAGE; - if ("DataElement".equals(codeString)) - return FHIRAllTypes.DATAELEMENT; - if ("DecisionSupportRule".equals(codeString)) - return FHIRAllTypes.DECISIONSUPPORTRULE; - if ("DecisionSupportServiceModule".equals(codeString)) - return FHIRAllTypes.DECISIONSUPPORTSERVICEMODULE; - if ("DetectedIssue".equals(codeString)) - return FHIRAllTypes.DETECTEDISSUE; - if ("Device".equals(codeString)) - return FHIRAllTypes.DEVICE; - if ("DeviceComponent".equals(codeString)) - return FHIRAllTypes.DEVICECOMPONENT; - if ("DeviceMetric".equals(codeString)) - return FHIRAllTypes.DEVICEMETRIC; - if ("DeviceUseRequest".equals(codeString)) - return FHIRAllTypes.DEVICEUSEREQUEST; - if ("DeviceUseStatement".equals(codeString)) - return FHIRAllTypes.DEVICEUSESTATEMENT; - if ("DiagnosticOrder".equals(codeString)) - return FHIRAllTypes.DIAGNOSTICORDER; - if ("DiagnosticReport".equals(codeString)) - return FHIRAllTypes.DIAGNOSTICREPORT; - if ("DocumentManifest".equals(codeString)) - return FHIRAllTypes.DOCUMENTMANIFEST; - if ("DocumentReference".equals(codeString)) - return FHIRAllTypes.DOCUMENTREFERENCE; - if ("DomainResource".equals(codeString)) - return FHIRAllTypes.DOMAINRESOURCE; - if ("EligibilityRequest".equals(codeString)) - return FHIRAllTypes.ELIGIBILITYREQUEST; - if ("EligibilityResponse".equals(codeString)) - return FHIRAllTypes.ELIGIBILITYRESPONSE; - if ("Encounter".equals(codeString)) - return FHIRAllTypes.ENCOUNTER; - if ("EnrollmentRequest".equals(codeString)) - return FHIRAllTypes.ENROLLMENTREQUEST; - if ("EnrollmentResponse".equals(codeString)) - return FHIRAllTypes.ENROLLMENTRESPONSE; - if ("EpisodeOfCare".equals(codeString)) - return FHIRAllTypes.EPISODEOFCARE; - if ("ExpansionProfile".equals(codeString)) - return FHIRAllTypes.EXPANSIONPROFILE; - if ("ExplanationOfBenefit".equals(codeString)) - return FHIRAllTypes.EXPLANATIONOFBENEFIT; - if ("FamilyMemberHistory".equals(codeString)) - return FHIRAllTypes.FAMILYMEMBERHISTORY; - if ("Flag".equals(codeString)) - return FHIRAllTypes.FLAG; - if ("Goal".equals(codeString)) - return FHIRAllTypes.GOAL; - if ("Group".equals(codeString)) - return FHIRAllTypes.GROUP; - if ("GuidanceResponse".equals(codeString)) - return FHIRAllTypes.GUIDANCERESPONSE; - if ("HealthcareService".equals(codeString)) - return FHIRAllTypes.HEALTHCARESERVICE; - if ("ImagingExcerpt".equals(codeString)) - return FHIRAllTypes.IMAGINGEXCERPT; - if ("ImagingObjectSelection".equals(codeString)) - return FHIRAllTypes.IMAGINGOBJECTSELECTION; - if ("ImagingStudy".equals(codeString)) - return FHIRAllTypes.IMAGINGSTUDY; - if ("Immunization".equals(codeString)) - return FHIRAllTypes.IMMUNIZATION; - if ("ImmunizationRecommendation".equals(codeString)) - return FHIRAllTypes.IMMUNIZATIONRECOMMENDATION; - if ("ImplementationGuide".equals(codeString)) - return FHIRAllTypes.IMPLEMENTATIONGUIDE; - if ("Library".equals(codeString)) - return FHIRAllTypes.LIBRARY; - if ("Linkage".equals(codeString)) - return FHIRAllTypes.LINKAGE; - if ("List".equals(codeString)) - return FHIRAllTypes.LIST; - if ("Location".equals(codeString)) - return FHIRAllTypes.LOCATION; - if ("Measure".equals(codeString)) - return FHIRAllTypes.MEASURE; - if ("MeasureReport".equals(codeString)) - return FHIRAllTypes.MEASUREREPORT; - if ("Media".equals(codeString)) - return FHIRAllTypes.MEDIA; - if ("Medication".equals(codeString)) - return FHIRAllTypes.MEDICATION; - if ("MedicationAdministration".equals(codeString)) - return FHIRAllTypes.MEDICATIONADMINISTRATION; - if ("MedicationDispense".equals(codeString)) - return FHIRAllTypes.MEDICATIONDISPENSE; - if ("MedicationOrder".equals(codeString)) - return FHIRAllTypes.MEDICATIONORDER; - if ("MedicationStatement".equals(codeString)) - return FHIRAllTypes.MEDICATIONSTATEMENT; - if ("MessageHeader".equals(codeString)) - return FHIRAllTypes.MESSAGEHEADER; - if ("ModuleDefinition".equals(codeString)) - return FHIRAllTypes.MODULEDEFINITION; - if ("NamingSystem".equals(codeString)) - return FHIRAllTypes.NAMINGSYSTEM; - if ("NutritionOrder".equals(codeString)) - return FHIRAllTypes.NUTRITIONORDER; - if ("Observation".equals(codeString)) - return FHIRAllTypes.OBSERVATION; - if ("OperationDefinition".equals(codeString)) - return FHIRAllTypes.OPERATIONDEFINITION; - if ("OperationOutcome".equals(codeString)) - return FHIRAllTypes.OPERATIONOUTCOME; - if ("Order".equals(codeString)) - return FHIRAllTypes.ORDER; - if ("OrderResponse".equals(codeString)) - return FHIRAllTypes.ORDERRESPONSE; - if ("OrderSet".equals(codeString)) - return FHIRAllTypes.ORDERSET; - if ("Organization".equals(codeString)) - return FHIRAllTypes.ORGANIZATION; - if ("Parameters".equals(codeString)) - return FHIRAllTypes.PARAMETERS; - if ("Patient".equals(codeString)) - return FHIRAllTypes.PATIENT; - if ("PaymentNotice".equals(codeString)) - return FHIRAllTypes.PAYMENTNOTICE; - if ("PaymentReconciliation".equals(codeString)) - return FHIRAllTypes.PAYMENTRECONCILIATION; - if ("Person".equals(codeString)) - return FHIRAllTypes.PERSON; - if ("Practitioner".equals(codeString)) - return FHIRAllTypes.PRACTITIONER; - if ("PractitionerRole".equals(codeString)) - return FHIRAllTypes.PRACTITIONERROLE; - if ("Procedure".equals(codeString)) - return FHIRAllTypes.PROCEDURE; - if ("ProcedureRequest".equals(codeString)) - return FHIRAllTypes.PROCEDUREREQUEST; - if ("ProcessRequest".equals(codeString)) - return FHIRAllTypes.PROCESSREQUEST; - if ("ProcessResponse".equals(codeString)) - return FHIRAllTypes.PROCESSRESPONSE; - if ("Protocol".equals(codeString)) - return FHIRAllTypes.PROTOCOL; - if ("Provenance".equals(codeString)) - return FHIRAllTypes.PROVENANCE; - if ("Questionnaire".equals(codeString)) - return FHIRAllTypes.QUESTIONNAIRE; - if ("QuestionnaireResponse".equals(codeString)) - return FHIRAllTypes.QUESTIONNAIRERESPONSE; - if ("ReferralRequest".equals(codeString)) - return FHIRAllTypes.REFERRALREQUEST; - if ("RelatedPerson".equals(codeString)) - return FHIRAllTypes.RELATEDPERSON; - if ("Resource".equals(codeString)) - return FHIRAllTypes.RESOURCE; - if ("RiskAssessment".equals(codeString)) - return FHIRAllTypes.RISKASSESSMENT; - if ("Schedule".equals(codeString)) - return FHIRAllTypes.SCHEDULE; - if ("SearchParameter".equals(codeString)) - return FHIRAllTypes.SEARCHPARAMETER; - if ("Sequence".equals(codeString)) - return FHIRAllTypes.SEQUENCE; - if ("Slot".equals(codeString)) - return FHIRAllTypes.SLOT; - if ("Specimen".equals(codeString)) - return FHIRAllTypes.SPECIMEN; - if ("StructureDefinition".equals(codeString)) - return FHIRAllTypes.STRUCTUREDEFINITION; - if ("StructureMap".equals(codeString)) - return FHIRAllTypes.STRUCTUREMAP; - if ("Subscription".equals(codeString)) - return FHIRAllTypes.SUBSCRIPTION; - if ("Substance".equals(codeString)) - return FHIRAllTypes.SUBSTANCE; - if ("SupplyDelivery".equals(codeString)) - return FHIRAllTypes.SUPPLYDELIVERY; - if ("SupplyRequest".equals(codeString)) - return FHIRAllTypes.SUPPLYREQUEST; - if ("Task".equals(codeString)) - return FHIRAllTypes.TASK; - if ("TestScript".equals(codeString)) - return FHIRAllTypes.TESTSCRIPT; - if ("ValueSet".equals(codeString)) - return FHIRAllTypes.VALUESET; - if ("VisionPrescription".equals(codeString)) - return FHIRAllTypes.VISIONPRESCRIPTION; - if ("Type".equals(codeString)) - return FHIRAllTypes.TYPE; - if ("Any".equals(codeString)) - return FHIRAllTypes.ANY; - throw new IllegalArgumentException("Unknown FHIRAllTypes code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ACTIONDEFINITION); - if ("Address".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ADDRESS); - if ("Age".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.AGE); - if ("Annotation".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ANNOTATION); - if ("Attachment".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ATTACHMENT); - if ("BackboneElement".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BACKBONEELEMENT); - if ("CodeableConcept".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CODEABLECONCEPT); - if ("Coding".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CODING); - if ("ContactPoint".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CONTACTPOINT); - if ("Count".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.COUNT); - if ("DataRequirement".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DATAREQUIREMENT); - if ("Distance".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DISTANCE); - if ("Duration".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DURATION); - if ("Element".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ELEMENT); - if ("ElementDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ELEMENTDEFINITION); - if ("Extension".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.EXTENSION); - if ("HumanName".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.HUMANNAME); - if ("Identifier".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IDENTIFIER); - if ("Meta".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.META); - if ("ModuleMetadata".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MODULEMETADATA); - if ("Money".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MONEY); - if ("Narrative".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.NARRATIVE); - if ("ParameterDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PARAMETERDEFINITION); - if ("Period".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PERIOD); - if ("Quantity".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.QUANTITY); - if ("Range".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.RANGE); - if ("Ratio".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.RATIO); - if ("Reference".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.REFERENCE); - if ("SampledData".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SAMPLEDDATA); - if ("Signature".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SIGNATURE); - if ("SimpleQuantity".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SIMPLEQUANTITY); - if ("Timing".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.TIMING); - if ("TriggerDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.TRIGGERDEFINITION); - if ("base64Binary".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BASE64BINARY); - if ("boolean".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BOOLEAN); - if ("code".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CODE); - if ("date".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DATE); - if ("dateTime".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DATETIME); - if ("decimal".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DECIMAL); - if ("id".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ID); - if ("instant".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.INSTANT); - if ("integer".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.INTEGER); - if ("markdown".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MARKDOWN); - if ("oid".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.OID); - if ("positiveInt".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.POSITIVEINT); - if ("string".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.STRING); - if ("time".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.TIME); - if ("unsignedInt".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.UNSIGNEDINT); - if ("uri".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.URI); - if ("uuid".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.UUID); - if ("xhtml".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.XHTML); - if ("Account".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ACCOUNT); - if ("AllergyIntolerance".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ALLERGYINTOLERANCE); - if ("Appointment".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.APPOINTMENT); - if ("AppointmentResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.APPOINTMENTRESPONSE); - if ("AuditEvent".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.AUDITEVENT); - if ("Basic".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BASIC); - if ("Binary".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BINARY); - if ("BodySite".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BODYSITE); - if ("Bundle".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.BUNDLE); - if ("CarePlan".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CAREPLAN); - if ("CareTeam".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CARETEAM); - if ("Claim".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CLAIM); - if ("ClaimResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CLAIMRESPONSE); - if ("ClinicalImpression".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CLINICALIMPRESSION); - if ("CodeSystem".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CODESYSTEM); - if ("Communication".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.COMMUNICATION); - if ("CommunicationRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.COMMUNICATIONREQUEST); - if ("CompartmentDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.COMPARTMENTDEFINITION); - if ("Composition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.COMPOSITION); - if ("ConceptMap".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CONCEPTMAP); - if ("Condition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CONDITION); - if ("Conformance".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CONFORMANCE); - if ("Contract".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.CONTRACT); - if ("Coverage".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.COVERAGE); - if ("DataElement".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DATAELEMENT); - if ("DecisionSupportRule".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DECISIONSUPPORTRULE); - if ("DecisionSupportServiceModule".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DECISIONSUPPORTSERVICEMODULE); - if ("DetectedIssue".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DETECTEDISSUE); - if ("Device".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DEVICE); - if ("DeviceComponent".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DEVICECOMPONENT); - if ("DeviceMetric".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DEVICEMETRIC); - if ("DeviceUseRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DEVICEUSEREQUEST); - if ("DeviceUseStatement".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DEVICEUSESTATEMENT); - if ("DiagnosticOrder".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DIAGNOSTICORDER); - if ("DiagnosticReport".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DIAGNOSTICREPORT); - if ("DocumentManifest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DOCUMENTMANIFEST); - if ("DocumentReference".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DOCUMENTREFERENCE); - if ("DomainResource".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.DOMAINRESOURCE); - if ("EligibilityRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ELIGIBILITYREQUEST); - if ("EligibilityResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ELIGIBILITYRESPONSE); - if ("Encounter".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ENCOUNTER); - if ("EnrollmentRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ENROLLMENTREQUEST); - if ("EnrollmentResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ENROLLMENTRESPONSE); - if ("EpisodeOfCare".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.EPISODEOFCARE); - if ("ExpansionProfile".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.EXPANSIONPROFILE); - if ("ExplanationOfBenefit".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.EXPLANATIONOFBENEFIT); - if ("FamilyMemberHistory".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.FAMILYMEMBERHISTORY); - if ("Flag".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.FLAG); - if ("Goal".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.GOAL); - if ("Group".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.GROUP); - if ("GuidanceResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.GUIDANCERESPONSE); - if ("HealthcareService".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.HEALTHCARESERVICE); - if ("ImagingExcerpt".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IMAGINGEXCERPT); - if ("ImagingObjectSelection".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IMAGINGOBJECTSELECTION); - if ("ImagingStudy".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IMAGINGSTUDY); - if ("Immunization".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IMMUNIZATION); - if ("ImmunizationRecommendation".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IMMUNIZATIONRECOMMENDATION); - if ("ImplementationGuide".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.IMPLEMENTATIONGUIDE); - if ("Library".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.LIBRARY); - if ("Linkage".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.LINKAGE); - if ("List".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.LIST); - if ("Location".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.LOCATION); - if ("Measure".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEASURE); - if ("MeasureReport".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEASUREREPORT); - if ("Media".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEDIA); - if ("Medication".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEDICATION); - if ("MedicationAdministration".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEDICATIONADMINISTRATION); - if ("MedicationDispense".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEDICATIONDISPENSE); - if ("MedicationOrder".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEDICATIONORDER); - if ("MedicationStatement".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MEDICATIONSTATEMENT); - if ("MessageHeader".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MESSAGEHEADER); - if ("ModuleDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.MODULEDEFINITION); - if ("NamingSystem".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.NAMINGSYSTEM); - if ("NutritionOrder".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.NUTRITIONORDER); - if ("Observation".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.OBSERVATION); - if ("OperationDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.OPERATIONDEFINITION); - if ("OperationOutcome".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.OPERATIONOUTCOME); - if ("Order".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ORDER); - if ("OrderResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ORDERRESPONSE); - if ("OrderSet".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ORDERSET); - if ("Organization".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ORGANIZATION); - if ("Parameters".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PARAMETERS); - if ("Patient".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PATIENT); - if ("PaymentNotice".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PAYMENTNOTICE); - if ("PaymentReconciliation".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PAYMENTRECONCILIATION); - if ("Person".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PERSON); - if ("Practitioner".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PRACTITIONER); - if ("PractitionerRole".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PRACTITIONERROLE); - if ("Procedure".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PROCEDURE); - if ("ProcedureRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PROCEDUREREQUEST); - if ("ProcessRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PROCESSREQUEST); - if ("ProcessResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PROCESSRESPONSE); - if ("Protocol".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PROTOCOL); - if ("Provenance".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.PROVENANCE); - if ("Questionnaire".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.QUESTIONNAIRE); - if ("QuestionnaireResponse".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.QUESTIONNAIRERESPONSE); - if ("ReferralRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.REFERRALREQUEST); - if ("RelatedPerson".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.RELATEDPERSON); - if ("Resource".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.RESOURCE); - if ("RiskAssessment".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.RISKASSESSMENT); - if ("Schedule".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SCHEDULE); - if ("SearchParameter".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SEARCHPARAMETER); - if ("Sequence".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SEQUENCE); - if ("Slot".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SLOT); - if ("Specimen".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SPECIMEN); - if ("StructureDefinition".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.STRUCTUREDEFINITION); - if ("StructureMap".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.STRUCTUREMAP); - if ("Subscription".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SUBSCRIPTION); - if ("Substance".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SUBSTANCE); - if ("SupplyDelivery".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SUPPLYDELIVERY); - if ("SupplyRequest".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.SUPPLYREQUEST); - if ("Task".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.TASK); - if ("TestScript".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.TESTSCRIPT); - if ("ValueSet".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.VALUESET); - if ("VisionPrescription".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.VISIONPRESCRIPTION); - if ("Type".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.TYPE); - if ("Any".equals(codeString)) - return new Enumeration(this, FHIRAllTypes.ANY); - throw new FHIRException("Unknown FHIRAllTypes code '"+codeString+"'"); - } - public String toCode(FHIRAllTypes code) { - if (code == FHIRAllTypes.ACTIONDEFINITION) - return "ActionDefinition"; - if (code == FHIRAllTypes.ADDRESS) - return "Address"; - if (code == FHIRAllTypes.AGE) - return "Age"; - if (code == FHIRAllTypes.ANNOTATION) - return "Annotation"; - if (code == FHIRAllTypes.ATTACHMENT) - return "Attachment"; - if (code == FHIRAllTypes.BACKBONEELEMENT) - return "BackboneElement"; - if (code == FHIRAllTypes.CODEABLECONCEPT) - return "CodeableConcept"; - if (code == FHIRAllTypes.CODING) - return "Coding"; - if (code == FHIRAllTypes.CONTACTPOINT) - return "ContactPoint"; - if (code == FHIRAllTypes.COUNT) - return "Count"; - if (code == FHIRAllTypes.DATAREQUIREMENT) - return "DataRequirement"; - if (code == FHIRAllTypes.DISTANCE) - return "Distance"; - if (code == FHIRAllTypes.DURATION) - return "Duration"; - if (code == FHIRAllTypes.ELEMENT) - return "Element"; - if (code == FHIRAllTypes.ELEMENTDEFINITION) - return "ElementDefinition"; - if (code == FHIRAllTypes.EXTENSION) - return "Extension"; - if (code == FHIRAllTypes.HUMANNAME) - return "HumanName"; - if (code == FHIRAllTypes.IDENTIFIER) - return "Identifier"; - if (code == FHIRAllTypes.META) - return "Meta"; - if (code == FHIRAllTypes.MODULEMETADATA) - return "ModuleMetadata"; - if (code == FHIRAllTypes.MONEY) - return "Money"; - if (code == FHIRAllTypes.NARRATIVE) - return "Narrative"; - if (code == FHIRAllTypes.PARAMETERDEFINITION) - return "ParameterDefinition"; - if (code == FHIRAllTypes.PERIOD) - return "Period"; - if (code == FHIRAllTypes.QUANTITY) - return "Quantity"; - if (code == FHIRAllTypes.RANGE) - return "Range"; - if (code == FHIRAllTypes.RATIO) - return "Ratio"; - if (code == FHIRAllTypes.REFERENCE) - return "Reference"; - if (code == FHIRAllTypes.SAMPLEDDATA) - return "SampledData"; - if (code == FHIRAllTypes.SIGNATURE) - return "Signature"; - if (code == FHIRAllTypes.SIMPLEQUANTITY) - return "SimpleQuantity"; - if (code == FHIRAllTypes.TIMING) - return "Timing"; - if (code == FHIRAllTypes.TRIGGERDEFINITION) - return "TriggerDefinition"; - if (code == FHIRAllTypes.BASE64BINARY) - return "base64Binary"; - if (code == FHIRAllTypes.BOOLEAN) - return "boolean"; - if (code == FHIRAllTypes.CODE) - return "code"; - if (code == FHIRAllTypes.DATE) - return "date"; - if (code == FHIRAllTypes.DATETIME) - return "dateTime"; - if (code == FHIRAllTypes.DECIMAL) - return "decimal"; - if (code == FHIRAllTypes.ID) - return "id"; - if (code == FHIRAllTypes.INSTANT) - return "instant"; - if (code == FHIRAllTypes.INTEGER) - return "integer"; - if (code == FHIRAllTypes.MARKDOWN) - return "markdown"; - if (code == FHIRAllTypes.OID) - return "oid"; - if (code == FHIRAllTypes.POSITIVEINT) - return "positiveInt"; - if (code == FHIRAllTypes.STRING) - return "string"; - if (code == FHIRAllTypes.TIME) - return "time"; - if (code == FHIRAllTypes.UNSIGNEDINT) - return "unsignedInt"; - if (code == FHIRAllTypes.URI) - return "uri"; - if (code == FHIRAllTypes.UUID) - return "uuid"; - if (code == FHIRAllTypes.XHTML) - return "xhtml"; - if (code == FHIRAllTypes.ACCOUNT) - return "Account"; - if (code == FHIRAllTypes.ALLERGYINTOLERANCE) - return "AllergyIntolerance"; - if (code == FHIRAllTypes.APPOINTMENT) - return "Appointment"; - if (code == FHIRAllTypes.APPOINTMENTRESPONSE) - return "AppointmentResponse"; - if (code == FHIRAllTypes.AUDITEVENT) - return "AuditEvent"; - if (code == FHIRAllTypes.BASIC) - return "Basic"; - if (code == FHIRAllTypes.BINARY) - return "Binary"; - if (code == FHIRAllTypes.BODYSITE) - return "BodySite"; - if (code == FHIRAllTypes.BUNDLE) - return "Bundle"; - if (code == FHIRAllTypes.CAREPLAN) - return "CarePlan"; - if (code == FHIRAllTypes.CARETEAM) - return "CareTeam"; - if (code == FHIRAllTypes.CLAIM) - return "Claim"; - if (code == FHIRAllTypes.CLAIMRESPONSE) - return "ClaimResponse"; - if (code == FHIRAllTypes.CLINICALIMPRESSION) - return "ClinicalImpression"; - if (code == FHIRAllTypes.CODESYSTEM) - return "CodeSystem"; - if (code == FHIRAllTypes.COMMUNICATION) - return "Communication"; - if (code == FHIRAllTypes.COMMUNICATIONREQUEST) - return "CommunicationRequest"; - if (code == FHIRAllTypes.COMPARTMENTDEFINITION) - return "CompartmentDefinition"; - if (code == FHIRAllTypes.COMPOSITION) - return "Composition"; - if (code == FHIRAllTypes.CONCEPTMAP) - return "ConceptMap"; - if (code == FHIRAllTypes.CONDITION) - return "Condition"; - if (code == FHIRAllTypes.CONFORMANCE) - return "Conformance"; - if (code == FHIRAllTypes.CONTRACT) - return "Contract"; - if (code == FHIRAllTypes.COVERAGE) - return "Coverage"; - if (code == FHIRAllTypes.DATAELEMENT) - return "DataElement"; - if (code == FHIRAllTypes.DECISIONSUPPORTRULE) - return "DecisionSupportRule"; - if (code == FHIRAllTypes.DECISIONSUPPORTSERVICEMODULE) - return "DecisionSupportServiceModule"; - if (code == FHIRAllTypes.DETECTEDISSUE) - return "DetectedIssue"; - if (code == FHIRAllTypes.DEVICE) - return "Device"; - if (code == FHIRAllTypes.DEVICECOMPONENT) - return "DeviceComponent"; - if (code == FHIRAllTypes.DEVICEMETRIC) - return "DeviceMetric"; - if (code == FHIRAllTypes.DEVICEUSEREQUEST) - return "DeviceUseRequest"; - if (code == FHIRAllTypes.DEVICEUSESTATEMENT) - return "DeviceUseStatement"; - if (code == FHIRAllTypes.DIAGNOSTICORDER) - return "DiagnosticOrder"; - if (code == FHIRAllTypes.DIAGNOSTICREPORT) - return "DiagnosticReport"; - if (code == FHIRAllTypes.DOCUMENTMANIFEST) - return "DocumentManifest"; - if (code == FHIRAllTypes.DOCUMENTREFERENCE) - return "DocumentReference"; - if (code == FHIRAllTypes.DOMAINRESOURCE) - return "DomainResource"; - if (code == FHIRAllTypes.ELIGIBILITYREQUEST) - return "EligibilityRequest"; - if (code == FHIRAllTypes.ELIGIBILITYRESPONSE) - return "EligibilityResponse"; - if (code == FHIRAllTypes.ENCOUNTER) - return "Encounter"; - if (code == FHIRAllTypes.ENROLLMENTREQUEST) - return "EnrollmentRequest"; - if (code == FHIRAllTypes.ENROLLMENTRESPONSE) - return "EnrollmentResponse"; - if (code == FHIRAllTypes.EPISODEOFCARE) - return "EpisodeOfCare"; - if (code == FHIRAllTypes.EXPANSIONPROFILE) - return "ExpansionProfile"; - if (code == FHIRAllTypes.EXPLANATIONOFBENEFIT) - return "ExplanationOfBenefit"; - if (code == FHIRAllTypes.FAMILYMEMBERHISTORY) - return "FamilyMemberHistory"; - if (code == FHIRAllTypes.FLAG) - return "Flag"; - if (code == FHIRAllTypes.GOAL) - return "Goal"; - if (code == FHIRAllTypes.GROUP) - return "Group"; - if (code == FHIRAllTypes.GUIDANCERESPONSE) - return "GuidanceResponse"; - if (code == FHIRAllTypes.HEALTHCARESERVICE) - return "HealthcareService"; - if (code == FHIRAllTypes.IMAGINGEXCERPT) - return "ImagingExcerpt"; - if (code == FHIRAllTypes.IMAGINGOBJECTSELECTION) - return "ImagingObjectSelection"; - if (code == FHIRAllTypes.IMAGINGSTUDY) - return "ImagingStudy"; - if (code == FHIRAllTypes.IMMUNIZATION) - return "Immunization"; - if (code == FHIRAllTypes.IMMUNIZATIONRECOMMENDATION) - return "ImmunizationRecommendation"; - if (code == FHIRAllTypes.IMPLEMENTATIONGUIDE) - return "ImplementationGuide"; - if (code == FHIRAllTypes.LIBRARY) - return "Library"; - if (code == FHIRAllTypes.LINKAGE) - return "Linkage"; - if (code == FHIRAllTypes.LIST) - return "List"; - if (code == FHIRAllTypes.LOCATION) - return "Location"; - if (code == FHIRAllTypes.MEASURE) - return "Measure"; - if (code == FHIRAllTypes.MEASUREREPORT) - return "MeasureReport"; - if (code == FHIRAllTypes.MEDIA) - return "Media"; - if (code == FHIRAllTypes.MEDICATION) - return "Medication"; - if (code == FHIRAllTypes.MEDICATIONADMINISTRATION) - return "MedicationAdministration"; - if (code == FHIRAllTypes.MEDICATIONDISPENSE) - return "MedicationDispense"; - if (code == FHIRAllTypes.MEDICATIONORDER) - return "MedicationOrder"; - if (code == FHIRAllTypes.MEDICATIONSTATEMENT) - return "MedicationStatement"; - if (code == FHIRAllTypes.MESSAGEHEADER) - return "MessageHeader"; - if (code == FHIRAllTypes.MODULEDEFINITION) - return "ModuleDefinition"; - if (code == FHIRAllTypes.NAMINGSYSTEM) - return "NamingSystem"; - if (code == FHIRAllTypes.NUTRITIONORDER) - return "NutritionOrder"; - if (code == FHIRAllTypes.OBSERVATION) - return "Observation"; - if (code == FHIRAllTypes.OPERATIONDEFINITION) - return "OperationDefinition"; - if (code == FHIRAllTypes.OPERATIONOUTCOME) - return "OperationOutcome"; - if (code == FHIRAllTypes.ORDER) - return "Order"; - if (code == FHIRAllTypes.ORDERRESPONSE) - return "OrderResponse"; - if (code == FHIRAllTypes.ORDERSET) - return "OrderSet"; - if (code == FHIRAllTypes.ORGANIZATION) - return "Organization"; - if (code == FHIRAllTypes.PARAMETERS) - return "Parameters"; - if (code == FHIRAllTypes.PATIENT) - return "Patient"; - if (code == FHIRAllTypes.PAYMENTNOTICE) - return "PaymentNotice"; - if (code == FHIRAllTypes.PAYMENTRECONCILIATION) - return "PaymentReconciliation"; - if (code == FHIRAllTypes.PERSON) - return "Person"; - if (code == FHIRAllTypes.PRACTITIONER) - return "Practitioner"; - if (code == FHIRAllTypes.PRACTITIONERROLE) - return "PractitionerRole"; - if (code == FHIRAllTypes.PROCEDURE) - return "Procedure"; - if (code == FHIRAllTypes.PROCEDUREREQUEST) - return "ProcedureRequest"; - if (code == FHIRAllTypes.PROCESSREQUEST) - return "ProcessRequest"; - if (code == FHIRAllTypes.PROCESSRESPONSE) - return "ProcessResponse"; - if (code == FHIRAllTypes.PROTOCOL) - return "Protocol"; - if (code == FHIRAllTypes.PROVENANCE) - return "Provenance"; - if (code == FHIRAllTypes.QUESTIONNAIRE) - return "Questionnaire"; - if (code == FHIRAllTypes.QUESTIONNAIRERESPONSE) - return "QuestionnaireResponse"; - if (code == FHIRAllTypes.REFERRALREQUEST) - return "ReferralRequest"; - if (code == FHIRAllTypes.RELATEDPERSON) - return "RelatedPerson"; - if (code == FHIRAllTypes.RESOURCE) - return "Resource"; - if (code == FHIRAllTypes.RISKASSESSMENT) - return "RiskAssessment"; - if (code == FHIRAllTypes.SCHEDULE) - return "Schedule"; - if (code == FHIRAllTypes.SEARCHPARAMETER) - return "SearchParameter"; - if (code == FHIRAllTypes.SEQUENCE) - return "Sequence"; - if (code == FHIRAllTypes.SLOT) - return "Slot"; - if (code == FHIRAllTypes.SPECIMEN) - return "Specimen"; - if (code == FHIRAllTypes.STRUCTUREDEFINITION) - return "StructureDefinition"; - if (code == FHIRAllTypes.STRUCTUREMAP) - return "StructureMap"; - if (code == FHIRAllTypes.SUBSCRIPTION) - return "Subscription"; - if (code == FHIRAllTypes.SUBSTANCE) - return "Substance"; - if (code == FHIRAllTypes.SUPPLYDELIVERY) - return "SupplyDelivery"; - if (code == FHIRAllTypes.SUPPLYREQUEST) - return "SupplyRequest"; - if (code == FHIRAllTypes.TASK) - return "Task"; - if (code == FHIRAllTypes.TESTSCRIPT) - return "TestScript"; - if (code == FHIRAllTypes.VALUESET) - return "ValueSet"; - if (code == FHIRAllTypes.VISIONPRESCRIPTION) - return "VisionPrescription"; - if (code == FHIRAllTypes.TYPE) - return "Type"; - if (code == FHIRAllTypes.ANY) - return "Any"; - return "?"; - } - public String toSystem(FHIRAllTypes code) { - return code.getSystem(); - } - } - - public enum FHIRDefinedType { - /** - * The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library. - */ - ACTIONDEFINITION, - /** - * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world. - */ - ADDRESS, - /** - * null - */ - AGE, - /** - * A text note which also contains information about who made the statement and when. - */ - ANNOTATION, - /** - * For referring to data content defined in other formats. - */ - ATTACHMENT, - /** - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ - BACKBONEELEMENT, - /** - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ - CODEABLECONCEPT, - /** - * A reference to a code defined by a terminology system. - */ - CODING, - /** - * Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc. - */ - CONTACTPOINT, - /** - * null - */ - COUNT, - /** - * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. - */ - DATAREQUIREMENT, - /** - * null - */ - DISTANCE, - /** - * null - */ - DURATION, - /** - * Base definition for all elements in a resource. - */ - ELEMENT, - /** - * Captures constraints on each element within the resource, profile, or extension. - */ - ELEMENTDEFINITION, - /** - * Optional Extensions Element - found in all resources. - */ - EXTENSION, - /** - * A human's name with the ability to identify parts and usage. - */ - HUMANNAME, - /** - * A technical identifier - identifies some entity uniquely and unambiguously. - */ - IDENTIFIER, - /** - * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ - META, - /** - * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. - */ - MODULEMETADATA, - /** - * null - */ - MONEY, - /** - * A human-readable formatted text, including images. - */ - NARRATIVE, - /** - * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. - */ - PARAMETERDEFINITION, - /** - * A time period defined by a start and end date and optionally time. - */ - PERIOD, - /** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ - QUANTITY, - /** - * A set of ordered Quantities defined by a low and high limit. - */ - RANGE, - /** - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ - RATIO, - /** - * A reference from one resource to another. - */ - REFERENCE, - /** - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - */ - SAMPLEDDATA, - /** - * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. - */ - SIGNATURE, - /** - * null - */ - SIMPLEQUANTITY, - /** - * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. - */ - TIMING, - /** - * A description of a triggering event. - */ - TRIGGERDEFINITION, - /** - * A stream of bytes - */ - BASE64BINARY, - /** - * Value of "true" or "false" - */ - BOOLEAN, - /** - * A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents - */ - CODE, - /** - * A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates. - */ - DATE, - /** - * A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates. - */ - DATETIME, - /** - * A rational number with implicit precision - */ - DECIMAL, - /** - * Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive. - */ - ID, - /** - * An instant in time - known at least to the second - */ - INSTANT, - /** - * A whole number - */ - INTEGER, - /** - * A string that may contain markdown syntax for optional processing by a mark down presentation engine - */ - MARKDOWN, - /** - * An oid represented as a URI - */ - OID, - /** - * An integer with a value that is positive (e.g. >0) - */ - POSITIVEINT, - /** - * A sequence of Unicode characters - */ - STRING, - /** - * A time during the day, with no date specified - */ - TIME, - /** - * An integer with a value that is not negative (e.g. >= 0) - */ - UNSIGNEDINT, - /** - * String of characters used to identify a name or a resource - */ - URI, - /** - * A UUID, represented as a URI - */ - UUID, - /** - * XHTML format, as defined by W3C, but restricted usage (mainly, no active content) - */ - XHTML, - /** - * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. - */ - ACCOUNT, - /** - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. - */ - ALLERGYINTOLERANCE, - /** - * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). - */ - APPOINTMENT, - /** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ - APPOINTMENTRESPONSE, - /** - * 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. - */ - AUDITEVENT, - /** - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ - BASIC, - /** - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ - BINARY, - /** - * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. - */ - BODYSITE, - /** - * A container for a collection of resources. - */ - BUNDLE, - /** - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. - */ - CAREPLAN, - /** - * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. - */ - CARETEAM, - /** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ - CLAIM, - /** - * This resource provides the adjudication details from the processing of a Claim resource. - */ - CLAIMRESPONSE, - /** - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. - */ - CLINICALIMPRESSION, - /** - * A code system resource specifies a set of codes drawn from one or more code systems. - */ - CODESYSTEM, - /** - * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. - */ - COMMUNICATION, - /** - * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. - */ - COMMUNICATIONREQUEST, - /** - * A compartment definition that defines how resources are accessed on a server. - */ - COMPARTMENTDEFINITION, - /** - * 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. - */ - COMPOSITION, - /** - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. - */ - CONCEPTMAP, - /** - * 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. - */ - CONDITION, - /** - * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. - */ - CONFORMANCE, - /** - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ - CONTRACT, - /** - * Financial instrument which may be used to pay for or reimburse health care products and services. - */ - COVERAGE, - /** - * The formal description of a single piece of information that can be gathered and reported. - */ - DATAELEMENT, - /** - * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. - */ - DECISIONSUPPORTRULE, - /** - * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. - */ - DECISIONSUPPORTSERVICEMODULE, - /** - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ - DETECTEDISSUE, - /** - * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. - */ - DEVICE, - /** - * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. - */ - DEVICECOMPONENT, - /** - * Describes a measurement, calculation or setting capability of a medical device. - */ - DEVICEMETRIC, - /** - * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. - */ - DEVICEUSEREQUEST, - /** - * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. - */ - DEVICEUSESTATEMENT, - /** - * A record of a request for a diagnostic investigation service to be performed. - */ - DIAGNOSTICORDER, - /** - * 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 interpretations, and formatted representation of diagnostic reports. - */ - DIAGNOSTICREPORT, - /** - * A manifest that defines a set of documents. - */ - DOCUMENTMANIFEST, - /** - * A reference to a document . - */ - DOCUMENTREFERENCE, - /** - * A resource that includes narrative, extensions, and contained resources. - */ - DOMAINRESOURCE, - /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. - */ - ELIGIBILITYREQUEST, - /** - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ - ELIGIBILITYRESPONSE, - /** - * 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. - */ - ENCOUNTER, - /** - * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. - */ - ENROLLMENTREQUEST, - /** - * This resource provides enrollment and plan details from the processing of an Enrollment resource. - */ - ENROLLMENTRESPONSE, - /** - * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. - */ - EPISODEOFCARE, - /** - * Resource to define constraints on the Expansion of a FHIR ValueSet. - */ - EXPANSIONPROFILE, - /** - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - */ - EXPLANATIONOFBENEFIT, - /** - * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. - */ - FAMILYMEMBERHISTORY, - /** - * Prospective warnings of potential issues when providing care to the patient. - */ - FLAG, - /** - * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. - */ - GOAL, - /** - * 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. - */ - GROUP, - /** - * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. - */ - GUIDANCERESPONSE, - /** - * The details of a healthcare service available at a location. - */ - HEALTHCARESERVICE, - /** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ - IMAGINGEXCERPT, - /** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ - IMAGINGOBJECTSELECTION, - /** - * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. - */ - IMAGINGSTUDY, - /** - * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. - */ - IMMUNIZATION, - /** - * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. - */ - IMMUNIZATIONRECOMMENDATION, - /** - * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. - */ - IMPLEMENTATIONGUIDE, - /** - * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. - */ - LIBRARY, - /** - * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". - */ - LINKAGE, - /** - * A set of information summarized from a list of other resources. - */ - LIST, - /** - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. - */ - LOCATION, - /** - * The Measure resource provides the definition of a quality measure. - */ - MEASURE, - /** - * The MeasureReport resource contains the results of evaluating a measure. - */ - MEASUREREPORT, - /** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. - */ - MEDIA, - /** - * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. - */ - MEDICATION, - /** - * Describes the event of a patient consuming or otherwise being administered 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. - */ - MEDICATIONADMINISTRATION, - /** - * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. - */ - MEDICATIONDISPENSE, - /** - * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. - */ - MEDICATIONORDER, - /** - * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. - */ - MEDICATIONSTATEMENT, - /** - * The header for a message exchange that is either requesting or responding to an action. The reference(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. - */ - MESSAGEHEADER, - /** - * The ModuleDefinition resource defines the data requirements for a quality artifact. - */ - MODULEDEFINITION, - /** - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ - NAMINGSYSTEM, - /** - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ - NUTRITIONORDER, - /** - * Measurements and simple assertions made about a patient, device or other subject. - */ - OBSERVATION, - /** - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). - */ - OPERATIONDEFINITION, - /** - * A collection of error, warning or information messages that result from a system action. - */ - OPERATIONOUTCOME, - /** - * A request to perform an action. - */ - ORDER, - /** - * A response to an order. - */ - ORDERRESPONSE, - /** - * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. - */ - ORDERSET, - /** - * 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. - */ - ORGANIZATION, - /** - * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. - */ - PARAMETERS, - /** - * Demographics and other administrative information about an individual or animal receiving care or other health-related services. - */ - PATIENT, - /** - * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. - */ - PAYMENTNOTICE, - /** - * This resource provides payment details and claim references supporting a bulk payment. - */ - PAYMENTRECONCILIATION, - /** - * Demographics and administrative information about a person independent of a specific health-related context. - */ - PERSON, - /** - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ - PRACTITIONER, - /** - * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. - */ - PRACTITIONERROLE, - /** - * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. - */ - PROCEDURE, - /** - * A request for a procedure to be performed. May be a proposal or an order. - */ - PROCEDUREREQUEST, - /** - * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. - */ - PROCESSREQUEST, - /** - * This resource provides processing status, errors and notes from the processing of a resource. - */ - PROCESSRESPONSE, - /** - * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. - */ - PROTOCOL, - /** - * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. - */ - PROVENANCE, - /** - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ - QUESTIONNAIRE, - /** - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ - QUESTIONNAIRERESPONSE, - /** - * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. - */ - REFERRALREQUEST, - /** - * 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. - */ - RELATEDPERSON, - /** - * This is the base resource type for everything. - */ - RESOURCE, - /** - * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ - RISKASSESSMENT, - /** - * A container for slot(s) of time that may be available for booking appointments. - */ - SCHEDULE, - /** - * A search parameter that defines a named search item that can be used to search/filter on a resource. - */ - SEARCHPARAMETER, - /** - * Variation and Sequence data. - */ - SEQUENCE, - /** - * A slot of time on a schedule that may be available for booking appointments. - */ - SLOT, - /** - * A sample to be used for analysis. - */ - SPECIMEN, - /** - * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. - */ - STRUCTUREDEFINITION, - /** - * A Map of relationships between 2 structures that can be used to transform data. - */ - STRUCTUREMAP, - /** - * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. - */ - SUBSCRIPTION, - /** - * A homogeneous material with a definite composition. - */ - SUBSTANCE, - /** - * Record of delivery of what is supplied. - */ - SUPPLYDELIVERY, - /** - * A record of a request for a medication, substance or device used in the healthcare setting. - */ - SUPPLYREQUEST, - /** - * A task to be performed. - */ - TASK, - /** - * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. - */ - TESTSCRIPT, - /** - * A value set specifies a set of codes drawn from one or more code systems. - */ - VALUESET, - /** - * An authorization for the supply of glasses and/or contact lenses to a patient. - */ - VISIONPRESCRIPTION, - /** - * added to help the parsers - */ - NULL; - public static FHIRDefinedType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return ACTIONDEFINITION; - if ("Address".equals(codeString)) - return ADDRESS; - if ("Age".equals(codeString)) - return AGE; - if ("Annotation".equals(codeString)) - return ANNOTATION; - if ("Attachment".equals(codeString)) - return ATTACHMENT; - if ("BackboneElement".equals(codeString)) - return BACKBONEELEMENT; - if ("CodeableConcept".equals(codeString)) - return CODEABLECONCEPT; - if ("Coding".equals(codeString)) - return CODING; - if ("ContactPoint".equals(codeString)) - return CONTACTPOINT; - if ("Count".equals(codeString)) - return COUNT; - if ("DataRequirement".equals(codeString)) - return DATAREQUIREMENT; - if ("Distance".equals(codeString)) - return DISTANCE; - if ("Duration".equals(codeString)) - return DURATION; - if ("Element".equals(codeString)) - return ELEMENT; - if ("ElementDefinition".equals(codeString)) - return ELEMENTDEFINITION; - if ("Extension".equals(codeString)) - return EXTENSION; - if ("HumanName".equals(codeString)) - return HUMANNAME; - if ("Identifier".equals(codeString)) - return IDENTIFIER; - if ("Meta".equals(codeString)) - return META; - if ("ModuleMetadata".equals(codeString)) - return MODULEMETADATA; - if ("Money".equals(codeString)) - return MONEY; - if ("Narrative".equals(codeString)) - return NARRATIVE; - if ("ParameterDefinition".equals(codeString)) - return PARAMETERDEFINITION; - if ("Period".equals(codeString)) - return PERIOD; - if ("Quantity".equals(codeString)) - return QUANTITY; - if ("Range".equals(codeString)) - return RANGE; - if ("Ratio".equals(codeString)) - return RATIO; - if ("Reference".equals(codeString)) - return REFERENCE; - if ("SampledData".equals(codeString)) - return SAMPLEDDATA; - if ("Signature".equals(codeString)) - return SIGNATURE; - if ("SimpleQuantity".equals(codeString)) - return SIMPLEQUANTITY; - if ("Timing".equals(codeString)) - return TIMING; - if ("TriggerDefinition".equals(codeString)) - return TRIGGERDEFINITION; - if ("base64Binary".equals(codeString)) - return BASE64BINARY; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("code".equals(codeString)) - return CODE; - if ("date".equals(codeString)) - return DATE; - if ("dateTime".equals(codeString)) - return DATETIME; - if ("decimal".equals(codeString)) - return DECIMAL; - if ("id".equals(codeString)) - return ID; - if ("instant".equals(codeString)) - return INSTANT; - if ("integer".equals(codeString)) - return INTEGER; - if ("markdown".equals(codeString)) - return MARKDOWN; - if ("oid".equals(codeString)) - return OID; - if ("positiveInt".equals(codeString)) - return POSITIVEINT; - if ("string".equals(codeString)) - return STRING; - if ("time".equals(codeString)) - return TIME; - if ("unsignedInt".equals(codeString)) - return UNSIGNEDINT; - if ("uri".equals(codeString)) - return URI; - if ("uuid".equals(codeString)) - return UUID; - if ("xhtml".equals(codeString)) - return XHTML; - if ("Account".equals(codeString)) - return ACCOUNT; - if ("AllergyIntolerance".equals(codeString)) - return ALLERGYINTOLERANCE; - if ("Appointment".equals(codeString)) - return APPOINTMENT; - if ("AppointmentResponse".equals(codeString)) - return APPOINTMENTRESPONSE; - if ("AuditEvent".equals(codeString)) - return AUDITEVENT; - if ("Basic".equals(codeString)) - return BASIC; - if ("Binary".equals(codeString)) - return BINARY; - if ("BodySite".equals(codeString)) - return BODYSITE; - if ("Bundle".equals(codeString)) - return BUNDLE; - if ("CarePlan".equals(codeString)) - return CAREPLAN; - if ("CareTeam".equals(codeString)) - return CARETEAM; - if ("Claim".equals(codeString)) - return CLAIM; - if ("ClaimResponse".equals(codeString)) - return CLAIMRESPONSE; - if ("ClinicalImpression".equals(codeString)) - return CLINICALIMPRESSION; - if ("CodeSystem".equals(codeString)) - return CODESYSTEM; - if ("Communication".equals(codeString)) - return COMMUNICATION; - if ("CommunicationRequest".equals(codeString)) - return COMMUNICATIONREQUEST; - if ("CompartmentDefinition".equals(codeString)) - return COMPARTMENTDEFINITION; - if ("Composition".equals(codeString)) - return COMPOSITION; - if ("ConceptMap".equals(codeString)) - return CONCEPTMAP; - if ("Condition".equals(codeString)) - return CONDITION; - if ("Conformance".equals(codeString)) - return CONFORMANCE; - if ("Contract".equals(codeString)) - return CONTRACT; - if ("Coverage".equals(codeString)) - return COVERAGE; - if ("DataElement".equals(codeString)) - return DATAELEMENT; - if ("DecisionSupportRule".equals(codeString)) - return DECISIONSUPPORTRULE; - if ("DecisionSupportServiceModule".equals(codeString)) - return DECISIONSUPPORTSERVICEMODULE; - if ("DetectedIssue".equals(codeString)) - return DETECTEDISSUE; - if ("Device".equals(codeString)) - return DEVICE; - if ("DeviceComponent".equals(codeString)) - return DEVICECOMPONENT; - if ("DeviceMetric".equals(codeString)) - return DEVICEMETRIC; - if ("DeviceUseRequest".equals(codeString)) - return DEVICEUSEREQUEST; - if ("DeviceUseStatement".equals(codeString)) - return DEVICEUSESTATEMENT; - if ("DiagnosticOrder".equals(codeString)) - return DIAGNOSTICORDER; - if ("DiagnosticReport".equals(codeString)) - return DIAGNOSTICREPORT; - if ("DocumentManifest".equals(codeString)) - return DOCUMENTMANIFEST; - if ("DocumentReference".equals(codeString)) - return DOCUMENTREFERENCE; - if ("DomainResource".equals(codeString)) - return DOMAINRESOURCE; - if ("EligibilityRequest".equals(codeString)) - return ELIGIBILITYREQUEST; - if ("EligibilityResponse".equals(codeString)) - return ELIGIBILITYRESPONSE; - if ("Encounter".equals(codeString)) - return ENCOUNTER; - if ("EnrollmentRequest".equals(codeString)) - return ENROLLMENTREQUEST; - if ("EnrollmentResponse".equals(codeString)) - return ENROLLMENTRESPONSE; - if ("EpisodeOfCare".equals(codeString)) - return EPISODEOFCARE; - if ("ExpansionProfile".equals(codeString)) - return EXPANSIONPROFILE; - if ("ExplanationOfBenefit".equals(codeString)) - return EXPLANATIONOFBENEFIT; - if ("FamilyMemberHistory".equals(codeString)) - return FAMILYMEMBERHISTORY; - if ("Flag".equals(codeString)) - return FLAG; - if ("Goal".equals(codeString)) - return GOAL; - if ("Group".equals(codeString)) - return GROUP; - if ("GuidanceResponse".equals(codeString)) - return GUIDANCERESPONSE; - if ("HealthcareService".equals(codeString)) - return HEALTHCARESERVICE; - if ("ImagingExcerpt".equals(codeString)) - return IMAGINGEXCERPT; - if ("ImagingObjectSelection".equals(codeString)) - return IMAGINGOBJECTSELECTION; - if ("ImagingStudy".equals(codeString)) - return IMAGINGSTUDY; - if ("Immunization".equals(codeString)) - return IMMUNIZATION; - if ("ImmunizationRecommendation".equals(codeString)) - return IMMUNIZATIONRECOMMENDATION; - if ("ImplementationGuide".equals(codeString)) - return IMPLEMENTATIONGUIDE; - if ("Library".equals(codeString)) - return LIBRARY; - if ("Linkage".equals(codeString)) - return LINKAGE; - if ("List".equals(codeString)) - return LIST; - if ("Location".equals(codeString)) - return LOCATION; - if ("Measure".equals(codeString)) - return MEASURE; - if ("MeasureReport".equals(codeString)) - return MEASUREREPORT; - if ("Media".equals(codeString)) - return MEDIA; - if ("Medication".equals(codeString)) - return MEDICATION; - if ("MedicationAdministration".equals(codeString)) - return MEDICATIONADMINISTRATION; - if ("MedicationDispense".equals(codeString)) - return MEDICATIONDISPENSE; - if ("MedicationOrder".equals(codeString)) - return MEDICATIONORDER; - if ("MedicationStatement".equals(codeString)) - return MEDICATIONSTATEMENT; - if ("MessageHeader".equals(codeString)) - return MESSAGEHEADER; - if ("ModuleDefinition".equals(codeString)) - return MODULEDEFINITION; - if ("NamingSystem".equals(codeString)) - return NAMINGSYSTEM; - if ("NutritionOrder".equals(codeString)) - return NUTRITIONORDER; - if ("Observation".equals(codeString)) - return OBSERVATION; - if ("OperationDefinition".equals(codeString)) - return OPERATIONDEFINITION; - if ("OperationOutcome".equals(codeString)) - return OPERATIONOUTCOME; - if ("Order".equals(codeString)) - return ORDER; - if ("OrderResponse".equals(codeString)) - return ORDERRESPONSE; - if ("OrderSet".equals(codeString)) - return ORDERSET; - if ("Organization".equals(codeString)) - return ORGANIZATION; - if ("Parameters".equals(codeString)) - return PARAMETERS; - if ("Patient".equals(codeString)) - return PATIENT; - if ("PaymentNotice".equals(codeString)) - return PAYMENTNOTICE; - if ("PaymentReconciliation".equals(codeString)) - return PAYMENTRECONCILIATION; - if ("Person".equals(codeString)) - return PERSON; - if ("Practitioner".equals(codeString)) - return PRACTITIONER; - if ("PractitionerRole".equals(codeString)) - return PRACTITIONERROLE; - if ("Procedure".equals(codeString)) - return PROCEDURE; - if ("ProcedureRequest".equals(codeString)) - return PROCEDUREREQUEST; - if ("ProcessRequest".equals(codeString)) - return PROCESSREQUEST; - if ("ProcessResponse".equals(codeString)) - return PROCESSRESPONSE; - if ("Protocol".equals(codeString)) - return PROTOCOL; - if ("Provenance".equals(codeString)) - return PROVENANCE; - if ("Questionnaire".equals(codeString)) - return QUESTIONNAIRE; - if ("QuestionnaireResponse".equals(codeString)) - return QUESTIONNAIRERESPONSE; - if ("ReferralRequest".equals(codeString)) - return REFERRALREQUEST; - if ("RelatedPerson".equals(codeString)) - return RELATEDPERSON; - if ("Resource".equals(codeString)) - return RESOURCE; - if ("RiskAssessment".equals(codeString)) - return RISKASSESSMENT; - if ("Schedule".equals(codeString)) - return SCHEDULE; - if ("SearchParameter".equals(codeString)) - return SEARCHPARAMETER; - if ("Sequence".equals(codeString)) - return SEQUENCE; - if ("Slot".equals(codeString)) - return SLOT; - if ("Specimen".equals(codeString)) - return SPECIMEN; - if ("StructureDefinition".equals(codeString)) - return STRUCTUREDEFINITION; - if ("StructureMap".equals(codeString)) - return STRUCTUREMAP; - if ("Subscription".equals(codeString)) - return SUBSCRIPTION; - if ("Substance".equals(codeString)) - return SUBSTANCE; - if ("SupplyDelivery".equals(codeString)) - return SUPPLYDELIVERY; - if ("SupplyRequest".equals(codeString)) - return SUPPLYREQUEST; - if ("Task".equals(codeString)) - return TASK; - if ("TestScript".equals(codeString)) - return TESTSCRIPT; - if ("ValueSet".equals(codeString)) - return VALUESET; - if ("VisionPrescription".equals(codeString)) - return VISIONPRESCRIPTION; - throw new FHIRException("Unknown FHIRDefinedType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIONDEFINITION: return "ActionDefinition"; - case ADDRESS: return "Address"; - case AGE: return "Age"; - case ANNOTATION: return "Annotation"; - case ATTACHMENT: return "Attachment"; - case BACKBONEELEMENT: return "BackboneElement"; - case CODEABLECONCEPT: return "CodeableConcept"; - case CODING: return "Coding"; - case CONTACTPOINT: return "ContactPoint"; - case COUNT: return "Count"; - case DATAREQUIREMENT: return "DataRequirement"; - case DISTANCE: return "Distance"; - case DURATION: return "Duration"; - case ELEMENT: return "Element"; - case ELEMENTDEFINITION: return "ElementDefinition"; - case EXTENSION: return "Extension"; - case HUMANNAME: return "HumanName"; - case IDENTIFIER: return "Identifier"; - case META: return "Meta"; - case MODULEMETADATA: return "ModuleMetadata"; - case MONEY: return "Money"; - case NARRATIVE: return "Narrative"; - case PARAMETERDEFINITION: return "ParameterDefinition"; - case PERIOD: return "Period"; - case QUANTITY: return "Quantity"; - case RANGE: return "Range"; - case RATIO: return "Ratio"; - case REFERENCE: return "Reference"; - case SAMPLEDDATA: return "SampledData"; - case SIGNATURE: return "Signature"; - case SIMPLEQUANTITY: return "SimpleQuantity"; - case TIMING: return "Timing"; - case TRIGGERDEFINITION: return "TriggerDefinition"; - case BASE64BINARY: return "base64Binary"; - case BOOLEAN: return "boolean"; - case CODE: return "code"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case DECIMAL: return "decimal"; - case ID: return "id"; - case INSTANT: return "instant"; - case INTEGER: return "integer"; - case MARKDOWN: return "markdown"; - case OID: return "oid"; - case POSITIVEINT: return "positiveInt"; - case STRING: return "string"; - case TIME: return "time"; - case UNSIGNEDINT: return "unsignedInt"; - case URI: return "uri"; - case UUID: return "uuid"; - case XHTML: return "xhtml"; - case ACCOUNT: return "Account"; - case ALLERGYINTOLERANCE: return "AllergyIntolerance"; - case APPOINTMENT: return "Appointment"; - case APPOINTMENTRESPONSE: return "AppointmentResponse"; - case AUDITEVENT: return "AuditEvent"; - case BASIC: return "Basic"; - case BINARY: return "Binary"; - case BODYSITE: return "BodySite"; - case BUNDLE: return "Bundle"; - case CAREPLAN: return "CarePlan"; - case CARETEAM: return "CareTeam"; - case CLAIM: return "Claim"; - case CLAIMRESPONSE: return "ClaimResponse"; - case CLINICALIMPRESSION: return "ClinicalImpression"; - case CODESYSTEM: return "CodeSystem"; - case COMMUNICATION: return "Communication"; - case COMMUNICATIONREQUEST: return "CommunicationRequest"; - case COMPARTMENTDEFINITION: return "CompartmentDefinition"; - case COMPOSITION: return "Composition"; - case CONCEPTMAP: return "ConceptMap"; - case CONDITION: return "Condition"; - case CONFORMANCE: return "Conformance"; - case CONTRACT: return "Contract"; - case COVERAGE: return "Coverage"; - case DATAELEMENT: return "DataElement"; - case DECISIONSUPPORTRULE: return "DecisionSupportRule"; - case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; - case DETECTEDISSUE: return "DetectedIssue"; - case DEVICE: return "Device"; - case DEVICECOMPONENT: return "DeviceComponent"; - case DEVICEMETRIC: return "DeviceMetric"; - case DEVICEUSEREQUEST: return "DeviceUseRequest"; - case DEVICEUSESTATEMENT: return "DeviceUseStatement"; - case DIAGNOSTICORDER: return "DiagnosticOrder"; - case DIAGNOSTICREPORT: return "DiagnosticReport"; - case DOCUMENTMANIFEST: return "DocumentManifest"; - case DOCUMENTREFERENCE: return "DocumentReference"; - case DOMAINRESOURCE: return "DomainResource"; - case ELIGIBILITYREQUEST: return "EligibilityRequest"; - case ELIGIBILITYRESPONSE: return "EligibilityResponse"; - case ENCOUNTER: return "Encounter"; - case ENROLLMENTREQUEST: return "EnrollmentRequest"; - case ENROLLMENTRESPONSE: return "EnrollmentResponse"; - case EPISODEOFCARE: return "EpisodeOfCare"; - case EXPANSIONPROFILE: return "ExpansionProfile"; - case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; - case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; - case FLAG: return "Flag"; - case GOAL: return "Goal"; - case GROUP: return "Group"; - case GUIDANCERESPONSE: return "GuidanceResponse"; - case HEALTHCARESERVICE: return "HealthcareService"; - case IMAGINGEXCERPT: return "ImagingExcerpt"; - case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; - case IMAGINGSTUDY: return "ImagingStudy"; - case IMMUNIZATION: return "Immunization"; - case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; - case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; - case LIBRARY: return "Library"; - case LINKAGE: return "Linkage"; - case LIST: return "List"; - case LOCATION: return "Location"; - case MEASURE: return "Measure"; - case MEASUREREPORT: return "MeasureReport"; - case MEDIA: return "Media"; - case MEDICATION: return "Medication"; - case MEDICATIONADMINISTRATION: return "MedicationAdministration"; - case MEDICATIONDISPENSE: return "MedicationDispense"; - case MEDICATIONORDER: return "MedicationOrder"; - case MEDICATIONSTATEMENT: return "MedicationStatement"; - case MESSAGEHEADER: return "MessageHeader"; - case MODULEDEFINITION: return "ModuleDefinition"; - case NAMINGSYSTEM: return "NamingSystem"; - case NUTRITIONORDER: return "NutritionOrder"; - case OBSERVATION: return "Observation"; - case OPERATIONDEFINITION: return "OperationDefinition"; - case OPERATIONOUTCOME: return "OperationOutcome"; - case ORDER: return "Order"; - case ORDERRESPONSE: return "OrderResponse"; - case ORDERSET: return "OrderSet"; - case ORGANIZATION: return "Organization"; - case PARAMETERS: return "Parameters"; - case PATIENT: return "Patient"; - case PAYMENTNOTICE: return "PaymentNotice"; - case PAYMENTRECONCILIATION: return "PaymentReconciliation"; - case PERSON: return "Person"; - case PRACTITIONER: return "Practitioner"; - case PRACTITIONERROLE: return "PractitionerRole"; - case PROCEDURE: return "Procedure"; - case PROCEDUREREQUEST: return "ProcedureRequest"; - case PROCESSREQUEST: return "ProcessRequest"; - case PROCESSRESPONSE: return "ProcessResponse"; - case PROTOCOL: return "Protocol"; - case PROVENANCE: return "Provenance"; - case QUESTIONNAIRE: return "Questionnaire"; - case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; - case REFERRALREQUEST: return "ReferralRequest"; - case RELATEDPERSON: return "RelatedPerson"; - case RESOURCE: return "Resource"; - case RISKASSESSMENT: return "RiskAssessment"; - case SCHEDULE: return "Schedule"; - case SEARCHPARAMETER: return "SearchParameter"; - case SEQUENCE: return "Sequence"; - case SLOT: return "Slot"; - case SPECIMEN: return "Specimen"; - case STRUCTUREDEFINITION: return "StructureDefinition"; - case STRUCTUREMAP: return "StructureMap"; - case SUBSCRIPTION: return "Subscription"; - case SUBSTANCE: return "Substance"; - case SUPPLYDELIVERY: return "SupplyDelivery"; - case SUPPLYREQUEST: return "SupplyRequest"; - case TASK: return "Task"; - case TESTSCRIPT: return "TestScript"; - case VALUESET: return "ValueSet"; - case VISIONPRESCRIPTION: return "VisionPrescription"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIONDEFINITION: return "http://hl7.org/fhir/data-types"; - case ADDRESS: return "http://hl7.org/fhir/data-types"; - case AGE: return "http://hl7.org/fhir/data-types"; - case ANNOTATION: return "http://hl7.org/fhir/data-types"; - case ATTACHMENT: return "http://hl7.org/fhir/data-types"; - case BACKBONEELEMENT: return "http://hl7.org/fhir/data-types"; - case CODEABLECONCEPT: return "http://hl7.org/fhir/data-types"; - case CODING: return "http://hl7.org/fhir/data-types"; - case CONTACTPOINT: return "http://hl7.org/fhir/data-types"; - case COUNT: return "http://hl7.org/fhir/data-types"; - case DATAREQUIREMENT: return "http://hl7.org/fhir/data-types"; - case DISTANCE: return "http://hl7.org/fhir/data-types"; - case DURATION: return "http://hl7.org/fhir/data-types"; - case ELEMENT: return "http://hl7.org/fhir/data-types"; - case ELEMENTDEFINITION: return "http://hl7.org/fhir/data-types"; - case EXTENSION: return "http://hl7.org/fhir/data-types"; - case HUMANNAME: return "http://hl7.org/fhir/data-types"; - case IDENTIFIER: return "http://hl7.org/fhir/data-types"; - case META: return "http://hl7.org/fhir/data-types"; - case MODULEMETADATA: return "http://hl7.org/fhir/data-types"; - case MONEY: return "http://hl7.org/fhir/data-types"; - case NARRATIVE: return "http://hl7.org/fhir/data-types"; - case PARAMETERDEFINITION: return "http://hl7.org/fhir/data-types"; - case PERIOD: return "http://hl7.org/fhir/data-types"; - case QUANTITY: return "http://hl7.org/fhir/data-types"; - case RANGE: return "http://hl7.org/fhir/data-types"; - case RATIO: return "http://hl7.org/fhir/data-types"; - case REFERENCE: return "http://hl7.org/fhir/data-types"; - case SAMPLEDDATA: return "http://hl7.org/fhir/data-types"; - case SIGNATURE: return "http://hl7.org/fhir/data-types"; - case SIMPLEQUANTITY: return "http://hl7.org/fhir/data-types"; - case TIMING: return "http://hl7.org/fhir/data-types"; - case TRIGGERDEFINITION: return "http://hl7.org/fhir/data-types"; - case BASE64BINARY: return "http://hl7.org/fhir/data-types"; - case BOOLEAN: return "http://hl7.org/fhir/data-types"; - case CODE: return "http://hl7.org/fhir/data-types"; - case DATE: return "http://hl7.org/fhir/data-types"; - case DATETIME: return "http://hl7.org/fhir/data-types"; - case DECIMAL: return "http://hl7.org/fhir/data-types"; - case ID: return "http://hl7.org/fhir/data-types"; - case INSTANT: return "http://hl7.org/fhir/data-types"; - case INTEGER: return "http://hl7.org/fhir/data-types"; - case MARKDOWN: return "http://hl7.org/fhir/data-types"; - case OID: return "http://hl7.org/fhir/data-types"; - case POSITIVEINT: return "http://hl7.org/fhir/data-types"; - case STRING: return "http://hl7.org/fhir/data-types"; - case TIME: return "http://hl7.org/fhir/data-types"; - case UNSIGNEDINT: return "http://hl7.org/fhir/data-types"; - case URI: return "http://hl7.org/fhir/data-types"; - case UUID: return "http://hl7.org/fhir/data-types"; - case XHTML: return "http://hl7.org/fhir/data-types"; - case ACCOUNT: return "http://hl7.org/fhir/resource-types"; - case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types"; - case APPOINTMENT: return "http://hl7.org/fhir/resource-types"; - case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; - case AUDITEVENT: return "http://hl7.org/fhir/resource-types"; - case BASIC: return "http://hl7.org/fhir/resource-types"; - case BINARY: return "http://hl7.org/fhir/resource-types"; - case BODYSITE: return "http://hl7.org/fhir/resource-types"; - case BUNDLE: return "http://hl7.org/fhir/resource-types"; - case CAREPLAN: return "http://hl7.org/fhir/resource-types"; - case CARETEAM: return "http://hl7.org/fhir/resource-types"; - case CLAIM: return "http://hl7.org/fhir/resource-types"; - case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types"; - case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types"; - case CODESYSTEM: return "http://hl7.org/fhir/resource-types"; - case COMMUNICATION: return "http://hl7.org/fhir/resource-types"; - case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; - case COMPARTMENTDEFINITION: return "http://hl7.org/fhir/resource-types"; - case COMPOSITION: return "http://hl7.org/fhir/resource-types"; - case CONCEPTMAP: return "http://hl7.org/fhir/resource-types"; - case CONDITION: return "http://hl7.org/fhir/resource-types"; - case CONFORMANCE: return "http://hl7.org/fhir/resource-types"; - case CONTRACT: return "http://hl7.org/fhir/resource-types"; - case COVERAGE: return "http://hl7.org/fhir/resource-types"; - case DATAELEMENT: return "http://hl7.org/fhir/resource-types"; - case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/resource-types"; - case DECISIONSUPPORTSERVICEMODULE: return "http://hl7.org/fhir/resource-types"; - case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types"; - case DEVICE: return "http://hl7.org/fhir/resource-types"; - case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types"; - case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types"; - case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types"; - case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types"; - case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types"; - case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types"; - case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types"; - case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types"; - case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types"; - case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types"; - case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types"; - case ENCOUNTER: return "http://hl7.org/fhir/resource-types"; - case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types"; - case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; - case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types"; - case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types"; - case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types"; - case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types"; - case FLAG: return "http://hl7.org/fhir/resource-types"; - case GOAL: return "http://hl7.org/fhir/resource-types"; - case GROUP: return "http://hl7.org/fhir/resource-types"; - case GUIDANCERESPONSE: return "http://hl7.org/fhir/resource-types"; - case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types"; - case IMAGINGEXCERPT: return "http://hl7.org/fhir/resource-types"; - case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types"; - case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types"; - case IMMUNIZATION: return "http://hl7.org/fhir/resource-types"; - case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types"; - case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types"; - case LIBRARY: return "http://hl7.org/fhir/resource-types"; - case LINKAGE: return "http://hl7.org/fhir/resource-types"; - case LIST: return "http://hl7.org/fhir/resource-types"; - case LOCATION: return "http://hl7.org/fhir/resource-types"; - case MEASURE: return "http://hl7.org/fhir/resource-types"; - case MEASUREREPORT: return "http://hl7.org/fhir/resource-types"; - case MEDIA: return "http://hl7.org/fhir/resource-types"; - case MEDICATION: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; - case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; - case MODULEDEFINITION: return "http://hl7.org/fhir/resource-types"; - case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; - case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types"; - case OBSERVATION: return "http://hl7.org/fhir/resource-types"; - case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types"; - case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types"; - case ORDER: return "http://hl7.org/fhir/resource-types"; - case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types"; - case ORDERSET: return "http://hl7.org/fhir/resource-types"; - case ORGANIZATION: return "http://hl7.org/fhir/resource-types"; - case PARAMETERS: return "http://hl7.org/fhir/resource-types"; - case PATIENT: return "http://hl7.org/fhir/resource-types"; - case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types"; - case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types"; - case PERSON: return "http://hl7.org/fhir/resource-types"; - case PRACTITIONER: return "http://hl7.org/fhir/resource-types"; - case PRACTITIONERROLE: return "http://hl7.org/fhir/resource-types"; - case PROCEDURE: return "http://hl7.org/fhir/resource-types"; - case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types"; - case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types"; - case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types"; - case PROTOCOL: return "http://hl7.org/fhir/resource-types"; - case PROVENANCE: return "http://hl7.org/fhir/resource-types"; - case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types"; - case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types"; - case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; - case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; - case RESOURCE: return "http://hl7.org/fhir/resource-types"; - case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; - case SCHEDULE: return "http://hl7.org/fhir/resource-types"; - case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types"; - case SEQUENCE: return "http://hl7.org/fhir/resource-types"; - case SLOT: return "http://hl7.org/fhir/resource-types"; - case SPECIMEN: return "http://hl7.org/fhir/resource-types"; - case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types"; - case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types"; - case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types"; - case SUBSTANCE: return "http://hl7.org/fhir/resource-types"; - case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types"; - case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types"; - case TASK: return "http://hl7.org/fhir/resource-types"; - case TESTSCRIPT: return "http://hl7.org/fhir/resource-types"; - case VALUESET: return "http://hl7.org/fhir/resource-types"; - case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIONDEFINITION: return "The definition of an action to be performed. Some aspects of the definition are specified statically, and some aspects can be specified dynamically by referencing logic defined in a library."; - case ADDRESS: return "An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be valid for mail delivery. There are a variety of postal address formats defined around the world."; - case AGE: return ""; - case ANNOTATION: return "A text note which also contains information about who made the statement and when."; - case ATTACHMENT: return "For referring to data content defined in other formats."; - case BACKBONEELEMENT: return "Base definition for all elements that are defined inside a resource - but not those in a data type."; - case CODEABLECONCEPT: return "A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text."; - case CODING: return "A reference to a code defined by a terminology system."; - case CONTACTPOINT: return "Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, etc."; - case COUNT: return ""; - case DATAREQUIREMENT: return "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data."; - case DISTANCE: return ""; - case DURATION: return ""; - case ELEMENT: return "Base definition for all elements in a resource."; - case ELEMENTDEFINITION: return "Captures constraints on each element within the resource, profile, or extension."; - case EXTENSION: return "Optional Extensions Element - found in all resources."; - case HUMANNAME: return "A human's name with the ability to identify parts and usage."; - case IDENTIFIER: return "A technical identifier - identifies some entity uniquely and unambiguously."; - case META: return "The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource."; - case MODULEMETADATA: return "The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information."; - case MONEY: return ""; - case NARRATIVE: return "A human-readable formatted text, including images."; - case PARAMETERDEFINITION: return "The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse."; - case PERIOD: return "A time period defined by a start and end date and optionally time."; - case QUANTITY: return "A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies."; - case RANGE: return "A set of ordered Quantities defined by a low and high limit."; - case RATIO: return "A relationship of two Quantity values - expressed as a numerator and a denominator."; - case REFERENCE: return "A reference from one resource to another."; - case SAMPLEDDATA: return "A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data."; - case SIGNATURE: return "A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities."; - case SIMPLEQUANTITY: return ""; - case TIMING: return "Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds."; - case TRIGGERDEFINITION: return "A description of a triggering event."; - case BASE64BINARY: return "A stream of bytes"; - case BOOLEAN: return "Value of \"true\" or \"false\""; - case CODE: return "A string which has at least one character and no leading or trailing whitespace and where there is no whitespace other than single spaces in the contents"; - case DATE: return "A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the schema types gYear, gYearMonth and date. Dates SHALL be valid dates."; - case DATETIME: return "A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates SHALL be valid dates."; - case DECIMAL: return "A rational number with implicit precision"; - case ID: return "Any combination of letters, numerals, \"-\" and \".\", with a length limit of 64 characters. (This might be an integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case-insensitive."; - case INSTANT: return "An instant in time - known at least to the second"; - case INTEGER: return "A whole number"; - case MARKDOWN: return "A string that may contain markdown syntax for optional processing by a mark down presentation engine"; - case OID: return "An oid represented as a URI"; - case POSITIVEINT: return "An integer with a value that is positive (e.g. >0)"; - case STRING: return "A sequence of Unicode characters"; - case TIME: return "A time during the day, with no date specified"; - case UNSIGNEDINT: return "An integer with a value that is not negative (e.g. >= 0)"; - case URI: return "String of characters used to identify a name or a resource"; - case UUID: return "A UUID, represented as a URI"; - case XHTML: return "XHTML format, as defined by W3C, but restricted usage (mainly, no active content)"; - case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc."; - case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance."; - case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s)."; - case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection."; - case AUDITEVENT: return "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."; - case BASIC: return "Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification."; - case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc."; - case BODYSITE: return "Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case."; - case BUNDLE: return "A container for a collection of resources."; - case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions."; - case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient."; - case CLAIM: return "A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery."; - case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource."; - case CLINICALIMPRESSION: return "A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion with the recording of assessment tools such as Apgar score."; - case CODESYSTEM: return "A code system resource specifies a set of codes drawn from one or more code systems."; - case COMMUNICATION: return "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition."; - case COMMUNICATIONREQUEST: return "A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition."; - case COMPARTMENTDEFINITION: return "A compartment definition that defines how resources are accessed on a server."; - case COMPOSITION: return "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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained."; - case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models."; - case CONDITION: return "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."; - case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation."; - case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters."; - case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services."; - case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported."; - case DECISIONSUPPORTRULE: return "This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events."; - case DECISIONSUPPORTSERVICEMODULE: return "The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking."; - case DETECTEDISSUE: return "Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc."; - case DEVICE: return "This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc."; - case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device."; - case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device."; - case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker."; - case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician."; - case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed."; - case DIAGNOSTICREPORT: return "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 interpretations, and formatted representation of diagnostic reports."; - case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; - case DOCUMENTREFERENCE: return "A reference to a document ."; - case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; - case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; - case ENCOUNTER: return "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."; - case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage."; - case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource."; - case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time."; - case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet."; - case EXPLANATIONOFBENEFIT: return "This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided."; - case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient."; - case FLAG: return "Prospective warnings of potential issues when providing care to the patient."; - case GOAL: return "Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc."; - case GROUP: return "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."; - case GUIDANCERESPONSE: return "A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken."; - case HEALTHCARESERVICE: return "The details of a healthcare service available at a location."; - case IMAGINGEXCERPT: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; - case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; - case IMAGINGSTUDY: return "Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities."; - case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed."; - case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification."; - case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts."; - case LIBRARY: return "The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library."; - case LINKAGE: return "Identifies two or more records (resource instances) that are referring to the same real-world \"occurrence\"."; - case LIST: return "A set of information summarized from a list of other resources."; - case LOCATION: return "Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated."; - case MEASURE: return "The Measure resource provides the definition of a quality measure."; - case MEASUREREPORT: return "The MeasureReport resource contains the results of evaluating a measure."; - case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."; - case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication."; - case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered 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."; - case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; - case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc."; - case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; - case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(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."; - case MODULEDEFINITION: return "The ModuleDefinition resource defines the data requirements for a quality artifact."; - case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; - case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; - case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject."; - case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction)."; - case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action."; - case ORDER: return "A request to perform an action."; - case ORDERRESPONSE: return "A response to an order."; - case ORDERSET: return "This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support."; - case ORGANIZATION: return "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."; - case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it."; - case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services."; - case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references."; - case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment."; - case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context."; - case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare."; - case PRACTITIONERROLE: return "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time."; - case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy."; - case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order."; - case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources."; - case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource."; - case PROTOCOL: return "A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points."; - case PROVENANCE: return "Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies."; - case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; - case QUESTIONNAIRERESPONSE: return "A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; - case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; - case RELATEDPERSON: return "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."; - case RESOURCE: return "This is the base resource type for everything."; - case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; - case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; - case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource."; - case SEQUENCE: return "Variation and Sequence data."; - case SLOT: return "A slot of time on a schedule that may be available for booking appointments."; - case SPECIMEN: return "A sample to be used for analysis."; - case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types."; - case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data."; - case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action."; - case SUBSTANCE: return "A homogeneous material with a definite composition."; - case SUPPLYDELIVERY: return "Record of delivery of what is supplied."; - case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting."; - case TASK: return "A task to be performed."; - case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification."; - case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems."; - case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIONDEFINITION: return "ActionDefinition"; - case ADDRESS: return "Address"; - case AGE: return "Age"; - case ANNOTATION: return "Annotation"; - case ATTACHMENT: return "Attachment"; - case BACKBONEELEMENT: return "BackboneElement"; - case CODEABLECONCEPT: return "CodeableConcept"; - case CODING: return "Coding"; - case CONTACTPOINT: return "ContactPoint"; - case COUNT: return "Count"; - case DATAREQUIREMENT: return "DataRequirement"; - case DISTANCE: return "Distance"; - case DURATION: return "Duration"; - case ELEMENT: return "Element"; - case ELEMENTDEFINITION: return "ElementDefinition"; - case EXTENSION: return "Extension"; - case HUMANNAME: return "HumanName"; - case IDENTIFIER: return "Identifier"; - case META: return "Meta"; - case MODULEMETADATA: return "ModuleMetadata"; - case MONEY: return "Money"; - case NARRATIVE: return "Narrative"; - case PARAMETERDEFINITION: return "ParameterDefinition"; - case PERIOD: return "Period"; - case QUANTITY: return "Quantity"; - case RANGE: return "Range"; - case RATIO: return "Ratio"; - case REFERENCE: return "Reference"; - case SAMPLEDDATA: return "SampledData"; - case SIGNATURE: return "Signature"; - case SIMPLEQUANTITY: return "SimpleQuantity"; - case TIMING: return "Timing"; - case TRIGGERDEFINITION: return "TriggerDefinition"; - case BASE64BINARY: return "base64Binary"; - case BOOLEAN: return "boolean"; - case CODE: return "code"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case DECIMAL: return "decimal"; - case ID: return "id"; - case INSTANT: return "instant"; - case INTEGER: return "integer"; - case MARKDOWN: return "markdown"; - case OID: return "oid"; - case POSITIVEINT: return "positiveInt"; - case STRING: return "string"; - case TIME: return "time"; - case UNSIGNEDINT: return "unsignedInt"; - case URI: return "uri"; - case UUID: return "uuid"; - case XHTML: return "XHTML"; - case ACCOUNT: return "Account"; - case ALLERGYINTOLERANCE: return "AllergyIntolerance"; - case APPOINTMENT: return "Appointment"; - case APPOINTMENTRESPONSE: return "AppointmentResponse"; - case AUDITEVENT: return "AuditEvent"; - case BASIC: return "Basic"; - case BINARY: return "Binary"; - case BODYSITE: return "BodySite"; - case BUNDLE: return "Bundle"; - case CAREPLAN: return "CarePlan"; - case CARETEAM: return "CareTeam"; - case CLAIM: return "Claim"; - case CLAIMRESPONSE: return "ClaimResponse"; - case CLINICALIMPRESSION: return "ClinicalImpression"; - case CODESYSTEM: return "CodeSystem"; - case COMMUNICATION: return "Communication"; - case COMMUNICATIONREQUEST: return "CommunicationRequest"; - case COMPARTMENTDEFINITION: return "CompartmentDefinition"; - case COMPOSITION: return "Composition"; - case CONCEPTMAP: return "ConceptMap"; - case CONDITION: return "Condition"; - case CONFORMANCE: return "Conformance"; - case CONTRACT: return "Contract"; - case COVERAGE: return "Coverage"; - case DATAELEMENT: return "DataElement"; - case DECISIONSUPPORTRULE: return "DecisionSupportRule"; - case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; - case DETECTEDISSUE: return "DetectedIssue"; - case DEVICE: return "Device"; - case DEVICECOMPONENT: return "DeviceComponent"; - case DEVICEMETRIC: return "DeviceMetric"; - case DEVICEUSEREQUEST: return "DeviceUseRequest"; - case DEVICEUSESTATEMENT: return "DeviceUseStatement"; - case DIAGNOSTICORDER: return "DiagnosticOrder"; - case DIAGNOSTICREPORT: return "DiagnosticReport"; - case DOCUMENTMANIFEST: return "DocumentManifest"; - case DOCUMENTREFERENCE: return "DocumentReference"; - case DOMAINRESOURCE: return "DomainResource"; - case ELIGIBILITYREQUEST: return "EligibilityRequest"; - case ELIGIBILITYRESPONSE: return "EligibilityResponse"; - case ENCOUNTER: return "Encounter"; - case ENROLLMENTREQUEST: return "EnrollmentRequest"; - case ENROLLMENTRESPONSE: return "EnrollmentResponse"; - case EPISODEOFCARE: return "EpisodeOfCare"; - case EXPANSIONPROFILE: return "ExpansionProfile"; - case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; - case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; - case FLAG: return "Flag"; - case GOAL: return "Goal"; - case GROUP: return "Group"; - case GUIDANCERESPONSE: return "GuidanceResponse"; - case HEALTHCARESERVICE: return "HealthcareService"; - case IMAGINGEXCERPT: return "ImagingExcerpt"; - case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; - case IMAGINGSTUDY: return "ImagingStudy"; - case IMMUNIZATION: return "Immunization"; - case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; - case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; - case LIBRARY: return "Library"; - case LINKAGE: return "Linkage"; - case LIST: return "List"; - case LOCATION: return "Location"; - case MEASURE: return "Measure"; - case MEASUREREPORT: return "MeasureReport"; - case MEDIA: return "Media"; - case MEDICATION: return "Medication"; - case MEDICATIONADMINISTRATION: return "MedicationAdministration"; - case MEDICATIONDISPENSE: return "MedicationDispense"; - case MEDICATIONORDER: return "MedicationOrder"; - case MEDICATIONSTATEMENT: return "MedicationStatement"; - case MESSAGEHEADER: return "MessageHeader"; - case MODULEDEFINITION: return "ModuleDefinition"; - case NAMINGSYSTEM: return "NamingSystem"; - case NUTRITIONORDER: return "NutritionOrder"; - case OBSERVATION: return "Observation"; - case OPERATIONDEFINITION: return "OperationDefinition"; - case OPERATIONOUTCOME: return "OperationOutcome"; - case ORDER: return "Order"; - case ORDERRESPONSE: return "OrderResponse"; - case ORDERSET: return "OrderSet"; - case ORGANIZATION: return "Organization"; - case PARAMETERS: return "Parameters"; - case PATIENT: return "Patient"; - case PAYMENTNOTICE: return "PaymentNotice"; - case PAYMENTRECONCILIATION: return "PaymentReconciliation"; - case PERSON: return "Person"; - case PRACTITIONER: return "Practitioner"; - case PRACTITIONERROLE: return "PractitionerRole"; - case PROCEDURE: return "Procedure"; - case PROCEDUREREQUEST: return "ProcedureRequest"; - case PROCESSREQUEST: return "ProcessRequest"; - case PROCESSRESPONSE: return "ProcessResponse"; - case PROTOCOL: return "Protocol"; - case PROVENANCE: return "Provenance"; - case QUESTIONNAIRE: return "Questionnaire"; - case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; - case REFERRALREQUEST: return "ReferralRequest"; - case RELATEDPERSON: return "RelatedPerson"; - case RESOURCE: return "Resource"; - case RISKASSESSMENT: return "RiskAssessment"; - case SCHEDULE: return "Schedule"; - case SEARCHPARAMETER: return "SearchParameter"; - case SEQUENCE: return "Sequence"; - case SLOT: return "Slot"; - case SPECIMEN: return "Specimen"; - case STRUCTUREDEFINITION: return "StructureDefinition"; - case STRUCTUREMAP: return "StructureMap"; - case SUBSCRIPTION: return "Subscription"; - case SUBSTANCE: return "Substance"; - case SUPPLYDELIVERY: return "SupplyDelivery"; - case SUPPLYREQUEST: return "SupplyRequest"; - case TASK: return "Task"; - case TESTSCRIPT: return "TestScript"; - case VALUESET: return "ValueSet"; - case VISIONPRESCRIPTION: return "VisionPrescription"; - default: return "?"; - } - } - } - - public static class FHIRDefinedTypeEnumFactory implements EnumFactory { - public FHIRDefinedType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return FHIRDefinedType.ACTIONDEFINITION; - if ("Address".equals(codeString)) - return FHIRDefinedType.ADDRESS; - if ("Age".equals(codeString)) - return FHIRDefinedType.AGE; - if ("Annotation".equals(codeString)) - return FHIRDefinedType.ANNOTATION; - if ("Attachment".equals(codeString)) - return FHIRDefinedType.ATTACHMENT; - if ("BackboneElement".equals(codeString)) - return FHIRDefinedType.BACKBONEELEMENT; - if ("CodeableConcept".equals(codeString)) - return FHIRDefinedType.CODEABLECONCEPT; - if ("Coding".equals(codeString)) - return FHIRDefinedType.CODING; - if ("ContactPoint".equals(codeString)) - return FHIRDefinedType.CONTACTPOINT; - if ("Count".equals(codeString)) - return FHIRDefinedType.COUNT; - if ("DataRequirement".equals(codeString)) - return FHIRDefinedType.DATAREQUIREMENT; - if ("Distance".equals(codeString)) - return FHIRDefinedType.DISTANCE; - if ("Duration".equals(codeString)) - return FHIRDefinedType.DURATION; - if ("Element".equals(codeString)) - return FHIRDefinedType.ELEMENT; - if ("ElementDefinition".equals(codeString)) - return FHIRDefinedType.ELEMENTDEFINITION; - if ("Extension".equals(codeString)) - return FHIRDefinedType.EXTENSION; - if ("HumanName".equals(codeString)) - return FHIRDefinedType.HUMANNAME; - if ("Identifier".equals(codeString)) - return FHIRDefinedType.IDENTIFIER; - if ("Meta".equals(codeString)) - return FHIRDefinedType.META; - if ("ModuleMetadata".equals(codeString)) - return FHIRDefinedType.MODULEMETADATA; - if ("Money".equals(codeString)) - return FHIRDefinedType.MONEY; - if ("Narrative".equals(codeString)) - return FHIRDefinedType.NARRATIVE; - if ("ParameterDefinition".equals(codeString)) - return FHIRDefinedType.PARAMETERDEFINITION; - if ("Period".equals(codeString)) - return FHIRDefinedType.PERIOD; - if ("Quantity".equals(codeString)) - return FHIRDefinedType.QUANTITY; - if ("Range".equals(codeString)) - return FHIRDefinedType.RANGE; - if ("Ratio".equals(codeString)) - return FHIRDefinedType.RATIO; - if ("Reference".equals(codeString)) - return FHIRDefinedType.REFERENCE; - if ("SampledData".equals(codeString)) - return FHIRDefinedType.SAMPLEDDATA; - if ("Signature".equals(codeString)) - return FHIRDefinedType.SIGNATURE; - if ("SimpleQuantity".equals(codeString)) - return FHIRDefinedType.SIMPLEQUANTITY; - if ("Timing".equals(codeString)) - return FHIRDefinedType.TIMING; - if ("TriggerDefinition".equals(codeString)) - return FHIRDefinedType.TRIGGERDEFINITION; - if ("base64Binary".equals(codeString)) - return FHIRDefinedType.BASE64BINARY; - if ("boolean".equals(codeString)) - return FHIRDefinedType.BOOLEAN; - if ("code".equals(codeString)) - return FHIRDefinedType.CODE; - if ("date".equals(codeString)) - return FHIRDefinedType.DATE; - if ("dateTime".equals(codeString)) - return FHIRDefinedType.DATETIME; - if ("decimal".equals(codeString)) - return FHIRDefinedType.DECIMAL; - if ("id".equals(codeString)) - return FHIRDefinedType.ID; - if ("instant".equals(codeString)) - return FHIRDefinedType.INSTANT; - if ("integer".equals(codeString)) - return FHIRDefinedType.INTEGER; - if ("markdown".equals(codeString)) - return FHIRDefinedType.MARKDOWN; - if ("oid".equals(codeString)) - return FHIRDefinedType.OID; - if ("positiveInt".equals(codeString)) - return FHIRDefinedType.POSITIVEINT; - if ("string".equals(codeString)) - return FHIRDefinedType.STRING; - if ("time".equals(codeString)) - return FHIRDefinedType.TIME; - if ("unsignedInt".equals(codeString)) - return FHIRDefinedType.UNSIGNEDINT; - if ("uri".equals(codeString)) - return FHIRDefinedType.URI; - if ("uuid".equals(codeString)) - return FHIRDefinedType.UUID; - if ("xhtml".equals(codeString)) - return FHIRDefinedType.XHTML; - if ("Account".equals(codeString)) - return FHIRDefinedType.ACCOUNT; - if ("AllergyIntolerance".equals(codeString)) - return FHIRDefinedType.ALLERGYINTOLERANCE; - if ("Appointment".equals(codeString)) - return FHIRDefinedType.APPOINTMENT; - if ("AppointmentResponse".equals(codeString)) - return FHIRDefinedType.APPOINTMENTRESPONSE; - if ("AuditEvent".equals(codeString)) - return FHIRDefinedType.AUDITEVENT; - if ("Basic".equals(codeString)) - return FHIRDefinedType.BASIC; - if ("Binary".equals(codeString)) - return FHIRDefinedType.BINARY; - if ("BodySite".equals(codeString)) - return FHIRDefinedType.BODYSITE; - if ("Bundle".equals(codeString)) - return FHIRDefinedType.BUNDLE; - if ("CarePlan".equals(codeString)) - return FHIRDefinedType.CAREPLAN; - if ("CareTeam".equals(codeString)) - return FHIRDefinedType.CARETEAM; - if ("Claim".equals(codeString)) - return FHIRDefinedType.CLAIM; - if ("ClaimResponse".equals(codeString)) - return FHIRDefinedType.CLAIMRESPONSE; - if ("ClinicalImpression".equals(codeString)) - return FHIRDefinedType.CLINICALIMPRESSION; - if ("CodeSystem".equals(codeString)) - return FHIRDefinedType.CODESYSTEM; - if ("Communication".equals(codeString)) - return FHIRDefinedType.COMMUNICATION; - if ("CommunicationRequest".equals(codeString)) - return FHIRDefinedType.COMMUNICATIONREQUEST; - if ("CompartmentDefinition".equals(codeString)) - return FHIRDefinedType.COMPARTMENTDEFINITION; - if ("Composition".equals(codeString)) - return FHIRDefinedType.COMPOSITION; - if ("ConceptMap".equals(codeString)) - return FHIRDefinedType.CONCEPTMAP; - if ("Condition".equals(codeString)) - return FHIRDefinedType.CONDITION; - if ("Conformance".equals(codeString)) - return FHIRDefinedType.CONFORMANCE; - if ("Contract".equals(codeString)) - return FHIRDefinedType.CONTRACT; - if ("Coverage".equals(codeString)) - return FHIRDefinedType.COVERAGE; - if ("DataElement".equals(codeString)) - return FHIRDefinedType.DATAELEMENT; - if ("DecisionSupportRule".equals(codeString)) - return FHIRDefinedType.DECISIONSUPPORTRULE; - if ("DecisionSupportServiceModule".equals(codeString)) - return FHIRDefinedType.DECISIONSUPPORTSERVICEMODULE; - if ("DetectedIssue".equals(codeString)) - return FHIRDefinedType.DETECTEDISSUE; - if ("Device".equals(codeString)) - return FHIRDefinedType.DEVICE; - if ("DeviceComponent".equals(codeString)) - return FHIRDefinedType.DEVICECOMPONENT; - if ("DeviceMetric".equals(codeString)) - return FHIRDefinedType.DEVICEMETRIC; - if ("DeviceUseRequest".equals(codeString)) - return FHIRDefinedType.DEVICEUSEREQUEST; - if ("DeviceUseStatement".equals(codeString)) - return FHIRDefinedType.DEVICEUSESTATEMENT; - if ("DiagnosticOrder".equals(codeString)) - return FHIRDefinedType.DIAGNOSTICORDER; - if ("DiagnosticReport".equals(codeString)) - return FHIRDefinedType.DIAGNOSTICREPORT; - if ("DocumentManifest".equals(codeString)) - return FHIRDefinedType.DOCUMENTMANIFEST; - if ("DocumentReference".equals(codeString)) - return FHIRDefinedType.DOCUMENTREFERENCE; - if ("DomainResource".equals(codeString)) - return FHIRDefinedType.DOMAINRESOURCE; - if ("EligibilityRequest".equals(codeString)) - return FHIRDefinedType.ELIGIBILITYREQUEST; - if ("EligibilityResponse".equals(codeString)) - return FHIRDefinedType.ELIGIBILITYRESPONSE; - if ("Encounter".equals(codeString)) - return FHIRDefinedType.ENCOUNTER; - if ("EnrollmentRequest".equals(codeString)) - return FHIRDefinedType.ENROLLMENTREQUEST; - if ("EnrollmentResponse".equals(codeString)) - return FHIRDefinedType.ENROLLMENTRESPONSE; - if ("EpisodeOfCare".equals(codeString)) - return FHIRDefinedType.EPISODEOFCARE; - if ("ExpansionProfile".equals(codeString)) - return FHIRDefinedType.EXPANSIONPROFILE; - if ("ExplanationOfBenefit".equals(codeString)) - return FHIRDefinedType.EXPLANATIONOFBENEFIT; - if ("FamilyMemberHistory".equals(codeString)) - return FHIRDefinedType.FAMILYMEMBERHISTORY; - if ("Flag".equals(codeString)) - return FHIRDefinedType.FLAG; - if ("Goal".equals(codeString)) - return FHIRDefinedType.GOAL; - if ("Group".equals(codeString)) - return FHIRDefinedType.GROUP; - if ("GuidanceResponse".equals(codeString)) - return FHIRDefinedType.GUIDANCERESPONSE; - if ("HealthcareService".equals(codeString)) - return FHIRDefinedType.HEALTHCARESERVICE; - if ("ImagingExcerpt".equals(codeString)) - return FHIRDefinedType.IMAGINGEXCERPT; - if ("ImagingObjectSelection".equals(codeString)) - return FHIRDefinedType.IMAGINGOBJECTSELECTION; - if ("ImagingStudy".equals(codeString)) - return FHIRDefinedType.IMAGINGSTUDY; - if ("Immunization".equals(codeString)) - return FHIRDefinedType.IMMUNIZATION; - if ("ImmunizationRecommendation".equals(codeString)) - return FHIRDefinedType.IMMUNIZATIONRECOMMENDATION; - if ("ImplementationGuide".equals(codeString)) - return FHIRDefinedType.IMPLEMENTATIONGUIDE; - if ("Library".equals(codeString)) - return FHIRDefinedType.LIBRARY; - if ("Linkage".equals(codeString)) - return FHIRDefinedType.LINKAGE; - if ("List".equals(codeString)) - return FHIRDefinedType.LIST; - if ("Location".equals(codeString)) - return FHIRDefinedType.LOCATION; - if ("Measure".equals(codeString)) - return FHIRDefinedType.MEASURE; - if ("MeasureReport".equals(codeString)) - return FHIRDefinedType.MEASUREREPORT; - if ("Media".equals(codeString)) - return FHIRDefinedType.MEDIA; - if ("Medication".equals(codeString)) - return FHIRDefinedType.MEDICATION; - if ("MedicationAdministration".equals(codeString)) - return FHIRDefinedType.MEDICATIONADMINISTRATION; - if ("MedicationDispense".equals(codeString)) - return FHIRDefinedType.MEDICATIONDISPENSE; - if ("MedicationOrder".equals(codeString)) - return FHIRDefinedType.MEDICATIONORDER; - if ("MedicationStatement".equals(codeString)) - return FHIRDefinedType.MEDICATIONSTATEMENT; - if ("MessageHeader".equals(codeString)) - return FHIRDefinedType.MESSAGEHEADER; - if ("ModuleDefinition".equals(codeString)) - return FHIRDefinedType.MODULEDEFINITION; - if ("NamingSystem".equals(codeString)) - return FHIRDefinedType.NAMINGSYSTEM; - if ("NutritionOrder".equals(codeString)) - return FHIRDefinedType.NUTRITIONORDER; - if ("Observation".equals(codeString)) - return FHIRDefinedType.OBSERVATION; - if ("OperationDefinition".equals(codeString)) - return FHIRDefinedType.OPERATIONDEFINITION; - if ("OperationOutcome".equals(codeString)) - return FHIRDefinedType.OPERATIONOUTCOME; - if ("Order".equals(codeString)) - return FHIRDefinedType.ORDER; - if ("OrderResponse".equals(codeString)) - return FHIRDefinedType.ORDERRESPONSE; - if ("OrderSet".equals(codeString)) - return FHIRDefinedType.ORDERSET; - if ("Organization".equals(codeString)) - return FHIRDefinedType.ORGANIZATION; - if ("Parameters".equals(codeString)) - return FHIRDefinedType.PARAMETERS; - if ("Patient".equals(codeString)) - return FHIRDefinedType.PATIENT; - if ("PaymentNotice".equals(codeString)) - return FHIRDefinedType.PAYMENTNOTICE; - if ("PaymentReconciliation".equals(codeString)) - return FHIRDefinedType.PAYMENTRECONCILIATION; - if ("Person".equals(codeString)) - return FHIRDefinedType.PERSON; - if ("Practitioner".equals(codeString)) - return FHIRDefinedType.PRACTITIONER; - if ("PractitionerRole".equals(codeString)) - return FHIRDefinedType.PRACTITIONERROLE; - if ("Procedure".equals(codeString)) - return FHIRDefinedType.PROCEDURE; - if ("ProcedureRequest".equals(codeString)) - return FHIRDefinedType.PROCEDUREREQUEST; - if ("ProcessRequest".equals(codeString)) - return FHIRDefinedType.PROCESSREQUEST; - if ("ProcessResponse".equals(codeString)) - return FHIRDefinedType.PROCESSRESPONSE; - if ("Protocol".equals(codeString)) - return FHIRDefinedType.PROTOCOL; - if ("Provenance".equals(codeString)) - return FHIRDefinedType.PROVENANCE; - if ("Questionnaire".equals(codeString)) - return FHIRDefinedType.QUESTIONNAIRE; - if ("QuestionnaireResponse".equals(codeString)) - return FHIRDefinedType.QUESTIONNAIRERESPONSE; - if ("ReferralRequest".equals(codeString)) - return FHIRDefinedType.REFERRALREQUEST; - if ("RelatedPerson".equals(codeString)) - return FHIRDefinedType.RELATEDPERSON; - if ("Resource".equals(codeString)) - return FHIRDefinedType.RESOURCE; - if ("RiskAssessment".equals(codeString)) - return FHIRDefinedType.RISKASSESSMENT; - if ("Schedule".equals(codeString)) - return FHIRDefinedType.SCHEDULE; - if ("SearchParameter".equals(codeString)) - return FHIRDefinedType.SEARCHPARAMETER; - if ("Sequence".equals(codeString)) - return FHIRDefinedType.SEQUENCE; - if ("Slot".equals(codeString)) - return FHIRDefinedType.SLOT; - if ("Specimen".equals(codeString)) - return FHIRDefinedType.SPECIMEN; - if ("StructureDefinition".equals(codeString)) - return FHIRDefinedType.STRUCTUREDEFINITION; - if ("StructureMap".equals(codeString)) - return FHIRDefinedType.STRUCTUREMAP; - if ("Subscription".equals(codeString)) - return FHIRDefinedType.SUBSCRIPTION; - if ("Substance".equals(codeString)) - return FHIRDefinedType.SUBSTANCE; - if ("SupplyDelivery".equals(codeString)) - return FHIRDefinedType.SUPPLYDELIVERY; - if ("SupplyRequest".equals(codeString)) - return FHIRDefinedType.SUPPLYREQUEST; - if ("Task".equals(codeString)) - return FHIRDefinedType.TASK; - if ("TestScript".equals(codeString)) - return FHIRDefinedType.TESTSCRIPT; - if ("ValueSet".equals(codeString)) - return FHIRDefinedType.VALUESET; - if ("VisionPrescription".equals(codeString)) - return FHIRDefinedType.VISIONPRESCRIPTION; - throw new IllegalArgumentException("Unknown FHIRDefinedType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("ActionDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ACTIONDEFINITION); - if ("Address".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ADDRESS); - if ("Age".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.AGE); - if ("Annotation".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ANNOTATION); - if ("Attachment".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ATTACHMENT); - if ("BackboneElement".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BACKBONEELEMENT); - if ("CodeableConcept".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CODEABLECONCEPT); - if ("Coding".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CODING); - if ("ContactPoint".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CONTACTPOINT); - if ("Count".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.COUNT); - if ("DataRequirement".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DATAREQUIREMENT); - if ("Distance".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DISTANCE); - if ("Duration".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DURATION); - if ("Element".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ELEMENT); - if ("ElementDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ELEMENTDEFINITION); - if ("Extension".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.EXTENSION); - if ("HumanName".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.HUMANNAME); - if ("Identifier".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IDENTIFIER); - if ("Meta".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.META); - if ("ModuleMetadata".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MODULEMETADATA); - if ("Money".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MONEY); - if ("Narrative".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.NARRATIVE); - if ("ParameterDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PARAMETERDEFINITION); - if ("Period".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PERIOD); - if ("Quantity".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.QUANTITY); - if ("Range".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.RANGE); - if ("Ratio".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.RATIO); - if ("Reference".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.REFERENCE); - if ("SampledData".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SAMPLEDDATA); - if ("Signature".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SIGNATURE); - if ("SimpleQuantity".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SIMPLEQUANTITY); - if ("Timing".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.TIMING); - if ("TriggerDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.TRIGGERDEFINITION); - if ("base64Binary".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BASE64BINARY); - if ("boolean".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BOOLEAN); - if ("code".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CODE); - if ("date".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DATE); - if ("dateTime".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DATETIME); - if ("decimal".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DECIMAL); - if ("id".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ID); - if ("instant".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.INSTANT); - if ("integer".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.INTEGER); - if ("markdown".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MARKDOWN); - if ("oid".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.OID); - if ("positiveInt".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.POSITIVEINT); - if ("string".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.STRING); - if ("time".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.TIME); - if ("unsignedInt".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.UNSIGNEDINT); - if ("uri".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.URI); - if ("uuid".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.UUID); - if ("xhtml".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.XHTML); - if ("Account".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ACCOUNT); - if ("AllergyIntolerance".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ALLERGYINTOLERANCE); - if ("Appointment".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.APPOINTMENT); - if ("AppointmentResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.APPOINTMENTRESPONSE); - if ("AuditEvent".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.AUDITEVENT); - if ("Basic".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BASIC); - if ("Binary".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BINARY); - if ("BodySite".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BODYSITE); - if ("Bundle".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.BUNDLE); - if ("CarePlan".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CAREPLAN); - if ("CareTeam".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CARETEAM); - if ("Claim".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CLAIM); - if ("ClaimResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CLAIMRESPONSE); - if ("ClinicalImpression".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CLINICALIMPRESSION); - if ("CodeSystem".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CODESYSTEM); - if ("Communication".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.COMMUNICATION); - if ("CommunicationRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.COMMUNICATIONREQUEST); - if ("CompartmentDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.COMPARTMENTDEFINITION); - if ("Composition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.COMPOSITION); - if ("ConceptMap".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CONCEPTMAP); - if ("Condition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CONDITION); - if ("Conformance".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CONFORMANCE); - if ("Contract".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.CONTRACT); - if ("Coverage".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.COVERAGE); - if ("DataElement".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DATAELEMENT); - if ("DecisionSupportRule".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DECISIONSUPPORTRULE); - if ("DecisionSupportServiceModule".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DECISIONSUPPORTSERVICEMODULE); - if ("DetectedIssue".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DETECTEDISSUE); - if ("Device".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DEVICE); - if ("DeviceComponent".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DEVICECOMPONENT); - if ("DeviceMetric".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DEVICEMETRIC); - if ("DeviceUseRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DEVICEUSEREQUEST); - if ("DeviceUseStatement".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DEVICEUSESTATEMENT); - if ("DiagnosticOrder".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DIAGNOSTICORDER); - if ("DiagnosticReport".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DIAGNOSTICREPORT); - if ("DocumentManifest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DOCUMENTMANIFEST); - if ("DocumentReference".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DOCUMENTREFERENCE); - if ("DomainResource".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.DOMAINRESOURCE); - if ("EligibilityRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ELIGIBILITYREQUEST); - if ("EligibilityResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ELIGIBILITYRESPONSE); - if ("Encounter".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ENCOUNTER); - if ("EnrollmentRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ENROLLMENTREQUEST); - if ("EnrollmentResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ENROLLMENTRESPONSE); - if ("EpisodeOfCare".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.EPISODEOFCARE); - if ("ExpansionProfile".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.EXPANSIONPROFILE); - if ("ExplanationOfBenefit".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.EXPLANATIONOFBENEFIT); - if ("FamilyMemberHistory".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.FAMILYMEMBERHISTORY); - if ("Flag".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.FLAG); - if ("Goal".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.GOAL); - if ("Group".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.GROUP); - if ("GuidanceResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.GUIDANCERESPONSE); - if ("HealthcareService".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.HEALTHCARESERVICE); - if ("ImagingExcerpt".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IMAGINGEXCERPT); - if ("ImagingObjectSelection".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IMAGINGOBJECTSELECTION); - if ("ImagingStudy".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IMAGINGSTUDY); - if ("Immunization".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IMMUNIZATION); - if ("ImmunizationRecommendation".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IMMUNIZATIONRECOMMENDATION); - if ("ImplementationGuide".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.IMPLEMENTATIONGUIDE); - if ("Library".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.LIBRARY); - if ("Linkage".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.LINKAGE); - if ("List".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.LIST); - if ("Location".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.LOCATION); - if ("Measure".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEASURE); - if ("MeasureReport".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEASUREREPORT); - if ("Media".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEDIA); - if ("Medication".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEDICATION); - if ("MedicationAdministration".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEDICATIONADMINISTRATION); - if ("MedicationDispense".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEDICATIONDISPENSE); - if ("MedicationOrder".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEDICATIONORDER); - if ("MedicationStatement".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MEDICATIONSTATEMENT); - if ("MessageHeader".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MESSAGEHEADER); - if ("ModuleDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.MODULEDEFINITION); - if ("NamingSystem".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.NAMINGSYSTEM); - if ("NutritionOrder".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.NUTRITIONORDER); - if ("Observation".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.OBSERVATION); - if ("OperationDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.OPERATIONDEFINITION); - if ("OperationOutcome".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.OPERATIONOUTCOME); - if ("Order".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ORDER); - if ("OrderResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ORDERRESPONSE); - if ("OrderSet".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ORDERSET); - if ("Organization".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.ORGANIZATION); - if ("Parameters".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PARAMETERS); - if ("Patient".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PATIENT); - if ("PaymentNotice".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PAYMENTNOTICE); - if ("PaymentReconciliation".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PAYMENTRECONCILIATION); - if ("Person".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PERSON); - if ("Practitioner".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PRACTITIONER); - if ("PractitionerRole".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PRACTITIONERROLE); - if ("Procedure".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PROCEDURE); - if ("ProcedureRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PROCEDUREREQUEST); - if ("ProcessRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PROCESSREQUEST); - if ("ProcessResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PROCESSRESPONSE); - if ("Protocol".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PROTOCOL); - if ("Provenance".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.PROVENANCE); - if ("Questionnaire".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.QUESTIONNAIRE); - if ("QuestionnaireResponse".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.QUESTIONNAIRERESPONSE); - if ("ReferralRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.REFERRALREQUEST); - if ("RelatedPerson".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.RELATEDPERSON); - if ("Resource".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.RESOURCE); - if ("RiskAssessment".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.RISKASSESSMENT); - if ("Schedule".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SCHEDULE); - if ("SearchParameter".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SEARCHPARAMETER); - if ("Sequence".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SEQUENCE); - if ("Slot".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SLOT); - if ("Specimen".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SPECIMEN); - if ("StructureDefinition".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.STRUCTUREDEFINITION); - if ("StructureMap".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.STRUCTUREMAP); - if ("Subscription".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SUBSCRIPTION); - if ("Substance".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SUBSTANCE); - if ("SupplyDelivery".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SUPPLYDELIVERY); - if ("SupplyRequest".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.SUPPLYREQUEST); - if ("Task".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.TASK); - if ("TestScript".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.TESTSCRIPT); - if ("ValueSet".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.VALUESET); - if ("VisionPrescription".equals(codeString)) - return new Enumeration(this, FHIRDefinedType.VISIONPRESCRIPTION); - throw new FHIRException("Unknown FHIRDefinedType code '"+codeString+"'"); - } - public String toCode(FHIRDefinedType code) { - if (code == FHIRDefinedType.ACTIONDEFINITION) - return "ActionDefinition"; - if (code == FHIRDefinedType.ADDRESS) - return "Address"; - if (code == FHIRDefinedType.AGE) - return "Age"; - if (code == FHIRDefinedType.ANNOTATION) - return "Annotation"; - if (code == FHIRDefinedType.ATTACHMENT) - return "Attachment"; - if (code == FHIRDefinedType.BACKBONEELEMENT) - return "BackboneElement"; - if (code == FHIRDefinedType.CODEABLECONCEPT) - return "CodeableConcept"; - if (code == FHIRDefinedType.CODING) - return "Coding"; - if (code == FHIRDefinedType.CONTACTPOINT) - return "ContactPoint"; - if (code == FHIRDefinedType.COUNT) - return "Count"; - if (code == FHIRDefinedType.DATAREQUIREMENT) - return "DataRequirement"; - if (code == FHIRDefinedType.DISTANCE) - return "Distance"; - if (code == FHIRDefinedType.DURATION) - return "Duration"; - if (code == FHIRDefinedType.ELEMENT) - return "Element"; - if (code == FHIRDefinedType.ELEMENTDEFINITION) - return "ElementDefinition"; - if (code == FHIRDefinedType.EXTENSION) - return "Extension"; - if (code == FHIRDefinedType.HUMANNAME) - return "HumanName"; - if (code == FHIRDefinedType.IDENTIFIER) - return "Identifier"; - if (code == FHIRDefinedType.META) - return "Meta"; - if (code == FHIRDefinedType.MODULEMETADATA) - return "ModuleMetadata"; - if (code == FHIRDefinedType.MONEY) - return "Money"; - if (code == FHIRDefinedType.NARRATIVE) - return "Narrative"; - if (code == FHIRDefinedType.PARAMETERDEFINITION) - return "ParameterDefinition"; - if (code == FHIRDefinedType.PERIOD) - return "Period"; - if (code == FHIRDefinedType.QUANTITY) - return "Quantity"; - if (code == FHIRDefinedType.RANGE) - return "Range"; - if (code == FHIRDefinedType.RATIO) - return "Ratio"; - if (code == FHIRDefinedType.REFERENCE) - return "Reference"; - if (code == FHIRDefinedType.SAMPLEDDATA) - return "SampledData"; - if (code == FHIRDefinedType.SIGNATURE) - return "Signature"; - if (code == FHIRDefinedType.SIMPLEQUANTITY) - return "SimpleQuantity"; - if (code == FHIRDefinedType.TIMING) - return "Timing"; - if (code == FHIRDefinedType.TRIGGERDEFINITION) - return "TriggerDefinition"; - if (code == FHIRDefinedType.BASE64BINARY) - return "base64Binary"; - if (code == FHIRDefinedType.BOOLEAN) - return "boolean"; - if (code == FHIRDefinedType.CODE) - return "code"; - if (code == FHIRDefinedType.DATE) - return "date"; - if (code == FHIRDefinedType.DATETIME) - return "dateTime"; - if (code == FHIRDefinedType.DECIMAL) - return "decimal"; - if (code == FHIRDefinedType.ID) - return "id"; - if (code == FHIRDefinedType.INSTANT) - return "instant"; - if (code == FHIRDefinedType.INTEGER) - return "integer"; - if (code == FHIRDefinedType.MARKDOWN) - return "markdown"; - if (code == FHIRDefinedType.OID) - return "oid"; - if (code == FHIRDefinedType.POSITIVEINT) - return "positiveInt"; - if (code == FHIRDefinedType.STRING) - return "string"; - if (code == FHIRDefinedType.TIME) - return "time"; - if (code == FHIRDefinedType.UNSIGNEDINT) - return "unsignedInt"; - if (code == FHIRDefinedType.URI) - return "uri"; - if (code == FHIRDefinedType.UUID) - return "uuid"; - if (code == FHIRDefinedType.XHTML) - return "xhtml"; - if (code == FHIRDefinedType.ACCOUNT) - return "Account"; - if (code == FHIRDefinedType.ALLERGYINTOLERANCE) - return "AllergyIntolerance"; - if (code == FHIRDefinedType.APPOINTMENT) - return "Appointment"; - if (code == FHIRDefinedType.APPOINTMENTRESPONSE) - return "AppointmentResponse"; - if (code == FHIRDefinedType.AUDITEVENT) - return "AuditEvent"; - if (code == FHIRDefinedType.BASIC) - return "Basic"; - if (code == FHIRDefinedType.BINARY) - return "Binary"; - if (code == FHIRDefinedType.BODYSITE) - return "BodySite"; - if (code == FHIRDefinedType.BUNDLE) - return "Bundle"; - if (code == FHIRDefinedType.CAREPLAN) - return "CarePlan"; - if (code == FHIRDefinedType.CARETEAM) - return "CareTeam"; - if (code == FHIRDefinedType.CLAIM) - return "Claim"; - if (code == FHIRDefinedType.CLAIMRESPONSE) - return "ClaimResponse"; - if (code == FHIRDefinedType.CLINICALIMPRESSION) - return "ClinicalImpression"; - if (code == FHIRDefinedType.CODESYSTEM) - return "CodeSystem"; - if (code == FHIRDefinedType.COMMUNICATION) - return "Communication"; - if (code == FHIRDefinedType.COMMUNICATIONREQUEST) - return "CommunicationRequest"; - if (code == FHIRDefinedType.COMPARTMENTDEFINITION) - return "CompartmentDefinition"; - if (code == FHIRDefinedType.COMPOSITION) - return "Composition"; - if (code == FHIRDefinedType.CONCEPTMAP) - return "ConceptMap"; - if (code == FHIRDefinedType.CONDITION) - return "Condition"; - if (code == FHIRDefinedType.CONFORMANCE) - return "Conformance"; - if (code == FHIRDefinedType.CONTRACT) - return "Contract"; - if (code == FHIRDefinedType.COVERAGE) - return "Coverage"; - if (code == FHIRDefinedType.DATAELEMENT) - return "DataElement"; - if (code == FHIRDefinedType.DECISIONSUPPORTRULE) - return "DecisionSupportRule"; - if (code == FHIRDefinedType.DECISIONSUPPORTSERVICEMODULE) - return "DecisionSupportServiceModule"; - if (code == FHIRDefinedType.DETECTEDISSUE) - return "DetectedIssue"; - if (code == FHIRDefinedType.DEVICE) - return "Device"; - if (code == FHIRDefinedType.DEVICECOMPONENT) - return "DeviceComponent"; - if (code == FHIRDefinedType.DEVICEMETRIC) - return "DeviceMetric"; - if (code == FHIRDefinedType.DEVICEUSEREQUEST) - return "DeviceUseRequest"; - if (code == FHIRDefinedType.DEVICEUSESTATEMENT) - return "DeviceUseStatement"; - if (code == FHIRDefinedType.DIAGNOSTICORDER) - return "DiagnosticOrder"; - if (code == FHIRDefinedType.DIAGNOSTICREPORT) - return "DiagnosticReport"; - if (code == FHIRDefinedType.DOCUMENTMANIFEST) - return "DocumentManifest"; - if (code == FHIRDefinedType.DOCUMENTREFERENCE) - return "DocumentReference"; - if (code == FHIRDefinedType.DOMAINRESOURCE) - return "DomainResource"; - if (code == FHIRDefinedType.ELIGIBILITYREQUEST) - return "EligibilityRequest"; - if (code == FHIRDefinedType.ELIGIBILITYRESPONSE) - return "EligibilityResponse"; - if (code == FHIRDefinedType.ENCOUNTER) - return "Encounter"; - if (code == FHIRDefinedType.ENROLLMENTREQUEST) - return "EnrollmentRequest"; - if (code == FHIRDefinedType.ENROLLMENTRESPONSE) - return "EnrollmentResponse"; - if (code == FHIRDefinedType.EPISODEOFCARE) - return "EpisodeOfCare"; - if (code == FHIRDefinedType.EXPANSIONPROFILE) - return "ExpansionProfile"; - if (code == FHIRDefinedType.EXPLANATIONOFBENEFIT) - return "ExplanationOfBenefit"; - if (code == FHIRDefinedType.FAMILYMEMBERHISTORY) - return "FamilyMemberHistory"; - if (code == FHIRDefinedType.FLAG) - return "Flag"; - if (code == FHIRDefinedType.GOAL) - return "Goal"; - if (code == FHIRDefinedType.GROUP) - return "Group"; - if (code == FHIRDefinedType.GUIDANCERESPONSE) - return "GuidanceResponse"; - if (code == FHIRDefinedType.HEALTHCARESERVICE) - return "HealthcareService"; - if (code == FHIRDefinedType.IMAGINGEXCERPT) - return "ImagingExcerpt"; - if (code == FHIRDefinedType.IMAGINGOBJECTSELECTION) - return "ImagingObjectSelection"; - if (code == FHIRDefinedType.IMAGINGSTUDY) - return "ImagingStudy"; - if (code == FHIRDefinedType.IMMUNIZATION) - return "Immunization"; - if (code == FHIRDefinedType.IMMUNIZATIONRECOMMENDATION) - return "ImmunizationRecommendation"; - if (code == FHIRDefinedType.IMPLEMENTATIONGUIDE) - return "ImplementationGuide"; - if (code == FHIRDefinedType.LIBRARY) - return "Library"; - if (code == FHIRDefinedType.LINKAGE) - return "Linkage"; - if (code == FHIRDefinedType.LIST) - return "List"; - if (code == FHIRDefinedType.LOCATION) - return "Location"; - if (code == FHIRDefinedType.MEASURE) - return "Measure"; - if (code == FHIRDefinedType.MEASUREREPORT) - return "MeasureReport"; - if (code == FHIRDefinedType.MEDIA) - return "Media"; - if (code == FHIRDefinedType.MEDICATION) - return "Medication"; - if (code == FHIRDefinedType.MEDICATIONADMINISTRATION) - return "MedicationAdministration"; - if (code == FHIRDefinedType.MEDICATIONDISPENSE) - return "MedicationDispense"; - if (code == FHIRDefinedType.MEDICATIONORDER) - return "MedicationOrder"; - if (code == FHIRDefinedType.MEDICATIONSTATEMENT) - return "MedicationStatement"; - if (code == FHIRDefinedType.MESSAGEHEADER) - return "MessageHeader"; - if (code == FHIRDefinedType.MODULEDEFINITION) - return "ModuleDefinition"; - if (code == FHIRDefinedType.NAMINGSYSTEM) - return "NamingSystem"; - if (code == FHIRDefinedType.NUTRITIONORDER) - return "NutritionOrder"; - if (code == FHIRDefinedType.OBSERVATION) - return "Observation"; - if (code == FHIRDefinedType.OPERATIONDEFINITION) - return "OperationDefinition"; - if (code == FHIRDefinedType.OPERATIONOUTCOME) - return "OperationOutcome"; - if (code == FHIRDefinedType.ORDER) - return "Order"; - if (code == FHIRDefinedType.ORDERRESPONSE) - return "OrderResponse"; - if (code == FHIRDefinedType.ORDERSET) - return "OrderSet"; - if (code == FHIRDefinedType.ORGANIZATION) - return "Organization"; - if (code == FHIRDefinedType.PARAMETERS) - return "Parameters"; - if (code == FHIRDefinedType.PATIENT) - return "Patient"; - if (code == FHIRDefinedType.PAYMENTNOTICE) - return "PaymentNotice"; - if (code == FHIRDefinedType.PAYMENTRECONCILIATION) - return "PaymentReconciliation"; - if (code == FHIRDefinedType.PERSON) - return "Person"; - if (code == FHIRDefinedType.PRACTITIONER) - return "Practitioner"; - if (code == FHIRDefinedType.PRACTITIONERROLE) - return "PractitionerRole"; - if (code == FHIRDefinedType.PROCEDURE) - return "Procedure"; - if (code == FHIRDefinedType.PROCEDUREREQUEST) - return "ProcedureRequest"; - if (code == FHIRDefinedType.PROCESSREQUEST) - return "ProcessRequest"; - if (code == FHIRDefinedType.PROCESSRESPONSE) - return "ProcessResponse"; - if (code == FHIRDefinedType.PROTOCOL) - return "Protocol"; - if (code == FHIRDefinedType.PROVENANCE) - return "Provenance"; - if (code == FHIRDefinedType.QUESTIONNAIRE) - return "Questionnaire"; - if (code == FHIRDefinedType.QUESTIONNAIRERESPONSE) - return "QuestionnaireResponse"; - if (code == FHIRDefinedType.REFERRALREQUEST) - return "ReferralRequest"; - if (code == FHIRDefinedType.RELATEDPERSON) - return "RelatedPerson"; - if (code == FHIRDefinedType.RESOURCE) - return "Resource"; - if (code == FHIRDefinedType.RISKASSESSMENT) - return "RiskAssessment"; - if (code == FHIRDefinedType.SCHEDULE) - return "Schedule"; - if (code == FHIRDefinedType.SEARCHPARAMETER) - return "SearchParameter"; - if (code == FHIRDefinedType.SEQUENCE) - return "Sequence"; - if (code == FHIRDefinedType.SLOT) - return "Slot"; - if (code == FHIRDefinedType.SPECIMEN) - return "Specimen"; - if (code == FHIRDefinedType.STRUCTUREDEFINITION) - return "StructureDefinition"; - if (code == FHIRDefinedType.STRUCTUREMAP) - return "StructureMap"; - if (code == FHIRDefinedType.SUBSCRIPTION) - return "Subscription"; - if (code == FHIRDefinedType.SUBSTANCE) - return "Substance"; - if (code == FHIRDefinedType.SUPPLYDELIVERY) - return "SupplyDelivery"; - if (code == FHIRDefinedType.SUPPLYREQUEST) - return "SupplyRequest"; - if (code == FHIRDefinedType.TASK) - return "Task"; - if (code == FHIRDefinedType.TESTSCRIPT) - return "TestScript"; - if (code == FHIRDefinedType.VALUESET) - return "ValueSet"; - if (code == FHIRDefinedType.VISIONPRESCRIPTION) - return "VisionPrescription"; - return "?"; - } - public String toSystem(FHIRDefinedType code) { - return code.getSystem(); - } - } - - public enum MessageEvent { - /** - * The definition of a code system is used to create a simple collection of codes suitable for use for data entry or validation. An expanded code system will be returned, or an error message. - */ - CODESYSTEMEXPAND, - /** - * Change the status of a Medication Administration to show that it is complete. - */ - MEDICATIONADMINISTRATIONCOMPLETE, - /** - * Someone wishes to record that the record of administration of a medication is in error and should be ignored. - */ - MEDICATIONADMINISTRATIONNULLIFICATION, - /** - * Indicates that a medication has been recorded against the patient's record. - */ - MEDICATIONADMINISTRATIONRECORDING, - /** - * Update a Medication Administration record. - */ - MEDICATIONADMINISTRATIONUPDATE, - /** - * Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use. - */ - ADMINNOTIFY, - /** - * Provide a diagnostic report, or update a previously provided diagnostic report. - */ - DIAGNOSTICREPORTPROVIDE, - /** - * Provide a simple observation or update a previously provided simple observation. - */ - OBSERVATIONPROVIDE, - /** - * Notification that two patient records actually identify the same patient. - */ - PATIENTLINK, - /** - * Notification that previous advice that two patient records concern the same patient is now considered incorrect. - */ - PATIENTUNLINK, - /** - * The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message. - */ - VALUESETEXPAND, - /** - * added to help the parsers - */ - NULL; - public static MessageEvent fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("CodeSystem-expand".equals(codeString)) - return CODESYSTEMEXPAND; - if ("MedicationAdministration-Complete".equals(codeString)) - return MEDICATIONADMINISTRATIONCOMPLETE; - if ("MedicationAdministration-Nullification".equals(codeString)) - return MEDICATIONADMINISTRATIONNULLIFICATION; - if ("MedicationAdministration-Recording".equals(codeString)) - return MEDICATIONADMINISTRATIONRECORDING; - if ("MedicationAdministration-Update".equals(codeString)) - return MEDICATIONADMINISTRATIONUPDATE; - if ("admin-notify".equals(codeString)) - return ADMINNOTIFY; - if ("diagnosticreport-provide".equals(codeString)) - return DIAGNOSTICREPORTPROVIDE; - if ("observation-provide".equals(codeString)) - return OBSERVATIONPROVIDE; - if ("patient-link".equals(codeString)) - return PATIENTLINK; - if ("patient-unlink".equals(codeString)) - return PATIENTUNLINK; - if ("valueset-expand".equals(codeString)) - return VALUESETEXPAND; - throw new FHIRException("Unknown MessageEvent code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CODESYSTEMEXPAND: return "CodeSystem-expand"; - case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete"; - case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification"; - case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording"; - case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update"; - case ADMINNOTIFY: return "admin-notify"; - case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide"; - case OBSERVATIONPROVIDE: return "observation-provide"; - case PATIENTLINK: return "patient-link"; - case PATIENTUNLINK: return "patient-unlink"; - case VALUESETEXPAND: return "valueset-expand"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CODESYSTEMEXPAND: return "http://hl7.org/fhir/message-events"; - case MEDICATIONADMINISTRATIONCOMPLETE: return "http://hl7.org/fhir/message-events"; - case MEDICATIONADMINISTRATIONNULLIFICATION: return "http://hl7.org/fhir/message-events"; - case MEDICATIONADMINISTRATIONRECORDING: return "http://hl7.org/fhir/message-events"; - case MEDICATIONADMINISTRATIONUPDATE: return "http://hl7.org/fhir/message-events"; - case ADMINNOTIFY: return "http://hl7.org/fhir/message-events"; - case DIAGNOSTICREPORTPROVIDE: return "http://hl7.org/fhir/message-events"; - case OBSERVATIONPROVIDE: return "http://hl7.org/fhir/message-events"; - case PATIENTLINK: return "http://hl7.org/fhir/message-events"; - case PATIENTUNLINK: return "http://hl7.org/fhir/message-events"; - case VALUESETEXPAND: return "http://hl7.org/fhir/message-events"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CODESYSTEMEXPAND: return "The definition of a code system is used to create a simple collection of codes suitable for use for data entry or validation. An expanded code system will be returned, or an error message."; - case MEDICATIONADMINISTRATIONCOMPLETE: return "Change the status of a Medication Administration to show that it is complete."; - case MEDICATIONADMINISTRATIONNULLIFICATION: return "Someone wishes to record that the record of administration of a medication is in error and should be ignored."; - case MEDICATIONADMINISTRATIONRECORDING: return "Indicates that a medication has been recorded against the patient's record."; - case MEDICATIONADMINISTRATIONUPDATE: return "Update a Medication Administration record."; - case ADMINNOTIFY: return "Notification of a change to an administrative resource (either create or update). Note that there is no delete, though some administrative resources have status or period elements for this use."; - case DIAGNOSTICREPORTPROVIDE: return "Provide a diagnostic report, or update a previously provided diagnostic report."; - case OBSERVATIONPROVIDE: return "Provide a simple observation or update a previously provided simple observation."; - case PATIENTLINK: return "Notification that two patient records actually identify the same patient."; - case PATIENTUNLINK: return "Notification that previous advice that two patient records concern the same patient is now considered incorrect."; - case VALUESETEXPAND: return "The definition of a value set is used to create a simple collection of codes suitable for use for data entry or validation. An expanded value set will be returned, or an error message."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CODESYSTEMEXPAND: return "CodeSystem-expand"; - case MEDICATIONADMINISTRATIONCOMPLETE: return "MedicationAdministration-Complete"; - case MEDICATIONADMINISTRATIONNULLIFICATION: return "MedicationAdministration-Nullification"; - case MEDICATIONADMINISTRATIONRECORDING: return "MedicationAdministration-Recording"; - case MEDICATIONADMINISTRATIONUPDATE: return "MedicationAdministration-Update"; - case ADMINNOTIFY: return "admin-notify"; - case DIAGNOSTICREPORTPROVIDE: return "diagnosticreport-provide"; - case OBSERVATIONPROVIDE: return "observation-provide"; - case PATIENTLINK: return "patient-link"; - case PATIENTUNLINK: return "patient-unlink"; - case VALUESETEXPAND: return "valueset-expand"; - default: return "?"; - } - } - } - - public static class MessageEventEnumFactory implements EnumFactory { - public MessageEvent fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("CodeSystem-expand".equals(codeString)) - return MessageEvent.CODESYSTEMEXPAND; - if ("MedicationAdministration-Complete".equals(codeString)) - return MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE; - if ("MedicationAdministration-Nullification".equals(codeString)) - return MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION; - if ("MedicationAdministration-Recording".equals(codeString)) - return MessageEvent.MEDICATIONADMINISTRATIONRECORDING; - if ("MedicationAdministration-Update".equals(codeString)) - return MessageEvent.MEDICATIONADMINISTRATIONUPDATE; - if ("admin-notify".equals(codeString)) - return MessageEvent.ADMINNOTIFY; - if ("diagnosticreport-provide".equals(codeString)) - return MessageEvent.DIAGNOSTICREPORTPROVIDE; - if ("observation-provide".equals(codeString)) - return MessageEvent.OBSERVATIONPROVIDE; - if ("patient-link".equals(codeString)) - return MessageEvent.PATIENTLINK; - if ("patient-unlink".equals(codeString)) - return MessageEvent.PATIENTUNLINK; - if ("valueset-expand".equals(codeString)) - return MessageEvent.VALUESETEXPAND; - throw new IllegalArgumentException("Unknown MessageEvent code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("CodeSystem-expand".equals(codeString)) - return new Enumeration(this, MessageEvent.CODESYSTEMEXPAND); - if ("MedicationAdministration-Complete".equals(codeString)) - return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE); - if ("MedicationAdministration-Nullification".equals(codeString)) - return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION); - if ("MedicationAdministration-Recording".equals(codeString)) - return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONRECORDING); - if ("MedicationAdministration-Update".equals(codeString)) - return new Enumeration(this, MessageEvent.MEDICATIONADMINISTRATIONUPDATE); - if ("admin-notify".equals(codeString)) - return new Enumeration(this, MessageEvent.ADMINNOTIFY); - if ("diagnosticreport-provide".equals(codeString)) - return new Enumeration(this, MessageEvent.DIAGNOSTICREPORTPROVIDE); - if ("observation-provide".equals(codeString)) - return new Enumeration(this, MessageEvent.OBSERVATIONPROVIDE); - if ("patient-link".equals(codeString)) - return new Enumeration(this, MessageEvent.PATIENTLINK); - if ("patient-unlink".equals(codeString)) - return new Enumeration(this, MessageEvent.PATIENTUNLINK); - if ("valueset-expand".equals(codeString)) - return new Enumeration(this, MessageEvent.VALUESETEXPAND); - throw new FHIRException("Unknown MessageEvent code '"+codeString+"'"); - } - public String toCode(MessageEvent code) { - if (code == MessageEvent.CODESYSTEMEXPAND) - return "CodeSystem-expand"; - if (code == MessageEvent.MEDICATIONADMINISTRATIONCOMPLETE) - return "MedicationAdministration-Complete"; - if (code == MessageEvent.MEDICATIONADMINISTRATIONNULLIFICATION) - return "MedicationAdministration-Nullification"; - if (code == MessageEvent.MEDICATIONADMINISTRATIONRECORDING) - return "MedicationAdministration-Recording"; - if (code == MessageEvent.MEDICATIONADMINISTRATIONUPDATE) - return "MedicationAdministration-Update"; - if (code == MessageEvent.ADMINNOTIFY) - return "admin-notify"; - if (code == MessageEvent.DIAGNOSTICREPORTPROVIDE) - return "diagnosticreport-provide"; - if (code == MessageEvent.OBSERVATIONPROVIDE) - return "observation-provide"; - if (code == MessageEvent.PATIENTLINK) - return "patient-link"; - if (code == MessageEvent.PATIENTUNLINK) - return "patient-unlink"; - if (code == MessageEvent.VALUESETEXPAND) - return "valueset-expand"; - return "?"; - } - public String toSystem(MessageEvent code) { - return code.getSystem(); - } - } - - public enum NoteType { - /** - * Display the note. - */ - DISPLAY, - /** - * Print the note on the form. - */ - PRINT, - /** - * Print the note for the operator. - */ - PRINTOPER, - /** - * added to help the parsers - */ - NULL; - public static NoteType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("display".equals(codeString)) - return DISPLAY; - if ("print".equals(codeString)) - return PRINT; - if ("printoper".equals(codeString)) - return PRINTOPER; - throw new FHIRException("Unknown NoteType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DISPLAY: return "display"; - case PRINT: return "print"; - case PRINTOPER: return "printoper"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DISPLAY: return "http://hl7.org/fhir/note-type"; - case PRINT: return "http://hl7.org/fhir/note-type"; - case PRINTOPER: return "http://hl7.org/fhir/note-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DISPLAY: return "Display the note."; - case PRINT: return "Print the note on the form."; - case PRINTOPER: return "Print the note for the operator."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DISPLAY: return "Display"; - case PRINT: return "Print (Form)"; - case PRINTOPER: return "Print (Operator)"; - default: return "?"; - } - } - } - - public static class NoteTypeEnumFactory implements EnumFactory { - public NoteType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("display".equals(codeString)) - return NoteType.DISPLAY; - if ("print".equals(codeString)) - return NoteType.PRINT; - if ("printoper".equals(codeString)) - return NoteType.PRINTOPER; - throw new IllegalArgumentException("Unknown NoteType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("display".equals(codeString)) - return new Enumeration(this, NoteType.DISPLAY); - if ("print".equals(codeString)) - return new Enumeration(this, NoteType.PRINT); - if ("printoper".equals(codeString)) - return new Enumeration(this, NoteType.PRINTOPER); - throw new FHIRException("Unknown NoteType code '"+codeString+"'"); - } - public String toCode(NoteType code) { - if (code == NoteType.DISPLAY) - return "display"; - if (code == NoteType.PRINT) - return "print"; - if (code == NoteType.PRINTOPER) - return "printoper"; - return "?"; - } - public String toSystem(NoteType code) { - return code.getSystem(); - } - } - - public enum RemittanceOutcome { - /** - * The processing completed without errors. - */ - COMPLETE, - /** - * The processing identified errors. - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static RemittanceOutcome fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("error".equals(codeString)) - return ERROR; - throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return "http://hl7.org/fhir/remittance-outcome"; - case ERROR: return "http://hl7.org/fhir/remittance-outcome"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The processing completed without errors."; - case ERROR: return "The processing identified errors."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class RemittanceOutcomeEnumFactory implements EnumFactory { - public RemittanceOutcome fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return RemittanceOutcome.COMPLETE; - if ("error".equals(codeString)) - return RemittanceOutcome.ERROR; - throw new IllegalArgumentException("Unknown RemittanceOutcome code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return new Enumeration(this, RemittanceOutcome.COMPLETE); - if ("error".equals(codeString)) - return new Enumeration(this, RemittanceOutcome.ERROR); - throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'"); - } - public String toCode(RemittanceOutcome code) { - if (code == RemittanceOutcome.COMPLETE) - return "complete"; - if (code == RemittanceOutcome.ERROR) - return "error"; - return "?"; - } - public String toSystem(RemittanceOutcome code) { - return code.getSystem(); - } - } - - public enum ResourceType { - /** - * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc. - */ - ACCOUNT, - /** - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance. - */ - ALLERGYINTOLERANCE, - /** - * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s). - */ - APPOINTMENT, - /** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ - APPOINTMENTRESPONSE, - /** - * 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. - */ - AUDITEVENT, - /** - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ - BASIC, - /** - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ - BINARY, - /** - * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case. - */ - BODYSITE, - /** - * A container for a collection of resources. - */ - BUNDLE, - /** - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions. - */ - CAREPLAN, - /** - * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient. - */ - CARETEAM, - /** - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery. - */ - CLAIM, - /** - * This resource provides the adjudication details from the processing of a Claim resource. - */ - CLAIMRESPONSE, - /** - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as Apgar score. - */ - CLINICALIMPRESSION, - /** - * A code system resource specifies a set of codes drawn from one or more code systems. - */ - CODESYSTEM, - /** - * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition. - */ - COMMUNICATION, - /** - * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition. - */ - COMMUNICATIONREQUEST, - /** - * A compartment definition that defines how resources are accessed on a server. - */ - COMPARTMENTDEFINITION, - /** - * 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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained. - */ - COMPOSITION, - /** - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models. - */ - CONCEPTMAP, - /** - * 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. - */ - CONDITION, - /** - * A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation. - */ - CONFORMANCE, - /** - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ - CONTRACT, - /** - * Financial instrument which may be used to pay for or reimburse health care products and services. - */ - COVERAGE, - /** - * The formal description of a single piece of information that can be gathered and reported. - */ - DATAELEMENT, - /** - * This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events. - */ - DECISIONSUPPORTRULE, - /** - * The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking. - */ - DECISIONSUPPORTSERVICEMODULE, - /** - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ - DETECTEDISSUE, - /** - * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc. - */ - DEVICE, - /** - * Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. - */ - DEVICECOMPONENT, - /** - * Describes a measurement, calculation or setting capability of a medical device. - */ - DEVICEMETRIC, - /** - * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker. - */ - DEVICEUSEREQUEST, - /** - * A record of a device being used by a patient where the record is the result of a report from the patient or another clinician. - */ - DEVICEUSESTATEMENT, - /** - * A record of a request for a diagnostic investigation service to be performed. - */ - DIAGNOSTICORDER, - /** - * 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 interpretations, and formatted representation of diagnostic reports. - */ - DIAGNOSTICREPORT, - /** - * A manifest that defines a set of documents. - */ - DOCUMENTMANIFEST, - /** - * A reference to a document . - */ - DOCUMENTREFERENCE, - /** - * A resource that includes narrative, extensions, and contained resources. - */ - DOMAINRESOURCE, - /** - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service. - */ - ELIGIBILITYREQUEST, - /** - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ - ELIGIBILITYRESPONSE, - /** - * 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. - */ - ENCOUNTER, - /** - * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. - */ - ENROLLMENTREQUEST, - /** - * This resource provides enrollment and plan details from the processing of an Enrollment resource. - */ - ENROLLMENTRESPONSE, - /** - * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. - */ - EPISODEOFCARE, - /** - * Resource to define constraints on the Expansion of a FHIR ValueSet. - */ - EXPANSIONPROFILE, - /** - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - */ - EXPLANATIONOFBENEFIT, - /** - * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. - */ - FAMILYMEMBERHISTORY, - /** - * Prospective warnings of potential issues when providing care to the patient. - */ - FLAG, - /** - * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. - */ - GOAL, - /** - * 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. - */ - GROUP, - /** - * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. - */ - GUIDANCERESPONSE, - /** - * The details of a healthcare service available at a location. - */ - HEALTHCARESERVICE, - /** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ - IMAGINGEXCERPT, - /** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ - IMAGINGOBJECTSELECTION, - /** - * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. - */ - IMAGINGSTUDY, - /** - * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. - */ - IMMUNIZATION, - /** - * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. - */ - IMMUNIZATIONRECOMMENDATION, - /** - * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. - */ - IMPLEMENTATIONGUIDE, - /** - * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. - */ - LIBRARY, - /** - * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". - */ - LINKAGE, - /** - * A set of information summarized from a list of other resources. - */ - LIST, - /** - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. - */ - LOCATION, - /** - * The Measure resource provides the definition of a quality measure. - */ - MEASURE, - /** - * The MeasureReport resource contains the results of evaluating a measure. - */ - MEASUREREPORT, - /** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. - */ - MEDIA, - /** - * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. - */ - MEDICATION, - /** - * Describes the event of a patient consuming or otherwise being administered 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. - */ - MEDICATIONADMINISTRATION, - /** - * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. - */ - MEDICATIONDISPENSE, - /** - * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. - */ - MEDICATIONORDER, - /** - * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. - */ - MEDICATIONSTATEMENT, - /** - * The header for a message exchange that is either requesting or responding to an action. The reference(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. - */ - MESSAGEHEADER, - /** - * The ModuleDefinition resource defines the data requirements for a quality artifact. - */ - MODULEDEFINITION, - /** - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ - NAMINGSYSTEM, - /** - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ - NUTRITIONORDER, - /** - * Measurements and simple assertions made about a patient, device or other subject. - */ - OBSERVATION, - /** - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). - */ - OPERATIONDEFINITION, - /** - * A collection of error, warning or information messages that result from a system action. - */ - OPERATIONOUTCOME, - /** - * A request to perform an action. - */ - ORDER, - /** - * A response to an order. - */ - ORDERRESPONSE, - /** - * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. - */ - ORDERSET, - /** - * 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. - */ - ORGANIZATION, - /** - * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. - */ - PARAMETERS, - /** - * Demographics and other administrative information about an individual or animal receiving care or other health-related services. - */ - PATIENT, - /** - * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. - */ - PAYMENTNOTICE, - /** - * This resource provides payment details and claim references supporting a bulk payment. - */ - PAYMENTRECONCILIATION, - /** - * Demographics and administrative information about a person independent of a specific health-related context. - */ - PERSON, - /** - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ - PRACTITIONER, - /** - * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. - */ - PRACTITIONERROLE, - /** - * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. - */ - PROCEDURE, - /** - * A request for a procedure to be performed. May be a proposal or an order. - */ - PROCEDUREREQUEST, - /** - * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. - */ - PROCESSREQUEST, - /** - * This resource provides processing status, errors and notes from the processing of a resource. - */ - PROCESSRESPONSE, - /** - * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. - */ - PROTOCOL, - /** - * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. - */ - PROVENANCE, - /** - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ - QUESTIONNAIRE, - /** - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ - QUESTIONNAIRERESPONSE, - /** - * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. - */ - REFERRALREQUEST, - /** - * 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. - */ - RELATEDPERSON, - /** - * This is the base resource type for everything. - */ - RESOURCE, - /** - * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ - RISKASSESSMENT, - /** - * A container for slot(s) of time that may be available for booking appointments. - */ - SCHEDULE, - /** - * A search parameter that defines a named search item that can be used to search/filter on a resource. - */ - SEARCHPARAMETER, - /** - * Variation and Sequence data. - */ - SEQUENCE, - /** - * A slot of time on a schedule that may be available for booking appointments. - */ - SLOT, - /** - * A sample to be used for analysis. - */ - SPECIMEN, - /** - * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. - */ - STRUCTUREDEFINITION, - /** - * A Map of relationships between 2 structures that can be used to transform data. - */ - STRUCTUREMAP, - /** - * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. - */ - SUBSCRIPTION, - /** - * A homogeneous material with a definite composition. - */ - SUBSTANCE, - /** - * Record of delivery of what is supplied. - */ - SUPPLYDELIVERY, - /** - * A record of a request for a medication, substance or device used in the healthcare setting. - */ - SUPPLYREQUEST, - /** - * A task to be performed. - */ - TASK, - /** - * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. - */ - TESTSCRIPT, - /** - * A value set specifies a set of codes drawn from one or more code systems. - */ - VALUESET, - /** - * An authorization for the supply of glasses and/or contact lenses to a patient. - */ - VISIONPRESCRIPTION, - /** - * added to help the parsers - */ - NULL; - public static ResourceType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("Account".equals(codeString)) - return ACCOUNT; - if ("AllergyIntolerance".equals(codeString)) - return ALLERGYINTOLERANCE; - if ("Appointment".equals(codeString)) - return APPOINTMENT; - if ("AppointmentResponse".equals(codeString)) - return APPOINTMENTRESPONSE; - if ("AuditEvent".equals(codeString)) - return AUDITEVENT; - if ("Basic".equals(codeString)) - return BASIC; - if ("Binary".equals(codeString)) - return BINARY; - if ("BodySite".equals(codeString)) - return BODYSITE; - if ("Bundle".equals(codeString)) - return BUNDLE; - if ("CarePlan".equals(codeString)) - return CAREPLAN; - if ("CareTeam".equals(codeString)) - return CARETEAM; - if ("Claim".equals(codeString)) - return CLAIM; - if ("ClaimResponse".equals(codeString)) - return CLAIMRESPONSE; - if ("ClinicalImpression".equals(codeString)) - return CLINICALIMPRESSION; - if ("CodeSystem".equals(codeString)) - return CODESYSTEM; - if ("Communication".equals(codeString)) - return COMMUNICATION; - if ("CommunicationRequest".equals(codeString)) - return COMMUNICATIONREQUEST; - if ("CompartmentDefinition".equals(codeString)) - return COMPARTMENTDEFINITION; - if ("Composition".equals(codeString)) - return COMPOSITION; - if ("ConceptMap".equals(codeString)) - return CONCEPTMAP; - if ("Condition".equals(codeString)) - return CONDITION; - if ("Conformance".equals(codeString)) - return CONFORMANCE; - if ("Contract".equals(codeString)) - return CONTRACT; - if ("Coverage".equals(codeString)) - return COVERAGE; - if ("DataElement".equals(codeString)) - return DATAELEMENT; - if ("DecisionSupportRule".equals(codeString)) - return DECISIONSUPPORTRULE; - if ("DecisionSupportServiceModule".equals(codeString)) - return DECISIONSUPPORTSERVICEMODULE; - if ("DetectedIssue".equals(codeString)) - return DETECTEDISSUE; - if ("Device".equals(codeString)) - return DEVICE; - if ("DeviceComponent".equals(codeString)) - return DEVICECOMPONENT; - if ("DeviceMetric".equals(codeString)) - return DEVICEMETRIC; - if ("DeviceUseRequest".equals(codeString)) - return DEVICEUSEREQUEST; - if ("DeviceUseStatement".equals(codeString)) - return DEVICEUSESTATEMENT; - if ("DiagnosticOrder".equals(codeString)) - return DIAGNOSTICORDER; - if ("DiagnosticReport".equals(codeString)) - return DIAGNOSTICREPORT; - if ("DocumentManifest".equals(codeString)) - return DOCUMENTMANIFEST; - if ("DocumentReference".equals(codeString)) - return DOCUMENTREFERENCE; - if ("DomainResource".equals(codeString)) - return DOMAINRESOURCE; - if ("EligibilityRequest".equals(codeString)) - return ELIGIBILITYREQUEST; - if ("EligibilityResponse".equals(codeString)) - return ELIGIBILITYRESPONSE; - if ("Encounter".equals(codeString)) - return ENCOUNTER; - if ("EnrollmentRequest".equals(codeString)) - return ENROLLMENTREQUEST; - if ("EnrollmentResponse".equals(codeString)) - return ENROLLMENTRESPONSE; - if ("EpisodeOfCare".equals(codeString)) - return EPISODEOFCARE; - if ("ExpansionProfile".equals(codeString)) - return EXPANSIONPROFILE; - if ("ExplanationOfBenefit".equals(codeString)) - return EXPLANATIONOFBENEFIT; - if ("FamilyMemberHistory".equals(codeString)) - return FAMILYMEMBERHISTORY; - if ("Flag".equals(codeString)) - return FLAG; - if ("Goal".equals(codeString)) - return GOAL; - if ("Group".equals(codeString)) - return GROUP; - if ("GuidanceResponse".equals(codeString)) - return GUIDANCERESPONSE; - if ("HealthcareService".equals(codeString)) - return HEALTHCARESERVICE; - if ("ImagingExcerpt".equals(codeString)) - return IMAGINGEXCERPT; - if ("ImagingObjectSelection".equals(codeString)) - return IMAGINGOBJECTSELECTION; - if ("ImagingStudy".equals(codeString)) - return IMAGINGSTUDY; - if ("Immunization".equals(codeString)) - return IMMUNIZATION; - if ("ImmunizationRecommendation".equals(codeString)) - return IMMUNIZATIONRECOMMENDATION; - if ("ImplementationGuide".equals(codeString)) - return IMPLEMENTATIONGUIDE; - if ("Library".equals(codeString)) - return LIBRARY; - if ("Linkage".equals(codeString)) - return LINKAGE; - if ("List".equals(codeString)) - return LIST; - if ("Location".equals(codeString)) - return LOCATION; - if ("Measure".equals(codeString)) - return MEASURE; - if ("MeasureReport".equals(codeString)) - return MEASUREREPORT; - if ("Media".equals(codeString)) - return MEDIA; - if ("Medication".equals(codeString)) - return MEDICATION; - if ("MedicationAdministration".equals(codeString)) - return MEDICATIONADMINISTRATION; - if ("MedicationDispense".equals(codeString)) - return MEDICATIONDISPENSE; - if ("MedicationOrder".equals(codeString)) - return MEDICATIONORDER; - if ("MedicationStatement".equals(codeString)) - return MEDICATIONSTATEMENT; - if ("MessageHeader".equals(codeString)) - return MESSAGEHEADER; - if ("ModuleDefinition".equals(codeString)) - return MODULEDEFINITION; - if ("NamingSystem".equals(codeString)) - return NAMINGSYSTEM; - if ("NutritionOrder".equals(codeString)) - return NUTRITIONORDER; - if ("Observation".equals(codeString)) - return OBSERVATION; - if ("OperationDefinition".equals(codeString)) - return OPERATIONDEFINITION; - if ("OperationOutcome".equals(codeString)) - return OPERATIONOUTCOME; - if ("Order".equals(codeString)) - return ORDER; - if ("OrderResponse".equals(codeString)) - return ORDERRESPONSE; - if ("OrderSet".equals(codeString)) - return ORDERSET; - if ("Organization".equals(codeString)) - return ORGANIZATION; - if ("Parameters".equals(codeString)) - return PARAMETERS; - if ("Patient".equals(codeString)) - return PATIENT; - if ("PaymentNotice".equals(codeString)) - return PAYMENTNOTICE; - if ("PaymentReconciliation".equals(codeString)) - return PAYMENTRECONCILIATION; - if ("Person".equals(codeString)) - return PERSON; - if ("Practitioner".equals(codeString)) - return PRACTITIONER; - if ("PractitionerRole".equals(codeString)) - return PRACTITIONERROLE; - if ("Procedure".equals(codeString)) - return PROCEDURE; - if ("ProcedureRequest".equals(codeString)) - return PROCEDUREREQUEST; - if ("ProcessRequest".equals(codeString)) - return PROCESSREQUEST; - if ("ProcessResponse".equals(codeString)) - return PROCESSRESPONSE; - if ("Protocol".equals(codeString)) - return PROTOCOL; - if ("Provenance".equals(codeString)) - return PROVENANCE; - if ("Questionnaire".equals(codeString)) - return QUESTIONNAIRE; - if ("QuestionnaireResponse".equals(codeString)) - return QUESTIONNAIRERESPONSE; - if ("ReferralRequest".equals(codeString)) - return REFERRALREQUEST; - if ("RelatedPerson".equals(codeString)) - return RELATEDPERSON; - if ("Resource".equals(codeString)) - return RESOURCE; - if ("RiskAssessment".equals(codeString)) - return RISKASSESSMENT; - if ("Schedule".equals(codeString)) - return SCHEDULE; - if ("SearchParameter".equals(codeString)) - return SEARCHPARAMETER; - if ("Sequence".equals(codeString)) - return SEQUENCE; - if ("Slot".equals(codeString)) - return SLOT; - if ("Specimen".equals(codeString)) - return SPECIMEN; - if ("StructureDefinition".equals(codeString)) - return STRUCTUREDEFINITION; - if ("StructureMap".equals(codeString)) - return STRUCTUREMAP; - if ("Subscription".equals(codeString)) - return SUBSCRIPTION; - if ("Substance".equals(codeString)) - return SUBSTANCE; - if ("SupplyDelivery".equals(codeString)) - return SUPPLYDELIVERY; - if ("SupplyRequest".equals(codeString)) - return SUPPLYREQUEST; - if ("Task".equals(codeString)) - return TASK; - if ("TestScript".equals(codeString)) - return TESTSCRIPT; - if ("ValueSet".equals(codeString)) - return VALUESET; - if ("VisionPrescription".equals(codeString)) - return VISIONPRESCRIPTION; - throw new FHIRException("Unknown ResourceType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACCOUNT: return "Account"; - case ALLERGYINTOLERANCE: return "AllergyIntolerance"; - case APPOINTMENT: return "Appointment"; - case APPOINTMENTRESPONSE: return "AppointmentResponse"; - case AUDITEVENT: return "AuditEvent"; - case BASIC: return "Basic"; - case BINARY: return "Binary"; - case BODYSITE: return "BodySite"; - case BUNDLE: return "Bundle"; - case CAREPLAN: return "CarePlan"; - case CARETEAM: return "CareTeam"; - case CLAIM: return "Claim"; - case CLAIMRESPONSE: return "ClaimResponse"; - case CLINICALIMPRESSION: return "ClinicalImpression"; - case CODESYSTEM: return "CodeSystem"; - case COMMUNICATION: return "Communication"; - case COMMUNICATIONREQUEST: return "CommunicationRequest"; - case COMPARTMENTDEFINITION: return "CompartmentDefinition"; - case COMPOSITION: return "Composition"; - case CONCEPTMAP: return "ConceptMap"; - case CONDITION: return "Condition"; - case CONFORMANCE: return "Conformance"; - case CONTRACT: return "Contract"; - case COVERAGE: return "Coverage"; - case DATAELEMENT: return "DataElement"; - case DECISIONSUPPORTRULE: return "DecisionSupportRule"; - case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; - case DETECTEDISSUE: return "DetectedIssue"; - case DEVICE: return "Device"; - case DEVICECOMPONENT: return "DeviceComponent"; - case DEVICEMETRIC: return "DeviceMetric"; - case DEVICEUSEREQUEST: return "DeviceUseRequest"; - case DEVICEUSESTATEMENT: return "DeviceUseStatement"; - case DIAGNOSTICORDER: return "DiagnosticOrder"; - case DIAGNOSTICREPORT: return "DiagnosticReport"; - case DOCUMENTMANIFEST: return "DocumentManifest"; - case DOCUMENTREFERENCE: return "DocumentReference"; - case DOMAINRESOURCE: return "DomainResource"; - case ELIGIBILITYREQUEST: return "EligibilityRequest"; - case ELIGIBILITYRESPONSE: return "EligibilityResponse"; - case ENCOUNTER: return "Encounter"; - case ENROLLMENTREQUEST: return "EnrollmentRequest"; - case ENROLLMENTRESPONSE: return "EnrollmentResponse"; - case EPISODEOFCARE: return "EpisodeOfCare"; - case EXPANSIONPROFILE: return "ExpansionProfile"; - case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; - case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; - case FLAG: return "Flag"; - case GOAL: return "Goal"; - case GROUP: return "Group"; - case GUIDANCERESPONSE: return "GuidanceResponse"; - case HEALTHCARESERVICE: return "HealthcareService"; - case IMAGINGEXCERPT: return "ImagingExcerpt"; - case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; - case IMAGINGSTUDY: return "ImagingStudy"; - case IMMUNIZATION: return "Immunization"; - case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; - case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; - case LIBRARY: return "Library"; - case LINKAGE: return "Linkage"; - case LIST: return "List"; - case LOCATION: return "Location"; - case MEASURE: return "Measure"; - case MEASUREREPORT: return "MeasureReport"; - case MEDIA: return "Media"; - case MEDICATION: return "Medication"; - case MEDICATIONADMINISTRATION: return "MedicationAdministration"; - case MEDICATIONDISPENSE: return "MedicationDispense"; - case MEDICATIONORDER: return "MedicationOrder"; - case MEDICATIONSTATEMENT: return "MedicationStatement"; - case MESSAGEHEADER: return "MessageHeader"; - case MODULEDEFINITION: return "ModuleDefinition"; - case NAMINGSYSTEM: return "NamingSystem"; - case NUTRITIONORDER: return "NutritionOrder"; - case OBSERVATION: return "Observation"; - case OPERATIONDEFINITION: return "OperationDefinition"; - case OPERATIONOUTCOME: return "OperationOutcome"; - case ORDER: return "Order"; - case ORDERRESPONSE: return "OrderResponse"; - case ORDERSET: return "OrderSet"; - case ORGANIZATION: return "Organization"; - case PARAMETERS: return "Parameters"; - case PATIENT: return "Patient"; - case PAYMENTNOTICE: return "PaymentNotice"; - case PAYMENTRECONCILIATION: return "PaymentReconciliation"; - case PERSON: return "Person"; - case PRACTITIONER: return "Practitioner"; - case PRACTITIONERROLE: return "PractitionerRole"; - case PROCEDURE: return "Procedure"; - case PROCEDUREREQUEST: return "ProcedureRequest"; - case PROCESSREQUEST: return "ProcessRequest"; - case PROCESSRESPONSE: return "ProcessResponse"; - case PROTOCOL: return "Protocol"; - case PROVENANCE: return "Provenance"; - case QUESTIONNAIRE: return "Questionnaire"; - case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; - case REFERRALREQUEST: return "ReferralRequest"; - case RELATEDPERSON: return "RelatedPerson"; - case RESOURCE: return "Resource"; - case RISKASSESSMENT: return "RiskAssessment"; - case SCHEDULE: return "Schedule"; - case SEARCHPARAMETER: return "SearchParameter"; - case SEQUENCE: return "Sequence"; - case SLOT: return "Slot"; - case SPECIMEN: return "Specimen"; - case STRUCTUREDEFINITION: return "StructureDefinition"; - case STRUCTUREMAP: return "StructureMap"; - case SUBSCRIPTION: return "Subscription"; - case SUBSTANCE: return "Substance"; - case SUPPLYDELIVERY: return "SupplyDelivery"; - case SUPPLYREQUEST: return "SupplyRequest"; - case TASK: return "Task"; - case TESTSCRIPT: return "TestScript"; - case VALUESET: return "ValueSet"; - case VISIONPRESCRIPTION: return "VisionPrescription"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACCOUNT: return "http://hl7.org/fhir/resource-types"; - case ALLERGYINTOLERANCE: return "http://hl7.org/fhir/resource-types"; - case APPOINTMENT: return "http://hl7.org/fhir/resource-types"; - case APPOINTMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; - case AUDITEVENT: return "http://hl7.org/fhir/resource-types"; - case BASIC: return "http://hl7.org/fhir/resource-types"; - case BINARY: return "http://hl7.org/fhir/resource-types"; - case BODYSITE: return "http://hl7.org/fhir/resource-types"; - case BUNDLE: return "http://hl7.org/fhir/resource-types"; - case CAREPLAN: return "http://hl7.org/fhir/resource-types"; - case CARETEAM: return "http://hl7.org/fhir/resource-types"; - case CLAIM: return "http://hl7.org/fhir/resource-types"; - case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types"; - case CLINICALIMPRESSION: return "http://hl7.org/fhir/resource-types"; - case CODESYSTEM: return "http://hl7.org/fhir/resource-types"; - case COMMUNICATION: return "http://hl7.org/fhir/resource-types"; - case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types"; - case COMPARTMENTDEFINITION: return "http://hl7.org/fhir/resource-types"; - case COMPOSITION: return "http://hl7.org/fhir/resource-types"; - case CONCEPTMAP: return "http://hl7.org/fhir/resource-types"; - case CONDITION: return "http://hl7.org/fhir/resource-types"; - case CONFORMANCE: return "http://hl7.org/fhir/resource-types"; - case CONTRACT: return "http://hl7.org/fhir/resource-types"; - case COVERAGE: return "http://hl7.org/fhir/resource-types"; - case DATAELEMENT: return "http://hl7.org/fhir/resource-types"; - case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/resource-types"; - case DECISIONSUPPORTSERVICEMODULE: return "http://hl7.org/fhir/resource-types"; - case DETECTEDISSUE: return "http://hl7.org/fhir/resource-types"; - case DEVICE: return "http://hl7.org/fhir/resource-types"; - case DEVICECOMPONENT: return "http://hl7.org/fhir/resource-types"; - case DEVICEMETRIC: return "http://hl7.org/fhir/resource-types"; - case DEVICEUSEREQUEST: return "http://hl7.org/fhir/resource-types"; - case DEVICEUSESTATEMENT: return "http://hl7.org/fhir/resource-types"; - case DIAGNOSTICORDER: return "http://hl7.org/fhir/resource-types"; - case DIAGNOSTICREPORT: return "http://hl7.org/fhir/resource-types"; - case DOCUMENTMANIFEST: return "http://hl7.org/fhir/resource-types"; - case DOCUMENTREFERENCE: return "http://hl7.org/fhir/resource-types"; - case DOMAINRESOURCE: return "http://hl7.org/fhir/resource-types"; - case ELIGIBILITYREQUEST: return "http://hl7.org/fhir/resource-types"; - case ELIGIBILITYRESPONSE: return "http://hl7.org/fhir/resource-types"; - case ENCOUNTER: return "http://hl7.org/fhir/resource-types"; - case ENROLLMENTREQUEST: return "http://hl7.org/fhir/resource-types"; - case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types"; - case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types"; - case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types"; - case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types"; - case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types"; - case FLAG: return "http://hl7.org/fhir/resource-types"; - case GOAL: return "http://hl7.org/fhir/resource-types"; - case GROUP: return "http://hl7.org/fhir/resource-types"; - case GUIDANCERESPONSE: return "http://hl7.org/fhir/resource-types"; - case HEALTHCARESERVICE: return "http://hl7.org/fhir/resource-types"; - case IMAGINGEXCERPT: return "http://hl7.org/fhir/resource-types"; - case IMAGINGOBJECTSELECTION: return "http://hl7.org/fhir/resource-types"; - case IMAGINGSTUDY: return "http://hl7.org/fhir/resource-types"; - case IMMUNIZATION: return "http://hl7.org/fhir/resource-types"; - case IMMUNIZATIONRECOMMENDATION: return "http://hl7.org/fhir/resource-types"; - case IMPLEMENTATIONGUIDE: return "http://hl7.org/fhir/resource-types"; - case LIBRARY: return "http://hl7.org/fhir/resource-types"; - case LINKAGE: return "http://hl7.org/fhir/resource-types"; - case LIST: return "http://hl7.org/fhir/resource-types"; - case LOCATION: return "http://hl7.org/fhir/resource-types"; - case MEASURE: return "http://hl7.org/fhir/resource-types"; - case MEASUREREPORT: return "http://hl7.org/fhir/resource-types"; - case MEDIA: return "http://hl7.org/fhir/resource-types"; - case MEDICATION: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONADMINISTRATION: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONDISPENSE: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONORDER: return "http://hl7.org/fhir/resource-types"; - case MEDICATIONSTATEMENT: return "http://hl7.org/fhir/resource-types"; - case MESSAGEHEADER: return "http://hl7.org/fhir/resource-types"; - case MODULEDEFINITION: return "http://hl7.org/fhir/resource-types"; - case NAMINGSYSTEM: return "http://hl7.org/fhir/resource-types"; - case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types"; - case OBSERVATION: return "http://hl7.org/fhir/resource-types"; - case OPERATIONDEFINITION: return "http://hl7.org/fhir/resource-types"; - case OPERATIONOUTCOME: return "http://hl7.org/fhir/resource-types"; - case ORDER: return "http://hl7.org/fhir/resource-types"; - case ORDERRESPONSE: return "http://hl7.org/fhir/resource-types"; - case ORDERSET: return "http://hl7.org/fhir/resource-types"; - case ORGANIZATION: return "http://hl7.org/fhir/resource-types"; - case PARAMETERS: return "http://hl7.org/fhir/resource-types"; - case PATIENT: return "http://hl7.org/fhir/resource-types"; - case PAYMENTNOTICE: return "http://hl7.org/fhir/resource-types"; - case PAYMENTRECONCILIATION: return "http://hl7.org/fhir/resource-types"; - case PERSON: return "http://hl7.org/fhir/resource-types"; - case PRACTITIONER: return "http://hl7.org/fhir/resource-types"; - case PRACTITIONERROLE: return "http://hl7.org/fhir/resource-types"; - case PROCEDURE: return "http://hl7.org/fhir/resource-types"; - case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types"; - case PROCESSREQUEST: return "http://hl7.org/fhir/resource-types"; - case PROCESSRESPONSE: return "http://hl7.org/fhir/resource-types"; - case PROTOCOL: return "http://hl7.org/fhir/resource-types"; - case PROVENANCE: return "http://hl7.org/fhir/resource-types"; - case QUESTIONNAIRE: return "http://hl7.org/fhir/resource-types"; - case QUESTIONNAIRERESPONSE: return "http://hl7.org/fhir/resource-types"; - case REFERRALREQUEST: return "http://hl7.org/fhir/resource-types"; - case RELATEDPERSON: return "http://hl7.org/fhir/resource-types"; - case RESOURCE: return "http://hl7.org/fhir/resource-types"; - case RISKASSESSMENT: return "http://hl7.org/fhir/resource-types"; - case SCHEDULE: return "http://hl7.org/fhir/resource-types"; - case SEARCHPARAMETER: return "http://hl7.org/fhir/resource-types"; - case SEQUENCE: return "http://hl7.org/fhir/resource-types"; - case SLOT: return "http://hl7.org/fhir/resource-types"; - case SPECIMEN: return "http://hl7.org/fhir/resource-types"; - case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types"; - case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types"; - case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types"; - case SUBSTANCE: return "http://hl7.org/fhir/resource-types"; - case SUPPLYDELIVERY: return "http://hl7.org/fhir/resource-types"; - case SUPPLYREQUEST: return "http://hl7.org/fhir/resource-types"; - case TASK: return "http://hl7.org/fhir/resource-types"; - case TESTSCRIPT: return "http://hl7.org/fhir/resource-types"; - case VALUESET: return "http://hl7.org/fhir/resource-types"; - case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACCOUNT: return "A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges for a patient, cost centres, etc."; - case ALLERGYINTOLERANCE: return "Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to a substance."; - case APPOINTMENT: return "A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific date/time. This may result in one or more Encounter(s)."; - case APPOINTMENTRESPONSE: return "A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection."; - case AUDITEVENT: return "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."; - case BASIC: return "Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing resource, and custom resources not appropriate for inclusion in the FHIR specification."; - case BINARY: return "A binary resource can contain any content, whether text, image, pdf, zip archive, etc."; - case BODYSITE: return "Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept does not provide the necessary detail needed for the use case."; - case BUNDLE: return "A container for a collection of resources."; - case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions."; - case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient."; - case CLAIM: return "A provider issued list of services and products provided, or to be provided, to a patient which is provided to an insurer for payment recovery."; - case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource."; - case CLINICALIMPRESSION: return "A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called \"ClinicalImpression\" rather than \"ClinicalAssessment\" to avoid confusion with the recording of assessment tools such as Apgar score."; - case CODESYSTEM: return "A code system resource specifies a set of codes drawn from one or more code systems."; - case COMMUNICATION: return "An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health agency was notified about a reportable condition."; - case COMMUNICATIONREQUEST: return "A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS system proposes that the public health agency be notified about a reportable condition."; - case COMPARTMENTDEFINITION: return "A compartment definition that defines how resources are accessed on a server."; - case COMPOSITION: return "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. While a Composition defines the structure, it does not actually contain the content: rather the full content of a document is contained in a Bundle, of which the Composition is the first resource contained."; - case CONCEPTMAP: return "A statement of relationships from one set of concepts to one or more other concepts - either code systems or data elements, or classes in class models."; - case CONDITION: return "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."; - case CONFORMANCE: return "A conformance statement is a set of capabilities of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation."; - case CONTRACT: return "A formal agreement between parties regarding the conduct of business, exchange of information or other matters."; - case COVERAGE: return "Financial instrument which may be used to pay for or reimburse health care products and services."; - case DATAELEMENT: return "The formal description of a single piece of information that can be gathered and reported."; - case DECISIONSUPPORTRULE: return "This resource defines a decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, computable definition of a actions that should be taken whenever some condition is met in response to a particular event or events."; - case DECISIONSUPPORTSERVICEMODULE: return "The DecisionSupportServiceModule describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking."; - case DETECTEDISSUE: return "Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc."; - case DEVICE: return "This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare without being substantially changed through that activity. The device may be a medical or non-medical device. Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a machine, cellphone, computer, application, etc."; - case DEVICECOMPONENT: return "Describes the characteristics, operational status and capabilities of a medical-related component of a medical device."; - case DEVICEMETRIC: return "Describes a measurement, calculation or setting capability of a medical device."; - case DEVICEUSEREQUEST: return "Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external assistive device, such as a walker."; - case DEVICEUSESTATEMENT: return "A record of a device being used by a patient where the record is the result of a report from the patient or another clinician."; - case DIAGNOSTICORDER: return "A record of a request for a diagnostic investigation service to be performed."; - case DIAGNOSTICREPORT: return "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 interpretations, and formatted representation of diagnostic reports."; - case DOCUMENTMANIFEST: return "A manifest that defines a set of documents."; - case DOCUMENTREFERENCE: return "A reference to a document ."; - case DOMAINRESOURCE: return "A resource that includes narrative, extensions, and contained resources."; - case ELIGIBILITYREQUEST: return "This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally some class of service."; - case ELIGIBILITYRESPONSE: return "This resource provides eligibility and plan details from the processing of an Eligibility resource."; - case ENCOUNTER: return "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."; - case ENROLLMENTREQUEST: return "This resource provides the insurance enrollment details to the insurer regarding a specified coverage."; - case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource."; - case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time."; - case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet."; - case EXPLANATIONOFBENEFIT: return "This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided."; - case FAMILYMEMBERHISTORY: return "Significant health events and conditions for a person related to the patient relevant in the context of care for the patient."; - case FLAG: return "Prospective warnings of potential issues when providing care to the patient."; - case GOAL: return "Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc."; - case GROUP: return "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."; - case GUIDANCERESPONSE: return "A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken."; - case HEALTHCARESERVICE: return "The details of a healthcare service available at a location."; - case IMAGINGEXCERPT: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; - case IMAGINGOBJECTSELECTION: return "A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance (\"cine\" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on."; - case IMAGINGSTUDY: return "Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities."; - case IMMUNIZATION: return "Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed."; - case IMMUNIZATIONRECOMMENDATION: return "A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification."; - case IMPLEMENTATIONGUIDE: return "A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts."; - case LIBRARY: return "The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library."; - case LINKAGE: return "Identifies two or more records (resource instances) that are referring to the same real-world \"occurrence\"."; - case LIST: return "A set of information summarized from a list of other resources."; - case LOCATION: return "Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated."; - case MEASURE: return "The Measure resource provides the definition of a quality measure."; - case MEASUREREPORT: return "The MeasureReport resource contains the results of evaluating a measure."; - case MEDIA: return "A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference."; - case MEDICATION: return "This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication."; - case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered 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."; - case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order."; - case MEDICATIONORDER: return "An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationOrder\" rather than \"MedicationPrescription\" to generalize the use across inpatient and outpatient settings as well as for care plans, etc."; - case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information."; - case MESSAGEHEADER: return "The header for a message exchange that is either requesting or responding to an action. The reference(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."; - case MODULEDEFINITION: return "The ModuleDefinition resource defines the data requirements for a quality artifact."; - case NAMINGSYSTEM: return "A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a \"System\" used within the Identifier and Coding data types."; - case NUTRITIONORDER: return "A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident."; - case OBSERVATION: return "Measurements and simple assertions made about a patient, device or other subject."; - case OPERATIONDEFINITION: return "A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction)."; - case OPERATIONOUTCOME: return "A collection of error, warning or information messages that result from a system action."; - case ORDER: return "A request to perform an action."; - case ORDERRESPONSE: return "A response to an order."; - case ORDERSET: return "This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support."; - case ORGANIZATION: return "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."; - case PARAMETERS: return "This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it."; - case PATIENT: return "Demographics and other administrative information about an individual or animal receiving care or other health-related services."; - case PAYMENTNOTICE: return "This resource provides the status of the payment for goods and services rendered, and the request and response resource references."; - case PAYMENTRECONCILIATION: return "This resource provides payment details and claim references supporting a bulk payment."; - case PERSON: return "Demographics and administrative information about a person independent of a specific health-related context."; - case PRACTITIONER: return "A person who is directly or indirectly involved in the provisioning of healthcare."; - case PRACTITIONERROLE: return "A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time."; - case PROCEDURE: return "An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy."; - case PROCEDUREREQUEST: return "A request for a procedure to be performed. May be a proposal or an order."; - case PROCESSREQUEST: return "This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources."; - case PROCESSRESPONSE: return "This resource provides processing status, errors and notes from the processing of a resource."; - case PROTOCOL: return "A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points."; - case PROVENANCE: return "Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies."; - case QUESTIONNAIRE: return "A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; - case QUESTIONNAIRERESPONSE: return "A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions."; - case REFERRALREQUEST: return "Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization."; - case RELATEDPERSON: return "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."; - case RESOURCE: return "This is the base resource type for everything."; - case RISKASSESSMENT: return "An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome."; - case SCHEDULE: return "A container for slot(s) of time that may be available for booking appointments."; - case SEARCHPARAMETER: return "A search parameter that defines a named search item that can be used to search/filter on a resource."; - case SEQUENCE: return "Variation and Sequence data."; - case SLOT: return "A slot of time on a schedule that may be available for booking appointments."; - case SPECIMEN: return "A sample to be used for analysis."; - case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types."; - case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data."; - case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action."; - case SUBSTANCE: return "A homogeneous material with a definite composition."; - case SUPPLYDELIVERY: return "Record of delivery of what is supplied."; - case SUPPLYREQUEST: return "A record of a request for a medication, substance or device used in the healthcare setting."; - case TASK: return "A task to be performed."; - case TESTSCRIPT: return "TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification."; - case VALUESET: return "A value set specifies a set of codes drawn from one or more code systems."; - case VISIONPRESCRIPTION: return "An authorization for the supply of glasses and/or contact lenses to a patient."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACCOUNT: return "Account"; - case ALLERGYINTOLERANCE: return "AllergyIntolerance"; - case APPOINTMENT: return "Appointment"; - case APPOINTMENTRESPONSE: return "AppointmentResponse"; - case AUDITEVENT: return "AuditEvent"; - case BASIC: return "Basic"; - case BINARY: return "Binary"; - case BODYSITE: return "BodySite"; - case BUNDLE: return "Bundle"; - case CAREPLAN: return "CarePlan"; - case CARETEAM: return "CareTeam"; - case CLAIM: return "Claim"; - case CLAIMRESPONSE: return "ClaimResponse"; - case CLINICALIMPRESSION: return "ClinicalImpression"; - case CODESYSTEM: return "CodeSystem"; - case COMMUNICATION: return "Communication"; - case COMMUNICATIONREQUEST: return "CommunicationRequest"; - case COMPARTMENTDEFINITION: return "CompartmentDefinition"; - case COMPOSITION: return "Composition"; - case CONCEPTMAP: return "ConceptMap"; - case CONDITION: return "Condition"; - case CONFORMANCE: return "Conformance"; - case CONTRACT: return "Contract"; - case COVERAGE: return "Coverage"; - case DATAELEMENT: return "DataElement"; - case DECISIONSUPPORTRULE: return "DecisionSupportRule"; - case DECISIONSUPPORTSERVICEMODULE: return "DecisionSupportServiceModule"; - case DETECTEDISSUE: return "DetectedIssue"; - case DEVICE: return "Device"; - case DEVICECOMPONENT: return "DeviceComponent"; - case DEVICEMETRIC: return "DeviceMetric"; - case DEVICEUSEREQUEST: return "DeviceUseRequest"; - case DEVICEUSESTATEMENT: return "DeviceUseStatement"; - case DIAGNOSTICORDER: return "DiagnosticOrder"; - case DIAGNOSTICREPORT: return "DiagnosticReport"; - case DOCUMENTMANIFEST: return "DocumentManifest"; - case DOCUMENTREFERENCE: return "DocumentReference"; - case DOMAINRESOURCE: return "DomainResource"; - case ELIGIBILITYREQUEST: return "EligibilityRequest"; - case ELIGIBILITYRESPONSE: return "EligibilityResponse"; - case ENCOUNTER: return "Encounter"; - case ENROLLMENTREQUEST: return "EnrollmentRequest"; - case ENROLLMENTRESPONSE: return "EnrollmentResponse"; - case EPISODEOFCARE: return "EpisodeOfCare"; - case EXPANSIONPROFILE: return "ExpansionProfile"; - case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit"; - case FAMILYMEMBERHISTORY: return "FamilyMemberHistory"; - case FLAG: return "Flag"; - case GOAL: return "Goal"; - case GROUP: return "Group"; - case GUIDANCERESPONSE: return "GuidanceResponse"; - case HEALTHCARESERVICE: return "HealthcareService"; - case IMAGINGEXCERPT: return "ImagingExcerpt"; - case IMAGINGOBJECTSELECTION: return "ImagingObjectSelection"; - case IMAGINGSTUDY: return "ImagingStudy"; - case IMMUNIZATION: return "Immunization"; - case IMMUNIZATIONRECOMMENDATION: return "ImmunizationRecommendation"; - case IMPLEMENTATIONGUIDE: return "ImplementationGuide"; - case LIBRARY: return "Library"; - case LINKAGE: return "Linkage"; - case LIST: return "List"; - case LOCATION: return "Location"; - case MEASURE: return "Measure"; - case MEASUREREPORT: return "MeasureReport"; - case MEDIA: return "Media"; - case MEDICATION: return "Medication"; - case MEDICATIONADMINISTRATION: return "MedicationAdministration"; - case MEDICATIONDISPENSE: return "MedicationDispense"; - case MEDICATIONORDER: return "MedicationOrder"; - case MEDICATIONSTATEMENT: return "MedicationStatement"; - case MESSAGEHEADER: return "MessageHeader"; - case MODULEDEFINITION: return "ModuleDefinition"; - case NAMINGSYSTEM: return "NamingSystem"; - case NUTRITIONORDER: return "NutritionOrder"; - case OBSERVATION: return "Observation"; - case OPERATIONDEFINITION: return "OperationDefinition"; - case OPERATIONOUTCOME: return "OperationOutcome"; - case ORDER: return "Order"; - case ORDERRESPONSE: return "OrderResponse"; - case ORDERSET: return "OrderSet"; - case ORGANIZATION: return "Organization"; - case PARAMETERS: return "Parameters"; - case PATIENT: return "Patient"; - case PAYMENTNOTICE: return "PaymentNotice"; - case PAYMENTRECONCILIATION: return "PaymentReconciliation"; - case PERSON: return "Person"; - case PRACTITIONER: return "Practitioner"; - case PRACTITIONERROLE: return "PractitionerRole"; - case PROCEDURE: return "Procedure"; - case PROCEDUREREQUEST: return "ProcedureRequest"; - case PROCESSREQUEST: return "ProcessRequest"; - case PROCESSRESPONSE: return "ProcessResponse"; - case PROTOCOL: return "Protocol"; - case PROVENANCE: return "Provenance"; - case QUESTIONNAIRE: return "Questionnaire"; - case QUESTIONNAIRERESPONSE: return "QuestionnaireResponse"; - case REFERRALREQUEST: return "ReferralRequest"; - case RELATEDPERSON: return "RelatedPerson"; - case RESOURCE: return "Resource"; - case RISKASSESSMENT: return "RiskAssessment"; - case SCHEDULE: return "Schedule"; - case SEARCHPARAMETER: return "SearchParameter"; - case SEQUENCE: return "Sequence"; - case SLOT: return "Slot"; - case SPECIMEN: return "Specimen"; - case STRUCTUREDEFINITION: return "StructureDefinition"; - case STRUCTUREMAP: return "StructureMap"; - case SUBSCRIPTION: return "Subscription"; - case SUBSTANCE: return "Substance"; - case SUPPLYDELIVERY: return "SupplyDelivery"; - case SUPPLYREQUEST: return "SupplyRequest"; - case TASK: return "Task"; - case TESTSCRIPT: return "TestScript"; - case VALUESET: return "ValueSet"; - case VISIONPRESCRIPTION: return "VisionPrescription"; - default: return "?"; - } - } - } - - public static class ResourceTypeEnumFactory implements EnumFactory { - public ResourceType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("Account".equals(codeString)) - return ResourceType.ACCOUNT; - if ("AllergyIntolerance".equals(codeString)) - return ResourceType.ALLERGYINTOLERANCE; - if ("Appointment".equals(codeString)) - return ResourceType.APPOINTMENT; - if ("AppointmentResponse".equals(codeString)) - return ResourceType.APPOINTMENTRESPONSE; - if ("AuditEvent".equals(codeString)) - return ResourceType.AUDITEVENT; - if ("Basic".equals(codeString)) - return ResourceType.BASIC; - if ("Binary".equals(codeString)) - return ResourceType.BINARY; - if ("BodySite".equals(codeString)) - return ResourceType.BODYSITE; - if ("Bundle".equals(codeString)) - return ResourceType.BUNDLE; - if ("CarePlan".equals(codeString)) - return ResourceType.CAREPLAN; - if ("CareTeam".equals(codeString)) - return ResourceType.CARETEAM; - if ("Claim".equals(codeString)) - return ResourceType.CLAIM; - if ("ClaimResponse".equals(codeString)) - return ResourceType.CLAIMRESPONSE; - if ("ClinicalImpression".equals(codeString)) - return ResourceType.CLINICALIMPRESSION; - if ("CodeSystem".equals(codeString)) - return ResourceType.CODESYSTEM; - if ("Communication".equals(codeString)) - return ResourceType.COMMUNICATION; - if ("CommunicationRequest".equals(codeString)) - return ResourceType.COMMUNICATIONREQUEST; - if ("CompartmentDefinition".equals(codeString)) - return ResourceType.COMPARTMENTDEFINITION; - if ("Composition".equals(codeString)) - return ResourceType.COMPOSITION; - if ("ConceptMap".equals(codeString)) - return ResourceType.CONCEPTMAP; - if ("Condition".equals(codeString)) - return ResourceType.CONDITION; - if ("Conformance".equals(codeString)) - return ResourceType.CONFORMANCE; - if ("Contract".equals(codeString)) - return ResourceType.CONTRACT; - if ("Coverage".equals(codeString)) - return ResourceType.COVERAGE; - if ("DataElement".equals(codeString)) - return ResourceType.DATAELEMENT; - if ("DecisionSupportRule".equals(codeString)) - return ResourceType.DECISIONSUPPORTRULE; - if ("DecisionSupportServiceModule".equals(codeString)) - return ResourceType.DECISIONSUPPORTSERVICEMODULE; - if ("DetectedIssue".equals(codeString)) - return ResourceType.DETECTEDISSUE; - if ("Device".equals(codeString)) - return ResourceType.DEVICE; - if ("DeviceComponent".equals(codeString)) - return ResourceType.DEVICECOMPONENT; - if ("DeviceMetric".equals(codeString)) - return ResourceType.DEVICEMETRIC; - if ("DeviceUseRequest".equals(codeString)) - return ResourceType.DEVICEUSEREQUEST; - if ("DeviceUseStatement".equals(codeString)) - return ResourceType.DEVICEUSESTATEMENT; - if ("DiagnosticOrder".equals(codeString)) - return ResourceType.DIAGNOSTICORDER; - if ("DiagnosticReport".equals(codeString)) - return ResourceType.DIAGNOSTICREPORT; - if ("DocumentManifest".equals(codeString)) - return ResourceType.DOCUMENTMANIFEST; - if ("DocumentReference".equals(codeString)) - return ResourceType.DOCUMENTREFERENCE; - if ("DomainResource".equals(codeString)) - return ResourceType.DOMAINRESOURCE; - if ("EligibilityRequest".equals(codeString)) - return ResourceType.ELIGIBILITYREQUEST; - if ("EligibilityResponse".equals(codeString)) - return ResourceType.ELIGIBILITYRESPONSE; - if ("Encounter".equals(codeString)) - return ResourceType.ENCOUNTER; - if ("EnrollmentRequest".equals(codeString)) - return ResourceType.ENROLLMENTREQUEST; - if ("EnrollmentResponse".equals(codeString)) - return ResourceType.ENROLLMENTRESPONSE; - if ("EpisodeOfCare".equals(codeString)) - return ResourceType.EPISODEOFCARE; - if ("ExpansionProfile".equals(codeString)) - return ResourceType.EXPANSIONPROFILE; - if ("ExplanationOfBenefit".equals(codeString)) - return ResourceType.EXPLANATIONOFBENEFIT; - if ("FamilyMemberHistory".equals(codeString)) - return ResourceType.FAMILYMEMBERHISTORY; - if ("Flag".equals(codeString)) - return ResourceType.FLAG; - if ("Goal".equals(codeString)) - return ResourceType.GOAL; - if ("Group".equals(codeString)) - return ResourceType.GROUP; - if ("GuidanceResponse".equals(codeString)) - return ResourceType.GUIDANCERESPONSE; - if ("HealthcareService".equals(codeString)) - return ResourceType.HEALTHCARESERVICE; - if ("ImagingExcerpt".equals(codeString)) - return ResourceType.IMAGINGEXCERPT; - if ("ImagingObjectSelection".equals(codeString)) - return ResourceType.IMAGINGOBJECTSELECTION; - if ("ImagingStudy".equals(codeString)) - return ResourceType.IMAGINGSTUDY; - if ("Immunization".equals(codeString)) - return ResourceType.IMMUNIZATION; - if ("ImmunizationRecommendation".equals(codeString)) - return ResourceType.IMMUNIZATIONRECOMMENDATION; - if ("ImplementationGuide".equals(codeString)) - return ResourceType.IMPLEMENTATIONGUIDE; - if ("Library".equals(codeString)) - return ResourceType.LIBRARY; - if ("Linkage".equals(codeString)) - return ResourceType.LINKAGE; - if ("List".equals(codeString)) - return ResourceType.LIST; - if ("Location".equals(codeString)) - return ResourceType.LOCATION; - if ("Measure".equals(codeString)) - return ResourceType.MEASURE; - if ("MeasureReport".equals(codeString)) - return ResourceType.MEASUREREPORT; - if ("Media".equals(codeString)) - return ResourceType.MEDIA; - if ("Medication".equals(codeString)) - return ResourceType.MEDICATION; - if ("MedicationAdministration".equals(codeString)) - return ResourceType.MEDICATIONADMINISTRATION; - if ("MedicationDispense".equals(codeString)) - return ResourceType.MEDICATIONDISPENSE; - if ("MedicationOrder".equals(codeString)) - return ResourceType.MEDICATIONORDER; - if ("MedicationStatement".equals(codeString)) - return ResourceType.MEDICATIONSTATEMENT; - if ("MessageHeader".equals(codeString)) - return ResourceType.MESSAGEHEADER; - if ("ModuleDefinition".equals(codeString)) - return ResourceType.MODULEDEFINITION; - if ("NamingSystem".equals(codeString)) - return ResourceType.NAMINGSYSTEM; - if ("NutritionOrder".equals(codeString)) - return ResourceType.NUTRITIONORDER; - if ("Observation".equals(codeString)) - return ResourceType.OBSERVATION; - if ("OperationDefinition".equals(codeString)) - return ResourceType.OPERATIONDEFINITION; - if ("OperationOutcome".equals(codeString)) - return ResourceType.OPERATIONOUTCOME; - if ("Order".equals(codeString)) - return ResourceType.ORDER; - if ("OrderResponse".equals(codeString)) - return ResourceType.ORDERRESPONSE; - if ("OrderSet".equals(codeString)) - return ResourceType.ORDERSET; - if ("Organization".equals(codeString)) - return ResourceType.ORGANIZATION; - if ("Parameters".equals(codeString)) - return ResourceType.PARAMETERS; - if ("Patient".equals(codeString)) - return ResourceType.PATIENT; - if ("PaymentNotice".equals(codeString)) - return ResourceType.PAYMENTNOTICE; - if ("PaymentReconciliation".equals(codeString)) - return ResourceType.PAYMENTRECONCILIATION; - if ("Person".equals(codeString)) - return ResourceType.PERSON; - if ("Practitioner".equals(codeString)) - return ResourceType.PRACTITIONER; - if ("PractitionerRole".equals(codeString)) - return ResourceType.PRACTITIONERROLE; - if ("Procedure".equals(codeString)) - return ResourceType.PROCEDURE; - if ("ProcedureRequest".equals(codeString)) - return ResourceType.PROCEDUREREQUEST; - if ("ProcessRequest".equals(codeString)) - return ResourceType.PROCESSREQUEST; - if ("ProcessResponse".equals(codeString)) - return ResourceType.PROCESSRESPONSE; - if ("Protocol".equals(codeString)) - return ResourceType.PROTOCOL; - if ("Provenance".equals(codeString)) - return ResourceType.PROVENANCE; - if ("Questionnaire".equals(codeString)) - return ResourceType.QUESTIONNAIRE; - if ("QuestionnaireResponse".equals(codeString)) - return ResourceType.QUESTIONNAIRERESPONSE; - if ("ReferralRequest".equals(codeString)) - return ResourceType.REFERRALREQUEST; - if ("RelatedPerson".equals(codeString)) - return ResourceType.RELATEDPERSON; - if ("Resource".equals(codeString)) - return ResourceType.RESOURCE; - if ("RiskAssessment".equals(codeString)) - return ResourceType.RISKASSESSMENT; - if ("Schedule".equals(codeString)) - return ResourceType.SCHEDULE; - if ("SearchParameter".equals(codeString)) - return ResourceType.SEARCHPARAMETER; - if ("Sequence".equals(codeString)) - return ResourceType.SEQUENCE; - if ("Slot".equals(codeString)) - return ResourceType.SLOT; - if ("Specimen".equals(codeString)) - return ResourceType.SPECIMEN; - if ("StructureDefinition".equals(codeString)) - return ResourceType.STRUCTUREDEFINITION; - if ("StructureMap".equals(codeString)) - return ResourceType.STRUCTUREMAP; - if ("Subscription".equals(codeString)) - return ResourceType.SUBSCRIPTION; - if ("Substance".equals(codeString)) - return ResourceType.SUBSTANCE; - if ("SupplyDelivery".equals(codeString)) - return ResourceType.SUPPLYDELIVERY; - if ("SupplyRequest".equals(codeString)) - return ResourceType.SUPPLYREQUEST; - if ("Task".equals(codeString)) - return ResourceType.TASK; - if ("TestScript".equals(codeString)) - return ResourceType.TESTSCRIPT; - if ("ValueSet".equals(codeString)) - return ResourceType.VALUESET; - if ("VisionPrescription".equals(codeString)) - return ResourceType.VISIONPRESCRIPTION; - throw new IllegalArgumentException("Unknown ResourceType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("Account".equals(codeString)) - return new Enumeration(this, ResourceType.ACCOUNT); - if ("AllergyIntolerance".equals(codeString)) - return new Enumeration(this, ResourceType.ALLERGYINTOLERANCE); - if ("Appointment".equals(codeString)) - return new Enumeration(this, ResourceType.APPOINTMENT); - if ("AppointmentResponse".equals(codeString)) - return new Enumeration(this, ResourceType.APPOINTMENTRESPONSE); - if ("AuditEvent".equals(codeString)) - return new Enumeration(this, ResourceType.AUDITEVENT); - if ("Basic".equals(codeString)) - return new Enumeration(this, ResourceType.BASIC); - if ("Binary".equals(codeString)) - return new Enumeration(this, ResourceType.BINARY); - if ("BodySite".equals(codeString)) - return new Enumeration(this, ResourceType.BODYSITE); - if ("Bundle".equals(codeString)) - return new Enumeration(this, ResourceType.BUNDLE); - if ("CarePlan".equals(codeString)) - return new Enumeration(this, ResourceType.CAREPLAN); - if ("CareTeam".equals(codeString)) - return new Enumeration(this, ResourceType.CARETEAM); - if ("Claim".equals(codeString)) - return new Enumeration(this, ResourceType.CLAIM); - if ("ClaimResponse".equals(codeString)) - return new Enumeration(this, ResourceType.CLAIMRESPONSE); - if ("ClinicalImpression".equals(codeString)) - return new Enumeration(this, ResourceType.CLINICALIMPRESSION); - if ("CodeSystem".equals(codeString)) - return new Enumeration(this, ResourceType.CODESYSTEM); - if ("Communication".equals(codeString)) - return new Enumeration(this, ResourceType.COMMUNICATION); - if ("CommunicationRequest".equals(codeString)) - return new Enumeration(this, ResourceType.COMMUNICATIONREQUEST); - if ("CompartmentDefinition".equals(codeString)) - return new Enumeration(this, ResourceType.COMPARTMENTDEFINITION); - if ("Composition".equals(codeString)) - return new Enumeration(this, ResourceType.COMPOSITION); - if ("ConceptMap".equals(codeString)) - return new Enumeration(this, ResourceType.CONCEPTMAP); - if ("Condition".equals(codeString)) - return new Enumeration(this, ResourceType.CONDITION); - if ("Conformance".equals(codeString)) - return new Enumeration(this, ResourceType.CONFORMANCE); - if ("Contract".equals(codeString)) - return new Enumeration(this, ResourceType.CONTRACT); - if ("Coverage".equals(codeString)) - return new Enumeration(this, ResourceType.COVERAGE); - if ("DataElement".equals(codeString)) - return new Enumeration(this, ResourceType.DATAELEMENT); - if ("DecisionSupportRule".equals(codeString)) - return new Enumeration(this, ResourceType.DECISIONSUPPORTRULE); - if ("DecisionSupportServiceModule".equals(codeString)) - return new Enumeration(this, ResourceType.DECISIONSUPPORTSERVICEMODULE); - if ("DetectedIssue".equals(codeString)) - return new Enumeration(this, ResourceType.DETECTEDISSUE); - if ("Device".equals(codeString)) - return new Enumeration(this, ResourceType.DEVICE); - if ("DeviceComponent".equals(codeString)) - return new Enumeration(this, ResourceType.DEVICECOMPONENT); - if ("DeviceMetric".equals(codeString)) - return new Enumeration(this, ResourceType.DEVICEMETRIC); - if ("DeviceUseRequest".equals(codeString)) - return new Enumeration(this, ResourceType.DEVICEUSEREQUEST); - if ("DeviceUseStatement".equals(codeString)) - return new Enumeration(this, ResourceType.DEVICEUSESTATEMENT); - if ("DiagnosticOrder".equals(codeString)) - return new Enumeration(this, ResourceType.DIAGNOSTICORDER); - if ("DiagnosticReport".equals(codeString)) - return new Enumeration(this, ResourceType.DIAGNOSTICREPORT); - if ("DocumentManifest".equals(codeString)) - return new Enumeration(this, ResourceType.DOCUMENTMANIFEST); - if ("DocumentReference".equals(codeString)) - return new Enumeration(this, ResourceType.DOCUMENTREFERENCE); - if ("DomainResource".equals(codeString)) - return new Enumeration(this, ResourceType.DOMAINRESOURCE); - if ("EligibilityRequest".equals(codeString)) - return new Enumeration(this, ResourceType.ELIGIBILITYREQUEST); - if ("EligibilityResponse".equals(codeString)) - return new Enumeration(this, ResourceType.ELIGIBILITYRESPONSE); - if ("Encounter".equals(codeString)) - return new Enumeration(this, ResourceType.ENCOUNTER); - if ("EnrollmentRequest".equals(codeString)) - return new Enumeration(this, ResourceType.ENROLLMENTREQUEST); - if ("EnrollmentResponse".equals(codeString)) - return new Enumeration(this, ResourceType.ENROLLMENTRESPONSE); - if ("EpisodeOfCare".equals(codeString)) - return new Enumeration(this, ResourceType.EPISODEOFCARE); - if ("ExpansionProfile".equals(codeString)) - return new Enumeration(this, ResourceType.EXPANSIONPROFILE); - if ("ExplanationOfBenefit".equals(codeString)) - return new Enumeration(this, ResourceType.EXPLANATIONOFBENEFIT); - if ("FamilyMemberHistory".equals(codeString)) - return new Enumeration(this, ResourceType.FAMILYMEMBERHISTORY); - if ("Flag".equals(codeString)) - return new Enumeration(this, ResourceType.FLAG); - if ("Goal".equals(codeString)) - return new Enumeration(this, ResourceType.GOAL); - if ("Group".equals(codeString)) - return new Enumeration(this, ResourceType.GROUP); - if ("GuidanceResponse".equals(codeString)) - return new Enumeration(this, ResourceType.GUIDANCERESPONSE); - if ("HealthcareService".equals(codeString)) - return new Enumeration(this, ResourceType.HEALTHCARESERVICE); - if ("ImagingExcerpt".equals(codeString)) - return new Enumeration(this, ResourceType.IMAGINGEXCERPT); - if ("ImagingObjectSelection".equals(codeString)) - return new Enumeration(this, ResourceType.IMAGINGOBJECTSELECTION); - if ("ImagingStudy".equals(codeString)) - return new Enumeration(this, ResourceType.IMAGINGSTUDY); - if ("Immunization".equals(codeString)) - return new Enumeration(this, ResourceType.IMMUNIZATION); - if ("ImmunizationRecommendation".equals(codeString)) - return new Enumeration(this, ResourceType.IMMUNIZATIONRECOMMENDATION); - if ("ImplementationGuide".equals(codeString)) - return new Enumeration(this, ResourceType.IMPLEMENTATIONGUIDE); - if ("Library".equals(codeString)) - return new Enumeration(this, ResourceType.LIBRARY); - if ("Linkage".equals(codeString)) - return new Enumeration(this, ResourceType.LINKAGE); - if ("List".equals(codeString)) - return new Enumeration(this, ResourceType.LIST); - if ("Location".equals(codeString)) - return new Enumeration(this, ResourceType.LOCATION); - if ("Measure".equals(codeString)) - return new Enumeration(this, ResourceType.MEASURE); - if ("MeasureReport".equals(codeString)) - return new Enumeration(this, ResourceType.MEASUREREPORT); - if ("Media".equals(codeString)) - return new Enumeration(this, ResourceType.MEDIA); - if ("Medication".equals(codeString)) - return new Enumeration(this, ResourceType.MEDICATION); - if ("MedicationAdministration".equals(codeString)) - return new Enumeration(this, ResourceType.MEDICATIONADMINISTRATION); - if ("MedicationDispense".equals(codeString)) - return new Enumeration(this, ResourceType.MEDICATIONDISPENSE); - if ("MedicationOrder".equals(codeString)) - return new Enumeration(this, ResourceType.MEDICATIONORDER); - if ("MedicationStatement".equals(codeString)) - return new Enumeration(this, ResourceType.MEDICATIONSTATEMENT); - if ("MessageHeader".equals(codeString)) - return new Enumeration(this, ResourceType.MESSAGEHEADER); - if ("ModuleDefinition".equals(codeString)) - return new Enumeration(this, ResourceType.MODULEDEFINITION); - if ("NamingSystem".equals(codeString)) - return new Enumeration(this, ResourceType.NAMINGSYSTEM); - if ("NutritionOrder".equals(codeString)) - return new Enumeration(this, ResourceType.NUTRITIONORDER); - if ("Observation".equals(codeString)) - return new Enumeration(this, ResourceType.OBSERVATION); - if ("OperationDefinition".equals(codeString)) - return new Enumeration(this, ResourceType.OPERATIONDEFINITION); - if ("OperationOutcome".equals(codeString)) - return new Enumeration(this, ResourceType.OPERATIONOUTCOME); - if ("Order".equals(codeString)) - return new Enumeration(this, ResourceType.ORDER); - if ("OrderResponse".equals(codeString)) - return new Enumeration(this, ResourceType.ORDERRESPONSE); - if ("OrderSet".equals(codeString)) - return new Enumeration(this, ResourceType.ORDERSET); - if ("Organization".equals(codeString)) - return new Enumeration(this, ResourceType.ORGANIZATION); - if ("Parameters".equals(codeString)) - return new Enumeration(this, ResourceType.PARAMETERS); - if ("Patient".equals(codeString)) - return new Enumeration(this, ResourceType.PATIENT); - if ("PaymentNotice".equals(codeString)) - return new Enumeration(this, ResourceType.PAYMENTNOTICE); - if ("PaymentReconciliation".equals(codeString)) - return new Enumeration(this, ResourceType.PAYMENTRECONCILIATION); - if ("Person".equals(codeString)) - return new Enumeration(this, ResourceType.PERSON); - if ("Practitioner".equals(codeString)) - return new Enumeration(this, ResourceType.PRACTITIONER); - if ("PractitionerRole".equals(codeString)) - return new Enumeration(this, ResourceType.PRACTITIONERROLE); - if ("Procedure".equals(codeString)) - return new Enumeration(this, ResourceType.PROCEDURE); - if ("ProcedureRequest".equals(codeString)) - return new Enumeration(this, ResourceType.PROCEDUREREQUEST); - if ("ProcessRequest".equals(codeString)) - return new Enumeration(this, ResourceType.PROCESSREQUEST); - if ("ProcessResponse".equals(codeString)) - return new Enumeration(this, ResourceType.PROCESSRESPONSE); - if ("Protocol".equals(codeString)) - return new Enumeration(this, ResourceType.PROTOCOL); - if ("Provenance".equals(codeString)) - return new Enumeration(this, ResourceType.PROVENANCE); - if ("Questionnaire".equals(codeString)) - return new Enumeration(this, ResourceType.QUESTIONNAIRE); - if ("QuestionnaireResponse".equals(codeString)) - return new Enumeration(this, ResourceType.QUESTIONNAIRERESPONSE); - if ("ReferralRequest".equals(codeString)) - return new Enumeration(this, ResourceType.REFERRALREQUEST); - if ("RelatedPerson".equals(codeString)) - return new Enumeration(this, ResourceType.RELATEDPERSON); - if ("Resource".equals(codeString)) - return new Enumeration(this, ResourceType.RESOURCE); - if ("RiskAssessment".equals(codeString)) - return new Enumeration(this, ResourceType.RISKASSESSMENT); - if ("Schedule".equals(codeString)) - return new Enumeration(this, ResourceType.SCHEDULE); - if ("SearchParameter".equals(codeString)) - return new Enumeration(this, ResourceType.SEARCHPARAMETER); - if ("Sequence".equals(codeString)) - return new Enumeration(this, ResourceType.SEQUENCE); - if ("Slot".equals(codeString)) - return new Enumeration(this, ResourceType.SLOT); - if ("Specimen".equals(codeString)) - return new Enumeration(this, ResourceType.SPECIMEN); - if ("StructureDefinition".equals(codeString)) - return new Enumeration(this, ResourceType.STRUCTUREDEFINITION); - if ("StructureMap".equals(codeString)) - return new Enumeration(this, ResourceType.STRUCTUREMAP); - if ("Subscription".equals(codeString)) - return new Enumeration(this, ResourceType.SUBSCRIPTION); - if ("Substance".equals(codeString)) - return new Enumeration(this, ResourceType.SUBSTANCE); - if ("SupplyDelivery".equals(codeString)) - return new Enumeration(this, ResourceType.SUPPLYDELIVERY); - if ("SupplyRequest".equals(codeString)) - return new Enumeration(this, ResourceType.SUPPLYREQUEST); - if ("Task".equals(codeString)) - return new Enumeration(this, ResourceType.TASK); - if ("TestScript".equals(codeString)) - return new Enumeration(this, ResourceType.TESTSCRIPT); - if ("ValueSet".equals(codeString)) - return new Enumeration(this, ResourceType.VALUESET); - if ("VisionPrescription".equals(codeString)) - return new Enumeration(this, ResourceType.VISIONPRESCRIPTION); - throw new FHIRException("Unknown ResourceType code '"+codeString+"'"); - } - public String toCode(ResourceType code) { - if (code == ResourceType.ACCOUNT) - return "Account"; - if (code == ResourceType.ALLERGYINTOLERANCE) - return "AllergyIntolerance"; - if (code == ResourceType.APPOINTMENT) - return "Appointment"; - if (code == ResourceType.APPOINTMENTRESPONSE) - return "AppointmentResponse"; - if (code == ResourceType.AUDITEVENT) - return "AuditEvent"; - if (code == ResourceType.BASIC) - return "Basic"; - if (code == ResourceType.BINARY) - return "Binary"; - if (code == ResourceType.BODYSITE) - return "BodySite"; - if (code == ResourceType.BUNDLE) - return "Bundle"; - if (code == ResourceType.CAREPLAN) - return "CarePlan"; - if (code == ResourceType.CARETEAM) - return "CareTeam"; - if (code == ResourceType.CLAIM) - return "Claim"; - if (code == ResourceType.CLAIMRESPONSE) - return "ClaimResponse"; - if (code == ResourceType.CLINICALIMPRESSION) - return "ClinicalImpression"; - if (code == ResourceType.CODESYSTEM) - return "CodeSystem"; - if (code == ResourceType.COMMUNICATION) - return "Communication"; - if (code == ResourceType.COMMUNICATIONREQUEST) - return "CommunicationRequest"; - if (code == ResourceType.COMPARTMENTDEFINITION) - return "CompartmentDefinition"; - if (code == ResourceType.COMPOSITION) - return "Composition"; - if (code == ResourceType.CONCEPTMAP) - return "ConceptMap"; - if (code == ResourceType.CONDITION) - return "Condition"; - if (code == ResourceType.CONFORMANCE) - return "Conformance"; - if (code == ResourceType.CONTRACT) - return "Contract"; - if (code == ResourceType.COVERAGE) - return "Coverage"; - if (code == ResourceType.DATAELEMENT) - return "DataElement"; - if (code == ResourceType.DECISIONSUPPORTRULE) - return "DecisionSupportRule"; - if (code == ResourceType.DECISIONSUPPORTSERVICEMODULE) - return "DecisionSupportServiceModule"; - if (code == ResourceType.DETECTEDISSUE) - return "DetectedIssue"; - if (code == ResourceType.DEVICE) - return "Device"; - if (code == ResourceType.DEVICECOMPONENT) - return "DeviceComponent"; - if (code == ResourceType.DEVICEMETRIC) - return "DeviceMetric"; - if (code == ResourceType.DEVICEUSEREQUEST) - return "DeviceUseRequest"; - if (code == ResourceType.DEVICEUSESTATEMENT) - return "DeviceUseStatement"; - if (code == ResourceType.DIAGNOSTICORDER) - return "DiagnosticOrder"; - if (code == ResourceType.DIAGNOSTICREPORT) - return "DiagnosticReport"; - if (code == ResourceType.DOCUMENTMANIFEST) - return "DocumentManifest"; - if (code == ResourceType.DOCUMENTREFERENCE) - return "DocumentReference"; - if (code == ResourceType.DOMAINRESOURCE) - return "DomainResource"; - if (code == ResourceType.ELIGIBILITYREQUEST) - return "EligibilityRequest"; - if (code == ResourceType.ELIGIBILITYRESPONSE) - return "EligibilityResponse"; - if (code == ResourceType.ENCOUNTER) - return "Encounter"; - if (code == ResourceType.ENROLLMENTREQUEST) - return "EnrollmentRequest"; - if (code == ResourceType.ENROLLMENTRESPONSE) - return "EnrollmentResponse"; - if (code == ResourceType.EPISODEOFCARE) - return "EpisodeOfCare"; - if (code == ResourceType.EXPANSIONPROFILE) - return "ExpansionProfile"; - if (code == ResourceType.EXPLANATIONOFBENEFIT) - return "ExplanationOfBenefit"; - if (code == ResourceType.FAMILYMEMBERHISTORY) - return "FamilyMemberHistory"; - if (code == ResourceType.FLAG) - return "Flag"; - if (code == ResourceType.GOAL) - return "Goal"; - if (code == ResourceType.GROUP) - return "Group"; - if (code == ResourceType.GUIDANCERESPONSE) - return "GuidanceResponse"; - if (code == ResourceType.HEALTHCARESERVICE) - return "HealthcareService"; - if (code == ResourceType.IMAGINGEXCERPT) - return "ImagingExcerpt"; - if (code == ResourceType.IMAGINGOBJECTSELECTION) - return "ImagingObjectSelection"; - if (code == ResourceType.IMAGINGSTUDY) - return "ImagingStudy"; - if (code == ResourceType.IMMUNIZATION) - return "Immunization"; - if (code == ResourceType.IMMUNIZATIONRECOMMENDATION) - return "ImmunizationRecommendation"; - if (code == ResourceType.IMPLEMENTATIONGUIDE) - return "ImplementationGuide"; - if (code == ResourceType.LIBRARY) - return "Library"; - if (code == ResourceType.LINKAGE) - return "Linkage"; - if (code == ResourceType.LIST) - return "List"; - if (code == ResourceType.LOCATION) - return "Location"; - if (code == ResourceType.MEASURE) - return "Measure"; - if (code == ResourceType.MEASUREREPORT) - return "MeasureReport"; - if (code == ResourceType.MEDIA) - return "Media"; - if (code == ResourceType.MEDICATION) - return "Medication"; - if (code == ResourceType.MEDICATIONADMINISTRATION) - return "MedicationAdministration"; - if (code == ResourceType.MEDICATIONDISPENSE) - return "MedicationDispense"; - if (code == ResourceType.MEDICATIONORDER) - return "MedicationOrder"; - if (code == ResourceType.MEDICATIONSTATEMENT) - return "MedicationStatement"; - if (code == ResourceType.MESSAGEHEADER) - return "MessageHeader"; - if (code == ResourceType.MODULEDEFINITION) - return "ModuleDefinition"; - if (code == ResourceType.NAMINGSYSTEM) - return "NamingSystem"; - if (code == ResourceType.NUTRITIONORDER) - return "NutritionOrder"; - if (code == ResourceType.OBSERVATION) - return "Observation"; - if (code == ResourceType.OPERATIONDEFINITION) - return "OperationDefinition"; - if (code == ResourceType.OPERATIONOUTCOME) - return "OperationOutcome"; - if (code == ResourceType.ORDER) - return "Order"; - if (code == ResourceType.ORDERRESPONSE) - return "OrderResponse"; - if (code == ResourceType.ORDERSET) - return "OrderSet"; - if (code == ResourceType.ORGANIZATION) - return "Organization"; - if (code == ResourceType.PARAMETERS) - return "Parameters"; - if (code == ResourceType.PATIENT) - return "Patient"; - if (code == ResourceType.PAYMENTNOTICE) - return "PaymentNotice"; - if (code == ResourceType.PAYMENTRECONCILIATION) - return "PaymentReconciliation"; - if (code == ResourceType.PERSON) - return "Person"; - if (code == ResourceType.PRACTITIONER) - return "Practitioner"; - if (code == ResourceType.PRACTITIONERROLE) - return "PractitionerRole"; - if (code == ResourceType.PROCEDURE) - return "Procedure"; - if (code == ResourceType.PROCEDUREREQUEST) - return "ProcedureRequest"; - if (code == ResourceType.PROCESSREQUEST) - return "ProcessRequest"; - if (code == ResourceType.PROCESSRESPONSE) - return "ProcessResponse"; - if (code == ResourceType.PROTOCOL) - return "Protocol"; - if (code == ResourceType.PROVENANCE) - return "Provenance"; - if (code == ResourceType.QUESTIONNAIRE) - return "Questionnaire"; - if (code == ResourceType.QUESTIONNAIRERESPONSE) - return "QuestionnaireResponse"; - if (code == ResourceType.REFERRALREQUEST) - return "ReferralRequest"; - if (code == ResourceType.RELATEDPERSON) - return "RelatedPerson"; - if (code == ResourceType.RESOURCE) - return "Resource"; - if (code == ResourceType.RISKASSESSMENT) - return "RiskAssessment"; - if (code == ResourceType.SCHEDULE) - return "Schedule"; - if (code == ResourceType.SEARCHPARAMETER) - return "SearchParameter"; - if (code == ResourceType.SEQUENCE) - return "Sequence"; - if (code == ResourceType.SLOT) - return "Slot"; - if (code == ResourceType.SPECIMEN) - return "Specimen"; - if (code == ResourceType.STRUCTUREDEFINITION) - return "StructureDefinition"; - if (code == ResourceType.STRUCTUREMAP) - return "StructureMap"; - if (code == ResourceType.SUBSCRIPTION) - return "Subscription"; - if (code == ResourceType.SUBSTANCE) - return "Substance"; - if (code == ResourceType.SUPPLYDELIVERY) - return "SupplyDelivery"; - if (code == ResourceType.SUPPLYREQUEST) - return "SupplyRequest"; - if (code == ResourceType.TASK) - return "Task"; - if (code == ResourceType.TESTSCRIPT) - return "TestScript"; - if (code == ResourceType.VALUESET) - return "ValueSet"; - if (code == ResourceType.VISIONPRESCRIPTION) - return "VisionPrescription"; - return "?"; - } - public String toSystem(ResourceType code) { - return code.getSystem(); - } - } - - public enum SearchParamType { - /** - * Search parameter SHALL be a number (a whole number, or a decimal). - */ - NUMBER, - /** - * Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported. - */ - DATE, - /** - * Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces. - */ - STRING, - /** - * Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a "|", depending on the modifier used. - */ - TOKEN, - /** - * A reference to another resource. - */ - REFERENCE, - /** - * A composite search parameter that combines a search on two values together. - */ - COMPOSITE, - /** - * A search parameter that searches on a quantity. - */ - QUANTITY, - /** - * A search parameter that searches on a URI (RFC 3986). - */ - URI, - /** - * added to help the parsers - */ - NULL; - public static SearchParamType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return NUMBER; - if ("date".equals(codeString)) - return DATE; - if ("string".equals(codeString)) - return STRING; - if ("token".equals(codeString)) - return TOKEN; - if ("reference".equals(codeString)) - return REFERENCE; - if ("composite".equals(codeString)) - return COMPOSITE; - if ("quantity".equals(codeString)) - return QUANTITY; - if ("uri".equals(codeString)) - return URI; - throw new FHIRException("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NUMBER: return "number"; - case DATE: return "date"; - case STRING: return "string"; - case TOKEN: return "token"; - case REFERENCE: return "reference"; - case COMPOSITE: return "composite"; - case QUANTITY: return "quantity"; - case URI: return "uri"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NUMBER: return "http://hl7.org/fhir/search-param-type"; - case DATE: return "http://hl7.org/fhir/search-param-type"; - case STRING: return "http://hl7.org/fhir/search-param-type"; - case TOKEN: return "http://hl7.org/fhir/search-param-type"; - case REFERENCE: return "http://hl7.org/fhir/search-param-type"; - case COMPOSITE: return "http://hl7.org/fhir/search-param-type"; - case QUANTITY: return "http://hl7.org/fhir/search-param-type"; - case URI: return "http://hl7.org/fhir/search-param-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NUMBER: return "Search parameter SHALL be a number (a whole number, or a decimal)."; - case DATE: return "Search parameter is on a date/time. The date format is the standard XML format, though other formats may be supported."; - case STRING: return "Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May match just the start of a string. String parameters may contain spaces."; - case TOKEN: return "Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair of namespace and value, separated by a \"|\", depending on the modifier used."; - case REFERENCE: return "A reference to another resource."; - case COMPOSITE: return "A composite search parameter that combines a search on two values together."; - case QUANTITY: return "A search parameter that searches on a quantity."; - case URI: return "A search parameter that searches on a URI (RFC 3986)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NUMBER: return "Number"; - case DATE: return "Date/DateTime"; - case STRING: return "String"; - case TOKEN: return "Token"; - case REFERENCE: return "Reference"; - case COMPOSITE: return "Composite"; - case QUANTITY: return "Quantity"; - case URI: return "URI"; - default: return "?"; - } - } - } - - public static class SearchParamTypeEnumFactory implements EnumFactory { - public SearchParamType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return SearchParamType.NUMBER; - if ("date".equals(codeString)) - return SearchParamType.DATE; - if ("string".equals(codeString)) - return SearchParamType.STRING; - if ("token".equals(codeString)) - return SearchParamType.TOKEN; - if ("reference".equals(codeString)) - return SearchParamType.REFERENCE; - if ("composite".equals(codeString)) - return SearchParamType.COMPOSITE; - if ("quantity".equals(codeString)) - return SearchParamType.QUANTITY; - if ("uri".equals(codeString)) - return SearchParamType.URI; - throw new IllegalArgumentException("Unknown SearchParamType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("number".equals(codeString)) - return new Enumeration(this, SearchParamType.NUMBER); - if ("date".equals(codeString)) - return new Enumeration(this, SearchParamType.DATE); - if ("string".equals(codeString)) - return new Enumeration(this, SearchParamType.STRING); - if ("token".equals(codeString)) - return new Enumeration(this, SearchParamType.TOKEN); - if ("reference".equals(codeString)) - return new Enumeration(this, SearchParamType.REFERENCE); - if ("composite".equals(codeString)) - return new Enumeration(this, SearchParamType.COMPOSITE); - if ("quantity".equals(codeString)) - return new Enumeration(this, SearchParamType.QUANTITY); - if ("uri".equals(codeString)) - return new Enumeration(this, SearchParamType.URI); - throw new FHIRException("Unknown SearchParamType code '"+codeString+"'"); - } - public String toCode(SearchParamType code) { - if (code == SearchParamType.NUMBER) - return "number"; - if (code == SearchParamType.DATE) - return "date"; - if (code == SearchParamType.STRING) - return "string"; - if (code == SearchParamType.TOKEN) - return "token"; - if (code == SearchParamType.REFERENCE) - return "reference"; - if (code == SearchParamType.COMPOSITE) - return "composite"; - if (code == SearchParamType.QUANTITY) - return "quantity"; - if (code == SearchParamType.URI) - return "uri"; - return "?"; - } - public String toSystem(SearchParamType code) { - return code.getSystem(); - } - } - - public enum SpecialValues { - /** - * Boolean true. - */ - TRUE, - /** - * Boolean false. - */ - FALSE, - /** - * The content is greater than zero, but too small to be quantified. - */ - TRACE, - /** - * The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material. - */ - SUFFICIENT, - /** - * The value is no longer available. - */ - WITHDRAWN, - /** - * The are no known applicable values in this context. - */ - NILKNOWN, - /** - * added to help the parsers - */ - NULL; - public static SpecialValues fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("true".equals(codeString)) - return TRUE; - if ("false".equals(codeString)) - return FALSE; - if ("trace".equals(codeString)) - return TRACE; - if ("sufficient".equals(codeString)) - return SUFFICIENT; - if ("withdrawn".equals(codeString)) - return WITHDRAWN; - if ("nil-known".equals(codeString)) - return NILKNOWN; - throw new FHIRException("Unknown SpecialValues code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case TRUE: return "true"; - case FALSE: return "false"; - case TRACE: return "trace"; - case SUFFICIENT: return "sufficient"; - case WITHDRAWN: return "withdrawn"; - case NILKNOWN: return "nil-known"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TRUE: return "http://hl7.org/fhir/special-values"; - case FALSE: return "http://hl7.org/fhir/special-values"; - case TRACE: return "http://hl7.org/fhir/special-values"; - case SUFFICIENT: return "http://hl7.org/fhir/special-values"; - case WITHDRAWN: return "http://hl7.org/fhir/special-values"; - case NILKNOWN: return "http://hl7.org/fhir/special-values"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TRUE: return "Boolean true."; - case FALSE: return "Boolean false."; - case TRACE: return "The content is greater than zero, but too small to be quantified."; - case SUFFICIENT: return "The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the bulk of the material."; - case WITHDRAWN: return "The value is no longer available."; - case NILKNOWN: return "The are no known applicable values in this context."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TRUE: return "true"; - case FALSE: return "false"; - case TRACE: return "Trace Amount Detected"; - case SUFFICIENT: return "Sufficient Quantity"; - case WITHDRAWN: return "Value Withdrawn"; - case NILKNOWN: return "Nil Known"; - default: return "?"; - } - } - } - - public static class SpecialValuesEnumFactory implements EnumFactory { - public SpecialValues fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("true".equals(codeString)) - return SpecialValues.TRUE; - if ("false".equals(codeString)) - return SpecialValues.FALSE; - if ("trace".equals(codeString)) - return SpecialValues.TRACE; - if ("sufficient".equals(codeString)) - return SpecialValues.SUFFICIENT; - if ("withdrawn".equals(codeString)) - return SpecialValues.WITHDRAWN; - if ("nil-known".equals(codeString)) - return SpecialValues.NILKNOWN; - throw new IllegalArgumentException("Unknown SpecialValues code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("true".equals(codeString)) - return new Enumeration(this, SpecialValues.TRUE); - if ("false".equals(codeString)) - return new Enumeration(this, SpecialValues.FALSE); - if ("trace".equals(codeString)) - return new Enumeration(this, SpecialValues.TRACE); - if ("sufficient".equals(codeString)) - return new Enumeration(this, SpecialValues.SUFFICIENT); - if ("withdrawn".equals(codeString)) - return new Enumeration(this, SpecialValues.WITHDRAWN); - if ("nil-known".equals(codeString)) - return new Enumeration(this, SpecialValues.NILKNOWN); - throw new FHIRException("Unknown SpecialValues code '"+codeString+"'"); - } - public String toCode(SpecialValues code) { - if (code == SpecialValues.TRUE) - return "true"; - if (code == SpecialValues.FALSE) - return "false"; - if (code == SpecialValues.TRACE) - return "trace"; - if (code == SpecialValues.SUFFICIENT) - return "sufficient"; - if (code == SpecialValues.WITHDRAWN) - return "withdrawn"; - if (code == SpecialValues.NILKNOWN) - return "nil-known"; - return "?"; - } - public String toSystem(SpecialValues code) { - return code.getSystem(); - } - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java deleted file mode 100644 index d5afe101dd5..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/EpisodeOfCare.java +++ /dev/null @@ -1,1500 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time. - */ -@ResourceDef(name="EpisodeOfCare", profile="http://hl7.org/fhir/Profile/EpisodeOfCare") -public class EpisodeOfCare extends DomainResource { - - public enum EpisodeOfCareStatus { - /** - * This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services. - */ - PLANNED, - /** - * This episode has been placed on a waitlist, pending the episode being made active (or cancelled). - */ - WAITLIST, - /** - * This episode of care is current. - */ - ACTIVE, - /** - * This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite). - */ - ONHOLD, - /** - * This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as "closed", "completed" or other similar terms. - */ - FINISHED, - /** - * The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static EpisodeOfCareStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return PLANNED; - if ("waitlist".equals(codeString)) - return WAITLIST; - if ("active".equals(codeString)) - return ACTIVE; - if ("onhold".equals(codeString)) - return ONHOLD; - if ("finished".equals(codeString)) - return FINISHED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PLANNED: return "planned"; - case WAITLIST: return "waitlist"; - case ACTIVE: return "active"; - case ONHOLD: return "onhold"; - case FINISHED: return "finished"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PLANNED: return "http://hl7.org/fhir/episode-of-care-status"; - case WAITLIST: return "http://hl7.org/fhir/episode-of-care-status"; - case ACTIVE: return "http://hl7.org/fhir/episode-of-care-status"; - case ONHOLD: return "http://hl7.org/fhir/episode-of-care-status"; - case FINISHED: return "http://hl7.org/fhir/episode-of-care-status"; - case CANCELLED: return "http://hl7.org/fhir/episode-of-care-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PLANNED: return "This episode of care is planned to start at the date specified in the period.start. During this status an organization may perform assessments to determine if they are eligible to receive services, or be organizing to make resources available to provide care services."; - case WAITLIST: return "This episode has been placed on a waitlist, pending the episode being made active (or cancelled)."; - case ACTIVE: return "This episode of care is current."; - case ONHOLD: return "This episode of care is on hold, the organization has limited responsibility for the patient (such as while on respite)."; - case FINISHED: return "This episode of care is finished at the organization is not expecting to be providing care to the patient. Can also be known as \"closed\", \"completed\" or other similar terms."; - case CANCELLED: return "The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the care. It indicates that services terminated outside the planned/expected workflow."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PLANNED: return "Planned"; - case WAITLIST: return "Waitlist"; - case ACTIVE: return "Active"; - case ONHOLD: return "On Hold"; - case FINISHED: return "Finished"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class EpisodeOfCareStatusEnumFactory implements EnumFactory { - public EpisodeOfCareStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return EpisodeOfCareStatus.PLANNED; - if ("waitlist".equals(codeString)) - return EpisodeOfCareStatus.WAITLIST; - if ("active".equals(codeString)) - return EpisodeOfCareStatus.ACTIVE; - if ("onhold".equals(codeString)) - return EpisodeOfCareStatus.ONHOLD; - if ("finished".equals(codeString)) - return EpisodeOfCareStatus.FINISHED; - if ("cancelled".equals(codeString)) - return EpisodeOfCareStatus.CANCELLED; - throw new IllegalArgumentException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("planned".equals(codeString)) - return new Enumeration(this, EpisodeOfCareStatus.PLANNED); - if ("waitlist".equals(codeString)) - return new Enumeration(this, EpisodeOfCareStatus.WAITLIST); - if ("active".equals(codeString)) - return new Enumeration(this, EpisodeOfCareStatus.ACTIVE); - if ("onhold".equals(codeString)) - return new Enumeration(this, EpisodeOfCareStatus.ONHOLD); - if ("finished".equals(codeString)) - return new Enumeration(this, EpisodeOfCareStatus.FINISHED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, EpisodeOfCareStatus.CANCELLED); - throw new FHIRException("Unknown EpisodeOfCareStatus code '"+codeString+"'"); - } - public String toCode(EpisodeOfCareStatus code) { - if (code == EpisodeOfCareStatus.PLANNED) - return "planned"; - if (code == EpisodeOfCareStatus.WAITLIST) - return "waitlist"; - if (code == EpisodeOfCareStatus.ACTIVE) - return "active"; - if (code == EpisodeOfCareStatus.ONHOLD) - return "onhold"; - if (code == EpisodeOfCareStatus.FINISHED) - return "finished"; - if (code == EpisodeOfCareStatus.CANCELLED) - return "cancelled"; - return "?"; - } - public String toSystem(EpisodeOfCareStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class EpisodeOfCareStatusHistoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * planned | waitlist | active | onhold | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) - protected Enumeration status; - - /** - * The period during this EpisodeOfCare that the specific status applied. - */ - @Child(name = "period", type = {Period.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Period for the status", formalDefinition="The period during this EpisodeOfCare that the specific status applied." ) - protected Period period; - - private static final long serialVersionUID = -1192432864L; - - /** - * Constructor - */ - public EpisodeOfCareStatusHistoryComponent() { - super(); - } - - /** - * Constructor - */ - public EpisodeOfCareStatusHistoryComponent(Enumeration status, Period period) { - super(); - this.status = status; - this.period = period; - } - - /** - * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EpisodeOfCareStatusHistoryComponent setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCareStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCareStatusHistoryComponent setStatus(EpisodeOfCareStatus value) { - if (this.status == null) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (The period during this EpisodeOfCare that the specific status applied.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCareStatusHistoryComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during this EpisodeOfCare that the specific status applied.) - */ - public EpisodeOfCareStatusHistoryComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "The period during this EpisodeOfCare that the specific status applied.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -892481550: // status - this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("status")) - this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.status"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public EpisodeOfCareStatusHistoryComponent copy() { - EpisodeOfCareStatusHistoryComponent dst = new EpisodeOfCareStatusHistoryComponent(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) - return false; - EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; - return compareDeep(status, o.status, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EpisodeOfCareStatusHistoryComponent)) - return false; - EpisodeOfCareStatusHistoryComponent o = (EpisodeOfCareStatusHistoryComponent) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - public String fhirType() { - return "EpisodeOfCare.statusHistory"; - - } - - } - - /** - * Identifier(s) by which this EpisodeOfCare is known. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Identifier(s) for the EpisodeOfCare", formalDefinition="Identifier(s) by which this EpisodeOfCare is known." ) - protected List identifier; - - /** - * planned | waitlist | active | onhold | finished | cancelled. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="planned | waitlist | active | onhold | finished | cancelled", formalDefinition="planned | waitlist | active | onhold | finished | cancelled." ) - protected Enumeration status; - - /** - * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource). - */ - @Child(name = "statusHistory", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Past list of status codes", formalDefinition="The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource)." ) - protected List statusHistory; - - /** - * A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Type/class - e.g. specialist referral, disease management", formalDefinition="A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care." ) - protected List type; - - /** - * A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for. - */ - @Child(name = "condition", type = {Condition.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Conditions/problems/diagnoses this episode of care is for", formalDefinition="A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for." ) - protected List condition; - /** - * The actual objects that are the target of the reference (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - protected List conditionTarget; - - - /** - * The patient that this EpisodeOfCare applies to. - */ - @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient for this episode of care", formalDefinition="The patient that this EpisodeOfCare applies to." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient that this EpisodeOfCare applies to.) - */ - protected Patient patientTarget; - - /** - * The organization that has assumed the specific responsibilities for the specified duration. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization that assumes care", formalDefinition="The organization that has assumed the specific responsibilities for the specified duration." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization that has assumed the specific responsibilities for the specified duration.) - */ - protected Organization managingOrganizationTarget; - - /** - * The interval during which the managing organization assumes the defined responsibility. - */ - @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Interval during responsibility is assumed", formalDefinition="The interval during which the managing organization assumes the defined responsibility." ) - protected Period period; - - /** - * Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals. - */ - @Child(name = "referralRequest", type = {ReferralRequest.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Originating Referral Request(s)", formalDefinition="Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals." ) - protected List referralRequest; - /** - * The actual objects that are the target of the reference (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - protected List referralRequestTarget; - - - /** - * The practitioner that is the care manager/care co-ordinator for this patient. - */ - @Child(name = "careManager", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Care manager/care co-ordinator for the patient", formalDefinition="The practitioner that is the care manager/care co-ordinator for this patient." ) - protected Reference careManager; - - /** - * The actual object that is the target of the reference (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - protected Practitioner careManagerTarget; - - /** - * The list of practitioners that may be facilitating this episode of care for specific purposes. - */ - @Child(name = "team", type = {CareTeam.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Other practitioners facilitating this episode of care", formalDefinition="The list of practitioners that may be facilitating this episode of care for specific purposes." ) - protected List team; - /** - * The actual objects that are the target of the reference (The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - protected List teamTarget; - - - private static final long serialVersionUID = 922419354L; - - /** - * Constructor - */ - public EpisodeOfCare() { - super(); - } - - /** - * Constructor - */ - public EpisodeOfCare(Enumeration status, Reference patient) { - super(); - this.status = status; - this.patient = patient; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier(s) by which this EpisodeOfCare is known.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (planned | waitlist | active | onhold | finished | cancelled.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public EpisodeOfCare setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCareStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value planned | waitlist | active | onhold | finished | cancelled. - */ - public EpisodeOfCare setStatus(EpisodeOfCareStatus value) { - if (this.status == null) - this.status = new Enumeration(new EpisodeOfCareStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).) - */ - public List getStatusHistory() { - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - return this.statusHistory; - } - - public boolean hasStatusHistory() { - if (this.statusHistory == null) - return false; - for (EpisodeOfCareStatusHistoryComponent item : this.statusHistory) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #statusHistory} (The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).) - */ - // syntactic sugar - public EpisodeOfCareStatusHistoryComponent addStatusHistory() { //3 - EpisodeOfCareStatusHistoryComponent t = new EpisodeOfCareStatusHistoryComponent(); - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addStatusHistory(EpisodeOfCareStatusHistoryComponent t) { //3 - if (t == null) - return this; - if (this.statusHistory == null) - this.statusHistory = new ArrayList(); - this.statusHistory.add(t); - return this; - } - - /** - * @return {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - public List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (Reference item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - // syntactic sugar - public Reference addCondition() { //3 - Reference t = new Reference(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addCondition(Reference t) { //3 - if (t == null) - return this; - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - /** - * @return {@link #condition} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - public List getConditionTarget() { - if (this.conditionTarget == null) - this.conditionTarget = new ArrayList(); - return this.conditionTarget; - } - - // syntactic sugar - /** - * @return {@link #condition} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.) - */ - public Condition addConditionTarget() { - Condition r = new Condition(); - if (this.conditionTarget == null) - this.conditionTarget = new ArrayList(); - this.conditionTarget.add(r); - return r; - } - - /** - * @return {@link #patient} (The patient that this EpisodeOfCare applies to.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient that this EpisodeOfCare applies to.) - */ - public EpisodeOfCare setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient that this EpisodeOfCare applies to.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient that this EpisodeOfCare applies to.) - */ - public EpisodeOfCare setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public EpisodeOfCare setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that has assumed the specific responsibilities for the specified duration.) - */ - public EpisodeOfCare setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #period} (The interval during which the managing organization assumes the defined responsibility.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The interval during which the managing organization assumes the defined responsibility.) - */ - public EpisodeOfCare setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - public List getReferralRequest() { - if (this.referralRequest == null) - this.referralRequest = new ArrayList(); - return this.referralRequest; - } - - public boolean hasReferralRequest() { - if (this.referralRequest == null) - return false; - for (Reference item : this.referralRequest) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referralRequest} (Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - // syntactic sugar - public Reference addReferralRequest() { //3 - Reference t = new Reference(); - if (this.referralRequest == null) - this.referralRequest = new ArrayList(); - this.referralRequest.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addReferralRequest(Reference t) { //3 - if (t == null) - return this; - if (this.referralRequest == null) - this.referralRequest = new ArrayList(); - this.referralRequest.add(t); - return this; - } - - /** - * @return {@link #referralRequest} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - public List getReferralRequestTarget() { - if (this.referralRequestTarget == null) - this.referralRequestTarget = new ArrayList(); - return this.referralRequestTarget; - } - - // syntactic sugar - /** - * @return {@link #referralRequest} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.) - */ - public ReferralRequest addReferralRequestTarget() { - ReferralRequest r = new ReferralRequest(); - if (this.referralRequestTarget == null) - this.referralRequestTarget = new ArrayList(); - this.referralRequestTarget.add(r); - return r; - } - - /** - * @return {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public Reference getCareManager() { - if (this.careManager == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); - else if (Configuration.doAutoCreate()) - this.careManager = new Reference(); // cc - return this.careManager; - } - - public boolean hasCareManager() { - return this.careManager != null && !this.careManager.isEmpty(); - } - - /** - * @param value {@link #careManager} (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public EpisodeOfCare setCareManager(Reference value) { - this.careManager = value; - return this; - } - - /** - * @return {@link #careManager} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public Practitioner getCareManagerTarget() { - if (this.careManagerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create EpisodeOfCare.careManager"); - else if (Configuration.doAutoCreate()) - this.careManagerTarget = new Practitioner(); // aa - return this.careManagerTarget; - } - - /** - * @param value {@link #careManager} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that is the care manager/care co-ordinator for this patient.) - */ - public EpisodeOfCare setCareManagerTarget(Practitioner value) { - this.careManagerTarget = value; - return this; - } - - /** - * @return {@link #team} (The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - public List getTeam() { - if (this.team == null) - this.team = new ArrayList(); - return this.team; - } - - public boolean hasTeam() { - if (this.team == null) - return false; - for (Reference item : this.team) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #team} (The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - // syntactic sugar - public Reference addTeam() { //3 - Reference t = new Reference(); - if (this.team == null) - this.team = new ArrayList(); - this.team.add(t); - return t; - } - - // syntactic sugar - public EpisodeOfCare addTeam(Reference t) { //3 - if (t == null) - return this; - if (this.team == null) - this.team = new ArrayList(); - this.team.add(t); - return this; - } - - /** - * @return {@link #team} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - public List getTeamTarget() { - if (this.teamTarget == null) - this.teamTarget = new ArrayList(); - return this.teamTarget; - } - - // syntactic sugar - /** - * @return {@link #team} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The list of practitioners that may be facilitating this episode of care for specific purposes.) - */ - public CareTeam addTeamTarget() { - CareTeam r = new CareTeam(); - if (this.teamTarget == null) - this.teamTarget = new ArrayList(); - this.teamTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier(s) by which this EpisodeOfCare is known.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "planned | waitlist | active | onhold | finished | cancelled.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusHistory", "", "The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the resource).", 0, java.lang.Integer.MAX_VALUE, statusHistory)); - childrenList.add(new Property("type", "CodeableConcept", "A classification of the type of episode of care; e.g. specialist referral, disease management, type of funded care.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("condition", "Reference(Condition)", "A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient that this EpisodeOfCare applies to.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that has assumed the specific responsibilities for the specified duration.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("period", "Period", "The interval during which the managing organization assumes the defined responsibility.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("referralRequest", "Reference(ReferralRequest)", "Referral Request(s) that are fulfilled by this EpisodeOfCare, incoming referrals.", 0, java.lang.Integer.MAX_VALUE, referralRequest)); - childrenList.add(new Property("careManager", "Reference(Practitioner)", "The practitioner that is the care manager/care co-ordinator for this patient.", 0, java.lang.Integer.MAX_VALUE, careManager)); - childrenList.add(new Property("team", "Reference(CareTeam)", "The list of practitioners that may be facilitating this episode of care for specific purposes.", 0, java.lang.Integer.MAX_VALUE, team)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -986695614: /*statusHistory*/ return this.statusHistory == null ? new Base[0] : this.statusHistory.toArray(new Base[this.statusHistory.size()]); // EpisodeOfCareStatusHistoryComponent - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // Reference - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -310299598: /*referralRequest*/ return this.referralRequest == null ? new Base[0] : this.referralRequest.toArray(new Base[this.referralRequest.size()]); // Reference - case -1147746468: /*careManager*/ return this.careManager == null ? new Base[0] : new Base[] {this.careManager}; // Reference - case 3555933: /*team*/ return this.team == null ? new Base[0] : this.team.toArray(new Base[this.team.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration - break; - case -986695614: // statusHistory - this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); // EpisodeOfCareStatusHistoryComponent - break; - case 3575610: // type - this.getType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -861311717: // condition - this.getCondition().add(castToReference(value)); // Reference - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -2058947787: // managingOrganization - this.managingOrganization = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -310299598: // referralRequest - this.getReferralRequest().add(castToReference(value)); // Reference - break; - case -1147746468: // careManager - this.careManager = castToReference(value); // Reference - break; - case 3555933: // team - this.getTeam().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new EpisodeOfCareStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("statusHistory")) - this.getStatusHistory().add((EpisodeOfCareStatusHistoryComponent) value); - else if (name.equals("type")) - this.getType().add(castToCodeableConcept(value)); - else if (name.equals("condition")) - this.getCondition().add(castToReference(value)); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("managingOrganization")) - this.managingOrganization = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("referralRequest")) - this.getReferralRequest().add(castToReference(value)); - else if (name.equals("careManager")) - this.careManager = castToReference(value); // Reference - else if (name.equals("team")) - this.getTeam().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -986695614: return addStatusHistory(); // EpisodeOfCareStatusHistoryComponent - case 3575610: return addType(); // CodeableConcept - case -861311717: return addCondition(); // Reference - case -791418107: return getPatient(); // Reference - case -2058947787: return getManagingOrganization(); // Reference - case -991726143: return getPeriod(); // Period - case -310299598: return addReferralRequest(); // Reference - case -1147746468: return getCareManager(); // Reference - case 3555933: return addTeam(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type EpisodeOfCare.status"); - } - else if (name.equals("statusHistory")) { - return addStatusHistory(); - } - else if (name.equals("type")) { - return addType(); - } - else if (name.equals("condition")) { - return addCondition(); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("managingOrganization")) { - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("referralRequest")) { - return addReferralRequest(); - } - else if (name.equals("careManager")) { - this.careManager = new Reference(); - return this.careManager; - } - else if (name.equals("team")) { - return addTeam(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "EpisodeOfCare"; - - } - - public EpisodeOfCare copy() { - EpisodeOfCare dst = new EpisodeOfCare(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - if (statusHistory != null) { - dst.statusHistory = new ArrayList(); - for (EpisodeOfCareStatusHistoryComponent i : statusHistory) - dst.statusHistory.add(i.copy()); - }; - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - if (condition != null) { - dst.condition = new ArrayList(); - for (Reference i : condition) - dst.condition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.period = period == null ? null : period.copy(); - if (referralRequest != null) { - dst.referralRequest = new ArrayList(); - for (Reference i : referralRequest) - dst.referralRequest.add(i.copy()); - }; - dst.careManager = careManager == null ? null : careManager.copy(); - if (team != null) { - dst.team = new ArrayList(); - for (Reference i : team) - dst.team.add(i.copy()); - }; - return dst; - } - - protected EpisodeOfCare typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof EpisodeOfCare)) - return false; - EpisodeOfCare o = (EpisodeOfCare) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(statusHistory, o.statusHistory, true) - && compareDeep(type, o.type, true) && compareDeep(condition, o.condition, true) && compareDeep(patient, o.patient, true) - && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(period, o.period, true) - && compareDeep(referralRequest, o.referralRequest, true) && compareDeep(careManager, o.careManager, true) - && compareDeep(team, o.team, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof EpisodeOfCare)) - return false; - EpisodeOfCare o = (EpisodeOfCare) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (statusHistory == null || statusHistory.isEmpty()) && (type == null || type.isEmpty()) - && (condition == null || condition.isEmpty()) && (patient == null || patient.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (period == null || period.isEmpty()) && (referralRequest == null || referralRequest.isEmpty()) - && (careManager == null || careManager.isEmpty()) && (team == null || team.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.EpisodeOfCare; - } - - /** - * Search parameter: organization - *

- * Description: The organization that has assumed the specific responsibilities of this EpisodeOfCare
- * Type: reference
- * Path: EpisodeOfCare.managingOrganization
- *

- */ - @SearchParamDefinition(name="organization", path="EpisodeOfCare.managingOrganization", description="The organization that has assumed the specific responsibilities of this EpisodeOfCare", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - /** - * Fluent Client search parameter constant for organization - *

- * Description: The organization that has assumed the specific responsibilities of this EpisodeOfCare
- * Type: reference
- * Path: EpisodeOfCare.managingOrganization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EpisodeOfCare:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:organization").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Patient for this episode of care
- * Type: reference
- * Path: EpisodeOfCare.patient
- *

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

- * Description: Patient for this episode of care
- * Type: reference
- * Path: EpisodeOfCare.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EpisodeOfCare:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:patient").toLocked(); - - /** - * Search parameter: condition - *

- * Description: Conditions/problems/diagnoses this episode of care is for
- * Type: reference
- * Path: EpisodeOfCare.condition
- *

- */ - @SearchParamDefinition(name="condition", path="EpisodeOfCare.condition", description="Conditions/problems/diagnoses this episode of care is for", type="reference" ) - public static final String SP_CONDITION = "condition"; - /** - * Fluent Client search parameter constant for condition - *

- * Description: Conditions/problems/diagnoses this episode of care is for
- * Type: reference
- * Path: EpisodeOfCare.condition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EpisodeOfCare:condition". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:condition").toLocked(); - - /** - * Search parameter: status - *

- * Description: The current status of the Episode of Care as provided (does not check the status history collection)
- * Type: token
- * Path: EpisodeOfCare.status
- *

- */ - @SearchParamDefinition(name="status", path="EpisodeOfCare.status", description="The current status of the Episode of Care as provided (does not check the status history collection)", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: The current status of the Episode of Care as provided (does not check the status history collection)
- * Type: token
- * Path: EpisodeOfCare.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: care-manager - *

- * Description: Care manager/care co-ordinator for the patient
- * Type: reference
- * Path: EpisodeOfCare.careManager
- *

- */ - @SearchParamDefinition(name="care-manager", path="EpisodeOfCare.careManager", description="Care manager/care co-ordinator for the patient", type="reference" ) - public static final String SP_CARE_MANAGER = "care-manager"; - /** - * Fluent Client search parameter constant for care-manager - *

- * Description: Care manager/care co-ordinator for the patient
- * Type: reference
- * Path: EpisodeOfCare.careManager
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CARE_MANAGER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CARE_MANAGER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EpisodeOfCare:care-manager". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CARE_MANAGER = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:care-manager").toLocked(); - - /** - * Search parameter: type - *

- * Description: Type/class - e.g. specialist referral, disease management
- * Type: token
- * Path: EpisodeOfCare.type
- *

- */ - @SearchParamDefinition(name="type", path="EpisodeOfCare.type", description="Type/class - e.g. specialist referral, disease management", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Type/class - e.g. specialist referral, disease management
- * Type: token
- * Path: EpisodeOfCare.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: The provided date search value falls within the episode of care's period
- * Type: date
- * Path: EpisodeOfCare.period
- *

- */ - @SearchParamDefinition(name="date", path="EpisodeOfCare.period", description="The provided date search value falls within the episode of care's period", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: The provided date search value falls within the episode of care's period
- * Type: date
- * Path: EpisodeOfCare.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: incomingreferral - *

- * Description: Incoming Referral Request
- * Type: reference
- * Path: EpisodeOfCare.referralRequest
- *

- */ - @SearchParamDefinition(name="incomingreferral", path="EpisodeOfCare.referralRequest", description="Incoming Referral Request", type="reference" ) - public static final String SP_INCOMINGREFERRAL = "incomingreferral"; - /** - * Fluent Client search parameter constant for incomingreferral - *

- * Description: Incoming Referral Request
- * Type: reference
- * Path: EpisodeOfCare.referralRequest
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INCOMINGREFERRAL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INCOMINGREFERRAL); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "EpisodeOfCare:incomingreferral". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_INCOMINGREFERRAL = new ca.uhn.fhir.model.api.Include("EpisodeOfCare:incomingreferral").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Identifier(s) for the EpisodeOfCare
- * Type: token
- * Path: EpisodeOfCare.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="EpisodeOfCare.identifier", description="Identifier(s) for the EpisodeOfCare", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Identifier(s) for the EpisodeOfCare
- * Type: token
- * Path: EpisodeOfCare.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java deleted file mode 100644 index 4c25513a80b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExpansionProfile.java +++ /dev/null @@ -1,3625 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Resource to define constraints on the Expansion of a FHIR ValueSet. - */ -@ResourceDef(name="ExpansionProfile", profile="http://hl7.org/fhir/Profile/ExpansionProfile") -public class ExpansionProfile extends DomainResource { - - @Block() - public static class ExpansionProfileContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the expansion profile. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the expansion profile." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ExpansionProfileContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfileContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ExpansionProfileContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the expansion profile. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the expansion profile. - */ - public ExpansionProfileContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ExpansionProfileContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the expansion profile.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ExpansionProfileContactComponent copy() { - ExpansionProfileContactComponent dst = new ExpansionProfileContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ExpansionProfileContactComponent)) - return false; - ExpansionProfileContactComponent o = (ExpansionProfileContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ExpansionProfileContactComponent)) - return false; - ExpansionProfileContactComponent o = (ExpansionProfileContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.contact"; - - } - - } - - @Block() - public static class ExpansionProfileCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code systems to be included in value set expansions. - */ - @Child(name = "include", type = {}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Code systems to be included", formalDefinition="Code systems to be included in value set expansions." ) - protected CodeSystemIncludeComponent include; - - /** - * Code systems to be excluded from value set expansions. - */ - @Child(name = "exclude", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Code systems to be excluded", formalDefinition="Code systems to be excluded from value set expansions." ) - protected CodeSystemExcludeComponent exclude; - - private static final long serialVersionUID = 340558624L; - - /** - * Constructor - */ - public ExpansionProfileCodeSystemComponent() { - super(); - } - - /** - * @return {@link #include} (Code systems to be included in value set expansions.) - */ - public CodeSystemIncludeComponent getInclude() { - if (this.include == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfileCodeSystemComponent.include"); - else if (Configuration.doAutoCreate()) - this.include = new CodeSystemIncludeComponent(); // cc - return this.include; - } - - public boolean hasInclude() { - return this.include != null && !this.include.isEmpty(); - } - - /** - * @param value {@link #include} (Code systems to be included in value set expansions.) - */ - public ExpansionProfileCodeSystemComponent setInclude(CodeSystemIncludeComponent value) { - this.include = value; - return this; - } - - /** - * @return {@link #exclude} (Code systems to be excluded from value set expansions.) - */ - public CodeSystemExcludeComponent getExclude() { - if (this.exclude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfileCodeSystemComponent.exclude"); - else if (Configuration.doAutoCreate()) - this.exclude = new CodeSystemExcludeComponent(); // cc - return this.exclude; - } - - public boolean hasExclude() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - /** - * @param value {@link #exclude} (Code systems to be excluded from value set expansions.) - */ - public ExpansionProfileCodeSystemComponent setExclude(CodeSystemExcludeComponent value) { - this.exclude = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("include", "", "Code systems to be included in value set expansions.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "", "Code systems to be excluded from value set expansions.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1942574248: /*include*/ return this.include == null ? new Base[0] : new Base[] {this.include}; // CodeSystemIncludeComponent - case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // CodeSystemExcludeComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1942574248: // include - this.include = (CodeSystemIncludeComponent) value; // CodeSystemIncludeComponent - break; - case -1321148966: // exclude - this.exclude = (CodeSystemExcludeComponent) value; // CodeSystemExcludeComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("include")) - this.include = (CodeSystemIncludeComponent) value; // CodeSystemIncludeComponent - else if (name.equals("exclude")) - this.exclude = (CodeSystemExcludeComponent) value; // CodeSystemExcludeComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1942574248: return getInclude(); // CodeSystemIncludeComponent - case -1321148966: return getExclude(); // CodeSystemExcludeComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("include")) { - this.include = new CodeSystemIncludeComponent(); - return this.include; - } - else if (name.equals("exclude")) { - this.exclude = new CodeSystemExcludeComponent(); - return this.exclude; - } - else - return super.addChild(name); - } - - public ExpansionProfileCodeSystemComponent copy() { - ExpansionProfileCodeSystemComponent dst = new ExpansionProfileCodeSystemComponent(); - copyValues(dst); - dst.include = include == null ? null : include.copy(); - dst.exclude = exclude == null ? null : exclude.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ExpansionProfileCodeSystemComponent)) - return false; - ExpansionProfileCodeSystemComponent o = (ExpansionProfileCodeSystemComponent) other; - return compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ExpansionProfileCodeSystemComponent)) - return false; - ExpansionProfileCodeSystemComponent o = (ExpansionProfileCodeSystemComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.codeSystem"; - - } - - } - - @Block() - public static class CodeSystemIncludeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A data group for each code system to be included. - */ - @Child(name = "codeSystem", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The code systems to be included", formalDefinition="A data group for each code system to be included." ) - protected List codeSystem; - - private static final long serialVersionUID = 1076909689L; - - /** - * Constructor - */ - public CodeSystemIncludeComponent() { - super(); - } - - /** - * @return {@link #codeSystem} (A data group for each code system to be included.) - */ - public List getCodeSystem() { - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - return this.codeSystem; - } - - public boolean hasCodeSystem() { - if (this.codeSystem == null) - return false; - for (CodeSystemIncludeCodeSystemComponent item : this.codeSystem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeSystem} (A data group for each code system to be included.) - */ - // syntactic sugar - public CodeSystemIncludeCodeSystemComponent addCodeSystem() { //3 - CodeSystemIncludeCodeSystemComponent t = new CodeSystemIncludeCodeSystemComponent(); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return t; - } - - // syntactic sugar - public CodeSystemIncludeComponent addCodeSystem(CodeSystemIncludeCodeSystemComponent t) { //3 - if (t == null) - return this; - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeSystem", "", "A data group for each code system to be included.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // CodeSystemIncludeCodeSystemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -916511108: // codeSystem - this.getCodeSystem().add((CodeSystemIncludeCodeSystemComponent) value); // CodeSystemIncludeCodeSystemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("codeSystem")) - this.getCodeSystem().add((CodeSystemIncludeCodeSystemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -916511108: return addCodeSystem(); // CodeSystemIncludeCodeSystemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("codeSystem")) { - return addCodeSystem(); - } - else - return super.addChild(name); - } - - public CodeSystemIncludeComponent copy() { - CodeSystemIncludeComponent dst = new CodeSystemIncludeComponent(); - copyValues(dst); - if (codeSystem != null) { - dst.codeSystem = new ArrayList(); - for (CodeSystemIncludeCodeSystemComponent i : codeSystem) - dst.codeSystem.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemIncludeComponent)) - return false; - CodeSystemIncludeComponent o = (CodeSystemIncludeComponent) other; - return compareDeep(codeSystem, o.codeSystem, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemIncludeComponent)) - return false; - CodeSystemIncludeComponent o = (CodeSystemIncludeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()); - } - - public String fhirType() { - return "ExpansionProfile.codeSystem.include"; - - } - - } - - @Block() - public static class CodeSystemIncludeCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI which is the code system to be included. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The specific code system to be included", formalDefinition="An absolute URI which is the code system to be included." ) - protected UriType system; - - /** - * The version of the code system from which codes in the expansion should be included. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system from which codes in the expansion should be included." ) - protected StringType version; - - private static final long serialVersionUID = 1145288774L; - - /** - * Constructor - */ - public CodeSystemIncludeCodeSystemComponent() { - super(); - } - - /** - * Constructor - */ - public CodeSystemIncludeCodeSystemComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (An absolute URI which is the code system to be included.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemIncludeCodeSystemComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI which is the code system to be included.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public CodeSystemIncludeCodeSystemComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI which is the code system to be included. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI which is the code system to be included. - */ - public CodeSystemIncludeCodeSystemComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the code system from which codes in the expansion should be included.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemIncludeCodeSystemComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system from which codes in the expansion should be included.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public CodeSystemIncludeCodeSystemComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system from which codes in the expansion should be included. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system from which codes in the expansion should be included. - */ - public CodeSystemIncludeCodeSystemComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI which is the code system to be included.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system from which codes in the expansion should be included.", 0, java.lang.Integer.MAX_VALUE, version)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.system"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.version"); - } - else - return super.addChild(name); - } - - public CodeSystemIncludeCodeSystemComponent copy() { - CodeSystemIncludeCodeSystemComponent dst = new CodeSystemIncludeCodeSystemComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemIncludeCodeSystemComponent)) - return false; - CodeSystemIncludeCodeSystemComponent o = (CodeSystemIncludeCodeSystemComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemIncludeCodeSystemComponent)) - return false; - CodeSystemIncludeCodeSystemComponent o = (CodeSystemIncludeCodeSystemComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.codeSystem.include.codeSystem"; - - } - - } - - @Block() - public static class CodeSystemExcludeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A data group for each code system to be excluded. - */ - @Child(name = "codeSystem", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The code systems to be excluded", formalDefinition="A data group for each code system to be excluded." ) - protected List codeSystem; - - private static final long serialVersionUID = 1960514347L; - - /** - * Constructor - */ - public CodeSystemExcludeComponent() { - super(); - } - - /** - * @return {@link #codeSystem} (A data group for each code system to be excluded.) - */ - public List getCodeSystem() { - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - return this.codeSystem; - } - - public boolean hasCodeSystem() { - if (this.codeSystem == null) - return false; - for (CodeSystemExcludeCodeSystemComponent item : this.codeSystem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeSystem} (A data group for each code system to be excluded.) - */ - // syntactic sugar - public CodeSystemExcludeCodeSystemComponent addCodeSystem() { //3 - CodeSystemExcludeCodeSystemComponent t = new CodeSystemExcludeCodeSystemComponent(); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return t; - } - - // syntactic sugar - public CodeSystemExcludeComponent addCodeSystem(CodeSystemExcludeCodeSystemComponent t) { //3 - if (t == null) - return this; - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("codeSystem", "", "A data group for each code system to be excluded.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // CodeSystemExcludeCodeSystemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -916511108: // codeSystem - this.getCodeSystem().add((CodeSystemExcludeCodeSystemComponent) value); // CodeSystemExcludeCodeSystemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("codeSystem")) - this.getCodeSystem().add((CodeSystemExcludeCodeSystemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -916511108: return addCodeSystem(); // CodeSystemExcludeCodeSystemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("codeSystem")) { - return addCodeSystem(); - } - else - return super.addChild(name); - } - - public CodeSystemExcludeComponent copy() { - CodeSystemExcludeComponent dst = new CodeSystemExcludeComponent(); - copyValues(dst); - if (codeSystem != null) { - dst.codeSystem = new ArrayList(); - for (CodeSystemExcludeCodeSystemComponent i : codeSystem) - dst.codeSystem.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemExcludeComponent)) - return false; - CodeSystemExcludeComponent o = (CodeSystemExcludeComponent) other; - return compareDeep(codeSystem, o.codeSystem, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemExcludeComponent)) - return false; - CodeSystemExcludeComponent o = (CodeSystemExcludeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (codeSystem == null || codeSystem.isEmpty()); - } - - public String fhirType() { - return "ExpansionProfile.codeSystem.exclude"; - - } - - } - - @Block() - public static class CodeSystemExcludeCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI which is the code system to be excluded. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The specific code system to be excluded", formalDefinition="An absolute URI which is the code system to be excluded." ) - protected UriType system; - - /** - * The version of the code system from which codes in the expansion should be excluded. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system from which codes in the expansion should be excluded." ) - protected StringType version; - - private static final long serialVersionUID = 1145288774L; - - /** - * Constructor - */ - public CodeSystemExcludeCodeSystemComponent() { - super(); - } - - /** - * Constructor - */ - public CodeSystemExcludeCodeSystemComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (An absolute URI which is the code system to be excluded.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemExcludeCodeSystemComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI which is the code system to be excluded.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public CodeSystemExcludeCodeSystemComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI which is the code system to be excluded. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI which is the code system to be excluded. - */ - public CodeSystemExcludeCodeSystemComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the code system from which codes in the expansion should be excluded.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create CodeSystemExcludeCodeSystemComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system from which codes in the expansion should be excluded.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public CodeSystemExcludeCodeSystemComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system from which codes in the expansion should be excluded. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system from which codes in the expansion should be excluded. - */ - public CodeSystemExcludeCodeSystemComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI which is the code system to be excluded.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system from which codes in the expansion should be excluded.", 0, java.lang.Integer.MAX_VALUE, version)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.system"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.version"); - } - else - return super.addChild(name); - } - - public CodeSystemExcludeCodeSystemComponent copy() { - CodeSystemExcludeCodeSystemComponent dst = new CodeSystemExcludeCodeSystemComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CodeSystemExcludeCodeSystemComponent)) - return false; - CodeSystemExcludeCodeSystemComponent o = (CodeSystemExcludeCodeSystemComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CodeSystemExcludeCodeSystemComponent)) - return false; - CodeSystemExcludeCodeSystemComponent o = (CodeSystemExcludeCodeSystemComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.codeSystem.exclude.codeSystem"; - - } - - } - - @Block() - public static class ExpansionProfileDesignationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Designations to be included. - */ - @Child(name = "include", type = {}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Designations to be included", formalDefinition="Designations to be included." ) - protected DesignationIncludeComponent include; - - /** - * Designations to be excluded. - */ - @Child(name = "exclude", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Designations to be excluded", formalDefinition="Designations to be excluded." ) - protected DesignationExcludeComponent exclude; - - private static final long serialVersionUID = -2080476436L; - - /** - * Constructor - */ - public ExpansionProfileDesignationComponent() { - super(); - } - - /** - * @return {@link #include} (Designations to be included.) - */ - public DesignationIncludeComponent getInclude() { - if (this.include == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfileDesignationComponent.include"); - else if (Configuration.doAutoCreate()) - this.include = new DesignationIncludeComponent(); // cc - return this.include; - } - - public boolean hasInclude() { - return this.include != null && !this.include.isEmpty(); - } - - /** - * @param value {@link #include} (Designations to be included.) - */ - public ExpansionProfileDesignationComponent setInclude(DesignationIncludeComponent value) { - this.include = value; - return this; - } - - /** - * @return {@link #exclude} (Designations to be excluded.) - */ - public DesignationExcludeComponent getExclude() { - if (this.exclude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfileDesignationComponent.exclude"); - else if (Configuration.doAutoCreate()) - this.exclude = new DesignationExcludeComponent(); // cc - return this.exclude; - } - - public boolean hasExclude() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - /** - * @param value {@link #exclude} (Designations to be excluded.) - */ - public ExpansionProfileDesignationComponent setExclude(DesignationExcludeComponent value) { - this.exclude = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("include", "", "Designations to be included.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "", "Designations to be excluded.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1942574248: /*include*/ return this.include == null ? new Base[0] : new Base[] {this.include}; // DesignationIncludeComponent - case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // DesignationExcludeComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1942574248: // include - this.include = (DesignationIncludeComponent) value; // DesignationIncludeComponent - break; - case -1321148966: // exclude - this.exclude = (DesignationExcludeComponent) value; // DesignationExcludeComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("include")) - this.include = (DesignationIncludeComponent) value; // DesignationIncludeComponent - else if (name.equals("exclude")) - this.exclude = (DesignationExcludeComponent) value; // DesignationExcludeComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1942574248: return getInclude(); // DesignationIncludeComponent - case -1321148966: return getExclude(); // DesignationExcludeComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("include")) { - this.include = new DesignationIncludeComponent(); - return this.include; - } - else if (name.equals("exclude")) { - this.exclude = new DesignationExcludeComponent(); - return this.exclude; - } - else - return super.addChild(name); - } - - public ExpansionProfileDesignationComponent copy() { - ExpansionProfileDesignationComponent dst = new ExpansionProfileDesignationComponent(); - copyValues(dst); - dst.include = include == null ? null : include.copy(); - dst.exclude = exclude == null ? null : exclude.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ExpansionProfileDesignationComponent)) - return false; - ExpansionProfileDesignationComponent o = (ExpansionProfileDesignationComponent) other; - return compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ExpansionProfileDesignationComponent)) - return false; - ExpansionProfileDesignationComponent o = (ExpansionProfileDesignationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.designation"; - - } - - } - - @Block() - public static class DesignationIncludeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A data group for each designation to be included. - */ - @Child(name = "designation", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The designation to be included", formalDefinition="A data group for each designation to be included." ) - protected List designation; - - private static final long serialVersionUID = -1989669274L; - - /** - * Constructor - */ - public DesignationIncludeComponent() { - super(); - } - - /** - * @return {@link #designation} (A data group for each designation to be included.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (DesignationIncludeDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (A data group for each designation to be included.) - */ - // syntactic sugar - public DesignationIncludeDesignationComponent addDesignation() { //3 - DesignationIncludeDesignationComponent t = new DesignationIncludeDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - // syntactic sugar - public DesignationIncludeComponent addDesignation(DesignationIncludeDesignationComponent t) { //3 - if (t == null) - return this; - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("designation", "", "A data group for each designation to be included.", 0, java.lang.Integer.MAX_VALUE, designation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // DesignationIncludeDesignationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -900931593: // designation - this.getDesignation().add((DesignationIncludeDesignationComponent) value); // DesignationIncludeDesignationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("designation")) - this.getDesignation().add((DesignationIncludeDesignationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -900931593: return addDesignation(); // DesignationIncludeDesignationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("designation")) { - return addDesignation(); - } - else - return super.addChild(name); - } - - public DesignationIncludeComponent copy() { - DesignationIncludeComponent dst = new DesignationIncludeComponent(); - copyValues(dst); - if (designation != null) { - dst.designation = new ArrayList(); - for (DesignationIncludeDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DesignationIncludeComponent)) - return false; - DesignationIncludeComponent o = (DesignationIncludeComponent) other; - return compareDeep(designation, o.designation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DesignationIncludeComponent)) - return false; - DesignationIncludeComponent o = (DesignationIncludeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (designation == null || designation.isEmpty()); - } - - public String fhirType() { - return "ExpansionProfile.designation.include"; - - } - - } - - @Block() - public static class DesignationIncludeDesignationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The language this designation is defined for. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human language of the designation to be included", formalDefinition="The language this designation is defined for." ) - protected CodeType language; - - /** - * Designation uses for inclusion in the expansion. - */ - @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Designation use", formalDefinition="Designation uses for inclusion in the expansion." ) - protected Coding use; - - private static final long serialVersionUID = 242239292L; - - /** - * Constructor - */ - public DesignationIncludeDesignationComponent() { - super(); - } - - /** - * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DesignationIncludeDesignationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public DesignationIncludeDesignationComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The language this designation is defined for. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The language this designation is defined for. - */ - public DesignationIncludeDesignationComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (Designation uses for inclusion in the expansion.) - */ - public Coding getUse() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DesignationIncludeDesignationComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Coding(); // cc - return this.use; - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Designation uses for inclusion in the expansion.) - */ - public DesignationIncludeDesignationComponent setUse(Coding value) { - this.use = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("use", "Coding", "Designation uses for inclusion in the expansion.", 0, java.lang.Integer.MAX_VALUE, use)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - case 116103: // use - this.use = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("language")) - this.language = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - case 116103: return getUse(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.language"); - } - else if (name.equals("use")) { - this.use = new Coding(); - return this.use; - } - else - return super.addChild(name); - } - - public DesignationIncludeDesignationComponent copy() { - DesignationIncludeDesignationComponent dst = new DesignationIncludeDesignationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.use = use == null ? null : use.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DesignationIncludeDesignationComponent)) - return false; - DesignationIncludeDesignationComponent o = (DesignationIncludeDesignationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(use, o.use, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DesignationIncludeDesignationComponent)) - return false; - DesignationIncludeDesignationComponent o = (DesignationIncludeDesignationComponent) other; - return compareValues(language, o.language, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.designation.include.designation"; - - } - - } - - @Block() - public static class DesignationExcludeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A data group for each designation to be excluded. - */ - @Child(name = "designation", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The designation to be excluded", formalDefinition="A data group for each designation to be excluded." ) - protected List designation; - - private static final long serialVersionUID = 1045849752L; - - /** - * Constructor - */ - public DesignationExcludeComponent() { - super(); - } - - /** - * @return {@link #designation} (A data group for each designation to be excluded.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (DesignationExcludeDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (A data group for each designation to be excluded.) - */ - // syntactic sugar - public DesignationExcludeDesignationComponent addDesignation() { //3 - DesignationExcludeDesignationComponent t = new DesignationExcludeDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - // syntactic sugar - public DesignationExcludeComponent addDesignation(DesignationExcludeDesignationComponent t) { //3 - if (t == null) - return this; - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("designation", "", "A data group for each designation to be excluded.", 0, java.lang.Integer.MAX_VALUE, designation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // DesignationExcludeDesignationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -900931593: // designation - this.getDesignation().add((DesignationExcludeDesignationComponent) value); // DesignationExcludeDesignationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("designation")) - this.getDesignation().add((DesignationExcludeDesignationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -900931593: return addDesignation(); // DesignationExcludeDesignationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("designation")) { - return addDesignation(); - } - else - return super.addChild(name); - } - - public DesignationExcludeComponent copy() { - DesignationExcludeComponent dst = new DesignationExcludeComponent(); - copyValues(dst); - if (designation != null) { - dst.designation = new ArrayList(); - for (DesignationExcludeDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DesignationExcludeComponent)) - return false; - DesignationExcludeComponent o = (DesignationExcludeComponent) other; - return compareDeep(designation, o.designation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DesignationExcludeComponent)) - return false; - DesignationExcludeComponent o = (DesignationExcludeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (designation == null || designation.isEmpty()); - } - - public String fhirType() { - return "ExpansionProfile.designation.exclude"; - - } - - } - - @Block() - public static class DesignationExcludeDesignationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The language this designation is defined for. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human language of the designation to be excluded", formalDefinition="The language this designation is defined for." ) - protected CodeType language; - - /** - * Designation uses for exclusion in the expansion. - */ - @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Designation use", formalDefinition="Designation uses for exclusion in the expansion." ) - protected Coding use; - - private static final long serialVersionUID = 242239292L; - - /** - * Constructor - */ - public DesignationExcludeDesignationComponent() { - super(); - } - - /** - * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DesignationExcludeDesignationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public DesignationExcludeDesignationComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The language this designation is defined for. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The language this designation is defined for. - */ - public DesignationExcludeDesignationComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (Designation uses for exclusion in the expansion.) - */ - public Coding getUse() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DesignationExcludeDesignationComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Coding(); // cc - return this.use; - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Designation uses for exclusion in the expansion.) - */ - public DesignationExcludeDesignationComponent setUse(Coding value) { - this.use = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("use", "Coding", "Designation uses for exclusion in the expansion.", 0, java.lang.Integer.MAX_VALUE, use)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - case 116103: // use - this.use = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("language")) - this.language = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - case 116103: return getUse(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.language"); - } - else if (name.equals("use")) { - this.use = new Coding(); - return this.use; - } - else - return super.addChild(name); - } - - public DesignationExcludeDesignationComponent copy() { - DesignationExcludeDesignationComponent dst = new DesignationExcludeDesignationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.use = use == null ? null : use.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DesignationExcludeDesignationComponent)) - return false; - DesignationExcludeDesignationComponent o = (DesignationExcludeDesignationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(use, o.use, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DesignationExcludeDesignationComponent)) - return false; - DesignationExcludeDesignationComponent o = (DesignationExcludeDesignationComponent) other; - return compareValues(language, o.language, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) - ; - } - - public String fhirType() { - return "ExpansionProfile.designation.exclude.designation"; - - } - - } - - /** - * An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Globally unique logical identifier for expansion profile", formalDefinition="An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional identifier for the expansion profile (e.g. an Object Identifier)", formalDefinition="Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical identifier for this version of the expansion profile", formalDefinition="Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance." ) - protected StringType version; - - /** - * A free text natural language name for the expansion profile. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this expansion profile", formalDefinition="A free text natural language name for the expansion profile." ) - protected StringType name; - - /** - * The status of the expansion profile. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the expansion profile." ) - protected Enumeration status; - - /** - * This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the expansion profile. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the expansion profile." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes." ) - protected DateTimeType date; - - /** - * A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile. - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human language description of the expansion profile", formalDefinition="A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile." ) - protected StringType description; - - /** - * A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions). - */ - @Child(name = "codeSystem", type = {}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the expansion profile imposes code system contraints", formalDefinition="A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions)." ) - protected ExpansionProfileCodeSystemComponent codeSystem; - - /** - * Controls whether concept designations are to be included or excluded in value set expansions. - */ - @Child(name = "includeDesignations", type = {BooleanType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether the expansion should include concept designations", formalDefinition="Controls whether concept designations are to be included or excluded in value set expansions." ) - protected BooleanType includeDesignations; - - /** - * A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations. - */ - @Child(name = "designation", type = {}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the expansion profile imposes designation contraints", formalDefinition="A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations." ) - protected ExpansionProfileDesignationComponent designation; - - /** - * Controls whether the value set definition is included or excluded in value set expansions. - */ - @Child(name = "includeDefinition", type = {BooleanType.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include or exclude the value set definition in the expansion", formalDefinition="Controls whether the value set definition is included or excluded in value set expansions." ) - protected BooleanType includeDefinition; - - /** - * Controls whether inactive concepts are included or excluded in value set expansions. - */ - @Child(name = "includeInactive", type = {BooleanType.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include or exclude inactive concepts in the expansion", formalDefinition="Controls whether inactive concepts are included or excluded in value set expansions." ) - protected BooleanType includeInactive; - - /** - * Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). - */ - @Child(name = "excludeNested", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include or exclude nested codes in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains)." ) - protected BooleanType excludeNested; - - /** - * Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces. - */ - @Child(name = "excludeNotForUI", type = {BooleanType.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include or exclude codes which cannot be rendered in user interfaces in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces." ) - protected BooleanType excludeNotForUI; - - /** - * Controls whether or not the value set expansion includes post coordinated codes. - */ - @Child(name = "excludePostCoordinated", type = {BooleanType.class}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Include or exclude codes which are post coordinated expressions in the value set expansion", formalDefinition="Controls whether or not the value set expansion includes post coordinated codes." ) - protected BooleanType excludePostCoordinated; - - /** - * Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display. - */ - @Child(name = "displayLanguage", type = {CodeType.class}, order=18, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specify the language for the display element of codes in the value set expansion", formalDefinition="Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display." ) - protected CodeType displayLanguage; - - /** - * If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete. - */ - @Child(name = "limitedExpansion", type = {BooleanType.class}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Controls behaviour of the value set expand operation when value sets are too large to be completely expanded", formalDefinition="If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete." ) - protected BooleanType limitedExpansion; - - private static final long serialVersionUID = -651123079L; - - /** - * Constructor - */ - public ExpansionProfile() { - super(); - } - - /** - * Constructor - */ - public ExpansionProfile(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ExpansionProfile setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published. - */ - public ExpansionProfile setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public ExpansionProfile setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ExpansionProfile setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance. - */ - public ExpansionProfile setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name for the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name for the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ExpansionProfile setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name for the expansion profile. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name for the expansion profile. - */ - public ExpansionProfile setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ExpansionProfile setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the expansion profile. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the expansion profile. - */ - public ExpansionProfile setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ExpansionProfile setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage. - */ - public ExpansionProfile setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ExpansionProfile setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the expansion profile. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the expansion profile. - */ - public ExpansionProfile setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ExpansionProfileContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ExpansionProfileContactComponent addContact() { //3 - ExpansionProfileContactComponent t = new ExpansionProfileContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ExpansionProfile addContact(ExpansionProfileContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ExpansionProfile setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. - */ - public ExpansionProfile setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ExpansionProfile setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile. - */ - public ExpansionProfile setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #codeSystem} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions).) - */ - public ExpansionProfileCodeSystemComponent getCodeSystem() { - if (this.codeSystem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.codeSystem"); - else if (Configuration.doAutoCreate()) - this.codeSystem = new ExpansionProfileCodeSystemComponent(); // cc - return this.codeSystem; - } - - public boolean hasCodeSystem() { - return this.codeSystem != null && !this.codeSystem.isEmpty(); - } - - /** - * @param value {@link #codeSystem} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions).) - */ - public ExpansionProfile setCodeSystem(ExpansionProfileCodeSystemComponent value) { - this.codeSystem = value; - return this; - } - - /** - * @return {@link #includeDesignations} (Controls whether concept designations are to be included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDesignations" gives direct access to the value - */ - public BooleanType getIncludeDesignationsElement() { - if (this.includeDesignations == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.includeDesignations"); - else if (Configuration.doAutoCreate()) - this.includeDesignations = new BooleanType(); // bb - return this.includeDesignations; - } - - public boolean hasIncludeDesignationsElement() { - return this.includeDesignations != null && !this.includeDesignations.isEmpty(); - } - - public boolean hasIncludeDesignations() { - return this.includeDesignations != null && !this.includeDesignations.isEmpty(); - } - - /** - * @param value {@link #includeDesignations} (Controls whether concept designations are to be included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDesignations" gives direct access to the value - */ - public ExpansionProfile setIncludeDesignationsElement(BooleanType value) { - this.includeDesignations = value; - return this; - } - - /** - * @return Controls whether concept designations are to be included or excluded in value set expansions. - */ - public boolean getIncludeDesignations() { - return this.includeDesignations == null || this.includeDesignations.isEmpty() ? false : this.includeDesignations.getValue(); - } - - /** - * @param value Controls whether concept designations are to be included or excluded in value set expansions. - */ - public ExpansionProfile setIncludeDesignations(boolean value) { - if (this.includeDesignations == null) - this.includeDesignations = new BooleanType(); - this.includeDesignations.setValue(value); - return this; - } - - /** - * @return {@link #designation} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.) - */ - public ExpansionProfileDesignationComponent getDesignation() { - if (this.designation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.designation"); - else if (Configuration.doAutoCreate()) - this.designation = new ExpansionProfileDesignationComponent(); // cc - return this.designation; - } - - public boolean hasDesignation() { - return this.designation != null && !this.designation.isEmpty(); - } - - /** - * @param value {@link #designation} (A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.) - */ - public ExpansionProfile setDesignation(ExpansionProfileDesignationComponent value) { - this.designation = value; - return this; - } - - /** - * @return {@link #includeDefinition} (Controls whether the value set definition is included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDefinition" gives direct access to the value - */ - public BooleanType getIncludeDefinitionElement() { - if (this.includeDefinition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.includeDefinition"); - else if (Configuration.doAutoCreate()) - this.includeDefinition = new BooleanType(); // bb - return this.includeDefinition; - } - - public boolean hasIncludeDefinitionElement() { - return this.includeDefinition != null && !this.includeDefinition.isEmpty(); - } - - public boolean hasIncludeDefinition() { - return this.includeDefinition != null && !this.includeDefinition.isEmpty(); - } - - /** - * @param value {@link #includeDefinition} (Controls whether the value set definition is included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeDefinition" gives direct access to the value - */ - public ExpansionProfile setIncludeDefinitionElement(BooleanType value) { - this.includeDefinition = value; - return this; - } - - /** - * @return Controls whether the value set definition is included or excluded in value set expansions. - */ - public boolean getIncludeDefinition() { - return this.includeDefinition == null || this.includeDefinition.isEmpty() ? false : this.includeDefinition.getValue(); - } - - /** - * @param value Controls whether the value set definition is included or excluded in value set expansions. - */ - public ExpansionProfile setIncludeDefinition(boolean value) { - if (this.includeDefinition == null) - this.includeDefinition = new BooleanType(); - this.includeDefinition.setValue(value); - return this; - } - - /** - * @return {@link #includeInactive} (Controls whether inactive concepts are included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeInactive" gives direct access to the value - */ - public BooleanType getIncludeInactiveElement() { - if (this.includeInactive == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.includeInactive"); - else if (Configuration.doAutoCreate()) - this.includeInactive = new BooleanType(); // bb - return this.includeInactive; - } - - public boolean hasIncludeInactiveElement() { - return this.includeInactive != null && !this.includeInactive.isEmpty(); - } - - public boolean hasIncludeInactive() { - return this.includeInactive != null && !this.includeInactive.isEmpty(); - } - - /** - * @param value {@link #includeInactive} (Controls whether inactive concepts are included or excluded in value set expansions.). This is the underlying object with id, value and extensions. The accessor "getIncludeInactive" gives direct access to the value - */ - public ExpansionProfile setIncludeInactiveElement(BooleanType value) { - this.includeInactive = value; - return this; - } - - /** - * @return Controls whether inactive concepts are included or excluded in value set expansions. - */ - public boolean getIncludeInactive() { - return this.includeInactive == null || this.includeInactive.isEmpty() ? false : this.includeInactive.getValue(); - } - - /** - * @param value Controls whether inactive concepts are included or excluded in value set expansions. - */ - public ExpansionProfile setIncludeInactive(boolean value) { - if (this.includeInactive == null) - this.includeInactive = new BooleanType(); - this.includeInactive.setValue(value); - return this; - } - - /** - * @return {@link #excludeNested} (Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value - */ - public BooleanType getExcludeNestedElement() { - if (this.excludeNested == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.excludeNested"); - else if (Configuration.doAutoCreate()) - this.excludeNested = new BooleanType(); // bb - return this.excludeNested; - } - - public boolean hasExcludeNestedElement() { - return this.excludeNested != null && !this.excludeNested.isEmpty(); - } - - public boolean hasExcludeNested() { - return this.excludeNested != null && !this.excludeNested.isEmpty(); - } - - /** - * @param value {@link #excludeNested} (Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).). This is the underlying object with id, value and extensions. The accessor "getExcludeNested" gives direct access to the value - */ - public ExpansionProfile setExcludeNestedElement(BooleanType value) { - this.excludeNested = value; - return this; - } - - /** - * @return Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). - */ - public boolean getExcludeNested() { - return this.excludeNested == null || this.excludeNested.isEmpty() ? false : this.excludeNested.getValue(); - } - - /** - * @param value Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains). - */ - public ExpansionProfile setExcludeNested(boolean value) { - if (this.excludeNested == null) - this.excludeNested = new BooleanType(); - this.excludeNested.setValue(value); - return this; - } - - /** - * @return {@link #excludeNotForUI} (Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.). This is the underlying object with id, value and extensions. The accessor "getExcludeNotForUI" gives direct access to the value - */ - public BooleanType getExcludeNotForUIElement() { - if (this.excludeNotForUI == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.excludeNotForUI"); - else if (Configuration.doAutoCreate()) - this.excludeNotForUI = new BooleanType(); // bb - return this.excludeNotForUI; - } - - public boolean hasExcludeNotForUIElement() { - return this.excludeNotForUI != null && !this.excludeNotForUI.isEmpty(); - } - - public boolean hasExcludeNotForUI() { - return this.excludeNotForUI != null && !this.excludeNotForUI.isEmpty(); - } - - /** - * @param value {@link #excludeNotForUI} (Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.). This is the underlying object with id, value and extensions. The accessor "getExcludeNotForUI" gives direct access to the value - */ - public ExpansionProfile setExcludeNotForUIElement(BooleanType value) { - this.excludeNotForUI = value; - return this; - } - - /** - * @return Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces. - */ - public boolean getExcludeNotForUI() { - return this.excludeNotForUI == null || this.excludeNotForUI.isEmpty() ? false : this.excludeNotForUI.getValue(); - } - - /** - * @param value Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces. - */ - public ExpansionProfile setExcludeNotForUI(boolean value) { - if (this.excludeNotForUI == null) - this.excludeNotForUI = new BooleanType(); - this.excludeNotForUI.setValue(value); - return this; - } - - /** - * @return {@link #excludePostCoordinated} (Controls whether or not the value set expansion includes post coordinated codes.). This is the underlying object with id, value and extensions. The accessor "getExcludePostCoordinated" gives direct access to the value - */ - public BooleanType getExcludePostCoordinatedElement() { - if (this.excludePostCoordinated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.excludePostCoordinated"); - else if (Configuration.doAutoCreate()) - this.excludePostCoordinated = new BooleanType(); // bb - return this.excludePostCoordinated; - } - - public boolean hasExcludePostCoordinatedElement() { - return this.excludePostCoordinated != null && !this.excludePostCoordinated.isEmpty(); - } - - public boolean hasExcludePostCoordinated() { - return this.excludePostCoordinated != null && !this.excludePostCoordinated.isEmpty(); - } - - /** - * @param value {@link #excludePostCoordinated} (Controls whether or not the value set expansion includes post coordinated codes.). This is the underlying object with id, value and extensions. The accessor "getExcludePostCoordinated" gives direct access to the value - */ - public ExpansionProfile setExcludePostCoordinatedElement(BooleanType value) { - this.excludePostCoordinated = value; - return this; - } - - /** - * @return Controls whether or not the value set expansion includes post coordinated codes. - */ - public boolean getExcludePostCoordinated() { - return this.excludePostCoordinated == null || this.excludePostCoordinated.isEmpty() ? false : this.excludePostCoordinated.getValue(); - } - - /** - * @param value Controls whether or not the value set expansion includes post coordinated codes. - */ - public ExpansionProfile setExcludePostCoordinated(boolean value) { - if (this.excludePostCoordinated == null) - this.excludePostCoordinated = new BooleanType(); - this.excludePostCoordinated.setValue(value); - return this; - } - - /** - * @return {@link #displayLanguage} (Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.). This is the underlying object with id, value and extensions. The accessor "getDisplayLanguage" gives direct access to the value - */ - public CodeType getDisplayLanguageElement() { - if (this.displayLanguage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.displayLanguage"); - else if (Configuration.doAutoCreate()) - this.displayLanguage = new CodeType(); // bb - return this.displayLanguage; - } - - public boolean hasDisplayLanguageElement() { - return this.displayLanguage != null && !this.displayLanguage.isEmpty(); - } - - public boolean hasDisplayLanguage() { - return this.displayLanguage != null && !this.displayLanguage.isEmpty(); - } - - /** - * @param value {@link #displayLanguage} (Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.). This is the underlying object with id, value and extensions. The accessor "getDisplayLanguage" gives direct access to the value - */ - public ExpansionProfile setDisplayLanguageElement(CodeType value) { - this.displayLanguage = value; - return this; - } - - /** - * @return Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display. - */ - public String getDisplayLanguage() { - return this.displayLanguage == null ? null : this.displayLanguage.getValue(); - } - - /** - * @param value Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display. - */ - public ExpansionProfile setDisplayLanguage(String value) { - if (Utilities.noString(value)) - this.displayLanguage = null; - else { - if (this.displayLanguage == null) - this.displayLanguage = new CodeType(); - this.displayLanguage.setValue(value); - } - return this; - } - - /** - * @return {@link #limitedExpansion} (If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete.). This is the underlying object with id, value and extensions. The accessor "getLimitedExpansion" gives direct access to the value - */ - public BooleanType getLimitedExpansionElement() { - if (this.limitedExpansion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExpansionProfile.limitedExpansion"); - else if (Configuration.doAutoCreate()) - this.limitedExpansion = new BooleanType(); // bb - return this.limitedExpansion; - } - - public boolean hasLimitedExpansionElement() { - return this.limitedExpansion != null && !this.limitedExpansion.isEmpty(); - } - - public boolean hasLimitedExpansion() { - return this.limitedExpansion != null && !this.limitedExpansion.isEmpty(); - } - - /** - * @param value {@link #limitedExpansion} (If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete.). This is the underlying object with id, value and extensions. The accessor "getLimitedExpansion" gives direct access to the value - */ - public ExpansionProfile setLimitedExpansionElement(BooleanType value) { - this.limitedExpansion = value; - return this; - } - - /** - * @return If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete. - */ - public boolean getLimitedExpansion() { - return this.limitedExpansion == null || this.limitedExpansion.isEmpty() ? false : this.limitedExpansion.getValue(); - } - - /** - * @param value If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete. - */ - public ExpansionProfile setLimitedExpansion(boolean value) { - if (this.limitedExpansion == null) - this.limitedExpansion = new BooleanType(); - this.limitedExpansion.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this expansion profile when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this expansion profile is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this expansion profile when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "Used to identify this version of the expansion profile when it is referenced in a specification, model, design or instance.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name for the expansion profile.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the expansion profile.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This expansion profile was authored for testing purposes (or education/evaluation/marketing), and is not intended for genuine production usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the expansion profile.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date that the expansion profile status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the expansion profile - reason for definition, conditions of use, etc. The description may include a list of expected usages for the expansion profile and can also describe the approach taken to build the expansion profile.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("codeSystem", "", "A set of criteria that provide the constraints imposed on the value set expansion by including or excluding codes from specific code systems (or versions).", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("includeDesignations", "boolean", "Controls whether concept designations are to be included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeDesignations)); - childrenList.add(new Property("designation", "", "A set of criteria that provide the constraints imposed on the value set expansion by including or excluding designations.", 0, java.lang.Integer.MAX_VALUE, designation)); - childrenList.add(new Property("includeDefinition", "boolean", "Controls whether the value set definition is included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeDefinition)); - childrenList.add(new Property("includeInactive", "boolean", "Controls whether inactive concepts are included or excluded in value set expansions.", 0, java.lang.Integer.MAX_VALUE, includeInactive)); - childrenList.add(new Property("excludeNested", "boolean", "Controls whether or not the value set expansion includes nested codes (i.e. ValueSet.expansion.contains.contains).", 0, java.lang.Integer.MAX_VALUE, excludeNested)); - childrenList.add(new Property("excludeNotForUI", "boolean", "Controls whether or not the value set expansion includes codes which cannot be displayed in user interfaces.", 0, java.lang.Integer.MAX_VALUE, excludeNotForUI)); - childrenList.add(new Property("excludePostCoordinated", "boolean", "Controls whether or not the value set expansion includes post coordinated codes.", 0, java.lang.Integer.MAX_VALUE, excludePostCoordinated)); - childrenList.add(new Property("displayLanguage", "code", "Specifies the language to be used for description in the expansions i.e. the language to be used for ValueSet.expansion.contains.display.", 0, java.lang.Integer.MAX_VALUE, displayLanguage)); - childrenList.add(new Property("limitedExpansion", "boolean", "If the value set being expanded is incomplete (because it is too big to expand), return a limited expansion (a subset) with an indicator that expansion is incomplete.", 0, java.lang.Integer.MAX_VALUE, limitedExpansion)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ExpansionProfileContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : new Base[] {this.codeSystem}; // ExpansionProfileCodeSystemComponent - case 461507620: /*includeDesignations*/ return this.includeDesignations == null ? new Base[0] : new Base[] {this.includeDesignations}; // BooleanType - case -900931593: /*designation*/ return this.designation == null ? new Base[0] : new Base[] {this.designation}; // ExpansionProfileDesignationComponent - case 127972379: /*includeDefinition*/ return this.includeDefinition == null ? new Base[0] : new Base[] {this.includeDefinition}; // BooleanType - case 1634790707: /*includeInactive*/ return this.includeInactive == null ? new Base[0] : new Base[] {this.includeInactive}; // BooleanType - case 424992625: /*excludeNested*/ return this.excludeNested == null ? new Base[0] : new Base[] {this.excludeNested}; // BooleanType - case 667582980: /*excludeNotForUI*/ return this.excludeNotForUI == null ? new Base[0] : new Base[] {this.excludeNotForUI}; // BooleanType - case 563335154: /*excludePostCoordinated*/ return this.excludePostCoordinated == null ? new Base[0] : new Base[] {this.excludePostCoordinated}; // BooleanType - case 1486237242: /*displayLanguage*/ return this.displayLanguage == null ? new Base[0] : new Base[] {this.displayLanguage}; // CodeType - case 597771333: /*limitedExpansion*/ return this.limitedExpansion == null ? new Base[0] : new Base[] {this.limitedExpansion}; // BooleanType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ExpansionProfileContactComponent) value); // ExpansionProfileContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -916511108: // codeSystem - this.codeSystem = (ExpansionProfileCodeSystemComponent) value; // ExpansionProfileCodeSystemComponent - break; - case 461507620: // includeDesignations - this.includeDesignations = castToBoolean(value); // BooleanType - break; - case -900931593: // designation - this.designation = (ExpansionProfileDesignationComponent) value; // ExpansionProfileDesignationComponent - break; - case 127972379: // includeDefinition - this.includeDefinition = castToBoolean(value); // BooleanType - break; - case 1634790707: // includeInactive - this.includeInactive = castToBoolean(value); // BooleanType - break; - case 424992625: // excludeNested - this.excludeNested = castToBoolean(value); // BooleanType - break; - case 667582980: // excludeNotForUI - this.excludeNotForUI = castToBoolean(value); // BooleanType - break; - case 563335154: // excludePostCoordinated - this.excludePostCoordinated = castToBoolean(value); // BooleanType - break; - case 1486237242: // displayLanguage - this.displayLanguage = castToCode(value); // CodeType - break; - case 597771333: // limitedExpansion - this.limitedExpansion = castToBoolean(value); // BooleanType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ExpansionProfileContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("codeSystem")) - this.codeSystem = (ExpansionProfileCodeSystemComponent) value; // ExpansionProfileCodeSystemComponent - else if (name.equals("includeDesignations")) - this.includeDesignations = castToBoolean(value); // BooleanType - else if (name.equals("designation")) - this.designation = (ExpansionProfileDesignationComponent) value; // ExpansionProfileDesignationComponent - else if (name.equals("includeDefinition")) - this.includeDefinition = castToBoolean(value); // BooleanType - else if (name.equals("includeInactive")) - this.includeInactive = castToBoolean(value); // BooleanType - else if (name.equals("excludeNested")) - this.excludeNested = castToBoolean(value); // BooleanType - else if (name.equals("excludeNotForUI")) - this.excludeNotForUI = castToBoolean(value); // BooleanType - else if (name.equals("excludePostCoordinated")) - this.excludePostCoordinated = castToBoolean(value); // BooleanType - else if (name.equals("displayLanguage")) - this.displayLanguage = castToCode(value); // CodeType - else if (name.equals("limitedExpansion")) - this.limitedExpansion = castToBoolean(value); // BooleanType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return getIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // ExpansionProfileContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -916511108: return getCodeSystem(); // ExpansionProfileCodeSystemComponent - case 461507620: throw new FHIRException("Cannot make property includeDesignations as it is not a complex type"); // BooleanType - case -900931593: return getDesignation(); // ExpansionProfileDesignationComponent - case 127972379: throw new FHIRException("Cannot make property includeDefinition as it is not a complex type"); // BooleanType - case 1634790707: throw new FHIRException("Cannot make property includeInactive as it is not a complex type"); // BooleanType - case 424992625: throw new FHIRException("Cannot make property excludeNested as it is not a complex type"); // BooleanType - case 667582980: throw new FHIRException("Cannot make property excludeNotForUI as it is not a complex type"); // BooleanType - case 563335154: throw new FHIRException("Cannot make property excludePostCoordinated as it is not a complex type"); // BooleanType - case 1486237242: throw new FHIRException("Cannot make property displayLanguage as it is not a complex type"); // CodeType - case 597771333: throw new FHIRException("Cannot make property limitedExpansion as it is not a complex type"); // BooleanType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.url"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.description"); - } - else if (name.equals("codeSystem")) { - this.codeSystem = new ExpansionProfileCodeSystemComponent(); - return this.codeSystem; - } - else if (name.equals("includeDesignations")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.includeDesignations"); - } - else if (name.equals("designation")) { - this.designation = new ExpansionProfileDesignationComponent(); - return this.designation; - } - else if (name.equals("includeDefinition")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.includeDefinition"); - } - else if (name.equals("includeInactive")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.includeInactive"); - } - else if (name.equals("excludeNested")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.excludeNested"); - } - else if (name.equals("excludeNotForUI")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.excludeNotForUI"); - } - else if (name.equals("excludePostCoordinated")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.excludePostCoordinated"); - } - else if (name.equals("displayLanguage")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.displayLanguage"); - } - else if (name.equals("limitedExpansion")) { - throw new FHIRException("Cannot call addChild on a primitive type ExpansionProfile.limitedExpansion"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ExpansionProfile"; - - } - - public ExpansionProfile copy() { - ExpansionProfile dst = new ExpansionProfile(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ExpansionProfileContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - dst.codeSystem = codeSystem == null ? null : codeSystem.copy(); - dst.includeDesignations = includeDesignations == null ? null : includeDesignations.copy(); - dst.designation = designation == null ? null : designation.copy(); - dst.includeDefinition = includeDefinition == null ? null : includeDefinition.copy(); - dst.includeInactive = includeInactive == null ? null : includeInactive.copy(); - dst.excludeNested = excludeNested == null ? null : excludeNested.copy(); - dst.excludeNotForUI = excludeNotForUI == null ? null : excludeNotForUI.copy(); - dst.excludePostCoordinated = excludePostCoordinated == null ? null : excludePostCoordinated.copy(); - dst.displayLanguage = displayLanguage == null ? null : displayLanguage.copy(); - dst.limitedExpansion = limitedExpansion == null ? null : limitedExpansion.copy(); - return dst; - } - - protected ExpansionProfile typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ExpansionProfile)) - return false; - ExpansionProfile o = (ExpansionProfile) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) - && compareDeep(description, o.description, true) && compareDeep(codeSystem, o.codeSystem, true) - && compareDeep(includeDesignations, o.includeDesignations, true) && compareDeep(designation, o.designation, true) - && compareDeep(includeDefinition, o.includeDefinition, true) && compareDeep(includeInactive, o.includeInactive, true) - && compareDeep(excludeNested, o.excludeNested, true) && compareDeep(excludeNotForUI, o.excludeNotForUI, true) - && compareDeep(excludePostCoordinated, o.excludePostCoordinated, true) && compareDeep(displayLanguage, o.displayLanguage, true) - && compareDeep(limitedExpansion, o.limitedExpansion, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ExpansionProfile)) - return false; - ExpansionProfile o = (ExpansionProfile) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(includeDesignations, o.includeDesignations, true) - && compareValues(includeDefinition, o.includeDefinition, true) && compareValues(includeInactive, o.includeInactive, true) - && compareValues(excludeNested, o.excludeNested, true) && compareValues(excludeNotForUI, o.excludeNotForUI, true) - && compareValues(excludePostCoordinated, o.excludePostCoordinated, true) && compareValues(displayLanguage, o.displayLanguage, true) - && compareValues(limitedExpansion, o.limitedExpansion, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (codeSystem == null || codeSystem.isEmpty()) && (includeDesignations == null || includeDesignations.isEmpty()) - && (designation == null || designation.isEmpty()) && (includeDefinition == null || includeDefinition.isEmpty()) - && (includeInactive == null || includeInactive.isEmpty()) && (excludeNested == null || excludeNested.isEmpty()) - && (excludeNotForUI == null || excludeNotForUI.isEmpty()) && (excludePostCoordinated == null || excludePostCoordinated.isEmpty()) - && (displayLanguage == null || displayLanguage.isEmpty()) && (limitedExpansion == null || limitedExpansion.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ExpansionProfile; - } - - /** - * Search parameter: status - *

- * Description: The status of the expansion profile
- * Type: token
- * Path: ExpansionProfile.status
- *

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

- * Description: The status of the expansion profile
- * Type: token
- * Path: ExpansionProfile.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search in the description of the expansion profile
- * Type: string
- * Path: ExpansionProfile.description
- *

- */ - @SearchParamDefinition(name="description", path="ExpansionProfile.description", description="Text search in the description of the expansion profile", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search in the description of the expansion profile
- * Type: string
- * Path: ExpansionProfile.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: The name of the expansion profile
- * Type: string
- * Path: ExpansionProfile.name
- *

- */ - @SearchParamDefinition(name="name", path="ExpansionProfile.name", description="The name of the expansion profile", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: The name of the expansion profile
- * Type: string
- * Path: ExpansionProfile.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: date - *

- * Description: The expansion profile publication date
- * Type: date
- * Path: ExpansionProfile.date
- *

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

- * Description: The expansion profile publication date
- * Type: date
- * Path: ExpansionProfile.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: The identifier for the expansion profile
- * Type: token
- * Path: ExpansionProfile.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ExpansionProfile.identifier", description="The identifier for the expansion profile", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identifier for the expansion profile
- * Type: token
- * Path: ExpansionProfile.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: url - *

- * Description: The logical URL for the expansion profile
- * Type: uri
- * Path: ExpansionProfile.url
- *

- */ - @SearchParamDefinition(name="url", path="ExpansionProfile.url", description="The logical URL for the expansion profile", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The logical URL for the expansion profile
- * Type: uri
- * Path: ExpansionProfile.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher of the expansion profile
- * Type: string
- * Path: ExpansionProfile.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="ExpansionProfile.publisher", description="Name of the publisher of the expansion profile", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher of the expansion profile
- * Type: string
- * Path: ExpansionProfile.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: version - *

- * Description: The version identifier of the expansion profile
- * Type: token
- * Path: ExpansionProfile.version
- *

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

- * Description: The version identifier of the expansion profile
- * Type: token
- * Path: ExpansionProfile.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java deleted file mode 100644 index b1a0d7dce32..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExplanationOfBenefit.java +++ /dev/null @@ -1,11620 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account balance information, for informing the subscriber of the benefits provided. - */ -@ResourceDef(name="ExplanationOfBenefit", profile="http://hl7.org/fhir/Profile/ExplanationOfBenefit") -public class ExplanationOfBenefit extends DomainResource { - - @Block() - public static class RelatedClaimsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Other claims which are related to this claim such as prior claim versions or for related services. - */ - @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to the related claim", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) - protected Type claim; - - /** - * For example prior or umbrella. - */ - @Child(name = "relationship", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How the reference claim is related", formalDefinition="For example prior or umbrella." ) - protected Coding relationship; - - /** - * An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # . - */ - @Child(name = "reference", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Related file or case reference", formalDefinition="An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # ." ) - protected Identifier reference; - - private static final long serialVersionUID = -2033217402L; - - /** - * Constructor - */ - public RelatedClaimsComponent() { - super(); - } - - /** - * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public Type getClaim() { - return this.claim; - } - - /** - * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public Identifier getClaimIdentifier() throws FHIRException { - if (!(this.claim instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered"); - return (Identifier) this.claim; - } - - public boolean hasClaimIdentifier() { - return this.claim instanceof Identifier; - } - - /** - * @return {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public Reference getClaimReference() throws FHIRException { - if (!(this.claim instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered"); - return (Reference) this.claim; - } - - public boolean hasClaimReference() { - return this.claim instanceof Reference; - } - - public boolean hasClaim() { - return this.claim != null && !this.claim.isEmpty(); - } - - /** - * @param value {@link #claim} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public RelatedClaimsComponent setClaim(Type value) { - this.claim = value; - return this; - } - - /** - * @return {@link #relationship} (For example prior or umbrella.) - */ - public Coding getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedClaimsComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new Coding(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (For example prior or umbrella.) - */ - public RelatedClaimsComponent setRelationship(Coding value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) - */ - public Identifier getReference() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedClaimsComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new Identifier(); // cc - return this.reference; - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .) - */ - public RelatedClaimsComponent setReference(Identifier value) { - this.reference = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("claim[x]", "Identifier|Reference(Claim)", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, claim)); - childrenList.add(new Property("relationship", "Coding", "For example prior or umbrella.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("reference", "Identifier", "An alternate organizational reference to the case or file to which this particular claim pertains - eg Property/Casualy insurer claim # or Workers Compensation case # .", 0, java.lang.Integer.MAX_VALUE, reference)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // Coding - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Identifier - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 94742588: // claim - this.claim = (Type) value; // Type - break; - case -261851592: // relationship - this.relationship = castToCoding(value); // Coding - break; - case -925155509: // reference - this.reference = castToIdentifier(value); // Identifier - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("claim[x]")) - this.claim = (Type) value; // Type - else if (name.equals("relationship")) - this.relationship = castToCoding(value); // Coding - else if (name.equals("reference")) - this.reference = castToIdentifier(value); // Identifier - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 683016900: return getClaim(); // Type - case -261851592: return getRelationship(); // Coding - case -925155509: return getReference(); // Identifier - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("claimIdentifier")) { - this.claim = new Identifier(); - return this.claim; - } - else if (name.equals("claimReference")) { - this.claim = new Reference(); - return this.claim; - } - else if (name.equals("relationship")) { - this.relationship = new Coding(); - return this.relationship; - } - else if (name.equals("reference")) { - this.reference = new Identifier(); - return this.reference; - } - else - return super.addChild(name); - } - - public RelatedClaimsComponent copy() { - RelatedClaimsComponent dst = new RelatedClaimsComponent(); - copyValues(dst); - dst.claim = claim == null ? null : claim.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.reference = reference == null ? null : reference.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RelatedClaimsComponent)) - return false; - RelatedClaimsComponent o = (RelatedClaimsComponent) other; - return compareDeep(claim, o.claim, true) && compareDeep(relationship, o.relationship, true) && compareDeep(reference, o.reference, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RelatedClaimsComponent)) - return false; - RelatedClaimsComponent o = (RelatedClaimsComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (claim == null || claim.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (reference == null || reference.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.related"; - - } - - } - - @Block() - public static class PayeeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Type of Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of party: Subscriber, Provider, other", formalDefinition="Type of Party to be reimbursed: Subscriber, provider, other." ) - protected Coding type; - - /** - * Party to be reimbursed: Subscriber, provider, other. - */ - @Child(name = "party", type = {Identifier.class, Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Party to receive the payable", formalDefinition="Party to be reimbursed: Subscriber, provider, other." ) - protected Type party; - - private static final long serialVersionUID = 1304353420L; - - /** - * Constructor - */ - public PayeeComponent() { - super(); - } - - /** - * @return {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PayeeComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type of Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Type getParty() { - return this.party; - } - - /** - * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Identifier getPartyIdentifier() throws FHIRException { - if (!(this.party instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.party.getClass().getName()+" was encountered"); - return (Identifier) this.party; - } - - public boolean hasPartyIdentifier() { - return this.party instanceof Identifier; - } - - /** - * @return {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public Reference getPartyReference() throws FHIRException { - if (!(this.party instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.party.getClass().getName()+" was encountered"); - return (Reference) this.party; - } - - public boolean hasPartyReference() { - return this.party instanceof Reference; - } - - public boolean hasParty() { - return this.party != null && !this.party.isEmpty(); - } - - /** - * @param value {@link #party} (Party to be reimbursed: Subscriber, provider, other.) - */ - public PayeeComponent setParty(Type value) { - this.party = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Type of Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("party[x]", "Identifier|Reference(Practitioner|Organization|Patient|RelatedPerson)", "Party to be reimbursed: Subscriber, provider, other.", 0, java.lang.Integer.MAX_VALUE, party)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 106437350: /*party*/ return this.party == null ? new Base[0] : new Base[] {this.party}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 106437350: // party - this.party = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("party[x]")) - this.party = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 1189320666: return getParty(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("partyIdentifier")) { - this.party = new Identifier(); - return this.party; - } - else if (name.equals("partyReference")) { - this.party = new Reference(); - return this.party; - } - else - return super.addChild(name); - } - - public PayeeComponent copy() { - PayeeComponent dst = new PayeeComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.party = party == null ? null : party.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PayeeComponent)) - return false; - PayeeComponent o = (PayeeComponent) other; - return compareDeep(type, o.type, true) && compareDeep(party, o.party, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PayeeComponent)) - return false; - PayeeComponent o = (PayeeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (party == null || party.isEmpty()) - ; - } - - public String fhirType() { - return "ExplanationOfBenefit.payee"; - - } - - } - - @Block() - public static class DiagnosisComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Sequence of diagnosis which serves to order and provide a link. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number to covey order of diagnosis", formalDefinition="Sequence of diagnosis which serves to order and provide a link." ) - protected PositiveIntType sequence; - - /** - * The diagnosis. - */ - @Child(name = "diagnosis", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient's list of diagnosis", formalDefinition="The diagnosis." ) - protected Coding diagnosis; - - private static final long serialVersionUID = -795010186L; - - /** - * Constructor - */ - public DiagnosisComponent() { - super(); - } - - /** - * Constructor - */ - public DiagnosisComponent(PositiveIntType sequence, Coding diagnosis) { - super(); - this.sequence = sequence; - this.diagnosis = diagnosis; - } - - /** - * @return {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of diagnosis which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DiagnosisComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of diagnosis which serves to order and provide a link. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value Sequence of diagnosis which serves to order and provide a link. - */ - public DiagnosisComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #diagnosis} (The diagnosis.) - */ - public Coding getDiagnosis() { - if (this.diagnosis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DiagnosisComponent.diagnosis"); - else if (Configuration.doAutoCreate()) - this.diagnosis = new Coding(); // cc - return this.diagnosis; - } - - public boolean hasDiagnosis() { - return this.diagnosis != null && !this.diagnosis.isEmpty(); - } - - /** - * @param value {@link #diagnosis} (The diagnosis.) - */ - public DiagnosisComponent setDiagnosis(Coding value) { - this.diagnosis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "Sequence of diagnosis which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("diagnosis", "Coding", "The diagnosis.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : new Base[] {this.diagnosis}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 1196993265: // diagnosis - this.diagnosis = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("diagnosis")) - this.diagnosis = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 1196993265: return getDiagnosis(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); - } - else if (name.equals("diagnosis")) { - this.diagnosis = new Coding(); - return this.diagnosis; - } - else - return super.addChild(name); - } - - public DiagnosisComponent copy() { - DiagnosisComponent dst = new DiagnosisComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.diagnosis = diagnosis == null ? null : diagnosis.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DiagnosisComponent)) - return false; - DiagnosisComponent o = (DiagnosisComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(diagnosis, o.diagnosis, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DiagnosisComponent)) - return false; - DiagnosisComponent o = (DiagnosisComponent) other; - return compareValues(sequence, o.sequence, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (diagnosis == null || diagnosis.isEmpty()) - ; - } - - public String fhirType() { - return "ExplanationOfBenefit.diagnosis"; - - } - - } - - @Block() - public static class ProcedureComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Sequence of procedures which serves to order and provide a link. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Procedure sequence for reference", formalDefinition="Sequence of procedures which serves to order and provide a link." ) - protected PositiveIntType sequence; - - /** - * Date and optionally time the procedure was performed . - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the procedure was performed", formalDefinition="Date and optionally time the procedure was performed ." ) - protected DateTimeType date; - - /** - * The procedure code. - */ - @Child(name = "procedure", type = {Coding.class, Procedure.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient's list of procedures performed", formalDefinition="The procedure code." ) - protected Type procedure; - - private static final long serialVersionUID = 864307347L; - - /** - * Constructor - */ - public ProcedureComponent() { - super(); - } - - /** - * Constructor - */ - public ProcedureComponent(PositiveIntType sequence, Type procedure) { - super(); - this.sequence = sequence; - this.procedure = procedure; - } - - /** - * @return {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Sequence of procedures which serves to order and provide a link.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ProcedureComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return Sequence of procedures which serves to order and provide a link. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value Sequence of procedures which serves to order and provide a link. - */ - public ProcedureComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #date} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date and optionally time the procedure was performed .). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ProcedureComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date and optionally time the procedure was performed . - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date and optionally time the procedure was performed . - */ - public ProcedureComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (The procedure code.) - */ - public Type getProcedure() { - return this.procedure; - } - - /** - * @return {@link #procedure} (The procedure code.) - */ - public Coding getProcedureCoding() throws FHIRException { - if (!(this.procedure instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.procedure.getClass().getName()+" was encountered"); - return (Coding) this.procedure; - } - - public boolean hasProcedureCoding() { - return this.procedure instanceof Coding; - } - - /** - * @return {@link #procedure} (The procedure code.) - */ - public Reference getProcedureReference() throws FHIRException { - if (!(this.procedure instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.procedure.getClass().getName()+" was encountered"); - return (Reference) this.procedure; - } - - public boolean hasProcedureReference() { - return this.procedure instanceof Reference; - } - - public boolean hasProcedure() { - return this.procedure != null && !this.procedure.isEmpty(); - } - - /** - * @param value {@link #procedure} (The procedure code.) - */ - public ProcedureComponent setProcedure(Type value) { - this.procedure = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "Sequence of procedures which serves to order and provide a link.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("date", "dateTime", "Date and optionally time the procedure was performed .", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("procedure[x]", "Coding|Reference(Procedure)", "The procedure code.", 0, java.lang.Integer.MAX_VALUE, procedure)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1095204141: // procedure - this.procedure = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("procedure[x]")) - this.procedure = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1640074445: return getProcedure(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.date"); - } - else if (name.equals("procedureCoding")) { - this.procedure = new Coding(); - return this.procedure; - } - else if (name.equals("procedureReference")) { - this.procedure = new Reference(); - return this.procedure; - } - else - return super.addChild(name); - } - - public ProcedureComponent copy() { - ProcedureComponent dst = new ProcedureComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.date = date == null ? null : date.copy(); - dst.procedure = procedure == null ? null : procedure.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureComponent)) - return false; - ProcedureComponent o = (ProcedureComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(date, o.date, true) && compareDeep(procedure, o.procedure, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureComponent)) - return false; - ProcedureComponent o = (ProcedureComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (date == null || date.isEmpty()) - && (procedure == null || procedure.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.procedure"; - - } - - } - - @Block() - public static class CoverageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Reference to the program or plan identification, underwriter or payor. - */ - @Child(name = "coverage", type = {Identifier.class, Coverage.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." ) - protected Type coverage; - - /** - * A list of references from the Insurer to which these services pertain. - */ - @Child(name = "preAuthRef", type = {StringType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." ) - protected List preAuthRef; - - private static final long serialVersionUID = -21571213L; - - /** - * Constructor - */ - public CoverageComponent() { - super(); - } - - /** - * Constructor - */ - public CoverageComponent(Type coverage) { - super(); - this.coverage = coverage; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Type getCoverage() { - return this.coverage; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Identifier getCoverageIdentifier() throws FHIRException { - if (!(this.coverage instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Identifier) this.coverage; - } - - public boolean hasCoverageIdentifier() { - return this.coverage instanceof Identifier; - } - - /** - * @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public Reference getCoverageReference() throws FHIRException { - if (!(this.coverage instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.coverage.getClass().getName()+" was encountered"); - return (Reference) this.coverage; - } - - public boolean hasCoverageReference() { - return this.coverage instanceof Reference; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Reference to the program or plan identification, underwriter or payor.) - */ - public CoverageComponent setCoverage(Type value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public List getPreAuthRef() { - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - return this.preAuthRef; - } - - public boolean hasPreAuthRef() { - if (this.preAuthRef == null) - return false; - for (StringType item : this.preAuthRef) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - // syntactic sugar - public StringType addPreAuthRefElement() {//2 - StringType t = new StringType(); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return t; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public CoverageComponent addPreAuthRef(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.preAuthRef == null) - this.preAuthRef = new ArrayList(); - this.preAuthRef.add(t); - return this; - } - - /** - * @param value {@link #preAuthRef} (A list of references from the Insurer to which these services pertain.) - */ - public boolean hasPreAuthRef(String value) { - if (this.preAuthRef == null) - return false; - for (StringType v : this.preAuthRef) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("coverage[x]", "Identifier|Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Type - case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -351767064: // coverage - this.coverage = (Type) value; // Type - break; - case 522246568: // preAuthRef - this.getPreAuthRef().add(castToString(value)); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("coverage[x]")) - this.coverage = (Type) value; // Type - else if (name.equals("preAuthRef")) - this.getPreAuthRef().add(castToString(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 227689880: return getCoverage(); // Type - case 522246568: throw new FHIRException("Cannot make property preAuthRef as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("coverageIdentifier")) { - this.coverage = new Identifier(); - return this.coverage; - } - else if (name.equals("coverageReference")) { - this.coverage = new Reference(); - return this.coverage; - } - else if (name.equals("preAuthRef")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.preAuthRef"); - } - else - return super.addChild(name); - } - - public CoverageComponent copy() { - CoverageComponent dst = new CoverageComponent(); - copyValues(dst); - dst.coverage = coverage == null ? null : coverage.copy(); - if (preAuthRef != null) { - dst.preAuthRef = new ArrayList(); - for (StringType i : preAuthRef) - dst.preAuthRef.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareDeep(coverage, o.coverage, true) && compareDeep(preAuthRef, o.preAuthRef, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof CoverageComponent)) - return false; - CoverageComponent o = (CoverageComponent) other; - return compareValues(preAuthRef, o.preAuthRef, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (coverage == null || coverage.isEmpty()) && (preAuthRef == null || preAuthRef.isEmpty()) - ; - } - - public String fhirType() { - return "ExplanationOfBenefit.coverage"; - - } - - } - - @Block() - public static class OnsetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The start or start and end dates for the treatable condition. - */ - @Child(name = "time", type = {DateType.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Illness, injury or treatable condition date", formalDefinition="The start or start and end dates for the treatable condition." ) - protected Type time; - - /** - * Onset typifications eg. Start of pregnancy, start of illnes, etc. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Onset of what", formalDefinition="Onset typifications eg. Start of pregnancy, start of illnes, etc." ) - protected Coding type; - - private static final long serialVersionUID = -560173231L; - - /** - * Constructor - */ - public OnsetComponent() { - super(); - } - - /** - * @return {@link #time} (The start or start and end dates for the treatable condition.) - */ - public Type getTime() { - return this.time; - } - - /** - * @return {@link #time} (The start or start and end dates for the treatable condition.) - */ - public DateType getTimeDateType() throws FHIRException { - if (!(this.time instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.time.getClass().getName()+" was encountered"); - return (DateType) this.time; - } - - public boolean hasTimeDateType() { - return this.time instanceof DateType; - } - - /** - * @return {@link #time} (The start or start and end dates for the treatable condition.) - */ - public Period getTimePeriod() throws FHIRException { - if (!(this.time instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.time.getClass().getName()+" was encountered"); - return (Period) this.time; - } - - public boolean hasTimePeriod() { - return this.time instanceof Period; - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (The start or start and end dates for the treatable condition.) - */ - public OnsetComponent setTime(Type value) { - this.time = value; - return this; - } - - /** - * @return {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OnsetComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Onset typifications eg. Start of pregnancy, start of illnes, etc.) - */ - public OnsetComponent setType(Coding value) { - this.type = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("time[x]", "date|Period", "The start or start and end dates for the treatable condition.", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("type", "Coding", "Onset typifications eg. Start of pregnancy, start of illnes, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // Type - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3560141: // time - this.time = (Type) value; // Type - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("time[x]")) - this.time = (Type) value; // Type - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1313930605: return getTime(); // Type - case 3575610: return getType(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("timeDate")) { - this.time = new DateType(); - return this.time; - } - else if (name.equals("timePeriod")) { - this.time = new Period(); - return this.time; - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else - return super.addChild(name); - } - - public OnsetComponent copy() { - OnsetComponent dst = new OnsetComponent(); - copyValues(dst); - dst.time = time == null ? null : time.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OnsetComponent)) - return false; - OnsetComponent o = (OnsetComponent) other; - return compareDeep(time, o.time, true) && compareDeep(type, o.type, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OnsetComponent)) - return false; - OnsetComponent o = (OnsetComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (time == null || time.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - public String fhirType() { - return "ExplanationOfBenefit.onset"; - - } - - } - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type provider; - - /** - * The practitioner who is supervising the work of the servicing provider(s). - */ - @Child(name = "supervisor", type = {Identifier.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Supervising Practitioner", formalDefinition="The practitioner who is supervising the work of the servicing provider(s)." ) - protected Type supervisor; - - /** - * The qualification which is applicable for this service. - */ - @Child(name = "providerQualification", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type, classification or Specialization", formalDefinition="The qualification which is applicable for this service." ) - protected Coding providerQualification; - - /** - * Diagnosis applicable for this service or product line. - */ - @Child(name = "diagnosisLinkId", type = {PositiveIntType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Applicable diagnoses", formalDefinition="Diagnosis applicable for this service or product line." ) - protected List diagnosisLinkId; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Item Code", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * Unusual circumstances which may influence adjudication. - */ - @Child(name = "serviceModifier", type = {Coding.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service/Product modifiers", formalDefinition="Unusual circumstances which may influence adjudication." ) - protected List serviceModifier; - - /** - * Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen. - */ - @Child(name = "modifier", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service/Product billing modifiers", formalDefinition="Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen." ) - protected List modifier; - - /** - * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. - */ - @Child(name = "programCode", type = {Coding.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) - protected List programCode; - - /** - * The date or dates when the enclosed suite of services were performed or completed. - */ - @Child(name = "serviced", type = {DateType.class, Period.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date or dates of Service", formalDefinition="The date or dates when the enclosed suite of services were performed or completed." ) - protected Type serviced; - - /** - * Where the service was provided. - */ - @Child(name = "place", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Place of service", formalDefinition="Where the service was provided." ) - protected Coding place; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected SimpleQuantity quantity; - - /** - * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. - */ - @Child(name = "unitPrice", type = {Money.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Device.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected List udi; - /** - * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) - */ - protected List udiTarget; - - - /** - * Physical service site on the patient (limb, tooth, etc). - */ - @Child(name = "bodySite", type = {Coding.class}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service Location", formalDefinition="Physical service site on the patient (limb, tooth, etc)." ) - protected Coding bodySite; - - /** - * A region or surface of the site, eg. limb region or tooth surface(s). - */ - @Child(name = "subSite", type = {Coding.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service Sub-location", formalDefinition="A region or surface of the site, eg. limb region or tooth surface(s)." ) - protected List subSite; - - /** - * A list of note references to the notes provided below. - */ - @Child(name = "noteNumber", type = {PositiveIntType.class}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumber; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Adjudication details", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * Second tier of goods and services. - */ - @Child(name = "detail", type = {}, order=23, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional items", formalDefinition="Second tier of goods and services." ) - protected List detail; - - /** - * The materials and placement date of prior fixed prosthesis. - */ - @Child(name = "prosthesis", type = {}, order=24, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Prosthetic details", formalDefinition="The materials and placement date of prior fixed prosthesis." ) - protected ProsthesisComponent prosthesis; - - private static final long serialVersionUID = 2037926144L; - - /** - * Constructor - */ - public ItemsComponent() { - super(); - } - - /** - * Constructor - */ - public ItemsComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ItemsComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public ItemsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ItemsComponent setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public Type getSupervisor() { - return this.supervisor; - } - - /** - * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public Identifier getSupervisorIdentifier() throws FHIRException { - if (!(this.supervisor instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.supervisor.getClass().getName()+" was encountered"); - return (Identifier) this.supervisor; - } - - public boolean hasSupervisorIdentifier() { - return this.supervisor instanceof Identifier; - } - - /** - * @return {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public Reference getSupervisorReference() throws FHIRException { - if (!(this.supervisor instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.supervisor.getClass().getName()+" was encountered"); - return (Reference) this.supervisor; - } - - public boolean hasSupervisorReference() { - return this.supervisor instanceof Reference; - } - - public boolean hasSupervisor() { - return this.supervisor != null && !this.supervisor.isEmpty(); - } - - /** - * @param value {@link #supervisor} (The practitioner who is supervising the work of the servicing provider(s).) - */ - public ItemsComponent setSupervisor(Type value) { - this.supervisor = value; - return this; - } - - /** - * @return {@link #providerQualification} (The qualification which is applicable for this service.) - */ - public Coding getProviderQualification() { - if (this.providerQualification == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.providerQualification"); - else if (Configuration.doAutoCreate()) - this.providerQualification = new Coding(); // cc - return this.providerQualification; - } - - public boolean hasProviderQualification() { - return this.providerQualification != null && !this.providerQualification.isEmpty(); - } - - /** - * @param value {@link #providerQualification} (The qualification which is applicable for this service.) - */ - public ItemsComponent setProviderQualification(Coding value) { - this.providerQualification = value; - return this; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public List getDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - return this.diagnosisLinkId; - } - - public boolean hasDiagnosisLinkId() { - if (this.diagnosisLinkId == null) - return false; - for (PositiveIntType item : this.diagnosisLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - // syntactic sugar - public PositiveIntType addDiagnosisLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - this.diagnosisLinkId.add(t); - return t; - } - - /** - * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public ItemsComponent addDiagnosisLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.diagnosisLinkId == null) - this.diagnosisLinkId = new ArrayList(); - this.diagnosisLinkId.add(t); - return this; - } - - /** - * @param value {@link #diagnosisLinkId} (Diagnosis applicable for this service or product line.) - */ - public boolean hasDiagnosisLinkId(int value) { - if (this.diagnosisLinkId == null) - return false; - for (PositiveIntType v : this.diagnosisLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public ItemsComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.) - */ - public List getServiceModifier() { - if (this.serviceModifier == null) - this.serviceModifier = new ArrayList(); - return this.serviceModifier; - } - - public boolean hasServiceModifier() { - if (this.serviceModifier == null) - return false; - for (Coding item : this.serviceModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceModifier} (Unusual circumstances which may influence adjudication.) - */ - // syntactic sugar - public Coding addServiceModifier() { //3 - Coding t = new Coding(); - if (this.serviceModifier == null) - this.serviceModifier = new ArrayList(); - this.serviceModifier.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addServiceModifier(Coding t) { //3 - if (t == null) - return this; - if (this.serviceModifier == null) - this.serviceModifier = new ArrayList(); - this.serviceModifier.add(t); - return this; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - public List getModifier() { - if (this.modifier == null) - this.modifier = new ArrayList(); - return this.modifier; - } - - public boolean hasModifier() { - if (this.modifier == null) - return false; - for (Coding item : this.modifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modifier} (Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.) - */ - // syntactic sugar - public Coding addModifier() { //3 - Coding t = new Coding(); - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addModifier(Coding t) { //3 - if (t == null) - return this; - if (this.modifier == null) - this.modifier = new ArrayList(); - this.modifier.add(t); - return this; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - public List getProgramCode() { - if (this.programCode == null) - this.programCode = new ArrayList(); - return this.programCode; - } - - public boolean hasProgramCode() { - if (this.programCode == null) - return false; - for (Coding item : this.programCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - // syntactic sugar - public Coding addProgramCode() { //3 - Coding t = new Coding(); - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addProgramCode(Coding t) { //3 - if (t == null) - return this; - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return this; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Type getServiced() { - return this.serviced; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public DateType getServicedDateType() throws FHIRException { - if (!(this.serviced instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (DateType) this.serviced; - } - - public boolean hasServicedDateType() { - return this.serviced instanceof DateType; - } - - /** - * @return {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public Period getServicedPeriod() throws FHIRException { - if (!(this.serviced instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.serviced.getClass().getName()+" was encountered"); - return (Period) this.serviced; - } - - public boolean hasServicedPeriod() { - return this.serviced instanceof Period; - } - - public boolean hasServiced() { - return this.serviced != null && !this.serviced.isEmpty(); - } - - /** - * @param value {@link #serviced} (The date or dates when the enclosed suite of services were performed or completed.) - */ - public ItemsComponent setServiced(Type value) { - this.serviced = value; - return this; - } - - /** - * @return {@link #place} (Where the service was provided.) - */ - public Coding getPlace() { - if (this.place == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.place"); - else if (Configuration.doAutoCreate()) - this.place = new Coding(); // cc - return this.place; - } - - public boolean hasPlace() { - return this.place != null && !this.place.isEmpty(); - } - - /** - * @param value {@link #place} (Where the service was provided.) - */ - public ItemsComponent setPlace(Coding value) { - this.place = value; - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public ItemsComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public ItemsComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public ItemsComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public ItemsComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public ItemsComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public ItemsComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public ItemsComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public List getUdi() { - if (this.udi == null) - this.udi = new ArrayList(); - return this.udi; - } - - public boolean hasUdi() { - if (this.udi == null) - return false; - for (Reference item : this.udi) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - // syntactic sugar - public Reference addUdi() { //3 - Reference t = new Reference(); - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addUdi(Reference t) { //3 - if (t == null) - return this; - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return this; - } - - /** - * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public List getUdiTarget() { - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - return this.udiTarget; - } - - // syntactic sugar - /** - * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public Device addUdiTarget() { - Device r = new Device(); - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - this.udiTarget.add(r); - return r; - } - - /** - * @return {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Physical service site on the patient (limb, tooth, etc).) - */ - public ItemsComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - public List getSubSite() { - if (this.subSite == null) - this.subSite = new ArrayList(); - return this.subSite; - } - - public boolean hasSubSite() { - if (this.subSite == null) - return false; - for (Coding item : this.subSite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subSite} (A region or surface of the site, eg. limb region or tooth surface(s).) - */ - // syntactic sugar - public Coding addSubSite() { //3 - Coding t = new Coding(); - if (this.subSite == null) - this.subSite = new ArrayList(); - this.subSite.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addSubSite(Coding t) { //3 - if (t == null) - return this; - if (this.subSite == null) - this.subSite = new ArrayList(); - this.subSite.add(t); - return this; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public List getNoteNumber() { - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - return this.noteNumber; - } - - public boolean hasNoteNumber() { - if (this.noteNumber == null) - return false; - for (PositiveIntType item : this.noteNumber) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumber} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public PositiveIntType addNoteNumberElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return t; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public ItemsComponent addNoteNumber(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.noteNumber == null) - this.noteNumber = new ArrayList(); - this.noteNumber.add(t); - return this; - } - - /** - * @param value {@link #noteNumber} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumber(int value) { - if (this.noteNumber == null) - return false; - for (PositiveIntType v : this.noteNumber) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (ItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public ItemAdjudicationComponent addAdjudication() { //3 - ItemAdjudicationComponent t = new ItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addAdjudication(ItemAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (Second tier of goods and services.) - */ - // syntactic sugar - public DetailComponent addDetail() { //3 - DetailComponent t = new DetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public ItemsComponent addDetail(DetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ProsthesisComponent getProsthesis() { - if (this.prosthesis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.prosthesis"); - else if (Configuration.doAutoCreate()) - this.prosthesis = new ProsthesisComponent(); // cc - return this.prosthesis; - } - - public boolean hasProsthesis() { - return this.prosthesis != null && !this.prosthesis.isEmpty(); - } - - /** - * @param value {@link #prosthesis} (The materials and placement date of prior fixed prosthesis.) - */ - public ItemsComponent setProsthesis(ProsthesisComponent value) { - this.prosthesis = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("supervisor[x]", "Identifier|Reference(Practitioner)", "The practitioner who is supervising the work of the servicing provider(s).", 0, java.lang.Integer.MAX_VALUE, supervisor)); - childrenList.add(new Property("providerQualification", "Coding", "The qualification which is applicable for this service.", 0, java.lang.Integer.MAX_VALUE, providerQualification)); - childrenList.add(new Property("diagnosisLinkId", "positiveInt", "Diagnosis applicable for this service or product line.", 0, java.lang.Integer.MAX_VALUE, diagnosisLinkId)); - childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("serviceModifier", "Coding", "Unusual circumstances which may influence adjudication.", 0, java.lang.Integer.MAX_VALUE, serviceModifier)); - childrenList.add(new Property("modifier", "Coding", "Item typification or modifiers codes, eg for Oral whether the treatment is cosmetic or associated with TMJ, or an appliance was lost or stolen.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); - childrenList.add(new Property("serviced[x]", "date|Period", "The date or dates when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, serviced)); - childrenList.add(new Property("place", "Coding", "Where the service was provided.", 0, java.lang.Integer.MAX_VALUE, place)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("bodySite", "Coding", "Physical service site on the patient (limb, tooth, etc).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("subSite", "Coding", "A region or surface of the site, eg. limb region or tooth surface(s).", 0, java.lang.Integer.MAX_VALUE, subSite)); - childrenList.add(new Property("noteNumber", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumber)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "Second tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("prosthesis", "", "The materials and placement date of prior fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, prosthesis)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case -1697229976: /*supervisor*/ return this.supervisor == null ? new Base[0] : new Base[] {this.supervisor}; // Type - case -1240156290: /*providerQualification*/ return this.providerQualification == null ? new Base[0] : new Base[] {this.providerQualification}; // Coding - case -1659207418: /*diagnosisLinkId*/ return this.diagnosisLinkId == null ? new Base[0] : this.diagnosisLinkId.toArray(new Base[this.diagnosisLinkId.size()]); // PositiveIntType - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 615164076: /*serviceModifier*/ return this.serviceModifier == null ? new Base[0] : this.serviceModifier.toArray(new Base[this.serviceModifier.size()]); // Coding - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : this.modifier.toArray(new Base[this.modifier.size()]); // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding - case 1379209295: /*serviced*/ return this.serviced == null ? new Base[0] : new Base[] {this.serviced}; // Type - case 106748167: /*place*/ return this.place == null ? new Base[0] : new Base[] {this.place}; // Coding - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding - case -1868566105: /*subSite*/ return this.subSite == null ? new Base[0] : this.subSite.toArray(new Base[this.subSite.size()]); // Coding - case -1110033957: /*noteNumber*/ return this.noteNumber == null ? new Base[0] : this.noteNumber.toArray(new Base[this.noteNumber.size()]); // PositiveIntType - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // ItemAdjudicationComponent - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailComponent - case -2138744398: /*prosthesis*/ return this.prosthesis == null ? new Base[0] : new Base[] {this.prosthesis}; // ProsthesisComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case -1697229976: // supervisor - this.supervisor = (Type) value; // Type - break; - case -1240156290: // providerQualification - this.providerQualification = castToCoding(value); // Coding - break; - case -1659207418: // diagnosisLinkId - this.getDiagnosisLinkId().add(castToPositiveInt(value)); // PositiveIntType - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 615164076: // serviceModifier - this.getServiceModifier().add(castToCoding(value)); // Coding - break; - case -615513385: // modifier - this.getModifier().add(castToCoding(value)); // Coding - break; - case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding - break; - case 1379209295: // serviced - this.serviced = (Type) value; // Type - break; - case 106748167: // place - this.place = castToCoding(value); // Coding - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - case 115642: // udi - this.getUdi().add(castToReference(value)); // Reference - break; - case 1702620169: // bodySite - this.bodySite = castToCoding(value); // Coding - break; - case -1868566105: // subSite - this.getSubSite().add(castToCoding(value)); // Coding - break; - case -1110033957: // noteNumber - this.getNoteNumber().add(castToPositiveInt(value)); // PositiveIntType - break; - case -231349275: // adjudication - this.getAdjudication().add((ItemAdjudicationComponent) value); // ItemAdjudicationComponent - break; - case -1335224239: // detail - this.getDetail().add((DetailComponent) value); // DetailComponent - break; - case -2138744398: // prosthesis - this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("supervisor[x]")) - this.supervisor = (Type) value; // Type - else if (name.equals("providerQualification")) - this.providerQualification = castToCoding(value); // Coding - else if (name.equals("diagnosisLinkId")) - this.getDiagnosisLinkId().add(castToPositiveInt(value)); - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("serviceModifier")) - this.getServiceModifier().add(castToCoding(value)); - else if (name.equals("modifier")) - this.getModifier().add(castToCoding(value)); - else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); - else if (name.equals("serviced[x]")) - this.serviced = (Type) value; // Type - else if (name.equals("place")) - this.place = castToCoding(value); // Coding - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else if (name.equals("udi")) - this.getUdi().add(castToReference(value)); - else if (name.equals("bodySite")) - this.bodySite = castToCoding(value); // Coding - else if (name.equals("subSite")) - this.getSubSite().add(castToCoding(value)); - else if (name.equals("noteNumber")) - this.getNoteNumber().add(castToPositiveInt(value)); - else if (name.equals("adjudication")) - this.getAdjudication().add((ItemAdjudicationComponent) value); - else if (name.equals("detail")) - this.getDetail().add((DetailComponent) value); - else if (name.equals("prosthesis")) - this.prosthesis = (ProsthesisComponent) value; // ProsthesisComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 2064698607: return getProvider(); // Type - case -1823115240: return getSupervisor(); // Type - case -1240156290: return getProviderQualification(); // Coding - case -1659207418: throw new FHIRException("Cannot make property diagnosisLinkId as it is not a complex type"); // PositiveIntType - case 1984153269: return getService(); // Coding - case 615164076: return addServiceModifier(); // Coding - case -615513385: return addModifier(); // Coding - case 1010065041: return addProgramCode(); // Coding - case -1927922223: return getServiced(); // Type - case 106748167: return getPlace(); // Coding - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - case 115642: return addUdi(); // Reference - case 1702620169: return getBodySite(); // Coding - case -1868566105: return addSubSite(); // Coding - case -1110033957: throw new FHIRException("Cannot make property noteNumber as it is not a complex type"); // PositiveIntType - case -231349275: return addAdjudication(); // ItemAdjudicationComponent - case -1335224239: return addDetail(); // DetailComponent - case -2138744398: return getProsthesis(); // ProsthesisComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("supervisorIdentifier")) { - this.supervisor = new Identifier(); - return this.supervisor; - } - else if (name.equals("supervisorReference")) { - this.supervisor = new Reference(); - return this.supervisor; - } - else if (name.equals("providerQualification")) { - this.providerQualification = new Coding(); - return this.providerQualification; - } - else if (name.equals("diagnosisLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.diagnosisLinkId"); - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("serviceModifier")) { - return addServiceModifier(); - } - else if (name.equals("modifier")) { - return addModifier(); - } - else if (name.equals("programCode")) { - return addProgramCode(); - } - else if (name.equals("servicedDate")) { - this.serviced = new DateType(); - return this.serviced; - } - else if (name.equals("servicedPeriod")) { - this.serviced = new Period(); - return this.serviced; - } - else if (name.equals("place")) { - this.place = new Coding(); - return this.place; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else if (name.equals("udi")) { - return addUdi(); - } - else if (name.equals("bodySite")) { - this.bodySite = new Coding(); - return this.bodySite; - } - else if (name.equals("subSite")) { - return addSubSite(); - } - else if (name.equals("noteNumber")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.noteNumber"); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else if (name.equals("detail")) { - return addDetail(); - } - else if (name.equals("prosthesis")) { - this.prosthesis = new ProsthesisComponent(); - return this.prosthesis; - } - else - return super.addChild(name); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.supervisor = supervisor == null ? null : supervisor.copy(); - dst.providerQualification = providerQualification == null ? null : providerQualification.copy(); - if (diagnosisLinkId != null) { - dst.diagnosisLinkId = new ArrayList(); - for (PositiveIntType i : diagnosisLinkId) - dst.diagnosisLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - if (serviceModifier != null) { - dst.serviceModifier = new ArrayList(); - for (Coding i : serviceModifier) - dst.serviceModifier.add(i.copy()); - }; - if (modifier != null) { - dst.modifier = new ArrayList(); - for (Coding i : modifier) - dst.modifier.add(i.copy()); - }; - if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) - dst.programCode.add(i.copy()); - }; - dst.serviced = serviced == null ? null : serviced.copy(); - dst.place = place == null ? null : place.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (udi != null) { - dst.udi = new ArrayList(); - for (Reference i : udi) - dst.udi.add(i.copy()); - }; - dst.bodySite = bodySite == null ? null : bodySite.copy(); - if (subSite != null) { - dst.subSite = new ArrayList(); - for (Coding i : subSite) - dst.subSite.add(i.copy()); - }; - if (noteNumber != null) { - dst.noteNumber = new ArrayList(); - for (PositiveIntType i : noteNumber) - dst.noteNumber.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (ItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.prosthesis = prosthesis == null ? null : prosthesis.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(provider, o.provider, true) - && compareDeep(supervisor, o.supervisor, true) && compareDeep(providerQualification, o.providerQualification, true) - && compareDeep(diagnosisLinkId, o.diagnosisLinkId, true) && compareDeep(service, o.service, true) - && compareDeep(serviceModifier, o.serviceModifier, true) && compareDeep(modifier, o.modifier, true) - && compareDeep(programCode, o.programCode, true) && compareDeep(serviced, o.serviced, true) && compareDeep(place, o.place, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) && compareDeep(factor, o.factor, true) - && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) && compareDeep(udi, o.udi, true) - && compareDeep(bodySite, o.bodySite, true) && compareDeep(subSite, o.subSite, true) && compareDeep(noteNumber, o.noteNumber, true) - && compareDeep(adjudication, o.adjudication, true) && compareDeep(detail, o.detail, true) && compareDeep(prosthesis, o.prosthesis, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(diagnosisLinkId, o.diagnosisLinkId, true) - && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) && compareValues(noteNumber, o.noteNumber, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (provider == null || provider.isEmpty()) && (supervisor == null || supervisor.isEmpty()) - && (providerQualification == null || providerQualification.isEmpty()) && (diagnosisLinkId == null || diagnosisLinkId.isEmpty()) - && (service == null || service.isEmpty()) && (serviceModifier == null || serviceModifier.isEmpty()) - && (modifier == null || modifier.isEmpty()) && (programCode == null || programCode.isEmpty()) - && (serviced == null || serviced.isEmpty()) && (place == null || place.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (unitPrice == null || unitPrice.isEmpty()) && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) - && (net == null || net.isEmpty()) && (udi == null || udi.isEmpty()) && (bodySite == null || bodySite.isEmpty()) - && (subSite == null || subSite.isEmpty()) && (noteNumber == null || noteNumber.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - && (prosthesis == null || prosthesis.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.item"; - - } - - } - - @Block() - public static class ItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public ItemAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public ItemAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public ItemAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public ItemAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public ItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public ItemAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); - } - else - return super.addChild(name); - } - - public ItemAdjudicationComponent copy() { - ItemAdjudicationComponent dst = new ItemAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemAdjudicationComponent)) - return false; - ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemAdjudicationComponent)) - return false; - ItemAdjudicationComponent o = (ItemAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.item.adjudication"; - - } - - } - - @Block() - public static class DetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Group or type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional item codes", formalDefinition="If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. - */ - @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) - protected List programCode; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected SimpleQuantity quantity; - - /** - * If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group. - */ - @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected List udi; - /** - * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) - */ - protected List udiTarget; - - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * Third tier of goods and services. - */ - @Child(name = "subDetail", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional items", formalDefinition="Third tier of goods and services." ) - protected List subDetail; - - private static final long serialVersionUID = -240637412L; - - /** - * Constructor - */ - public DetailComponent() { - super(); - } - - /** - * Constructor - */ - public DetailComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public DetailComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public DetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public DetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.) - */ - public DetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - public List getProgramCode() { - if (this.programCode == null) - this.programCode = new ArrayList(); - return this.programCode; - } - - public boolean hasProgramCode() { - if (this.programCode == null) - return false; - for (Coding item : this.programCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - // syntactic sugar - public Coding addProgramCode() { //3 - Coding t = new Coding(); - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addProgramCode(Coding t) { //3 - if (t == null) - return this; - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public DetailComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.) - */ - public DetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public DetailComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public DetailComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public DetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public List getUdi() { - if (this.udi == null) - this.udi = new ArrayList(); - return this.udi; - } - - public boolean hasUdi() { - if (this.udi == null) - return false; - for (Reference item : this.udi) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - // syntactic sugar - public Reference addUdi() { //3 - Reference t = new Reference(); - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addUdi(Reference t) { //3 - if (t == null) - return this; - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return this; - } - - /** - * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public List getUdiTarget() { - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - return this.udiTarget; - } - - // syntactic sugar - /** - * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public Device addUdiTarget() { - Device r = new Device(); - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - this.udiTarget.add(r); - return r; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (DetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public DetailAdjudicationComponent addAdjudication() { //3 - DetailAdjudicationComponent t = new DetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addAdjudication(DetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - public List getSubDetail() { - if (this.subDetail == null) - this.subDetail = new ArrayList(); - return this.subDetail; - } - - public boolean hasSubDetail() { - if (this.subDetail == null) - return false; - for (SubDetailComponent item : this.subDetail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subDetail} (Third tier of goods and services.) - */ - // syntactic sugar - public SubDetailComponent addSubDetail() { //3 - SubDetailComponent t = new SubDetailComponent(); - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return t; - } - - // syntactic sugar - public DetailComponent addSubDetail(SubDetailComponent t) { //3 - if (t == null) - return this; - if (this.subDetail == null) - this.subDetail = new ArrayList(); - this.subDetail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("service", "Coding", "If a grouping item then 'GROUP' otherwise it is a node therefore a code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "If the item is a node then this is the fee for the product or service, otherwise this is the total of the fees for the children of the group.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("subDetail", "", "Third tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, subDetail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // DetailAdjudicationComponent - case -828829007: /*subDetail*/ return this.subDetail == null ? new Base[0] : this.subDetail.toArray(new Base[this.subDetail.size()]); // SubDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - case 115642: // udi - this.getUdi().add(castToReference(value)); // Reference - break; - case -231349275: // adjudication - this.getAdjudication().add((DetailAdjudicationComponent) value); // DetailAdjudicationComponent - break; - case -828829007: // subDetail - this.getSubDetail().add((SubDetailComponent) value); // SubDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else if (name.equals("udi")) - this.getUdi().add(castToReference(value)); - else if (name.equals("adjudication")) - this.getAdjudication().add((DetailAdjudicationComponent) value); - else if (name.equals("subDetail")) - this.getSubDetail().add((SubDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 1984153269: return getService(); // Coding - case 1010065041: return addProgramCode(); // Coding - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - case 115642: return addUdi(); // Reference - case -231349275: return addAdjudication(); // DetailAdjudicationComponent - case -828829007: return addSubDetail(); // SubDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("programCode")) { - return addProgramCode(); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else if (name.equals("udi")) { - return addUdi(); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else if (name.equals("subDetail")) { - return addSubDetail(); - } - else - return super.addChild(name); - } - - public DetailComponent copy() { - DetailComponent dst = new DetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) - dst.programCode.add(i.copy()); - }; - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (udi != null) { - dst.udi = new ArrayList(); - for (Reference i : udi) - dst.udi.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (DetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (subDetail != null) { - dst.subDetail = new ArrayList(); - for (SubDetailComponent i : subDetail) - dst.subDetail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailComponent)) - return false; - DetailComponent o = (DetailComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) - && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(adjudication, o.adjudication, true) && compareDeep(subDetail, o.subDetail, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailComponent)) - return false; - DetailComponent o = (DetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.isEmpty()) && (programCode == null || programCode.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()) && (adjudication == null || adjudication.isEmpty()) && (subDetail == null || subDetail.isEmpty()) - ; - } - - public String fhirType() { - return "ExplanationOfBenefit.item.detail"; - - } - - } - - @Block() - public static class DetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public DetailAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public DetailAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public DetailAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public DetailAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public DetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public DetailAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); - } - else - return super.addChild(name); - } - - public DetailAdjudicationComponent copy() { - DetailAdjudicationComponent dst = new DetailAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailAdjudicationComponent)) - return false; - DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailAdjudicationComponent)) - return false; - DetailAdjudicationComponent o = (DetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.item.detail.adjudication"; - - } - - } - - @Block() - public static class SubDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected PositiveIntType sequence; - - /** - * The type of product or service. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of product or service", formalDefinition="The type of product or service." ) - protected Coding type; - - /** - * The fee for an addittional service or product or charge. - */ - @Child(name = "service", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional item codes", formalDefinition="The fee for an addittional service or product or charge." ) - protected Coding service; - - /** - * For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program. - */ - @Child(name = "programCode", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Program specific reason for item inclusion", formalDefinition="For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program." ) - protected List programCode; - - /** - * The number of repetitions of a service or product. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Count of Products or Services", formalDefinition="The number of repetitions of a service or product." ) - protected SimpleQuantity quantity; - - /** - * The fee for an addittional service or product or charge. - */ - @Child(name = "unitPrice", type = {Money.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fee, charge or cost per point", formalDefinition="The fee for an addittional service or product or charge." ) - protected Money unitPrice; - - /** - * A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - @Child(name = "factor", type = {DecimalType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Price scaling factor", formalDefinition="A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount." ) - protected DecimalType factor; - - /** - * An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - @Child(name = "points", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Difficulty scaling factor", formalDefinition="An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point." ) - protected DecimalType points; - - /** - * The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied. - */ - @Child(name = "net", type = {Money.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Net additional item cost", formalDefinition="The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied." ) - protected Money net; - - /** - * List of Unique Device Identifiers associated with this line item. - */ - @Child(name = "udi", type = {Device.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Device Identifier", formalDefinition="List of Unique Device Identifiers associated with this line item." ) - protected List udi; - /** - * The actual objects that are the target of the reference (List of Unique Device Identifiers associated with this line item.) - */ - protected List udiTarget; - - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="SubDetail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = -1690477905L; - - /** - * Constructor - */ - public SubDetailComponent() { - super(); - } - - /** - * Constructor - */ - public SubDetailComponent(PositiveIntType sequence, Coding type, Coding service) { - super(); - this.sequence = sequence; - this.type = type; - this.service = service; - } - - /** - * @return {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public PositiveIntType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new PositiveIntType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public SubDetailComponent setSequenceElement(PositiveIntType value) { - this.sequence = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value A service line number. - */ - public SubDetailComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new PositiveIntType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of product or service.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of product or service.) - */ - public SubDetailComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #service} (The fee for an addittional service or product or charge.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (The fee for an addittional service or product or charge.) - */ - public SubDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - public List getProgramCode() { - if (this.programCode == null) - this.programCode = new ArrayList(); - return this.programCode; - } - - public boolean hasProgramCode() { - if (this.programCode == null) - return false; - for (Coding item : this.programCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programCode} (For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.) - */ - // syntactic sugar - public Coding addProgramCode() { //3 - Coding t = new Coding(); - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addProgramCode(Coding t) { //3 - if (t == null) - return this; - if (this.programCode == null) - this.programCode = new ArrayList(); - this.programCode.add(t); - return this; - } - - /** - * @return {@link #quantity} (The number of repetitions of a service or product.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The number of repetitions of a service or product.) - */ - public SubDetailComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #unitPrice} (The fee for an addittional service or product or charge.) - */ - public Money getUnitPrice() { - if (this.unitPrice == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.unitPrice"); - else if (Configuration.doAutoCreate()) - this.unitPrice = new Money(); // cc - return this.unitPrice; - } - - public boolean hasUnitPrice() { - return this.unitPrice != null && !this.unitPrice.isEmpty(); - } - - /** - * @param value {@link #unitPrice} (The fee for an addittional service or product or charge.) - */ - public SubDetailComponent setUnitPrice(Money value) { - this.unitPrice = value; - return this; - } - - /** - * @return {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SubDetailComponent setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount. - */ - public SubDetailComponent setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public DecimalType getPointsElement() { - if (this.points == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.points"); - else if (Configuration.doAutoCreate()) - this.points = new DecimalType(); // bb - return this.points; - } - - public boolean hasPointsElement() { - return this.points != null && !this.points.isEmpty(); - } - - public boolean hasPoints() { - return this.points != null && !this.points.isEmpty(); - } - - /** - * @param value {@link #points} (An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.). This is the underlying object with id, value and extensions. The accessor "getPoints" gives direct access to the value - */ - public SubDetailComponent setPointsElement(DecimalType value) { - this.points = value; - return this; - } - - /** - * @return An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public BigDecimal getPoints() { - return this.points == null ? null : this.points.getValue(); - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(BigDecimal value) { - if (value == null) - this.points = null; - else { - if (this.points == null) - this.points = new DecimalType(); - this.points.setValue(value); - } - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(long value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @param value An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point. - */ - public SubDetailComponent setPoints(double value) { - this.points = new DecimalType(); - this.points.setValue(value); - return this; - } - - /** - * @return {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public Money getNet() { - if (this.net == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailComponent.net"); - else if (Configuration.doAutoCreate()) - this.net = new Money(); // cc - return this.net; - } - - public boolean hasNet() { - return this.net != null && !this.net.isEmpty(); - } - - /** - * @param value {@link #net} (The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.) - */ - public SubDetailComponent setNet(Money value) { - this.net = value; - return this; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - public List getUdi() { - if (this.udi == null) - this.udi = new ArrayList(); - return this.udi; - } - - public boolean hasUdi() { - if (this.udi == null) - return false; - for (Reference item : this.udi) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #udi} (List of Unique Device Identifiers associated with this line item.) - */ - // syntactic sugar - public Reference addUdi() { //3 - Reference t = new Reference(); - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addUdi(Reference t) { //3 - if (t == null) - return this; - if (this.udi == null) - this.udi = new ArrayList(); - this.udi.add(t); - return this; - } - - /** - * @return {@link #udi} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public List getUdiTarget() { - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - return this.udiTarget; - } - - // syntactic sugar - /** - * @return {@link #udi} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. List of Unique Device Identifiers associated with this line item.) - */ - public Device addUdiTarget() { - Device r = new Device(); - if (this.udiTarget == null) - this.udiTarget = new ArrayList(); - this.udiTarget.add(r); - return r; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (SubDetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public SubDetailAdjudicationComponent addAdjudication() { //3 - SubDetailAdjudicationComponent t = new SubDetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public SubDetailComponent addAdjudication(SubDetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "positiveInt", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("type", "Coding", "The type of product or service.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("service", "Coding", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("programCode", "Coding", "For programs which require reson codes for the inclusion, covering, of this billed item under the program or sub-program.", 0, java.lang.Integer.MAX_VALUE, programCode)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The number of repetitions of a service or product.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("unitPrice", "Money", "The fee for an addittional service or product or charge.", 0, java.lang.Integer.MAX_VALUE, unitPrice)); - childrenList.add(new Property("factor", "decimal", "A real number that represents a multiplier used in determining the overall value of services delivered and/or goods received. The concept of a Factor allows for a discount or surcharge multiplier to be applied to a monetary amount.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("points", "decimal", "An amount that expresses the weighting (based on difficulty, cost and/or resource intensiveness) associated with the good or service delivered. The concept of Points allows for assignment of point values for services and/or goods, such that a monetary amount can be assigned to each point.", 0, java.lang.Integer.MAX_VALUE, points)); - childrenList.add(new Property("net", "Money", "The quantity times the unit price for an addittional service or product or charge. For example, the formula: unit Quantity * unit Price (Cost per Point) * factor Number * points = net Amount. Quantity, factor and points are assumed to be 1 if not supplied.", 0, java.lang.Integer.MAX_VALUE, net)); - childrenList.add(new Property("udi", "Reference(Device)", "List of Unique Device Identifiers associated with this line item.", 0, java.lang.Integer.MAX_VALUE, udi)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 1010065041: /*programCode*/ return this.programCode == null ? new Base[0] : this.programCode.toArray(new Base[this.programCode.size()]); // Coding - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -486196699: /*unitPrice*/ return this.unitPrice == null ? new Base[0] : new Base[] {this.unitPrice}; // Money - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case -982754077: /*points*/ return this.points == null ? new Base[0] : new Base[] {this.points}; // DecimalType - case 108957: /*net*/ return this.net == null ? new Base[0] : new Base[] {this.net}; // Money - case 115642: /*udi*/ return this.udi == null ? new Base[0] : this.udi.toArray(new Base[this.udi.size()]); // Reference - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // SubDetailAdjudicationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 1010065041: // programCode - this.getProgramCode().add(castToCoding(value)); // Coding - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -486196699: // unitPrice - this.unitPrice = castToMoney(value); // Money - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case -982754077: // points - this.points = castToDecimal(value); // DecimalType - break; - case 108957: // net - this.net = castToMoney(value); // Money - break; - case 115642: // udi - this.getUdi().add(castToReference(value)); // Reference - break; - case -231349275: // adjudication - this.getAdjudication().add((SubDetailAdjudicationComponent) value); // SubDetailAdjudicationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("programCode")) - this.getProgramCode().add(castToCoding(value)); - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("unitPrice")) - this.unitPrice = castToMoney(value); // Money - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("points")) - this.points = castToDecimal(value); // DecimalType - else if (name.equals("net")) - this.net = castToMoney(value); // Money - else if (name.equals("udi")) - this.getUdi().add(castToReference(value)); - else if (name.equals("adjudication")) - this.getAdjudication().add((SubDetailAdjudicationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 1984153269: return getService(); // Coding - case 1010065041: return addProgramCode(); // Coding - case -1285004149: return getQuantity(); // SimpleQuantity - case -486196699: return getUnitPrice(); // Money - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case -982754077: throw new FHIRException("Cannot make property points as it is not a complex type"); // DecimalType - case 108957: return getNet(); // Money - case 115642: return addUdi(); // Reference - case -231349275: return addAdjudication(); // SubDetailAdjudicationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequence"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("programCode")) { - return addProgramCode(); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("unitPrice")) { - this.unitPrice = new Money(); - return this.unitPrice; - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.factor"); - } - else if (name.equals("points")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.points"); - } - else if (name.equals("net")) { - this.net = new Money(); - return this.net; - } - else if (name.equals("udi")) { - return addUdi(); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else - return super.addChild(name); - } - - public SubDetailComponent copy() { - SubDetailComponent dst = new SubDetailComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.type = type == null ? null : type.copy(); - dst.service = service == null ? null : service.copy(); - if (programCode != null) { - dst.programCode = new ArrayList(); - for (Coding i : programCode) - dst.programCode.add(i.copy()); - }; - dst.quantity = quantity == null ? null : quantity.copy(); - dst.unitPrice = unitPrice == null ? null : unitPrice.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.points = points == null ? null : points.copy(); - dst.net = net == null ? null : net.copy(); - if (udi != null) { - dst.udi = new ArrayList(); - for (Reference i : udi) - dst.udi.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (SubDetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(type, o.type, true) && compareDeep(service, o.service, true) - && compareDeep(programCode, o.programCode, true) && compareDeep(quantity, o.quantity, true) && compareDeep(unitPrice, o.unitPrice, true) - && compareDeep(factor, o.factor, true) && compareDeep(points, o.points, true) && compareDeep(net, o.net, true) - && compareDeep(udi, o.udi, true) && compareDeep(adjudication, o.adjudication, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubDetailComponent)) - return false; - SubDetailComponent o = (SubDetailComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(factor, o.factor, true) && compareValues(points, o.points, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (type == null || type.isEmpty()) - && (service == null || service.isEmpty()) && (programCode == null || programCode.isEmpty()) - && (quantity == null || quantity.isEmpty()) && (unitPrice == null || unitPrice.isEmpty()) - && (factor == null || factor.isEmpty()) && (points == null || points.isEmpty()) && (net == null || net.isEmpty()) - && (udi == null || udi.isEmpty()) && (adjudication == null || adjudication.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.item.detail.subDetail"; - - } - - } - - @Block() - public static class SubDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public SubDetailAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public SubDetailAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public SubDetailAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public SubDetailAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public SubDetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubDetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SubDetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubDetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubDetailAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public SubDetailAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); - } - else - return super.addChild(name); - } - - public SubDetailAdjudicationComponent copy() { - SubDetailAdjudicationComponent dst = new SubDetailAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubDetailAdjudicationComponent)) - return false; - SubDetailAdjudicationComponent o = (SubDetailAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubDetailAdjudicationComponent)) - return false; - SubDetailAdjudicationComponent o = (SubDetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.item.detail.subDetail.adjudication"; - - } - - } - - @Block() - public static class ProsthesisComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates whether this is the initial placement of a fixed prosthesis. - */ - @Child(name = "initial", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Is this the initial service", formalDefinition="Indicates whether this is the initial placement of a fixed prosthesis." ) - protected BooleanType initial; - - /** - * Date of the initial placement. - */ - @Child(name = "priorDate", type = {DateType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Initial service Date", formalDefinition="Date of the initial placement." ) - protected DateType priorDate; - - /** - * Material of the prior denture or bridge prosthesis. (Oral). - */ - @Child(name = "priorMaterial", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Prosthetic Material", formalDefinition="Material of the prior denture or bridge prosthesis. (Oral)." ) - protected Coding priorMaterial; - - private static final long serialVersionUID = 1739349641L; - - /** - * Constructor - */ - public ProsthesisComponent() { - super(); - } - - /** - * @return {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public BooleanType getInitialElement() { - if (this.initial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.initial"); - else if (Configuration.doAutoCreate()) - this.initial = new BooleanType(); // bb - return this.initial; - } - - public boolean hasInitialElement() { - return this.initial != null && !this.initial.isEmpty(); - } - - public boolean hasInitial() { - return this.initial != null && !this.initial.isEmpty(); - } - - /** - * @param value {@link #initial} (Indicates whether this is the initial placement of a fixed prosthesis.). This is the underlying object with id, value and extensions. The accessor "getInitial" gives direct access to the value - */ - public ProsthesisComponent setInitialElement(BooleanType value) { - this.initial = value; - return this; - } - - /** - * @return Indicates whether this is the initial placement of a fixed prosthesis. - */ - public boolean getInitial() { - return this.initial == null || this.initial.isEmpty() ? false : this.initial.getValue(); - } - - /** - * @param value Indicates whether this is the initial placement of a fixed prosthesis. - */ - public ProsthesisComponent setInitial(boolean value) { - if (this.initial == null) - this.initial = new BooleanType(); - this.initial.setValue(value); - return this; - } - - /** - * @return {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public DateType getPriorDateElement() { - if (this.priorDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorDate"); - else if (Configuration.doAutoCreate()) - this.priorDate = new DateType(); // bb - return this.priorDate; - } - - public boolean hasPriorDateElement() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - public boolean hasPriorDate() { - return this.priorDate != null && !this.priorDate.isEmpty(); - } - - /** - * @param value {@link #priorDate} (Date of the initial placement.). This is the underlying object with id, value and extensions. The accessor "getPriorDate" gives direct access to the value - */ - public ProsthesisComponent setPriorDateElement(DateType value) { - this.priorDate = value; - return this; - } - - /** - * @return Date of the initial placement. - */ - public Date getPriorDate() { - return this.priorDate == null ? null : this.priorDate.getValue(); - } - - /** - * @param value Date of the initial placement. - */ - public ProsthesisComponent setPriorDate(Date value) { - if (value == null) - this.priorDate = null; - else { - if (this.priorDate == null) - this.priorDate = new DateType(); - this.priorDate.setValue(value); - } - return this; - } - - /** - * @return {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public Coding getPriorMaterial() { - if (this.priorMaterial == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProsthesisComponent.priorMaterial"); - else if (Configuration.doAutoCreate()) - this.priorMaterial = new Coding(); // cc - return this.priorMaterial; - } - - public boolean hasPriorMaterial() { - return this.priorMaterial != null && !this.priorMaterial.isEmpty(); - } - - /** - * @param value {@link #priorMaterial} (Material of the prior denture or bridge prosthesis. (Oral).) - */ - public ProsthesisComponent setPriorMaterial(Coding value) { - this.priorMaterial = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("initial", "boolean", "Indicates whether this is the initial placement of a fixed prosthesis.", 0, java.lang.Integer.MAX_VALUE, initial)); - childrenList.add(new Property("priorDate", "date", "Date of the initial placement.", 0, java.lang.Integer.MAX_VALUE, priorDate)); - childrenList.add(new Property("priorMaterial", "Coding", "Material of the prior denture or bridge prosthesis. (Oral).", 0, java.lang.Integer.MAX_VALUE, priorMaterial)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // BooleanType - case -1770675816: /*priorDate*/ return this.priorDate == null ? new Base[0] : new Base[] {this.priorDate}; // DateType - case -532999663: /*priorMaterial*/ return this.priorMaterial == null ? new Base[0] : new Base[] {this.priorMaterial}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1948342084: // initial - this.initial = castToBoolean(value); // BooleanType - break; - case -1770675816: // priorDate - this.priorDate = castToDate(value); // DateType - break; - case -532999663: // priorMaterial - this.priorMaterial = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("initial")) - this.initial = castToBoolean(value); // BooleanType - else if (name.equals("priorDate")) - this.priorDate = castToDate(value); // DateType - else if (name.equals("priorMaterial")) - this.priorMaterial = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1948342084: throw new FHIRException("Cannot make property initial as it is not a complex type"); // BooleanType - case -1770675816: throw new FHIRException("Cannot make property priorDate as it is not a complex type"); // DateType - case -532999663: return getPriorMaterial(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("initial")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.initial"); - } - else if (name.equals("priorDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.priorDate"); - } - else if (name.equals("priorMaterial")) { - this.priorMaterial = new Coding(); - return this.priorMaterial; - } - else - return super.addChild(name); - } - - public ProsthesisComponent copy() { - ProsthesisComponent dst = new ProsthesisComponent(); - copyValues(dst); - dst.initial = initial == null ? null : initial.copy(); - dst.priorDate = priorDate == null ? null : priorDate.copy(); - dst.priorMaterial = priorMaterial == null ? null : priorMaterial.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProsthesisComponent)) - return false; - ProsthesisComponent o = (ProsthesisComponent) other; - return compareDeep(initial, o.initial, true) && compareDeep(priorDate, o.priorDate, true) && compareDeep(priorMaterial, o.priorMaterial, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProsthesisComponent)) - return false; - ProsthesisComponent o = (ProsthesisComponent) other; - return compareValues(initial, o.initial, true) && compareValues(priorDate, o.priorDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (initial == null || initial.isEmpty()) && (priorDate == null || priorDate.isEmpty()) - && (priorMaterial == null || priorMaterial.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.item.prosthesis"; - - } - - } - - @Block() - public static class AddedItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * List of input service items which this service line is intended to replace. - */ - @Child(name = "sequenceLinkId", type = {PositiveIntType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Service instances", formalDefinition="List of input service items which this service line is intended to replace." ) - protected List sequenceLinkId; - - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Group, Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name = "fee", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * A list of note references to the notes provided below. - */ - @Child(name = "noteNumberLinkId", type = {PositiveIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of note numbers which apply", formalDefinition="A list of note references to the notes provided below." ) - protected List noteNumberLinkId; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Added items adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - /** - * The second tier service adjudications for payor added services. - */ - @Child(name = "detail", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Added items details", formalDefinition="The second tier service adjudications for payor added services." ) - protected List detail; - - private static final long serialVersionUID = -1675935854L; - - /** - * Constructor - */ - public AddedItemComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public List getSequenceLinkId() { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkId() { - if (this.sequenceLinkId == null) - return false; - for (PositiveIntType item : this.sequenceLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - // syntactic sugar - public PositiveIntType addSequenceLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return t; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public AddedItemComponent addSequenceLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.sequenceLinkId == null) - this.sequenceLinkId = new ArrayList(); - this.sequenceLinkId.add(t); - return this; - } - - /** - * @param value {@link #sequenceLinkId} (List of input service items which this service line is intended to replace.) - */ - public boolean hasSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - return false; - for (PositiveIntType v : this.sequenceLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); // cc - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public List getNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - return this.noteNumberLinkId; - } - - public boolean hasNoteNumberLinkId() { - if (this.noteNumberLinkId == null) - return false; - for (PositiveIntType item : this.noteNumberLinkId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - // syntactic sugar - public PositiveIntType addNoteNumberLinkIdElement() {//2 - PositiveIntType t = new PositiveIntType(); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return t; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public AddedItemComponent addNoteNumberLinkId(int value) { //1 - PositiveIntType t = new PositiveIntType(); - t.setValue(value); - if (this.noteNumberLinkId == null) - this.noteNumberLinkId = new ArrayList(); - this.noteNumberLinkId.add(t); - return this; - } - - /** - * @param value {@link #noteNumberLinkId} (A list of note references to the notes provided below.) - */ - public boolean hasNoteNumberLinkId(int value) { - if (this.noteNumberLinkId == null) - return false; - for (PositiveIntType v : this.noteNumberLinkId) - if (v.equals(value)) // positiveInt - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemAdjudicationComponent addAdjudication() { //3 - AddedItemAdjudicationComponent t = new AddedItemAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public AddedItemComponent addAdjudication(AddedItemAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (AddedItemsDetailComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (The second tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemsDetailComponent addDetail() { //3 - AddedItemsDetailComponent t = new AddedItemsDetailComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public AddedItemComponent addDetail(AddedItemsDetailComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "positiveInt", "List of input service items which this service line is intended to replace.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("noteNumberLinkId", "positiveInt", "A list of note references to the notes provided below.", 0, java.lang.Integer.MAX_VALUE, noteNumberLinkId)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - childrenList.add(new Property("detail", "", "The second tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : this.sequenceLinkId.toArray(new Base[this.sequenceLinkId.size()]); // PositiveIntType - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money - case -1859667856: /*noteNumberLinkId*/ return this.noteNumberLinkId == null ? new Base[0] : this.noteNumberLinkId.toArray(new Base[this.noteNumberLinkId.size()]); // PositiveIntType - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemAdjudicationComponent - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // AddedItemsDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.getSequenceLinkId().add(castToPositiveInt(value)); // PositiveIntType - break; - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 101254: // fee - this.fee = castToMoney(value); // Money - break; - case -1859667856: // noteNumberLinkId - this.getNoteNumberLinkId().add(castToPositiveInt(value)); // PositiveIntType - break; - case -231349275: // adjudication - this.getAdjudication().add((AddedItemAdjudicationComponent) value); // AddedItemAdjudicationComponent - break; - case -1335224239: // detail - this.getDetail().add((AddedItemsDetailComponent) value); // AddedItemsDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.getSequenceLinkId().add(castToPositiveInt(value)); - else if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("fee")) - this.fee = castToMoney(value); // Money - else if (name.equals("noteNumberLinkId")) - this.getNoteNumberLinkId().add(castToPositiveInt(value)); - else if (name.equals("adjudication")) - this.getAdjudication().add((AddedItemAdjudicationComponent) value); - else if (name.equals("detail")) - this.getDetail().add((AddedItemsDetailComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // PositiveIntType - case 1984153269: return getService(); // Coding - case 101254: return getFee(); // Money - case -1859667856: throw new FHIRException("Cannot make property noteNumberLinkId as it is not a complex type"); // PositiveIntType - case -231349275: return addAdjudication(); // AddedItemAdjudicationComponent - case -1335224239: return addDetail(); // AddedItemsDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.sequenceLinkId"); - } - else if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("fee")) { - this.fee = new Money(); - return this.fee; - } - else if (name.equals("noteNumberLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.noteNumberLinkId"); - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public AddedItemComponent copy() { - AddedItemComponent dst = new AddedItemComponent(); - copyValues(dst); - if (sequenceLinkId != null) { - dst.sequenceLinkId = new ArrayList(); - for (PositiveIntType i : sequenceLinkId) - dst.sequenceLinkId.add(i.copy()); - }; - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (noteNumberLinkId != null) { - dst.noteNumberLinkId = new ArrayList(); - for (PositiveIntType i : noteNumberLinkId) - dst.noteNumberLinkId.add(i.copy()); - }; - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - if (detail != null) { - dst.detail = new ArrayList(); - for (AddedItemsDetailComponent i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemComponent)) - return false; - AddedItemComponent o = (AddedItemComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true) && compareDeep(service, o.service, true) - && compareDeep(fee, o.fee, true) && compareDeep(noteNumberLinkId, o.noteNumberLinkId, true) && compareDeep(adjudication, o.adjudication, true) - && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemComponent)) - return false; - AddedItemComponent o = (AddedItemComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true) && compareValues(noteNumberLinkId, o.noteNumberLinkId, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()) && (service == null || service.isEmpty()) - && (fee == null || fee.isEmpty()) && (noteNumberLinkId == null || noteNumberLinkId.isEmpty()) - && (adjudication == null || adjudication.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - public String fhirType() { - return "ExplanationOfBenefit.addItem"; - - } - - } - - @Block() - public static class AddedItemAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public AddedItemAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public AddedItemAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public AddedItemAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public AddedItemAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); - } - else - return super.addChild(name); - } - - public AddedItemAdjudicationComponent copy() { - AddedItemAdjudicationComponent dst = new AddedItemAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemAdjudicationComponent)) - return false; - AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemAdjudicationComponent)) - return false; - AddedItemAdjudicationComponent o = (AddedItemAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.addItem.adjudication"; - - } - - } - - @Block() - public static class AddedItemsDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code to indicate the Professional Service or Product supplied. - */ - @Child(name = "service", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service or Product", formalDefinition="A code to indicate the Professional Service or Product supplied." ) - protected Coding service; - - /** - * The fee charged for the professional service or product.. - */ - @Child(name = "fee", type = {Money.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Professional fee or Product charge", formalDefinition="The fee charged for the professional service or product.." ) - protected Money fee; - - /** - * The adjudications results. - */ - @Child(name = "adjudication", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Added items detail adjudication", formalDefinition="The adjudications results." ) - protected List adjudication; - - private static final long serialVersionUID = -2104242020L; - - /** - * Constructor - */ - public AddedItemsDetailComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemsDetailComponent(Coding service) { - super(); - this.service = service; - } - - /** - * @return {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public Coding getService() { - if (this.service == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.service"); - else if (Configuration.doAutoCreate()) - this.service = new Coding(); // cc - return this.service; - } - - public boolean hasService() { - return this.service != null && !this.service.isEmpty(); - } - - /** - * @param value {@link #service} (A code to indicate the Professional Service or Product supplied.) - */ - public AddedItemsDetailComponent setService(Coding value) { - this.service = value; - return this; - } - - /** - * @return {@link #fee} (The fee charged for the professional service or product..) - */ - public Money getFee() { - if (this.fee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemsDetailComponent.fee"); - else if (Configuration.doAutoCreate()) - this.fee = new Money(); // cc - return this.fee; - } - - public boolean hasFee() { - return this.fee != null && !this.fee.isEmpty(); - } - - /** - * @param value {@link #fee} (The fee charged for the professional service or product..) - */ - public AddedItemsDetailComponent setFee(Money value) { - this.fee = value; - return this; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - public List getAdjudication() { - if (this.adjudication == null) - this.adjudication = new ArrayList(); - return this.adjudication; - } - - public boolean hasAdjudication() { - if (this.adjudication == null) - return false; - for (AddedItemDetailAdjudicationComponent item : this.adjudication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #adjudication} (The adjudications results.) - */ - // syntactic sugar - public AddedItemDetailAdjudicationComponent addAdjudication() { //3 - AddedItemDetailAdjudicationComponent t = new AddedItemDetailAdjudicationComponent(); - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return t; - } - - // syntactic sugar - public AddedItemsDetailComponent addAdjudication(AddedItemDetailAdjudicationComponent t) { //3 - if (t == null) - return this; - if (this.adjudication == null) - this.adjudication = new ArrayList(); - this.adjudication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("service", "Coding", "A code to indicate the Professional Service or Product supplied.", 0, java.lang.Integer.MAX_VALUE, service)); - childrenList.add(new Property("fee", "Money", "The fee charged for the professional service or product..", 0, java.lang.Integer.MAX_VALUE, fee)); - childrenList.add(new Property("adjudication", "", "The adjudications results.", 0, java.lang.Integer.MAX_VALUE, adjudication)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1984153269: /*service*/ return this.service == null ? new Base[0] : new Base[] {this.service}; // Coding - case 101254: /*fee*/ return this.fee == null ? new Base[0] : new Base[] {this.fee}; // Money - case -231349275: /*adjudication*/ return this.adjudication == null ? new Base[0] : this.adjudication.toArray(new Base[this.adjudication.size()]); // AddedItemDetailAdjudicationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1984153269: // service - this.service = castToCoding(value); // Coding - break; - case 101254: // fee - this.fee = castToMoney(value); // Money - break; - case -231349275: // adjudication - this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); // AddedItemDetailAdjudicationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("service")) - this.service = castToCoding(value); // Coding - else if (name.equals("fee")) - this.fee = castToMoney(value); // Money - else if (name.equals("adjudication")) - this.getAdjudication().add((AddedItemDetailAdjudicationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1984153269: return getService(); // Coding - case 101254: return getFee(); // Money - case -231349275: return addAdjudication(); // AddedItemDetailAdjudicationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("service")) { - this.service = new Coding(); - return this.service; - } - else if (name.equals("fee")) { - this.fee = new Money(); - return this.fee; - } - else if (name.equals("adjudication")) { - return addAdjudication(); - } - else - return super.addChild(name); - } - - public AddedItemsDetailComponent copy() { - AddedItemsDetailComponent dst = new AddedItemsDetailComponent(); - copyValues(dst); - dst.service = service == null ? null : service.copy(); - dst.fee = fee == null ? null : fee.copy(); - if (adjudication != null) { - dst.adjudication = new ArrayList(); - for (AddedItemDetailAdjudicationComponent i : adjudication) - dst.adjudication.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemsDetailComponent)) - return false; - AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; - return compareDeep(service, o.service, true) && compareDeep(fee, o.fee, true) && compareDeep(adjudication, o.adjudication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemsDetailComponent)) - return false; - AddedItemsDetailComponent o = (AddedItemsDetailComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (service == null || service.isEmpty()) && (fee == null || fee.isEmpty()) - && (adjudication == null || adjudication.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.addItem.detail"; - - } - - } - - @Block() - public static class AddedItemDetailAdjudicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication category such as co-pay, eligible, benefit, etc.", formalDefinition="Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc." ) - protected Coding category; - - /** - * Adjudication reason such as limit reached. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Adjudication reason", formalDefinition="Adjudication reason such as limit reached." ) - protected Coding reason; - - /** - * Monitory amount associated with the code. - */ - @Child(name = "amount", type = {Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Monetary amount", formalDefinition="Monitory amount associated with the code." ) - protected Money amount; - - /** - * A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - @Child(name = "value", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Non-monitory value", formalDefinition="A non-monetary value for example a percentage. Mutually exclusive to the amount element above." ) - protected DecimalType value; - - private static final long serialVersionUID = -1926987562L; - - /** - * Constructor - */ - public AddedItemDetailAdjudicationComponent() { - super(); - } - - /** - * Constructor - */ - public AddedItemDetailAdjudicationComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.) - */ - public AddedItemDetailAdjudicationComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #reason} (Adjudication reason such as limit reached.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Adjudication reason such as limit reached.) - */ - public AddedItemDetailAdjudicationComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #amount} (Monitory amount associated with the code.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Monitory amount associated with the code.) - */ - public AddedItemDetailAdjudicationComponent setAmount(Money value) { - this.amount = value; - return this; - } - - /** - * @return {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AddedItemDetailAdjudicationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (A non-monetary value for example a percentage. Mutually exclusive to the amount element above.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public AddedItemDetailAdjudicationComponent setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value A non-monetary value for example a percentage. Mutually exclusive to the amount element above. - */ - public AddedItemDetailAdjudicationComponent setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Code indicating: Co-Pay, deductable, elegible, benefit, tax, etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("reason", "Coding", "Adjudication reason such as limit reached.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("amount", "Money", "Monitory amount associated with the code.", 0, java.lang.Integer.MAX_VALUE, amount)); - childrenList.add(new Property("value", "decimal", "A non-monetary value for example a percentage. Mutually exclusive to the amount element above.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case -934964668: return getReason(); // Coding - case -1413853096: return getAmount(); // Money - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.value"); - } - else - return super.addChild(name); - } - - public AddedItemDetailAdjudicationComponent copy() { - AddedItemDetailAdjudicationComponent dst = new AddedItemDetailAdjudicationComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.amount = amount == null ? null : amount.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AddedItemDetailAdjudicationComponent)) - return false; - AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; - return compareDeep(category, o.category, true) && compareDeep(reason, o.reason, true) && compareDeep(amount, o.amount, true) - && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AddedItemDetailAdjudicationComponent)) - return false; - AddedItemDetailAdjudicationComponent o = (AddedItemDetailAdjudicationComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (reason == null || reason.isEmpty()) - && (amount == null || amount.isEmpty()) && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.addItem.detail.adjudication"; - - } - - } - - @Block() - public static class MissingTeethComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code identifying which tooth is missing. - */ - @Child(name = "tooth", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Tooth Code", formalDefinition="The code identifying which tooth is missing." ) - protected Coding tooth; - - /** - * Missing reason may be: E-extraction, O-other. - */ - @Child(name = "reason", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason for missing", formalDefinition="Missing reason may be: E-extraction, O-other." ) - protected Coding reason; - - /** - * The date of the extraction either known from records or patient reported estimate. - */ - @Child(name = "extractionDate", type = {DateType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date of Extraction", formalDefinition="The date of the extraction either known from records or patient reported estimate." ) - protected DateType extractionDate; - - private static final long serialVersionUID = 352913313L; - - /** - * Constructor - */ - public MissingTeethComponent() { - super(); - } - - /** - * Constructor - */ - public MissingTeethComponent(Coding tooth) { - super(); - this.tooth = tooth; - } - - /** - * @return {@link #tooth} (The code identifying which tooth is missing.) - */ - public Coding getTooth() { - if (this.tooth == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.tooth"); - else if (Configuration.doAutoCreate()) - this.tooth = new Coding(); // cc - return this.tooth; - } - - public boolean hasTooth() { - return this.tooth != null && !this.tooth.isEmpty(); - } - - /** - * @param value {@link #tooth} (The code identifying which tooth is missing.) - */ - public MissingTeethComponent setTooth(Coding value) { - this.tooth = value; - return this; - } - - /** - * @return {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public Coding getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new Coding(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Missing reason may be: E-extraction, O-other.) - */ - public MissingTeethComponent setReason(Coding value) { - this.reason = value; - return this; - } - - /** - * @return {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public DateType getExtractionDateElement() { - if (this.extractionDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MissingTeethComponent.extractionDate"); - else if (Configuration.doAutoCreate()) - this.extractionDate = new DateType(); // bb - return this.extractionDate; - } - - public boolean hasExtractionDateElement() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - public boolean hasExtractionDate() { - return this.extractionDate != null && !this.extractionDate.isEmpty(); - } - - /** - * @param value {@link #extractionDate} (The date of the extraction either known from records or patient reported estimate.). This is the underlying object with id, value and extensions. The accessor "getExtractionDate" gives direct access to the value - */ - public MissingTeethComponent setExtractionDateElement(DateType value) { - this.extractionDate = value; - return this; - } - - /** - * @return The date of the extraction either known from records or patient reported estimate. - */ - public Date getExtractionDate() { - return this.extractionDate == null ? null : this.extractionDate.getValue(); - } - - /** - * @param value The date of the extraction either known from records or patient reported estimate. - */ - public MissingTeethComponent setExtractionDate(Date value) { - if (value == null) - this.extractionDate = null; - else { - if (this.extractionDate == null) - this.extractionDate = new DateType(); - this.extractionDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("tooth", "Coding", "The code identifying which tooth is missing.", 0, java.lang.Integer.MAX_VALUE, tooth)); - childrenList.add(new Property("reason", "Coding", "Missing reason may be: E-extraction, O-other.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("extractionDate", "date", "The date of the extraction either known from records or patient reported estimate.", 0, java.lang.Integer.MAX_VALUE, extractionDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 110545608: /*tooth*/ return this.tooth == null ? new Base[0] : new Base[] {this.tooth}; // Coding - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Coding - case 580646965: /*extractionDate*/ return this.extractionDate == null ? new Base[0] : new Base[] {this.extractionDate}; // DateType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 110545608: // tooth - this.tooth = castToCoding(value); // Coding - break; - case -934964668: // reason - this.reason = castToCoding(value); // Coding - break; - case 580646965: // extractionDate - this.extractionDate = castToDate(value); // DateType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("tooth")) - this.tooth = castToCoding(value); // Coding - else if (name.equals("reason")) - this.reason = castToCoding(value); // Coding - else if (name.equals("extractionDate")) - this.extractionDate = castToDate(value); // DateType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 110545608: return getTooth(); // Coding - case -934964668: return getReason(); // Coding - case 580646965: throw new FHIRException("Cannot make property extractionDate as it is not a complex type"); // DateType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("tooth")) { - this.tooth = new Coding(); - return this.tooth; - } - else if (name.equals("reason")) { - this.reason = new Coding(); - return this.reason; - } - else if (name.equals("extractionDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.extractionDate"); - } - else - return super.addChild(name); - } - - public MissingTeethComponent copy() { - MissingTeethComponent dst = new MissingTeethComponent(); - copyValues(dst); - dst.tooth = tooth == null ? null : tooth.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.extractionDate = extractionDate == null ? null : extractionDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareDeep(tooth, o.tooth, true) && compareDeep(reason, o.reason, true) && compareDeep(extractionDate, o.extractionDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MissingTeethComponent)) - return false; - MissingTeethComponent o = (MissingTeethComponent) other; - return compareValues(extractionDate, o.extractionDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (tooth == null || tooth.isEmpty()) && (reason == null || reason.isEmpty()) - && (extractionDate == null || extractionDate.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.missingTeeth"; - - } - - } - - @Block() - public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An integer associated with each note which may be referred to from each service line item. - */ - @Child(name = "number", type = {PositiveIntType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Note Number for this note", formalDefinition="An integer associated with each note which may be referred to from each service line item." ) - protected PositiveIntType number; - - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Note explanitory text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 1768923951L; - - /** - * Constructor - */ - public NotesComponent() { - super(); - } - - /** - * @return {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public PositiveIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new PositiveIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (An integer associated with each note which may be referred to from each service line item.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public NotesComponent setNumberElement(PositiveIntType value) { - this.number = value; - return this; - } - - /** - * @return An integer associated with each note which may be referred to from each service line item. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value An integer associated with each note which may be referred to from each service line item. - */ - public NotesComponent setNumber(int value) { - if (this.number == null) - this.number = new PositiveIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1034364087: // number - this.number = castToPositiveInt(value); // PositiveIntType - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("number")) - this.number = castToPositiveInt(value); // PositiveIntType - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // PositiveIntType - case 3575610: return getType(); // Coding - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("number")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.number"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.text"); - } - else - return super.addChild(name); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.number = number == null ? null : number.copy(); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareDeep(number, o.number, true) && compareDeep(type, o.type, true) && compareDeep(text, o.text, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareValues(number, o.number, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (type == null || type.isEmpty()) - && (text == null || text.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.note"; - - } - - } - - @Block() - public static class BenefitBalanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Dental, Vision, Medical, Pharmacy, Rehab etc. - */ - @Child(name = "category", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefit Category", formalDefinition="Dental, Vision, Medical, Pharmacy, Rehab etc." ) - protected Coding category; - - /** - * Dental: basic, major, ortho; Vision exam, glasses, contacts; etc. - */ - @Child(name = "subCategory", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefit SubCategory", formalDefinition="Dental: basic, major, ortho; Vision exam, glasses, contacts; etc." ) - protected Coding subCategory; - - /** - * Network designation. - */ - @Child(name = "network", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="In or out of network", formalDefinition="Network designation." ) - protected Coding network; - - /** - * Unit designation: individual or family. - */ - @Child(name = "unit", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Individual or family", formalDefinition="Unit designation: individual or family." ) - protected Coding unit; - - /** - * The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'. - */ - @Child(name = "term", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Annual or lifetime", formalDefinition="The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'." ) - protected Coding term; - - /** - * Benefits Used to date. - */ - @Child(name = "financial", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Benefit Summary", formalDefinition="Benefits Used to date." ) - protected List financial; - - private static final long serialVersionUID = 1708176773L; - - /** - * Constructor - */ - public BenefitBalanceComponent() { - super(); - } - - /** - * Constructor - */ - public BenefitBalanceComponent(Coding category) { - super(); - this.category = category; - } - - /** - * @return {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) - */ - public Coding getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitBalanceComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Coding(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Dental, Vision, Medical, Pharmacy, Rehab etc.) - */ - public BenefitBalanceComponent setCategory(Coding value) { - this.category = value; - return this; - } - - /** - * @return {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) - */ - public Coding getSubCategory() { - if (this.subCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitBalanceComponent.subCategory"); - else if (Configuration.doAutoCreate()) - this.subCategory = new Coding(); // cc - return this.subCategory; - } - - public boolean hasSubCategory() { - return this.subCategory != null && !this.subCategory.isEmpty(); - } - - /** - * @param value {@link #subCategory} (Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.) - */ - public BenefitBalanceComponent setSubCategory(Coding value) { - this.subCategory = value; - return this; - } - - /** - * @return {@link #network} (Network designation.) - */ - public Coding getNetwork() { - if (this.network == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitBalanceComponent.network"); - else if (Configuration.doAutoCreate()) - this.network = new Coding(); // cc - return this.network; - } - - public boolean hasNetwork() { - return this.network != null && !this.network.isEmpty(); - } - - /** - * @param value {@link #network} (Network designation.) - */ - public BenefitBalanceComponent setNetwork(Coding value) { - this.network = value; - return this; - } - - /** - * @return {@link #unit} (Unit designation: individual or family.) - */ - public Coding getUnit() { - if (this.unit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitBalanceComponent.unit"); - else if (Configuration.doAutoCreate()) - this.unit = new Coding(); // cc - return this.unit; - } - - public boolean hasUnit() { - return this.unit != null && !this.unit.isEmpty(); - } - - /** - * @param value {@link #unit} (Unit designation: individual or family.) - */ - public BenefitBalanceComponent setUnit(Coding value) { - this.unit = value; - return this; - } - - /** - * @return {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) - */ - public Coding getTerm() { - if (this.term == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitBalanceComponent.term"); - else if (Configuration.doAutoCreate()) - this.term = new Coding(); // cc - return this.term; - } - - public boolean hasTerm() { - return this.term != null && !this.term.isEmpty(); - } - - /** - * @param value {@link #term} (The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.) - */ - public BenefitBalanceComponent setTerm(Coding value) { - this.term = value; - return this; - } - - /** - * @return {@link #financial} (Benefits Used to date.) - */ - public List getFinancial() { - if (this.financial == null) - this.financial = new ArrayList(); - return this.financial; - } - - public boolean hasFinancial() { - if (this.financial == null) - return false; - for (BenefitComponent item : this.financial) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #financial} (Benefits Used to date.) - */ - // syntactic sugar - public BenefitComponent addFinancial() { //3 - BenefitComponent t = new BenefitComponent(); - if (this.financial == null) - this.financial = new ArrayList(); - this.financial.add(t); - return t; - } - - // syntactic sugar - public BenefitBalanceComponent addFinancial(BenefitComponent t) { //3 - if (t == null) - return this; - if (this.financial == null) - this.financial = new ArrayList(); - this.financial.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "Coding", "Dental, Vision, Medical, Pharmacy, Rehab etc.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("subCategory", "Coding", "Dental: basic, major, ortho; Vision exam, glasses, contacts; etc.", 0, java.lang.Integer.MAX_VALUE, subCategory)); - childrenList.add(new Property("network", "Coding", "Network designation.", 0, java.lang.Integer.MAX_VALUE, network)); - childrenList.add(new Property("unit", "Coding", "Unit designation: individual or family.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("term", "Coding", "The term or period of the values such as 'maximum lifetime benefit' or 'maximum annual vistis'.", 0, java.lang.Integer.MAX_VALUE, term)); - childrenList.add(new Property("financial", "", "Benefits Used to date.", 0, java.lang.Integer.MAX_VALUE, financial)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Coding - case 1365024606: /*subCategory*/ return this.subCategory == null ? new Base[0] : new Base[] {this.subCategory}; // Coding - case 1843485230: /*network*/ return this.network == null ? new Base[0] : new Base[] {this.network}; // Coding - case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // Coding - case 3556460: /*term*/ return this.term == null ? new Base[0] : new Base[] {this.term}; // Coding - case 357555337: /*financial*/ return this.financial == null ? new Base[0] : this.financial.toArray(new Base[this.financial.size()]); // BenefitComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = castToCoding(value); // Coding - break; - case 1365024606: // subCategory - this.subCategory = castToCoding(value); // Coding - break; - case 1843485230: // network - this.network = castToCoding(value); // Coding - break; - case 3594628: // unit - this.unit = castToCoding(value); // Coding - break; - case 3556460: // term - this.term = castToCoding(value); // Coding - break; - case 357555337: // financial - this.getFinancial().add((BenefitComponent) value); // BenefitComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = castToCoding(value); // Coding - else if (name.equals("subCategory")) - this.subCategory = castToCoding(value); // Coding - else if (name.equals("network")) - this.network = castToCoding(value); // Coding - else if (name.equals("unit")) - this.unit = castToCoding(value); // Coding - else if (name.equals("term")) - this.term = castToCoding(value); // Coding - else if (name.equals("financial")) - this.getFinancial().add((BenefitComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: return getCategory(); // Coding - case 1365024606: return getSubCategory(); // Coding - case 1843485230: return getNetwork(); // Coding - case 3594628: return getUnit(); // Coding - case 3556460: return getTerm(); // Coding - case 357555337: return addFinancial(); // BenefitComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - this.category = new Coding(); - return this.category; - } - else if (name.equals("subCategory")) { - this.subCategory = new Coding(); - return this.subCategory; - } - else if (name.equals("network")) { - this.network = new Coding(); - return this.network; - } - else if (name.equals("unit")) { - this.unit = new Coding(); - return this.unit; - } - else if (name.equals("term")) { - this.term = new Coding(); - return this.term; - } - else if (name.equals("financial")) { - return addFinancial(); - } - else - return super.addChild(name); - } - - public BenefitBalanceComponent copy() { - BenefitBalanceComponent dst = new BenefitBalanceComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.subCategory = subCategory == null ? null : subCategory.copy(); - dst.network = network == null ? null : network.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.term = term == null ? null : term.copy(); - if (financial != null) { - dst.financial = new ArrayList(); - for (BenefitComponent i : financial) - dst.financial.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BenefitBalanceComponent)) - return false; - BenefitBalanceComponent o = (BenefitBalanceComponent) other; - return compareDeep(category, o.category, true) && compareDeep(subCategory, o.subCategory, true) - && compareDeep(network, o.network, true) && compareDeep(unit, o.unit, true) && compareDeep(term, o.term, true) - && compareDeep(financial, o.financial, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BenefitBalanceComponent)) - return false; - BenefitBalanceComponent o = (BenefitBalanceComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (subCategory == null || subCategory.isEmpty()) - && (network == null || network.isEmpty()) && (unit == null || unit.isEmpty()) && (term == null || term.isEmpty()) - && (financial == null || financial.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.benefitBalance"; - - } - - } - - @Block() - public static class BenefitComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Deductable, visits, benefit amount. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Deductable, visits, benefit amount", formalDefinition="Deductable, visits, benefit amount." ) - protected Coding type; - - /** - * Benefits allowed. - */ - @Child(name = "benefit", type = {UnsignedIntType.class, Money.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefits allowed", formalDefinition="Benefits allowed." ) - protected Type benefit; - - /** - * Benefits used. - */ - @Child(name = "benefitUsed", type = {UnsignedIntType.class, Money.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Benefits used", formalDefinition="Benefits used." ) - protected Type benefitUsed; - - private static final long serialVersionUID = 1742418909L; - - /** - * Constructor - */ - public BenefitComponent() { - super(); - } - - /** - * Constructor - */ - public BenefitComponent(Coding type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Deductable, visits, benefit amount.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create BenefitComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Deductable, visits, benefit amount.) - */ - public BenefitComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #benefit} (Benefits allowed.) - */ - public Type getBenefit() { - return this.benefit; - } - - /** - * @return {@link #benefit} (Benefits allowed.) - */ - public UnsignedIntType getBenefitUnsignedIntType() throws FHIRException { - if (!(this.benefit instanceof UnsignedIntType)) - throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefit.getClass().getName()+" was encountered"); - return (UnsignedIntType) this.benefit; - } - - public boolean hasBenefitUnsignedIntType() { - return this.benefit instanceof UnsignedIntType; - } - - /** - * @return {@link #benefit} (Benefits allowed.) - */ - public Money getBenefitMoney() throws FHIRException { - if (!(this.benefit instanceof Money)) - throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefit.getClass().getName()+" was encountered"); - return (Money) this.benefit; - } - - public boolean hasBenefitMoney() { - return this.benefit instanceof Money; - } - - public boolean hasBenefit() { - return this.benefit != null && !this.benefit.isEmpty(); - } - - /** - * @param value {@link #benefit} (Benefits allowed.) - */ - public BenefitComponent setBenefit(Type value) { - this.benefit = value; - return this; - } - - /** - * @return {@link #benefitUsed} (Benefits used.) - */ - public Type getBenefitUsed() { - return this.benefitUsed; - } - - /** - * @return {@link #benefitUsed} (Benefits used.) - */ - public UnsignedIntType getBenefitUsedUnsignedIntType() throws FHIRException { - if (!(this.benefitUsed instanceof UnsignedIntType)) - throw new FHIRException("Type mismatch: the type UnsignedIntType was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); - return (UnsignedIntType) this.benefitUsed; - } - - public boolean hasBenefitUsedUnsignedIntType() { - return this.benefitUsed instanceof UnsignedIntType; - } - - /** - * @return {@link #benefitUsed} (Benefits used.) - */ - public Money getBenefitUsedMoney() throws FHIRException { - if (!(this.benefitUsed instanceof Money)) - throw new FHIRException("Type mismatch: the type Money was expected, but "+this.benefitUsed.getClass().getName()+" was encountered"); - return (Money) this.benefitUsed; - } - - public boolean hasBenefitUsedMoney() { - return this.benefitUsed instanceof Money; - } - - public boolean hasBenefitUsed() { - return this.benefitUsed != null && !this.benefitUsed.isEmpty(); - } - - /** - * @param value {@link #benefitUsed} (Benefits used.) - */ - public BenefitComponent setBenefitUsed(Type value) { - this.benefitUsed = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Deductable, visits, benefit amount.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("benefit[x]", "unsignedInt|Money", "Benefits allowed.", 0, java.lang.Integer.MAX_VALUE, benefit)); - childrenList.add(new Property("benefitUsed[x]", "unsignedInt|Money", "Benefits used.", 0, java.lang.Integer.MAX_VALUE, benefitUsed)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -222710633: /*benefit*/ return this.benefit == null ? new Base[0] : new Base[] {this.benefit}; // Type - case -549981964: /*benefitUsed*/ return this.benefitUsed == null ? new Base[0] : new Base[] {this.benefitUsed}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -222710633: // benefit - this.benefit = (Type) value; // Type - break; - case -549981964: // benefitUsed - this.benefitUsed = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("benefit[x]")) - this.benefit = (Type) value; // Type - else if (name.equals("benefitUsed[x]")) - this.benefitUsed = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 952095881: return getBenefit(); // Type - case 787635980: return getBenefitUsed(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("benefitUnsignedInt")) { - this.benefit = new UnsignedIntType(); - return this.benefit; - } - else if (name.equals("benefitMoney")) { - this.benefit = new Money(); - return this.benefit; - } - else if (name.equals("benefitUsedUnsignedInt")) { - this.benefitUsed = new UnsignedIntType(); - return this.benefitUsed; - } - else if (name.equals("benefitUsedMoney")) { - this.benefitUsed = new Money(); - return this.benefitUsed; - } - else - return super.addChild(name); - } - - public BenefitComponent copy() { - BenefitComponent dst = new BenefitComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.benefit = benefit == null ? null : benefit.copy(); - dst.benefitUsed = benefitUsed == null ? null : benefitUsed.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof BenefitComponent)) - return false; - BenefitComponent o = (BenefitComponent) other; - return compareDeep(type, o.type, true) && compareDeep(benefit, o.benefit, true) && compareDeep(benefitUsed, o.benefitUsed, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof BenefitComponent)) - return false; - BenefitComponent o = (BenefitComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (benefit == null || benefit.isEmpty()) - && (benefitUsed == null || benefitUsed.isEmpty()); - } - - public String fhirType() { - return "ExplanationOfBenefit.benefitBalance.financial"; - - } - - } - - /** - * The Response Business Identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response Business Identifier." ) - protected List identifier; - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name = "claim", type = {Identifier.class, Claim.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected Type claim; - - /** - * The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number. - */ - @Child(name = "claimResponse", type = {Identifier.class, ClaimResponse.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim response reference", formalDefinition="The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number." ) - protected Type claimResponse; - - /** - * A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType. - */ - @Child(name = "subType", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Finer grained claim type information", formalDefinition="A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType." ) - protected List subType; - - /** - * The version of the specification on which this instance relies. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Current specification followed", formalDefinition="The version of the specification on which this instance relies." ) - protected Coding ruleset; - - /** - * The version of the specification from which the original instance was created. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original specification followed", formalDefinition="The version of the specification from which the original instance was created." ) - protected Coding originalRuleset; - - /** - * The date when the EOB was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the EOB was created." ) - protected DateTimeType created; - - /** - * The billable period for which charges are being submitted. - */ - @Child(name = "billablePeriod", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period for charge submission", formalDefinition="The billable period for which charges are being submitted." ) - protected Period billablePeriod; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The provider which is responsible for the claim. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible provider for the claim", formalDefinition="The provider which is responsible for the claim." ) - protected Type provider; - - /** - * The provider which is responsible for the claim. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization for the claim", formalDefinition="The provider which is responsible for the claim." ) - protected Type organization; - - /** - * Facility where the services were provided. - */ - @Child(name = "facility", type = {Identifier.class, Location.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Servicing Facility", formalDefinition="Facility where the services were provided." ) - protected Type facility; - - /** - * Other claims which are related to this claim such as prior claim versions or for related services. - */ - @Child(name = "related", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Related Claims which may be revelant to processing this claimn", formalDefinition="Other claims which are related to this claim such as prior claim versions or for related services." ) - protected List related; - - /** - * Prescription to support the dispensing of Pharmacy or Vision products. - */ - @Child(name = "prescription", type = {Identifier.class, MedicationOrder.class, VisionPrescription.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Prescription", formalDefinition="Prescription to support the dispensing of Pharmacy or Vision products." ) - protected Type prescription; - - /** - * Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products. - */ - @Child(name = "originalPrescription", type = {Identifier.class, MedicationOrder.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original Prescription", formalDefinition="Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products." ) - protected Type originalPrescription; - - /** - * The party to be reimbursed for the services. - */ - @Child(name = "payee", type = {}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payee", formalDefinition="The party to be reimbursed for the services." ) - protected PayeeComponent payee; - - /** - * The referral resource which lists the date, practitioner, reason and other supporting information. - */ - @Child(name = "referral", type = {Identifier.class, ReferralRequest.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Treatment Referral", formalDefinition="The referral resource which lists the date, practitioner, reason and other supporting information." ) - protected Type referral; - - /** - * **Insert definition of Occurrence codes. - */ - @Child(name = "occurrenceCode", type = {Coding.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Occurrence Codes", formalDefinition="**Insert definition of Occurrence codes." ) - protected List occurrenceCode; - - /** - * **Insert definition of Occurrence Span codes. - */ - @Child(name = "occurenceSpanCode", type = {Coding.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Occurrence Span Codes", formalDefinition="**Insert definition of Occurrence Span codes." ) - protected List occurenceSpanCode; - - /** - * **Insert definition of Value codes. - */ - @Child(name = "valueCode", type = {Coding.class}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Value Codes", formalDefinition="**Insert definition of Value codes." ) - protected List valueCode; - - /** - * Ordered list of patient diagnosis for which care is sought. - */ - @Child(name = "diagnosis", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Diagnosis", formalDefinition="Ordered list of patient diagnosis for which care is sought." ) - protected List diagnosis; - - /** - * Ordered list of patient procedures performed to support the adjudication. - */ - @Child(name = "procedure", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Procedures performed", formalDefinition="Ordered list of patient procedures performed to support the adjudication." ) - protected List procedure; - - /** - * List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication. - */ - @Child(name = "specialCondition", type = {Coding.class}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="List of special Conditions", formalDefinition="List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication." ) - protected List specialCondition; - - /** - * Patient Resource. - */ - @Child(name = "patient", type = {Identifier.class, Patient.class}, order=23, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The subject of the Products and Services", formalDefinition="Patient Resource." ) - protected Type patient; - - /** - * Precedence (primary, secondary, etc.). - */ - @Child(name = "precedence", type = {PositiveIntType.class}, order=24, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Precedence (primary, secondary, etc.)", formalDefinition="Precedence (primary, secondary, etc.)." ) - protected PositiveIntType precedence; - - /** - * Financial instrument by which payment information for health care. - */ - @Child(name = "coverage", type = {}, order=25, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." ) - protected CoverageComponent coverage; - - /** - * Date of an accident which these services are addressing. - */ - @Child(name = "accidentDate", type = {DateType.class}, order=26, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the accident occurred", formalDefinition="Date of an accident which these services are addressing." ) - protected DateType accidentDate; - - /** - * Type of accident: work, auto, etc. - */ - @Child(name = "accidentType", type = {Coding.class}, order=27, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The nature of the accident", formalDefinition="Type of accident: work, auto, etc." ) - protected Coding accidentType; - - /** - * Accident Place. - */ - @Child(name = "accidentLocation", type = {Address.class, Location.class}, order=28, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Accident Place", formalDefinition="Accident Place." ) - protected Type accidentLocation; - - /** - * A list of intervention and exception codes which may influence the adjudication of the claim. - */ - @Child(name = "interventionException", type = {Coding.class}, order=29, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Intervention and exception code (Pharma)", formalDefinition="A list of intervention and exception codes which may influence the adjudication of the claim." ) - protected List interventionException; - - /** - * Period, start and last dates of aspects of the Condition or related services. - */ - @Child(name = "onset", type = {}, order=30, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Condition related Onset related dates and codes", formalDefinition="Period, start and last dates of aspects of the Condition or related services." ) - protected List onset; - - /** - * The start and optional end dates of when the patient was precluded from working due to the treatable condition(s). - */ - @Child(name = "employmentImpacted", type = {Period.class}, order=31, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period unable to work", formalDefinition="The start and optional end dates of when the patient was precluded from working due to the treatable condition(s)." ) - protected Period employmentImpacted; - - /** - * The start and optional end dates of when the patient was confined to a treatment center. - */ - @Child(name = "hospitalization", type = {Period.class}, order=32, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period in hospital", formalDefinition="The start and optional end dates of when the patient was confined to a treatment center." ) - protected Period hospitalization; - - /** - * First tier of goods and services. - */ - @Child(name = "item", type = {}, order=33, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Goods and Services", formalDefinition="First tier of goods and services." ) - protected List item; - - /** - * The first tier service adjudications for payor added services. - */ - @Child(name = "addItem", type = {}, order=34, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Insurer added line items", formalDefinition="The first tier service adjudications for payor added services." ) - protected List addItem; - - /** - * A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. - */ - @Child(name = "missingTeeth", type = {}, order=35, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Only if type = oral", formalDefinition="A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons." ) - protected List missingTeeth; - - /** - * The total cost of the services reported. - */ - @Child(name = "totalCost", type = {Money.class}, order=36, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total Cost of service from the Claim", formalDefinition="The total cost of the services reported." ) - protected Money totalCost; - - /** - * The amount of deductable applied which was not allocated to any particular service line. - */ - @Child(name = "unallocDeductable", type = {Money.class}, order=37, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unallocated deductable", formalDefinition="The amount of deductable applied which was not allocated to any particular service line." ) - protected Money unallocDeductable; - - /** - * Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable). - */ - @Child(name = "totalBenefit", type = {Money.class}, order=38, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total benefit payable for the Claim", formalDefinition="Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable)." ) - protected Money totalBenefit; - - /** - * Adjustment to the payment of this transaction which is not related to adjudication of this transaction. - */ - @Child(name = "paymentAdjustment", type = {Money.class}, order=39, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment adjustment for non-Claim issues", formalDefinition="Adjustment to the payment of this transaction which is not related to adjudication of this transaction." ) - protected Money paymentAdjustment; - - /** - * Reason for the payment adjustment. - */ - @Child(name = "paymentAdjustmentReason", type = {Coding.class}, order=40, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason for Payment adjustment", formalDefinition="Reason for the payment adjustment." ) - protected Coding paymentAdjustmentReason; - - /** - * Estimated payment data. - */ - @Child(name = "paymentDate", type = {DateType.class}, order=41, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Expected data of Payment", formalDefinition="Estimated payment data." ) - protected DateType paymentDate; - - /** - * Payable less any payment adjustment. - */ - @Child(name = "paymentAmount", type = {Money.class}, order=42, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment amount", formalDefinition="Payable less any payment adjustment." ) - protected Money paymentAmount; - - /** - * Payment identifer. - */ - @Child(name = "paymentRef", type = {Identifier.class}, order=43, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment identifier", formalDefinition="Payment identifer." ) - protected Identifier paymentRef; - - /** - * Status of funds reservation (For provider, for Patient, None). - */ - @Child(name = "reserved", type = {Coding.class}, order=44, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Funds reserved status", formalDefinition="Status of funds reservation (For provider, for Patient, None)." ) - protected Coding reserved; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=45, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Note text. - */ - @Child(name = "note", type = {}, order=46, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Processing notes", formalDefinition="Note text." ) - protected List note; - - /** - * Balance by Benefit Category. - */ - @Child(name = "benefitBalance", type = {}, order=47, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Balance by Benefit Category", formalDefinition="Balance by Benefit Category." ) - protected List benefitBalance; - - private static final long serialVersionUID = 1781852561L; - - /** - * Constructor - */ - public ExplanationOfBenefit() { - super(); - } - - /** - * Constructor - */ - public ExplanationOfBenefit(Type patient, CoverageComponent coverage) { - super(); - this.patient = patient; - this.coverage = coverage; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response Business Identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Type getClaim() { - return this.claim; - } - - /** - * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Identifier getClaimIdentifier() throws FHIRException { - if (!(this.claim instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claim.getClass().getName()+" was encountered"); - return (Identifier) this.claim; - } - - public boolean hasClaimIdentifier() { - return this.claim instanceof Identifier; - } - - /** - * @return {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Reference getClaimReference() throws FHIRException { - if (!(this.claim instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claim.getClass().getName()+" was encountered"); - return (Reference) this.claim; - } - - public boolean hasClaimReference() { - return this.claim instanceof Reference; - } - - public boolean hasClaim() { - return this.claim != null && !this.claim.isEmpty(); - } - - /** - * @param value {@link #claim} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ExplanationOfBenefit setClaim(Type value) { - this.claim = value; - return this; - } - - /** - * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Type getClaimResponse() { - return this.claimResponse; - } - - /** - * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Identifier getClaimResponseIdentifier() throws FHIRException { - if (!(this.claimResponse instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.claimResponse.getClass().getName()+" was encountered"); - return (Identifier) this.claimResponse; - } - - public boolean hasClaimResponseIdentifier() { - return this.claimResponse instanceof Identifier; - } - - /** - * @return {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public Reference getClaimResponseReference() throws FHIRException { - if (!(this.claimResponse instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.claimResponse.getClass().getName()+" was encountered"); - return (Reference) this.claimResponse; - } - - public boolean hasClaimResponseReference() { - return this.claimResponse instanceof Reference; - } - - public boolean hasClaimResponse() { - return this.claimResponse != null && !this.claimResponse.isEmpty(); - } - - /** - * @param value {@link #claimResponse} (The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.) - */ - public ExplanationOfBenefit setClaimResponse(Type value) { - this.claimResponse = value; - return this; - } - - /** - * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) - */ - public List getSubType() { - if (this.subType == null) - this.subType = new ArrayList(); - return this.subType; - } - - public boolean hasSubType() { - if (this.subType == null) - return false; - for (Coding item : this.subType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subType} (A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.) - */ - // syntactic sugar - public Coding addSubType() { //3 - Coding t = new Coding(); - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addSubType(Coding t) { //3 - if (t == null) - return this; - if (this.subType == null) - this.subType = new ArrayList(); - this.subType.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the specification on which this instance relies.) - */ - public ExplanationOfBenefit setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The version of the specification from which the original instance was created.) - */ - public ExplanationOfBenefit setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the EOB was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the EOB was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ExplanationOfBenefit setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the EOB was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the EOB was created. - */ - public ExplanationOfBenefit setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #billablePeriod} (The billable period for which charges are being submitted.) - */ - public Period getBillablePeriod() { - if (this.billablePeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.billablePeriod"); - else if (Configuration.doAutoCreate()) - this.billablePeriod = new Period(); // cc - return this.billablePeriod; - } - - public boolean hasBillablePeriod() { - return this.billablePeriod != null && !this.billablePeriod.isEmpty(); - } - - /** - * @param value {@link #billablePeriod} (The billable period for which charges are being submitted.) - */ - public ExplanationOfBenefit setBillablePeriod(Period value) { - this.billablePeriod = value; - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ExplanationOfBenefit setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public ExplanationOfBenefit setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #provider} (The provider which is responsible for the claim.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The provider which is responsible for the claim.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The provider which is responsible for the claim.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The provider which is responsible for the claim.) - */ - public ExplanationOfBenefit setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #organization} (The provider which is responsible for the claim.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The provider which is responsible for the claim.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The provider which is responsible for the claim.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The provider which is responsible for the claim.) - */ - public ExplanationOfBenefit setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Type getFacility() { - return this.facility; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Identifier getFacilityIdentifier() throws FHIRException { - if (!(this.facility instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.facility.getClass().getName()+" was encountered"); - return (Identifier) this.facility; - } - - public boolean hasFacilityIdentifier() { - return this.facility instanceof Identifier; - } - - /** - * @return {@link #facility} (Facility where the services were provided.) - */ - public Reference getFacilityReference() throws FHIRException { - if (!(this.facility instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.facility.getClass().getName()+" was encountered"); - return (Reference) this.facility; - } - - public boolean hasFacilityReference() { - return this.facility instanceof Reference; - } - - public boolean hasFacility() { - return this.facility != null && !this.facility.isEmpty(); - } - - /** - * @param value {@link #facility} (Facility where the services were provided.) - */ - public ExplanationOfBenefit setFacility(Type value) { - this.facility = value; - return this; - } - - /** - * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (RelatedClaimsComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (Other claims which are related to this claim such as prior claim versions or for related services.) - */ - // syntactic sugar - public RelatedClaimsComponent addRelated() { //3 - RelatedClaimsComponent t = new RelatedClaimsComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addRelated(RelatedClaimsComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Type getPrescription() { - return this.prescription; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Identifier getPrescriptionIdentifier() throws FHIRException { - if (!(this.prescription instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.prescription.getClass().getName()+" was encountered"); - return (Identifier) this.prescription; - } - - public boolean hasPrescriptionIdentifier() { - return this.prescription instanceof Identifier; - } - - /** - * @return {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public Reference getPrescriptionReference() throws FHIRException { - if (!(this.prescription instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.prescription.getClass().getName()+" was encountered"); - return (Reference) this.prescription; - } - - public boolean hasPrescriptionReference() { - return this.prescription instanceof Reference; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (Prescription to support the dispensing of Pharmacy or Vision products.) - */ - public ExplanationOfBenefit setPrescription(Type value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Type getOriginalPrescription() { - return this.originalPrescription; - } - - /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Identifier getOriginalPrescriptionIdentifier() throws FHIRException { - if (!(this.originalPrescription instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); - return (Identifier) this.originalPrescription; - } - - public boolean hasOriginalPrescriptionIdentifier() { - return this.originalPrescription instanceof Identifier; - } - - /** - * @return {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public Reference getOriginalPrescriptionReference() throws FHIRException { - if (!(this.originalPrescription instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.originalPrescription.getClass().getName()+" was encountered"); - return (Reference) this.originalPrescription; - } - - public boolean hasOriginalPrescriptionReference() { - return this.originalPrescription instanceof Reference; - } - - public boolean hasOriginalPrescription() { - return this.originalPrescription != null && !this.originalPrescription.isEmpty(); - } - - /** - * @param value {@link #originalPrescription} (Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.) - */ - public ExplanationOfBenefit setOriginalPrescription(Type value) { - this.originalPrescription = value; - return this; - } - - /** - * @return {@link #payee} (The party to be reimbursed for the services.) - */ - public PayeeComponent getPayee() { - if (this.payee == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.payee"); - else if (Configuration.doAutoCreate()) - this.payee = new PayeeComponent(); // cc - return this.payee; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (The party to be reimbursed for the services.) - */ - public ExplanationOfBenefit setPayee(PayeeComponent value) { - this.payee = value; - return this; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Type getReferral() { - return this.referral; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Identifier getReferralIdentifier() throws FHIRException { - if (!(this.referral instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.referral.getClass().getName()+" was encountered"); - return (Identifier) this.referral; - } - - public boolean hasReferralIdentifier() { - return this.referral instanceof Identifier; - } - - /** - * @return {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public Reference getReferralReference() throws FHIRException { - if (!(this.referral instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.referral.getClass().getName()+" was encountered"); - return (Reference) this.referral; - } - - public boolean hasReferralReference() { - return this.referral instanceof Reference; - } - - public boolean hasReferral() { - return this.referral != null && !this.referral.isEmpty(); - } - - /** - * @param value {@link #referral} (The referral resource which lists the date, practitioner, reason and other supporting information.) - */ - public ExplanationOfBenefit setReferral(Type value) { - this.referral = value; - return this; - } - - /** - * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) - */ - public List getOccurrenceCode() { - if (this.occurrenceCode == null) - this.occurrenceCode = new ArrayList(); - return this.occurrenceCode; - } - - public boolean hasOccurrenceCode() { - if (this.occurrenceCode == null) - return false; - for (Coding item : this.occurrenceCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #occurrenceCode} (**Insert definition of Occurrence codes.) - */ - // syntactic sugar - public Coding addOccurrenceCode() { //3 - Coding t = new Coding(); - if (this.occurrenceCode == null) - this.occurrenceCode = new ArrayList(); - this.occurrenceCode.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addOccurrenceCode(Coding t) { //3 - if (t == null) - return this; - if (this.occurrenceCode == null) - this.occurrenceCode = new ArrayList(); - this.occurrenceCode.add(t); - return this; - } - - /** - * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) - */ - public List getOccurenceSpanCode() { - if (this.occurenceSpanCode == null) - this.occurenceSpanCode = new ArrayList(); - return this.occurenceSpanCode; - } - - public boolean hasOccurenceSpanCode() { - if (this.occurenceSpanCode == null) - return false; - for (Coding item : this.occurenceSpanCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #occurenceSpanCode} (**Insert definition of Occurrence Span codes.) - */ - // syntactic sugar - public Coding addOccurenceSpanCode() { //3 - Coding t = new Coding(); - if (this.occurenceSpanCode == null) - this.occurenceSpanCode = new ArrayList(); - this.occurenceSpanCode.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addOccurenceSpanCode(Coding t) { //3 - if (t == null) - return this; - if (this.occurenceSpanCode == null) - this.occurenceSpanCode = new ArrayList(); - this.occurenceSpanCode.add(t); - return this; - } - - /** - * @return {@link #valueCode} (**Insert definition of Value codes.) - */ - public List getValueCode() { - if (this.valueCode == null) - this.valueCode = new ArrayList(); - return this.valueCode; - } - - public boolean hasValueCode() { - if (this.valueCode == null) - return false; - for (Coding item : this.valueCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueCode} (**Insert definition of Value codes.) - */ - // syntactic sugar - public Coding addValueCode() { //3 - Coding t = new Coding(); - if (this.valueCode == null) - this.valueCode = new ArrayList(); - this.valueCode.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addValueCode(Coding t) { //3 - if (t == null) - return this; - if (this.valueCode == null) - this.valueCode = new ArrayList(); - this.valueCode.add(t); - return this; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - public List getDiagnosis() { - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - return this.diagnosis; - } - - public boolean hasDiagnosis() { - if (this.diagnosis == null) - return false; - for (DiagnosisComponent item : this.diagnosis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #diagnosis} (Ordered list of patient diagnosis for which care is sought.) - */ - // syntactic sugar - public DiagnosisComponent addDiagnosis() { //3 - DiagnosisComponent t = new DiagnosisComponent(); - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addDiagnosis(DiagnosisComponent t) { //3 - if (t == null) - return this; - if (this.diagnosis == null) - this.diagnosis = new ArrayList(); - this.diagnosis.add(t); - return this; - } - - /** - * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) - */ - public List getProcedure() { - if (this.procedure == null) - this.procedure = new ArrayList(); - return this.procedure; - } - - public boolean hasProcedure() { - if (this.procedure == null) - return false; - for (ProcedureComponent item : this.procedure) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #procedure} (Ordered list of patient procedures performed to support the adjudication.) - */ - // syntactic sugar - public ProcedureComponent addProcedure() { //3 - ProcedureComponent t = new ProcedureComponent(); - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addProcedure(ProcedureComponent t) { //3 - if (t == null) - return this; - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return this; - } - - /** - * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) - */ - public List getSpecialCondition() { - if (this.specialCondition == null) - this.specialCondition = new ArrayList(); - return this.specialCondition; - } - - public boolean hasSpecialCondition() { - if (this.specialCondition == null) - return false; - for (Coding item : this.specialCondition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialCondition} (List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.) - */ - // syntactic sugar - public Coding addSpecialCondition() { //3 - Coding t = new Coding(); - if (this.specialCondition == null) - this.specialCondition = new ArrayList(); - this.specialCondition.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addSpecialCondition(Coding t) { //3 - if (t == null) - return this; - if (this.specialCondition == null) - this.specialCondition = new ArrayList(); - this.specialCondition.add(t); - return this; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Type getPatient() { - return this.patient; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Identifier getPatientIdentifier() throws FHIRException { - if (!(this.patient instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.patient.getClass().getName()+" was encountered"); - return (Identifier) this.patient; - } - - public boolean hasPatientIdentifier() { - return this.patient instanceof Identifier; - } - - /** - * @return {@link #patient} (Patient Resource.) - */ - public Reference getPatientReference() throws FHIRException { - if (!(this.patient instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.patient.getClass().getName()+" was encountered"); - return (Reference) this.patient; - } - - public boolean hasPatientReference() { - return this.patient instanceof Reference; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Patient Resource.) - */ - public ExplanationOfBenefit setPatient(Type value) { - this.patient = value; - return this; - } - - /** - * @return {@link #precedence} (Precedence (primary, secondary, etc.).). This is the underlying object with id, value and extensions. The accessor "getPrecedence" gives direct access to the value - */ - public PositiveIntType getPrecedenceElement() { - if (this.precedence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.precedence"); - else if (Configuration.doAutoCreate()) - this.precedence = new PositiveIntType(); // bb - return this.precedence; - } - - public boolean hasPrecedenceElement() { - return this.precedence != null && !this.precedence.isEmpty(); - } - - public boolean hasPrecedence() { - return this.precedence != null && !this.precedence.isEmpty(); - } - - /** - * @param value {@link #precedence} (Precedence (primary, secondary, etc.).). This is the underlying object with id, value and extensions. The accessor "getPrecedence" gives direct access to the value - */ - public ExplanationOfBenefit setPrecedenceElement(PositiveIntType value) { - this.precedence = value; - return this; - } - - /** - * @return Precedence (primary, secondary, etc.). - */ - public int getPrecedence() { - return this.precedence == null || this.precedence.isEmpty() ? 0 : this.precedence.getValue(); - } - - /** - * @param value Precedence (primary, secondary, etc.). - */ - public ExplanationOfBenefit setPrecedence(int value) { - if (this.precedence == null) - this.precedence = new PositiveIntType(); - this.precedence.setValue(value); - return this; - } - - /** - * @return {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public CoverageComponent getCoverage() { - if (this.coverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.coverage"); - else if (Configuration.doAutoCreate()) - this.coverage = new CoverageComponent(); // cc - return this.coverage; - } - - public boolean hasCoverage() { - return this.coverage != null && !this.coverage.isEmpty(); - } - - /** - * @param value {@link #coverage} (Financial instrument by which payment information for health care.) - */ - public ExplanationOfBenefit setCoverage(CoverageComponent value) { - this.coverage = value; - return this; - } - - /** - * @return {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value - */ - public DateType getAccidentDateElement() { - if (this.accidentDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.accidentDate"); - else if (Configuration.doAutoCreate()) - this.accidentDate = new DateType(); // bb - return this.accidentDate; - } - - public boolean hasAccidentDateElement() { - return this.accidentDate != null && !this.accidentDate.isEmpty(); - } - - public boolean hasAccidentDate() { - return this.accidentDate != null && !this.accidentDate.isEmpty(); - } - - /** - * @param value {@link #accidentDate} (Date of an accident which these services are addressing.). This is the underlying object with id, value and extensions. The accessor "getAccidentDate" gives direct access to the value - */ - public ExplanationOfBenefit setAccidentDateElement(DateType value) { - this.accidentDate = value; - return this; - } - - /** - * @return Date of an accident which these services are addressing. - */ - public Date getAccidentDate() { - return this.accidentDate == null ? null : this.accidentDate.getValue(); - } - - /** - * @param value Date of an accident which these services are addressing. - */ - public ExplanationOfBenefit setAccidentDate(Date value) { - if (value == null) - this.accidentDate = null; - else { - if (this.accidentDate == null) - this.accidentDate = new DateType(); - this.accidentDate.setValue(value); - } - return this; - } - - /** - * @return {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public Coding getAccidentType() { - if (this.accidentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.accidentType"); - else if (Configuration.doAutoCreate()) - this.accidentType = new Coding(); // cc - return this.accidentType; - } - - public boolean hasAccidentType() { - return this.accidentType != null && !this.accidentType.isEmpty(); - } - - /** - * @param value {@link #accidentType} (Type of accident: work, auto, etc.) - */ - public ExplanationOfBenefit setAccidentType(Coding value) { - this.accidentType = value; - return this; - } - - /** - * @return {@link #accidentLocation} (Accident Place.) - */ - public Type getAccidentLocation() { - return this.accidentLocation; - } - - /** - * @return {@link #accidentLocation} (Accident Place.) - */ - public Address getAccidentLocationAddress() throws FHIRException { - if (!(this.accidentLocation instanceof Address)) - throw new FHIRException("Type mismatch: the type Address was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); - return (Address) this.accidentLocation; - } - - public boolean hasAccidentLocationAddress() { - return this.accidentLocation instanceof Address; - } - - /** - * @return {@link #accidentLocation} (Accident Place.) - */ - public Reference getAccidentLocationReference() throws FHIRException { - if (!(this.accidentLocation instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.accidentLocation.getClass().getName()+" was encountered"); - return (Reference) this.accidentLocation; - } - - public boolean hasAccidentLocationReference() { - return this.accidentLocation instanceof Reference; - } - - public boolean hasAccidentLocation() { - return this.accidentLocation != null && !this.accidentLocation.isEmpty(); - } - - /** - * @param value {@link #accidentLocation} (Accident Place.) - */ - public ExplanationOfBenefit setAccidentLocation(Type value) { - this.accidentLocation = value; - return this; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - public List getInterventionException() { - if (this.interventionException == null) - this.interventionException = new ArrayList(); - return this.interventionException; - } - - public boolean hasInterventionException() { - if (this.interventionException == null) - return false; - for (Coding item : this.interventionException) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #interventionException} (A list of intervention and exception codes which may influence the adjudication of the claim.) - */ - // syntactic sugar - public Coding addInterventionException() { //3 - Coding t = new Coding(); - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addInterventionException(Coding t) { //3 - if (t == null) - return this; - if (this.interventionException == null) - this.interventionException = new ArrayList(); - this.interventionException.add(t); - return this; - } - - /** - * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) - */ - public List getOnset() { - if (this.onset == null) - this.onset = new ArrayList(); - return this.onset; - } - - public boolean hasOnset() { - if (this.onset == null) - return false; - for (OnsetComponent item : this.onset) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #onset} (Period, start and last dates of aspects of the Condition or related services.) - */ - // syntactic sugar - public OnsetComponent addOnset() { //3 - OnsetComponent t = new OnsetComponent(); - if (this.onset == null) - this.onset = new ArrayList(); - this.onset.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addOnset(OnsetComponent t) { //3 - if (t == null) - return this; - if (this.onset == null) - this.onset = new ArrayList(); - this.onset.add(t); - return this; - } - - /** - * @return {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) - */ - public Period getEmploymentImpacted() { - if (this.employmentImpacted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.employmentImpacted"); - else if (Configuration.doAutoCreate()) - this.employmentImpacted = new Period(); // cc - return this.employmentImpacted; - } - - public boolean hasEmploymentImpacted() { - return this.employmentImpacted != null && !this.employmentImpacted.isEmpty(); - } - - /** - * @param value {@link #employmentImpacted} (The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).) - */ - public ExplanationOfBenefit setEmploymentImpacted(Period value) { - this.employmentImpacted = value; - return this; - } - - /** - * @return {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) - */ - public Period getHospitalization() { - if (this.hospitalization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.hospitalization"); - else if (Configuration.doAutoCreate()) - this.hospitalization = new Period(); // cc - return this.hospitalization; - } - - public boolean hasHospitalization() { - return this.hospitalization != null && !this.hospitalization.isEmpty(); - } - - /** - * @param value {@link #hospitalization} (The start and optional end dates of when the patient was confined to a treatment center.) - */ - public ExplanationOfBenefit setHospitalization(Period value) { - this.hospitalization = value; - return this; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (First tier of goods and services.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #addItem} (The first tier service adjudications for payor added services.) - */ - public List getAddItem() { - if (this.addItem == null) - this.addItem = new ArrayList(); - return this.addItem; - } - - public boolean hasAddItem() { - if (this.addItem == null) - return false; - for (AddedItemComponent item : this.addItem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #addItem} (The first tier service adjudications for payor added services.) - */ - // syntactic sugar - public AddedItemComponent addAddItem() { //3 - AddedItemComponent t = new AddedItemComponent(); - if (this.addItem == null) - this.addItem = new ArrayList(); - this.addItem.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addAddItem(AddedItemComponent t) { //3 - if (t == null) - return this; - if (this.addItem == null) - this.addItem = new ArrayList(); - this.addItem.add(t); - return this; - } - - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - public List getMissingTeeth() { - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - return this.missingTeeth; - } - - public boolean hasMissingTeeth() { - if (this.missingTeeth == null) - return false; - for (MissingTeethComponent item : this.missingTeeth) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #missingTeeth} (A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.) - */ - // syntactic sugar - public MissingTeethComponent addMissingTeeth() { //3 - MissingTeethComponent t = new MissingTeethComponent(); - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addMissingTeeth(MissingTeethComponent t) { //3 - if (t == null) - return this; - if (this.missingTeeth == null) - this.missingTeeth = new ArrayList(); - this.missingTeeth.add(t); - return this; - } - - /** - * @return {@link #totalCost} (The total cost of the services reported.) - */ - public Money getTotalCost() { - if (this.totalCost == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.totalCost"); - else if (Configuration.doAutoCreate()) - this.totalCost = new Money(); // cc - return this.totalCost; - } - - public boolean hasTotalCost() { - return this.totalCost != null && !this.totalCost.isEmpty(); - } - - /** - * @param value {@link #totalCost} (The total cost of the services reported.) - */ - public ExplanationOfBenefit setTotalCost(Money value) { - this.totalCost = value; - return this; - } - - /** - * @return {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) - */ - public Money getUnallocDeductable() { - if (this.unallocDeductable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.unallocDeductable"); - else if (Configuration.doAutoCreate()) - this.unallocDeductable = new Money(); // cc - return this.unallocDeductable; - } - - public boolean hasUnallocDeductable() { - return this.unallocDeductable != null && !this.unallocDeductable.isEmpty(); - } - - /** - * @param value {@link #unallocDeductable} (The amount of deductable applied which was not allocated to any particular service line.) - */ - public ExplanationOfBenefit setUnallocDeductable(Money value) { - this.unallocDeductable = value; - return this; - } - - /** - * @return {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) - */ - public Money getTotalBenefit() { - if (this.totalBenefit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.totalBenefit"); - else if (Configuration.doAutoCreate()) - this.totalBenefit = new Money(); // cc - return this.totalBenefit; - } - - public boolean hasTotalBenefit() { - return this.totalBenefit != null && !this.totalBenefit.isEmpty(); - } - - /** - * @param value {@link #totalBenefit} (Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).) - */ - public ExplanationOfBenefit setTotalBenefit(Money value) { - this.totalBenefit = value; - return this; - } - - /** - * @return {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public Money getPaymentAdjustment() { - if (this.paymentAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentAdjustment"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustment = new Money(); // cc - return this.paymentAdjustment; - } - - public boolean hasPaymentAdjustment() { - return this.paymentAdjustment != null && !this.paymentAdjustment.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustment} (Adjustment to the payment of this transaction which is not related to adjudication of this transaction.) - */ - public ExplanationOfBenefit setPaymentAdjustment(Money value) { - this.paymentAdjustment = value; - return this; - } - - /** - * @return {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public Coding getPaymentAdjustmentReason() { - if (this.paymentAdjustmentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentAdjustmentReason"); - else if (Configuration.doAutoCreate()) - this.paymentAdjustmentReason = new Coding(); // cc - return this.paymentAdjustmentReason; - } - - public boolean hasPaymentAdjustmentReason() { - return this.paymentAdjustmentReason != null && !this.paymentAdjustmentReason.isEmpty(); - } - - /** - * @param value {@link #paymentAdjustmentReason} (Reason for the payment adjustment.) - */ - public ExplanationOfBenefit setPaymentAdjustmentReason(Coding value) { - this.paymentAdjustmentReason = value; - return this; - } - - /** - * @return {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public DateType getPaymentDateElement() { - if (this.paymentDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentDate"); - else if (Configuration.doAutoCreate()) - this.paymentDate = new DateType(); // bb - return this.paymentDate; - } - - public boolean hasPaymentDateElement() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - public boolean hasPaymentDate() { - return this.paymentDate != null && !this.paymentDate.isEmpty(); - } - - /** - * @param value {@link #paymentDate} (Estimated payment data.). This is the underlying object with id, value and extensions. The accessor "getPaymentDate" gives direct access to the value - */ - public ExplanationOfBenefit setPaymentDateElement(DateType value) { - this.paymentDate = value; - return this; - } - - /** - * @return Estimated payment data. - */ - public Date getPaymentDate() { - return this.paymentDate == null ? null : this.paymentDate.getValue(); - } - - /** - * @param value Estimated payment data. - */ - public ExplanationOfBenefit setPaymentDate(Date value) { - if (value == null) - this.paymentDate = null; - else { - if (this.paymentDate == null) - this.paymentDate = new DateType(); - this.paymentDate.setValue(value); - } - return this; - } - - /** - * @return {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public Money getPaymentAmount() { - if (this.paymentAmount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentAmount"); - else if (Configuration.doAutoCreate()) - this.paymentAmount = new Money(); // cc - return this.paymentAmount; - } - - public boolean hasPaymentAmount() { - return this.paymentAmount != null && !this.paymentAmount.isEmpty(); - } - - /** - * @param value {@link #paymentAmount} (Payable less any payment adjustment.) - */ - public ExplanationOfBenefit setPaymentAmount(Money value) { - this.paymentAmount = value; - return this; - } - - /** - * @return {@link #paymentRef} (Payment identifer.) - */ - public Identifier getPaymentRef() { - if (this.paymentRef == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.paymentRef"); - else if (Configuration.doAutoCreate()) - this.paymentRef = new Identifier(); // cc - return this.paymentRef; - } - - public boolean hasPaymentRef() { - return this.paymentRef != null && !this.paymentRef.isEmpty(); - } - - /** - * @param value {@link #paymentRef} (Payment identifer.) - */ - public ExplanationOfBenefit setPaymentRef(Identifier value) { - this.paymentRef = value; - return this; - } - - /** - * @return {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public Coding getReserved() { - if (this.reserved == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.reserved"); - else if (Configuration.doAutoCreate()) - this.reserved = new Coding(); // cc - return this.reserved; - } - - public boolean hasReserved() { - return this.reserved != null && !this.reserved.isEmpty(); - } - - /** - * @param value {@link #reserved} (Status of funds reservation (For provider, for Patient, None).) - */ - public ExplanationOfBenefit setReserved(Coding value) { - this.reserved = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ExplanationOfBenefit.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public ExplanationOfBenefit setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #note} (Note text.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Note text.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addNote(NotesComponent t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #benefitBalance} (Balance by Benefit Category.) - */ - public List getBenefitBalance() { - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - return this.benefitBalance; - } - - public boolean hasBenefitBalance() { - if (this.benefitBalance == null) - return false; - for (BenefitBalanceComponent item : this.benefitBalance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #benefitBalance} (Balance by Benefit Category.) - */ - // syntactic sugar - public BenefitBalanceComponent addBenefitBalance() { //3 - BenefitBalanceComponent t = new BenefitBalanceComponent(); - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - this.benefitBalance.add(t); - return t; - } - - // syntactic sugar - public ExplanationOfBenefit addBenefitBalance(BenefitBalanceComponent t) { //3 - if (t == null) - return this; - if (this.benefitBalance == null) - this.benefitBalance = new ArrayList(); - this.benefitBalance.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response Business Identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("claim[x]", "Identifier|Reference(Claim)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claim)); - childrenList.add(new Property("claimResponse[x]", "Identifier|Reference(ClaimResponse)", "The business identifier for the instance: invoice number, claim number, pre-determination or pre-authorization number.", 0, java.lang.Integer.MAX_VALUE, claimResponse)); - childrenList.add(new Property("subType", "Coding", "A finer grained suite of claim subtype codes which may convey Inpatient vs Outpatient and/or a specialty service. In the US the BillType.", 0, java.lang.Integer.MAX_VALUE, subType)); - childrenList.add(new Property("ruleset", "Coding", "The version of the specification on which this instance relies.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The version of the specification from which the original instance was created.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the EOB was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("billablePeriod", "Period", "The billable period for which charges are being submitted.", 0, java.lang.Integer.MAX_VALUE, billablePeriod)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The provider which is responsible for the claim.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The provider which is responsible for the claim.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("facility[x]", "Identifier|Reference(Location)", "Facility where the services were provided.", 0, java.lang.Integer.MAX_VALUE, facility)); - childrenList.add(new Property("related", "", "Other claims which are related to this claim such as prior claim versions or for related services.", 0, java.lang.Integer.MAX_VALUE, related)); - childrenList.add(new Property("prescription[x]", "Identifier|Reference(MedicationOrder|VisionPrescription)", "Prescription to support the dispensing of Pharmacy or Vision products.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("originalPrescription[x]", "Identifier|Reference(MedicationOrder)", "Original prescription which has been superceded by this prescription to support the dispensing of pharmacy services, medications or products.", 0, java.lang.Integer.MAX_VALUE, originalPrescription)); - childrenList.add(new Property("payee", "", "The party to be reimbursed for the services.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("referral[x]", "Identifier|Reference(ReferralRequest)", "The referral resource which lists the date, practitioner, reason and other supporting information.", 0, java.lang.Integer.MAX_VALUE, referral)); - childrenList.add(new Property("occurrenceCode", "Coding", "**Insert definition of Occurrence codes.", 0, java.lang.Integer.MAX_VALUE, occurrenceCode)); - childrenList.add(new Property("occurenceSpanCode", "Coding", "**Insert definition of Occurrence Span codes.", 0, java.lang.Integer.MAX_VALUE, occurenceSpanCode)); - childrenList.add(new Property("valueCode", "Coding", "**Insert definition of Value codes.", 0, java.lang.Integer.MAX_VALUE, valueCode)); - childrenList.add(new Property("diagnosis", "", "Ordered list of patient diagnosis for which care is sought.", 0, java.lang.Integer.MAX_VALUE, diagnosis)); - childrenList.add(new Property("procedure", "", "Ordered list of patient procedures performed to support the adjudication.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("specialCondition", "Coding", "List of special conditions relating to the setting, treatment or patient for which care is sought which may influence the adjudication.", 0, java.lang.Integer.MAX_VALUE, specialCondition)); - childrenList.add(new Property("patient[x]", "Identifier|Reference(Patient)", "Patient Resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("precedence", "positiveInt", "Precedence (primary, secondary, etc.).", 0, java.lang.Integer.MAX_VALUE, precedence)); - childrenList.add(new Property("coverage", "", "Financial instrument by which payment information for health care.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("accidentDate", "date", "Date of an accident which these services are addressing.", 0, java.lang.Integer.MAX_VALUE, accidentDate)); - childrenList.add(new Property("accidentType", "Coding", "Type of accident: work, auto, etc.", 0, java.lang.Integer.MAX_VALUE, accidentType)); - childrenList.add(new Property("accidentLocation[x]", "Address|Reference(Location)", "Accident Place.", 0, java.lang.Integer.MAX_VALUE, accidentLocation)); - childrenList.add(new Property("interventionException", "Coding", "A list of intervention and exception codes which may influence the adjudication of the claim.", 0, java.lang.Integer.MAX_VALUE, interventionException)); - childrenList.add(new Property("onset", "", "Period, start and last dates of aspects of the Condition or related services.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("employmentImpacted", "Period", "The start and optional end dates of when the patient was precluded from working due to the treatable condition(s).", 0, java.lang.Integer.MAX_VALUE, employmentImpacted)); - childrenList.add(new Property("hospitalization", "Period", "The start and optional end dates of when the patient was confined to a treatment center.", 0, java.lang.Integer.MAX_VALUE, hospitalization)); - childrenList.add(new Property("item", "", "First tier of goods and services.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("addItem", "", "The first tier service adjudications for payor added services.", 0, java.lang.Integer.MAX_VALUE, addItem)); - childrenList.add(new Property("missingTeeth", "", "A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons.", 0, java.lang.Integer.MAX_VALUE, missingTeeth)); - childrenList.add(new Property("totalCost", "Money", "The total cost of the services reported.", 0, java.lang.Integer.MAX_VALUE, totalCost)); - childrenList.add(new Property("unallocDeductable", "Money", "The amount of deductable applied which was not allocated to any particular service line.", 0, java.lang.Integer.MAX_VALUE, unallocDeductable)); - childrenList.add(new Property("totalBenefit", "Money", "Total amount of benefit payable (Equal to sum of the Benefit amounts from all detail lines and additions less the Unallocated Deductable).", 0, java.lang.Integer.MAX_VALUE, totalBenefit)); - childrenList.add(new Property("paymentAdjustment", "Money", "Adjustment to the payment of this transaction which is not related to adjudication of this transaction.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustment)); - childrenList.add(new Property("paymentAdjustmentReason", "Coding", "Reason for the payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAdjustmentReason)); - childrenList.add(new Property("paymentDate", "date", "Estimated payment data.", 0, java.lang.Integer.MAX_VALUE, paymentDate)); - childrenList.add(new Property("paymentAmount", "Money", "Payable less any payment adjustment.", 0, java.lang.Integer.MAX_VALUE, paymentAmount)); - childrenList.add(new Property("paymentRef", "Identifier", "Payment identifer.", 0, java.lang.Integer.MAX_VALUE, paymentRef)); - childrenList.add(new Property("reserved", "Coding", "Status of funds reservation (For provider, for Patient, None).", 0, java.lang.Integer.MAX_VALUE, reserved)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("note", "", "Note text.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("benefitBalance", "", "Balance by Benefit Category.", 0, java.lang.Integer.MAX_VALUE, benefitBalance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 94742588: /*claim*/ return this.claim == null ? new Base[0] : new Base[] {this.claim}; // Type - case 689513629: /*claimResponse*/ return this.claimResponse == null ? new Base[0] : new Base[] {this.claimResponse}; // Type - case -1868521062: /*subType*/ return this.subType == null ? new Base[0] : this.subType.toArray(new Base[this.subType.size()]); // Coding - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -332066046: /*billablePeriod*/ return this.billablePeriod == null ? new Base[0] : new Base[] {this.billablePeriod}; // Period - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 501116579: /*facility*/ return this.facility == null ? new Base[0] : new Base[] {this.facility}; // Type - case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // RelatedClaimsComponent - case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Type - case -1814015861: /*originalPrescription*/ return this.originalPrescription == null ? new Base[0] : new Base[] {this.originalPrescription}; // Type - case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // PayeeComponent - case -722568291: /*referral*/ return this.referral == null ? new Base[0] : new Base[] {this.referral}; // Type - case 1721744222: /*occurrenceCode*/ return this.occurrenceCode == null ? new Base[0] : this.occurrenceCode.toArray(new Base[this.occurrenceCode.size()]); // Coding - case -556690898: /*occurenceSpanCode*/ return this.occurenceSpanCode == null ? new Base[0] : this.occurenceSpanCode.toArray(new Base[this.occurenceSpanCode.size()]); // Coding - case -766209282: /*valueCode*/ return this.valueCode == null ? new Base[0] : this.valueCode.toArray(new Base[this.valueCode.size()]); // Coding - case 1196993265: /*diagnosis*/ return this.diagnosis == null ? new Base[0] : this.diagnosis.toArray(new Base[this.diagnosis.size()]); // DiagnosisComponent - case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // ProcedureComponent - case -481489822: /*specialCondition*/ return this.specialCondition == null ? new Base[0] : this.specialCondition.toArray(new Base[this.specialCondition.size()]); // Coding - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Type - case 159695370: /*precedence*/ return this.precedence == null ? new Base[0] : new Base[] {this.precedence}; // PositiveIntType - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // CoverageComponent - case -63170979: /*accidentDate*/ return this.accidentDate == null ? new Base[0] : new Base[] {this.accidentDate}; // DateType - case -62671383: /*accidentType*/ return this.accidentType == null ? new Base[0] : new Base[] {this.accidentType}; // Coding - case -1074014492: /*accidentLocation*/ return this.accidentLocation == null ? new Base[0] : new Base[] {this.accidentLocation}; // Type - case 1753076536: /*interventionException*/ return this.interventionException == null ? new Base[0] : this.interventionException.toArray(new Base[this.interventionException.size()]); // Coding - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : this.onset.toArray(new Base[this.onset.size()]); // OnsetComponent - case 1051487345: /*employmentImpacted*/ return this.employmentImpacted == null ? new Base[0] : new Base[] {this.employmentImpacted}; // Period - case 1057894634: /*hospitalization*/ return this.hospitalization == null ? new Base[0] : new Base[] {this.hospitalization}; // Period - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent - case -1148899500: /*addItem*/ return this.addItem == null ? new Base[0] : this.addItem.toArray(new Base[this.addItem.size()]); // AddedItemComponent - case -1157130302: /*missingTeeth*/ return this.missingTeeth == null ? new Base[0] : this.missingTeeth.toArray(new Base[this.missingTeeth.size()]); // MissingTeethComponent - case -577782479: /*totalCost*/ return this.totalCost == null ? new Base[0] : new Base[] {this.totalCost}; // Money - case 2096309753: /*unallocDeductable*/ return this.unallocDeductable == null ? new Base[0] : new Base[] {this.unallocDeductable}; // Money - case 332332211: /*totalBenefit*/ return this.totalBenefit == null ? new Base[0] : new Base[] {this.totalBenefit}; // Money - case 856402963: /*paymentAdjustment*/ return this.paymentAdjustment == null ? new Base[0] : new Base[] {this.paymentAdjustment}; // Money - case -1386508233: /*paymentAdjustmentReason*/ return this.paymentAdjustmentReason == null ? new Base[0] : new Base[] {this.paymentAdjustmentReason}; // Coding - case -1540873516: /*paymentDate*/ return this.paymentDate == null ? new Base[0] : new Base[] {this.paymentDate}; // DateType - case 909332990: /*paymentAmount*/ return this.paymentAmount == null ? new Base[0] : new Base[] {this.paymentAmount}; // Money - case 1612875949: /*paymentRef*/ return this.paymentRef == null ? new Base[0] : new Base[] {this.paymentRef}; // Identifier - case -350385368: /*reserved*/ return this.reserved == null ? new Base[0] : new Base[] {this.reserved}; // Coding - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent - case 596003397: /*benefitBalance*/ return this.benefitBalance == null ? new Base[0] : this.benefitBalance.toArray(new Base[this.benefitBalance.size()]); // BenefitBalanceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 94742588: // claim - this.claim = (Type) value; // Type - break; - case 689513629: // claimResponse - this.claimResponse = (Type) value; // Type - break; - case -1868521062: // subType - this.getSubType().add(castToCoding(value)); // Coding - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -332066046: // billablePeriod - this.billablePeriod = castToPeriod(value); // Period - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 501116579: // facility - this.facility = (Type) value; // Type - break; - case 1090493483: // related - this.getRelated().add((RelatedClaimsComponent) value); // RelatedClaimsComponent - break; - case 460301338: // prescription - this.prescription = (Type) value; // Type - break; - case -1814015861: // originalPrescription - this.originalPrescription = (Type) value; // Type - break; - case 106443592: // payee - this.payee = (PayeeComponent) value; // PayeeComponent - break; - case -722568291: // referral - this.referral = (Type) value; // Type - break; - case 1721744222: // occurrenceCode - this.getOccurrenceCode().add(castToCoding(value)); // Coding - break; - case -556690898: // occurenceSpanCode - this.getOccurenceSpanCode().add(castToCoding(value)); // Coding - break; - case -766209282: // valueCode - this.getValueCode().add(castToCoding(value)); // Coding - break; - case 1196993265: // diagnosis - this.getDiagnosis().add((DiagnosisComponent) value); // DiagnosisComponent - break; - case -1095204141: // procedure - this.getProcedure().add((ProcedureComponent) value); // ProcedureComponent - break; - case -481489822: // specialCondition - this.getSpecialCondition().add(castToCoding(value)); // Coding - break; - case -791418107: // patient - this.patient = (Type) value; // Type - break; - case 159695370: // precedence - this.precedence = castToPositiveInt(value); // PositiveIntType - break; - case -351767064: // coverage - this.coverage = (CoverageComponent) value; // CoverageComponent - break; - case -63170979: // accidentDate - this.accidentDate = castToDate(value); // DateType - break; - case -62671383: // accidentType - this.accidentType = castToCoding(value); // Coding - break; - case -1074014492: // accidentLocation - this.accidentLocation = (Type) value; // Type - break; - case 1753076536: // interventionException - this.getInterventionException().add(castToCoding(value)); // Coding - break; - case 105901603: // onset - this.getOnset().add((OnsetComponent) value); // OnsetComponent - break; - case 1051487345: // employmentImpacted - this.employmentImpacted = castToPeriod(value); // Period - break; - case 1057894634: // hospitalization - this.hospitalization = castToPeriod(value); // Period - break; - case 3242771: // item - this.getItem().add((ItemsComponent) value); // ItemsComponent - break; - case -1148899500: // addItem - this.getAddItem().add((AddedItemComponent) value); // AddedItemComponent - break; - case -1157130302: // missingTeeth - this.getMissingTeeth().add((MissingTeethComponent) value); // MissingTeethComponent - break; - case -577782479: // totalCost - this.totalCost = castToMoney(value); // Money - break; - case 2096309753: // unallocDeductable - this.unallocDeductable = castToMoney(value); // Money - break; - case 332332211: // totalBenefit - this.totalBenefit = castToMoney(value); // Money - break; - case 856402963: // paymentAdjustment - this.paymentAdjustment = castToMoney(value); // Money - break; - case -1386508233: // paymentAdjustmentReason - this.paymentAdjustmentReason = castToCoding(value); // Coding - break; - case -1540873516: // paymentDate - this.paymentDate = castToDate(value); // DateType - break; - case 909332990: // paymentAmount - this.paymentAmount = castToMoney(value); // Money - break; - case 1612875949: // paymentRef - this.paymentRef = castToIdentifier(value); // Identifier - break; - case -350385368: // reserved - this.reserved = castToCoding(value); // Coding - break; - case 3148996: // form - this.form = castToCoding(value); // Coding - break; - case 3387378: // note - this.getNote().add((NotesComponent) value); // NotesComponent - break; - case 596003397: // benefitBalance - this.getBenefitBalance().add((BenefitBalanceComponent) value); // BenefitBalanceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("claim[x]")) - this.claim = (Type) value; // Type - else if (name.equals("claimResponse[x]")) - this.claimResponse = (Type) value; // Type - else if (name.equals("subType")) - this.getSubType().add(castToCoding(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("billablePeriod")) - this.billablePeriod = castToPeriod(value); // Period - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("facility[x]")) - this.facility = (Type) value; // Type - else if (name.equals("related")) - this.getRelated().add((RelatedClaimsComponent) value); - else if (name.equals("prescription[x]")) - this.prescription = (Type) value; // Type - else if (name.equals("originalPrescription[x]")) - this.originalPrescription = (Type) value; // Type - else if (name.equals("payee")) - this.payee = (PayeeComponent) value; // PayeeComponent - else if (name.equals("referral[x]")) - this.referral = (Type) value; // Type - else if (name.equals("occurrenceCode")) - this.getOccurrenceCode().add(castToCoding(value)); - else if (name.equals("occurenceSpanCode")) - this.getOccurenceSpanCode().add(castToCoding(value)); - else if (name.equals("valueCode")) - this.getValueCode().add(castToCoding(value)); - else if (name.equals("diagnosis")) - this.getDiagnosis().add((DiagnosisComponent) value); - else if (name.equals("procedure")) - this.getProcedure().add((ProcedureComponent) value); - else if (name.equals("specialCondition")) - this.getSpecialCondition().add(castToCoding(value)); - else if (name.equals("patient[x]")) - this.patient = (Type) value; // Type - else if (name.equals("precedence")) - this.precedence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("coverage")) - this.coverage = (CoverageComponent) value; // CoverageComponent - else if (name.equals("accidentDate")) - this.accidentDate = castToDate(value); // DateType - else if (name.equals("accidentType")) - this.accidentType = castToCoding(value); // Coding - else if (name.equals("accidentLocation[x]")) - this.accidentLocation = (Type) value; // Type - else if (name.equals("interventionException")) - this.getInterventionException().add(castToCoding(value)); - else if (name.equals("onset")) - this.getOnset().add((OnsetComponent) value); - else if (name.equals("employmentImpacted")) - this.employmentImpacted = castToPeriod(value); // Period - else if (name.equals("hospitalization")) - this.hospitalization = castToPeriod(value); // Period - else if (name.equals("item")) - this.getItem().add((ItemsComponent) value); - else if (name.equals("addItem")) - this.getAddItem().add((AddedItemComponent) value); - else if (name.equals("missingTeeth")) - this.getMissingTeeth().add((MissingTeethComponent) value); - else if (name.equals("totalCost")) - this.totalCost = castToMoney(value); // Money - else if (name.equals("unallocDeductable")) - this.unallocDeductable = castToMoney(value); // Money - else if (name.equals("totalBenefit")) - this.totalBenefit = castToMoney(value); // Money - else if (name.equals("paymentAdjustment")) - this.paymentAdjustment = castToMoney(value); // Money - else if (name.equals("paymentAdjustmentReason")) - this.paymentAdjustmentReason = castToCoding(value); // Coding - else if (name.equals("paymentDate")) - this.paymentDate = castToDate(value); // DateType - else if (name.equals("paymentAmount")) - this.paymentAmount = castToMoney(value); // Money - else if (name.equals("paymentRef")) - this.paymentRef = castToIdentifier(value); // Identifier - else if (name.equals("reserved")) - this.reserved = castToCoding(value); // Coding - else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("note")) - this.getNote().add((NotesComponent) value); - else if (name.equals("benefitBalance")) - this.getBenefitBalance().add((BenefitBalanceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 683016900: return getClaim(); // Type - case -1527963965: return getClaimResponse(); // Type - case -1868521062: return addSubType(); // Coding - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -332066046: return getBillablePeriod(); // Period - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 2064698607: return getProvider(); // Type - case 1326483053: return getOrganization(); // Type - case -542224643: return getFacility(); // Type - case 1090493483: return addRelated(); // RelatedClaimsComponent - case -993324506: return getPrescription(); // Type - case -2067905515: return getOriginalPrescription(); // Type - case 106443592: return getPayee(); // PayeeComponent - case 344221635: return getReferral(); // Type - case 1721744222: return addOccurrenceCode(); // Coding - case -556690898: return addOccurenceSpanCode(); // Coding - case -766209282: return addValueCode(); // Coding - case 1196993265: return addDiagnosis(); // DiagnosisComponent - case -1095204141: return addProcedure(); // ProcedureComponent - case -481489822: return addSpecialCondition(); // Coding - case -2061246629: return getPatient(); // Type - case 159695370: throw new FHIRException("Cannot make property precedence as it is not a complex type"); // PositiveIntType - case -351767064: return getCoverage(); // CoverageComponent - case -63170979: throw new FHIRException("Cannot make property accidentDate as it is not a complex type"); // DateType - case -62671383: return getAccidentType(); // Coding - case 1540715292: return getAccidentLocation(); // Type - case 1753076536: return addInterventionException(); // Coding - case 105901603: return addOnset(); // OnsetComponent - case 1051487345: return getEmploymentImpacted(); // Period - case 1057894634: return getHospitalization(); // Period - case 3242771: return addItem(); // ItemsComponent - case -1148899500: return addAddItem(); // AddedItemComponent - case -1157130302: return addMissingTeeth(); // MissingTeethComponent - case -577782479: return getTotalCost(); // Money - case 2096309753: return getUnallocDeductable(); // Money - case 332332211: return getTotalBenefit(); // Money - case 856402963: return getPaymentAdjustment(); // Money - case -1386508233: return getPaymentAdjustmentReason(); // Coding - case -1540873516: throw new FHIRException("Cannot make property paymentDate as it is not a complex type"); // DateType - case 909332990: return getPaymentAmount(); // Money - case 1612875949: return getPaymentRef(); // Identifier - case -350385368: return getReserved(); // Coding - case 3148996: return getForm(); // Coding - case 3387378: return addNote(); // NotesComponent - case 596003397: return addBenefitBalance(); // BenefitBalanceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("claimIdentifier")) { - this.claim = new Identifier(); - return this.claim; - } - else if (name.equals("claimReference")) { - this.claim = new Reference(); - return this.claim; - } - else if (name.equals("claimResponseIdentifier")) { - this.claimResponse = new Identifier(); - return this.claimResponse; - } - else if (name.equals("claimResponseReference")) { - this.claimResponse = new Reference(); - return this.claimResponse; - } - else if (name.equals("subType")) { - return addSubType(); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.created"); - } - else if (name.equals("billablePeriod")) { - this.billablePeriod = new Period(); - return this.billablePeriod; - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.disposition"); - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("facilityIdentifier")) { - this.facility = new Identifier(); - return this.facility; - } - else if (name.equals("facilityReference")) { - this.facility = new Reference(); - return this.facility; - } - else if (name.equals("related")) { - return addRelated(); - } - else if (name.equals("prescriptionIdentifier")) { - this.prescription = new Identifier(); - return this.prescription; - } - else if (name.equals("prescriptionReference")) { - this.prescription = new Reference(); - return this.prescription; - } - else if (name.equals("originalPrescriptionIdentifier")) { - this.originalPrescription = new Identifier(); - return this.originalPrescription; - } - else if (name.equals("originalPrescriptionReference")) { - this.originalPrescription = new Reference(); - return this.originalPrescription; - } - else if (name.equals("payee")) { - this.payee = new PayeeComponent(); - return this.payee; - } - else if (name.equals("referralIdentifier")) { - this.referral = new Identifier(); - return this.referral; - } - else if (name.equals("referralReference")) { - this.referral = new Reference(); - return this.referral; - } - else if (name.equals("occurrenceCode")) { - return addOccurrenceCode(); - } - else if (name.equals("occurenceSpanCode")) { - return addOccurenceSpanCode(); - } - else if (name.equals("valueCode")) { - return addValueCode(); - } - else if (name.equals("diagnosis")) { - return addDiagnosis(); - } - else if (name.equals("procedure")) { - return addProcedure(); - } - else if (name.equals("specialCondition")) { - return addSpecialCondition(); - } - else if (name.equals("patientIdentifier")) { - this.patient = new Identifier(); - return this.patient; - } - else if (name.equals("patientReference")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("precedence")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.precedence"); - } - else if (name.equals("coverage")) { - this.coverage = new CoverageComponent(); - return this.coverage; - } - else if (name.equals("accidentDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.accidentDate"); - } - else if (name.equals("accidentType")) { - this.accidentType = new Coding(); - return this.accidentType; - } - else if (name.equals("accidentLocationAddress")) { - this.accidentLocation = new Address(); - return this.accidentLocation; - } - else if (name.equals("accidentLocationReference")) { - this.accidentLocation = new Reference(); - return this.accidentLocation; - } - else if (name.equals("interventionException")) { - return addInterventionException(); - } - else if (name.equals("onset")) { - return addOnset(); - } - else if (name.equals("employmentImpacted")) { - this.employmentImpacted = new Period(); - return this.employmentImpacted; - } - else if (name.equals("hospitalization")) { - this.hospitalization = new Period(); - return this.hospitalization; - } - else if (name.equals("item")) { - return addItem(); - } - else if (name.equals("addItem")) { - return addAddItem(); - } - else if (name.equals("missingTeeth")) { - return addMissingTeeth(); - } - else if (name.equals("totalCost")) { - this.totalCost = new Money(); - return this.totalCost; - } - else if (name.equals("unallocDeductable")) { - this.unallocDeductable = new Money(); - return this.unallocDeductable; - } - else if (name.equals("totalBenefit")) { - this.totalBenefit = new Money(); - return this.totalBenefit; - } - else if (name.equals("paymentAdjustment")) { - this.paymentAdjustment = new Money(); - return this.paymentAdjustment; - } - else if (name.equals("paymentAdjustmentReason")) { - this.paymentAdjustmentReason = new Coding(); - return this.paymentAdjustmentReason; - } - else if (name.equals("paymentDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ExplanationOfBenefit.paymentDate"); - } - else if (name.equals("paymentAmount")) { - this.paymentAmount = new Money(); - return this.paymentAmount; - } - else if (name.equals("paymentRef")) { - this.paymentRef = new Identifier(); - return this.paymentRef; - } - else if (name.equals("reserved")) { - this.reserved = new Coding(); - return this.reserved; - } - else if (name.equals("form")) { - this.form = new Coding(); - return this.form; - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("benefitBalance")) { - return addBenefitBalance(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ExplanationOfBenefit"; - - } - - public ExplanationOfBenefit copy() { - ExplanationOfBenefit dst = new ExplanationOfBenefit(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.claim = claim == null ? null : claim.copy(); - dst.claimResponse = claimResponse == null ? null : claimResponse.copy(); - if (subType != null) { - dst.subType = new ArrayList(); - for (Coding i : subType) - dst.subType.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.billablePeriod = billablePeriod == null ? null : billablePeriod.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.facility = facility == null ? null : facility.copy(); - if (related != null) { - dst.related = new ArrayList(); - for (RelatedClaimsComponent i : related) - dst.related.add(i.copy()); - }; - dst.prescription = prescription == null ? null : prescription.copy(); - dst.originalPrescription = originalPrescription == null ? null : originalPrescription.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.referral = referral == null ? null : referral.copy(); - if (occurrenceCode != null) { - dst.occurrenceCode = new ArrayList(); - for (Coding i : occurrenceCode) - dst.occurrenceCode.add(i.copy()); - }; - if (occurenceSpanCode != null) { - dst.occurenceSpanCode = new ArrayList(); - for (Coding i : occurenceSpanCode) - dst.occurenceSpanCode.add(i.copy()); - }; - if (valueCode != null) { - dst.valueCode = new ArrayList(); - for (Coding i : valueCode) - dst.valueCode.add(i.copy()); - }; - if (diagnosis != null) { - dst.diagnosis = new ArrayList(); - for (DiagnosisComponent i : diagnosis) - dst.diagnosis.add(i.copy()); - }; - if (procedure != null) { - dst.procedure = new ArrayList(); - for (ProcedureComponent i : procedure) - dst.procedure.add(i.copy()); - }; - if (specialCondition != null) { - dst.specialCondition = new ArrayList(); - for (Coding i : specialCondition) - dst.specialCondition.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.precedence = precedence == null ? null : precedence.copy(); - dst.coverage = coverage == null ? null : coverage.copy(); - dst.accidentDate = accidentDate == null ? null : accidentDate.copy(); - dst.accidentType = accidentType == null ? null : accidentType.copy(); - dst.accidentLocation = accidentLocation == null ? null : accidentLocation.copy(); - if (interventionException != null) { - dst.interventionException = new ArrayList(); - for (Coding i : interventionException) - dst.interventionException.add(i.copy()); - }; - if (onset != null) { - dst.onset = new ArrayList(); - for (OnsetComponent i : onset) - dst.onset.add(i.copy()); - }; - dst.employmentImpacted = employmentImpacted == null ? null : employmentImpacted.copy(); - dst.hospitalization = hospitalization == null ? null : hospitalization.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (addItem != null) { - dst.addItem = new ArrayList(); - for (AddedItemComponent i : addItem) - dst.addItem.add(i.copy()); - }; - if (missingTeeth != null) { - dst.missingTeeth = new ArrayList(); - for (MissingTeethComponent i : missingTeeth) - dst.missingTeeth.add(i.copy()); - }; - dst.totalCost = totalCost == null ? null : totalCost.copy(); - dst.unallocDeductable = unallocDeductable == null ? null : unallocDeductable.copy(); - dst.totalBenefit = totalBenefit == null ? null : totalBenefit.copy(); - dst.paymentAdjustment = paymentAdjustment == null ? null : paymentAdjustment.copy(); - dst.paymentAdjustmentReason = paymentAdjustmentReason == null ? null : paymentAdjustmentReason.copy(); - dst.paymentDate = paymentDate == null ? null : paymentDate.copy(); - dst.paymentAmount = paymentAmount == null ? null : paymentAmount.copy(); - dst.paymentRef = paymentRef == null ? null : paymentRef.copy(); - dst.reserved = reserved == null ? null : reserved.copy(); - dst.form = form == null ? null : form.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - if (benefitBalance != null) { - dst.benefitBalance = new ArrayList(); - for (BenefitBalanceComponent i : benefitBalance) - dst.benefitBalance.add(i.copy()); - }; - return dst; - } - - protected ExplanationOfBenefit typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ExplanationOfBenefit)) - return false; - ExplanationOfBenefit o = (ExplanationOfBenefit) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(claim, o.claim, true) && compareDeep(claimResponse, o.claimResponse, true) - && compareDeep(subType, o.subType, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(billablePeriod, o.billablePeriod, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(facility, o.facility, true) && compareDeep(related, o.related, true) && compareDeep(prescription, o.prescription, true) - && compareDeep(originalPrescription, o.originalPrescription, true) && compareDeep(payee, o.payee, true) - && compareDeep(referral, o.referral, true) && compareDeep(occurrenceCode, o.occurrenceCode, true) - && compareDeep(occurenceSpanCode, o.occurenceSpanCode, true) && compareDeep(valueCode, o.valueCode, true) - && compareDeep(diagnosis, o.diagnosis, true) && compareDeep(procedure, o.procedure, true) && compareDeep(specialCondition, o.specialCondition, true) - && compareDeep(patient, o.patient, true) && compareDeep(precedence, o.precedence, true) && compareDeep(coverage, o.coverage, true) - && compareDeep(accidentDate, o.accidentDate, true) && compareDeep(accidentType, o.accidentType, true) - && compareDeep(accidentLocation, o.accidentLocation, true) && compareDeep(interventionException, o.interventionException, true) - && compareDeep(onset, o.onset, true) && compareDeep(employmentImpacted, o.employmentImpacted, true) - && compareDeep(hospitalization, o.hospitalization, true) && compareDeep(item, o.item, true) && compareDeep(addItem, o.addItem, true) - && compareDeep(missingTeeth, o.missingTeeth, true) && compareDeep(totalCost, o.totalCost, true) - && compareDeep(unallocDeductable, o.unallocDeductable, true) && compareDeep(totalBenefit, o.totalBenefit, true) - && compareDeep(paymentAdjustment, o.paymentAdjustment, true) && compareDeep(paymentAdjustmentReason, o.paymentAdjustmentReason, true) - && compareDeep(paymentDate, o.paymentDate, true) && compareDeep(paymentAmount, o.paymentAmount, true) - && compareDeep(paymentRef, o.paymentRef, true) && compareDeep(reserved, o.reserved, true) && compareDeep(form, o.form, true) - && compareDeep(note, o.note, true) && compareDeep(benefitBalance, o.benefitBalance, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ExplanationOfBenefit)) - return false; - ExplanationOfBenefit o = (ExplanationOfBenefit) other; - return compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true) && compareValues(precedence, o.precedence, true) - && compareValues(accidentDate, o.accidentDate, true) && compareValues(paymentDate, o.paymentDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (claim == null || claim.isEmpty()) - && (claimResponse == null || claimResponse.isEmpty()) && (subType == null || subType.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (billablePeriod == null || billablePeriod.isEmpty()) - && (disposition == null || disposition.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (facility == null || facility.isEmpty()) - && (related == null || related.isEmpty()) && (prescription == null || prescription.isEmpty()) - && (originalPrescription == null || originalPrescription.isEmpty()) && (payee == null || payee.isEmpty()) - && (referral == null || referral.isEmpty()) && (occurrenceCode == null || occurrenceCode.isEmpty()) - && (occurenceSpanCode == null || occurenceSpanCode.isEmpty()) && (valueCode == null || valueCode.isEmpty()) - && (diagnosis == null || diagnosis.isEmpty()) && (procedure == null || procedure.isEmpty()) - && (specialCondition == null || specialCondition.isEmpty()) && (patient == null || patient.isEmpty()) - && (precedence == null || precedence.isEmpty()) && (coverage == null || coverage.isEmpty()) - && (accidentDate == null || accidentDate.isEmpty()) && (accidentType == null || accidentType.isEmpty()) - && (accidentLocation == null || accidentLocation.isEmpty()) && (interventionException == null || interventionException.isEmpty()) - && (onset == null || onset.isEmpty()) && (employmentImpacted == null || employmentImpacted.isEmpty()) - && (hospitalization == null || hospitalization.isEmpty()) && (item == null || item.isEmpty()) - && (addItem == null || addItem.isEmpty()) && (missingTeeth == null || missingTeeth.isEmpty()) - && (totalCost == null || totalCost.isEmpty()) && (unallocDeductable == null || unallocDeductable.isEmpty()) - && (totalBenefit == null || totalBenefit.isEmpty()) && (paymentAdjustment == null || paymentAdjustment.isEmpty()) - && (paymentAdjustmentReason == null || paymentAdjustmentReason.isEmpty()) && (paymentDate == null || paymentDate.isEmpty()) - && (paymentAmount == null || paymentAmount.isEmpty()) && (paymentRef == null || paymentRef.isEmpty()) - && (reserved == null || reserved.isEmpty()) && (form == null || form.isEmpty()) && (note == null || note.isEmpty()) - && (benefitBalance == null || benefitBalance.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ExplanationOfBenefit; - } - - /** - * Search parameter: patientidentifier - *

- * Description: The reference to the patient
- * Type: token
- * Path: ExplanationOfBenefit.patientIdentifier
- *

- */ - @SearchParamDefinition(name="patientidentifier", path="ExplanationOfBenefit.patient.as(Identifier)", description="The reference to the patient", type="token" ) - public static final String SP_PATIENTIDENTIFIER = "patientidentifier"; - /** - * Fluent Client search parameter constant for patientidentifier - *

- * Description: The reference to the patient
- * Type: token
- * Path: ExplanationOfBenefit.patientIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATIENTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATIENTIDENTIFIER); - - /** - * Search parameter: claimindentifier - *

- * Description: The reference to the claim
- * Type: token
- * Path: ExplanationOfBenefit.claimIdentifier
- *

- */ - @SearchParamDefinition(name="claimindentifier", path="ExplanationOfBenefit.claim.as(Identifier)", description="The reference to the claim", type="token" ) - public static final String SP_CLAIMINDENTIFIER = "claimindentifier"; - /** - * Fluent Client search parameter constant for claimindentifier - *

- * Description: The reference to the claim
- * Type: token
- * Path: ExplanationOfBenefit.claimIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CLAIMINDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CLAIMINDENTIFIER); - - /** - * Search parameter: facilityreference - *

- * Description: Facility responsible for the goods and services
- * Type: reference
- * Path: ExplanationOfBenefit.facilityReference
- *

- */ - @SearchParamDefinition(name="facilityreference", path="ExplanationOfBenefit.facility.as(Reference)", description="Facility responsible for the goods and services", type="reference" ) - public static final String SP_FACILITYREFERENCE = "facilityreference"; - /** - * Fluent Client search parameter constant for facilityreference - *

- * Description: Facility responsible for the goods and services
- * Type: reference
- * Path: ExplanationOfBenefit.facilityReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FACILITYREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FACILITYREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ExplanationOfBenefit:facilityreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_FACILITYREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:facilityreference").toLocked(); - - /** - * Search parameter: providerreference - *

- * Description: The reference to the provider
- * Type: reference
- * Path: ExplanationOfBenefit.providerReference
- *

- */ - @SearchParamDefinition(name="providerreference", path="ExplanationOfBenefit.provider.as(Reference)", description="The reference to the provider", type="reference" ) - public static final String SP_PROVIDERREFERENCE = "providerreference"; - /** - * Fluent Client search parameter constant for providerreference - *

- * Description: The reference to the provider
- * Type: reference
- * Path: ExplanationOfBenefit.providerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ExplanationOfBenefit:providerreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:providerreference").toLocked(); - - /** - * Search parameter: facilityidentifier - *

- * Description: Facility responsible for the goods and services
- * Type: token
- * Path: ExplanationOfBenefit.facilityIdentifier
- *

- */ - @SearchParamDefinition(name="facilityidentifier", path="ExplanationOfBenefit.facility.as(Identifier)", description="Facility responsible for the goods and services", type="token" ) - public static final String SP_FACILITYIDENTIFIER = "facilityidentifier"; - /** - * Fluent Client search parameter constant for facilityidentifier - *

- * Description: Facility responsible for the goods and services
- * Type: token
- * Path: ExplanationOfBenefit.facilityIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FACILITYIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FACILITYIDENTIFIER); - - /** - * Search parameter: organizationidentifier - *

- * Description: The reference to the providing organization
- * Type: token
- * Path: ExplanationOfBenefit.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="ExplanationOfBenefit.organization.as(Identifier)", description="The reference to the providing organization", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The reference to the providing organization
- * Type: token
- * Path: ExplanationOfBenefit.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: patientreference - *

- * Description: The reference to the patient
- * Type: reference
- * Path: ExplanationOfBenefit.patientReference
- *

- */ - @SearchParamDefinition(name="patientreference", path="ExplanationOfBenefit.patient.as(Reference)", description="The reference to the patient", type="reference" ) - public static final String SP_PATIENTREFERENCE = "patientreference"; - /** - * Fluent Client search parameter constant for patientreference - *

- * Description: The reference to the patient
- * Type: reference
- * Path: ExplanationOfBenefit.patientReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ExplanationOfBenefit:patientreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENTREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:patientreference").toLocked(); - - /** - * Search parameter: created - *

- * Description: The creation date for the EOB
- * Type: date
- * Path: ExplanationOfBenefit.created
- *

- */ - @SearchParamDefinition(name="created", path="ExplanationOfBenefit.created", description="The creation date for the EOB", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: The creation date for the EOB
- * Type: date
- * Path: ExplanationOfBenefit.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: organizationreference - *

- * Description: The reference to the providing organization
- * Type: reference
- * Path: ExplanationOfBenefit.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="ExplanationOfBenefit.organization.as(Reference)", description="The reference to the providing organization", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The reference to the providing organization
- * Type: reference
- * Path: ExplanationOfBenefit.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ExplanationOfBenefit:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:organizationreference").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: ExplanationOfBenefit.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ExplanationOfBenefit.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: ExplanationOfBenefit.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: ExplanationOfBenefit.disposition
- *

- */ - @SearchParamDefinition(name="disposition", path="ExplanationOfBenefit.disposition", description="The contents of the disposition message", type="string" ) - public static final String SP_DISPOSITION = "disposition"; - /** - * Fluent Client search parameter constant for disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: ExplanationOfBenefit.disposition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); - - /** - * Search parameter: provideridentifier - *

- * Description: The reference to the provider
- * Type: token
- * Path: ExplanationOfBenefit.providerIdentifier
- *

- */ - @SearchParamDefinition(name="provideridentifier", path="ExplanationOfBenefit.provider.as(Identifier)", description="The reference to the provider", type="token" ) - public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; - /** - * Fluent Client search parameter constant for provideridentifier - *

- * Description: The reference to the provider
- * Type: token
- * Path: ExplanationOfBenefit.providerIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); - - /** - * Search parameter: claimreference - *

- * Description: The reference to the claim
- * Type: reference
- * Path: ExplanationOfBenefit.claimReference
- *

- */ - @SearchParamDefinition(name="claimreference", path="ExplanationOfBenefit.claim.as(Reference)", description="The reference to the claim", type="reference" ) - public static final String SP_CLAIMREFERENCE = "claimreference"; - /** - * Fluent Client search parameter constant for claimreference - *

- * Description: The reference to the claim
- * Type: reference
- * Path: ExplanationOfBenefit.claimReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CLAIMREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CLAIMREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ExplanationOfBenefit:claimreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CLAIMREFERENCE = new ca.uhn.fhir.model.api.Include("ExplanationOfBenefit:claimreference").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExpressionNode.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExpressionNode.java deleted file mode 100644 index f23451375d6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExpressionNode.java +++ /dev/null @@ -1,631 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -import org.hl7.fhir.utilities.Utilities; - -public class ExpressionNode { - - public enum Kind { - Name, Function, Constant, Group - } - public static class SourceLocation { - private int line; - private int column; - public SourceLocation(int line, int column) { - super(); - this.line = line; - this.column = column; - } - public int getLine() { - return line; - } - public int getColumn() { - return column; - } - public void setLine(int line) { - this.line = line; - } - public void setColumn(int column) { - this.column = column; - } - - public String toString() { - return Integer.toString(line)+", "+Integer.toString(column); - } - } - public enum Function { - Custom, - - Empty, Not, Exists, SubsetOf, SupersetOf, IsDistinct, Distinct, Count, Where, Select, All, Repeat, Item /*implicit from name[]*/, As, Is, Single, - First, Last, Tail, Skip, Take, Iif, ToInteger, ToDecimal, ToString, Substring, StartsWith, EndsWith, Matches, ReplaceMatches, Contains, Replace, Length, - Children, Descendents, MemberOf, Trace, Today, Now, Resolve, Extension; - - public static Function fromCode(String name) { - if (name.equals("empty")) return Function.Empty; - if (name.equals("not")) return Function.Not; - if (name.equals("exists")) return Function.Exists; - if (name.equals("subsetOf")) return Function.SubsetOf; - if (name.equals("supersetOf")) return Function.SupersetOf; - if (name.equals("isDistinct")) return Function.IsDistinct; - if (name.equals("distinct")) return Function.Distinct; - if (name.equals("count")) return Function.Count; - if (name.equals("where")) return Function.Where; - if (name.equals("select")) return Function.Select; - if (name.equals("all")) return Function.All; - if (name.equals("repeat")) return Function.Repeat; - if (name.equals("item")) return Function.Item; - if (name.equals("as")) return Function.As; - if (name.equals("is")) return Function.Is; - if (name.equals("single")) return Function.Single; - if (name.equals("first")) return Function.First; - if (name.equals("last")) return Function.Last; - if (name.equals("tail")) return Function.Tail; - if (name.equals("skip")) return Function.Skip; - if (name.equals("take")) return Function.Take; - if (name.equals("iif")) return Function.Iif; - if (name.equals("toInteger")) return Function.ToInteger; - if (name.equals("toDecimal")) return Function.ToDecimal; - if (name.equals("toString")) return Function.ToString; - if (name.equals("substring")) return Function.Substring; - if (name.equals("startsWith")) return Function.StartsWith; - if (name.equals("endsWith")) return Function.EndsWith; - if (name.equals("matches")) return Function.Matches; - if (name.equals("replaceMatches")) return Function.ReplaceMatches; - if (name.equals("contains")) return Function.Contains; - if (name.equals("replace")) return Function.Replace; - if (name.equals("length")) return Function.Length; - if (name.equals("children")) return Function.Children; - if (name.equals("descendents")) return Function.Descendents; - if (name.equals("memberOf")) return Function.MemberOf; - if (name.equals("trace")) return Function.Trace; - if (name.equals("today")) return Function.Today; - if (name.equals("now")) return Function.Now; - if (name.equals("resolve")) return Function.Resolve; - if (name.equals("extension")) return Function.Extension; - return null; - } - public String toCode() { - switch (this) { - case Empty : return "empty"; - case Not : return "not"; - case Exists : return "exists"; - case SubsetOf : return "subsetOf"; - case SupersetOf : return "supersetOf"; - case IsDistinct : return "isDistinct"; - case Distinct : return "distinct"; - case Count : return "count"; - case Where : return "where"; - case Select : return "select"; - case All : return "all"; - case Repeat : return "repeat"; - case Item : return "item"; - case As : return "as"; - case Is : return "is"; - case Single : return "single"; - case First : return "first"; - case Last : return "last"; - case Tail : return "tail"; - case Skip : return "skip"; - case Take : return "take"; - case Iif : return "iif"; - case ToInteger : return "toInteger"; - case ToDecimal : return "toDecimal"; - case ToString : return "toString"; - case Substring : return "substring"; - case StartsWith : return "startsWith"; - case EndsWith : return "endsWith"; - case Matches : return "matches"; - case ReplaceMatches : return "replaceMatches"; - case Contains : return "contains"; - case Replace : return "replace"; - case Length : return "length"; - case Children : return "children"; - case Descendents : return "descendents"; - case MemberOf : return "memberOf"; - case Trace : return "trace"; - case Today : return "today"; - case Now : return "now"; - case Resolve : return "resolve"; - case Extension : return "extension"; - default: return "??"; - } - } - } - - public enum Operation { - Equals, Equivalent, NotEquals, NotEquivalent, LessThen, Greater, LessOrEqual, GreaterOrEqual, Is, As, Union, Or, And, Xor, Implies, - Times, DivideBy, Plus, Minus, Concatenate, Div, Mod, In, Contains; - - public static Operation fromCode(String name) { - if (Utilities.noString(name)) - return null; - if (name.equals("=")) - return Operation.Equals; - if (name.equals("~")) - return Operation.Equivalent; - if (name.equals("!=")) - return Operation.NotEquals; - if (name.equals("!~")) - return Operation.NotEquivalent; - if (name.equals(">")) - return Operation.Greater; - if (name.equals("<")) - return Operation.LessThen; - if (name.equals(">=")) - return Operation.GreaterOrEqual; - if (name.equals("<=")) - return Operation.LessOrEqual; - if (name.equals("|")) - return Operation.Union; - if (name.equals("or")) - return Operation.Or; - if (name.equals("and")) - return Operation.And; - if (name.equals("xor")) - return Operation.Xor; - if (name.equals("is")) - return Operation.Is; - if (name.equals("as")) - return Operation.As; - if (name.equals("*")) - return Operation.Times; - if (name.equals("/")) - return Operation.DivideBy; - if (name.equals("+")) - return Operation.Plus; - if (name.equals("-")) - return Operation.Minus; - if (name.equals("&")) - return Operation.Concatenate; - if (name.equals("implies")) - return Operation.Implies; - if (name.equals("div")) - return Operation.Div; - if (name.equals("mod")) - return Operation.Mod; - if (name.equals("in")) - return Operation.In; - if (name.equals("contains")) - return Operation.Contains; - return null; - - } - public String toCode() { - switch (this) { - case Equals : return "="; - case Equivalent : return "~"; - case NotEquals : return "!="; - case NotEquivalent : return "!~"; - case Greater : return ">"; - case LessThen : return "<"; - case GreaterOrEqual : return ">="; - case LessOrEqual : return "<="; - case Union : return "|"; - case Or : return "or"; - case And : return "and"; - case Xor : return "xor"; - case Times : return "*"; - case DivideBy : return "/"; - case Plus : return "+"; - case Minus : return "-"; - case Concatenate : return "&"; - case Implies : return "implies"; - case Is : return "is"; - case As : return "as"; - case Div : return "div"; - case Mod : return "mod"; - case In : return "in"; - case Contains : return "contains"; - default: return "??"; - } - } - } - - public enum CollectionStatus { - SINGLETON, ORDERED, UNORDERED - } - - public static class TypeDetails { - private Set types = new HashSet(); - private CollectionStatus collectionStatus; - public TypeDetails(CollectionStatus collectionStatus, String... names) { - super(); - this.collectionStatus = collectionStatus; - for (String n : names) - this.types.add(n); - } - public TypeDetails(CollectionStatus collectionStatus, Set names) { - super(); - this.collectionStatus = collectionStatus; - for (String n : names) - this.types.add(n); - } - public void addType(String n) { - this.types.add(n); - } - public void addTypes(Collection n) { - this.types.addAll(n); - } - public boolean hasType(String... tn) { - for (String t: tn) - if (types.contains(t)) - return true; - return false; - } - public void update(TypeDetails source) { - types.addAll(source.types); - if (collectionStatus == null) - collectionStatus = source.collectionStatus; - else if (source.collectionStatus == CollectionStatus.UNORDERED) - collectionStatus = source.collectionStatus; - else - collectionStatus = CollectionStatus.ORDERED; - } - public TypeDetails union(TypeDetails right) { - TypeDetails result = new TypeDetails(null); - if (right.collectionStatus == CollectionStatus.UNORDERED || collectionStatus == CollectionStatus.UNORDERED) - result.collectionStatus = CollectionStatus.UNORDERED; - else - result.collectionStatus = CollectionStatus.ORDERED; - result.types.addAll(types); - result.types.addAll(right.types); - return result; - } - - public boolean hasNoTypes() { - return types.isEmpty(); - } - public Set getTypes() { - return types; - } - public TypeDetails toSingleton() { - TypeDetails result = new TypeDetails(CollectionStatus.SINGLETON); - result.types.addAll(types); - return result; - } - public CollectionStatus getCollectionStatus() { - return collectionStatus; - } - public boolean hasType(Set tn) { - for (String t: tn) - if (types.contains(t)) - return true; - return false; - } - public String describe() { - return types.toString(); - } - public String getType() { - for (String t : types) - return t; - return null; - } - - } - - - //the expression will have one of either name or constant - private String uniqueId; - private Kind kind; - private String name; - private String constant; - private Function function; - private List parameters; // will be created if there is a function - private ExpressionNode inner; - private ExpressionNode group; - private Operation operation; - private boolean proximal; // a proximal operation is the first in the sequence of operations. This is significant when evaluating the outcomes - private ExpressionNode opNext; - private SourceLocation start; - private SourceLocation end; - private SourceLocation opStart; - private SourceLocation opEnd; - private TypeDetails types; - private TypeDetails opTypes; - - - public ExpressionNode(int uniqueId) { - super(); - this.uniqueId = Integer.toString(uniqueId); - } - - public String toString() { - StringBuilder b = new StringBuilder(); - switch (kind) { - case Name: - b.append(name); - break; - case Function: - if (function == Function.Item) - b.append("["); - else { - b.append(name); - b.append("("); - } - boolean first = true; - for (ExpressionNode n : parameters) { - if (first) - first = false; - else - b.append(", "); - b.append(n.toString()); - } - if (function == Function.Item) - b.append("]"); - else { - b.append(")"); - } - break; - case Constant: - b.append(Utilities.escapeJava(constant)); - break; - case Group: - b.append("("); - b.append(group.toString()); - b.append(")"); - } - if (inner != null) { - b.append("."); - b.append(inner.toString()); - } - if (operation != null) { - b.append(" "); - b.append(operation.toCode()); - b.append(" "); - b.append(opNext.toString()); - } - - return b.toString(); - } - - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - public String getConstant() { - return constant; - } - public void setConstant(String constant) { - this.constant = constant; - } - public Function getFunction() { - return function; - } - public void setFunction(Function function) { - this.function = function; - if (parameters == null) - parameters = new ArrayList(); - } - - public boolean isProximal() { - return proximal; - } - public void setProximal(boolean proximal) { - this.proximal = proximal; - } - public Operation getOperation() { - return operation; - } - public void setOperation(Operation operation) { - this.operation = operation; - } - public ExpressionNode getInner() { - return inner; - } - public void setInner(ExpressionNode value) { - this.inner = value; - } - public ExpressionNode getOpNext() { - return opNext; - } - public void setOpNext(ExpressionNode value) { - this.opNext = value; - } - public List getParameters() { - return parameters; - } - public boolean checkName() { - if (!name.startsWith("$")) - return true; - else - return name.equals("$this"); - } - - public Kind getKind() { - return kind; - } - - public void setKind(Kind kind) { - this.kind = kind; - } - - public ExpressionNode getGroup() { - return group; - } - - public void setGroup(ExpressionNode group) { - this.group = group; - } - - public SourceLocation getStart() { - return start; - } - - public void setStart(SourceLocation start) { - this.start = start; - } - - public SourceLocation getEnd() { - return end; - } - - public void setEnd(SourceLocation end) { - this.end = end; - } - - public SourceLocation getOpStart() { - return opStart; - } - - public void setOpStart(SourceLocation opStart) { - this.opStart = opStart; - } - - public SourceLocation getOpEnd() { - return opEnd; - } - - public void setOpEnd(SourceLocation opEnd) { - this.opEnd = opEnd; - } - - public String getUniqueId() { - return uniqueId; - } - - - public int parameterCount() { - if (parameters == null) - return 0; - else - return parameters.size(); - } - - public String Canonical() { - StringBuilder b = new StringBuilder(); - write(b); - return b.toString(); - } - - public String summary() { - switch (kind) { - case Name: return uniqueId+": "+name; - case Function: return uniqueId+": "+function.toString()+"()"; - case Constant: return uniqueId+": "+constant; - case Group: return uniqueId+": (Group)"; - } - return "??"; - } - - private void write(StringBuilder b) { - - switch (kind) { - case Name: - b.append(name); - break; - case Constant: - b.append(constant); - break; - case Function: - b.append(function.toCode()); - b.append('('); - boolean f = true; - for (ExpressionNode n : parameters) { - if (f) - f = false; - else - b.append(", "); - n.write(b); - } - b.append(')'); - - break; - case Group: - b.append('('); - group.write(b); - b.append(')'); - } - - if (inner != null) { - b.append('.'); - inner.write(b); - } - if (operation != null) { - b.append(' '); - b.append(operation.toCode()); - b.append(' '); - opNext.write(b); - } - } - - public String check() { - - switch (kind) { - case Name: - if (Utilities.noString(name)) - return "No Name provided @ "+location(); - break; - - case Function: - if (function == null) - return "No Function id provided @ "+location(); - for (ExpressionNode n : parameters) { - String msg = n.check(); - if (msg != null) - return msg; - } - - break; - - case Constant: - if (Utilities.noString(constant)) - return "No Constant provided @ "+location(); - break; - - case Group: - if (group == null) - return "No Group provided @ "+location(); - else { - String msg = group.check(); - if (msg != null) - return msg; - } - } - if (inner != null) { - String msg = inner.check(); - if (msg != null) - return msg; - } - if (operation == null) { - - if (opNext != null) - return "Next provided when it shouldn't be @ "+location(); - } - else { - if (opNext == null) - return "No Next provided @ "+location(); - else - opNext.check(); - } - return null; - - } - - private String location() { - return Integer.toString(start.line)+", "+Integer.toString(start.column); - } - - public TypeDetails getTypes() { - return types; - } - - public void setTypes(TypeDetails types) { - this.types = types; - } - - public TypeDetails getOpTypes() { - return opTypes; - } - - public void setOpTypes(TypeDetails opTypes) { - this.opTypes = opTypes; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Extension.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Extension.java deleted file mode 100644 index ac06bff2f06..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Extension.java +++ /dev/null @@ -1,394 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseDatatype; -import org.hl7.fhir.instance.model.api.IBaseExtension; -import org.hl7.fhir.instance.model.api.IBaseHasExtensions; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Optional Extensions Element - found in all resources. - */ -@DatatypeDef(name="Extension") -public class Extension extends BaseExtension implements IBaseExtension, IBaseHasExtensions { - - /** - * Source of the definition for the extension code - a logical name or a URL. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="identifies the meaning of the extension", formalDefinition="Source of the definition for the extension code - a logical name or a URL." ) - protected UriType url; - - /** - * Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list). - */ - @Child(name = "value", type = {}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Value of extension", formalDefinition="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." ) - protected org.hl7.fhir.dstu2016may.model.Type value; - - private static final long serialVersionUID = 1240831878L; - - /** - * Constructor - */ - public Extension() { - super(); - } - - /** - * Constructor - */ - public Extension(UriType url) { - super(); - this.url = url; - } - - /** - * Constructor - */ - public Extension(String theUrl) { - setUrl(theUrl); - } - - /** - * Constructor - */ - public Extension(String theUrl, IBaseDatatype theValue) { - setUrl(theUrl); - setValue(theValue); - } - - /** - * @return {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Extension.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (Source of the definition for the extension code - a logical name or a URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Extension setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return Source of the definition for the extension code - a logical name or a URL. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value Source of the definition for the extension code - a logical name or a URL. - */ - public Extension setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) - */ - public org.hl7.fhir.dstu2016may.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).) - */ - public Extension setValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "Source of the definition for the extension code - a logical name or a URL.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("value[x]", "*", "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 111972721: // value - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("value[x]")) - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Extension.url"); - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else if (name.equals("valueBase64Binary")) { - this.value = new Base64BinaryType(); - return this.value; - } - else if (name.equals("valueInstant")) { - this.value = new InstantType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueUri")) { - this.value = new UriType(); - return this.value; - } - else if (name.equals("valueDate")) { - this.value = new DateType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueCode")) { - this.value = new CodeType(); - return this.value; - } - else if (name.equals("valueOid")) { - this.value = new OidType(); - return this.value; - } - else if (name.equals("valueId")) { - this.value = new IdType(); - return this.value; - } - else if (name.equals("valueUnsignedInt")) { - this.value = new UnsignedIntType(); - return this.value; - } - else if (name.equals("valuePositiveInt")) { - this.value = new PositiveIntType(); - return this.value; - } - else if (name.equals("valueMarkdown")) { - this.value = new MarkdownType(); - return this.value; - } - else if (name.equals("valueAnnotation")) { - this.value = new Annotation(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueIdentifier")) { - this.value = new Identifier(); - return this.value; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else if (name.equals("valueRatio")) { - this.value = new Ratio(); - return this.value; - } - else if (name.equals("valueSampledData")) { - this.value = new SampledData(); - return this.value; - } - else if (name.equals("valueSignature")) { - this.value = new Signature(); - return this.value; - } - else if (name.equals("valueHumanName")) { - this.value = new HumanName(); - return this.value; - } - else if (name.equals("valueAddress")) { - this.value = new Address(); - return this.value; - } - else if (name.equals("valueContactPoint")) { - this.value = new ContactPoint(); - return this.value; - } - else if (name.equals("valueTiming")) { - this.value = new Timing(); - return this.value; - } - else if (name.equals("valueReference")) { - this.value = new Reference(); - return this.value; - } - else if (name.equals("valueMeta")) { - this.value = new Meta(); - return this.value; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Extension"; - - } - - public Extension copy() { - Extension dst = new Extension(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - protected Extension typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Extension)) - return false; - Extension o = (Extension) other; - return compareDeep(url, o.url, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Extension)) - return false; - Extension o = (Extension) other; - return compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java deleted file mode 100644 index 624cbfd2637..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ExtensionHelper.java +++ /dev/null @@ -1,148 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.exceptions.FHIRException; - -/** - * in a language with helper classes, this would be a helper class (at least, the base exgtension helpers would be) - * @author Grahame - * - */ -public class ExtensionHelper { - - - /** - * @param name the identity of the extension of interest - * @return true if the named extension is on this element. Will check modifier extensions too if appropriate - */ - public static boolean hasExtension(Element element, String name) { - if (element != null && element instanceof BackboneElement) - return hasExtension((BackboneElement) element, name); - - if (name == null || element == null || !element.hasExtension()) - return false; - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return true; - } - return false; - } - - /** - * @param name the identity of the extension of interest - * @return true if the named extension is on this element. Will check modifier extensions - */ - public static boolean hasExtension(BackboneElement element, String name) { - if (name == null || element == null || !(element.hasExtension() || element.hasModifierExtension())) - return false; - for (Extension e : element.getModifierExtension()) { - if (name.equals(e.getUrl())) - return true; - } - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return true; - } - return false; - } - - - /** - * @param name the identity of the extension of interest - * @return The extension, if on this element, else null. will check modifier extensions too, if appropriate - */ - public static Extension getExtension(Element element, String name) { - if (element != null && element instanceof BackboneElement) - return getExtension((BackboneElement) element, name); - - if (name == null || element == null || !element.hasExtension()) - return null; - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return e; - } - return null; - } - - /** - * @param name the identity of the extension of interest - * @return The extension, if on this element, else null. will check modifier extensions too - */ - public static Extension getExtension(BackboneElement element, String name) { - if (name == null || element == null || !element.hasExtension()) - return null; - for (Extension e : element.getModifierExtension()) { - if (name.equals(e.getUrl())) - return e; - } - for (Extension e : element.getExtension()) { - if (name.equals(e.getUrl())) - return e; - } - return null; - } - - /** - * set the value of an extension on the element. if value == null, make sure it doesn't exist - * - * @param element - the element to act on. Can also be a backbone element - * @param modifier - whether this is a modifier. Note that this is a definitional property of the extension; don't alternate - * @param uri - the identifier for the extension - * @param value - the value of the extension. Delete if this is null - * @throws Exception - if the modifier logic is incorrect - */ - public static void setExtension(Element element, boolean modifier, String uri, Type value) throws FHIRException { - if (value == null) { - // deleting the extension - if (element instanceof BackboneElement) - for (Extension e : ((BackboneElement) element).getModifierExtension()) { - if (uri.equals(e.getUrl())) - ((BackboneElement) element).getModifierExtension().remove(e); - } - for (Extension e : element.getExtension()) { - if (uri.equals(e.getUrl())) - element.getExtension().remove(e); - } - } else { - // it would probably be easier to delete and then create, but this would re-order the extensions - // not that order matters, but we'll preserve it anyway - boolean found = false; - if (element instanceof BackboneElement) - for (Extension e : ((BackboneElement) element).getModifierExtension()) { - if (uri.equals(e.getUrl())) { - if (!modifier) - throw new FHIRException("Error adding extension \""+uri+"\": found an existing modifier extension, and the extension is not marked as a modifier"); - e.setValue(value); - found = true; - } - } - for (Extension e : element.getExtension()) { - if (uri.equals(e.getUrl())) { - if (modifier) - throw new FHIRException("Error adding extension \""+uri+"\": found an existing extension, and the extension is marked as a modifier"); - e.setValue(value); - found = true; - } - } - if (!found) { - Extension ex = new Extension().setUrl(uri).setValue(value); - if (modifier) { - if (!(element instanceof BackboneElement)) - throw new FHIRException("Error adding extension \""+uri+"\": extension is marked as a modifier, but element is not a backbone element"); - ((BackboneElement) element).getModifierExtension().add(ex); - - } else { - element.getExtension().add(ex); - } - } - } - } - - public static boolean hasExtensions(Element element) { - if (element instanceof BackboneElement) - return element.hasExtension() || ((BackboneElement) element).hasModifierExtension(); - else - return element.hasExtension(); - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Factory.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Factory.java deleted file mode 100644 index b7c22f6dce4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Factory.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.io.IOException; -import java.net.URISyntaxException; -import java.text.ParseException; -import java.util.UUID; - -import org.hl7.fhir.dstu2016may.model.ContactPoint.ContactPointSystem; -import org.hl7.fhir.dstu2016may.model.Narrative.NarrativeStatus; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.xhtml.XhtmlParser; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - - - -public class Factory { - - public static IdType newId(String value) { - if (value == null) - return null; - IdType res = new IdType(); - res.setValue(value); - return res; - } - - public static StringType newString_(String value) { - if (value == null) - return null; - StringType res = new StringType(); - res.setValue(value); - return res; - } - - public static UriType newUri(String value) throws URISyntaxException { - if (value == null) - return null; - UriType res = new UriType(); - res.setValue(value); - return res; - } - - public static DateTimeType newDateTime(String value) throws ParseException { - if (value == null) - return null; - return new DateTimeType(value); - } - - public static DateType newDate(String value) throws ParseException { - if (value == null) - return null; - return new DateType(value); - } - - public static CodeType newCode(String value) { - if (value == null) - return null; - CodeType res = new CodeType(); - res.setValue(value); - return res; - } - - public static IntegerType newInteger(int value) { - IntegerType res = new IntegerType(); - res.setValue(value); - return res; - } - - public static IntegerType newInteger(java.lang.Integer value) { - if (value == null) - return null; - IntegerType res = new IntegerType(); - res.setValue(value); - return res; - } - - public static BooleanType newBoolean(boolean value) { - BooleanType res = new BooleanType(); - res.setValue(value); - return res; - } - - public static ContactPoint newContactPoint(ContactPointSystem system, String value) { - ContactPoint res = new ContactPoint(); - res.setSystem(system); - res.setValue(value); - return res; - } - - public static Extension newExtension(String uri, Type value, boolean evenIfNull) { - if (!evenIfNull && (value == null || value.isEmpty())) - return null; - Extension e = new Extension(); - e.setUrl(uri); - e.setValue(value); - return e; - } - - public static CodeableConcept newCodeableConcept(String code, String system, String display) { - CodeableConcept cc = new CodeableConcept(); - Coding c = new Coding(); - c.setCode(code); - c.setSystem(system); - c.setDisplay(display); - cc.getCoding().add(c); - return cc; - } - - public static Reference makeReference(String url) { - Reference rr = new Reference(); - rr.setReference(url); - return rr; - } - - public static Narrative newNarrative(NarrativeStatus status, String html) throws IOException, FHIRException { - Narrative n = new Narrative(); - n.setStatus(status); - try { - n.setDiv(new XhtmlParser().parseFragment("
"+Utilities.escapeXml(html)+"
")); - } catch (org.hl7.fhir.exceptions.FHIRException e) { - throw new FHIRException(e.getMessage(), e); - } - return n; - } - - public static Coding makeCoding(String code) throws FHIRException { - String[] parts = code.split("\\|"); - Coding c = new Coding(); - if (parts.length == 2) { - c.setSystem(parts[0]); - c.setCode(parts[1]); - } else if (parts.length == 3) { - c.setSystem(parts[0]); - c.setCode(parts[1]); - c.setDisplay(parts[2]); - } else - throw new FHIRException("Unable to understand the code '"+code+"'. Use the format system|code(|display)"); - return c; - } - - public static Reference makeReference(String url, String text) { - Reference rr = new Reference(); - rr.setReference(url); - if (!Utilities.noString(text)) - rr.setDisplay(text); - return rr; - } - - public static String createUUID() { - return "urn:uuid:"+UUID.randomUUID().toString().toLowerCase(); - } - - public Type create(String name) throws FHIRException { - if (name.equals("boolean")) - return new BooleanType(); - else if (name.equals("integer")) - return new IntegerType(); - else if (name.equals("decimal")) - return new DecimalType(); - else if (name.equals("base64Binary")) - return new Base64BinaryType(); - else if (name.equals("instant")) - return new InstantType(); - else if (name.equals("string")) - return new StringType(); - else if (name.equals("uri")) - return new UriType(); - else if (name.equals("date")) - return new DateType(); - else if (name.equals("dateTime")) - return new DateTimeType(); - else if (name.equals("time")) - return new TimeType(); - else if (name.equals("code")) - return new CodeType(); - else if (name.equals("oid")) - return new OidType(); - else if (name.equals("id")) - return new IdType(); - else if (name.equals("unsignedInt")) - return new UnsignedIntType(); - else if (name.equals("positiveInt")) - return new PositiveIntType(); - else if (name.equals("markdown")) - return new MarkdownType(); - else if (name.equals("Annotation")) - return new Annotation(); - else if (name.equals("Attachment")) - return new Attachment(); - else if (name.equals("Identifier")) - return new Identifier(); - else if (name.equals("CodeableConcept")) - return new CodeableConcept(); - else if (name.equals("Coding")) - return new Coding(); - else if (name.equals("Quantity")) - return new Quantity(); - else if (name.equals("Range")) - return new Range(); - else if (name.equals("Period")) - return new Period(); - else if (name.equals("Ratio")) - return new Ratio(); - else if (name.equals("SampledData")) - return new SampledData(); - else if (name.equals("Signature")) - return new Signature(); - else if (name.equals("HumanName")) - return new HumanName(); - else if (name.equals("Address")) - return new Address(); - else if (name.equals("ContactPoint")) - return new ContactPoint(); - else if (name.equals("Timing")) - return new Timing(); - else if (name.equals("Reference")) - return new Reference(); - else if (name.equals("Meta")) - return new Meta(); - else - throw new FHIRException("Unknown data type name "+name); - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java deleted file mode 100644 index d8de7ec04eb..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/FamilyMemberHistory.java +++ /dev/null @@ -1,1589 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Significant health events and conditions for a person related to the patient relevant in the context of care for the patient. - */ -@ResourceDef(name="FamilyMemberHistory", profile="http://hl7.org/fhir/Profile/FamilyMemberHistory") -public class FamilyMemberHistory extends DomainResource { - - public enum FamilyHistoryStatus { - /** - * Some health information is known and captured, but not complete - see notes for details. - */ - PARTIAL, - /** - * All relevant health information is known and captured. - */ - COMPLETED, - /** - * This instance should not have been part of this patient's medical record. - */ - ENTEREDINERROR, - /** - * Health information for this individual is unavailable/unknown. - */ - HEALTHUNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static FamilyHistoryStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("partial".equals(codeString)) - return PARTIAL; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("health-unknown".equals(codeString)) - return HEALTHUNKNOWN; - throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PARTIAL: return "partial"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case HEALTHUNKNOWN: return "health-unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PARTIAL: return "http://hl7.org/fhir/history-status"; - case COMPLETED: return "http://hl7.org/fhir/history-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/history-status"; - case HEALTHUNKNOWN: return "http://hl7.org/fhir/history-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PARTIAL: return "Some health information is known and captured, but not complete - see notes for details."; - case COMPLETED: return "All relevant health information is known and captured."; - case ENTEREDINERROR: return "This instance should not have been part of this patient's medical record."; - case HEALTHUNKNOWN: return "Health information for this individual is unavailable/unknown."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PARTIAL: return "Partial"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in error"; - case HEALTHUNKNOWN: return "Health unknown"; - default: return "?"; - } - } - } - - public static class FamilyHistoryStatusEnumFactory implements EnumFactory { - public FamilyHistoryStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("partial".equals(codeString)) - return FamilyHistoryStatus.PARTIAL; - if ("completed".equals(codeString)) - return FamilyHistoryStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return FamilyHistoryStatus.ENTEREDINERROR; - if ("health-unknown".equals(codeString)) - return FamilyHistoryStatus.HEALTHUNKNOWN; - throw new IllegalArgumentException("Unknown FamilyHistoryStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("partial".equals(codeString)) - return new Enumeration(this, FamilyHistoryStatus.PARTIAL); - if ("completed".equals(codeString)) - return new Enumeration(this, FamilyHistoryStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, FamilyHistoryStatus.ENTEREDINERROR); - if ("health-unknown".equals(codeString)) - return new Enumeration(this, FamilyHistoryStatus.HEALTHUNKNOWN); - throw new FHIRException("Unknown FamilyHistoryStatus code '"+codeString+"'"); - } - public String toCode(FamilyHistoryStatus code) { - if (code == FamilyHistoryStatus.PARTIAL) - return "partial"; - if (code == FamilyHistoryStatus.COMPLETED) - return "completed"; - if (code == FamilyHistoryStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == FamilyHistoryStatus.HEALTHUNKNOWN) - return "health-unknown"; - return "?"; - } - public String toSystem(FamilyHistoryStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class FamilyMemberHistoryConditionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 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. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @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." ) - protected CodeableConcept code; - - /** - * Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation. - */ - @Child(name = "outcome", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @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." ) - protected CodeableConcept outcome; - - /** - * 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. - */ - @Child(name = "onset", type = {Age.class, Range.class, Period.class, StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @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." ) - protected Type onset; - - /** - * An area where general notes can be placed about this specific condition. - */ - @Child(name = "note", type = {Annotation.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Extra information about condition", formalDefinition="An area where general notes can be placed about this specific condition." ) - protected Annotation note; - - private static final long serialVersionUID = -1221569121L; - - /** - * Constructor - */ - public FamilyMemberHistoryConditionComponent() { - super(); - } - - /** - * Constructor - */ - public FamilyMemberHistoryConditionComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (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 CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (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 FamilyMemberHistoryConditionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.) - */ - public FamilyMemberHistoryConditionComponent setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #onset} (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 Type getOnset() { - return this.onset; - } - - /** - * @return {@link #onset} (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 Age getOnsetAge() throws FHIRException { - if (!(this.onset instanceof Age)) - throw new FHIRException("Type mismatch: the type Age was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Age) this.onset; - } - - public boolean hasOnsetAge() { - return this.onset instanceof Age; - } - - /** - * @return {@link #onset} (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 Range getOnsetRange() throws FHIRException { - if (!(this.onset instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Range) this.onset; - } - - public boolean hasOnsetRange() { - return this.onset instanceof Range; - } - - /** - * @return {@link #onset} (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 Period getOnsetPeriod() throws FHIRException { - if (!(this.onset instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (Period) this.onset; - } - - public boolean hasOnsetPeriod() { - return this.onset instanceof Period; - } - - /** - * @return {@link #onset} (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 StringType getOnsetStringType() throws FHIRException { - if (!(this.onset instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.onset.getClass().getName()+" was encountered"); - return (StringType) this.onset; - } - - public boolean hasOnsetStringType() { - return this.onset instanceof StringType; - } - - public boolean hasOnset() { - return this.onset != null && !this.onset.isEmpty(); - } - - /** - * @param value {@link #onset} (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 FamilyMemberHistoryConditionComponent setOnset(Type value) { - this.onset = value; - return this; - } - - /** - * @return {@link #note} (An area where general notes can be placed about this specific condition.) - */ - public Annotation getNote() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistoryConditionComponent.note"); - else if (Configuration.doAutoCreate()) - this.note = new Annotation(); // cc - return this.note; - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (An area where general notes can be placed about this specific condition.) - */ - public FamilyMemberHistoryConditionComponent setNote(Annotation value) { - this.note = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("outcome", "CodeableConcept", "Indicates what happened as a result of this condition. If the condition resulted in death, deceased date is captured on the relation.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("onset[x]", "Age|Range|Period|string", "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.", 0, java.lang.Integer.MAX_VALUE, onset)); - childrenList.add(new Property("note", "Annotation", "An area where general notes can be placed about this specific condition.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept - case 105901603: /*onset*/ return this.onset == null ? new Base[0] : new Base[] {this.onset}; // Type - case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // Annotation - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1106507950: // outcome - this.outcome = castToCodeableConcept(value); // CodeableConcept - break; - case 105901603: // onset - this.onset = (Type) value; // Type - break; - case 3387378: // note - this.note = castToAnnotation(value); // Annotation - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("outcome")) - this.outcome = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("onset[x]")) - this.onset = (Type) value; // Type - else if (name.equals("note")) - this.note = castToAnnotation(value); // Annotation - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -1106507950: return getOutcome(); // CodeableConcept - case -1886216323: return getOnset(); // Type - case 3387378: return getNote(); // Annotation - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("outcome")) { - this.outcome = new CodeableConcept(); - return this.outcome; - } - else if (name.equals("onsetAge")) { - this.onset = new Age(); - return this.onset; - } - else if (name.equals("onsetRange")) { - this.onset = new Range(); - return this.onset; - } - else if (name.equals("onsetPeriod")) { - this.onset = new Period(); - return this.onset; - } - else if (name.equals("onsetString")) { - this.onset = new StringType(); - return this.onset; - } - else if (name.equals("note")) { - this.note = new Annotation(); - return this.note; - } - else - return super.addChild(name); - } - - public FamilyMemberHistoryConditionComponent copy() { - FamilyMemberHistoryConditionComponent dst = new FamilyMemberHistoryConditionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.onset = onset == null ? null : onset.copy(); - dst.note = note == null ? null : note.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FamilyMemberHistoryConditionComponent)) - return false; - FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(outcome, o.outcome, true) && compareDeep(onset, o.onset, true) - && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FamilyMemberHistoryConditionComponent)) - return false; - FamilyMemberHistoryConditionComponent o = (FamilyMemberHistoryConditionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (outcome == null || outcome.isEmpty()) - && (onset == null || onset.isEmpty()) && (note == null || note.isEmpty()); - } - - public String fhirType() { - return "FamilyMemberHistory.condition"; - - } - - } - - /** - * This records identifiers associated with this family member 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="External Id(s) for this record", formalDefinition="This records identifiers associated with this family member 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)." ) - protected List identifier; - - /** - * The person who this history concerns. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient history is about", formalDefinition="The person who this history concerns." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person who this history concerns.) - */ - protected Patient patientTarget; - - /** - * The date (and possibly time) when the family member history was taken. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When history was captured/updated", formalDefinition="The date (and possibly time) when the family member history was taken." ) - protected DateTimeType date; - - /** - * A code specifying a state of a Family Member History record. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="partial | completed | entered-in-error | health-unknown", formalDefinition="A code specifying a state of a Family Member History record." ) - protected Enumeration status; - - /** - * This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". - */ - @Child(name = "name", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @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\"." ) - protected StringType name; - - /** - * The type of relationship this person has to the patient (father, mother, brother etc.). - */ - @Child(name = "relationship", type = {CodeableConcept.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Relationship to the subject", formalDefinition="The type of relationship this person has to the patient (father, mother, brother etc.)." ) - protected CodeableConcept relationship; - - /** - * Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The actual or approximate date of birth of the relative. - */ - @Child(name = "born", type = {Period.class, DateType.class, StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="(approximate) date of birth", formalDefinition="The actual or approximate date of birth of the relative." ) - protected Type born; - - /** - * The actual or approximate age of the relative at the time the family member history is recorded. - */ - @Child(name = "age", type = {Age.class, Range.class, StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="(approximate) age", formalDefinition="The actual or approximate age of the relative at the time the family member history is recorded." ) - protected Type age; - - /** - * Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record. - */ - @Child(name = "deceased", type = {BooleanType.class, Age.class, Range.class, DateType.class, StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Dead? How old/when?", formalDefinition="Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record." ) - protected Type deceased; - - /** - * 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. - */ - @Child(name = "note", type = {Annotation.class}, order=10, min=0, max=1, modifier=false, summary=false) - @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." ) - protected Annotation note; - - /** - * 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. - */ - @Child(name = "condition", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List condition; - - private static final long serialVersionUID = -1799103041L; - - /** - * Constructor - */ - public FamilyMemberHistory() { - super(); - } - - /** - * Constructor - */ - public FamilyMemberHistory(Reference patient, Enumeration status, CodeableConcept relationship) { - super(); - this.patient = patient; - this.status = status; - this.relationship = relationship; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this family member 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this family member 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public FamilyMemberHistory addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The person who this history concerns.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person who this history concerns.) - */ - public FamilyMemberHistory setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who this history concerns.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who this history concerns.) - */ - public FamilyMemberHistory setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and possibly time) when the family member history was taken.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public FamilyMemberHistory setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and possibly time) when the family member history was taken. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and possibly time) when the family member history was taken. - */ - public FamilyMemberHistory setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (A code specifying a state of a Family Member History record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new FamilyHistoryStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying a state of a Family Member History record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public FamilyMemberHistory setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying a state of a Family Member History record. - */ - public FamilyHistoryStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying a state of a Family Member History record. - */ - public FamilyMemberHistory setStatus(FamilyHistoryStatus value) { - if (this.status == null) - this.status = new Enumeration(new FamilyHistoryStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #name} (This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair".). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public FamilyMemberHistory setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value This will either be a name or a description; e.g. "Aunt Susan", "my cousin with the red hair". - */ - public FamilyMemberHistory setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) - */ - public CodeableConcept getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeableConcept(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The type of relationship this person has to the patient (father, mother, brother etc.).) - */ - public FamilyMemberHistory setRelationship(CodeableConcept value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public FamilyMemberHistory setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes. - */ - public FamilyMemberHistory setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public Type getBorn() { - return this.born; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public Period getBornPeriod() throws FHIRException { - if (!(this.born instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.born.getClass().getName()+" was encountered"); - return (Period) this.born; - } - - public boolean hasBornPeriod() { - return this.born instanceof Period; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public DateType getBornDateType() throws FHIRException { - if (!(this.born instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.born.getClass().getName()+" was encountered"); - return (DateType) this.born; - } - - public boolean hasBornDateType() { - return this.born instanceof DateType; - } - - /** - * @return {@link #born} (The actual or approximate date of birth of the relative.) - */ - public StringType getBornStringType() throws FHIRException { - if (!(this.born instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.born.getClass().getName()+" was encountered"); - return (StringType) this.born; - } - - public boolean hasBornStringType() { - return this.born instanceof StringType; - } - - public boolean hasBorn() { - return this.born != null && !this.born.isEmpty(); - } - - /** - * @param value {@link #born} (The actual or approximate date of birth of the relative.) - */ - public FamilyMemberHistory setBorn(Type value) { - this.born = value; - return this; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Type getAge() { - return this.age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Age getAgeAge() throws FHIRException { - if (!(this.age instanceof Age)) - throw new FHIRException("Type mismatch: the type Age was expected, but "+this.age.getClass().getName()+" was encountered"); - return (Age) this.age; - } - - public boolean hasAgeAge() { - return this.age instanceof Age; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public Range getAgeRange() throws FHIRException { - if (!(this.age instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.age.getClass().getName()+" was encountered"); - return (Range) this.age; - } - - public boolean hasAgeRange() { - return this.age instanceof Range; - } - - /** - * @return {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public StringType getAgeStringType() throws FHIRException { - if (!(this.age instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.age.getClass().getName()+" was encountered"); - return (StringType) this.age; - } - - public boolean hasAgeStringType() { - return this.age instanceof StringType; - } - - public boolean hasAge() { - return this.age != null && !this.age.isEmpty(); - } - - /** - * @param value {@link #age} (The actual or approximate age of the relative at the time the family member history is recorded.) - */ - public FamilyMemberHistory setAge(Type value) { - this.age = value; - return this; - } - - /** - * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public Type getDeceased() { - return this.deceased; - } - - /** - * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public BooleanType getDeceasedBooleanType() throws FHIRException { - if (!(this.deceased instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (BooleanType) this.deceased; - } - - public boolean hasDeceasedBooleanType() { - return this.deceased instanceof BooleanType; - } - - /** - * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public Age getDeceasedAge() throws FHIRException { - if (!(this.deceased instanceof Age)) - throw new FHIRException("Type mismatch: the type Age was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (Age) this.deceased; - } - - public boolean hasDeceasedAge() { - return this.deceased instanceof Age; - } - - /** - * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public Range getDeceasedRange() throws FHIRException { - if (!(this.deceased instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (Range) this.deceased; - } - - public boolean hasDeceasedRange() { - return this.deceased instanceof Range; - } - - /** - * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public DateType getDeceasedDateType() throws FHIRException { - if (!(this.deceased instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (DateType) this.deceased; - } - - public boolean hasDeceasedDateType() { - return this.deceased instanceof DateType; - } - - /** - * @return {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public StringType getDeceasedStringType() throws FHIRException { - if (!(this.deceased instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (StringType) this.deceased; - } - - public boolean hasDeceasedStringType() { - return this.deceased instanceof StringType; - } - - public boolean hasDeceased() { - return this.deceased != null && !this.deceased.isEmpty(); - } - - /** - * @param value {@link #deceased} (Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.) - */ - public FamilyMemberHistory setDeceased(Type value) { - this.deceased = value; - return this; - } - - /** - * @return {@link #note} (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 Annotation getNote() { - if (this.note == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FamilyMemberHistory.note"); - else if (Configuration.doAutoCreate()) - this.note = new Annotation(); // cc - return this.note; - } - - public boolean hasNote() { - return this.note != null && !this.note.isEmpty(); - } - - /** - * @param value {@link #note} (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 FamilyMemberHistory setNote(Annotation value) { - this.note = value; - return this; - } - - /** - * @return {@link #condition} (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 List getCondition() { - if (this.condition == null) - this.condition = new ArrayList(); - return this.condition; - } - - public boolean hasCondition() { - if (this.condition == null) - return false; - for (FamilyMemberHistoryConditionComponent item : this.condition) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #condition} (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.) - */ - // syntactic sugar - public FamilyMemberHistoryConditionComponent addCondition() { //3 - FamilyMemberHistoryConditionComponent t = new FamilyMemberHistoryConditionComponent(); - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return t; - } - - // syntactic sugar - public FamilyMemberHistory addCondition(FamilyMemberHistoryConditionComponent t) { //3 - if (t == null) - return this; - if (this.condition == null) - this.condition = new ArrayList(); - this.condition.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this family member 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person who this history concerns.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("date", "dateTime", "The date (and possibly time) when the family member history was taken.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("status", "code", "A code specifying a state of a Family Member History record.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("name", "string", "This will either be a name or a description; e.g. \"Aunt Susan\", \"my cousin with the red hair\".", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("relationship", "CodeableConcept", "The type of relationship this person has to the patient (father, mother, brother etc.).", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the relative is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("born[x]", "Period|date|string", "The actual or approximate date of birth of the relative.", 0, java.lang.Integer.MAX_VALUE, born)); - childrenList.add(new Property("age[x]", "Age|Range|string", "The actual or approximate age of the relative at the time the family member history is recorded.", 0, java.lang.Integer.MAX_VALUE, age)); - childrenList.add(new Property("deceased[x]", "boolean|Age|Range|date|string", "Deceased flag or the actual or approximate age of the relative at the time of death for the family member history record.", 0, java.lang.Integer.MAX_VALUE, deceased)); - childrenList.add(new Property("note", "Annotation", "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.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("condition", "", "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.", 0, java.lang.Integer.MAX_VALUE, condition)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept - case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration - case 3029833: /*born*/ return this.born == null ? new Base[0] : new Base[] {this.born}; // Type - case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Type - case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // Type - case 3387378: /*note*/ return this.note == null ? new Base[0] : new Base[] {this.note}; // Annotation - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : this.condition.toArray(new Base[this.condition.size()]); // FamilyMemberHistoryConditionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -892481550: // status - this.status = new FamilyHistoryStatusEnumFactory().fromType(value); // Enumeration - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -261851592: // relationship - this.relationship = castToCodeableConcept(value); // CodeableConcept - break; - case -1249512767: // gender - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - break; - case 3029833: // born - this.born = (Type) value; // Type - break; - case 96511: // age - this.age = (Type) value; // Type - break; - case 561497972: // deceased - this.deceased = (Type) value; // Type - break; - case 3387378: // note - this.note = castToAnnotation(value); // Annotation - break; - case -861311717: // condition - this.getCondition().add((FamilyMemberHistoryConditionComponent) value); // FamilyMemberHistoryConditionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("status")) - this.status = new FamilyHistoryStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("relationship")) - this.relationship = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("gender")) - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - else if (name.equals("born[x]")) - this.born = (Type) value; // Type - else if (name.equals("age[x]")) - this.age = (Type) value; // Type - else if (name.equals("deceased[x]")) - this.deceased = (Type) value; // Type - else if (name.equals("note")) - this.note = castToAnnotation(value); // Annotation - else if (name.equals("condition")) - this.getCondition().add((FamilyMemberHistoryConditionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -791418107: return getPatient(); // Reference - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -261851592: return getRelationship(); // CodeableConcept - case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration - case 67532951: return getBorn(); // Type - case -1419716831: return getAge(); // Type - case -1311442804: return getDeceased(); // Type - case 3387378: return getNote(); // Annotation - case -861311717: return addCondition(); // FamilyMemberHistoryConditionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.date"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.status"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.name"); - } - else if (name.equals("relationship")) { - this.relationship = new CodeableConcept(); - return this.relationship; - } - else if (name.equals("gender")) { - throw new FHIRException("Cannot call addChild on a primitive type FamilyMemberHistory.gender"); - } - else if (name.equals("bornPeriod")) { - this.born = new Period(); - return this.born; - } - else if (name.equals("bornDate")) { - this.born = new DateType(); - return this.born; - } - else if (name.equals("bornString")) { - this.born = new StringType(); - return this.born; - } - else if (name.equals("ageAge")) { - this.age = new Age(); - return this.age; - } - else if (name.equals("ageRange")) { - this.age = new Range(); - return this.age; - } - else if (name.equals("ageString")) { - this.age = new StringType(); - return this.age; - } - else if (name.equals("deceasedBoolean")) { - this.deceased = new BooleanType(); - return this.deceased; - } - else if (name.equals("deceasedAge")) { - this.deceased = new Age(); - return this.deceased; - } - else if (name.equals("deceasedRange")) { - this.deceased = new Range(); - return this.deceased; - } - else if (name.equals("deceasedDate")) { - this.deceased = new DateType(); - return this.deceased; - } - else if (name.equals("deceasedString")) { - this.deceased = new StringType(); - return this.deceased; - } - else if (name.equals("note")) { - this.note = new Annotation(); - return this.note; - } - else if (name.equals("condition")) { - return addCondition(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "FamilyMemberHistory"; - - } - - public FamilyMemberHistory copy() { - FamilyMemberHistory dst = new FamilyMemberHistory(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.date = date == null ? null : date.copy(); - dst.status = status == null ? null : status.copy(); - dst.name = name == null ? null : name.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.gender = gender == null ? null : gender.copy(); - dst.born = born == null ? null : born.copy(); - dst.age = age == null ? null : age.copy(); - dst.deceased = deceased == null ? null : deceased.copy(); - dst.note = note == null ? null : note.copy(); - if (condition != null) { - dst.condition = new ArrayList(); - for (FamilyMemberHistoryConditionComponent i : condition) - dst.condition.add(i.copy()); - }; - return dst; - } - - protected FamilyMemberHistory typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FamilyMemberHistory)) - return false; - FamilyMemberHistory o = (FamilyMemberHistory) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(date, o.date, true) - && compareDeep(status, o.status, true) && compareDeep(name, o.name, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(gender, o.gender, true) && compareDeep(born, o.born, true) && compareDeep(age, o.age, true) - && compareDeep(deceased, o.deceased, true) && compareDeep(note, o.note, true) && compareDeep(condition, o.condition, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FamilyMemberHistory)) - return false; - FamilyMemberHistory o = (FamilyMemberHistory) other; - return compareValues(date, o.date, true) && compareValues(status, o.status, true) && compareValues(name, o.name, true) - && compareValues(gender, o.gender, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (date == null || date.isEmpty()) && (status == null || status.isEmpty()) && (name == null || name.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (gender == null || gender.isEmpty()) - && (born == null || born.isEmpty()) && (age == null || age.isEmpty()) && (deceased == null || deceased.isEmpty()) - && (note == null || note.isEmpty()) && (condition == null || condition.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.FamilyMemberHistory; - } - - /** - * Search parameter: relationship - *

- * Description: A search by a relationship type
- * Type: token
- * Path: FamilyMemberHistory.relationship
- *

- */ - @SearchParamDefinition(name="relationship", path="FamilyMemberHistory.relationship", description="A search by a relationship type", type="token" ) - public static final String SP_RELATIONSHIP = "relationship"; - /** - * Fluent Client search parameter constant for relationship - *

- * Description: A search by a relationship type
- * Type: token
- * Path: FamilyMemberHistory.relationship
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATIONSHIP = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATIONSHIP); - - /** - * Search parameter: patient - *

- * Description: The identity of a subject to list family member history items for
- * Type: reference
- * Path: FamilyMemberHistory.patient
- *

- */ - @SearchParamDefinition(name="patient", path="FamilyMemberHistory.patient", description="The identity of a subject to list family member history items for", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of a subject to list family member history items for
- * Type: reference
- * Path: FamilyMemberHistory.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "FamilyMemberHistory:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("FamilyMemberHistory:patient").toLocked(); - - /** - * Search parameter: gender - *

- * Description: A search by a gender code of a family member
- * Type: token
- * Path: FamilyMemberHistory.gender
- *

- */ - @SearchParamDefinition(name="gender", path="FamilyMemberHistory.gender", description="A search by a gender code of a family member", type="token" ) - public static final String SP_GENDER = "gender"; - /** - * Fluent Client search parameter constant for gender - *

- * Description: A search by a gender code of a family member
- * Type: token
- * Path: FamilyMemberHistory.gender
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); - - /** - * Search parameter: code - *

- * Description: A search by a condition code
- * Type: token
- * Path: FamilyMemberHistory.condition.code
- *

- */ - @SearchParamDefinition(name="code", path="FamilyMemberHistory.condition.code", description="A search by a condition code", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: A search by a condition code
- * Type: token
- * Path: FamilyMemberHistory.condition.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: When history was captured/updated
- * Type: date
- * Path: FamilyMemberHistory.date
- *

- */ - @SearchParamDefinition(name="date", path="FamilyMemberHistory.date", description="When history was captured/updated", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When history was captured/updated
- * Type: date
- * Path: FamilyMemberHistory.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: A search by a record identifier
- * Type: token
- * Path: FamilyMemberHistory.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="FamilyMemberHistory.identifier", description="A search by a record identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A search by a record identifier
- * Type: token
- * Path: FamilyMemberHistory.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Flag.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Flag.java deleted file mode 100644 index 1949e310292..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Flag.java +++ /dev/null @@ -1,841 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * Prospective warnings of potential issues when providing care to the patient. - */ -@ResourceDef(name="Flag", profile="http://hl7.org/fhir/Profile/Flag") -public class Flag extends DomainResource { - - public enum FlagStatus { - /** - * A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag. - */ - ACTIVE, - /** - * The flag does not need to be displayed any more. - */ - INACTIVE, - /** - * The flag was added in error, and should no longer be displayed. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static FlagStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("inactive".equals(codeString)) - return INACTIVE; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown FlagStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return "http://hl7.org/fhir/flag-status"; - case INACTIVE: return "http://hl7.org/fhir/flag-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/flag-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "A current flag that should be displayed to a user. A system may use the category to determine which roles should view the flag."; - case INACTIVE: return "The flag does not need to be displayed any more."; - case ENTEREDINERROR: return "The flag was added in error, and should no longer be displayed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case INACTIVE: return "Inactive"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class FlagStatusEnumFactory implements EnumFactory { - public FlagStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return FlagStatus.ACTIVE; - if ("inactive".equals(codeString)) - return FlagStatus.INACTIVE; - if ("entered-in-error".equals(codeString)) - return FlagStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown FlagStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return new Enumeration(this, FlagStatus.ACTIVE); - if ("inactive".equals(codeString)) - return new Enumeration(this, FlagStatus.INACTIVE); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, FlagStatus.ENTEREDINERROR); - throw new FHIRException("Unknown FlagStatus code '"+codeString+"'"); - } - public String toCode(FlagStatus code) { - if (code == FlagStatus.ACTIVE) - return "active"; - if (code == FlagStatus.INACTIVE) - return "inactive"; - if (code == FlagStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(FlagStatus code) { - return code.getSystem(); - } - } - - /** - * Identifier assigned to the flag for external use (outside the FHIR environment). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier assigned to the flag for external use (outside the FHIR environment)." ) - protected List identifier; - - /** - * Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Clinical, administrative, etc.", formalDefinition="Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context." ) - protected CodeableConcept category; - - /** - * Supports basic workflow. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | inactive | entered-in-error", formalDefinition="Supports basic workflow." ) - protected Enumeration status; - - /** - * The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period when flag is active", formalDefinition="The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified." ) - protected Period period; - - /** - * The patient, location, group , organization , or practitioner this is about record this flag is associated with. - */ - @Child(name = "subject", type = {Patient.class, Location.class, Group.class, Organization.class, Practitioner.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who/What is flag about?", formalDefinition="The patient, location, group , organization , or practitioner this is about record this flag is associated with." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) - */ - protected Resource subjectTarget; - - /** - * This alert is only relevant during the encounter. - */ - @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Alert relevant during encounter", formalDefinition="This alert is only relevant during the encounter." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (This alert is only relevant during the encounter.) - */ - protected Encounter encounterTarget; - - /** - * The person, organization or device that created the flag. - */ - @Child(name = "author", type = {Device.class, Organization.class, Patient.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Flag creator", formalDefinition="The person, organization or device that created the flag." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (The person, organization or device that created the flag.) - */ - protected Resource authorTarget; - - /** - * The coded value or textual component of the flag to display to the user. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Partially deaf, Requires easy open caps, No permanent address, etc.", formalDefinition="The coded value or textual component of the flag to display to the user." ) - protected CodeableConcept code; - - private static final long serialVersionUID = 701147751L; - - /** - * Constructor - */ - public Flag() { - super(); - } - - /** - * Constructor - */ - public Flag(Enumeration status, Reference subject, CodeableConcept code) { - super(); - this.status = status; - this.subject = subject; - this.code = code; - } - - /** - * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier assigned to the flag for external use (outside the FHIR environment).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Flag addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.) - */ - public Flag setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new FlagStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Supports basic workflow.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Flag setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Supports basic workflow. - */ - public FlagStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Supports basic workflow. - */ - public Flag setStatus(FlagStatus value) { - if (this.status == null) - this.status = new Enumeration(new FlagStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.) - */ - public Flag setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #subject} (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) - */ - public Flag setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient, location, group , organization , or practitioner this is about record this flag is associated with.) - */ - public Flag setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #encounter} (This alert is only relevant during the encounter.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (This alert is only relevant during the encounter.) - */ - public Flag setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This alert is only relevant during the encounter.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (This alert is only relevant during the encounter.) - */ - public Flag setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #author} (The person, organization or device that created the flag.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (The person, organization or device that created the flag.) - */ - public Flag setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization or device that created the flag.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization or device that created the flag.) - */ - public Flag setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #code} (The coded value or textual component of the flag to display to the user.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Flag.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The coded value or textual component of the flag to display to the user.) - */ - public Flag setCode(CodeableConcept value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned to the flag for external use (outside the FHIR environment).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "Allows an flag to be divided into different categories like clinical, administrative etc. Intended to be used as a means of filtering which flags are displayed to particular user or in a given context.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("status", "code", "Supports basic workflow.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("period", "Period", "The period of time from the activation of the flag to inactivation of the flag. If the flag is active, the end of the period should be unspecified.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("subject", "Reference(Patient|Location|Group|Organization|Practitioner)", "The patient, location, group , organization , or practitioner this is about record this flag is associated with.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "This alert is only relevant during the encounter.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("author", "Reference(Device|Organization|Patient|Practitioner)", "The person, organization or device that created the flag.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("code", "CodeableConcept", "The coded value or textual component of the flag to display to the user.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case -892481550: // status - this.status = new FlagStatusEnumFactory().fromType(value); // Enumeration - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("status")) - this.status = new FlagStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 50511102: return getCategory(); // CodeableConcept - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -991726143: return getPeriod(); // Period - case -1867885268: return getSubject(); // Reference - case 1524132147: return getEncounter(); // Reference - case -1406328437: return getAuthor(); // Reference - case 3059181: return getCode(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Flag.status"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Flag"; - - } - - public Flag copy() { - Flag dst = new Flag(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.category = category == null ? null : category.copy(); - dst.status = status == null ? null : status.copy(); - dst.period = period == null ? null : period.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.author = author == null ? null : author.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Flag typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Flag)) - return false; - Flag o = (Flag) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(status, o.status, true) - && compareDeep(period, o.period, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(author, o.author, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Flag)) - return false; - Flag o = (Flag) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (status == null || status.isEmpty()) && (period == null || period.isEmpty()) && (subject == null || subject.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (author == null || author.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Flag; - } - - /** - * Search parameter: author - *

- * Description: Flag creator
- * Type: reference
- * Path: Flag.author
- *

- */ - @SearchParamDefinition(name="author", path="Flag.author", description="Flag creator", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Flag creator
- * Type: reference
- * Path: Flag.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Flag:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Flag:author").toLocked(); - - /** - * Search parameter: patient - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Flag:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Flag:patient").toLocked(); - - /** - * Search parameter: subject - *

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

- */ - @SearchParamDefinition(name="subject", path="Flag.subject", description="The identity of a subject to list flags 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 flags for
- * Type: reference
- * Path: Flag.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Flag:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Flag:subject").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Alert relevant during encounter
- * Type: reference
- * Path: Flag.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Flag.encounter", description="Alert relevant during encounter", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Alert relevant during encounter
- * Type: reference
- * Path: Flag.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Flag:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Flag:encounter").toLocked(); - - /** - * Search parameter: date - *

- * Description: Time period when flag is active
- * Type: date
- * Path: Flag.period
- *

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

- * Description: Time period when flag is active
- * Type: date
- * Path: Flag.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Goal.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Goal.java deleted file mode 100644 index 4c74e20f3b0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Goal.java +++ /dev/null @@ -1,1532 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. - */ -@ResourceDef(name="Goal", profile="http://hl7.org/fhir/Profile/Goal") -public class Goal extends DomainResource { - - public enum GoalStatus { - /** - * A goal is proposed for this patient - */ - PROPOSED, - /** - * A goal is planned for this patient - */ - PLANNED, - /** - * A proposed goal was accepted - */ - ACCEPTED, - /** - * A proposed goal was rejected - */ - REJECTED, - /** - * The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again) - */ - INPROGRESS, - /** - * The goal has been met and no further action is needed - */ - ACHIEVED, - /** - * The goal has been met, but ongoing activity is needed to sustain the goal objective - */ - SUSTAINING, - /** - * The goal remains a long term objective but is no longer being actively pursued for a temporary period of time. - */ - ONHOLD, - /** - * The goal is no longer being sought - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static GoalStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("planned".equals(codeString)) - return PLANNED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("achieved".equals(codeString)) - return ACHIEVED; - if ("sustaining".equals(codeString)) - return SUSTAINING; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new FHIRException("Unknown GoalStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case PLANNED: return "planned"; - case ACCEPTED: return "accepted"; - case REJECTED: return "rejected"; - case INPROGRESS: return "in-progress"; - case ACHIEVED: return "achieved"; - case SUSTAINING: return "sustaining"; - case ONHOLD: return "on-hold"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/goal-status"; - case PLANNED: return "http://hl7.org/fhir/goal-status"; - case ACCEPTED: return "http://hl7.org/fhir/goal-status"; - case REJECTED: return "http://hl7.org/fhir/goal-status"; - case INPROGRESS: return "http://hl7.org/fhir/goal-status"; - case ACHIEVED: return "http://hl7.org/fhir/goal-status"; - case SUSTAINING: return "http://hl7.org/fhir/goal-status"; - case ONHOLD: return "http://hl7.org/fhir/goal-status"; - case CANCELLED: return "http://hl7.org/fhir/goal-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "A goal is proposed for this patient"; - case PLANNED: return "A goal is planned for this patient"; - case ACCEPTED: return "A proposed goal was accepted"; - case REJECTED: return "A proposed goal was rejected"; - case INPROGRESS: return "The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there has been regression and goal is being sought again)"; - case ACHIEVED: return "The goal has been met and no further action is needed"; - case SUSTAINING: return "The goal has been met, but ongoing activity is needed to sustain the goal objective"; - case ONHOLD: return "The goal remains a long term objective but is no longer being actively pursued for a temporary period of time."; - case CANCELLED: return "The goal is no longer being sought"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case PLANNED: return "Planned"; - case ACCEPTED: return "Accepted"; - case REJECTED: return "Rejected"; - case INPROGRESS: return "In Progress"; - case ACHIEVED: return "Achieved"; - case SUSTAINING: return "Sustaining"; - case ONHOLD: return "On Hold"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class GoalStatusEnumFactory implements EnumFactory { - public GoalStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return GoalStatus.PROPOSED; - if ("planned".equals(codeString)) - return GoalStatus.PLANNED; - if ("accepted".equals(codeString)) - return GoalStatus.ACCEPTED; - if ("rejected".equals(codeString)) - return GoalStatus.REJECTED; - if ("in-progress".equals(codeString)) - return GoalStatus.INPROGRESS; - if ("achieved".equals(codeString)) - return GoalStatus.ACHIEVED; - if ("sustaining".equals(codeString)) - return GoalStatus.SUSTAINING; - if ("on-hold".equals(codeString)) - return GoalStatus.ONHOLD; - if ("cancelled".equals(codeString)) - return GoalStatus.CANCELLED; - throw new IllegalArgumentException("Unknown GoalStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, GoalStatus.PROPOSED); - if ("planned".equals(codeString)) - return new Enumeration(this, GoalStatus.PLANNED); - if ("accepted".equals(codeString)) - return new Enumeration(this, GoalStatus.ACCEPTED); - if ("rejected".equals(codeString)) - return new Enumeration(this, GoalStatus.REJECTED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, GoalStatus.INPROGRESS); - if ("achieved".equals(codeString)) - return new Enumeration(this, GoalStatus.ACHIEVED); - if ("sustaining".equals(codeString)) - return new Enumeration(this, GoalStatus.SUSTAINING); - if ("on-hold".equals(codeString)) - return new Enumeration(this, GoalStatus.ONHOLD); - if ("cancelled".equals(codeString)) - return new Enumeration(this, GoalStatus.CANCELLED); - throw new FHIRException("Unknown GoalStatus code '"+codeString+"'"); - } - public String toCode(GoalStatus code) { - if (code == GoalStatus.PROPOSED) - return "proposed"; - if (code == GoalStatus.PLANNED) - return "planned"; - if (code == GoalStatus.ACCEPTED) - return "accepted"; - if (code == GoalStatus.REJECTED) - return "rejected"; - if (code == GoalStatus.INPROGRESS) - return "in-progress"; - if (code == GoalStatus.ACHIEVED) - return "achieved"; - if (code == GoalStatus.SUSTAINING) - return "sustaining"; - if (code == GoalStatus.ONHOLD) - return "on-hold"; - if (code == GoalStatus.CANCELLED) - return "cancelled"; - return "?"; - } - public String toSystem(GoalStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class GoalOutcomeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Details of what's changed (or not changed). - */ - @Child(name = "result", type = {CodeableConcept.class, Observation.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code or observation that resulted from goal", formalDefinition="Details of what's changed (or not changed)." ) - protected Type result; - - private static final long serialVersionUID = 1994317639L; - - /** - * Constructor - */ - public GoalOutcomeComponent() { - super(); - } - - /** - * @return {@link #result} (Details of what's changed (or not changed).) - */ - public Type getResult() { - return this.result; - } - - /** - * @return {@link #result} (Details of what's changed (or not changed).) - */ - public CodeableConcept getResultCodeableConcept() throws FHIRException { - if (!(this.result instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.result.getClass().getName()+" was encountered"); - return (CodeableConcept) this.result; - } - - public boolean hasResultCodeableConcept() { - return this.result instanceof CodeableConcept; - } - - /** - * @return {@link #result} (Details of what's changed (or not changed).) - */ - public Reference getResultReference() throws FHIRException { - if (!(this.result instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.result.getClass().getName()+" was encountered"); - return (Reference) this.result; - } - - public boolean hasResultReference() { - return this.result instanceof Reference; - } - - public boolean hasResult() { - return this.result != null && !this.result.isEmpty(); - } - - /** - * @param value {@link #result} (Details of what's changed (or not changed).) - */ - public GoalOutcomeComponent setResult(Type value) { - this.result = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("result[x]", "CodeableConcept|Reference(Observation)", "Details of what's changed (or not changed).", 0, java.lang.Integer.MAX_VALUE, result)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -934426595: /*result*/ return this.result == null ? new Base[0] : new Base[] {this.result}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -934426595: // result - this.result = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("result[x]")) - this.result = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1819555005: return getResult(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("resultCodeableConcept")) { - this.result = new CodeableConcept(); - return this.result; - } - else if (name.equals("resultReference")) { - this.result = new Reference(); - return this.result; - } - else - return super.addChild(name); - } - - public GoalOutcomeComponent copy() { - GoalOutcomeComponent dst = new GoalOutcomeComponent(); - copyValues(dst); - dst.result = result == null ? null : result.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GoalOutcomeComponent)) - return false; - GoalOutcomeComponent o = (GoalOutcomeComponent) other; - return compareDeep(result, o.result, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GoalOutcomeComponent)) - return false; - GoalOutcomeComponent o = (GoalOutcomeComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (result == null || result.isEmpty()); - } - - public String fhirType() { - return "Goal.outcome"; - - } - - } - - /** - * This records identifiers associated with this care plan 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="External Ids for this goal", formalDefinition="This records identifiers associated with this care plan 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)." ) - protected List identifier; - - /** - * Identifies the patient, group or organization for whom the goal is being established. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Organization.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who this goal is intended for", formalDefinition="Identifies the patient, group or organization for whom the goal is being established." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Identifies the patient, group or organization for whom the goal is being established.) - */ - protected Resource subjectTarget; - - /** - * The date or event after which the goal should begin being pursued. - */ - @Child(name = "start", type = {DateType.class, CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When goal pursuit begins", formalDefinition="The date or event after which the goal should begin being pursued." ) - protected Type start; - - /** - * Indicates either the date or the duration after start by which the goal should be met. - */ - @Child(name = "target", type = {DateType.class, Duration.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reach goal on or before", formalDefinition="Indicates either the date or the duration after start by which the goal should be met." ) - protected Type target; - - /** - * Indicates a category the goal falls within. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="E.g. Treatment, dietary, behavioral, etc.", formalDefinition="Indicates a category the goal falls within." ) - protected List category; - - /** - * Human-readable description of a specific desired objective of care. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="What's the desired outcome?", formalDefinition="Human-readable description of a specific desired objective of care." ) - protected StringType description; - - /** - * Indicates whether the goal has been reached and is still considered relevant. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled", formalDefinition="Indicates whether the goal has been reached and is still considered relevant." ) - protected Enumeration status; - - /** - * Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. - */ - @Child(name = "statusDate", type = {DateType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When goal status took effect", formalDefinition="Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc." ) - protected DateType statusDate; - - /** - * Captures the reason for the current status. - */ - @Child(name = "statusReason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reason for current status", formalDefinition="Captures the reason for the current status." ) - protected CodeableConcept statusReason; - - /** - * Indicates whose goal this is - patient goal, practitioner goal, etc. - */ - @Child(name = "author", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who's responsible for creating Goal?", formalDefinition="Indicates whose goal this is - patient goal, practitioner goal, etc." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - protected Resource authorTarget; - - /** - * Identifies the mutually agreed level of importance associated with reaching/sustaining the goal. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="high | medium |low", formalDefinition="Identifies the mutually agreed level of importance associated with reaching/sustaining the goal." ) - protected CodeableConcept priority; - - /** - * The identified conditions and other health record elements that are intended to be addressed by the goal. - */ - @Child(name = "addresses", type = {Condition.class, Observation.class, MedicationStatement.class, NutritionOrder.class, ProcedureRequest.class, RiskAssessment.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Issues addressed by this goal", formalDefinition="The identified conditions and other health record elements that are intended to be addressed by the goal." ) - protected List addresses; - /** - * The actual objects that are the target of the reference (The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - protected List addressesTarget; - - - /** - * Any comments related to the goal. - */ - @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Comments about the goal", formalDefinition="Any comments related to the goal." ) - protected List note; - - /** - * Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved. - */ - @Child(name = "outcome", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="What was end result of goal?", formalDefinition="Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved." ) - protected List outcome; - - private static final long serialVersionUID = 2029459056L; - - /** - * Constructor - */ - public Goal() { - super(); - } - - /** - * Constructor - */ - public Goal(StringType description, Enumeration status) { - super(); - this.description = description; - this.status = status; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this care plan 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Goal addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Identifies the patient, group or organization for whom the goal is being established.) - */ - public Goal setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the patient, group or organization for whom the goal is being established.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the patient, group or organization for whom the goal is being established.) - */ - public Goal setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #start} (The date or event after which the goal should begin being pursued.) - */ - public Type getStart() { - return this.start; - } - - /** - * @return {@link #start} (The date or event after which the goal should begin being pursued.) - */ - public DateType getStartDateType() throws FHIRException { - if (!(this.start instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.start.getClass().getName()+" was encountered"); - return (DateType) this.start; - } - - public boolean hasStartDateType() { - return this.start instanceof DateType; - } - - /** - * @return {@link #start} (The date or event after which the goal should begin being pursued.) - */ - public CodeableConcept getStartCodeableConcept() throws FHIRException { - if (!(this.start instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.start.getClass().getName()+" was encountered"); - return (CodeableConcept) this.start; - } - - public boolean hasStartCodeableConcept() { - return this.start instanceof CodeableConcept; - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (The date or event after which the goal should begin being pursued.) - */ - public Goal setStart(Type value) { - this.start = value; - return this; - } - - /** - * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) - */ - public DateType getTargetDateType() throws FHIRException { - if (!(this.target instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.target.getClass().getName()+" was encountered"); - return (DateType) this.target; - } - - public boolean hasTargetDateType() { - return this.target instanceof DateType; - } - - /** - * @return {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) - */ - public Duration getTargetDuration() throws FHIRException { - if (!(this.target instanceof Duration)) - throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Duration) this.target; - } - - public boolean hasTargetDuration() { - return this.target instanceof Duration; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Indicates either the date or the duration after start by which the goal should be met.) - */ - public Goal setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #category} (Indicates a category the goal falls within.) - */ - public List getCategory() { - if (this.category == null) - this.category = new ArrayList(); - return this.category; - } - - public boolean hasCategory() { - if (this.category == null) - return false; - for (CodeableConcept item : this.category) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #category} (Indicates a category the goal falls within.) - */ - // syntactic sugar - public CodeableConcept addCategory() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return t; - } - - // syntactic sugar - public Goal addCategory(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return this; - } - - /** - * @return {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of a specific desired objective of care.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Goal setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of a specific desired objective of care. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of a specific desired objective of care. - */ - public Goal setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new GoalStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the goal has been reached and is still considered relevant.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Goal setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the goal has been reached and is still considered relevant. - */ - public GoalStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the goal has been reached and is still considered relevant. - */ - public Goal setStatus(GoalStatus value) { - if (this.status == null) - this.status = new Enumeration(new GoalStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public DateType getStatusDateElement() { - if (this.statusDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.statusDate"); - else if (Configuration.doAutoCreate()) - this.statusDate = new DateType(); // bb - return this.statusDate; - } - - public boolean hasStatusDateElement() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - public boolean hasStatusDate() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - /** - * @param value {@link #statusDate} (Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public Goal setStatusDateElement(DateType value) { - this.statusDate = value; - return this; - } - - /** - * @return Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. - */ - public Date getStatusDate() { - return this.statusDate == null ? null : this.statusDate.getValue(); - } - - /** - * @param value Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc. - */ - public Goal setStatusDate(Date value) { - if (value == null) - this.statusDate = null; - else { - if (this.statusDate == null) - this.statusDate = new DateType(); - this.statusDate.setValue(value); - } - return this; - } - - /** - * @return {@link #statusReason} (Captures the reason for the current status.) - */ - public CodeableConcept getStatusReason() { - if (this.statusReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.statusReason"); - else if (Configuration.doAutoCreate()) - this.statusReason = new CodeableConcept(); // cc - return this.statusReason; - } - - public boolean hasStatusReason() { - return this.statusReason != null && !this.statusReason.isEmpty(); - } - - /** - * @param value {@link #statusReason} (Captures the reason for the current status.) - */ - public Goal setStatusReason(CodeableConcept value) { - this.statusReason = value; - return this; - } - - /** - * @return {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Goal setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates whose goal this is - patient goal, practitioner goal, etc.) - */ - public Goal setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Goal.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.) - */ - public Goal setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - public List getAddresses() { - if (this.addresses == null) - this.addresses = new ArrayList(); - return this.addresses; - } - - public boolean hasAddresses() { - if (this.addresses == null) - return false; - for (Reference item : this.addresses) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #addresses} (The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - // syntactic sugar - public Reference addAddresses() { //3 - Reference t = new Reference(); - if (this.addresses == null) - this.addresses = new ArrayList(); - this.addresses.add(t); - return t; - } - - // syntactic sugar - public Goal addAddresses(Reference t) { //3 - if (t == null) - return this; - if (this.addresses == null) - this.addresses = new ArrayList(); - this.addresses.add(t); - return this; - } - - /** - * @return {@link #addresses} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The identified conditions and other health record elements that are intended to be addressed by the goal.) - */ - public List getAddressesTarget() { - if (this.addressesTarget == null) - this.addressesTarget = new ArrayList(); - return this.addressesTarget; - } - - /** - * @return {@link #note} (Any comments related to the goal.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Any comments related to the goal.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public Goal addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) - */ - public List getOutcome() { - if (this.outcome == null) - this.outcome = new ArrayList(); - return this.outcome; - } - - public boolean hasOutcome() { - if (this.outcome == null) - return false; - for (GoalOutcomeComponent item : this.outcome) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #outcome} (Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.) - */ - // syntactic sugar - public GoalOutcomeComponent addOutcome() { //3 - GoalOutcomeComponent t = new GoalOutcomeComponent(); - if (this.outcome == null) - this.outcome = new ArrayList(); - this.outcome.add(t); - return t; - } - - // syntactic sugar - public Goal addOutcome(GoalOutcomeComponent t) { //3 - if (t == null) - return this; - if (this.outcome == null) - this.outcome = new ArrayList(); - this.outcome.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this care plan 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Organization)", "Identifies the patient, group or organization for whom the goal is being established.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("start[x]", "date|CodeableConcept", "The date or event after which the goal should begin being pursued.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("target[x]", "date|Duration", "Indicates either the date or the duration after start by which the goal should be met.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("category", "CodeableConcept", "Indicates a category the goal falls within.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("description", "string", "Human-readable description of a specific desired objective of care.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("status", "code", "Indicates whether the goal has been reached and is still considered relevant.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("statusDate", "date", "Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.", 0, java.lang.Integer.MAX_VALUE, statusDate)); - childrenList.add(new Property("statusReason", "CodeableConcept", "Captures the reason for the current status.", 0, java.lang.Integer.MAX_VALUE, statusReason)); - childrenList.add(new Property("author", "Reference(Patient|Practitioner|RelatedPerson)", "Indicates whose goal this is - patient goal, practitioner goal, etc.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("priority", "CodeableConcept", "Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("addresses", "Reference(Condition|Observation|MedicationStatement|NutritionOrder|ProcedureRequest|RiskAssessment)", "The identified conditions and other health record elements that are intended to be addressed by the goal.", 0, java.lang.Integer.MAX_VALUE, addresses)); - childrenList.add(new Property("note", "Annotation", "Any comments related to the goal.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("outcome", "", "Identifies the change (or lack of change) at the point where the goal was deepmed to be cancelled or achieved.", 0, java.lang.Integer.MAX_VALUE, outcome)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // Type - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type - case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType - case 2051346646: /*statusReason*/ return this.statusReason == null ? new Base[0] : new Base[] {this.statusReason}; // CodeableConcept - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept - case 874544034: /*addresses*/ return this.addresses == null ? new Base[0] : this.addresses.toArray(new Base[this.addresses.size()]); // Reference - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : this.outcome.toArray(new Base[this.outcome.size()]); // GoalOutcomeComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 109757538: // start - this.start = (Type) value; // Type - break; - case -880905839: // target - this.target = (Type) value; // Type - break; - case 50511102: // category - this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -892481550: // status - this.status = new GoalStatusEnumFactory().fromType(value); // Enumeration - break; - case 247524032: // statusDate - this.statusDate = castToDate(value); // DateType - break; - case 2051346646: // statusReason - this.statusReason = castToCodeableConcept(value); // CodeableConcept - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case -1165461084: // priority - this.priority = castToCodeableConcept(value); // CodeableConcept - break; - case 874544034: // addresses - this.getAddresses().add(castToReference(value)); // Reference - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -1106507950: // outcome - this.getOutcome().add((GoalOutcomeComponent) value); // GoalOutcomeComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("start[x]")) - this.start = (Type) value; // Type - else if (name.equals("target[x]")) - this.target = (Type) value; // Type - else if (name.equals("category")) - this.getCategory().add(castToCodeableConcept(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("status")) - this.status = new GoalStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("statusDate")) - this.statusDate = castToDate(value); // DateType - else if (name.equals("statusReason")) - this.statusReason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("priority")) - this.priority = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("addresses")) - this.getAddresses().add(castToReference(value)); - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("outcome")) - this.getOutcome().add((GoalOutcomeComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1867885268: return getSubject(); // Reference - case 1316793566: return getStart(); // Type - case -815579825: return getTarget(); // Type - case 50511102: return addCategory(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType - case 2051346646: return getStatusReason(); // CodeableConcept - case -1406328437: return getAuthor(); // Reference - case -1165461084: return getPriority(); // CodeableConcept - case 874544034: return addAddresses(); // Reference - case 3387378: return addNote(); // Annotation - case -1106507950: return addOutcome(); // GoalOutcomeComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("startDate")) { - this.start = new DateType(); - return this.start; - } - else if (name.equals("startCodeableConcept")) { - this.start = new CodeableConcept(); - return this.start; - } - else if (name.equals("targetDate")) { - this.target = new DateType(); - return this.target; - } - else if (name.equals("targetDuration")) { - this.target = new Duration(); - return this.target; - } - else if (name.equals("category")) { - return addCategory(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Goal.description"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Goal.status"); - } - else if (name.equals("statusDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Goal.statusDate"); - } - else if (name.equals("statusReason")) { - this.statusReason = new CodeableConcept(); - return this.statusReason; - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("priority")) { - this.priority = new CodeableConcept(); - return this.priority; - } - else if (name.equals("addresses")) { - return addAddresses(); - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("outcome")) { - return addOutcome(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Goal"; - - } - - public Goal copy() { - Goal dst = new Goal(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.start = start == null ? null : start.copy(); - dst.target = target == null ? null : target.copy(); - if (category != null) { - dst.category = new ArrayList(); - for (CodeableConcept i : category) - dst.category.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.status = status == null ? null : status.copy(); - dst.statusDate = statusDate == null ? null : statusDate.copy(); - dst.statusReason = statusReason == null ? null : statusReason.copy(); - dst.author = author == null ? null : author.copy(); - dst.priority = priority == null ? null : priority.copy(); - if (addresses != null) { - dst.addresses = new ArrayList(); - for (Reference i : addresses) - dst.addresses.add(i.copy()); - }; - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - if (outcome != null) { - dst.outcome = new ArrayList(); - for (GoalOutcomeComponent i : outcome) - dst.outcome.add(i.copy()); - }; - return dst; - } - - protected Goal typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Goal)) - return false; - Goal o = (Goal) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(start, o.start, true) - && compareDeep(target, o.target, true) && compareDeep(category, o.category, true) && compareDeep(description, o.description, true) - && compareDeep(status, o.status, true) && compareDeep(statusDate, o.statusDate, true) && compareDeep(statusReason, o.statusReason, true) - && compareDeep(author, o.author, true) && compareDeep(priority, o.priority, true) && compareDeep(addresses, o.addresses, true) - && compareDeep(note, o.note, true) && compareDeep(outcome, o.outcome, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Goal)) - return false; - Goal o = (Goal) other; - return compareValues(description, o.description, true) && compareValues(status, o.status, true) && compareValues(statusDate, o.statusDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (start == null || start.isEmpty()) && (target == null || target.isEmpty()) && (category == null || category.isEmpty()) - && (description == null || description.isEmpty()) && (status == null || status.isEmpty()) - && (statusDate == null || statusDate.isEmpty()) && (statusReason == null || statusReason.isEmpty()) - && (author == null || author.isEmpty()) && (priority == null || priority.isEmpty()) && (addresses == null || addresses.isEmpty()) - && (note == null || note.isEmpty()) && (outcome == null || outcome.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Goal; - } - - /** - * Search parameter: targetdate - *

- * Description: Reach goal on or before
- * Type: date
- * Path: Goal.targetDate
- *

- */ - @SearchParamDefinition(name="targetdate", path="Goal.target.as(Date)", description="Reach goal on or before", type="date" ) - public static final String SP_TARGETDATE = "targetdate"; - /** - * Fluent Client search parameter constant for targetdate - *

- * Description: Reach goal on or before
- * Type: date
- * Path: Goal.targetDate
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam TARGETDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TARGETDATE); - - /** - * Search parameter: category - *

- * Description: E.g. Treatment, dietary, behavioral, etc.
- * Type: token
- * Path: Goal.category
- *

- */ - @SearchParamDefinition(name="category", path="Goal.category", description="E.g. Treatment, dietary, behavioral, etc.", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: E.g. Treatment, dietary, behavioral, etc.
- * Type: token
- * Path: Goal.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: patient - *

- * Description: Who this goal is intended for
- * Type: reference
- * Path: Goal.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Goal.subject", description="Who this goal is intended for", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Who this goal is intended for
- * Type: reference
- * Path: Goal.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Goal:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Goal:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled
- * Type: token
- * Path: Goal.status
- *

- */ - @SearchParamDefinition(name="status", path="Goal.status", description="proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled
- * Type: token
- * Path: Goal.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: Who this goal is intended for
- * Type: reference
- * Path: Goal.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Goal.subject", description="Who this goal is intended for", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who this goal is intended for
- * Type: reference
- * Path: Goal.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Goal:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Goal:subject").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: External Ids for this goal
- * Type: token
- * Path: Goal.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Goal.identifier", description="External Ids for this goal", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: External Ids for this goal
- * Type: token
- * Path: Goal.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Group.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Group.java deleted file mode 100644 index bfb4b411a0d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Group.java +++ /dev/null @@ -1,1681 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * 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. - */ -@ResourceDef(name="Group", profile="http://hl7.org/fhir/Profile/Group") -public class Group extends DomainResource { - - public enum GroupType { - /** - * Group contains "person" Patient resources - */ - PERSON, - /** - * Group contains "animal" Patient resources - */ - ANIMAL, - /** - * Group contains healthcare practitioner resources - */ - PRACTITIONER, - /** - * Group contains Device resources - */ - DEVICE, - /** - * Group contains Medication resources - */ - MEDICATION, - /** - * Group contains Substance resources - */ - SUBSTANCE, - /** - * added to help the parsers - */ - NULL; - public static GroupType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("person".equals(codeString)) - return PERSON; - if ("animal".equals(codeString)) - return ANIMAL; - if ("practitioner".equals(codeString)) - return PRACTITIONER; - if ("device".equals(codeString)) - return DEVICE; - if ("medication".equals(codeString)) - return MEDICATION; - if ("substance".equals(codeString)) - return SUBSTANCE; - throw new FHIRException("Unknown GroupType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PERSON: return "person"; - case ANIMAL: return "animal"; - case PRACTITIONER: return "practitioner"; - case DEVICE: return "device"; - case MEDICATION: return "medication"; - case SUBSTANCE: return "substance"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PERSON: return "http://hl7.org/fhir/group-type"; - case ANIMAL: return "http://hl7.org/fhir/group-type"; - case PRACTITIONER: return "http://hl7.org/fhir/group-type"; - case DEVICE: return "http://hl7.org/fhir/group-type"; - case MEDICATION: return "http://hl7.org/fhir/group-type"; - case SUBSTANCE: return "http://hl7.org/fhir/group-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PERSON: return "Group contains \"person\" Patient resources"; - case ANIMAL: return "Group contains \"animal\" Patient resources"; - case PRACTITIONER: return "Group contains healthcare practitioner resources"; - case DEVICE: return "Group contains Device resources"; - case MEDICATION: return "Group contains Medication resources"; - case SUBSTANCE: return "Group contains Substance resources"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PERSON: return "Person"; - case ANIMAL: return "Animal"; - case PRACTITIONER: return "Practitioner"; - case DEVICE: return "Device"; - case MEDICATION: return "Medication"; - case SUBSTANCE: return "Substance"; - default: return "?"; - } - } - } - - public static class GroupTypeEnumFactory implements EnumFactory { - public GroupType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("person".equals(codeString)) - return GroupType.PERSON; - if ("animal".equals(codeString)) - return GroupType.ANIMAL; - if ("practitioner".equals(codeString)) - return GroupType.PRACTITIONER; - if ("device".equals(codeString)) - return GroupType.DEVICE; - if ("medication".equals(codeString)) - return GroupType.MEDICATION; - if ("substance".equals(codeString)) - return GroupType.SUBSTANCE; - throw new IllegalArgumentException("Unknown GroupType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("person".equals(codeString)) - return new Enumeration(this, GroupType.PERSON); - if ("animal".equals(codeString)) - return new Enumeration(this, GroupType.ANIMAL); - if ("practitioner".equals(codeString)) - return new Enumeration(this, GroupType.PRACTITIONER); - if ("device".equals(codeString)) - return new Enumeration(this, GroupType.DEVICE); - if ("medication".equals(codeString)) - return new Enumeration(this, GroupType.MEDICATION); - if ("substance".equals(codeString)) - return new Enumeration(this, GroupType.SUBSTANCE); - throw new FHIRException("Unknown GroupType code '"+codeString+"'"); - } - public String toCode(GroupType code) { - if (code == GroupType.PERSON) - return "person"; - if (code == GroupType.ANIMAL) - return "animal"; - if (code == GroupType.PRACTITIONER) - return "practitioner"; - if (code == GroupType.DEVICE) - return "device"; - if (code == GroupType.MEDICATION) - return "medication"; - if (code == GroupType.SUBSTANCE) - return "substance"; - return "?"; - } - public String toSystem(GroupType code) { - return code.getSystem(); - } - } - - @Block() - public static class GroupCharacteristicComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that identifies the kind of trait being asserted. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Kind of characteristic", formalDefinition="A code that identifies the kind of trait being asserted." ) - protected CodeableConcept code; - - /** - * The value of the trait that holds (or does not hold - see 'exclude') for members of the group. - */ - @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, Quantity.class, Range.class}, order=2, min=1, max=1, modifier=false, summary=false) - @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." ) - protected Type value; - - /** - * If true, indicates the characteristic is one that is NOT held by members of the group. - */ - @Child(name = "exclude", type = {BooleanType.class}, order=3, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="Group includes or excludes", formalDefinition="If true, indicates the characteristic is one that is NOT held by members of the group." ) - protected BooleanType exclude; - - /** - * The period over which the characteristic is tested; e.g. the patient had an operation during the month of June. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Period over which characteristic is tested", formalDefinition="The period over which the characteristic is tested; e.g. the patient had an operation during the month of June." ) - protected Period period; - - private static final long serialVersionUID = -1000688967L; - - /** - * Constructor - */ - public GroupCharacteristicComponent() { - super(); - } - - /** - * Constructor - */ - public GroupCharacteristicComponent(CodeableConcept code, Type value, BooleanType exclude) { - super(); - this.code = code; - this.value = value; - this.exclude = exclude; - } - - /** - * @return {@link #code} (A code that identifies the kind of trait being asserted.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code that identifies the kind of trait being asserted.) - */ - public GroupCharacteristicComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public CodeableConcept getValueCodeableConcept() throws FHIRException { - if (!(this.value instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - public boolean hasValueCodeableConcept() { - return this.value instanceof CodeableConcept; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public BooleanType getValueBooleanType() throws FHIRException { - if (!(this.value instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - public boolean hasValueBooleanType() { - return this.value instanceof BooleanType; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Quantity getValueQuantity() throws FHIRException { - if (!(this.value instanceof Quantity)) - throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - public boolean hasValueQuantity() { - return this.value instanceof Quantity; - } - - /** - * @return {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public Range getValueRange() throws FHIRException { - if (!(this.value instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - public boolean hasValueRange() { - return this.value instanceof Range; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the trait that holds (or does not hold - see 'exclude') for members of the group.) - */ - public GroupCharacteristicComponent setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value - */ - public BooleanType getExcludeElement() { - if (this.exclude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.exclude"); - else if (Configuration.doAutoCreate()) - this.exclude = new BooleanType(); // bb - return this.exclude; - } - - public boolean hasExcludeElement() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - public boolean hasExclude() { - return this.exclude != null && !this.exclude.isEmpty(); - } - - /** - * @param value {@link #exclude} (If true, indicates the characteristic is one that is NOT held by members of the group.). This is the underlying object with id, value and extensions. The accessor "getExclude" gives direct access to the value - */ - public GroupCharacteristicComponent setExcludeElement(BooleanType value) { - this.exclude = value; - return this; - } - - /** - * @return If true, indicates the characteristic is one that is NOT held by members of the group. - */ - public boolean getExclude() { - return this.exclude == null || this.exclude.isEmpty() ? false : this.exclude.getValue(); - } - - /** - * @param value If true, indicates the characteristic is one that is NOT held by members of the group. - */ - public GroupCharacteristicComponent setExclude(boolean value) { - if (this.exclude == null) - this.exclude = new BooleanType(); - this.exclude.setValue(value); - return this; - } - - /** - * @return {@link #period} (The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupCharacteristicComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.) - */ - public GroupCharacteristicComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code that identifies the kind of trait being asserted.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value[x]", "CodeableConcept|boolean|Quantity|Range", "The value of the trait that holds (or does not hold - see 'exclude') for members of the group.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("exclude", "boolean", "If true, indicates the characteristic is one that is NOT held by members of the group.", 0, java.lang.Integer.MAX_VALUE, exclude)); - childrenList.add(new Property("period", "Period", "The period over which the characteristic is tested; e.g. the patient had an operation during the month of June.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : new Base[] {this.exclude}; // BooleanType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - case -1321148966: // exclude - this.exclude = castToBoolean(value); // BooleanType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else if (name.equals("exclude")) - this.exclude = castToBoolean(value); // BooleanType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -1410166417: return getValue(); // Type - case -1321148966: throw new FHIRException("Cannot make property exclude as it is not a complex type"); // BooleanType - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("exclude")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.exclude"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public GroupCharacteristicComponent copy() { - GroupCharacteristicComponent dst = new GroupCharacteristicComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - dst.exclude = exclude == null ? null : exclude.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GroupCharacteristicComponent)) - return false; - GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(exclude, o.exclude, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GroupCharacteristicComponent)) - return false; - GroupCharacteristicComponent o = (GroupCharacteristicComponent) other; - return compareValues(exclude, o.exclude, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - && (exclude == null || exclude.isEmpty()) && (period == null || period.isEmpty()); - } - - public String fhirType() { - return "Group.characteristic"; - - } - - } - - @Block() - public static class GroupMemberComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A reference to the entity that is a member of the group. Must be consistent with Group.type. - */ - @Child(name = "entity", type = {Patient.class, Practitioner.class, Device.class, Medication.class, Substance.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reference to the group member", formalDefinition="A reference to the entity that is a member of the group. Must be consistent with Group.type." ) - protected Reference entity; - - /** - * The actual object that is the target of the reference (A reference to the entity that is a member of the group. Must be consistent with Group.type.) - */ - protected Resource entityTarget; - - /** - * The period that the member was in the group, if known. - */ - @Child(name = "period", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Period member belonged to the group", formalDefinition="The period that the member was in the group, if known." ) - protected Period period; - - /** - * A flag to indicate that the member is no longer in the group, but previously may have been a member. - */ - @Child(name = "inactive", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If member is no longer in group", formalDefinition="A flag to indicate that the member is no longer in the group, but previously may have been a member." ) - protected BooleanType inactive; - - private static final long serialVersionUID = -333869055L; - - /** - * Constructor - */ - public GroupMemberComponent() { - super(); - } - - /** - * Constructor - */ - public GroupMemberComponent(Reference entity) { - super(); - this.entity = entity; - } - - /** - * @return {@link #entity} (A reference to the entity that is a member of the group. Must be consistent with Group.type.) - */ - public Reference getEntity() { - if (this.entity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupMemberComponent.entity"); - else if (Configuration.doAutoCreate()) - this.entity = new Reference(); // cc - return this.entity; - } - - public boolean hasEntity() { - return this.entity != null && !this.entity.isEmpty(); - } - - /** - * @param value {@link #entity} (A reference to the entity that is a member of the group. Must be consistent with Group.type.) - */ - public GroupMemberComponent setEntity(Reference value) { - this.entity = value; - return this; - } - - /** - * @return {@link #entity} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the entity that is a member of the group. Must be consistent with Group.type.) - */ - public Resource getEntityTarget() { - return this.entityTarget; - } - - /** - * @param value {@link #entity} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the entity that is a member of the group. Must be consistent with Group.type.) - */ - public GroupMemberComponent setEntityTarget(Resource value) { - this.entityTarget = value; - return this; - } - - /** - * @return {@link #period} (The period that the member was in the group, if known.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupMemberComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period that the member was in the group, if known.) - */ - public GroupMemberComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #inactive} (A flag to indicate that the member is no longer in the group, but previously may have been a member.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value - */ - public BooleanType getInactiveElement() { - if (this.inactive == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GroupMemberComponent.inactive"); - else if (Configuration.doAutoCreate()) - this.inactive = new BooleanType(); // bb - return this.inactive; - } - - public boolean hasInactiveElement() { - return this.inactive != null && !this.inactive.isEmpty(); - } - - public boolean hasInactive() { - return this.inactive != null && !this.inactive.isEmpty(); - } - - /** - * @param value {@link #inactive} (A flag to indicate that the member is no longer in the group, but previously may have been a member.). This is the underlying object with id, value and extensions. The accessor "getInactive" gives direct access to the value - */ - public GroupMemberComponent setInactiveElement(BooleanType value) { - this.inactive = value; - return this; - } - - /** - * @return A flag to indicate that the member is no longer in the group, but previously may have been a member. - */ - public boolean getInactive() { - return this.inactive == null || this.inactive.isEmpty() ? false : this.inactive.getValue(); - } - - /** - * @param value A flag to indicate that the member is no longer in the group, but previously may have been a member. - */ - public GroupMemberComponent setInactive(boolean value) { - if (this.inactive == null) - this.inactive = new BooleanType(); - this.inactive.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("entity", "Reference(Patient|Practitioner|Device|Medication|Substance)", "A reference to the entity that is a member of the group. Must be consistent with Group.type.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("period", "Period", "The period that the member was in the group, if known.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("inactive", "boolean", "A flag to indicate that the member is no longer in the group, but previously may have been a member.", 0, java.lang.Integer.MAX_VALUE, inactive)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : new Base[] {this.entity}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 24665195: /*inactive*/ return this.inactive == null ? new Base[0] : new Base[] {this.inactive}; // BooleanType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1298275357: // entity - this.entity = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 24665195: // inactive - this.inactive = castToBoolean(value); // BooleanType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("entity")) - this.entity = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("inactive")) - this.inactive = castToBoolean(value); // BooleanType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1298275357: return getEntity(); // Reference - case -991726143: return getPeriod(); // Period - case 24665195: throw new FHIRException("Cannot make property inactive as it is not a complex type"); // BooleanType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("entity")) { - this.entity = new Reference(); - return this.entity; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("inactive")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.inactive"); - } - else - return super.addChild(name); - } - - public GroupMemberComponent copy() { - GroupMemberComponent dst = new GroupMemberComponent(); - copyValues(dst); - dst.entity = entity == null ? null : entity.copy(); - dst.period = period == null ? null : period.copy(); - dst.inactive = inactive == null ? null : inactive.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GroupMemberComponent)) - return false; - GroupMemberComponent o = (GroupMemberComponent) other; - return compareDeep(entity, o.entity, true) && compareDeep(period, o.period, true) && compareDeep(inactive, o.inactive, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GroupMemberComponent)) - return false; - GroupMemberComponent o = (GroupMemberComponent) other; - return compareValues(inactive, o.inactive, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (entity == null || entity.isEmpty()) && (period == null || period.isEmpty()) - && (inactive == null || inactive.isEmpty()); - } - - public String fhirType() { - return "Group.member"; - - } - - } - - /** - * A unique business identifier for this group. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique id", formalDefinition="A unique business identifier for this group." ) - protected List identifier; - - /** - * Identifies the broad classification of the kind of resources the group includes. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="person | animal | practitioner | device | medication | substance", formalDefinition="Identifies the broad classification of the kind of resources the group includes." ) - protected Enumeration type; - - /** - * If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals. - */ - @Child(name = "actual", type = {BooleanType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @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." ) - protected BooleanType actual; - - /** - * Indicates whether the record for the group is available for use or is merely being retained for historical purposes. - */ - @Child(name = "active", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether this group's record is in active use", formalDefinition="Indicates whether the record for the group is available for use or is merely being retained for historical purposes." ) - protected BooleanType active; - - /** - * Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Kind of Group members", formalDefinition="Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc." ) - protected CodeableConcept code; - - /** - * A label assigned to the group for human identification and communication. - */ - @Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Label for Group", formalDefinition="A label assigned to the group for human identification and communication." ) - protected StringType name; - - /** - * A count of the number of resource instances that are part of the group. - */ - @Child(name = "quantity", type = {UnsignedIntType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of members", formalDefinition="A count of the number of resource instances that are part of the group." ) - protected UnsignedIntType quantity; - - /** - * Identifies the traits shared by members of the group. - */ - @Child(name = "characteristic", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Trait of group members", formalDefinition="Identifies the traits shared by members of the group." ) - protected List characteristic; - - /** - * Identifies the resource instances that are members of the group. - */ - @Child(name = "member", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Who or what is in group", formalDefinition="Identifies the resource instances that are members of the group." ) - protected List member; - - private static final long serialVersionUID = -437086579L; - - /** - * Constructor - */ - public Group() { - super(); - } - - /** - * Constructor - */ - public Group(Enumeration type, BooleanType actual) { - super(); - this.type = type; - this.actual = actual; - } - - /** - * @return {@link #identifier} (A unique business identifier for this group.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique business identifier for this group.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Group addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new GroupTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifies the broad classification of the kind of resources the group includes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Group setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the broad classification of the kind of resources the group includes. - */ - public GroupType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the broad classification of the kind of resources the group includes. - */ - public Group setType(GroupType value) { - if (this.type == null) - this.type = new Enumeration(new GroupTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value - */ - public BooleanType getActualElement() { - if (this.actual == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.actual"); - else if (Configuration.doAutoCreate()) - this.actual = new BooleanType(); // bb - return this.actual; - } - - public boolean hasActualElement() { - return this.actual != null && !this.actual.isEmpty(); - } - - public boolean hasActual() { - return this.actual != null && !this.actual.isEmpty(); - } - - /** - * @param value {@link #actual} (If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.). This is the underlying object with id, value and extensions. The accessor "getActual" gives direct access to the value - */ - public Group setActualElement(BooleanType value) { - this.actual = value; - return this; - } - - /** - * @return 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 boolean getActual() { - return this.actual == null || this.actual.isEmpty() ? false : this.actual.getValue(); - } - - /** - * @param value 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 value) { - if (this.actual == null) - this.actual = new BooleanType(); - this.actual.setValue(value); - return this; - } - - /** - * @return {@link #active} (Indicates whether the record for the group is available for use or is merely being retained for historical purposes.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Indicates whether the record for the group is available for use or is merely being retained for historical purposes.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Group setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Indicates whether the record for the group is available for use or is merely being retained for historical purposes. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Indicates whether the record for the group is available for use or is merely being retained for historical purposes. - */ - public Group setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Provides a specific type of resource the group includes; e.g. "cow", "syringe", etc.) - */ - public Group setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A label assigned to the group for human identification and communication.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Group setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A label assigned to the group for human identification and communication. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A label assigned to the group for human identification and communication. - */ - public Group setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value - */ - public UnsignedIntType getQuantityElement() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Group.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new UnsignedIntType(); // bb - return this.quantity; - } - - public boolean hasQuantityElement() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (A count of the number of resource instances that are part of the group.). This is the underlying object with id, value and extensions. The accessor "getQuantity" gives direct access to the value - */ - public Group setQuantityElement(UnsignedIntType value) { - this.quantity = value; - return this; - } - - /** - * @return A count of the number of resource instances that are part of the group. - */ - public int getQuantity() { - return this.quantity == null || this.quantity.isEmpty() ? 0 : this.quantity.getValue(); - } - - /** - * @param value A count of the number of resource instances that are part of the group. - */ - public Group setQuantity(int value) { - if (this.quantity == null) - this.quantity = new UnsignedIntType(); - this.quantity.setValue(value); - return this; - } - - /** - * @return {@link #characteristic} (Identifies the traits shared by members of the group.) - */ - public List getCharacteristic() { - if (this.characteristic == null) - this.characteristic = new ArrayList(); - return this.characteristic; - } - - public boolean hasCharacteristic() { - if (this.characteristic == null) - return false; - for (GroupCharacteristicComponent item : this.characteristic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #characteristic} (Identifies the traits shared by members of the group.) - */ - // syntactic sugar - public GroupCharacteristicComponent addCharacteristic() { //3 - GroupCharacteristicComponent t = new GroupCharacteristicComponent(); - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return t; - } - - // syntactic sugar - public Group addCharacteristic(GroupCharacteristicComponent t) { //3 - if (t == null) - return this; - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return this; - } - - /** - * @return {@link #member} (Identifies the resource instances that are members of the group.) - */ - public List getMember() { - if (this.member == null) - this.member = new ArrayList(); - return this.member; - } - - public boolean hasMember() { - if (this.member == null) - return false; - for (GroupMemberComponent item : this.member) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #member} (Identifies the resource instances that are members of the group.) - */ - // syntactic sugar - public GroupMemberComponent addMember() { //3 - GroupMemberComponent t = new GroupMemberComponent(); - if (this.member == null) - this.member = new ArrayList(); - this.member.add(t); - return t; - } - - // syntactic sugar - public Group addMember(GroupMemberComponent t) { //3 - if (t == null) - return this; - if (this.member == null) - this.member = new ArrayList(); - this.member.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique business identifier for this group.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "Identifies the broad classification of the kind of resources the group includes.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("actual", "boolean", "If true, indicates that the resource refers to a specific group of real individuals. If false, the group defines a set of intended individuals.", 0, java.lang.Integer.MAX_VALUE, actual)); - childrenList.add(new Property("active", "boolean", "Indicates whether the record for the group is available for use or is merely being retained for historical purposes.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("code", "CodeableConcept", "Provides a specific type of resource the group includes; e.g. \"cow\", \"syringe\", etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("name", "string", "A label assigned to the group for human identification and communication.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("quantity", "unsignedInt", "A count of the number of resource instances that are part of the group.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("characteristic", "", "Identifies the traits shared by members of the group.", 0, java.lang.Integer.MAX_VALUE, characteristic)); - childrenList.add(new Property("member", "", "Identifies the resource instances that are members of the group.", 0, java.lang.Integer.MAX_VALUE, member)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -1422939762: /*actual*/ return this.actual == null ? new Base[0] : new Base[] {this.actual}; // BooleanType - case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // UnsignedIntType - case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // GroupCharacteristicComponent - case -1077769574: /*member*/ return this.member == null ? new Base[0] : this.member.toArray(new Base[this.member.size()]); // GroupMemberComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3575610: // type - this.type = new GroupTypeEnumFactory().fromType(value); // Enumeration - break; - case -1422939762: // actual - this.actual = castToBoolean(value); // BooleanType - break; - case -1422950650: // active - this.active = castToBoolean(value); // BooleanType - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1285004149: // quantity - this.quantity = castToUnsignedInt(value); // UnsignedIntType - break; - case 366313883: // characteristic - this.getCharacteristic().add((GroupCharacteristicComponent) value); // GroupCharacteristicComponent - break; - case -1077769574: // member - this.getMember().add((GroupMemberComponent) value); // GroupMemberComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("type")) - this.type = new GroupTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("actual")) - this.actual = castToBoolean(value); // BooleanType - else if (name.equals("active")) - this.active = castToBoolean(value); // BooleanType - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("quantity")) - this.quantity = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("characteristic")) - this.getCharacteristic().add((GroupCharacteristicComponent) value); - else if (name.equals("member")) - this.getMember().add((GroupMemberComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -1422939762: throw new FHIRException("Cannot make property actual as it is not a complex type"); // BooleanType - case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType - case 3059181: return getCode(); // CodeableConcept - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1285004149: throw new FHIRException("Cannot make property quantity as it is not a complex type"); // UnsignedIntType - case 366313883: return addCharacteristic(); // GroupCharacteristicComponent - case -1077769574: return addMember(); // GroupMemberComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.type"); - } - else if (name.equals("actual")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.actual"); - } - else if (name.equals("active")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.active"); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.name"); - } - else if (name.equals("quantity")) { - throw new FHIRException("Cannot call addChild on a primitive type Group.quantity"); - } - else if (name.equals("characteristic")) { - return addCharacteristic(); - } - else if (name.equals("member")) { - return addMember(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Group"; - - } - - public Group copy() { - Group dst = new Group(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.actual = actual == null ? null : actual.copy(); - dst.active = active == null ? null : active.copy(); - dst.code = code == null ? null : code.copy(); - dst.name = name == null ? null : name.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - if (characteristic != null) { - dst.characteristic = new ArrayList(); - for (GroupCharacteristicComponent i : characteristic) - dst.characteristic.add(i.copy()); - }; - if (member != null) { - dst.member = new ArrayList(); - for (GroupMemberComponent i : member) - dst.member.add(i.copy()); - }; - return dst; - } - - protected Group typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Group)) - return false; - Group o = (Group) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(actual, o.actual, true) - && compareDeep(active, o.active, true) && compareDeep(code, o.code, true) && compareDeep(name, o.name, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(characteristic, o.characteristic, true) - && compareDeep(member, o.member, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Group)) - return false; - Group o = (Group) other; - return compareValues(type, o.type, true) && compareValues(actual, o.actual, true) && compareValues(active, o.active, true) - && compareValues(name, o.name, true) && compareValues(quantity, o.quantity, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (actual == null || actual.isEmpty()) && (active == null || active.isEmpty()) && (code == null || code.isEmpty()) - && (name == null || name.isEmpty()) && (quantity == null || quantity.isEmpty()) && (characteristic == null || characteristic.isEmpty()) - && (member == null || member.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Group; - } - - /** - * Search parameter: member - *

- * Description: Reference to the group member
- * Type: reference
- * Path: Group.member.entity
- *

- */ - @SearchParamDefinition(name="member", path="Group.member.entity", description="Reference to the group member", type="reference" ) - public static final String SP_MEMBER = "member"; - /** - * Fluent Client search parameter constant for member - *

- * Description: Reference to the group member
- * Type: reference
- * Path: Group.member.entity
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEMBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEMBER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Group:member". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MEMBER = new ca.uhn.fhir.model.api.Include("Group:member").toLocked(); - - /** - * Search parameter: characteristic-value - *

- * Description: A composite of both characteristic and value
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="characteristic-value", path="", 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:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CHARACTERISTIC_VALUE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CHARACTERISTIC_VALUE); - - /** - * Search parameter: value - *

- * Description: Value held by characteristic
- * Type: token
- * Path: Group.characteristic.value[x]
- *

- */ - @SearchParamDefinition(name="value", path="Group.characteristic.value", description="Value held by characteristic", type="token" ) - public static final String SP_VALUE = "value"; - /** - * Fluent Client search parameter constant for value - *

- * Description: Value held by characteristic
- * Type: token
- * Path: Group.characteristic.value[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE); - - /** - * Search parameter: actual - *

- * Description: Descriptive or actual
- * Type: token
- * Path: Group.actual
- *

- */ - @SearchParamDefinition(name="actual", path="Group.actual", description="Descriptive or actual", type="token" ) - public static final String SP_ACTUAL = "actual"; - /** - * Fluent Client search parameter constant for actual - *

- * Description: Descriptive or actual
- * Type: token
- * Path: Group.actual
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTUAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTUAL); - - /** - * Search parameter: exclude - *

- * Description: Group includes or excludes
- * Type: token
- * Path: Group.characteristic.exclude
- *

- */ - @SearchParamDefinition(name="exclude", path="Group.characteristic.exclude", description="Group includes or excludes", type="token" ) - public static final String SP_EXCLUDE = "exclude"; - /** - * Fluent Client search parameter constant for exclude - *

- * Description: Group includes or excludes
- * Type: token
- * Path: Group.characteristic.exclude
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXCLUDE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXCLUDE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: characteristic - *

- * Description: Kind of characteristic
- * Type: token
- * Path: Group.characteristic.code
- *

- */ - @SearchParamDefinition(name="characteristic", path="Group.characteristic.code", description="Kind of characteristic", type="token" ) - public static final String SP_CHARACTERISTIC = "characteristic"; - /** - * Fluent Client search parameter constant for characteristic - *

- * Description: Kind of characteristic
- * Type: token
- * Path: Group.characteristic.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: Unique id
- * Type: token
- * Path: Group.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Group.identifier", description="Unique id", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique id
- * Type: token
- * Path: Group.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java deleted file mode 100644 index 2e3cbaa3296..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/GuidanceResponse.java +++ /dev/null @@ -1,2288 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A guidance response is the formal response to a guidance request, including any output parameters returned by the evaluation, as well as the description of any proposed actions to be taken. - */ -@ResourceDef(name="GuidanceResponse", profile="http://hl7.org/fhir/Profile/GuidanceResponse") -public class GuidanceResponse extends DomainResource { - - public enum GuidanceResponseStatus { - /** - * The request was processed successfully - */ - SUCCESS, - /** - * The request was processed successfully, but more data may result in a more complete evaluation - */ - DATAREQUESTED, - /** - * The request was processed, but more data is required to complete the evaluation - */ - DATAREQUIRED, - /** - * The request is currently being processed - */ - INPROGRESS, - /** - * The request was not processed successfully - */ - FAILURE, - /** - * added to help the parsers - */ - NULL; - public static GuidanceResponseStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("success".equals(codeString)) - return SUCCESS; - if ("data-requested".equals(codeString)) - return DATAREQUESTED; - if ("data-required".equals(codeString)) - return DATAREQUIRED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("failure".equals(codeString)) - return FAILURE; - throw new FHIRException("Unknown GuidanceResponseStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SUCCESS: return "success"; - case DATAREQUESTED: return "data-requested"; - case DATAREQUIRED: return "data-required"; - case INPROGRESS: return "in-progress"; - case FAILURE: return "failure"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SUCCESS: return "http://hl7.org/fhir/guidance-response-status"; - case DATAREQUESTED: return "http://hl7.org/fhir/guidance-response-status"; - case DATAREQUIRED: return "http://hl7.org/fhir/guidance-response-status"; - case INPROGRESS: return "http://hl7.org/fhir/guidance-response-status"; - case FAILURE: return "http://hl7.org/fhir/guidance-response-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SUCCESS: return "The request was processed successfully"; - case DATAREQUESTED: return "The request was processed successfully, but more data may result in a more complete evaluation"; - case DATAREQUIRED: return "The request was processed, but more data is required to complete the evaluation"; - case INPROGRESS: return "The request is currently being processed"; - case FAILURE: return "The request was not processed successfully"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SUCCESS: return "Success"; - case DATAREQUESTED: return "Data Requested"; - case DATAREQUIRED: return "Data Required"; - case INPROGRESS: return "In Progress"; - case FAILURE: return "Failure"; - default: return "?"; - } - } - } - - public static class GuidanceResponseStatusEnumFactory implements EnumFactory { - public GuidanceResponseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("success".equals(codeString)) - return GuidanceResponseStatus.SUCCESS; - if ("data-requested".equals(codeString)) - return GuidanceResponseStatus.DATAREQUESTED; - if ("data-required".equals(codeString)) - return GuidanceResponseStatus.DATAREQUIRED; - if ("in-progress".equals(codeString)) - return GuidanceResponseStatus.INPROGRESS; - if ("failure".equals(codeString)) - return GuidanceResponseStatus.FAILURE; - throw new IllegalArgumentException("Unknown GuidanceResponseStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("success".equals(codeString)) - return new Enumeration(this, GuidanceResponseStatus.SUCCESS); - if ("data-requested".equals(codeString)) - return new Enumeration(this, GuidanceResponseStatus.DATAREQUESTED); - if ("data-required".equals(codeString)) - return new Enumeration(this, GuidanceResponseStatus.DATAREQUIRED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, GuidanceResponseStatus.INPROGRESS); - if ("failure".equals(codeString)) - return new Enumeration(this, GuidanceResponseStatus.FAILURE); - throw new FHIRException("Unknown GuidanceResponseStatus code '"+codeString+"'"); - } - public String toCode(GuidanceResponseStatus code) { - if (code == GuidanceResponseStatus.SUCCESS) - return "success"; - if (code == GuidanceResponseStatus.DATAREQUESTED) - return "data-requested"; - if (code == GuidanceResponseStatus.DATAREQUIRED) - return "data-required"; - if (code == GuidanceResponseStatus.INPROGRESS) - return "in-progress"; - if (code == GuidanceResponseStatus.FAILURE) - return "failure"; - return "?"; - } - public String toSystem(GuidanceResponseStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class GuidanceResponseActionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique. - */ - @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique." ) - protected Identifier actionIdentifier; - - /** - * A user-visible label for the action. - */ - @Child(name = "label", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="User-visible label for the action (e.g. 1. or A.)", formalDefinition="A user-visible label for the action." ) - protected StringType label; - - /** - * The title of the action displayed to a user. - */ - @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="User-visible title", formalDefinition="The title of the action displayed to a user." ) - protected StringType title; - - /** - * A short description of the action used to provide a summary to display to the user. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Short description of the action", formalDefinition="A short description of the action used to provide a summary to display to the user." ) - protected StringType description; - - /** - * A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. - */ - @Child(name = "textEquivalent", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system", formalDefinition="A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically." ) - protected StringType textEquivalent; - - /** - * The concept represented by this action or its sub-actions. - */ - @Child(name = "concept", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The meaning of the action or its sub-actions", formalDefinition="The concept represented by this action or its sub-actions." ) - protected List concept; - - /** - * The evidence grade and the sources of evidence for this action. - */ - @Child(name = "supportingEvidence", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Evidence that supports taking the action", formalDefinition="The evidence grade and the sources of evidence for this action." ) - protected List supportingEvidence; - - /** - * A relationship to another action such as "before" or "30-60 minutes after start of". - */ - @Child(name = "relatedAction", type = {}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Relationship to another action", formalDefinition="A relationship to another action such as \"before\" or \"30-60 minutes after start of\"." ) - protected GuidanceResponseActionRelatedActionComponent relatedAction; - - /** - * Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources. - */ - @Child(name = "documentation", type = {Attachment.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Supporting documentation for the intended performer of the action", formalDefinition="Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources." ) - protected List documentation; - - /** - * The participant in the action. - */ - @Child(name = "participant", type = {Patient.class, Person.class, Practitioner.class, RelatedPerson.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Participant", formalDefinition="The participant in the action." ) - protected List participant; - /** - * The actual objects that are the target of the reference (The participant in the action.) - */ - protected List participantTarget; - - - /** - * The type of action to perform (create, update, remove). - */ - @Child(name = "type", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="create | update | remove | fire-event", formalDefinition="The type of action to perform (create, update, remove)." ) - protected CodeType type; - - /** - * A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment. - */ - @Child(name = "behavior", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Defines behaviors such as selection and grouping", formalDefinition="A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment." ) - protected List behavior; - - /** - * The resource that is the target of the action (e.g. CommunicationRequest). - */ - @Child(name = "resource", type = {}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The target of the action", formalDefinition="The resource that is the target of the action (e.g. CommunicationRequest)." ) - protected Reference resource; - - /** - * The actual object that is the target of the reference (The resource that is the target of the action (e.g. CommunicationRequest).) - */ - protected Resource resourceTarget; - - /** - * Sub actions. - */ - @Child(name = "action", type = {GuidanceResponseActionComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Sub action", formalDefinition="Sub actions." ) - protected List action; - - private static final long serialVersionUID = -1602697381L; - - /** - * Constructor - */ - public GuidanceResponseActionComponent() { - super(); - } - - /** - * @return {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) - */ - public Identifier getActionIdentifier() { - if (this.actionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.actionIdentifier"); - else if (Configuration.doAutoCreate()) - this.actionIdentifier = new Identifier(); // cc - return this.actionIdentifier; - } - - public boolean hasActionIdentifier() { - return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); - } - - /** - * @param value {@link #actionIdentifier} (A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.) - */ - public GuidanceResponseActionComponent setActionIdentifier(Identifier value) { - this.actionIdentifier = value; - return this; - } - - /** - * @return {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); // bb - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (A user-visible label for the action.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public GuidanceResponseActionComponent setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return A user-visible label for the action. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value A user-visible label for the action. - */ - public GuidanceResponseActionComponent setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The title of the action displayed to a user.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public GuidanceResponseActionComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The title of the action displayed to a user. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The title of the action displayed to a user. - */ - public GuidanceResponseActionComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A short description of the action used to provide a summary to display to the user.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public GuidanceResponseActionComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A short description of the action used to provide a summary to display to the user. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A short description of the action used to provide a summary to display to the user. - */ - public GuidanceResponseActionComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value - */ - public StringType getTextEquivalentElement() { - if (this.textEquivalent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.textEquivalent"); - else if (Configuration.doAutoCreate()) - this.textEquivalent = new StringType(); // bb - return this.textEquivalent; - } - - public boolean hasTextEquivalentElement() { - return this.textEquivalent != null && !this.textEquivalent.isEmpty(); - } - - public boolean hasTextEquivalent() { - return this.textEquivalent != null && !this.textEquivalent.isEmpty(); - } - - /** - * @param value {@link #textEquivalent} (A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.). This is the underlying object with id, value and extensions. The accessor "getTextEquivalent" gives direct access to the value - */ - public GuidanceResponseActionComponent setTextEquivalentElement(StringType value) { - this.textEquivalent = value; - return this; - } - - /** - * @return A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. - */ - public String getTextEquivalent() { - return this.textEquivalent == null ? null : this.textEquivalent.getValue(); - } - - /** - * @param value A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically. - */ - public GuidanceResponseActionComponent setTextEquivalent(String value) { - if (Utilities.noString(value)) - this.textEquivalent = null; - else { - if (this.textEquivalent == null) - this.textEquivalent = new StringType(); - this.textEquivalent.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (The concept represented by this action or its sub-actions.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (CodeableConcept item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (The concept represented by this action or its sub-actions.) - */ - // syntactic sugar - public CodeableConcept addConcept() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponseActionComponent addConcept(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) - */ - public List getSupportingEvidence() { - if (this.supportingEvidence == null) - this.supportingEvidence = new ArrayList(); - return this.supportingEvidence; - } - - public boolean hasSupportingEvidence() { - if (this.supportingEvidence == null) - return false; - for (Attachment item : this.supportingEvidence) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingEvidence} (The evidence grade and the sources of evidence for this action.) - */ - // syntactic sugar - public Attachment addSupportingEvidence() { //3 - Attachment t = new Attachment(); - if (this.supportingEvidence == null) - this.supportingEvidence = new ArrayList(); - this.supportingEvidence.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponseActionComponent addSupportingEvidence(Attachment t) { //3 - if (t == null) - return this; - if (this.supportingEvidence == null) - this.supportingEvidence = new ArrayList(); - this.supportingEvidence.add(t); - return this; - } - - /** - * @return {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) - */ - public GuidanceResponseActionRelatedActionComponent getRelatedAction() { - if (this.relatedAction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.relatedAction"); - else if (Configuration.doAutoCreate()) - this.relatedAction = new GuidanceResponseActionRelatedActionComponent(); // cc - return this.relatedAction; - } - - public boolean hasRelatedAction() { - return this.relatedAction != null && !this.relatedAction.isEmpty(); - } - - /** - * @param value {@link #relatedAction} (A relationship to another action such as "before" or "30-60 minutes after start of".) - */ - public GuidanceResponseActionComponent setRelatedAction(GuidanceResponseActionRelatedActionComponent value) { - this.relatedAction = value; - return this; - } - - /** - * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) - */ - public List getDocumentation() { - if (this.documentation == null) - this.documentation = new ArrayList(); - return this.documentation; - } - - public boolean hasDocumentation() { - if (this.documentation == null) - return false; - for (Attachment item : this.documentation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #documentation} (Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.) - */ - // syntactic sugar - public Attachment addDocumentation() { //3 - Attachment t = new Attachment(); - if (this.documentation == null) - this.documentation = new ArrayList(); - this.documentation.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponseActionComponent addDocumentation(Attachment t) { //3 - if (t == null) - return this; - if (this.documentation == null) - this.documentation = new ArrayList(); - this.documentation.add(t); - return this; - } - - /** - * @return {@link #participant} (The participant in the action.) - */ - public List getParticipant() { - if (this.participant == null) - this.participant = new ArrayList(); - return this.participant; - } - - public boolean hasParticipant() { - if (this.participant == null) - return false; - for (Reference item : this.participant) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #participant} (The participant in the action.) - */ - // syntactic sugar - public Reference addParticipant() { //3 - Reference t = new Reference(); - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponseActionComponent addParticipant(Reference t) { //3 - if (t == null) - return this; - if (this.participant == null) - this.participant = new ArrayList(); - this.participant.add(t); - return this; - } - - /** - * @return {@link #participant} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The participant in the action.) - */ - public List getParticipantTarget() { - if (this.participantTarget == null) - this.participantTarget = new ArrayList(); - return this.participantTarget; - } - - /** - * @return {@link #type} (The type of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of action to perform (create, update, remove).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public GuidanceResponseActionComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of action to perform (create, update, remove). - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of action to perform (create, update, remove). - */ - public GuidanceResponseActionComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) - */ - public List getBehavior() { - if (this.behavior == null) - this.behavior = new ArrayList(); - return this.behavior; - } - - public boolean hasBehavior() { - if (this.behavior == null) - return false; - for (GuidanceResponseActionBehaviorComponent item : this.behavior) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #behavior} (A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.) - */ - // syntactic sugar - public GuidanceResponseActionBehaviorComponent addBehavior() { //3 - GuidanceResponseActionBehaviorComponent t = new GuidanceResponseActionBehaviorComponent(); - if (this.behavior == null) - this.behavior = new ArrayList(); - this.behavior.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponseActionComponent addBehavior(GuidanceResponseActionBehaviorComponent t) { //3 - if (t == null) - return this; - if (this.behavior == null) - this.behavior = new ArrayList(); - this.behavior.add(t); - return this; - } - - /** - * @return {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest).) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The resource that is the target of the action (e.g. CommunicationRequest).) - */ - public GuidanceResponseActionComponent setResource(Reference value) { - this.resource = value; - return this; - } - - /** - * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource that is the target of the action (e.g. CommunicationRequest).) - */ - public Resource getResourceTarget() { - return this.resourceTarget; - } - - /** - * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource that is the target of the action (e.g. CommunicationRequest).) - */ - public GuidanceResponseActionComponent setResourceTarget(Resource value) { - this.resourceTarget = value; - return this; - } - - /** - * @return {@link #action} (Sub actions.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (GuidanceResponseActionComponent item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Sub actions.) - */ - // syntactic sugar - public GuidanceResponseActionComponent addAction() { //3 - GuidanceResponseActionComponent t = new GuidanceResponseActionComponent(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponseActionComponent addAction(GuidanceResponseActionComponent t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actionIdentifier", "Identifier", "A unique identifier for the action. The identifier SHALL be unique within the container in which it appears, and MAY be universally unique.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); - childrenList.add(new Property("label", "string", "A user-visible label for the action.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("title", "string", "The title of the action displayed to a user.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("description", "string", "A short description of the action used to provide a summary to display to the user.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("textEquivalent", "string", "A text equivalent of the action to be performed. This provides a human-interpretable description of the action when the definition is consumed by a system that may not be capable of interpreting it dynamically.", 0, java.lang.Integer.MAX_VALUE, textEquivalent)); - childrenList.add(new Property("concept", "CodeableConcept", "The concept represented by this action or its sub-actions.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("supportingEvidence", "Attachment", "The evidence grade and the sources of evidence for this action.", 0, java.lang.Integer.MAX_VALUE, supportingEvidence)); - childrenList.add(new Property("relatedAction", "", "A relationship to another action such as \"before\" or \"30-60 minutes after start of\".", 0, java.lang.Integer.MAX_VALUE, relatedAction)); - childrenList.add(new Property("documentation", "Attachment", "Didactic or other informational resources associated with the action that can be provided to the CDS recipient. Information resources can include inline text commentary and links to web resources.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("participant", "Reference(Patient|Person|Practitioner|RelatedPerson)", "The participant in the action.", 0, java.lang.Integer.MAX_VALUE, participant)); - childrenList.add(new Property("type", "code", "The type of action to perform (create, update, remove).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("behavior", "", "A behavior associated with the action. Behaviors define how the action is to be presented and/or executed within the receiving environment.", 0, java.lang.Integer.MAX_VALUE, behavior)); - childrenList.add(new Property("resource", "Reference(Any)", "The resource that is the target of the action (e.g. CommunicationRequest).", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("action", "@GuidanceResponse.action", "Sub actions.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier - case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -900391049: /*textEquivalent*/ return this.textEquivalent == null ? new Base[0] : new Base[] {this.textEquivalent}; // StringType - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // CodeableConcept - case -1735429846: /*supportingEvidence*/ return this.supportingEvidence == null ? new Base[0] : this.supportingEvidence.toArray(new Base[this.supportingEvidence.size()]); // Attachment - case -384107967: /*relatedAction*/ return this.relatedAction == null ? new Base[0] : new Base[] {this.relatedAction}; // GuidanceResponseActionRelatedActionComponent - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : this.documentation.toArray(new Base[this.documentation.size()]); // Attachment - case 767422259: /*participant*/ return this.participant == null ? new Base[0] : this.participant.toArray(new Base[this.participant.size()]); // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case 1510912594: /*behavior*/ return this.behavior == null ? new Base[0] : this.behavior.toArray(new Base[this.behavior.size()]); // GuidanceResponseActionBehaviorComponent - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // GuidanceResponseActionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -889046145: // actionIdentifier - this.actionIdentifier = castToIdentifier(value); // Identifier - break; - case 102727412: // label - this.label = castToString(value); // StringType - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -900391049: // textEquivalent - this.textEquivalent = castToString(value); // StringType - break; - case 951024232: // concept - this.getConcept().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1735429846: // supportingEvidence - this.getSupportingEvidence().add(castToAttachment(value)); // Attachment - break; - case -384107967: // relatedAction - this.relatedAction = (GuidanceResponseActionRelatedActionComponent) value; // GuidanceResponseActionRelatedActionComponent - break; - case 1587405498: // documentation - this.getDocumentation().add(castToAttachment(value)); // Attachment - break; - case 767422259: // participant - this.getParticipant().add(castToReference(value)); // Reference - break; - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case 1510912594: // behavior - this.getBehavior().add((GuidanceResponseActionBehaviorComponent) value); // GuidanceResponseActionBehaviorComponent - break; - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - case -1422950858: // action - this.getAction().add((GuidanceResponseActionComponent) value); // GuidanceResponseActionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actionIdentifier")) - this.actionIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("label")) - this.label = castToString(value); // StringType - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("textEquivalent")) - this.textEquivalent = castToString(value); // StringType - else if (name.equals("concept")) - this.getConcept().add(castToCodeableConcept(value)); - else if (name.equals("supportingEvidence")) - this.getSupportingEvidence().add(castToAttachment(value)); - else if (name.equals("relatedAction")) - this.relatedAction = (GuidanceResponseActionRelatedActionComponent) value; // GuidanceResponseActionRelatedActionComponent - else if (name.equals("documentation")) - this.getDocumentation().add(castToAttachment(value)); - else if (name.equals("participant")) - this.getParticipant().add(castToReference(value)); - else if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("behavior")) - this.getBehavior().add((GuidanceResponseActionBehaviorComponent) value); - else if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else if (name.equals("action")) - this.getAction().add((GuidanceResponseActionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -889046145: return getActionIdentifier(); // Identifier - case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -900391049: throw new FHIRException("Cannot make property textEquivalent as it is not a complex type"); // StringType - case 951024232: return addConcept(); // CodeableConcept - case -1735429846: return addSupportingEvidence(); // Attachment - case -384107967: return getRelatedAction(); // GuidanceResponseActionRelatedActionComponent - case 1587405498: return addDocumentation(); // Attachment - case 767422259: return addParticipant(); // Reference - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case 1510912594: return addBehavior(); // GuidanceResponseActionBehaviorComponent - case -341064690: return getResource(); // Reference - case -1422950858: return addAction(); // GuidanceResponseActionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actionIdentifier")) { - this.actionIdentifier = new Identifier(); - return this.actionIdentifier; - } - else if (name.equals("label")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.label"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.title"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.description"); - } - else if (name.equals("textEquivalent")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.textEquivalent"); - } - else if (name.equals("concept")) { - return addConcept(); - } - else if (name.equals("supportingEvidence")) { - return addSupportingEvidence(); - } - else if (name.equals("relatedAction")) { - this.relatedAction = new GuidanceResponseActionRelatedActionComponent(); - return this.relatedAction; - } - else if (name.equals("documentation")) { - return addDocumentation(); - } - else if (name.equals("participant")) { - return addParticipant(); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.type"); - } - else if (name.equals("behavior")) { - return addBehavior(); - } - else if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public GuidanceResponseActionComponent copy() { - GuidanceResponseActionComponent dst = new GuidanceResponseActionComponent(); - copyValues(dst); - dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); - dst.label = label == null ? null : label.copy(); - dst.title = title == null ? null : title.copy(); - dst.description = description == null ? null : description.copy(); - dst.textEquivalent = textEquivalent == null ? null : textEquivalent.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (CodeableConcept i : concept) - dst.concept.add(i.copy()); - }; - if (supportingEvidence != null) { - dst.supportingEvidence = new ArrayList(); - for (Attachment i : supportingEvidence) - dst.supportingEvidence.add(i.copy()); - }; - dst.relatedAction = relatedAction == null ? null : relatedAction.copy(); - if (documentation != null) { - dst.documentation = new ArrayList(); - for (Attachment i : documentation) - dst.documentation.add(i.copy()); - }; - if (participant != null) { - dst.participant = new ArrayList(); - for (Reference i : participant) - dst.participant.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - if (behavior != null) { - dst.behavior = new ArrayList(); - for (GuidanceResponseActionBehaviorComponent i : behavior) - dst.behavior.add(i.copy()); - }; - dst.resource = resource == null ? null : resource.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (GuidanceResponseActionComponent i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GuidanceResponseActionComponent)) - return false; - GuidanceResponseActionComponent o = (GuidanceResponseActionComponent) other; - return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(label, o.label, true) - && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) && compareDeep(textEquivalent, o.textEquivalent, true) - && compareDeep(concept, o.concept, true) && compareDeep(supportingEvidence, o.supportingEvidence, true) - && compareDeep(relatedAction, o.relatedAction, true) && compareDeep(documentation, o.documentation, true) - && compareDeep(participant, o.participant, true) && compareDeep(type, o.type, true) && compareDeep(behavior, o.behavior, true) - && compareDeep(resource, o.resource, true) && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GuidanceResponseActionComponent)) - return false; - GuidanceResponseActionComponent o = (GuidanceResponseActionComponent) other; - return compareValues(label, o.label, true) && compareValues(title, o.title, true) && compareValues(description, o.description, true) - && compareValues(textEquivalent, o.textEquivalent, true) && compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (label == null || label.isEmpty()) - && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (textEquivalent == null || textEquivalent.isEmpty()) - && (concept == null || concept.isEmpty()) && (supportingEvidence == null || supportingEvidence.isEmpty()) - && (relatedAction == null || relatedAction.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (participant == null || participant.isEmpty()) && (type == null || type.isEmpty()) && (behavior == null || behavior.isEmpty()) - && (resource == null || resource.isEmpty()) && (action == null || action.isEmpty()); - } - - public String fhirType() { - return "GuidanceResponse.action"; - - } - - } - - @Block() - public static class GuidanceResponseActionRelatedActionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The unique identifier of the related action. - */ - @Child(name = "actionIdentifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Identifier of the related action", formalDefinition="The unique identifier of the related action." ) - protected Identifier actionIdentifier; - - /** - * The relationship of this action to the related action. - */ - @Child(name = "relationship", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="before | after", formalDefinition="The relationship of this action to the related action." ) - protected CodeType relationship; - - /** - * A duration or range of durations to apply to the relationship. For example, 30-60 minutes before. - */ - @Child(name = "offset", type = {Duration.class, Range.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Time offset for the relationship", formalDefinition="A duration or range of durations to apply to the relationship. For example, 30-60 minutes before." ) - protected Type offset; - - /** - * An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. - */ - @Child(name = "anchor", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="start | end", formalDefinition="An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action." ) - protected CodeType anchor; - - private static final long serialVersionUID = -1200619014L; - - /** - * Constructor - */ - public GuidanceResponseActionRelatedActionComponent() { - super(); - } - - /** - * Constructor - */ - public GuidanceResponseActionRelatedActionComponent(Identifier actionIdentifier, CodeType relationship) { - super(); - this.actionIdentifier = actionIdentifier; - this.relationship = relationship; - } - - /** - * @return {@link #actionIdentifier} (The unique identifier of the related action.) - */ - public Identifier getActionIdentifier() { - if (this.actionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.actionIdentifier"); - else if (Configuration.doAutoCreate()) - this.actionIdentifier = new Identifier(); // cc - return this.actionIdentifier; - } - - public boolean hasActionIdentifier() { - return this.actionIdentifier != null && !this.actionIdentifier.isEmpty(); - } - - /** - * @param value {@link #actionIdentifier} (The unique identifier of the related action.) - */ - public GuidanceResponseActionRelatedActionComponent setActionIdentifier(Identifier value) { - this.actionIdentifier = value; - return this; - } - - /** - * @return {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value - */ - public CodeType getRelationshipElement() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeType(); // bb - return this.relationship; - } - - public boolean hasRelationshipElement() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The relationship of this action to the related action.). This is the underlying object with id, value and extensions. The accessor "getRelationship" gives direct access to the value - */ - public GuidanceResponseActionRelatedActionComponent setRelationshipElement(CodeType value) { - this.relationship = value; - return this; - } - - /** - * @return The relationship of this action to the related action. - */ - public String getRelationship() { - return this.relationship == null ? null : this.relationship.getValue(); - } - - /** - * @param value The relationship of this action to the related action. - */ - public GuidanceResponseActionRelatedActionComponent setRelationship(String value) { - if (this.relationship == null) - this.relationship = new CodeType(); - this.relationship.setValue(value); - return this; - } - - /** - * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public Type getOffset() { - return this.offset; - } - - /** - * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public Duration getOffsetDuration() throws FHIRException { - if (!(this.offset instanceof Duration)) - throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.offset.getClass().getName()+" was encountered"); - return (Duration) this.offset; - } - - public boolean hasOffsetDuration() { - return this.offset instanceof Duration; - } - - /** - * @return {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public Range getOffsetRange() throws FHIRException { - if (!(this.offset instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.offset.getClass().getName()+" was encountered"); - return (Range) this.offset; - } - - public boolean hasOffsetRange() { - return this.offset instanceof Range; - } - - public boolean hasOffset() { - return this.offset != null && !this.offset.isEmpty(); - } - - /** - * @param value {@link #offset} (A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.) - */ - public GuidanceResponseActionRelatedActionComponent setOffset(Type value) { - this.offset = value; - return this; - } - - /** - * @return {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value - */ - public CodeType getAnchorElement() { - if (this.anchor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionRelatedActionComponent.anchor"); - else if (Configuration.doAutoCreate()) - this.anchor = new CodeType(); // bb - return this.anchor; - } - - public boolean hasAnchorElement() { - return this.anchor != null && !this.anchor.isEmpty(); - } - - public boolean hasAnchor() { - return this.anchor != null && !this.anchor.isEmpty(); - } - - /** - * @param value {@link #anchor} (An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action.). This is the underlying object with id, value and extensions. The accessor "getAnchor" gives direct access to the value - */ - public GuidanceResponseActionRelatedActionComponent setAnchorElement(CodeType value) { - this.anchor = value; - return this; - } - - /** - * @return An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. - */ - public String getAnchor() { - return this.anchor == null ? null : this.anchor.getValue(); - } - - /** - * @param value An optional indicator for how the relationship is anchored to the related action. For example "before the start" or "before the end" of the related action. - */ - public GuidanceResponseActionRelatedActionComponent setAnchor(String value) { - if (Utilities.noString(value)) - this.anchor = null; - else { - if (this.anchor == null) - this.anchor = new CodeType(); - this.anchor.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actionIdentifier", "Identifier", "The unique identifier of the related action.", 0, java.lang.Integer.MAX_VALUE, actionIdentifier)); - childrenList.add(new Property("relationship", "code", "The relationship of this action to the related action.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("offset[x]", "Duration|Range", "A duration or range of durations to apply to the relationship. For example, 30-60 minutes before.", 0, java.lang.Integer.MAX_VALUE, offset)); - childrenList.add(new Property("anchor", "code", "An optional indicator for how the relationship is anchored to the related action. For example \"before the start\" or \"before the end\" of the related action.", 0, java.lang.Integer.MAX_VALUE, anchor)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -889046145: /*actionIdentifier*/ return this.actionIdentifier == null ? new Base[0] : new Base[] {this.actionIdentifier}; // Identifier - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeType - case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // Type - case -1413299531: /*anchor*/ return this.anchor == null ? new Base[0] : new Base[] {this.anchor}; // CodeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -889046145: // actionIdentifier - this.actionIdentifier = castToIdentifier(value); // Identifier - break; - case -261851592: // relationship - this.relationship = castToCode(value); // CodeType - break; - case -1019779949: // offset - this.offset = (Type) value; // Type - break; - case -1413299531: // anchor - this.anchor = castToCode(value); // CodeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actionIdentifier")) - this.actionIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("relationship")) - this.relationship = castToCode(value); // CodeType - else if (name.equals("offset[x]")) - this.offset = (Type) value; // Type - else if (name.equals("anchor")) - this.anchor = castToCode(value); // CodeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -889046145: return getActionIdentifier(); // Identifier - case -261851592: throw new FHIRException("Cannot make property relationship as it is not a complex type"); // CodeType - case -1960684787: return getOffset(); // Type - case -1413299531: throw new FHIRException("Cannot make property anchor as it is not a complex type"); // CodeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actionIdentifier")) { - this.actionIdentifier = new Identifier(); - return this.actionIdentifier; - } - else if (name.equals("relationship")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.relationship"); - } - else if (name.equals("offsetDuration")) { - this.offset = new Duration(); - return this.offset; - } - else if (name.equals("offsetRange")) { - this.offset = new Range(); - return this.offset; - } - else if (name.equals("anchor")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.anchor"); - } - else - return super.addChild(name); - } - - public GuidanceResponseActionRelatedActionComponent copy() { - GuidanceResponseActionRelatedActionComponent dst = new GuidanceResponseActionRelatedActionComponent(); - copyValues(dst); - dst.actionIdentifier = actionIdentifier == null ? null : actionIdentifier.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.offset = offset == null ? null : offset.copy(); - dst.anchor = anchor == null ? null : anchor.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GuidanceResponseActionRelatedActionComponent)) - return false; - GuidanceResponseActionRelatedActionComponent o = (GuidanceResponseActionRelatedActionComponent) other; - return compareDeep(actionIdentifier, o.actionIdentifier, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(offset, o.offset, true) && compareDeep(anchor, o.anchor, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GuidanceResponseActionRelatedActionComponent)) - return false; - GuidanceResponseActionRelatedActionComponent o = (GuidanceResponseActionRelatedActionComponent) other; - return compareValues(relationship, o.relationship, true) && compareValues(anchor, o.anchor, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (actionIdentifier == null || actionIdentifier.isEmpty()) && (relationship == null || relationship.isEmpty()) - && (offset == null || offset.isEmpty()) && (anchor == null || anchor.isEmpty()); - } - - public String fhirType() { - return "GuidanceResponse.action.relatedAction"; - - } - - } - - @Block() - public static class GuidanceResponseActionBehaviorComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of the behavior to be described, such as grouping, visual, or selection behaviors. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The type of behavior (grouping, precheck, selection, cardinality, etc)", formalDefinition="The type of the behavior to be described, such as grouping, visual, or selection behaviors." ) - protected Coding type; - - /** - * The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset. - */ - @Child(name = "value", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specific behavior (e.g. required, at-most-one, single, etc)", formalDefinition="The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset." ) - protected Coding value; - - private static final long serialVersionUID = -1054119695L; - - /** - * Constructor - */ - public GuidanceResponseActionBehaviorComponent() { - super(); - } - - /** - * Constructor - */ - public GuidanceResponseActionBehaviorComponent(Coding type, Coding value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionBehaviorComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the behavior to be described, such as grouping, visual, or selection behaviors.) - */ - public GuidanceResponseActionBehaviorComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) - */ - public Coding getValue() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponseActionBehaviorComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new Coding(); // cc - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.) - */ - public GuidanceResponseActionBehaviorComponent setValue(Coding value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The type of the behavior to be described, such as grouping, visual, or selection behaviors.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "Coding", "The specific behavior. The code used here is determined by the type of behavior being described. For example, the grouping behavior uses the grouping-behavior-type valueset.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 111972721: // value - this.value = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("value")) - this.value = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 111972721: return getValue(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("value")) { - this.value = new Coding(); - return this.value; - } - else - return super.addChild(name); - } - - public GuidanceResponseActionBehaviorComponent copy() { - GuidanceResponseActionBehaviorComponent dst = new GuidanceResponseActionBehaviorComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GuidanceResponseActionBehaviorComponent)) - return false; - GuidanceResponseActionBehaviorComponent o = (GuidanceResponseActionBehaviorComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GuidanceResponseActionBehaviorComponent)) - return false; - GuidanceResponseActionBehaviorComponent o = (GuidanceResponseActionBehaviorComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "GuidanceResponse.action.behavior"; - - } - - } - - /** - * The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. - */ - @Child(name = "requestId", type = {StringType.class}, order=0, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The id of the request associated with this response, if any", formalDefinition="The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario." ) - protected StringType requestId; - - /** - * A reference to the knowledge module that was invoked. - */ - @Child(name = "module", type = {DecisionSupportServiceModule.class, DecisionSupportRule.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="A reference to a knowledge module", formalDefinition="A reference to the knowledge module that was invoked." ) - protected Reference module; - - /** - * The actual object that is the target of the reference (A reference to the knowledge module that was invoked.) - */ - protected Resource moduleTarget; - - /** - * The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="success | data-requested | data-required | in-progress | failure", formalDefinition="The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information." ) - protected Enumeration status; - - /** - * Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element. - */ - @Child(name = "evaluationMessage", type = {OperationOutcome.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Messages resulting from the evaluation of the artifact or artifacts", formalDefinition="Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element." ) - protected List evaluationMessage; - /** - * The actual objects that are the target of the reference (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) - */ - protected List evaluationMessageTarget; - - - /** - * The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element. - */ - @Child(name = "outputParameters", type = {Parameters.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The output parameters of the evaluation, if any", formalDefinition="The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element." ) - protected Reference outputParameters; - - /** - * The actual object that is the target of the reference (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) - */ - protected Parameters outputParametersTarget; - - /** - * The actions, if any, produced by the evaluation of the artifact. - */ - @Child(name = "action", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Proposed actions, if any", formalDefinition="The actions, if any, produced by the evaluation of the artifact." ) - protected List action; - - /** - * If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data. - */ - @Child(name = "dataRequirement", type = {DataRequirement.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional required data", formalDefinition="If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data." ) - protected List dataRequirement; - - private static final long serialVersionUID = -918912174L; - - /** - * Constructor - */ - public GuidanceResponse() { - super(); - } - - /** - * Constructor - */ - public GuidanceResponse(Reference module, Enumeration status) { - super(); - this.module = module; - this.status = status; - } - - /** - * @return {@link #requestId} (The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value - */ - public StringType getRequestIdElement() { - if (this.requestId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.requestId"); - else if (Configuration.doAutoCreate()) - this.requestId = new StringType(); // bb - return this.requestId; - } - - public boolean hasRequestIdElement() { - return this.requestId != null && !this.requestId.isEmpty(); - } - - public boolean hasRequestId() { - return this.requestId != null && !this.requestId.isEmpty(); - } - - /** - * @param value {@link #requestId} (The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.). This is the underlying object with id, value and extensions. The accessor "getRequestId" gives direct access to the value - */ - public GuidanceResponse setRequestIdElement(StringType value) { - this.requestId = value; - return this; - } - - /** - * @return The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. - */ - public String getRequestId() { - return this.requestId == null ? null : this.requestId.getValue(); - } - - /** - * @param value The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario. - */ - public GuidanceResponse setRequestId(String value) { - if (Utilities.noString(value)) - this.requestId = null; - else { - if (this.requestId == null) - this.requestId = new StringType(); - this.requestId.setValue(value); - } - return this; - } - - /** - * @return {@link #module} (A reference to the knowledge module that was invoked.) - */ - public Reference getModule() { - if (this.module == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.module"); - else if (Configuration.doAutoCreate()) - this.module = new Reference(); // cc - return this.module; - } - - public boolean hasModule() { - return this.module != null && !this.module.isEmpty(); - } - - /** - * @param value {@link #module} (A reference to the knowledge module that was invoked.) - */ - public GuidanceResponse setModule(Reference value) { - this.module = value; - return this; - } - - /** - * @return {@link #module} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the knowledge module that was invoked.) - */ - public Resource getModuleTarget() { - return this.moduleTarget; - } - - /** - * @param value {@link #module} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the knowledge module that was invoked.) - */ - public GuidanceResponse setModuleTarget(Resource value) { - this.moduleTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new GuidanceResponseStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public GuidanceResponse setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. - */ - public GuidanceResponseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information. - */ - public GuidanceResponse setStatus(GuidanceResponseStatus value) { - if (this.status == null) - this.status = new Enumeration(new GuidanceResponseStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #evaluationMessage} (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) - */ - public List getEvaluationMessage() { - if (this.evaluationMessage == null) - this.evaluationMessage = new ArrayList(); - return this.evaluationMessage; - } - - public boolean hasEvaluationMessage() { - if (this.evaluationMessage == null) - return false; - for (Reference item : this.evaluationMessage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #evaluationMessage} (Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) - */ - // syntactic sugar - public Reference addEvaluationMessage() { //3 - Reference t = new Reference(); - if (this.evaluationMessage == null) - this.evaluationMessage = new ArrayList(); - this.evaluationMessage.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponse addEvaluationMessage(Reference t) { //3 - if (t == null) - return this; - if (this.evaluationMessage == null) - this.evaluationMessage = new ArrayList(); - this.evaluationMessage.add(t); - return this; - } - - /** - * @return {@link #evaluationMessage} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) - */ - public List getEvaluationMessageTarget() { - if (this.evaluationMessageTarget == null) - this.evaluationMessageTarget = new ArrayList(); - return this.evaluationMessageTarget; - } - - // syntactic sugar - /** - * @return {@link #evaluationMessage} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.) - */ - public OperationOutcome addEvaluationMessageTarget() { - OperationOutcome r = new OperationOutcome(); - if (this.evaluationMessageTarget == null) - this.evaluationMessageTarget = new ArrayList(); - this.evaluationMessageTarget.add(r); - return r; - } - - /** - * @return {@link #outputParameters} (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) - */ - public Reference getOutputParameters() { - if (this.outputParameters == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.outputParameters"); - else if (Configuration.doAutoCreate()) - this.outputParameters = new Reference(); // cc - return this.outputParameters; - } - - public boolean hasOutputParameters() { - return this.outputParameters != null && !this.outputParameters.isEmpty(); - } - - /** - * @param value {@link #outputParameters} (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) - */ - public GuidanceResponse setOutputParameters(Reference value) { - this.outputParameters = value; - return this; - } - - /** - * @return {@link #outputParameters} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) - */ - public Parameters getOutputParametersTarget() { - if (this.outputParametersTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create GuidanceResponse.outputParameters"); - else if (Configuration.doAutoCreate()) - this.outputParametersTarget = new Parameters(); // aa - return this.outputParametersTarget; - } - - /** - * @param value {@link #outputParameters} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.) - */ - public GuidanceResponse setOutputParametersTarget(Parameters value) { - this.outputParametersTarget = value; - return this; - } - - /** - * @return {@link #action} (The actions, if any, produced by the evaluation of the artifact.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (GuidanceResponseActionComponent item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (The actions, if any, produced by the evaluation of the artifact.) - */ - // syntactic sugar - public GuidanceResponseActionComponent addAction() { //3 - GuidanceResponseActionComponent t = new GuidanceResponseActionComponent(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponse addAction(GuidanceResponseActionComponent t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - /** - * @return {@link #dataRequirement} (If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.) - */ - public List getDataRequirement() { - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - return this.dataRequirement; - } - - public boolean hasDataRequirement() { - if (this.dataRequirement == null) - return false; - for (DataRequirement item : this.dataRequirement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dataRequirement} (If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.) - */ - // syntactic sugar - public DataRequirement addDataRequirement() { //3 - DataRequirement t = new DataRequirement(); - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - this.dataRequirement.add(t); - return t; - } - - // syntactic sugar - public GuidanceResponse addDataRequirement(DataRequirement t) { //3 - if (t == null) - return this; - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - this.dataRequirement.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("requestId", "string", "The id of the request associated with this response. If an id was given as part of the request, it will be reproduced here to enable the requester to more easily identify the response in a multi-request scenario.", 0, java.lang.Integer.MAX_VALUE, requestId)); - childrenList.add(new Property("module", "Reference(DecisionSupportServiceModule|DecisionSupportRule)", "A reference to the knowledge module that was invoked.", 0, java.lang.Integer.MAX_VALUE, module)); - childrenList.add(new Property("status", "code", "The status of the response. If the evaluation is completed successfully, the status will indicate success. However, in order to complete the evaluation, the engine may require more information. In this case, the status will be data-required, and the response will contain a description of the additional required information. If the evaluation completed successfully, but the engine determines that a potentially more accurate response could be provided if more data was available, the status will be data-requested, and the response will contain a description of the additional requested information.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("evaluationMessage", "Reference(OperationOutcome)", "Messages resulting from the evaluation of the artifact or artifacts. As part of evaluating the request, the engine may produce informational or warning messages. These messages will be provided by this element.", 0, java.lang.Integer.MAX_VALUE, evaluationMessage)); - childrenList.add(new Property("outputParameters", "Reference(Parameters)", "The output parameters of the evaluation, if any. Many modules will result in the return of specific resources such as procedure or communication requests that are returned as part of the operation result. However, modules may define specific outputs that would be returned as the result of the evaluation, and these would be returned in this element.", 0, java.lang.Integer.MAX_VALUE, outputParameters)); - childrenList.add(new Property("action", "", "The actions, if any, produced by the evaluation of the artifact.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("dataRequirement", "DataRequirement", "If the evaluation could not be completed due to lack of information, or additional information would potentially result in a more accurate response, this element will a description of the data required in order to proceed with the evaluation. A subsequent request to the service should include this data.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 693933066: /*requestId*/ return this.requestId == null ? new Base[0] : new Base[] {this.requestId}; // StringType - case -1068784020: /*module*/ return this.module == null ? new Base[0] : new Base[] {this.module}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1081619755: /*evaluationMessage*/ return this.evaluationMessage == null ? new Base[0] : this.evaluationMessage.toArray(new Base[this.evaluationMessage.size()]); // Reference - case 525609419: /*outputParameters*/ return this.outputParameters == null ? new Base[0] : new Base[] {this.outputParameters}; // Reference - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // GuidanceResponseActionComponent - case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 693933066: // requestId - this.requestId = castToString(value); // StringType - break; - case -1068784020: // module - this.module = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new GuidanceResponseStatusEnumFactory().fromType(value); // Enumeration - break; - case 1081619755: // evaluationMessage - this.getEvaluationMessage().add(castToReference(value)); // Reference - break; - case 525609419: // outputParameters - this.outputParameters = castToReference(value); // Reference - break; - case -1422950858: // action - this.getAction().add((GuidanceResponseActionComponent) value); // GuidanceResponseActionComponent - break; - case 629147193: // dataRequirement - this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("requestId")) - this.requestId = castToString(value); // StringType - else if (name.equals("module")) - this.module = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new GuidanceResponseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("evaluationMessage")) - this.getEvaluationMessage().add(castToReference(value)); - else if (name.equals("outputParameters")) - this.outputParameters = castToReference(value); // Reference - else if (name.equals("action")) - this.getAction().add((GuidanceResponseActionComponent) value); - else if (name.equals("dataRequirement")) - this.getDataRequirement().add(castToDataRequirement(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 693933066: throw new FHIRException("Cannot make property requestId as it is not a complex type"); // StringType - case -1068784020: return getModule(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1081619755: return addEvaluationMessage(); // Reference - case 525609419: return getOutputParameters(); // Reference - case -1422950858: return addAction(); // GuidanceResponseActionComponent - case 629147193: return addDataRequirement(); // DataRequirement - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("requestId")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.requestId"); - } - else if (name.equals("module")) { - this.module = new Reference(); - return this.module; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type GuidanceResponse.status"); - } - else if (name.equals("evaluationMessage")) { - return addEvaluationMessage(); - } - else if (name.equals("outputParameters")) { - this.outputParameters = new Reference(); - return this.outputParameters; - } - else if (name.equals("action")) { - return addAction(); - } - else if (name.equals("dataRequirement")) { - return addDataRequirement(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "GuidanceResponse"; - - } - - public GuidanceResponse copy() { - GuidanceResponse dst = new GuidanceResponse(); - copyValues(dst); - dst.requestId = requestId == null ? null : requestId.copy(); - dst.module = module == null ? null : module.copy(); - dst.status = status == null ? null : status.copy(); - if (evaluationMessage != null) { - dst.evaluationMessage = new ArrayList(); - for (Reference i : evaluationMessage) - dst.evaluationMessage.add(i.copy()); - }; - dst.outputParameters = outputParameters == null ? null : outputParameters.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (GuidanceResponseActionComponent i : action) - dst.action.add(i.copy()); - }; - if (dataRequirement != null) { - dst.dataRequirement = new ArrayList(); - for (DataRequirement i : dataRequirement) - dst.dataRequirement.add(i.copy()); - }; - return dst; - } - - protected GuidanceResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof GuidanceResponse)) - return false; - GuidanceResponse o = (GuidanceResponse) other; - return compareDeep(requestId, o.requestId, true) && compareDeep(module, o.module, true) && compareDeep(status, o.status, true) - && compareDeep(evaluationMessage, o.evaluationMessage, true) && compareDeep(outputParameters, o.outputParameters, true) - && compareDeep(action, o.action, true) && compareDeep(dataRequirement, o.dataRequirement, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof GuidanceResponse)) - return false; - GuidanceResponse o = (GuidanceResponse) other; - return compareValues(requestId, o.requestId, true) && compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (requestId == null || requestId.isEmpty()) && (module == null || module.isEmpty()) - && (status == null || status.isEmpty()) && (evaluationMessage == null || evaluationMessage.isEmpty()) - && (outputParameters == null || outputParameters.isEmpty()) && (action == null || action.isEmpty()) - && (dataRequirement == null || dataRequirement.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.GuidanceResponse; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/HealthcareService.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/HealthcareService.java deleted file mode 100644 index 4ffbeee5231..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/HealthcareService.java +++ /dev/null @@ -1,2578 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The details of a healthcare service available at a location. - */ -@ResourceDef(name="HealthcareService", profile="http://hl7.org/fhir/Profile/HealthcareService") -public class HealthcareService extends DomainResource { - - public enum DaysOfWeek { - /** - * Monday - */ - MON, - /** - * Tuesday - */ - TUE, - /** - * Wednesday - */ - WED, - /** - * Thursday - */ - THU, - /** - * Friday - */ - FRI, - /** - * Saturday - */ - SAT, - /** - * Sunday - */ - SUN, - /** - * added to help the parsers - */ - NULL; - public static DaysOfWeek fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("mon".equals(codeString)) - return MON; - if ("tue".equals(codeString)) - return TUE; - if ("wed".equals(codeString)) - return WED; - if ("thu".equals(codeString)) - return THU; - if ("fri".equals(codeString)) - return FRI; - if ("sat".equals(codeString)) - return SAT; - if ("sun".equals(codeString)) - return SUN; - throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MON: return "mon"; - case TUE: return "tue"; - case WED: return "wed"; - case THU: return "thu"; - case FRI: return "fri"; - case SAT: return "sat"; - case SUN: return "sun"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MON: return "http://hl7.org/fhir/days-of-week"; - case TUE: return "http://hl7.org/fhir/days-of-week"; - case WED: return "http://hl7.org/fhir/days-of-week"; - case THU: return "http://hl7.org/fhir/days-of-week"; - case FRI: return "http://hl7.org/fhir/days-of-week"; - case SAT: return "http://hl7.org/fhir/days-of-week"; - case SUN: return "http://hl7.org/fhir/days-of-week"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MON: return "Monday"; - case TUE: return "Tuesday"; - case WED: return "Wednesday"; - case THU: return "Thursday"; - case FRI: return "Friday"; - case SAT: return "Saturday"; - case SUN: return "Sunday"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MON: return "Monday"; - case TUE: return "Tuesday"; - case WED: return "Wednesday"; - case THU: return "Thursday"; - case FRI: return "Friday"; - case SAT: return "Saturday"; - case SUN: return "Sunday"; - default: return "?"; - } - } - } - - public static class DaysOfWeekEnumFactory implements EnumFactory { - public DaysOfWeek fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("mon".equals(codeString)) - return DaysOfWeek.MON; - if ("tue".equals(codeString)) - return DaysOfWeek.TUE; - if ("wed".equals(codeString)) - return DaysOfWeek.WED; - if ("thu".equals(codeString)) - return DaysOfWeek.THU; - if ("fri".equals(codeString)) - return DaysOfWeek.FRI; - if ("sat".equals(codeString)) - return DaysOfWeek.SAT; - if ("sun".equals(codeString)) - return DaysOfWeek.SUN; - throw new IllegalArgumentException("Unknown DaysOfWeek code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("mon".equals(codeString)) - return new Enumeration(this, DaysOfWeek.MON); - if ("tue".equals(codeString)) - return new Enumeration(this, DaysOfWeek.TUE); - if ("wed".equals(codeString)) - return new Enumeration(this, DaysOfWeek.WED); - if ("thu".equals(codeString)) - return new Enumeration(this, DaysOfWeek.THU); - if ("fri".equals(codeString)) - return new Enumeration(this, DaysOfWeek.FRI); - if ("sat".equals(codeString)) - return new Enumeration(this, DaysOfWeek.SAT); - if ("sun".equals(codeString)) - return new Enumeration(this, DaysOfWeek.SUN); - throw new FHIRException("Unknown DaysOfWeek code '"+codeString+"'"); - } - public String toCode(DaysOfWeek code) { - if (code == DaysOfWeek.MON) - return "mon"; - if (code == DaysOfWeek.TUE) - return "tue"; - if (code == DaysOfWeek.WED) - return "wed"; - if (code == DaysOfWeek.THU) - return "thu"; - if (code == DaysOfWeek.FRI) - return "fri"; - if (code == DaysOfWeek.SAT) - return "sat"; - if (code == DaysOfWeek.SUN) - return "sun"; - return "?"; - } - public String toSystem(DaysOfWeek code) { - return code.getSystem(); - } - } - - @Block() - public static class HealthcareServiceAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates which days of the week are available between the start and end Times. - */ - @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which days of the week are available between the start and end Times." ) - protected List> daysOfWeek; - - /** - * Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Always available? e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) - protected BooleanType allDay; - - /** - * The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Opening time of day (ignored if allDay = true)", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." ) - protected TimeType availableStartTime; - - /** - * The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Closing time of day (ignored if allDay = true)", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." ) - protected TimeType availableEndTime; - - private static final long serialVersionUID = -2139510127L; - - /** - * Constructor - */ - public HealthcareServiceAvailableTimeComponent() { - super(); - } - - /** - * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - public List> getDaysOfWeek() { - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList>(); - return this.daysOfWeek; - } - - public boolean hasDaysOfWeek() { - if (this.daysOfWeek == null) - return false; - for (Enumeration item : this.daysOfWeek) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - // syntactic sugar - public Enumeration addDaysOfWeekElement() {//2 - Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList>(); - this.daysOfWeek.add(t); - return t; - } - - /** - * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - public HealthcareServiceAvailableTimeComponent addDaysOfWeek(DaysOfWeek value) { //1 - Enumeration t = new Enumeration(new DaysOfWeekEnumFactory()); - t.setValue(value); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList>(); - this.daysOfWeek.add(t); - return this; - } - - /** - * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - public boolean hasDaysOfWeek(DaysOfWeek value) { - if (this.daysOfWeek == null) - return false; - for (Enumeration v : this.daysOfWeek) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public BooleanType getAllDayElement() { - if (this.allDay == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.allDay"); - else if (Configuration.doAutoCreate()) - this.allDay = new BooleanType(); // bb - return this.allDay; - } - - public boolean hasAllDayElement() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - public boolean hasAllDay() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - /** - * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAllDayElement(BooleanType value) { - this.allDay = value; - return this; - } - - /** - * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public boolean getAllDay() { - return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue(); - } - - /** - * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public HealthcareServiceAvailableTimeComponent setAllDay(boolean value) { - if (this.allDay == null) - this.allDay = new BooleanType(); - this.allDay.setValue(value); - return this; - } - - /** - * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public TimeType getAvailableStartTimeElement() { - if (this.availableStartTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableStartTime"); - else if (Configuration.doAutoCreate()) - this.availableStartTime = new TimeType(); // bb - return this.availableStartTime; - } - - public boolean hasAvailableStartTimeElement() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - public boolean hasAvailableStartTime() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - /** - * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { - this.availableStartTime = value; - return this; - } - - /** - * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public String getAvailableStartTime() { - return this.availableStartTime == null ? null : this.availableStartTime.getValue(); - } - - /** - * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public HealthcareServiceAvailableTimeComponent setAvailableStartTime(String value) { - if (value == null) - this.availableStartTime = null; - else { - if (this.availableStartTime == null) - this.availableStartTime = new TimeType(); - this.availableStartTime.setValue(value); - } - return this; - } - - /** - * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public TimeType getAvailableEndTimeElement() { - if (this.availableEndTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceAvailableTimeComponent.availableEndTime"); - else if (Configuration.doAutoCreate()) - this.availableEndTime = new TimeType(); // bb - return this.availableEndTime; - } - - public boolean hasAvailableEndTimeElement() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - public boolean hasAvailableEndTime() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - /** - * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public HealthcareServiceAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { - this.availableEndTime = value; - return this; - } - - /** - * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public String getAvailableEndTime() { - return this.availableEndTime == null ? null : this.availableEndTime.getValue(); - } - - /** - * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public HealthcareServiceAvailableTimeComponent setAvailableEndTime(String value) { - if (value == null) - this.availableEndTime = null; - else { - if (this.availableEndTime == null) - this.availableEndTime = new TimeType(); - this.availableEndTime.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("daysOfWeek", "code", "Indicates which days of the week are available between the start and end Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); - childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); - childrenList.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); - childrenList.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 68050338: /*daysOfWeek*/ return this.daysOfWeek == null ? new Base[0] : this.daysOfWeek.toArray(new Base[this.daysOfWeek.size()]); // Enumeration - case -1414913477: /*allDay*/ return this.allDay == null ? new Base[0] : new Base[] {this.allDay}; // BooleanType - case -1039453818: /*availableStartTime*/ return this.availableStartTime == null ? new Base[0] : new Base[] {this.availableStartTime}; // TimeType - case 101151551: /*availableEndTime*/ return this.availableEndTime == null ? new Base[0] : new Base[] {this.availableEndTime}; // TimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 68050338: // daysOfWeek - this.getDaysOfWeek().add(new DaysOfWeekEnumFactory().fromType(value)); // Enumeration - break; - case -1414913477: // allDay - this.allDay = castToBoolean(value); // BooleanType - break; - case -1039453818: // availableStartTime - this.availableStartTime = castToTime(value); // TimeType - break; - case 101151551: // availableEndTime - this.availableEndTime = castToTime(value); // TimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("daysOfWeek")) - this.getDaysOfWeek().add(new DaysOfWeekEnumFactory().fromType(value)); - else if (name.equals("allDay")) - this.allDay = castToBoolean(value); // BooleanType - else if (name.equals("availableStartTime")) - this.availableStartTime = castToTime(value); // TimeType - else if (name.equals("availableEndTime")) - this.availableEndTime = castToTime(value); // TimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 68050338: throw new FHIRException("Cannot make property daysOfWeek as it is not a complex type"); // Enumeration - case -1414913477: throw new FHIRException("Cannot make property allDay as it is not a complex type"); // BooleanType - case -1039453818: throw new FHIRException("Cannot make property availableStartTime as it is not a complex type"); // TimeType - case 101151551: throw new FHIRException("Cannot make property availableEndTime as it is not a complex type"); // TimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("daysOfWeek")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.daysOfWeek"); - } - else if (name.equals("allDay")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.allDay"); - } - else if (name.equals("availableStartTime")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availableStartTime"); - } - else if (name.equals("availableEndTime")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availableEndTime"); - } - else - return super.addChild(name); - } - - public HealthcareServiceAvailableTimeComponent copy() { - HealthcareServiceAvailableTimeComponent dst = new HealthcareServiceAvailableTimeComponent(); - copyValues(dst); - if (daysOfWeek != null) { - dst.daysOfWeek = new ArrayList>(); - for (Enumeration i : daysOfWeek) - dst.daysOfWeek.add(i.copy()); - }; - dst.allDay = allDay == null ? null : allDay.copy(); - dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); - dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HealthcareServiceAvailableTimeComponent)) - return false; - HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; - return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true) - && compareDeep(availableEndTime, o.availableEndTime, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HealthcareServiceAvailableTimeComponent)) - return false; - HealthcareServiceAvailableTimeComponent o = (HealthcareServiceAvailableTimeComponent) other; - return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true) - && compareValues(availableEndTime, o.availableEndTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) - && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) - ; - } - - public String fhirType() { - return "HealthcareService.availableTime"; - - } - - } - - @Block() - public static class HealthcareServiceNotAvailableComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The reason that can be presented to the user as to why this time is not available. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reason presented to the user explaining why time not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) - protected StringType description; - - /** - * Service is not available (seasonally or for a public holiday) from this date. - */ - @Child(name = "during", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Service not availablefrom this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) - protected Period during; - - private static final long serialVersionUID = 310849929L; - - /** - * Constructor - */ - public HealthcareServiceNotAvailableComponent() { - super(); - } - - /** - * Constructor - */ - public HealthcareServiceNotAvailableComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public HealthcareServiceNotAvailableComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason that can be presented to the user as to why this time is not available. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason that can be presented to the user as to why this time is not available. - */ - public HealthcareServiceNotAvailableComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) - */ - public Period getDuring() { - if (this.during == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareServiceNotAvailableComponent.during"); - else if (Configuration.doAutoCreate()) - this.during = new Period(); // cc - return this.during; - } - - public boolean hasDuring() { - return this.during != null && !this.during.isEmpty(); - } - - /** - * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) - */ - public HealthcareServiceNotAvailableComponent setDuring(Period value) { - this.during = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, during)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1320499647: /*during*/ return this.during == null ? new Base[0] : new Base[] {this.during}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1320499647: // during - this.during = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("during")) - this.during = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1320499647: return getDuring(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.description"); - } - else if (name.equals("during")) { - this.during = new Period(); - return this.during; - } - else - return super.addChild(name); - } - - public HealthcareServiceNotAvailableComponent copy() { - HealthcareServiceNotAvailableComponent dst = new HealthcareServiceNotAvailableComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.during = during == null ? null : during.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HealthcareServiceNotAvailableComponent)) - return false; - HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; - return compareDeep(description, o.description, true) && compareDeep(during, o.during, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HealthcareServiceNotAvailableComponent)) - return false; - HealthcareServiceNotAvailableComponent o = (HealthcareServiceNotAvailableComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty()) - ; - } - - public String fhirType() { - return "HealthcareService.notAvailable"; - - } - - } - - /** - * External identifiers for this item. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External identifiers for this item", formalDefinition="External identifiers for this item." ) - protected List identifier; - - /** - * The organization that provides this healthcare service. - */ - @Child(name = "providedBy", type = {Organization.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization that provides this service", formalDefinition="The organization that provides this healthcare service." ) - protected Reference providedBy; - - /** - * The actual object that is the target of the reference (The organization that provides this healthcare service.) - */ - protected Organization providedByTarget; - - /** - * Identifies the broad category of service being performed or delivered. - */ - @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Broad category of service being performed or delivered", formalDefinition="Identifies the broad category of service being performed or delivered." ) - protected CodeableConcept serviceCategory; - - /** - * The specific type of service that may be delivered or performed. - */ - @Child(name = "serviceType", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Type of service that may be delivered or performed", formalDefinition="The specific type of service that may be delivered or performed." ) - protected List serviceType; - - /** - * Collection of specialties handled by the service site. This is more of a medical term. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Specialties handled by the HealthcareService", formalDefinition="Collection of specialties handled by the service site. This is more of a medical term." ) - protected List specialty; - - /** - * The location(s) where this healthcare service may be provided. - */ - @Child(name = "location", type = {Location.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Location(s) where service may be provided", formalDefinition="The location(s) where this healthcare service may be provided." ) - protected List location; - /** - * The actual objects that are the target of the reference (The location(s) where this healthcare service may be provided.) - */ - protected List locationTarget; - - - /** - * Further description of the service as it would be presented to a consumer while searching. - */ - @Child(name = "serviceName", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of service as presented to a consumer while searching", formalDefinition="Further description of the service as it would be presented to a consumer while searching." ) - protected StringType serviceName; - - /** - * Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - @Child(name = "comment", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional description and/or any specific issues not covered elsewhere", formalDefinition="Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName." ) - protected StringType comment; - - /** - * Extra details about the service that can't be placed in the other fields. - */ - @Child(name = "extraDetails", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Extra details about the service that can't be placed in the other fields", formalDefinition="Extra details about the service that can't be placed in the other fields." ) - protected StringType extraDetails; - - /** - * If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list. - */ - @Child(name = "photo", type = {Attachment.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Facilitates quick identification of the service", formalDefinition="If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list." ) - protected Attachment photo; - - /** - * List of contacts related to this specific healthcare service. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contacts related to the healthcare service", formalDefinition="List of contacts related to this specific healthcare service." ) - protected List telecom; - - /** - * The location(s) that this service is available to (not where the service is provided). - */ - @Child(name = "coverageArea", type = {Location.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Location(s) service is inteded for/available to", formalDefinition="The location(s) that this service is available to (not where the service is provided)." ) - protected List coverageArea; - /** - * The actual objects that are the target of the reference (The location(s) that this service is available to (not where the service is provided).) - */ - protected List coverageAreaTarget; - - - /** - * The code(s) that detail the conditions under which the healthcare service is available/offered. - */ - @Child(name = "serviceProvisionCode", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Conditions under which service is available/offered", formalDefinition="The code(s) that detail the conditions under which the healthcare service is available/offered." ) - protected List serviceProvisionCode; - - /** - * Does this service have specific eligibility requirements that need to be met in order to use the service? - */ - @Child(name = "eligibility", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specific eligibility requirements required to use the service", formalDefinition="Does this service have specific eligibility requirements that need to be met in order to use the service?" ) - protected CodeableConcept eligibility; - - /** - * Describes the eligibility conditions for the service. - */ - @Child(name = "eligibilityNote", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Describes the eligibility conditions for the service", formalDefinition="Describes the eligibility conditions for the service." ) - protected StringType eligibilityNote; - - /** - * Program Names that can be used to categorize the service. - */ - @Child(name = "programName", type = {StringType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Program Names that categorize the service", formalDefinition="Program Names that can be used to categorize the service." ) - protected List programName; - - /** - * Collection of characteristics (attributes). - */ - @Child(name = "characteristic", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Collection of characteristics (attributes)", formalDefinition="Collection of characteristics (attributes)." ) - protected List characteristic; - - /** - * Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required. - */ - @Child(name = "referralMethod", type = {CodeableConcept.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Ways that the service accepts referrals", formalDefinition="Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required." ) - protected List referralMethod; - - /** - * The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - @Child(name = "publicKey", type = {StringType.class}, order=18, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="PKI Public keys to support secure communications", formalDefinition="The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available." ) - protected StringType publicKey; - - /** - * Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. - */ - @Child(name = "appointmentRequired", type = {BooleanType.class}, order=19, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If an appointment is required for access to this service", formalDefinition="Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service." ) - protected BooleanType appointmentRequired; - - /** - * A collection of times that the Service Site is available. - */ - @Child(name = "availableTime", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Times the Service Site is available", formalDefinition="A collection of times that the Service Site is available." ) - protected List availableTime; - - /** - * The HealthcareService is not available during this period of time due to the provided reason. - */ - @Child(name = "notAvailable", type = {}, order=21, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Not available during this time due to provided reason", formalDefinition="The HealthcareService is not available during this period of time due to the provided reason." ) - protected List notAvailable; - - /** - * A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. - */ - @Child(name = "availabilityExceptions", type = {StringType.class}, order=22, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description of availability exceptions", formalDefinition="A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times." ) - protected StringType availabilityExceptions; - - private static final long serialVersionUID = -874217100L; - - /** - * Constructor - */ - public HealthcareService() { - super(); - } - - /** - * @return {@link #identifier} (External identifiers for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External identifiers for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #providedBy} (The organization that provides this healthcare service.) - */ - public Reference getProvidedBy() { - if (this.providedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.providedBy"); - else if (Configuration.doAutoCreate()) - this.providedBy = new Reference(); // cc - return this.providedBy; - } - - public boolean hasProvidedBy() { - return this.providedBy != null && !this.providedBy.isEmpty(); - } - - /** - * @param value {@link #providedBy} (The organization that provides this healthcare service.) - */ - public HealthcareService setProvidedBy(Reference value) { - this.providedBy = value; - return this; - } - - /** - * @return {@link #providedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that provides this healthcare service.) - */ - public Organization getProvidedByTarget() { - if (this.providedByTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.providedBy"); - else if (Configuration.doAutoCreate()) - this.providedByTarget = new Organization(); // aa - return this.providedByTarget; - } - - /** - * @param value {@link #providedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that provides this healthcare service.) - */ - public HealthcareService setProvidedByTarget(Organization value) { - this.providedByTarget = value; - return this; - } - - /** - * @return {@link #serviceCategory} (Identifies the broad category of service being performed or delivered.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); // cc - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (Identifies the broad category of service being performed or delivered.) - */ - public HealthcareService setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #serviceType} (The specific type of service that may be delivered or performed.) - */ - public List getServiceType() { - if (this.serviceType == null) - this.serviceType = new ArrayList(); - return this.serviceType; - } - - public boolean hasServiceType() { - if (this.serviceType == null) - return false; - for (CodeableConcept item : this.serviceType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceType} (The specific type of service that may be delivered or performed.) - */ - // syntactic sugar - public CodeableConcept addServiceType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addServiceType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return this; - } - - /** - * @return {@link #specialty} (Collection of specialties handled by the service site. This is more of a medical term.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Collection of specialties handled by the service site. This is more of a medical term.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #location} (The location(s) where this healthcare service may be provided.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (Reference item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The location(s) where this healthcare service may be provided.) - */ - // syntactic sugar - public Reference addLocation() { //3 - Reference t = new Reference(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addLocation(Reference t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) where this healthcare service may be provided.) - */ - public List getLocationTarget() { - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - return this.locationTarget; - } - - // syntactic sugar - /** - * @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) where this healthcare service may be provided.) - */ - public Location addLocationTarget() { - Location r = new Location(); - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - this.locationTarget.add(r); - return r; - } - - /** - * @return {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value - */ - public StringType getServiceNameElement() { - if (this.serviceName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.serviceName"); - else if (Configuration.doAutoCreate()) - this.serviceName = new StringType(); // bb - return this.serviceName; - } - - public boolean hasServiceNameElement() { - return this.serviceName != null && !this.serviceName.isEmpty(); - } - - public boolean hasServiceName() { - return this.serviceName != null && !this.serviceName.isEmpty(); - } - - /** - * @param value {@link #serviceName} (Further description of the service as it would be presented to a consumer while searching.). This is the underlying object with id, value and extensions. The accessor "getServiceName" gives direct access to the value - */ - public HealthcareService setServiceNameElement(StringType value) { - this.serviceName = value; - return this; - } - - /** - * @return Further description of the service as it would be presented to a consumer while searching. - */ - public String getServiceName() { - return this.serviceName == null ? null : this.serviceName.getValue(); - } - - /** - * @param value Further description of the service as it would be presented to a consumer while searching. - */ - public HealthcareService setServiceName(String value) { - if (Utilities.noString(value)) - this.serviceName = null; - else { - if (this.serviceName == null) - this.serviceName = new StringType(); - this.serviceName.setValue(value); - } - return this; - } - - /** - * @return {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public HealthcareService setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName. - */ - public HealthcareService setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value - */ - public StringType getExtraDetailsElement() { - if (this.extraDetails == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.extraDetails"); - else if (Configuration.doAutoCreate()) - this.extraDetails = new StringType(); // bb - return this.extraDetails; - } - - public boolean hasExtraDetailsElement() { - return this.extraDetails != null && !this.extraDetails.isEmpty(); - } - - public boolean hasExtraDetails() { - return this.extraDetails != null && !this.extraDetails.isEmpty(); - } - - /** - * @param value {@link #extraDetails} (Extra details about the service that can't be placed in the other fields.). This is the underlying object with id, value and extensions. The accessor "getExtraDetails" gives direct access to the value - */ - public HealthcareService setExtraDetailsElement(StringType value) { - this.extraDetails = value; - return this; - } - - /** - * @return Extra details about the service that can't be placed in the other fields. - */ - public String getExtraDetails() { - return this.extraDetails == null ? null : this.extraDetails.getValue(); - } - - /** - * @param value Extra details about the service that can't be placed in the other fields. - */ - public HealthcareService setExtraDetails(String value) { - if (Utilities.noString(value)) - this.extraDetails = null; - else { - if (this.extraDetails == null) - this.extraDetails = new StringType(); - this.extraDetails.setValue(value); - } - return this; - } - - /** - * @return {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) - */ - public Attachment getPhoto() { - if (this.photo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.photo"); - else if (Configuration.doAutoCreate()) - this.photo = new Attachment(); // cc - return this.photo; - } - - public boolean hasPhoto() { - return this.photo != null && !this.photo.isEmpty(); - } - - /** - * @param value {@link #photo} (If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.) - */ - public HealthcareService setPhoto(Attachment value) { - this.photo = value; - return this; - } - - /** - * @return {@link #telecom} (List of contacts related to this specific healthcare service.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (List of contacts related to this specific healthcare service.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) - */ - public List getCoverageArea() { - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - return this.coverageArea; - } - - public boolean hasCoverageArea() { - if (this.coverageArea == null) - return false; - for (Reference item : this.coverageArea) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverageArea} (The location(s) that this service is available to (not where the service is provided).) - */ - // syntactic sugar - public Reference addCoverageArea() { //3 - Reference t = new Reference(); - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - this.coverageArea.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addCoverageArea(Reference t) { //3 - if (t == null) - return this; - if (this.coverageArea == null) - this.coverageArea = new ArrayList(); - this.coverageArea.add(t); - return this; - } - - /** - * @return {@link #coverageArea} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) that this service is available to (not where the service is provided).) - */ - public List getCoverageAreaTarget() { - if (this.coverageAreaTarget == null) - this.coverageAreaTarget = new ArrayList(); - return this.coverageAreaTarget; - } - - // syntactic sugar - /** - * @return {@link #coverageArea} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) that this service is available to (not where the service is provided).) - */ - public Location addCoverageAreaTarget() { - Location r = new Location(); - if (this.coverageAreaTarget == null) - this.coverageAreaTarget = new ArrayList(); - this.coverageAreaTarget.add(r); - return r; - } - - /** - * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) - */ - public List getServiceProvisionCode() { - if (this.serviceProvisionCode == null) - this.serviceProvisionCode = new ArrayList(); - return this.serviceProvisionCode; - } - - public boolean hasServiceProvisionCode() { - if (this.serviceProvisionCode == null) - return false; - for (CodeableConcept item : this.serviceProvisionCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceProvisionCode} (The code(s) that detail the conditions under which the healthcare service is available/offered.) - */ - // syntactic sugar - public CodeableConcept addServiceProvisionCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceProvisionCode == null) - this.serviceProvisionCode = new ArrayList(); - this.serviceProvisionCode.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addServiceProvisionCode(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceProvisionCode == null) - this.serviceProvisionCode = new ArrayList(); - this.serviceProvisionCode.add(t); - return this; - } - - /** - * @return {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service?) - */ - public CodeableConcept getEligibility() { - if (this.eligibility == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.eligibility"); - else if (Configuration.doAutoCreate()) - this.eligibility = new CodeableConcept(); // cc - return this.eligibility; - } - - public boolean hasEligibility() { - return this.eligibility != null && !this.eligibility.isEmpty(); - } - - /** - * @param value {@link #eligibility} (Does this service have specific eligibility requirements that need to be met in order to use the service?) - */ - public HealthcareService setEligibility(CodeableConcept value) { - this.eligibility = value; - return this; - } - - /** - * @return {@link #eligibilityNote} (Describes the eligibility conditions for the service.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value - */ - public StringType getEligibilityNoteElement() { - if (this.eligibilityNote == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.eligibilityNote"); - else if (Configuration.doAutoCreate()) - this.eligibilityNote = new StringType(); // bb - return this.eligibilityNote; - } - - public boolean hasEligibilityNoteElement() { - return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); - } - - public boolean hasEligibilityNote() { - return this.eligibilityNote != null && !this.eligibilityNote.isEmpty(); - } - - /** - * @param value {@link #eligibilityNote} (Describes the eligibility conditions for the service.). This is the underlying object with id, value and extensions. The accessor "getEligibilityNote" gives direct access to the value - */ - public HealthcareService setEligibilityNoteElement(StringType value) { - this.eligibilityNote = value; - return this; - } - - /** - * @return Describes the eligibility conditions for the service. - */ - public String getEligibilityNote() { - return this.eligibilityNote == null ? null : this.eligibilityNote.getValue(); - } - - /** - * @param value Describes the eligibility conditions for the service. - */ - public HealthcareService setEligibilityNote(String value) { - if (Utilities.noString(value)) - this.eligibilityNote = null; - else { - if (this.eligibilityNote == null) - this.eligibilityNote = new StringType(); - this.eligibilityNote.setValue(value); - } - return this; - } - - /** - * @return {@link #programName} (Program Names that can be used to categorize the service.) - */ - public List getProgramName() { - if (this.programName == null) - this.programName = new ArrayList(); - return this.programName; - } - - public boolean hasProgramName() { - if (this.programName == null) - return false; - for (StringType item : this.programName) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #programName} (Program Names that can be used to categorize the service.) - */ - // syntactic sugar - public StringType addProgramNameElement() {//2 - StringType t = new StringType(); - if (this.programName == null) - this.programName = new ArrayList(); - this.programName.add(t); - return t; - } - - /** - * @param value {@link #programName} (Program Names that can be used to categorize the service.) - */ - public HealthcareService addProgramName(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.programName == null) - this.programName = new ArrayList(); - this.programName.add(t); - return this; - } - - /** - * @param value {@link #programName} (Program Names that can be used to categorize the service.) - */ - public boolean hasProgramName(String value) { - if (this.programName == null) - return false; - for (StringType v : this.programName) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #characteristic} (Collection of characteristics (attributes).) - */ - public List getCharacteristic() { - if (this.characteristic == null) - this.characteristic = new ArrayList(); - return this.characteristic; - } - - public boolean hasCharacteristic() { - if (this.characteristic == null) - return false; - for (CodeableConcept item : this.characteristic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #characteristic} (Collection of characteristics (attributes).) - */ - // syntactic sugar - public CodeableConcept addCharacteristic() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addCharacteristic(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.characteristic == null) - this.characteristic = new ArrayList(); - this.characteristic.add(t); - return this; - } - - /** - * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) - */ - public List getReferralMethod() { - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - return this.referralMethod; - } - - public boolean hasReferralMethod() { - if (this.referralMethod == null) - return false; - for (CodeableConcept item : this.referralMethod) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referralMethod} (Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.) - */ - // syntactic sugar - public CodeableConcept addReferralMethod() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - this.referralMethod.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addReferralMethod(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.referralMethod == null) - this.referralMethod = new ArrayList(); - this.referralMethod.add(t); - return this; - } - - /** - * @return {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value - */ - public StringType getPublicKeyElement() { - if (this.publicKey == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.publicKey"); - else if (Configuration.doAutoCreate()) - this.publicKey = new StringType(); // bb - return this.publicKey; - } - - public boolean hasPublicKeyElement() { - return this.publicKey != null && !this.publicKey.isEmpty(); - } - - public boolean hasPublicKey() { - return this.publicKey != null && !this.publicKey.isEmpty(); - } - - /** - * @param value {@link #publicKey} (The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.). This is the underlying object with id, value and extensions. The accessor "getPublicKey" gives direct access to the value - */ - public HealthcareService setPublicKeyElement(StringType value) { - this.publicKey = value; - return this; - } - - /** - * @return The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - public String getPublicKey() { - return this.publicKey == null ? null : this.publicKey.getValue(); - } - - /** - * @param value The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available. - */ - public HealthcareService setPublicKey(String value) { - if (Utilities.noString(value)) - this.publicKey = null; - else { - if (this.publicKey == null) - this.publicKey = new StringType(); - this.publicKey.setValue(value); - } - return this; - } - - /** - * @return {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value - */ - public BooleanType getAppointmentRequiredElement() { - if (this.appointmentRequired == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.appointmentRequired"); - else if (Configuration.doAutoCreate()) - this.appointmentRequired = new BooleanType(); // bb - return this.appointmentRequired; - } - - public boolean hasAppointmentRequiredElement() { - return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); - } - - public boolean hasAppointmentRequired() { - return this.appointmentRequired != null && !this.appointmentRequired.isEmpty(); - } - - /** - * @param value {@link #appointmentRequired} (Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.). This is the underlying object with id, value and extensions. The accessor "getAppointmentRequired" gives direct access to the value - */ - public HealthcareService setAppointmentRequiredElement(BooleanType value) { - this.appointmentRequired = value; - return this; - } - - /** - * @return Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. - */ - public boolean getAppointmentRequired() { - return this.appointmentRequired == null || this.appointmentRequired.isEmpty() ? false : this.appointmentRequired.getValue(); - } - - /** - * @param value Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service. - */ - public HealthcareService setAppointmentRequired(boolean value) { - if (this.appointmentRequired == null) - this.appointmentRequired = new BooleanType(); - this.appointmentRequired.setValue(value); - return this; - } - - /** - * @return {@link #availableTime} (A collection of times that the Service Site is available.) - */ - public List getAvailableTime() { - if (this.availableTime == null) - this.availableTime = new ArrayList(); - return this.availableTime; - } - - public boolean hasAvailableTime() { - if (this.availableTime == null) - return false; - for (HealthcareServiceAvailableTimeComponent item : this.availableTime) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #availableTime} (A collection of times that the Service Site is available.) - */ - // syntactic sugar - public HealthcareServiceAvailableTimeComponent addAvailableTime() { //3 - HealthcareServiceAvailableTimeComponent t = new HealthcareServiceAvailableTimeComponent(); - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addAvailableTime(HealthcareServiceAvailableTimeComponent t) { //3 - if (t == null) - return this; - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return this; - } - - /** - * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) - */ - public List getNotAvailable() { - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - return this.notAvailable; - } - - public boolean hasNotAvailable() { - if (this.notAvailable == null) - return false; - for (HealthcareServiceNotAvailableComponent item : this.notAvailable) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) - */ - // syntactic sugar - public HealthcareServiceNotAvailableComponent addNotAvailable() { //3 - HealthcareServiceNotAvailableComponent t = new HealthcareServiceNotAvailableComponent(); - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - this.notAvailable.add(t); - return t; - } - - // syntactic sugar - public HealthcareService addNotAvailable(HealthcareServiceNotAvailableComponent t) { //3 - if (t == null) - return this; - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - this.notAvailable.add(t); - return this; - } - - /** - * @return {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public StringType getAvailabilityExceptionsElement() { - if (this.availabilityExceptions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HealthcareService.availabilityExceptions"); - else if (Configuration.doAutoCreate()) - this.availabilityExceptions = new StringType(); // bb - return this.availabilityExceptions; - } - - public boolean hasAvailabilityExceptionsElement() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - public boolean hasAvailabilityExceptions() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - /** - * @param value {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public HealthcareService setAvailabilityExceptionsElement(StringType value) { - this.availabilityExceptions = value; - return this; - } - - /** - * @return A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. - */ - public String getAvailabilityExceptions() { - return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); - } - - /** - * @param value A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. - */ - public HealthcareService setAvailabilityExceptions(String value) { - if (Utilities.noString(value)) - this.availabilityExceptions = null; - else { - if (this.availabilityExceptions == null) - this.availabilityExceptions = new StringType(); - this.availabilityExceptions.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifiers for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("providedBy", "Reference(Organization)", "The organization that provides this healthcare service.", 0, java.lang.Integer.MAX_VALUE, providedBy)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "Identifies the broad category of service being performed or delivered.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("serviceType", "CodeableConcept", "The specific type of service that may be delivered or performed.", 0, java.lang.Integer.MAX_VALUE, serviceType)); - childrenList.add(new Property("specialty", "CodeableConcept", "Collection of specialties handled by the service site. This is more of a medical term.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("location", "Reference(Location)", "The location(s) where this healthcare service may be provided.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("serviceName", "string", "Further description of the service as it would be presented to a consumer while searching.", 0, java.lang.Integer.MAX_VALUE, serviceName)); - childrenList.add(new Property("comment", "string", "Any additional description of the service and/or any specific issues not covered by the other attributes, which can be displayed as further detail under the serviceName.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("extraDetails", "string", "Extra details about the service that can't be placed in the other fields.", 0, java.lang.Integer.MAX_VALUE, extraDetails)); - childrenList.add(new Property("photo", "Attachment", "If there is a photo/symbol associated with this HealthcareService, it may be included here to facilitate quick identification of the service in a list.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("telecom", "ContactPoint", "List of contacts related to this specific healthcare service.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("coverageArea", "Reference(Location)", "The location(s) that this service is available to (not where the service is provided).", 0, java.lang.Integer.MAX_VALUE, coverageArea)); - childrenList.add(new Property("serviceProvisionCode", "CodeableConcept", "The code(s) that detail the conditions under which the healthcare service is available/offered.", 0, java.lang.Integer.MAX_VALUE, serviceProvisionCode)); - childrenList.add(new Property("eligibility", "CodeableConcept", "Does this service have specific eligibility requirements that need to be met in order to use the service?", 0, java.lang.Integer.MAX_VALUE, eligibility)); - childrenList.add(new Property("eligibilityNote", "string", "Describes the eligibility conditions for the service.", 0, java.lang.Integer.MAX_VALUE, eligibilityNote)); - childrenList.add(new Property("programName", "string", "Program Names that can be used to categorize the service.", 0, java.lang.Integer.MAX_VALUE, programName)); - childrenList.add(new Property("characteristic", "CodeableConcept", "Collection of characteristics (attributes).", 0, java.lang.Integer.MAX_VALUE, characteristic)); - childrenList.add(new Property("referralMethod", "CodeableConcept", "Ways that the service accepts referrals, if this is not provided then it is implied that no referral is required.", 0, java.lang.Integer.MAX_VALUE, referralMethod)); - childrenList.add(new Property("publicKey", "string", "The public part of the 'keys' allocated to an Organization by an accredited body to support secure exchange of data over the internet. To be provided by the Organization, where available.", 0, java.lang.Integer.MAX_VALUE, publicKey)); - childrenList.add(new Property("appointmentRequired", "boolean", "Indicates whether or not a prospective consumer will require an appointment for a particular service at a site to be provided by the Organization. Indicates if an appointment is required for access to this service.", 0, java.lang.Integer.MAX_VALUE, appointmentRequired)); - childrenList.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); - childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); - childrenList.add(new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 205136282: /*providedBy*/ return this.providedBy == null ? new Base[0] : new Base[] {this.providedBy}; // Reference - case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept - case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept - case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference - case -1928572192: /*serviceName*/ return this.serviceName == null ? new Base[0] : new Base[] {this.serviceName}; // StringType - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - case -1469168622: /*extraDetails*/ return this.extraDetails == null ? new Base[0] : new Base[] {this.extraDetails}; // StringType - case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1532328299: /*coverageArea*/ return this.coverageArea == null ? new Base[0] : this.coverageArea.toArray(new Base[this.coverageArea.size()]); // Reference - case 1504575405: /*serviceProvisionCode*/ return this.serviceProvisionCode == null ? new Base[0] : this.serviceProvisionCode.toArray(new Base[this.serviceProvisionCode.size()]); // CodeableConcept - case -930847859: /*eligibility*/ return this.eligibility == null ? new Base[0] : new Base[] {this.eligibility}; // CodeableConcept - case 1635973407: /*eligibilityNote*/ return this.eligibilityNote == null ? new Base[0] : new Base[] {this.eligibilityNote}; // StringType - case 1010379567: /*programName*/ return this.programName == null ? new Base[0] : this.programName.toArray(new Base[this.programName.size()]); // StringType - case 366313883: /*characteristic*/ return this.characteristic == null ? new Base[0] : this.characteristic.toArray(new Base[this.characteristic.size()]); // CodeableConcept - case -2092740898: /*referralMethod*/ return this.referralMethod == null ? new Base[0] : this.referralMethod.toArray(new Base[this.referralMethod.size()]); // CodeableConcept - case 1446899510: /*publicKey*/ return this.publicKey == null ? new Base[0] : new Base[] {this.publicKey}; // StringType - case 427220062: /*appointmentRequired*/ return this.appointmentRequired == null ? new Base[0] : new Base[] {this.appointmentRequired}; // BooleanType - case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // HealthcareServiceAvailableTimeComponent - case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // HealthcareServiceNotAvailableComponent - case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 205136282: // providedBy - this.providedBy = castToReference(value); // Reference - break; - case 1281188563: // serviceCategory - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - break; - case -1928370289: // serviceType - this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1694759682: // specialty - this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1901043637: // location - this.getLocation().add(castToReference(value)); // Reference - break; - case -1928572192: // serviceName - this.serviceName = castToString(value); // StringType - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - case -1469168622: // extraDetails - this.extraDetails = castToString(value); // StringType - break; - case 106642994: // photo - this.photo = castToAttachment(value); // Attachment - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1532328299: // coverageArea - this.getCoverageArea().add(castToReference(value)); // Reference - break; - case 1504575405: // serviceProvisionCode - this.getServiceProvisionCode().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -930847859: // eligibility - this.eligibility = castToCodeableConcept(value); // CodeableConcept - break; - case 1635973407: // eligibilityNote - this.eligibilityNote = castToString(value); // StringType - break; - case 1010379567: // programName - this.getProgramName().add(castToString(value)); // StringType - break; - case 366313883: // characteristic - this.getCharacteristic().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -2092740898: // referralMethod - this.getReferralMethod().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1446899510: // publicKey - this.publicKey = castToString(value); // StringType - break; - case 427220062: // appointmentRequired - this.appointmentRequired = castToBoolean(value); // BooleanType - break; - case 1873069366: // availableTime - this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value); // HealthcareServiceAvailableTimeComponent - break; - case -629572298: // notAvailable - this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); // HealthcareServiceNotAvailableComponent - break; - case -1149143617: // availabilityExceptions - this.availabilityExceptions = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("providedBy")) - this.providedBy = castToReference(value); // Reference - else if (name.equals("serviceCategory")) - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("serviceType")) - this.getServiceType().add(castToCodeableConcept(value)); - else if (name.equals("specialty")) - this.getSpecialty().add(castToCodeableConcept(value)); - else if (name.equals("location")) - this.getLocation().add(castToReference(value)); - else if (name.equals("serviceName")) - this.serviceName = castToString(value); // StringType - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else if (name.equals("extraDetails")) - this.extraDetails = castToString(value); // StringType - else if (name.equals("photo")) - this.photo = castToAttachment(value); // Attachment - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("coverageArea")) - this.getCoverageArea().add(castToReference(value)); - else if (name.equals("serviceProvisionCode")) - this.getServiceProvisionCode().add(castToCodeableConcept(value)); - else if (name.equals("eligibility")) - this.eligibility = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("eligibilityNote")) - this.eligibilityNote = castToString(value); // StringType - else if (name.equals("programName")) - this.getProgramName().add(castToString(value)); - else if (name.equals("characteristic")) - this.getCharacteristic().add(castToCodeableConcept(value)); - else if (name.equals("referralMethod")) - this.getReferralMethod().add(castToCodeableConcept(value)); - else if (name.equals("publicKey")) - this.publicKey = castToString(value); // StringType - else if (name.equals("appointmentRequired")) - this.appointmentRequired = castToBoolean(value); // BooleanType - else if (name.equals("availableTime")) - this.getAvailableTime().add((HealthcareServiceAvailableTimeComponent) value); - else if (name.equals("notAvailable")) - this.getNotAvailable().add((HealthcareServiceNotAvailableComponent) value); - else if (name.equals("availabilityExceptions")) - this.availabilityExceptions = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 205136282: return getProvidedBy(); // Reference - case 1281188563: return getServiceCategory(); // CodeableConcept - case -1928370289: return addServiceType(); // CodeableConcept - case -1694759682: return addSpecialty(); // CodeableConcept - case 1901043637: return addLocation(); // Reference - case -1928572192: throw new FHIRException("Cannot make property serviceName as it is not a complex type"); // StringType - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - case -1469168622: throw new FHIRException("Cannot make property extraDetails as it is not a complex type"); // StringType - case 106642994: return getPhoto(); // Attachment - case -1429363305: return addTelecom(); // ContactPoint - case -1532328299: return addCoverageArea(); // Reference - case 1504575405: return addServiceProvisionCode(); // CodeableConcept - case -930847859: return getEligibility(); // CodeableConcept - case 1635973407: throw new FHIRException("Cannot make property eligibilityNote as it is not a complex type"); // StringType - case 1010379567: throw new FHIRException("Cannot make property programName as it is not a complex type"); // StringType - case 366313883: return addCharacteristic(); // CodeableConcept - case -2092740898: return addReferralMethod(); // CodeableConcept - case 1446899510: throw new FHIRException("Cannot make property publicKey as it is not a complex type"); // StringType - case 427220062: throw new FHIRException("Cannot make property appointmentRequired as it is not a complex type"); // BooleanType - case 1873069366: return addAvailableTime(); // HealthcareServiceAvailableTimeComponent - case -629572298: return addNotAvailable(); // HealthcareServiceNotAvailableComponent - case -1149143617: throw new FHIRException("Cannot make property availabilityExceptions as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("providedBy")) { - this.providedBy = new Reference(); - return this.providedBy; - } - else if (name.equals("serviceCategory")) { - this.serviceCategory = new CodeableConcept(); - return this.serviceCategory; - } - else if (name.equals("serviceType")) { - return addServiceType(); - } - else if (name.equals("specialty")) { - return addSpecialty(); - } - else if (name.equals("location")) { - return addLocation(); - } - else if (name.equals("serviceName")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.serviceName"); - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.comment"); - } - else if (name.equals("extraDetails")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.extraDetails"); - } - else if (name.equals("photo")) { - this.photo = new Attachment(); - return this.photo; - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("coverageArea")) { - return addCoverageArea(); - } - else if (name.equals("serviceProvisionCode")) { - return addServiceProvisionCode(); - } - else if (name.equals("eligibility")) { - this.eligibility = new CodeableConcept(); - return this.eligibility; - } - else if (name.equals("eligibilityNote")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.eligibilityNote"); - } - else if (name.equals("programName")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.programName"); - } - else if (name.equals("characteristic")) { - return addCharacteristic(); - } - else if (name.equals("referralMethod")) { - return addReferralMethod(); - } - else if (name.equals("publicKey")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.publicKey"); - } - else if (name.equals("appointmentRequired")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.appointmentRequired"); - } - else if (name.equals("availableTime")) { - return addAvailableTime(); - } - else if (name.equals("notAvailable")) { - return addNotAvailable(); - } - else if (name.equals("availabilityExceptions")) { - throw new FHIRException("Cannot call addChild on a primitive type HealthcareService.availabilityExceptions"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "HealthcareService"; - - } - - public HealthcareService copy() { - HealthcareService dst = new HealthcareService(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.providedBy = providedBy == null ? null : providedBy.copy(); - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - if (serviceType != null) { - dst.serviceType = new ArrayList(); - for (CodeableConcept i : serviceType) - dst.serviceType.add(i.copy()); - }; - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - if (location != null) { - dst.location = new ArrayList(); - for (Reference i : location) - dst.location.add(i.copy()); - }; - dst.serviceName = serviceName == null ? null : serviceName.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.extraDetails = extraDetails == null ? null : extraDetails.copy(); - dst.photo = photo == null ? null : photo.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (coverageArea != null) { - dst.coverageArea = new ArrayList(); - for (Reference i : coverageArea) - dst.coverageArea.add(i.copy()); - }; - if (serviceProvisionCode != null) { - dst.serviceProvisionCode = new ArrayList(); - for (CodeableConcept i : serviceProvisionCode) - dst.serviceProvisionCode.add(i.copy()); - }; - dst.eligibility = eligibility == null ? null : eligibility.copy(); - dst.eligibilityNote = eligibilityNote == null ? null : eligibilityNote.copy(); - if (programName != null) { - dst.programName = new ArrayList(); - for (StringType i : programName) - dst.programName.add(i.copy()); - }; - if (characteristic != null) { - dst.characteristic = new ArrayList(); - for (CodeableConcept i : characteristic) - dst.characteristic.add(i.copy()); - }; - if (referralMethod != null) { - dst.referralMethod = new ArrayList(); - for (CodeableConcept i : referralMethod) - dst.referralMethod.add(i.copy()); - }; - dst.publicKey = publicKey == null ? null : publicKey.copy(); - dst.appointmentRequired = appointmentRequired == null ? null : appointmentRequired.copy(); - if (availableTime != null) { - dst.availableTime = new ArrayList(); - for (HealthcareServiceAvailableTimeComponent i : availableTime) - dst.availableTime.add(i.copy()); - }; - if (notAvailable != null) { - dst.notAvailable = new ArrayList(); - for (HealthcareServiceNotAvailableComponent i : notAvailable) - dst.notAvailable.add(i.copy()); - }; - dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); - return dst; - } - - protected HealthcareService typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HealthcareService)) - return false; - HealthcareService o = (HealthcareService) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(providedBy, o.providedBy, true) - && compareDeep(serviceCategory, o.serviceCategory, true) && compareDeep(serviceType, o.serviceType, true) - && compareDeep(specialty, o.specialty, true) && compareDeep(location, o.location, true) && compareDeep(serviceName, o.serviceName, true) - && compareDeep(comment, o.comment, true) && compareDeep(extraDetails, o.extraDetails, true) && compareDeep(photo, o.photo, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(coverageArea, o.coverageArea, true) && compareDeep(serviceProvisionCode, o.serviceProvisionCode, true) - && compareDeep(eligibility, o.eligibility, true) && compareDeep(eligibilityNote, o.eligibilityNote, true) - && compareDeep(programName, o.programName, true) && compareDeep(characteristic, o.characteristic, true) - && compareDeep(referralMethod, o.referralMethod, true) && compareDeep(publicKey, o.publicKey, true) - && compareDeep(appointmentRequired, o.appointmentRequired, true) && compareDeep(availableTime, o.availableTime, true) - && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HealthcareService)) - return false; - HealthcareService o = (HealthcareService) other; - return compareValues(serviceName, o.serviceName, true) && compareValues(comment, o.comment, true) && compareValues(extraDetails, o.extraDetails, true) - && compareValues(eligibilityNote, o.eligibilityNote, true) && compareValues(programName, o.programName, true) - && compareValues(publicKey, o.publicKey, true) && compareValues(appointmentRequired, o.appointmentRequired, true) - && compareValues(availabilityExceptions, o.availabilityExceptions, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (providedBy == null || providedBy.isEmpty()) - && (serviceCategory == null || serviceCategory.isEmpty()) && (serviceType == null || serviceType.isEmpty()) - && (specialty == null || specialty.isEmpty()) && (location == null || location.isEmpty()) - && (serviceName == null || serviceName.isEmpty()) && (comment == null || comment.isEmpty()) - && (extraDetails == null || extraDetails.isEmpty()) && (photo == null || photo.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (coverageArea == null || coverageArea.isEmpty()) - && (serviceProvisionCode == null || serviceProvisionCode.isEmpty()) && (eligibility == null || eligibility.isEmpty()) - && (eligibilityNote == null || eligibilityNote.isEmpty()) && (programName == null || programName.isEmpty()) - && (characteristic == null || characteristic.isEmpty()) && (referralMethod == null || referralMethod.isEmpty()) - && (publicKey == null || publicKey.isEmpty()) && (appointmentRequired == null || appointmentRequired.isEmpty()) - && (availableTime == null || availableTime.isEmpty()) && (notAvailable == null || notAvailable.isEmpty()) - && (availabilityExceptions == null || availabilityExceptions.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.HealthcareService; - } - - /** - * Search parameter: servicecategory - *

- * Description: Service Category of the Healthcare Service
- * Type: token
- * Path: HealthcareService.serviceCategory
- *

- */ - @SearchParamDefinition(name="servicecategory", path="HealthcareService.serviceCategory", description="Service Category of the Healthcare Service", type="token" ) - public static final String SP_SERVICECATEGORY = "servicecategory"; - /** - * Fluent Client search parameter constant for servicecategory - *

- * Description: Service Category of the Healthcare Service
- * Type: token
- * Path: HealthcareService.serviceCategory
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICECATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICECATEGORY); - - /** - * Search parameter: organization - *

- * Description: The organization that provides this Healthcare Service
- * Type: reference
- * Path: HealthcareService.providedBy
- *

- */ - @SearchParamDefinition(name="organization", path="HealthcareService.providedBy", description="The organization that provides this Healthcare Service", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - /** - * Fluent Client search parameter constant for organization - *

- * Description: The organization that provides this Healthcare Service
- * Type: reference
- * Path: HealthcareService.providedBy
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "HealthcareService:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("HealthcareService:organization").toLocked(); - - /** - * Search parameter: servicetype - *

- * Description: The type of service provided by this healthcare service
- * Type: token
- * Path: HealthcareService.serviceType
- *

- */ - @SearchParamDefinition(name="servicetype", path="HealthcareService.serviceType", description="The type of service provided by this healthcare service", type="token" ) - public static final String SP_SERVICETYPE = "servicetype"; - /** - * Fluent Client search parameter constant for servicetype - *

- * Description: The type of service provided by this healthcare service
- * Type: token
- * Path: HealthcareService.serviceType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SERVICETYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SERVICETYPE); - - /** - * Search parameter: location - *

- * Description: The location of the Healthcare Service
- * Type: reference
- * Path: HealthcareService.location
- *

- */ - @SearchParamDefinition(name="location", path="HealthcareService.location", description="The location of the Healthcare Service", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: The location of the Healthcare Service
- * Type: reference
- * Path: HealthcareService.location
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "HealthcareService:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("HealthcareService:location").toLocked(); - - /** - * Search parameter: name - *

- * Description: A portion of the Healthcare service name
- * Type: string
- * Path: HealthcareService.serviceName
- *

- */ - @SearchParamDefinition(name="name", path="HealthcareService.serviceName", description="A portion of the Healthcare service name", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: A portion of the Healthcare service name
- * Type: string
- * Path: HealthcareService.serviceName
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: programname - *

- * Description: One of the Program Names serviced by this HealthcareService
- * Type: string
- * Path: HealthcareService.programName
- *

- */ - @SearchParamDefinition(name="programname", path="HealthcareService.programName", description="One of the Program Names serviced by this HealthcareService", type="string" ) - public static final String SP_PROGRAMNAME = "programname"; - /** - * Fluent Client search parameter constant for programname - *

- * Description: One of the Program Names serviced by this HealthcareService
- * Type: string
- * Path: HealthcareService.programName
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PROGRAMNAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PROGRAMNAME); - - /** - * Search parameter: characteristic - *

- * Description: One of the HealthcareService's characteristics
- * Type: token
- * Path: HealthcareService.characteristic
- *

- */ - @SearchParamDefinition(name="characteristic", path="HealthcareService.characteristic", description="One of the HealthcareService's characteristics", type="token" ) - public static final String SP_CHARACTERISTIC = "characteristic"; - /** - * Fluent Client search parameter constant for characteristic - *

- * Description: One of the HealthcareService's characteristics
- * Type: token
- * Path: HealthcareService.characteristic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHARACTERISTIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHARACTERISTIC); - - /** - * Search parameter: identifier - *

- * Description: External identifiers for this item
- * Type: token
- * Path: HealthcareService.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="HealthcareService.identifier", description="External identifiers for this item", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: External identifiers for this item
- * Type: token
- * Path: HealthcareService.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/HumanName.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/HumanName.java deleted file mode 100644 index 9b03f349d01..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/HumanName.java +++ /dev/null @@ -1,954 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - * Copyright (c) 2011+, HL7, Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific - * prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.instance.model.api.IPrimitiveType; -import org.hl7.fhir.utilities.Utilities; - -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.util.DatatypeUtil; - -/** - * A human's name with the ability to identify parts and usage. - */ -@DatatypeDef(name = "HumanName") -public class HumanName extends Type implements ICompositeType { - - public enum NameUse { - /** - * Known as/conventional/the one you normally use - */ - USUAL, - /** - * The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called "legal name". - */ - OFFICIAL, - /** - * A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations. - */ - TEMP, - /** - * A name that is used to address the person in an informal manner, but is not part of their formal or usual name - */ - NICKNAME, - /** - * Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons) - */ - ANONYMOUS, - /** - * This name is no longer in use (or was never correct, but retained for records) - */ - OLD, - /** - * A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store "maiden" names. Though the concept of - * maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name - * be determined algorithmically. - */ - MAIDEN, - /** - * added to help the parsers - */ - NULL; - public static NameUse fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return USUAL; - if ("official".equals(codeString)) - return OFFICIAL; - if ("temp".equals(codeString)) - return TEMP; - if ("nickname".equals(codeString)) - return NICKNAME; - if ("anonymous".equals(codeString)) - return ANONYMOUS; - if ("old".equals(codeString)) - return OLD; - if ("maiden".equals(codeString)) - return MAIDEN; - throw new FHIRException("Unknown NameUse code '" + codeString + "'"); - } - - public String toCode() { - switch (this) { - case USUAL: - return "usual"; - case OFFICIAL: - return "official"; - case TEMP: - return "temp"; - case NICKNAME: - return "nickname"; - case ANONYMOUS: - return "anonymous"; - case OLD: - return "old"; - case MAIDEN: - return "maiden"; - default: - return "?"; - } - } - - public String getSystem() { - switch (this) { - case USUAL: - return "http://hl7.org/fhir/name-use"; - case OFFICIAL: - return "http://hl7.org/fhir/name-use"; - case TEMP: - return "http://hl7.org/fhir/name-use"; - case NICKNAME: - return "http://hl7.org/fhir/name-use"; - case ANONYMOUS: - return "http://hl7.org/fhir/name-use"; - case OLD: - return "http://hl7.org/fhir/name-use"; - case MAIDEN: - return "http://hl7.org/fhir/name-use"; - default: - return "?"; - } - } - - public String getDefinition() { - switch (this) { - case USUAL: - return "Known as/conventional/the one you normally use"; - case OFFICIAL: - return "The formal name as registered in an official (government) registry, but which name might not be commonly used. May be called \"legal name\"."; - case TEMP: - return "A temporary name. Name.period can provide more detailed information. This may also be used for temporary names assigned at birth or in emergency situations."; - case NICKNAME: - return "A name that is used to address the person in an informal manner, but is not part of their formal or usual name"; - case ANONYMOUS: - return "Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons)"; - case OLD: - return "This name is no longer in use (or was never correct, but retained for records)"; - case MAIDEN: - return "A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use by applications that collect and store \"maiden\" names. Though the concept of maiden name is often gender specific, the use of this term is not gender specific. The use of this term does not imply any particular history for a person's name, nor should the maiden name be determined algorithmically."; - default: - return "?"; - } - } - - public String getDisplay() { - switch (this) { - case USUAL: - return "Usual"; - case OFFICIAL: - return "Official"; - case TEMP: - return "Temp"; - case NICKNAME: - return "Nickname"; - case ANONYMOUS: - return "Anonymous"; - case OLD: - return "Old"; - case MAIDEN: - return "Maiden"; - default: - return "?"; - } - } - } - - public static class NameUseEnumFactory implements EnumFactory { - public NameUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return NameUse.USUAL; - if ("official".equals(codeString)) - return NameUse.OFFICIAL; - if ("temp".equals(codeString)) - return NameUse.TEMP; - if ("nickname".equals(codeString)) - return NameUse.NICKNAME; - if ("anonymous".equals(codeString)) - return NameUse.ANONYMOUS; - if ("old".equals(codeString)) - return NameUse.OLD; - if ("maiden".equals(codeString)) - return NameUse.MAIDEN; - throw new IllegalArgumentException("Unknown NameUse code '" + codeString + "'"); - } - - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return new Enumeration(this, NameUse.USUAL); - if ("official".equals(codeString)) - return new Enumeration(this, NameUse.OFFICIAL); - if ("temp".equals(codeString)) - return new Enumeration(this, NameUse.TEMP); - if ("nickname".equals(codeString)) - return new Enumeration(this, NameUse.NICKNAME); - if ("anonymous".equals(codeString)) - return new Enumeration(this, NameUse.ANONYMOUS); - if ("old".equals(codeString)) - return new Enumeration(this, NameUse.OLD); - if ("maiden".equals(codeString)) - return new Enumeration(this, NameUse.MAIDEN); - throw new FHIRException("Unknown NameUse code '" + codeString + "'"); - } - - public String toCode(NameUse code) { - if (code == NameUse.USUAL) - return "usual"; - if (code == NameUse.OFFICIAL) - return "official"; - if (code == NameUse.TEMP) - return "temp"; - if (code == NameUse.NICKNAME) - return "nickname"; - if (code == NameUse.ANONYMOUS) - return "anonymous"; - if (code == NameUse.OLD) - return "old"; - if (code == NameUse.MAIDEN) - return "maiden"; - return "?"; - } - - public String toSystem(NameUse code) { - return code.getSystem(); - } - } - - /** - * Identifies the purpose for this name. - */ - @Child(name = "use", type = { CodeType.class }, order = 0, min = 0, max = 1, modifier = true, summary = true) - @Description(shortDefinition = "usual | official | temp | nickname | anonymous | old | maiden", formalDefinition = "Identifies the purpose for this name.") - protected Enumeration use; - - /** - * A full text representation of the name. - */ - @Child(name = "text", type = { StringType.class }, order = 1, min = 0, max = 1, modifier = false, summary = true) - @Description(shortDefinition = "Text representation of the full name", formalDefinition = "A full text representation of the name.") - protected StringType text; - - /** - * The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father. - */ - @Child(name = "family", type = { StringType.class }, order = 2, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) - @Description(shortDefinition = "Family name (often called 'Surname')", formalDefinition = "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.") - protected List family; - - /** - * Given name. - */ - @Child(name = "given", type = { StringType.class }, order = 3, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) - @Description(shortDefinition = "Given names (not always 'first'). Includes middle names", formalDefinition = "Given name.") - protected List given; - - /** - * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name. - */ - @Child(name = "prefix", type = { StringType.class }, order = 4, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) - @Description(shortDefinition = "Parts that come before the name", formalDefinition = "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.") - protected List prefix; - - /** - * Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name. - */ - @Child(name = "suffix", type = { StringType.class }, order = 5, min = 0, max = Child.MAX_UNLIMITED, modifier = false, summary = true) - @Description(shortDefinition = "Parts that come after the name", formalDefinition = "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.") - protected List suffix; - - /** - * Indicates the period of time when this name was valid for the named person. - */ - @Child(name = "period", type = { Period.class }, order = 6, min = 0, max = 1, modifier = false, summary = true) - @Description(shortDefinition = "Time period when name was/is in use", formalDefinition = "Indicates the period of time when this name was valid for the named person.") - protected Period period; - - private static final long serialVersionUID = -210174642L; - - /** - * Constructor - */ - public HumanName() { - super(); - } - - /** - * @return {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new NameUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value - * {@link #use} (Identifies the purpose for this name.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public HumanName setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Identifies the purpose for this name. - */ - public NameUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value - * Identifies the purpose for this name. - */ - public HumanName setUse(NameUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new NameUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value - * {@link #text} (A full text representation of the name.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public HumanName setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return A full text representation of the name. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value - * A full text representation of the name. - */ - public HumanName setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public List getFamily() { - if (this.family == null) - this.family = new ArrayList(); - return this.family; - } - - public boolean hasFamily() { - if (this.family == null) - return false; - for (StringType item : this.family) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - // syntactic sugar - public StringType addFamilyElement() {// 2 - StringType t = new StringType(); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return t; - } - - /** - * @param value - * {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public HumanName addFamily(String value) { // 1 - StringType t = new StringType(); - t.setValue(value); - if (this.family == null) - this.family = new ArrayList(); - this.family.add(t); - return this; - } - - /** - * @param value - * {@link #family} (The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.) - */ - public boolean hasFamily(String value) { - if (this.family == null) - return false; - for (StringType v : this.family) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #given} (Given name.) - */ - public List getGiven() { - if (this.given == null) - this.given = new ArrayList(); - return this.given; - } - - public boolean hasGiven() { - if (this.given == null) - return false; - for (StringType item : this.given) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #given} (Given name.) - */ - // syntactic sugar - public StringType addGivenElement() {// 2 - StringType t = new StringType(); - if (this.given == null) - this.given = new ArrayList(); - this.given.add(t); - return t; - } - - /** - * @param value - * {@link #given} (Given name.) - */ - public HumanName addGiven(String value) { // 1 - StringType t = new StringType(); - t.setValue(value); - if (this.given == null) - this.given = new ArrayList(); - this.given.add(t); - return this; - } - - /** - * @param value - * {@link #given} (Given name.) - */ - public boolean hasGiven(String value) { - if (this.given == null) - return false; - for (StringType v : this.given) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public List getPrefix() { - if (this.prefix == null) - this.prefix = new ArrayList(); - return this.prefix; - } - - public boolean hasPrefix() { - if (this.prefix == null) - return false; - for (StringType item : this.prefix) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - // syntactic sugar - public StringType addPrefixElement() {// 2 - StringType t = new StringType(); - if (this.prefix == null) - this.prefix = new ArrayList(); - this.prefix.add(t); - return t; - } - - /** - * @param value - * {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public HumanName addPrefix(String value) { // 1 - StringType t = new StringType(); - t.setValue(value); - if (this.prefix == null) - this.prefix = new ArrayList(); - this.prefix.add(t); - return this; - } - - /** - * @param value - * {@link #prefix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.) - */ - public boolean hasPrefix(String value) { - if (this.prefix == null) - return false; - for (StringType v : this.prefix) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public List getSuffix() { - if (this.suffix == null) - this.suffix = new ArrayList(); - return this.suffix; - } - - public boolean hasSuffix() { - if (this.suffix == null) - return false; - for (StringType item : this.suffix) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - // syntactic sugar - public StringType addSuffixElement() {// 2 - StringType t = new StringType(); - if (this.suffix == null) - this.suffix = new ArrayList(); - this.suffix.add(t); - return t; - } - - /** - * @param value - * {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public HumanName addSuffix(String value) { // 1 - StringType t = new StringType(); - t.setValue(value); - if (this.suffix == null) - this.suffix = new ArrayList(); - this.suffix.add(t); - return this; - } - - /** - * @param value - * {@link #suffix} (Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.) - */ - public boolean hasSuffix(String value) { - if (this.suffix == null) - return false; - for (StringType v : this.suffix) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #period} (Indicates the period of time when this name was valid for the named person.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create HumanName.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value - * {@link #period} (Indicates the period of time when this name was valid for the named person.) - */ - public HumanName setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * Returns all repetitions of {@link #getFamily() family name} as a space separated string - * - * @see DatatypeUtil#joinStringsSpaceSeparated(List) - */ - public String getFamilyAsSingleString() { - return joinStringsSpaceSeparated(getFamily()); - } - - /** - * Returns all repetitions of {@link #getGiven() given name} as a space separated string - * - * @see DatatypeUtil#joinStringsSpaceSeparated(List) - */ - public String getGivenAsSingleString() { - return joinStringsSpaceSeparated(getGiven()); - } - - /** - * Returns all repetitions of {@link #getPrefix() prefix name} as a space separated string - * - * @see DatatypeUtil#joinStringsSpaceSeparated(List) - */ - public String getPrefixAsSingleString() { - return joinStringsSpaceSeparated(getPrefix()); - } - - /** - * Returns all repetitions of {@link #getSuffix() suffix} as a space separated string - * - * @see DatatypeUtil#joinStringsSpaceSeparated(List) - */ - public String getSuffixAsSingleString() { - return joinStringsSpaceSeparated(getSuffix()); - } - - /** - * Returns all of the components of the name (prefix, given, family, suffix) as a single string with a single spaced - * string separating each part. - *

- * If none of the parts are populated, returns the {@link #getTextElement() text} element value instead. - *

- */ - public String getNameAsSingleString() { - List nameParts = new ArrayList(); - nameParts.addAll(getPrefix()); - nameParts.addAll(getGiven()); - nameParts.addAll(getFamily()); - nameParts.addAll(getSuffix()); - if (nameParts.size() > 0) { - return joinStringsSpaceSeparated(nameParts); - } else { - return getTextElement().getValue(); - } - } - - /** - * Joins a list of strings with a single space (' ') between each string - * - * TODO: replace with call to ca.uhn.fhir.util.DatatypeUtil.joinStringsSpaceSeparated when HAPI upgrades to 1.4 - */ - private static String joinStringsSpaceSeparated(List> theStrings) { - StringBuilder b = new StringBuilder(); - for (IPrimitiveType next : theStrings) { - if (next.isEmpty()) { - continue; - } - if (b.length() > 0) { - b.append(' '); - } - b.append(next.getValue()); - } - return b.toString(); - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "Identifies the purpose for this name.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("text", "string", "A full text representation of the name.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("family", "string", "The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.", 0, - java.lang.Integer.MAX_VALUE, family)); - childrenList.add(new Property("given", "string", "Given name.", 0, java.lang.Integer.MAX_VALUE, given)); - childrenList - .add(new Property("prefix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.", - 0, java.lang.Integer.MAX_VALUE, prefix)); - childrenList - .add(new Property("suffix", "string", "Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.", - 0, java.lang.Integer.MAX_VALUE, suffix)); - childrenList.add(new Property("period", "Period", "Indicates the period of time when this name was valid for the named person.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116103: - /* use */ return this.use == null ? new Base[0] : new Base[] { this.use }; // Enumeration - case 3556653: - /* text */ return this.text == null ? new Base[0] : new Base[] { this.text }; // StringType - case -1281860764: - /* family */ return this.family == null ? new Base[0] : this.family.toArray(new Base[this.family.size()]); // StringType - case 98367357: - /* given */ return this.given == null ? new Base[0] : this.given.toArray(new Base[this.given.size()]); // StringType - case -980110702: - /* prefix */ return this.prefix == null ? new Base[0] : this.prefix.toArray(new Base[this.prefix.size()]); // StringType - case -891422895: - /* suffix */ return this.suffix == null ? new Base[0] : this.suffix.toArray(new Base[this.suffix.size()]); // StringType - case -991726143: - /* period */ return this.period == null ? new Base[0] : new Base[] { this.period }; // Period - default: - return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116103: // use - this.use = new NameUseEnumFactory().fromType(value); // Enumeration - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - case -1281860764: // family - this.getFamily().add(castToString(value)); // StringType - break; - case 98367357: // given - this.getGiven().add(castToString(value)); // StringType - break; - case -980110702: // prefix - this.getPrefix().add(castToString(value)); // StringType - break; - case -891422895: // suffix - this.getSuffix().add(castToString(value)); // StringType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: - super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("use")) - this.use = new NameUseEnumFactory().fromType(value); // Enumeration - else if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("family")) - this.getFamily().add(castToString(value)); - else if (name.equals("given")) - this.getGiven().add(castToString(value)); - else if (name.equals("prefix")) - this.getPrefix().add(castToString(value)); - else if (name.equals("suffix")) - this.getSuffix().add(castToString(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116103: - throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case 3556653: - throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -1281860764: - throw new FHIRException("Cannot make property family as it is not a complex type"); // StringType - case 98367357: - throw new FHIRException("Cannot make property given as it is not a complex type"); // StringType - case -980110702: - throw new FHIRException("Cannot make property prefix as it is not a complex type"); // StringType - case -891422895: - throw new FHIRException("Cannot make property suffix as it is not a complex type"); // StringType - case -991726143: - return getPeriod(); // Period - default: - return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type HumanName.use"); - } else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type HumanName.text"); - } else if (name.equals("family")) { - throw new FHIRException("Cannot call addChild on a primitive type HumanName.family"); - } else if (name.equals("given")) { - throw new FHIRException("Cannot call addChild on a primitive type HumanName.given"); - } else if (name.equals("prefix")) { - throw new FHIRException("Cannot call addChild on a primitive type HumanName.prefix"); - } else if (name.equals("suffix")) { - throw new FHIRException("Cannot call addChild on a primitive type HumanName.suffix"); - } else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } else - return super.addChild(name); - } - - public String fhirType() { - return "HumanName"; - - } - - public HumanName copy() { - HumanName dst = new HumanName(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.text = text == null ? null : text.copy(); - if (family != null) { - dst.family = new ArrayList(); - for (StringType i : family) - dst.family.add(i.copy()); - } - ; - if (given != null) { - dst.given = new ArrayList(); - for (StringType i : given) - dst.given.add(i.copy()); - } - ; - if (prefix != null) { - dst.prefix = new ArrayList(); - for (StringType i : prefix) - dst.prefix.add(i.copy()); - } - ; - if (suffix != null) { - dst.suffix = new ArrayList(); - for (StringType i : suffix) - dst.suffix.add(i.copy()); - } - ; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected HumanName typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof HumanName)) - return false; - HumanName o = (HumanName) other; - return compareDeep(use, o.use, true) && compareDeep(text, o.text, true) && compareDeep(family, o.family, true) - && compareDeep(given, o.given, true) && compareDeep(prefix, o.prefix, true) && compareDeep(suffix, o.suffix, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof HumanName)) - return false; - HumanName o = (HumanName) other; - return compareValues(use, o.use, true) && compareValues(text, o.text, true) && compareValues(family, o.family, true) - && compareValues(given, o.given, true) && compareValues(prefix, o.prefix, true) && compareValues(suffix, o.suffix, true); - } - - public boolean isEmpty() { - boolean retVal = super.isEmpty(); - retVal &= (use == null || use.isEmpty()); - retVal &= (text == null || text.isEmpty()); - retVal &= (family == null || family.isEmpty()); - retVal &= (given == null || given.isEmpty()); - retVal &= (prefix == null || prefix.isEmpty()); - retVal &= (suffix == null || suffix.isEmpty()); - retVal &= (period == null || period.isEmpty()); - return retVal; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/IdType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/IdType.java deleted file mode 100644 index f5e4ee31a06..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/IdType.java +++ /dev/null @@ -1,781 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import static org.apache.commons.lang3.StringUtils.defaultString; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -import static org.apache.commons.lang3.StringUtils.isBlank; -import static org.apache.commons.lang3.StringUtils.isNotBlank; - -import java.math.BigDecimal; -import java.util.UUID; - -import org.apache.commons.lang3.ObjectUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.Validate; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.hl7.fhir.instance.model.api.IBaseResource; -import org.hl7.fhir.instance.model.api.IIdType; -import org.hl7.fhir.instance.model.api.IPrimitiveType; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * This class represents the logical identity for a resource, or as much of that - * identity is known. In FHIR, every resource must have a "logical ID" which is - * defined by the FHIR specification as: - *

- * A whole number in the range 0 to 2^64-1 (optionally represented in hex), - * a uuid, an oid, or any other combination of lowercase letters, numerals, "-" - * and ".", with a length limit of 36 characters - *

- *

- * This class contains that logical ID, and can optionally also contain a - * relative or absolute URL representing the resource identity. For example, the - * following are all valid values for IdType, and all might represent the same - * resource: - *

- *
    - *
  • 123 (just a resource's ID)
  • - *
  • Patient/123 (a relative identity)
  • - *
  • http://example.com/Patient/123 (an absolute identity)
  • - *
  • - * http://example.com/Patient/123/_history/1 (an absolute identity with a version id) - *
  • - *
  • - * Patient/123/_history/1 (a relative identity with a version id) - *
  • - *
- *

- * In most situations, you only need to populate the resource's ID (e.g. - * 123) in resources you are constructing and the encoder will - * infer the rest from the context in which the object is being used. On the - * other hand, the parser will always try to populate the complete absolute - * identity on objects it creates as a convenience. - *

- *

- * Regex for ID: [a-z0-9\-\.]{1,36} - *

- */ -@DatatypeDef(name = "id", profileOf=StringType.class) -public final class IdType extends UriType implements IPrimitiveType, IIdType { - /** - * This is the maximum length for the ID - */ - public static final int MAX_LENGTH = 64; // maximum length - - private static final long serialVersionUID = 2L; - private String myBaseUrl; - private boolean myHaveComponentParts; - private String myResourceType; - private String myUnqualifiedId; - private String myUnqualifiedVersionId; - - /** - * Create a new empty ID - */ - public IdType() { - super(); - } - - /** - * Create a new ID, using a BigDecimal input. Uses - * {@link BigDecimal#toPlainString()} to generate the string representation. - */ - public IdType(BigDecimal thePid) { - if (thePid != null) { - setValue(toPlainStringWithNpeThrowIfNeeded(thePid)); - } else { - setValue(null); - } - } - - /** - * Create a new ID using a long - */ - public IdType(long theId) { - setValue(Long.toString(theId)); - } - - /** - * Create a new ID using a string. This String may contain a simple ID (e.g. - * "1234") or it may contain a complete URL - * (http://example.com/fhir/Patient/1234). - * - *

- * Description: A whole number in the range 0 to 2^64-1 (optionally - * represented in hex), a uuid, an oid, or any other combination of lowercase - * letters, numerals, "-" and ".", with a length limit of 36 characters. - *

- *

- * regex: [a-z0-9\-\.]{1,36} - *

- */ - public IdType(String theValue) { - setValue(theValue); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theIdPart - * The ID (e.g. "123") - */ - public IdType(String theResourceType, BigDecimal theIdPart) { - this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theIdPart - * The ID (e.g. "123") - */ - public IdType(String theResourceType, Long theIdPart) { - this(theResourceType, toPlainStringWithNpeThrowIfNeeded(theIdPart)); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theId - * The ID (e.g. "123") - */ - public IdType(String theResourceType, String theId) { - this(theResourceType, theId, null); - } - - /** - * Constructor - * - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theId - * The ID (e.g. "123") - * @param theVersionId - * The version ID ("e.g. "456") - */ - public IdType(String theResourceType, String theId, String theVersionId) { - this(null, theResourceType, theId, theVersionId); - } - - /** - * Constructor - * - * @param theBaseUrl - * The server base URL (e.g. "http://example.com/fhir") - * @param theResourceType - * The resource type (e.g. "Patient") - * @param theId - * The ID (e.g. "123") - * @param theVersionId - * The version ID ("e.g. "456") - */ - public IdType(String theBaseUrl, String theResourceType, String theId, String theVersionId) { - myBaseUrl = theBaseUrl; - myResourceType = theResourceType; - myUnqualifiedId = theId; - myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionId, null); - myHaveComponentParts = true; - if (isBlank(myBaseUrl) && isBlank(myResourceType) && isBlank(myUnqualifiedId) && isBlank(myUnqualifiedVersionId)) { - myHaveComponentParts = false; - } - } - - /** - * Creates an ID based on a given URL - */ - public IdType(UriType theUrl) { - setValue(theUrl.getValueAsString()); - } - - public void applyTo(IBaseResource theResouce) { - if (theResouce == null) { - throw new NullPointerException("theResource can not be null"); - } else { - theResouce.setId(new IdType(getValue())); - } - } - - /** - * @deprecated Use {@link #getIdPartAsBigDecimal()} instead (this method was - * deprocated because its name is ambiguous) - */ - @Deprecated - public BigDecimal asBigDecimal() { - return getIdPartAsBigDecimal(); - } - - @Override - public IdType copy() { - return new IdType(getValue()); - } - - @Override - public boolean equals(Object theArg0) { - if (!(theArg0 instanceof IdType)) { - return false; - } - IdType id = (IdType) theArg0; - return StringUtils.equals(getValueAsString(), id.getValueAsString()); - } - - /** - * Returns true if this IdType matches the given IdType in terms of resource - * type and ID, but ignores the URL base - */ - @SuppressWarnings("deprecation") - public boolean equalsIgnoreBase(IdType theId) { - if (theId == null) { - return false; - } - if (theId.isEmpty()) { - return isEmpty(); - } - return ObjectUtils.equals(getResourceType(), theId.getResourceType()) - && ObjectUtils.equals(getIdPart(), theId.getIdPart()) - && ObjectUtils.equals(getVersionIdPart(), theId.getVersionIdPart()); - } - - /** - * Returns the portion of this resource ID which corresponds to the server - * base URL. For example given the resource ID - * http://example.com/fhir/Patient/123 the base URL would be - * http://example.com/fhir. - *

- * This method may return null if the ID contains no base (e.g. "Patient/123") - *

- */ - @Override - public String getBaseUrl() { - return myBaseUrl; - } - - /** - * Returns only the logical ID part of this ID. For example, given the ID - * "http://example,.com/fhir/Patient/123/_history/456", this method would - * return "123". - */ - @Override - public String getIdPart() { - return myUnqualifiedId; - } - - /** - * Returns the unqualified portion of this ID as a big decimal, or - * null if the value is null - * - * @throws NumberFormatException - * If the value is not a valid BigDecimal - */ - public BigDecimal getIdPartAsBigDecimal() { - String val = getIdPart(); - if (isBlank(val)) { - return null; - } - return new BigDecimal(val); - } - - /** - * Returns the unqualified portion of this ID as a {@link Long}, or - * null if the value is null - * - * @throws NumberFormatException - * If the value is not a valid Long - */ - @Override - public Long getIdPartAsLong() { - String val = getIdPart(); - if (isBlank(val)) { - return null; - } - return Long.parseLong(val); - } - - @Override - public String getResourceType() { - return myResourceType; - } - - /** - * Returns the value of this ID. Note that this value may be a fully qualified - * URL, a relative/partial URL, or a simple ID. Use {@link #getIdPart()} to - * get just the ID portion. - * - * @see #getIdPart() - */ - @Override - public String getValue() { - String retVal = super.getValue(); - if (retVal == null && myHaveComponentParts) { - - if (isLocal() || isUrn()) { - return myUnqualifiedId; - } - - StringBuilder b = new StringBuilder(); - if (isNotBlank(myBaseUrl)) { - b.append(myBaseUrl); - if (myBaseUrl.charAt(myBaseUrl.length() - 1) != '/') { - b.append('/'); - } - } - - if (isNotBlank(myResourceType)) { - b.append(myResourceType); - } - - if (b.length() > 0 && isNotBlank(myUnqualifiedId)) { - b.append('/'); - } - - if (isNotBlank(myUnqualifiedId)) { - b.append(myUnqualifiedId); - } else if (isNotBlank(myUnqualifiedVersionId)) { - b.append('/'); - } - - if (isNotBlank(myUnqualifiedVersionId)) { - b.append('/'); - b.append("_history"); - b.append('/'); - b.append(myUnqualifiedVersionId); - } - retVal = b.toString(); - super.setValue(retVal); - } - return retVal; - } - - @Override - public String getValueAsString() { - return getValue(); - } - - @Override - public String getVersionIdPart() { - return myUnqualifiedVersionId; - } - - public Long getVersionIdPartAsLong() { - if (!hasVersionIdPart()) { - return null; - } else { - return Long.parseLong(getVersionIdPart()); - } - } - - /** - * Returns true if this ID has a base url - * - * @see #getBaseUrl() - */ - public boolean hasBaseUrl() { - return isNotBlank(myBaseUrl); - } - - @Override - public int hashCode() { - HashCodeBuilder b = new HashCodeBuilder(); - b.append(getValueAsString()); - return b.toHashCode(); - } - - @Override - public boolean hasIdPart() { - return isNotBlank(getIdPart()); - } - - @Override - public boolean hasResourceType() { - return isNotBlank(myResourceType); - } - - @Override - public boolean hasVersionIdPart() { - return isNotBlank(getVersionIdPart()); - } - - /** - * Returns true if this ID contains an absolute URL (in other - * words, a URL starting with "http://" or "https://" - */ - @Override - public boolean isAbsolute() { - if (StringUtils.isBlank(getValue())) { - return false; - } - return isUrlAbsolute(getValue()); - } - - @Override - public boolean isEmpty() { - return isBlank(getValue()); - } - - @Override - public boolean isIdPartValid() { - String id = getIdPart(); - if (StringUtils.isBlank(id)) { - return false; - } - if (id.length() > 64) { - return false; - } - for (int i = 0; i < id.length(); i++) { - char nextChar = id.charAt(i); - if (nextChar >= 'a' && nextChar <= 'z') { - continue; - } - if (nextChar >= 'A' && nextChar <= 'Z') { - continue; - } - if (nextChar >= '0' && nextChar <= '9') { - continue; - } - if (nextChar == '-' || nextChar == '.') { - continue; - } - return false; - } - return true; - } - - /** - * Returns true if the unqualified ID is a valid {@link Long} - * value (in other words, it consists only of digits) - */ - @Override - public boolean isIdPartValidLong() { - return isValidLong(getIdPart()); - } - - /** - * Returns true if the ID is a local reference (in other words, - * it begins with the '#' character) - */ - @Override - public boolean isLocal() { - return defaultString(myUnqualifiedId).startsWith("#"); - } - - private boolean isUrn() { - return defaultString(myUnqualifiedId).startsWith("urn:"); - } - - @Override - public boolean isVersionIdPartValidLong() { - return isValidLong(getVersionIdPart()); - } - - /** - * Set the value - * - *

- * Description: A whole number in the range 0 to 2^64-1 (optionally - * represented in hex), a uuid, an oid, or any other combination of lowercase - * letters, numerals, "-" and ".", with a length limit of 36 characters. - *

- *

- * regex: [a-z0-9\-\.]{1,36} - *

- */ - @Override - public IdType setValue(String theValue) { - // TODO: add validation - super.setValue(theValue); - myHaveComponentParts = false; - - if (StringUtils.isBlank(theValue)) { - myBaseUrl = null; - super.setValue(null); - myUnqualifiedId = null; - myUnqualifiedVersionId = null; - myResourceType = null; - } else if (theValue.charAt(0) == '#' && theValue.length() > 1) { - super.setValue(theValue); - myBaseUrl = null; - myUnqualifiedId = theValue; - myUnqualifiedVersionId = null; - myResourceType = null; - myHaveComponentParts = true; - } else if (theValue.startsWith("urn:")) { - myBaseUrl = null; - myUnqualifiedId = theValue; - myUnqualifiedVersionId = null; - myResourceType = null; - myHaveComponentParts = true; - } else { - int vidIndex = theValue.indexOf("/_history/"); - int idIndex; - if (vidIndex != -1) { - myUnqualifiedVersionId = theValue.substring(vidIndex + "/_history/".length()); - idIndex = theValue.lastIndexOf('/', vidIndex - 1); - myUnqualifiedId = theValue.substring(idIndex + 1, vidIndex); - } else { - idIndex = theValue.lastIndexOf('/'); - myUnqualifiedId = theValue.substring(idIndex + 1); - myUnqualifiedVersionId = null; - } - - myBaseUrl = null; - if (idIndex <= 0) { - myResourceType = null; - } else { - int typeIndex = theValue.lastIndexOf('/', idIndex - 1); - if (typeIndex == -1) { - myResourceType = theValue.substring(0, idIndex); - } else { - if (typeIndex > 0 && '/' == theValue.charAt(typeIndex - 1)) { - typeIndex = theValue.indexOf('/', typeIndex + 1); - } - if (typeIndex >= idIndex) { - // e.g. http://example.org/foo - // 'foo' was the id but we're making that the resource type. Nullify the id part because we don't have an id. - // Also set null value to the super.setValue() and enable myHaveComponentParts so it forces getValue() to properly - // recreate the url - myResourceType = myUnqualifiedId; - myUnqualifiedId = null; - super.setValue(null); - myHaveComponentParts = true; - } else { - myResourceType = theValue.substring(typeIndex + 1, idIndex); - } - - if (typeIndex > 4) { - myBaseUrl = theValue.substring(0, typeIndex); - } - - } - } - - } - return this; - } - - /** - * Set the value - * - *

- * Description: A whole number in the range 0 to 2^64-1 (optionally - * represented in hex), a uuid, an oid, or any other combination of lowercase - * letters, numerals, "-" and ".", with a length limit of 36 characters. - *

- *

- * regex: [a-z0-9\-\.]{1,36} - *

- */ - @Override - public void setValueAsString(String theValue) { - setValue(theValue); - } - - @Override - public String toString() { - return getValue(); - } - - /** - * Returns a new IdType containing this IdType's values but with no server - * base URL if one is present in this IdType. For example, if this IdType - * contains the ID "http://foo/Patient/1", this method will return a new - * IdType containing ID "Patient/1". - */ - @Override - public IdType toUnqualified() { - if (isLocal() || isUrn()) { - return new IdType(getValueAsString()); - } - return new IdType(getResourceType(), getIdPart(), getVersionIdPart()); - } - - @Override - public IdType toUnqualifiedVersionless() { - if (isLocal() || isUrn()) { - return new IdType(getValueAsString()); - } - return new IdType(getResourceType(), getIdPart()); - } - - @Override - public IdType toVersionless() { - if (isLocal() || isUrn()) { - return new IdType(getValueAsString()); - } - return new IdType(getBaseUrl(), getResourceType(), getIdPart(), null); - } - - @Override - public IdType withResourceType(String theResourceName) { - if (isLocal() || isUrn()) { - return new IdType(getValueAsString()); - } - return new IdType(theResourceName, getIdPart(), getVersionIdPart()); - } - - /** - * Returns a view of this ID as a fully qualified URL, given a server base and - * resource name (which will only be used if the ID does not already contain - * those respective parts). Essentially, because IdType can contain either a - * complete URL or a partial one (or even jut a simple ID), this method may be - * used to translate into a complete URL. - * - * @param theServerBase - * The server base (e.g. "http://example.com/fhir") - * @param theResourceType - * The resource name (e.g. "Patient") - * @return A fully qualified URL for this ID (e.g. - * "http://example.com/fhir/Patient/1") - */ - @Override - public IdType withServerBase(String theServerBase, String theResourceType) { - if (isLocal() || isUrn()) { - return new IdType(getValueAsString()); - } - return new IdType(theServerBase, theResourceType, getIdPart(), getVersionIdPart()); - } - - /** - * Creates a new instance of this ID which is identical, but refers to the - * specific version of this resource ID noted by theVersion. - * - * @param theVersion - * The actual version string, e.g. "1" - * @return A new instance of IdType which is identical, but refers to the - * specific version of this resource ID noted by theVersion. - */ - public IdType withVersion(String theVersion) { - Validate.notBlank(theVersion, "Version may not be null or empty"); - - if (isLocal() || isUrn()) { - return new IdType(getValueAsString()); - } - - String existingValue = getValue(); - - int i = existingValue.indexOf("_history"); - String value; - if (i > 1) { - value = existingValue.substring(0, i - 1); - } else { - value = existingValue; - } - - return new IdType(value + '/' + "_history" + '/' + theVersion); - } - - private static boolean isUrlAbsolute(String theValue) { - String value = theValue.toLowerCase(); - return value.startsWith("http://") || value.startsWith("https://"); - } - - private static boolean isValidLong(String id) { - if (StringUtils.isBlank(id)) { - return false; - } - for (int i = 0; i < id.length(); i++) { - if (Character.isDigit(id.charAt(i)) == false) { - return false; - } - } - return true; - } - - /** - * Construct a new ID with with form "urn:uuid:[UUID]" where [UUID] is a new, - * randomly created UUID generated by {@link UUID#randomUUID()} - */ - public static IdType newRandomUuid() { - return new IdType("urn:uuid:" + UUID.randomUUID().toString()); - } - - /** - * Retrieves the ID from the given resource instance - */ - public static IdType of(IBaseResource theResouce) { - if (theResouce == null) { - throw new NullPointerException("theResource can not be null"); - } else { - IIdType retVal = theResouce.getIdElement(); - if (retVal == null) { - return null; - } else if (retVal instanceof IdType) { - return (IdType) retVal; - } else { - return new IdType(retVal.getValue()); - } - } - } - - private static String toPlainStringWithNpeThrowIfNeeded(BigDecimal theIdPart) { - if (theIdPart == null) { - throw new NullPointerException("BigDecimal ID can not be null"); - } - return theIdPart.toPlainString(); - } - - private static String toPlainStringWithNpeThrowIfNeeded(Long theIdPart) { - if (theIdPart == null) { - throw new NullPointerException("Long ID can not be null"); - } - return theIdPart.toString(); - } - - public String fhirType() { - return "id"; - } - - public IIdType setParts(String theBaseUrl, String theResourceType, String theIdPart, String theVersionIdPart) { - if (isNotBlank(theVersionIdPart)) { - Validate.notBlank(theResourceType, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated"); - Validate.notBlank(theIdPart, "If theVersionIdPart is populated, theResourceType and theIdPart must be populated"); - } - if (isNotBlank(theBaseUrl) && isNotBlank(theIdPart)) { - Validate.notBlank(theResourceType, "If theBaseUrl is populated and theIdPart is populated, theResourceType must be populated"); - } - - setValue(null); - - myBaseUrl = theBaseUrl; - myResourceType = theResourceType; - myUnqualifiedId = theIdPart; - myUnqualifiedVersionId = StringUtils.defaultIfBlank(theVersionIdPart, null); - myHaveComponentParts = true; - - return this; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Identifier.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Identifier.java deleted file mode 100644 index cdcd981b462..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Identifier.java +++ /dev/null @@ -1,623 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A technical identifier - identifies some entity uniquely and unambiguously. - */ -@DatatypeDef(name="Identifier") -public class Identifier extends Type implements ICompositeType { - - public enum IdentifierUse { - /** - * The identifier recommended for display and use in real-world interactions. - */ - USUAL, - /** - * The identifier considered to be most trusted for the identification of this item. - */ - OFFICIAL, - /** - * A temporary identifier. - */ - TEMP, - /** - * An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context. - */ - SECONDARY, - /** - * added to help the parsers - */ - NULL; - public static IdentifierUse fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return USUAL; - if ("official".equals(codeString)) - return OFFICIAL; - if ("temp".equals(codeString)) - return TEMP; - if ("secondary".equals(codeString)) - return SECONDARY; - throw new FHIRException("Unknown IdentifierUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case USUAL: return "usual"; - case OFFICIAL: return "official"; - case TEMP: return "temp"; - case SECONDARY: return "secondary"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case USUAL: return "http://hl7.org/fhir/identifier-use"; - case OFFICIAL: return "http://hl7.org/fhir/identifier-use"; - case TEMP: return "http://hl7.org/fhir/identifier-use"; - case SECONDARY: return "http://hl7.org/fhir/identifier-use"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case USUAL: return "The identifier recommended for display and use in real-world interactions."; - case OFFICIAL: return "The identifier considered to be most trusted for the identification of this item."; - case TEMP: return "A temporary identifier."; - case SECONDARY: return "An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but cannot be consistently assigned to the same object again in a different context."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case USUAL: return "Usual"; - case OFFICIAL: return "Official"; - case TEMP: return "Temp"; - case SECONDARY: return "Secondary"; - default: return "?"; - } - } - } - - public static class IdentifierUseEnumFactory implements EnumFactory { - public IdentifierUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return IdentifierUse.USUAL; - if ("official".equals(codeString)) - return IdentifierUse.OFFICIAL; - if ("temp".equals(codeString)) - return IdentifierUse.TEMP; - if ("secondary".equals(codeString)) - return IdentifierUse.SECONDARY; - throw new IllegalArgumentException("Unknown IdentifierUse code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("usual".equals(codeString)) - return new Enumeration(this, IdentifierUse.USUAL); - if ("official".equals(codeString)) - return new Enumeration(this, IdentifierUse.OFFICIAL); - if ("temp".equals(codeString)) - return new Enumeration(this, IdentifierUse.TEMP); - if ("secondary".equals(codeString)) - return new Enumeration(this, IdentifierUse.SECONDARY); - throw new FHIRException("Unknown IdentifierUse code '"+codeString+"'"); - } - public String toCode(IdentifierUse code) { - if (code == IdentifierUse.USUAL) - return "usual"; - if (code == IdentifierUse.OFFICIAL) - return "official"; - if (code == IdentifierUse.TEMP) - return "temp"; - if (code == IdentifierUse.SECONDARY) - return "secondary"; - return "?"; - } - public String toSystem(IdentifierUse code) { - return code.getSystem(); - } - } - - /** - * The purpose of this identifier. - */ - @Child(name = "use", type = {CodeType.class}, order=0, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="usual | official | temp | secondary (If known)", formalDefinition="The purpose of this identifier." ) - protected Enumeration use; - - /** - * A coded type for the identifier that can be used to determine which identifier to use for a specific purpose. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of identifier", formalDefinition="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." ) - protected CodeableConcept type; - - /** - * Establishes the namespace in which set of possible id values is unique. - */ - @Child(name = "system", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The namespace for the identifier", formalDefinition="Establishes the namespace in which set of possible id values is unique." ) - protected UriType system; - - /** - * The portion of the identifier typically relevant to the user and which is unique within the context of the system. - */ - @Child(name = "value", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The value that is unique", formalDefinition="The portion of the identifier typically relevant to the user and which is unique within the context of the system." ) - protected StringType value; - - /** - * Time period during which identifier is/was valid for use. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period when id is/was valid for use", formalDefinition="Time period during which identifier is/was valid for use." ) - protected Period period; - - /** - * Organization that issued/manages the identifier. - */ - @Child(name = "assigner", type = {Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization that issued id (may be just text)", formalDefinition="Organization that issued/manages the identifier." ) - protected Reference assigner; - - /** - * The actual object that is the target of the reference (Organization that issued/manages the identifier.) - */ - protected Organization assignerTarget; - - private static final long serialVersionUID = -478840981L; - - /** - * Constructor - */ - public Identifier() { - super(); - } - - /** - * @return {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new IdentifierUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (The purpose of this identifier.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Identifier setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return The purpose of this identifier. - */ - public IdentifierUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value The purpose of this identifier. - */ - public Identifier setUse(IdentifierUse value) { - if (value == null) - this.use = null; - else { - if (this.use == null) - this.use = new Enumeration(new IdentifierUseEnumFactory()); - this.use.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.) - */ - public Identifier setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Establishes the namespace in which set of possible id values is unique.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Identifier setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return Establishes the namespace in which set of possible id values is unique. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value Establishes the namespace in which set of possible id values is unique. - */ - public Identifier setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The portion of the identifier typically relevant to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The portion of the identifier typically relevant to the user and which is unique within the context of the system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Identifier setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The portion of the identifier typically relevant to the user and which is unique within the context of the system. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The portion of the identifier typically relevant to the user and which is unique within the context of the system. - */ - public Identifier setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (Time period during which identifier is/was valid for use.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Time period during which identifier is/was valid for use.) - */ - public Identifier setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #assigner} (Organization that issued/manages the identifier.) - */ - public Reference getAssigner() { - if (this.assigner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.assigner"); - else if (Configuration.doAutoCreate()) - this.assigner = new Reference(); // cc - return this.assigner; - } - - public boolean hasAssigner() { - return this.assigner != null && !this.assigner.isEmpty(); - } - - /** - * @param value {@link #assigner} (Organization that issued/manages the identifier.) - */ - public Identifier setAssigner(Reference value) { - this.assigner = value; - return this; - } - - /** - * @return {@link #assigner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that issued/manages the identifier.) - */ - public Organization getAssignerTarget() { - if (this.assignerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Identifier.assigner"); - else if (Configuration.doAutoCreate()) - this.assignerTarget = new Organization(); // aa - return this.assignerTarget; - } - - /** - * @param value {@link #assigner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that issued/manages the identifier.) - */ - public Identifier setAssignerTarget(Organization value) { - this.assignerTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("use", "code", "The purpose of this identifier.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("type", "CodeableConcept", "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("system", "uri", "Establishes the namespace in which set of possible id values is unique.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("value", "string", "The portion of the identifier typically relevant to the user and which is unique within the context of the system.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("period", "Period", "Time period during which identifier is/was valid for use.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("assigner", "Reference(Organization)", "Organization that issued/manages the identifier.", 0, java.lang.Integer.MAX_VALUE, assigner)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -369881636: /*assigner*/ return this.assigner == null ? new Base[0] : new Base[] {this.assigner}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116103: // use - this.use = new IdentifierUseEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -369881636: // assigner - this.assigner = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("use")) - this.use = new IdentifierUseEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("assigner")) - this.assigner = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case 3575610: return getType(); // CodeableConcept - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - case -991726143: return getPeriod(); // Period - case -369881636: return getAssigner(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type Identifier.use"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type Identifier.system"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type Identifier.value"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("assigner")) { - this.assigner = new Reference(); - return this.assigner; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Identifier"; - - } - - public Identifier copy() { - Identifier dst = new Identifier(); - copyValues(dst); - dst.use = use == null ? null : use.copy(); - dst.type = type == null ? null : type.copy(); - dst.system = system == null ? null : system.copy(); - dst.value = value == null ? null : value.copy(); - dst.period = period == null ? null : period.copy(); - dst.assigner = assigner == null ? null : assigner.copy(); - return dst; - } - - protected Identifier typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Identifier)) - return false; - Identifier o = (Identifier) other; - return compareDeep(use, o.use, true) && compareDeep(type, o.type, true) && compareDeep(system, o.system, true) - && compareDeep(value, o.value, true) && compareDeep(period, o.period, true) && compareDeep(assigner, o.assigner, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Identifier)) - return false; - Identifier o = (Identifier) other; - return compareValues(use, o.use, true) && compareValues(system, o.system, true) && compareValues(value, o.value, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (use == null || use.isEmpty()) && (type == null || type.isEmpty()) - && (system == null || system.isEmpty()) && (value == null || value.isEmpty()) && (period == null || period.isEmpty()) - && (assigner == null || assigner.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java deleted file mode 100644 index b1e28de7fc0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingExcerpt.java +++ /dev/null @@ -1,3230 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingExcerpt resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ -@ResourceDef(name="ImagingExcerpt", profile="http://hl7.org/fhir/Profile/ImagingExcerpt") -public class ImagingExcerpt extends DomainResource { - - public enum DWebType { - /** - * Web Access to DICOM Persistent Objects - RESTful Services - */ - WADORS, - /** - * Web Access to DICOM Persistent Objects - URI - */ - WADOURI, - /** - * IHE - Invoke Image Display Profile - */ - IID, - /** - * Web Access to DICOM Persistent Objects - Web Services - */ - WADOWS, - /** - * added to help the parsers - */ - NULL; - public static DWebType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("WADO-RS".equals(codeString)) - return WADORS; - if ("WADO-URI".equals(codeString)) - return WADOURI; - if ("IID".equals(codeString)) - return IID; - if ("WADO-WS".equals(codeString)) - return WADOWS; - throw new FHIRException("Unknown DWebType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case WADORS: return "WADO-RS"; - case WADOURI: return "WADO-URI"; - case IID: return "IID"; - case WADOWS: return "WADO-WS"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case WADORS: return "http://hl7.org/fhir/dWebType"; - case WADOURI: return "http://hl7.org/fhir/dWebType"; - case IID: return "http://hl7.org/fhir/dWebType"; - case WADOWS: return "http://hl7.org/fhir/dWebType"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case WADORS: return "Web Access to DICOM Persistent Objects - RESTful Services"; - case WADOURI: return "Web Access to DICOM Persistent Objects - URI"; - case IID: return "IHE - Invoke Image Display Profile"; - case WADOWS: return "Web Access to DICOM Persistent Objects - Web Services"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case WADORS: return "WADO-RS"; - case WADOURI: return "WADO-URI"; - case IID: return "IID"; - case WADOWS: return "WADO-WS"; - default: return "?"; - } - } - } - - public static class DWebTypeEnumFactory implements EnumFactory { - public DWebType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("WADO-RS".equals(codeString)) - return DWebType.WADORS; - if ("WADO-URI".equals(codeString)) - return DWebType.WADOURI; - if ("IID".equals(codeString)) - return DWebType.IID; - if ("WADO-WS".equals(codeString)) - return DWebType.WADOWS; - throw new IllegalArgumentException("Unknown DWebType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("WADO-RS".equals(codeString)) - return new Enumeration(this, DWebType.WADORS); - if ("WADO-URI".equals(codeString)) - return new Enumeration(this, DWebType.WADOURI); - if ("IID".equals(codeString)) - return new Enumeration(this, DWebType.IID); - if ("WADO-WS".equals(codeString)) - return new Enumeration(this, DWebType.WADOWS); - throw new FHIRException("Unknown DWebType code '"+codeString+"'"); - } - public String toCode(DWebType code) { - if (code == DWebType.WADORS) - return "WADO-RS"; - if (code == DWebType.WADOURI) - return "WADO-URI"; - if (code == DWebType.IID) - return "IID"; - if (code == DWebType.WADOWS) - return "WADO-WS"; - return "?"; - } - public String toSystem(DWebType code) { - return code.getSystem(); - } - } - - @Block() - public static class StudyComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Study instance UID of the SOP instances in the selection. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Study instance UID", formalDefinition="Study instance UID of the SOP instances in the selection." ) - protected OidType uid; - - /** - * Reference to the Imaging Study in FHIR form. - */ - @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to ImagingStudy", formalDefinition="Reference to the Imaging Study in FHIR form." ) - protected Reference imagingStudy; - - /** - * The actual object that is the target of the reference (Reference to the Imaging Study in FHIR form.) - */ - protected ImagingStudy imagingStudyTarget; - - /** - * Methods of accessing using DICOM web technologies. - */ - @Child(name = "dicom", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Dicom web access", formalDefinition="Methods of accessing using DICOM web technologies." ) - protected List dicom; - - /** - * A set of viewable reference images of various types. - */ - @Child(name = "viewable", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Viewable format", formalDefinition="A set of viewable reference images of various types." ) - protected List viewable; - - /** - * Series identity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name = "series", type = {}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series identity and locating information of the DICOM SOP instances in the selection." ) - protected List series; - - private static final long serialVersionUID = 1674060080L; - - /** - * Constructor - */ - public StudyComponent() { - super(); - } - - /** - * Constructor - */ - public StudyComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public StudyComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Study instance UID of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Study instance UID of the SOP instances in the selection. - */ - public StudyComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) - */ - public Reference getImagingStudy() { - if (this.imagingStudy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); - else if (Configuration.doAutoCreate()) - this.imagingStudy = new Reference(); // cc - return this.imagingStudy; - } - - public boolean hasImagingStudy() { - return this.imagingStudy != null && !this.imagingStudy.isEmpty(); - } - - /** - * @param value {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) - */ - public StudyComponent setImagingStudy(Reference value) { - this.imagingStudy = value; - return this; - } - - /** - * @return {@link #imagingStudy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the Imaging Study in FHIR form.) - */ - public ImagingStudy getImagingStudyTarget() { - if (this.imagingStudyTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); - else if (Configuration.doAutoCreate()) - this.imagingStudyTarget = new ImagingStudy(); // aa - return this.imagingStudyTarget; - } - - /** - * @param value {@link #imagingStudy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the Imaging Study in FHIR form.) - */ - public StudyComponent setImagingStudyTarget(ImagingStudy value) { - this.imagingStudyTarget = value; - return this; - } - - /** - * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) - */ - public List getDicom() { - if (this.dicom == null) - this.dicom = new ArrayList(); - return this.dicom; - } - - public boolean hasDicom() { - if (this.dicom == null) - return false; - for (StudyDicomComponent item : this.dicom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) - */ - // syntactic sugar - public StudyDicomComponent addDicom() { //3 - StudyDicomComponent t = new StudyDicomComponent(); - if (this.dicom == null) - this.dicom = new ArrayList(); - this.dicom.add(t); - return t; - } - - // syntactic sugar - public StudyComponent addDicom(StudyDicomComponent t) { //3 - if (t == null) - return this; - if (this.dicom == null) - this.dicom = new ArrayList(); - this.dicom.add(t); - return this; - } - - /** - * @return {@link #viewable} (A set of viewable reference images of various types.) - */ - public List getViewable() { - if (this.viewable == null) - this.viewable = new ArrayList(); - return this.viewable; - } - - public boolean hasViewable() { - if (this.viewable == null) - return false; - for (StudyViewableComponent item : this.viewable) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #viewable} (A set of viewable reference images of various types.) - */ - // syntactic sugar - public StudyViewableComponent addViewable() { //3 - StudyViewableComponent t = new StudyViewableComponent(); - if (this.viewable == null) - this.viewable = new ArrayList(); - this.viewable.add(t); - return t; - } - - // syntactic sugar - public StudyComponent addViewable(StudyViewableComponent t) { //3 - if (t == null) - return this; - if (this.viewable == null) - this.viewable = new ArrayList(); - this.viewable.add(t); - return this; - } - - /** - * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (SeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public SeriesComponent addSeries() { //3 - SeriesComponent t = new SeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - // syntactic sugar - public StudyComponent addSeries(SeriesComponent t) { //3 - if (t == null) - return this; - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Study instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "Reference to the Imaging Study in FHIR form.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); - childrenList.add(new Property("dicom", "", "Methods of accessing using DICOM web technologies.", 0, java.lang.Integer.MAX_VALUE, dicom)); - childrenList.add(new Property("viewable", "", "A set of viewable reference images of various types.", 0, java.lang.Integer.MAX_VALUE, viewable)); - childrenList.add(new Property("series", "", "Series identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : new Base[] {this.imagingStudy}; // Reference - case 95578844: /*dicom*/ return this.dicom == null ? new Base[0] : this.dicom.toArray(new Base[this.dicom.size()]); // StudyDicomComponent - case 1196225919: /*viewable*/ return this.viewable == null ? new Base[0] : this.viewable.toArray(new Base[this.viewable.size()]); // StudyViewableComponent - case -905838985: /*series*/ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // SeriesComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case -814900911: // imagingStudy - this.imagingStudy = castToReference(value); // Reference - break; - case 95578844: // dicom - this.getDicom().add((StudyDicomComponent) value); // StudyDicomComponent - break; - case 1196225919: // viewable - this.getViewable().add((StudyViewableComponent) value); // StudyViewableComponent - break; - case -905838985: // series - this.getSeries().add((SeriesComponent) value); // SeriesComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("imagingStudy")) - this.imagingStudy = castToReference(value); // Reference - else if (name.equals("dicom")) - this.getDicom().add((StudyDicomComponent) value); - else if (name.equals("viewable")) - this.getViewable().add((StudyViewableComponent) value); - else if (name.equals("series")) - this.getSeries().add((SeriesComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case -814900911: return getImagingStudy(); // Reference - case 95578844: return addDicom(); // StudyDicomComponent - case 1196225919: return addViewable(); // StudyViewableComponent - case -905838985: return addSeries(); // SeriesComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); - } - else if (name.equals("imagingStudy")) { - this.imagingStudy = new Reference(); - return this.imagingStudy; - } - else if (name.equals("dicom")) { - return addDicom(); - } - else if (name.equals("viewable")) { - return addViewable(); - } - else if (name.equals("series")) { - return addSeries(); - } - else - return super.addChild(name); - } - - public StudyComponent copy() { - StudyComponent dst = new StudyComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.imagingStudy = imagingStudy == null ? null : imagingStudy.copy(); - if (dicom != null) { - dst.dicom = new ArrayList(); - for (StudyDicomComponent i : dicom) - dst.dicom.add(i.copy()); - }; - if (viewable != null) { - dst.viewable = new ArrayList(); - for (StudyViewableComponent i : viewable) - dst.viewable.add(i.copy()); - }; - if (series != null) { - dst.series = new ArrayList(); - for (SeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StudyComponent)) - return false; - StudyComponent o = (StudyComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(imagingStudy, o.imagingStudy, true) && compareDeep(dicom, o.dicom, true) - && compareDeep(viewable, o.viewable, true) && compareDeep(series, o.series, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StudyComponent)) - return false; - StudyComponent o = (StudyComponent) other; - return compareValues(uid, o.uid, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) - && (dicom == null || dicom.isEmpty()) && (viewable == null || viewable.isEmpty()) && (series == null || series.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingExcerpt.study"; - - } - - } - - @Block() - public static class StudyDicomComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Access type for DICOM web. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="WADO-RS | WADO-URI | IID | WADO-WS", formalDefinition="Access type for DICOM web." ) - protected Enumeration type; - - /** - * The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Retrieve study URL", formalDefinition="The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol." ) - protected UriType url; - - private static final long serialVersionUID = 1661664416L; - - /** - * Constructor - */ - public StudyDicomComponent() { - super(); - } - - /** - * Constructor - */ - public StudyDicomComponent(Enumeration type, UriType url) { - super(); - this.type = type; - this.url = url; - } - - /** - * @return {@link #type} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyDicomComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new DWebTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StudyDicomComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Access type for DICOM web. - */ - public DWebType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Access type for DICOM web. - */ - public StudyDicomComponent setType(DWebType value) { - if (this.type == null) - this.type = new Enumeration(new DWebTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyDicomComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StudyDicomComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - public StudyDicomComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Access type for DICOM web.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("url", "uri", "The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.type"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); - } - else - return super.addChild(name); - } - - public StudyDicomComponent copy() { - StudyDicomComponent dst = new StudyDicomComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StudyDicomComponent)) - return false; - StudyDicomComponent o = (StudyDicomComponent) other; - return compareDeep(type, o.type, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StudyDicomComponent)) - return false; - StudyDicomComponent o = (StudyDicomComponent) other; - return compareValues(type, o.type, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingExcerpt.study.dicom"; - - } - - } - - @Block() - public static class StudyViewableComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - @Child(name = "contentType", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Mime type of the content, with charset etc.", formalDefinition="Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate." ) - protected CodeType contentType; - - /** - * Height of the image in pixels (photo/video). - */ - @Child(name = "height", type = {PositiveIntType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Height of the image in pixels (photo/video)", formalDefinition="Height of the image in pixels (photo/video)." ) - protected PositiveIntType height; - - /** - * Width of the image in pixels (photo/video). - */ - @Child(name = "width", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) - protected PositiveIntType width; - - /** - * 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. - */ - @Child(name = "frames", type = {PositiveIntType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @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." ) - protected PositiveIntType frames; - - /** - * The duration of the recording in seconds - for audio and video. - */ - @Child(name = "duration", type = {UnsignedIntType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) - protected UnsignedIntType duration; - - /** - * The number of bytes of data that make up this attachment. - */ - @Child(name = "size", type = {UnsignedIntType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Number of bytes of content (if url provided)", formalDefinition="The number of bytes of data that make up this attachment." ) - protected UnsignedIntType size; - - /** - * A label or set of text to display in place of the data. - */ - @Child(name = "title", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Label to display in place of the data", formalDefinition="A label or set of text to display in place of the data." ) - protected StringType title; - - /** - * A location where the data can be accessed. - */ - @Child(name = "url", type = {UriType.class}, order=8, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Uri where the data can be found", formalDefinition="A location where the data can be accessed." ) - protected UriType url; - - private static final long serialVersionUID = -2135689428L; - - /** - * Constructor - */ - public StudyViewableComponent() { - super(); - } - - /** - * Constructor - */ - public StudyViewableComponent(CodeType contentType, UriType url) { - super(); - this.contentType = contentType; - this.url = url; - } - - /** - * @return {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public StudyViewableComponent setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate. - */ - public StudyViewableComponent setContentType(String value) { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - return this; - } - - /** - * @return {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public PositiveIntType getHeightElement() { - if (this.height == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.height"); - else if (Configuration.doAutoCreate()) - this.height = new PositiveIntType(); // bb - return this.height; - } - - public boolean hasHeightElement() { - return this.height != null && !this.height.isEmpty(); - } - - public boolean hasHeight() { - return this.height != null && !this.height.isEmpty(); - } - - /** - * @param value {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public StudyViewableComponent setHeightElement(PositiveIntType value) { - this.height = value; - return this; - } - - /** - * @return Height of the image in pixels (photo/video). - */ - public int getHeight() { - return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue(); - } - - /** - * @param value Height of the image in pixels (photo/video). - */ - public StudyViewableComponent setHeight(int value) { - if (this.height == null) - this.height = new PositiveIntType(); - this.height.setValue(value); - return this; - } - - /** - * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public PositiveIntType getWidthElement() { - if (this.width == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.width"); - else if (Configuration.doAutoCreate()) - this.width = new PositiveIntType(); // bb - return this.width; - } - - public boolean hasWidthElement() { - return this.width != null && !this.width.isEmpty(); - } - - public boolean hasWidth() { - return this.width != null && !this.width.isEmpty(); - } - - /** - * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public StudyViewableComponent setWidthElement(PositiveIntType value) { - this.width = value; - return this; - } - - /** - * @return Width of the image in pixels (photo/video). - */ - public int getWidth() { - return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue(); - } - - /** - * @param value Width of the image in pixels (photo/video). - */ - public StudyViewableComponent setWidth(int value) { - if (this.width == null) - this.width = new PositiveIntType(); - this.width.setValue(value); - return this; - } - - /** - * @return {@link #frames} (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.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public PositiveIntType getFramesElement() { - if (this.frames == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.frames"); - else if (Configuration.doAutoCreate()) - this.frames = new PositiveIntType(); // bb - return this.frames; - } - - public boolean hasFramesElement() { - return this.frames != null && !this.frames.isEmpty(); - } - - public boolean hasFrames() { - return this.frames != null && !this.frames.isEmpty(); - } - - /** - * @param value {@link #frames} (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.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public StudyViewableComponent setFramesElement(PositiveIntType value) { - this.frames = value; - return this; - } - - /** - * @return 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. - */ - public int getFrames() { - return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue(); - } - - /** - * @param value 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. - */ - public StudyViewableComponent setFrames(int value) { - if (this.frames == null) - this.frames = new PositiveIntType(); - this.frames.setValue(value); - return this; - } - - /** - * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public UnsignedIntType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new UnsignedIntType(); // bb - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public StudyViewableComponent setDurationElement(UnsignedIntType value) { - this.duration = value; - return this; - } - - /** - * @return The duration of the recording in seconds - for audio and video. - */ - public int getDuration() { - return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue(); - } - - /** - * @param value The duration of the recording in seconds - for audio and video. - */ - public StudyViewableComponent setDuration(int value) { - if (this.duration == null) - this.duration = new UnsignedIntType(); - this.duration.setValue(value); - return this; - } - - /** - * @return {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public UnsignedIntType getSizeElement() { - if (this.size == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.size"); - else if (Configuration.doAutoCreate()) - this.size = new UnsignedIntType(); // bb - return this.size; - } - - public boolean hasSizeElement() { - return this.size != null && !this.size.isEmpty(); - } - - public boolean hasSize() { - return this.size != null && !this.size.isEmpty(); - } - - /** - * @param value {@link #size} (The number of bytes of data that make up this attachment.). This is the underlying object with id, value and extensions. The accessor "getSize" gives direct access to the value - */ - public StudyViewableComponent setSizeElement(UnsignedIntType value) { - this.size = value; - return this; - } - - /** - * @return The number of bytes of data that make up this attachment. - */ - public int getSize() { - return this.size == null || this.size.isEmpty() ? 0 : this.size.getValue(); - } - - /** - * @param value The number of bytes of data that make up this attachment. - */ - public StudyViewableComponent setSize(int value) { - if (this.size == null) - this.size = new UnsignedIntType(); - this.size.setValue(value); - return this; - } - - /** - * @return {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A label or set of text to display in place of the data.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StudyViewableComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A label or set of text to display in place of the data. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A label or set of text to display in place of the data. - */ - public StudyViewableComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (A location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyViewableComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (A location where the data can be accessed.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StudyViewableComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return A location where the data can be accessed. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value A location where the data can be accessed. - */ - public StudyViewableComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("contentType", "code", "Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); - childrenList.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); - childrenList.add(new Property("frames", "positiveInt", "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.", 0, java.lang.Integer.MAX_VALUE, frames)); - childrenList.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("size", "unsignedInt", "The number of bytes of data that make up this attachment.", 0, java.lang.Integer.MAX_VALUE, size)); - childrenList.add(new Property("title", "string", "A label or set of text to display in place of the data.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("url", "uri", "A location where the data can be accessed.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType - case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // PositiveIntType - case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // PositiveIntType - case -1266514778: /*frames*/ return this.frames == null ? new Base[0] : new Base[] {this.frames}; // PositiveIntType - case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // UnsignedIntType - case 3530753: /*size*/ return this.size == null ? new Base[0] : new Base[] {this.size}; // UnsignedIntType - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -389131437: // contentType - this.contentType = castToCode(value); // CodeType - break; - case -1221029593: // height - this.height = castToPositiveInt(value); // PositiveIntType - break; - case 113126854: // width - this.width = castToPositiveInt(value); // PositiveIntType - break; - case -1266514778: // frames - this.frames = castToPositiveInt(value); // PositiveIntType - break; - case -1992012396: // duration - this.duration = castToUnsignedInt(value); // UnsignedIntType - break; - case 3530753: // size - this.size = castToUnsignedInt(value); // UnsignedIntType - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("contentType")) - this.contentType = castToCode(value); // CodeType - else if (name.equals("height")) - this.height = castToPositiveInt(value); // PositiveIntType - else if (name.equals("width")) - this.width = castToPositiveInt(value); // PositiveIntType - else if (name.equals("frames")) - this.frames = castToPositiveInt(value); // PositiveIntType - else if (name.equals("duration")) - this.duration = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("size")) - this.size = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType - case -1221029593: throw new FHIRException("Cannot make property height as it is not a complex type"); // PositiveIntType - case 113126854: throw new FHIRException("Cannot make property width as it is not a complex type"); // PositiveIntType - case -1266514778: throw new FHIRException("Cannot make property frames as it is not a complex type"); // PositiveIntType - case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // UnsignedIntType - case 3530753: throw new FHIRException("Cannot make property size as it is not a complex type"); // UnsignedIntType - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("contentType")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.contentType"); - } - else if (name.equals("height")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.height"); - } - else if (name.equals("width")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.width"); - } - else if (name.equals("frames")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.frames"); - } - else if (name.equals("duration")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.duration"); - } - else if (name.equals("size")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.size"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.title"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); - } - else - return super.addChild(name); - } - - public StudyViewableComponent copy() { - StudyViewableComponent dst = new StudyViewableComponent(); - copyValues(dst); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.height = height == null ? null : height.copy(); - dst.width = width == null ? null : width.copy(); - dst.frames = frames == null ? null : frames.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.size = size == null ? null : size.copy(); - dst.title = title == null ? null : title.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StudyViewableComponent)) - return false; - StudyViewableComponent o = (StudyViewableComponent) other; - return compareDeep(contentType, o.contentType, true) && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) - && compareDeep(frames, o.frames, true) && compareDeep(duration, o.duration, true) && compareDeep(size, o.size, true) - && compareDeep(title, o.title, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StudyViewableComponent)) - return false; - StudyViewableComponent o = (StudyViewableComponent) other; - return compareValues(contentType, o.contentType, true) && compareValues(height, o.height, true) && compareValues(width, o.width, true) - && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true) && compareValues(size, o.size, true) - && compareValues(title, o.title, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (contentType == null || contentType.isEmpty()) && (height == null || height.isEmpty()) - && (width == null || width.isEmpty()) && (frames == null || frames.isEmpty()) && (duration == null || duration.isEmpty()) - && (size == null || size.isEmpty()) && (title == null || title.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingExcerpt.study.viewable"; - - } - - } - - @Block() - public static class SeriesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Series instance UID of the SOP instances in the selection. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Series instance UID", formalDefinition="Series instance UID of the SOP instances in the selection." ) - protected OidType uid; - - /** - * Methods of accessing using DICOM web technologies. - */ - @Child(name = "dicom", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Dicom web access", formalDefinition="Methods of accessing using DICOM web technologies." ) - protected List dicom; - - /** - * Identity and locating information of the selected DICOM SOP instances. - */ - @Child(name = "instance", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) - protected List instance; - - private static final long serialVersionUID = 1845643577L; - - /** - * Constructor - */ - public SeriesComponent() { - super(); - } - - /** - * Constructor - */ - public SeriesComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public SeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Series instance UID of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Series instance UID of the SOP instances in the selection. - */ - public SeriesComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) - */ - public List getDicom() { - if (this.dicom == null) - this.dicom = new ArrayList(); - return this.dicom; - } - - public boolean hasDicom() { - if (this.dicom == null) - return false; - for (SeriesDicomComponent item : this.dicom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) - */ - // syntactic sugar - public SeriesDicomComponent addDicom() { //3 - SeriesDicomComponent t = new SeriesDicomComponent(); - if (this.dicom == null) - this.dicom = new ArrayList(); - this.dicom.add(t); - return t; - } - - // syntactic sugar - public SeriesComponent addDicom(SeriesDicomComponent t) { //3 - if (t == null) - return this; - if (this.dicom == null) - this.dicom = new ArrayList(); - this.dicom.add(t); - return this; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (InstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - // syntactic sugar - public InstanceComponent addInstance() { //3 - InstanceComponent t = new InstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - // syntactic sugar - public SeriesComponent addInstance(InstanceComponent t) { //3 - if (t == null) - return this; - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Series instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("dicom", "", "Methods of accessing using DICOM web technologies.", 0, java.lang.Integer.MAX_VALUE, dicom)); - childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case 95578844: /*dicom*/ return this.dicom == null ? new Base[0] : this.dicom.toArray(new Base[this.dicom.size()]); // SeriesDicomComponent - case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // InstanceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case 95578844: // dicom - this.getDicom().add((SeriesDicomComponent) value); // SeriesDicomComponent - break; - case 555127957: // instance - this.getInstance().add((InstanceComponent) value); // InstanceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("dicom")) - this.getDicom().add((SeriesDicomComponent) value); - else if (name.equals("instance")) - this.getInstance().add((InstanceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case 95578844: return addDicom(); // SeriesDicomComponent - case 555127957: return addInstance(); // InstanceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); - } - else if (name.equals("dicom")) { - return addDicom(); - } - else if (name.equals("instance")) { - return addInstance(); - } - else - return super.addChild(name); - } - - public SeriesComponent copy() { - SeriesComponent dst = new SeriesComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - if (dicom != null) { - dst.dicom = new ArrayList(); - for (SeriesDicomComponent i : dicom) - dst.dicom.add(i.copy()); - }; - if (instance != null) { - dst.instance = new ArrayList(); - for (InstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SeriesComponent)) - return false; - SeriesComponent o = (SeriesComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(dicom, o.dicom, true) && compareDeep(instance, o.instance, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SeriesComponent)) - return false; - SeriesComponent o = (SeriesComponent) other; - return compareValues(uid, o.uid, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (dicom == null || dicom.isEmpty()) - && (instance == null || instance.isEmpty()); - } - - public String fhirType() { - return "ImagingExcerpt.study.series"; - - } - - } - - @Block() - public static class SeriesDicomComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Access type for DICOM web. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="WADO-RS | WADO-URI | IID | WADO-WS", formalDefinition="Access type for DICOM web." ) - protected Enumeration type; - - /** - * The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Retrieve study URL", formalDefinition="The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol." ) - protected UriType url; - - private static final long serialVersionUID = 1661664416L; - - /** - * Constructor - */ - public SeriesDicomComponent() { - super(); - } - - /** - * Constructor - */ - public SeriesDicomComponent(Enumeration type, UriType url) { - super(); - this.type = type; - this.url = url; - } - - /** - * @return {@link #type} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesDicomComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new DWebTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SeriesDicomComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Access type for DICOM web. - */ - public DWebType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Access type for DICOM web. - */ - public SeriesDicomComponent setType(DWebType value) { - if (this.type == null) - this.type = new Enumeration(new DWebTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesDicomComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SeriesDicomComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - public SeriesDicomComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Access type for DICOM web.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("url", "uri", "The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.type"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); - } - else - return super.addChild(name); - } - - public SeriesDicomComponent copy() { - SeriesDicomComponent dst = new SeriesDicomComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SeriesDicomComponent)) - return false; - SeriesDicomComponent o = (SeriesDicomComponent) other; - return compareDeep(type, o.type, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SeriesDicomComponent)) - return false; - SeriesDicomComponent o = (SeriesDicomComponent) other; - return compareValues(type, o.type, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingExcerpt.study.series.dicom"; - - } - - } - - @Block() - public static class InstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * SOP class UID of the selected instance. - */ - @Child(name = "sopClass", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="SOP class UID of instance", formalDefinition="SOP class UID of the selected instance." ) - protected OidType sopClass; - - /** - * SOP Instance UID of the selected instance. - */ - @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Selected instance UID", formalDefinition="SOP Instance UID of the selected instance." ) - protected OidType uid; - - /** - * Methods of accessing using DICOM web technologies. - */ - @Child(name = "dicom", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Dicom web access", formalDefinition="Methods of accessing using DICOM web technologies." ) - protected List dicom; - - /** - * The specific frame reference within a multi-frame object. - */ - @Child(name = "frameNumbers", type = {UnsignedIntType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Frame reference number", formalDefinition="The specific frame reference within a multi-frame object." ) - protected List frameNumbers; - - private static final long serialVersionUID = 1372440557L; - - /** - * Constructor - */ - public InstanceComponent() { - super(); - } - - /** - * Constructor - */ - public InstanceComponent(OidType sopClass, OidType uid) { - super(); - this.sopClass = sopClass; - this.uid = uid; - } - - /** - * @return {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public OidType getSopClassElement() { - if (this.sopClass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.sopClass"); - else if (Configuration.doAutoCreate()) - this.sopClass = new OidType(); // bb - return this.sopClass; - } - - public boolean hasSopClassElement() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - public boolean hasSopClass() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - /** - * @param value {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public InstanceComponent setSopClassElement(OidType value) { - this.sopClass = value; - return this; - } - - /** - * @return SOP class UID of the selected instance. - */ - public String getSopClass() { - return this.sopClass == null ? null : this.sopClass.getValue(); - } - - /** - * @param value SOP class UID of the selected instance. - */ - public InstanceComponent setSopClass(String value) { - if (this.sopClass == null) - this.sopClass = new OidType(); - this.sopClass.setValue(value); - return this; - } - - /** - * @return {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public InstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return SOP Instance UID of the selected instance. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value SOP Instance UID of the selected instance. - */ - public InstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) - */ - public List getDicom() { - if (this.dicom == null) - this.dicom = new ArrayList(); - return this.dicom; - } - - public boolean hasDicom() { - if (this.dicom == null) - return false; - for (InstanceDicomComponent item : this.dicom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dicom} (Methods of accessing using DICOM web technologies.) - */ - // syntactic sugar - public InstanceDicomComponent addDicom() { //3 - InstanceDicomComponent t = new InstanceDicomComponent(); - if (this.dicom == null) - this.dicom = new ArrayList(); - this.dicom.add(t); - return t; - } - - // syntactic sugar - public InstanceComponent addDicom(InstanceDicomComponent t) { //3 - if (t == null) - return this; - if (this.dicom == null) - this.dicom = new ArrayList(); - this.dicom.add(t); - return this; - } - - /** - * @return {@link #frameNumbers} (The specific frame reference within a multi-frame object.) - */ - public List getFrameNumbers() { - if (this.frameNumbers == null) - this.frameNumbers = new ArrayList(); - return this.frameNumbers; - } - - public boolean hasFrameNumbers() { - if (this.frameNumbers == null) - return false; - for (UnsignedIntType item : this.frameNumbers) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #frameNumbers} (The specific frame reference within a multi-frame object.) - */ - // syntactic sugar - public UnsignedIntType addFrameNumbersElement() {//2 - UnsignedIntType t = new UnsignedIntType(); - if (this.frameNumbers == null) - this.frameNumbers = new ArrayList(); - this.frameNumbers.add(t); - return t; - } - - /** - * @param value {@link #frameNumbers} (The specific frame reference within a multi-frame object.) - */ - public InstanceComponent addFrameNumbers(int value) { //1 - UnsignedIntType t = new UnsignedIntType(); - t.setValue(value); - if (this.frameNumbers == null) - this.frameNumbers = new ArrayList(); - this.frameNumbers.add(t); - return this; - } - - /** - * @param value {@link #frameNumbers} (The specific frame reference within a multi-frame object.) - */ - public boolean hasFrameNumbers(int value) { - if (this.frameNumbers == null) - return false; - for (UnsignedIntType v : this.frameNumbers) - if (v.equals(value)) // unsignedInt - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sopClass", "oid", "SOP class UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); - childrenList.add(new Property("uid", "oid", "SOP Instance UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("dicom", "", "Methods of accessing using DICOM web technologies.", 0, java.lang.Integer.MAX_VALUE, dicom)); - childrenList.add(new Property("frameNumbers", "unsignedInt", "The specific frame reference within a multi-frame object.", 0, java.lang.Integer.MAX_VALUE, frameNumbers)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // OidType - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case 95578844: /*dicom*/ return this.dicom == null ? new Base[0] : this.dicom.toArray(new Base[this.dicom.size()]); // InstanceDicomComponent - case -144148451: /*frameNumbers*/ return this.frameNumbers == null ? new Base[0] : this.frameNumbers.toArray(new Base[this.frameNumbers.size()]); // UnsignedIntType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1560041540: // sopClass - this.sopClass = castToOid(value); // OidType - break; - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case 95578844: // dicom - this.getDicom().add((InstanceDicomComponent) value); // InstanceDicomComponent - break; - case -144148451: // frameNumbers - this.getFrameNumbers().add(castToUnsignedInt(value)); // UnsignedIntType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sopClass")) - this.sopClass = castToOid(value); // OidType - else if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("dicom")) - this.getDicom().add((InstanceDicomComponent) value); - else if (name.equals("frameNumbers")) - this.getFrameNumbers().add(castToUnsignedInt(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1560041540: throw new FHIRException("Cannot make property sopClass as it is not a complex type"); // OidType - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case 95578844: return addDicom(); // InstanceDicomComponent - case -144148451: throw new FHIRException("Cannot make property frameNumbers as it is not a complex type"); // UnsignedIntType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sopClass")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.sopClass"); - } - else if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); - } - else if (name.equals("dicom")) { - return addDicom(); - } - else if (name.equals("frameNumbers")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.frameNumbers"); - } - else - return super.addChild(name); - } - - public InstanceComponent copy() { - InstanceComponent dst = new InstanceComponent(); - copyValues(dst); - dst.sopClass = sopClass == null ? null : sopClass.copy(); - dst.uid = uid == null ? null : uid.copy(); - if (dicom != null) { - dst.dicom = new ArrayList(); - for (InstanceDicomComponent i : dicom) - dst.dicom.add(i.copy()); - }; - if (frameNumbers != null) { - dst.frameNumbers = new ArrayList(); - for (UnsignedIntType i : frameNumbers) - dst.frameNumbers.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof InstanceComponent)) - return false; - InstanceComponent o = (InstanceComponent) other; - return compareDeep(sopClass, o.sopClass, true) && compareDeep(uid, o.uid, true) && compareDeep(dicom, o.dicom, true) - && compareDeep(frameNumbers, o.frameNumbers, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof InstanceComponent)) - return false; - InstanceComponent o = (InstanceComponent) other; - return compareValues(sopClass, o.sopClass, true) && compareValues(uid, o.uid, true) && compareValues(frameNumbers, o.frameNumbers, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) - && (dicom == null || dicom.isEmpty()) && (frameNumbers == null || frameNumbers.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingExcerpt.study.series.instance"; - - } - - } - - @Block() - public static class InstanceDicomComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Access type for DICOM web. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="WADO-RS | WADO-URI | IID | WADO-WS", formalDefinition="Access type for DICOM web." ) - protected Enumeration type; - - /** - * The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Retrieve study URL", formalDefinition="The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol." ) - protected UriType url; - - private static final long serialVersionUID = 1661664416L; - - /** - * Constructor - */ - public InstanceDicomComponent() { - super(); - } - - /** - * Constructor - */ - public InstanceDicomComponent(Enumeration type, UriType url) { - super(); - this.type = type; - this.url = url; - } - - /** - * @return {@link #type} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceDicomComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new DWebTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Access type for DICOM web.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public InstanceDicomComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Access type for DICOM web. - */ - public DWebType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Access type for DICOM web. - */ - public InstanceDicomComponent setType(DWebType value) { - if (this.type == null) - this.type = new Enumeration(new DWebTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceDicomComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public InstanceDicomComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol. - */ - public InstanceDicomComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Access type for DICOM web.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("url", "uri", "The source system root URL / base URL, from which all content can be retrieved using the specified DICOM protocol.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new DWebTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.type"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.url"); - } - else - return super.addChild(name); - } - - public InstanceDicomComponent copy() { - InstanceDicomComponent dst = new InstanceDicomComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof InstanceDicomComponent)) - return false; - InstanceDicomComponent o = (InstanceDicomComponent) other; - return compareDeep(type, o.type, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof InstanceDicomComponent)) - return false; - InstanceDicomComponent o = (InstanceDicomComponent) other; - return compareValues(type, o.type, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingExcerpt.study.series.instance.dicom"; - - } - - } - - /** - * Unique identifier of the DICOM Key Object Selection (KOS) representation. - */ - @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Instance UID", formalDefinition="Unique identifier of the DICOM Key Object Selection (KOS) representation." ) - protected OidType uid; - - /** - * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) - */ - protected Patient patientTarget; - - /** - * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). - */ - @Child(name = "authoringTime", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time when the imaging object selection was created", formalDefinition="Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image)." ) - protected DateTimeType authoringTime; - - /** - * Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. - */ - @Child(name = "author", type = {Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - protected Resource authorTarget; - - /** - * The reason for, or significance of, the selection of objects referenced in the resource. - */ - @Child(name = "title", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) - protected CodeableConcept title; - - /** - * Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) - protected StringType description; - - /** - * Study identity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name = "study", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) - protected List study; - - private static final long serialVersionUID = 1428713335L; - - /** - * Constructor - */ - public ImagingExcerpt() { - super(); - } - - /** - * Constructor - */ - public ImagingExcerpt(OidType uid, Reference patient, CodeableConcept title) { - super(); - this.uid = uid; - this.patient = patient; - this.title = title; - } - - /** - * @return {@link #uid} (Unique identifier of the DICOM Key Object Selection (KOS) representation.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Unique identifier of the DICOM Key Object Selection (KOS) representation.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingExcerpt setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Unique identifier of the DICOM Key Object Selection (KOS) representation. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Unique identifier of the DICOM Key Object Selection (KOS) representation. - */ - public ImagingExcerpt setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) - */ - public ImagingExcerpt setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.) - */ - public ImagingExcerpt setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public DateTimeType getAuthoringTimeElement() { - if (this.authoringTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.authoringTime"); - else if (Configuration.doAutoCreate()) - this.authoringTime = new DateTimeType(); // bb - return this.authoringTime; - } - - public boolean hasAuthoringTimeElement() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - public boolean hasAuthoringTime() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - /** - * @param value {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public ImagingExcerpt setAuthoringTimeElement(DateTimeType value) { - this.authoringTime = value; - return this; - } - - /** - * @return Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). - */ - public Date getAuthoringTime() { - return this.authoringTime == null ? null : this.authoringTime.getValue(); - } - - /** - * @param value Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). - */ - public ImagingExcerpt setAuthoringTime(Date value) { - if (value == null) - this.authoringTime = null; - else { - if (this.authoringTime == null) - this.authoringTime = new DateTimeType(); - this.authoringTime.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingExcerpt setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingExcerpt setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public CodeableConcept getTitle() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.title"); - else if (Configuration.doAutoCreate()) - this.title = new CodeableConcept(); // cc - return this.title; - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public ImagingExcerpt setTitle(CodeableConcept value) { - this.title = value; - return this; - } - - /** - * @return {@link #description} (Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingExcerpt.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingExcerpt setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public ImagingExcerpt setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - public List getStudy() { - if (this.study == null) - this.study = new ArrayList(); - return this.study; - } - - public boolean hasStudy() { - if (this.study == null) - return false; - for (StudyComponent item : this.study) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public StudyComponent addStudy() { //3 - StudyComponent t = new StudyComponent(); - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return t; - } - - // syntactic sugar - public ImagingExcerpt addStudy(StudyComponent t) { //3 - if (t == null) - return this; - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Unique identifier of the DICOM Key Object Selection (KOS) representation.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingExcerpt.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("authoringTime", "dateTime", "Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).", 0, java.lang.Integer.MAX_VALUE, authoringTime)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of ImagingExcerpt. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the ImagingExcerpt. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1724532252: /*authoringTime*/ return this.authoringTime == null ? new Base[0] : new Base[] {this.authoringTime}; // DateTimeType - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 109776329: /*study*/ return this.study == null ? new Base[0] : this.study.toArray(new Base[this.study.size()]); // StudyComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1724532252: // authoringTime - this.authoringTime = castToDateTime(value); // DateTimeType - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 110371416: // title - this.title = castToCodeableConcept(value); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 109776329: // study - this.getStudy().add((StudyComponent) value); // StudyComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("authoringTime")) - this.authoringTime = castToDateTime(value); // DateTimeType - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("title")) - this.title = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("study")) - this.getStudy().add((StudyComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case -791418107: return getPatient(); // Reference - case -1724532252: throw new FHIRException("Cannot make property authoringTime as it is not a complex type"); // DateTimeType - case -1406328437: return getAuthor(); // Reference - case 110371416: return getTitle(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 109776329: return addStudy(); // StudyComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.uid"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("authoringTime")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.authoringTime"); - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("title")) { - this.title = new CodeableConcept(); - return this.title; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingExcerpt.description"); - } - else if (name.equals("study")) { - return addStudy(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ImagingExcerpt"; - - } - - public ImagingExcerpt copy() { - ImagingExcerpt dst = new ImagingExcerpt(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); - dst.author = author == null ? null : author.copy(); - dst.title = title == null ? null : title.copy(); - dst.description = description == null ? null : description.copy(); - if (study != null) { - dst.study = new ArrayList(); - for (StudyComponent i : study) - dst.study.add(i.copy()); - }; - return dst; - } - - protected ImagingExcerpt typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingExcerpt)) - return false; - ImagingExcerpt o = (ImagingExcerpt) other; - return compareDeep(uid, o.uid, true) && compareDeep(patient, o.patient, true) && compareDeep(authoringTime, o.authoringTime, true) - && compareDeep(author, o.author, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) - && compareDeep(study, o.study, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingExcerpt)) - return false; - ImagingExcerpt o = (ImagingExcerpt) other; - return compareValues(uid, o.uid, true) && compareValues(authoringTime, o.authoringTime, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) - && (authoringTime == null || authoringTime.isEmpty()) && (author == null || author.isEmpty()) - && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (study == null || study.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingExcerpt; - } - - /** - * Search parameter: selected-study - *

- * Description: Study selected in key DICOM object selection
- * Type: uri
- * Path: ImagingExcerpt.study.uid
- *

- */ - @SearchParamDefinition(name="selected-study", path="ImagingExcerpt.study.uid", description="Study selected in key DICOM object selection", type="uri" ) - public static final String SP_SELECTED_STUDY = "selected-study"; - /** - * Fluent Client search parameter constant for selected-study - *

- * Description: Study selected in key DICOM object selection
- * Type: uri
- * Path: ImagingExcerpt.study.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SELECTED_STUDY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SELECTED_STUDY); - - /** - * Search parameter: author - *

- * Description: Author of key DICOM object selection
- * Type: reference
- * Path: ImagingExcerpt.author
- *

- */ - @SearchParamDefinition(name="author", path="ImagingExcerpt.author", description="Author of key DICOM object selection", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Author of key DICOM object selection
- * Type: reference
- * Path: ImagingExcerpt.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingExcerpt:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("ImagingExcerpt:author").toLocked(); - - /** - * Search parameter: title - *

- * Description: Title of key DICOM object selection
- * Type: token
- * Path: ImagingExcerpt.title
- *

- */ - @SearchParamDefinition(name="title", path="ImagingExcerpt.title", description="Title of key DICOM object selection", type="token" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Title of key DICOM object selection
- * Type: token
- * Path: ImagingExcerpt.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TITLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TITLE); - - /** - * Search parameter: patient - *

- * Description: Subject of key DICOM object selection
- * Type: reference
- * Path: ImagingExcerpt.patient
- *

- */ - @SearchParamDefinition(name="patient", path="ImagingExcerpt.patient", description="Subject of key DICOM object selection", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Subject of key DICOM object selection
- * Type: reference
- * Path: ImagingExcerpt.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingExcerpt:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingExcerpt:patient").toLocked(); - - /** - * Search parameter: authoring-time - *

- * Description: Time of key DICOM object selection authoring
- * Type: date
- * Path: ImagingExcerpt.authoringTime
- *

- */ - @SearchParamDefinition(name="authoring-time", path="ImagingExcerpt.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) - public static final String SP_AUTHORING_TIME = "authoring-time"; - /** - * Fluent Client search parameter constant for authoring-time - *

- * Description: Time of key DICOM object selection authoring
- * Type: date
- * Path: ImagingExcerpt.authoringTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORING_TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORING_TIME); - - /** - * Search parameter: identifier - *

- * Description: UID of key DICOM object selection
- * Type: uri
- * Path: ImagingExcerpt.uid
- *

- */ - @SearchParamDefinition(name="identifier", path="ImagingExcerpt.uid", description="UID of key DICOM object selection", type="uri" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: UID of key DICOM object selection
- * Type: uri
- * Path: ImagingExcerpt.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java deleted file mode 100644 index c2390befb4e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingObjectSelection.java +++ /dev/null @@ -1,1984 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances have been selected for a purpose, such as quality assurance, conference, or consult. Reflecting that range of purposes, typical ImagingObjectSelection resources may include all SOP Instances in a study (perhaps for sharing through a Health Information Exchange); key images from multiple studies (for reference by a referring or treating physician); a multi-frame ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching file); and so on. - */ -@ResourceDef(name="ImagingObjectSelection", profile="http://hl7.org/fhir/Profile/ImagingObjectSelection") -public class ImagingObjectSelection extends DomainResource { - - @Block() - public static class StudyComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Study instance UID of the SOP instances in the selection. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Study instance UID", formalDefinition="Study instance UID of the SOP instances in the selection." ) - protected OidType uid; - - /** - * WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Retrieve study URL", formalDefinition="WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection." ) - protected UriType url; - - /** - * Reference to the Imaging Study in FHIR form. - */ - @Child(name = "imagingStudy", type = {ImagingStudy.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to ImagingStudy", formalDefinition="Reference to the Imaging Study in FHIR form." ) - protected Reference imagingStudy; - - /** - * The actual object that is the target of the reference (Reference to the Imaging Study in FHIR form.) - */ - protected ImagingStudy imagingStudyTarget; - - /** - * Series identity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name = "series", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Series identity of the selected instances", formalDefinition="Series identity and locating information of the DICOM SOP instances in the selection." ) - protected List series; - - private static final long serialVersionUID = 341246743L; - - /** - * Constructor - */ - public StudyComponent() { - super(); - } - - /** - * Constructor - */ - public StudyComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Study instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public StudyComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Study instance UID of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Study instance UID of the SOP instances in the selection. - */ - public StudyComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StudyComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection. - */ - public StudyComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) - */ - public Reference getImagingStudy() { - if (this.imagingStudy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); - else if (Configuration.doAutoCreate()) - this.imagingStudy = new Reference(); // cc - return this.imagingStudy; - } - - public boolean hasImagingStudy() { - return this.imagingStudy != null && !this.imagingStudy.isEmpty(); - } - - /** - * @param value {@link #imagingStudy} (Reference to the Imaging Study in FHIR form.) - */ - public StudyComponent setImagingStudy(Reference value) { - this.imagingStudy = value; - return this; - } - - /** - * @return {@link #imagingStudy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the Imaging Study in FHIR form.) - */ - public ImagingStudy getImagingStudyTarget() { - if (this.imagingStudyTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StudyComponent.imagingStudy"); - else if (Configuration.doAutoCreate()) - this.imagingStudyTarget = new ImagingStudy(); // aa - return this.imagingStudyTarget; - } - - /** - * @param value {@link #imagingStudy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the Imaging Study in FHIR form.) - */ - public StudyComponent setImagingStudyTarget(ImagingStudy value) { - this.imagingStudyTarget = value; - return this; - } - - /** - * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (SeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Series identity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public SeriesComponent addSeries() { //3 - SeriesComponent t = new SeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - // syntactic sugar - public StudyComponent addSeries(SeriesComponent t) { //3 - if (t == null) - return this; - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Study instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the study. Note that this URL retrieves all SOP instances of the study, not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("imagingStudy", "Reference(ImagingStudy)", "Reference to the Imaging Study in FHIR form.", 0, java.lang.Integer.MAX_VALUE, imagingStudy)); - childrenList.add(new Property("series", "", "Series identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -814900911: /*imagingStudy*/ return this.imagingStudy == null ? new Base[0] : new Base[] {this.imagingStudy}; // Reference - case -905838985: /*series*/ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // SeriesComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -814900911: // imagingStudy - this.imagingStudy = castToReference(value); // Reference - break; - case -905838985: // series - this.getSeries().add((SeriesComponent) value); // SeriesComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("imagingStudy")) - this.imagingStudy = castToReference(value); // Reference - else if (name.equals("series")) - this.getSeries().add((SeriesComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -814900911: return getImagingStudy(); // Reference - case -905838985: return addSeries(); // SeriesComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); - } - else if (name.equals("imagingStudy")) { - this.imagingStudy = new Reference(); - return this.imagingStudy; - } - else if (name.equals("series")) { - return addSeries(); - } - else - return super.addChild(name); - } - - public StudyComponent copy() { - StudyComponent dst = new StudyComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.url = url == null ? null : url.copy(); - dst.imagingStudy = imagingStudy == null ? null : imagingStudy.copy(); - if (series != null) { - dst.series = new ArrayList(); - for (SeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StudyComponent)) - return false; - StudyComponent o = (StudyComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(imagingStudy, o.imagingStudy, true) - && compareDeep(series, o.series, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StudyComponent)) - return false; - StudyComponent o = (StudyComponent) other; - return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (imagingStudy == null || imagingStudy.isEmpty()) - && (series == null || series.isEmpty()); - } - - public String fhirType() { - return "ImagingObjectSelection.study"; - - } - - } - - @Block() - public static class SeriesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Series instance UID of the SOP instances in the selection. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Series instance UID", formalDefinition="Series instance UID of the SOP instances in the selection." ) - protected OidType uid; - - /** - * WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Retrieve series URL", formalDefinition="WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection." ) - protected UriType url; - - /** - * Identity and locating information of the selected DICOM SOP instances. - */ - @Child(name = "instance", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The selected instance", formalDefinition="Identity and locating information of the selected DICOM SOP instances." ) - protected List instance; - - private static final long serialVersionUID = 229247770L; - - /** - * Constructor - */ - public SeriesComponent() { - super(); - } - - /** - * Constructor - */ - public SeriesComponent(OidType uid) { - super(); - this.uid = uid; - } - - /** - * @return {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Series instance UID of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public SeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Series instance UID of the SOP instances in the selection. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Series instance UID of the SOP instances in the selection. - */ - public SeriesComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SeriesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SeriesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection. - */ - public SeriesComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (InstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (Identity and locating information of the selected DICOM SOP instances.) - */ - // syntactic sugar - public InstanceComponent addInstance() { //3 - InstanceComponent t = new InstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - // syntactic sugar - public SeriesComponent addInstance(InstanceComponent t) { //3 - if (t == null) - return this; - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Series instance UID of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the series. Note that this URL retrieves all SOP instances of the series not only those in the selection.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("instance", "", "Identity and locating information of the selected DICOM SOP instances.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // InstanceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 555127957: // instance - this.getInstance().add((InstanceComponent) value); // InstanceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("instance")) - this.getInstance().add((InstanceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 555127957: return addInstance(); // InstanceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); - } - else if (name.equals("instance")) { - return addInstance(); - } - else - return super.addChild(name); - } - - public SeriesComponent copy() { - SeriesComponent dst = new SeriesComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.url = url == null ? null : url.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (InstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SeriesComponent)) - return false; - SeriesComponent o = (SeriesComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) && compareDeep(instance, o.instance, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SeriesComponent)) - return false; - SeriesComponent o = (SeriesComponent) other; - return compareValues(uid, o.uid, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (url == null || url.isEmpty()) && (instance == null || instance.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingObjectSelection.study.series"; - - } - - } - - @Block() - public static class InstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * SOP class UID of the selected instance. - */ - @Child(name = "sopClass", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="SOP class UID of instance", formalDefinition="SOP class UID of the selected instance." ) - protected OidType sopClass; - - /** - * SOP Instance UID of the selected instance. - */ - @Child(name = "uid", type = {OidType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Selected instance UID", formalDefinition="SOP Instance UID of the selected instance." ) - protected OidType uid; - - /** - * WADO-RS URL to retrieve the DICOM SOP Instance. - */ - @Child(name = "url", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Retrieve instance URL", formalDefinition="WADO-RS URL to retrieve the DICOM SOP Instance." ) - protected UriType url; - - /** - * Identity and location information of the frames in the selected instance. - */ - @Child(name = "frame", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The frame set", formalDefinition="Identity and location information of the frames in the selected instance." ) - protected List frame; - - private static final long serialVersionUID = -1609681911L; - - /** - * Constructor - */ - public InstanceComponent() { - super(); - } - - /** - * Constructor - */ - public InstanceComponent(OidType sopClass, OidType uid, UriType url) { - super(); - this.sopClass = sopClass; - this.uid = uid; - this.url = url; - } - - /** - * @return {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public OidType getSopClassElement() { - if (this.sopClass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.sopClass"); - else if (Configuration.doAutoCreate()) - this.sopClass = new OidType(); // bb - return this.sopClass; - } - - public boolean hasSopClassElement() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - public boolean hasSopClass() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - /** - * @param value {@link #sopClass} (SOP class UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public InstanceComponent setSopClassElement(OidType value) { - this.sopClass = value; - return this; - } - - /** - * @return SOP class UID of the selected instance. - */ - public String getSopClass() { - return this.sopClass == null ? null : this.sopClass.getValue(); - } - - /** - * @param value SOP class UID of the selected instance. - */ - public InstanceComponent setSopClass(String value) { - if (this.sopClass == null) - this.sopClass = new OidType(); - this.sopClass.setValue(value); - return this; - } - - /** - * @return {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (SOP Instance UID of the selected instance.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public InstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return SOP Instance UID of the selected instance. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value SOP Instance UID of the selected instance. - */ - public InstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create InstanceComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the DICOM SOP Instance.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public InstanceComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the DICOM SOP Instance. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the DICOM SOP Instance. - */ - public InstanceComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #frame} (Identity and location information of the frames in the selected instance.) - */ - public List getFrame() { - if (this.frame == null) - this.frame = new ArrayList(); - return this.frame; - } - - public boolean hasFrame() { - if (this.frame == null) - return false; - for (FramesComponent item : this.frame) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #frame} (Identity and location information of the frames in the selected instance.) - */ - // syntactic sugar - public FramesComponent addFrame() { //3 - FramesComponent t = new FramesComponent(); - if (this.frame == null) - this.frame = new ArrayList(); - this.frame.add(t); - return t; - } - - // syntactic sugar - public InstanceComponent addFrame(FramesComponent t) { //3 - if (t == null) - return this; - if (this.frame == null) - this.frame = new ArrayList(); - this.frame.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sopClass", "oid", "SOP class UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, sopClass)); - childrenList.add(new Property("uid", "oid", "SOP Instance UID of the selected instance.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM SOP Instance.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("frame", "", "Identity and location information of the frames in the selected instance.", 0, java.lang.Integer.MAX_VALUE, frame)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // OidType - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 97692013: /*frame*/ return this.frame == null ? new Base[0] : this.frame.toArray(new Base[this.frame.size()]); // FramesComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1560041540: // sopClass - this.sopClass = castToOid(value); // OidType - break; - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 97692013: // frame - this.getFrame().add((FramesComponent) value); // FramesComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sopClass")) - this.sopClass = castToOid(value); // OidType - else if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("frame")) - this.getFrame().add((FramesComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1560041540: throw new FHIRException("Cannot make property sopClass as it is not a complex type"); // OidType - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 97692013: return addFrame(); // FramesComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sopClass")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.sopClass"); - } - else if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); - } - else if (name.equals("frame")) { - return addFrame(); - } - else - return super.addChild(name); - } - - public InstanceComponent copy() { - InstanceComponent dst = new InstanceComponent(); - copyValues(dst); - dst.sopClass = sopClass == null ? null : sopClass.copy(); - dst.uid = uid == null ? null : uid.copy(); - dst.url = url == null ? null : url.copy(); - if (frame != null) { - dst.frame = new ArrayList(); - for (FramesComponent i : frame) - dst.frame.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof InstanceComponent)) - return false; - InstanceComponent o = (InstanceComponent) other; - return compareDeep(sopClass, o.sopClass, true) && compareDeep(uid, o.uid, true) && compareDeep(url, o.url, true) - && compareDeep(frame, o.frame, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof InstanceComponent)) - return false; - InstanceComponent o = (InstanceComponent) other; - return compareValues(sopClass, o.sopClass, true) && compareValues(uid, o.uid, true) && compareValues(url, o.url, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (sopClass == null || sopClass.isEmpty()) && (uid == null || uid.isEmpty()) - && (url == null || url.isEmpty()) && (frame == null || frame.isEmpty()); - } - - public String fhirType() { - return "ImagingObjectSelection.study.series.instance"; - - } - - } - - @Block() - public static class FramesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The specific frame reference within a multi-frame object. - */ - @Child(name = "number", type = {UnsignedIntType.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Frame reference number", formalDefinition="The specific frame reference within a multi-frame object." ) - protected List number; - - /** - * WADO-RS URL to retrieve the DICOM frames. - */ - @Child(name = "url", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Retrieve frame URL", formalDefinition="WADO-RS URL to retrieve the DICOM frames." ) - protected UriType url; - - private static final long serialVersionUID = 236505178L; - - /** - * Constructor - */ - public FramesComponent() { - super(); - } - - /** - * Constructor - */ - public FramesComponent(UriType url) { - super(); - this.url = url; - } - - /** - * @return {@link #number} (The specific frame reference within a multi-frame object.) - */ - public List getNumber() { - if (this.number == null) - this.number = new ArrayList(); - return this.number; - } - - public boolean hasNumber() { - if (this.number == null) - return false; - for (UnsignedIntType item : this.number) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #number} (The specific frame reference within a multi-frame object.) - */ - // syntactic sugar - public UnsignedIntType addNumberElement() {//2 - UnsignedIntType t = new UnsignedIntType(); - if (this.number == null) - this.number = new ArrayList(); - this.number.add(t); - return t; - } - - /** - * @param value {@link #number} (The specific frame reference within a multi-frame object.) - */ - public FramesComponent addNumber(int value) { //1 - UnsignedIntType t = new UnsignedIntType(); - t.setValue(value); - if (this.number == null) - this.number = new ArrayList(); - this.number.add(t); - return this; - } - - /** - * @param value {@link #number} (The specific frame reference within a multi-frame object.) - */ - public boolean hasNumber(int value) { - if (this.number == null) - return false; - for (UnsignedIntType v : this.number) - if (v.equals(value)) // unsignedInt - return true; - return false; - } - - /** - * @return {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create FramesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS URL to retrieve the DICOM frames.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public FramesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS URL to retrieve the DICOM frames. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS URL to retrieve the DICOM frames. - */ - public FramesComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("number", "unsignedInt", "The specific frame reference within a multi-frame object.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("url", "uri", "WADO-RS URL to retrieve the DICOM frames.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1034364087: /*number*/ return this.number == null ? new Base[0] : this.number.toArray(new Base[this.number.size()]); // UnsignedIntType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1034364087: // number - this.getNumber().add(castToUnsignedInt(value)); // UnsignedIntType - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("number")) - this.getNumber().add(castToUnsignedInt(value)); - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // UnsignedIntType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("number")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.number"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.url"); - } - else - return super.addChild(name); - } - - public FramesComponent copy() { - FramesComponent dst = new FramesComponent(); - copyValues(dst); - if (number != null) { - dst.number = new ArrayList(); - for (UnsignedIntType i : number) - dst.number.add(i.copy()); - }; - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof FramesComponent)) - return false; - FramesComponent o = (FramesComponent) other; - return compareDeep(number, o.number, true) && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof FramesComponent)) - return false; - FramesComponent o = (FramesComponent) other; - return compareValues(number, o.number, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (number == null || number.isEmpty()) && (url == null || url.isEmpty()) - ; - } - - public String fhirType() { - return "ImagingObjectSelection.study.series.instance.frame"; - - } - - } - - /** - * Instance UID of the DICOM KOS SOP Instances represented in this resource. - */ - @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Instance UID", formalDefinition="Instance UID of the DICOM KOS SOP Instances represented in this resource." ) - protected OidType uid; - - /** - * A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient of the selected objects", formalDefinition="A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) - */ - protected Patient patientTarget; - - /** - * Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). - */ - @Child(name = "authoringTime", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time when the imaging object selection was created", formalDefinition="Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image)." ) - protected DateTimeType authoringTime; - - /** - * Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion. - */ - @Child(name = "author", type = {Practitioner.class, Device.class, Organization.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Author (human or machine)", formalDefinition="Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - protected Resource authorTarget; - - /** - * The reason for, or significance of, the selection of objects referenced in the resource. - */ - @Child(name = "title", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason for selection", formalDefinition="The reason for, or significance of, the selection of objects referenced in the resource." ) - protected CodeableConcept title; - - /** - * Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description text", formalDefinition="Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection." ) - protected StringType description; - - /** - * Study identity and locating information of the DICOM SOP instances in the selection. - */ - @Child(name = "study", type = {}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Study identity of the selected instances", formalDefinition="Study identity and locating information of the DICOM SOP instances in the selection." ) - protected List study; - - private static final long serialVersionUID = 1428713335L; - - /** - * Constructor - */ - public ImagingObjectSelection() { - super(); - } - - /** - * Constructor - */ - public ImagingObjectSelection(OidType uid, Reference patient, CodeableConcept title) { - super(); - this.uid = uid; - this.patient = patient; - this.title = title; - } - - /** - * @return {@link #uid} (Instance UID of the DICOM KOS SOP Instances represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Instance UID of the DICOM KOS SOP Instances represented in this resource.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingObjectSelection setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Instance UID of the DICOM KOS SOP Instances represented in this resource. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Instance UID of the DICOM KOS SOP Instances represented in this resource. - */ - public ImagingObjectSelection setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) - */ - public ImagingObjectSelection setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.) - */ - public ImagingObjectSelection setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public DateTimeType getAuthoringTimeElement() { - if (this.authoringTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.authoringTime"); - else if (Configuration.doAutoCreate()) - this.authoringTime = new DateTimeType(); // bb - return this.authoringTime; - } - - public boolean hasAuthoringTimeElement() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - public boolean hasAuthoringTime() { - return this.authoringTime != null && !this.authoringTime.isEmpty(); - } - - /** - * @param value {@link #authoringTime} (Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).). This is the underlying object with id, value and extensions. The accessor "getAuthoringTime" gives direct access to the value - */ - public ImagingObjectSelection setAuthoringTimeElement(DateTimeType value) { - this.authoringTime = value; - return this; - } - - /** - * @return Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). - */ - public Date getAuthoringTime() { - return this.authoringTime == null ? null : this.authoringTime.getValue(); - } - - /** - * @param value Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image). - */ - public ImagingObjectSelection setAuthoringTime(Date value) { - if (value == null) - this.authoringTime = null; - else { - if (this.authoringTime == null) - this.authoringTime = new DateTimeType(); - this.authoringTime.setValue(value); - } - return this; - } - - /** - * @return {@link #author} (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingObjectSelection setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.) - */ - public ImagingObjectSelection setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public CodeableConcept getTitle() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.title"); - else if (Configuration.doAutoCreate()) - this.title = new CodeableConcept(); // cc - return this.title; - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The reason for, or significance of, the selection of objects referenced in the resource.) - */ - public ImagingObjectSelection setTitle(CodeableConcept value) { - this.title = value; - return this; - } - - /** - * @return {@link #description} (Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingObjectSelection.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingObjectSelection setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection. - */ - public ImagingObjectSelection setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - public List getStudy() { - if (this.study == null) - this.study = new ArrayList(); - return this.study; - } - - public boolean hasStudy() { - if (this.study == null) - return false; - for (StudyComponent item : this.study) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #study} (Study identity and locating information of the DICOM SOP instances in the selection.) - */ - // syntactic sugar - public StudyComponent addStudy() { //3 - StudyComponent t = new StudyComponent(); - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return t; - } - - // syntactic sugar - public ImagingObjectSelection addStudy(StudyComponent t) { //3 - if (t == null) - return this; - if (this.study == null) - this.study = new ArrayList(); - this.study.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Instance UID of the DICOM KOS SOP Instances represented in this resource.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("patient", "Reference(Patient)", "A patient resource reference which is the patient subject of all DICOM SOP Instances in this ImagingObjectSelection.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("authoringTime", "dateTime", "Date and time when the selection of the referenced instances were made. It is (typically) different from the creation date of the selection resource, and from dates associated with the referenced instances (e.g. capture time of the referenced image).", 0, java.lang.Integer.MAX_VALUE, authoringTime)); - childrenList.add(new Property("author", "Reference(Practitioner|Device|Organization|Patient|RelatedPerson)", "Author of ImagingObjectSelection. It can be a human author or a device which made the decision of the SOP instances selected. For example, a radiologist selected a set of imaging SOP instances to attach in a diagnostic report, and a CAD application may author a selection to describe SOP instances it used to generate a detection conclusion.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("title", "CodeableConcept", "The reason for, or significance of, the selection of objects referenced in the resource.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("description", "string", "Text description of the DICOM SOP instances selected in the ImagingObjectSelection. This should be aligned with the content of the title element, and can provide further explanation of the SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("study", "", "Study identity and locating information of the DICOM SOP instances in the selection.", 0, java.lang.Integer.MAX_VALUE, study)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1724532252: /*authoringTime*/ return this.authoringTime == null ? new Base[0] : new Base[] {this.authoringTime}; // DateTimeType - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 109776329: /*study*/ return this.study == null ? new Base[0] : this.study.toArray(new Base[this.study.size()]); // StudyComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1724532252: // authoringTime - this.authoringTime = castToDateTime(value); // DateTimeType - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 110371416: // title - this.title = castToCodeableConcept(value); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 109776329: // study - this.getStudy().add((StudyComponent) value); // StudyComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("authoringTime")) - this.authoringTime = castToDateTime(value); // DateTimeType - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("title")) - this.title = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("study")) - this.getStudy().add((StudyComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case -791418107: return getPatient(); // Reference - case -1724532252: throw new FHIRException("Cannot make property authoringTime as it is not a complex type"); // DateTimeType - case -1406328437: return getAuthor(); // Reference - case 110371416: return getTitle(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 109776329: return addStudy(); // StudyComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.uid"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("authoringTime")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.authoringTime"); - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("title")) { - this.title = new CodeableConcept(); - return this.title; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingObjectSelection.description"); - } - else if (name.equals("study")) { - return addStudy(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ImagingObjectSelection"; - - } - - public ImagingObjectSelection copy() { - ImagingObjectSelection dst = new ImagingObjectSelection(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.authoringTime = authoringTime == null ? null : authoringTime.copy(); - dst.author = author == null ? null : author.copy(); - dst.title = title == null ? null : title.copy(); - dst.description = description == null ? null : description.copy(); - if (study != null) { - dst.study = new ArrayList(); - for (StudyComponent i : study) - dst.study.add(i.copy()); - }; - return dst; - } - - protected ImagingObjectSelection typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingObjectSelection)) - return false; - ImagingObjectSelection o = (ImagingObjectSelection) other; - return compareDeep(uid, o.uid, true) && compareDeep(patient, o.patient, true) && compareDeep(authoringTime, o.authoringTime, true) - && compareDeep(author, o.author, true) && compareDeep(title, o.title, true) && compareDeep(description, o.description, true) - && compareDeep(study, o.study, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingObjectSelection)) - return false; - ImagingObjectSelection o = (ImagingObjectSelection) other; - return compareValues(uid, o.uid, true) && compareValues(authoringTime, o.authoringTime, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (patient == null || patient.isEmpty()) - && (authoringTime == null || authoringTime.isEmpty()) && (author == null || author.isEmpty()) - && (title == null || title.isEmpty()) && (description == null || description.isEmpty()) && (study == null || study.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingObjectSelection; - } - - /** - * Search parameter: selected-study - *

- * Description: Study selected in key DICOM object selection
- * Type: uri
- * Path: ImagingObjectSelection.study.uid
- *

- */ - @SearchParamDefinition(name="selected-study", path="ImagingObjectSelection.study.uid", description="Study selected in key DICOM object selection", type="uri" ) - public static final String SP_SELECTED_STUDY = "selected-study"; - /** - * Fluent Client search parameter constant for selected-study - *

- * Description: Study selected in key DICOM object selection
- * Type: uri
- * Path: ImagingObjectSelection.study.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SELECTED_STUDY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SELECTED_STUDY); - - /** - * Search parameter: author - *

- * Description: Author of key DICOM object selection
- * Type: reference
- * Path: ImagingObjectSelection.author
- *

- */ - @SearchParamDefinition(name="author", path="ImagingObjectSelection.author", description="Author of key DICOM object selection", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Author of key DICOM object selection
- * Type: reference
- * Path: ImagingObjectSelection.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingObjectSelection:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("ImagingObjectSelection:author").toLocked(); - - /** - * Search parameter: title - *

- * Description: Title of key DICOM object selection
- * Type: token
- * Path: ImagingObjectSelection.title
- *

- */ - @SearchParamDefinition(name="title", path="ImagingObjectSelection.title", description="Title of key DICOM object selection", type="token" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Title of key DICOM object selection
- * Type: token
- * Path: ImagingObjectSelection.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TITLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TITLE); - - /** - * Search parameter: patient - *

- * Description: Subject of key DICOM object selection
- * Type: reference
- * Path: ImagingObjectSelection.patient
- *

- */ - @SearchParamDefinition(name="patient", path="ImagingObjectSelection.patient", description="Subject of key DICOM object selection", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Subject of key DICOM object selection
- * Type: reference
- * Path: ImagingObjectSelection.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingObjectSelection:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingObjectSelection:patient").toLocked(); - - /** - * Search parameter: authoring-time - *

- * Description: Time of key DICOM object selection authoring
- * Type: date
- * Path: ImagingObjectSelection.authoringTime
- *

- */ - @SearchParamDefinition(name="authoring-time", path="ImagingObjectSelection.authoringTime", description="Time of key DICOM object selection authoring", type="date" ) - public static final String SP_AUTHORING_TIME = "authoring-time"; - /** - * Fluent Client search parameter constant for authoring-time - *

- * Description: Time of key DICOM object selection authoring
- * Type: date
- * Path: ImagingObjectSelection.authoringTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORING_TIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORING_TIME); - - /** - * Search parameter: identifier - *

- * Description: UID of key DICOM object selection
- * Type: uri
- * Path: ImagingObjectSelection.uid
- *

- */ - @SearchParamDefinition(name="identifier", path="ImagingObjectSelection.uid", description="UID of key DICOM object selection", type="uri" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: UID of key DICOM object selection
- * Type: uri
- * Path: ImagingObjectSelection.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingStudy.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingStudy.java deleted file mode 100644 index 3108c58ee1a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImagingStudy.java +++ /dev/null @@ -1,2866 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of different modalities. - */ -@ResourceDef(name="ImagingStudy", profile="http://hl7.org/fhir/Profile/ImagingStudy") -public class ImagingStudy extends DomainResource { - - public enum InstanceAvailability { - /** - * null - */ - ONLINE, - /** - * null - */ - OFFLINE, - /** - * null - */ - NEARLINE, - /** - * null - */ - UNAVAILABLE, - /** - * added to help the parsers - */ - NULL; - public static InstanceAvailability fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("ONLINE".equals(codeString)) - return ONLINE; - if ("OFFLINE".equals(codeString)) - return OFFLINE; - if ("NEARLINE".equals(codeString)) - return NEARLINE; - if ("UNAVAILABLE".equals(codeString)) - return UNAVAILABLE; - throw new FHIRException("Unknown InstanceAvailability code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ONLINE: return "ONLINE"; - case OFFLINE: return "OFFLINE"; - case NEARLINE: return "NEARLINE"; - case UNAVAILABLE: return "UNAVAILABLE"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ONLINE: return "http://nema.org/dicom/dicm"; - case OFFLINE: return "http://nema.org/dicom/dicm"; - case NEARLINE: return "http://nema.org/dicom/dicm"; - case UNAVAILABLE: return "http://nema.org/dicom/dicm"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ONLINE: return ""; - case OFFLINE: return ""; - case NEARLINE: return ""; - case UNAVAILABLE: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ONLINE: return "ONLINE"; - case OFFLINE: return "OFFLINE"; - case NEARLINE: return "NEARLINE"; - case UNAVAILABLE: return "UNAVAILABLE"; - default: return "?"; - } - } - } - - public static class InstanceAvailabilityEnumFactory implements EnumFactory { - public InstanceAvailability fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ONLINE".equals(codeString)) - return InstanceAvailability.ONLINE; - if ("OFFLINE".equals(codeString)) - return InstanceAvailability.OFFLINE; - if ("NEARLINE".equals(codeString)) - return InstanceAvailability.NEARLINE; - if ("UNAVAILABLE".equals(codeString)) - return InstanceAvailability.UNAVAILABLE; - throw new IllegalArgumentException("Unknown InstanceAvailability code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("ONLINE".equals(codeString)) - return new Enumeration(this, InstanceAvailability.ONLINE); - if ("OFFLINE".equals(codeString)) - return new Enumeration(this, InstanceAvailability.OFFLINE); - if ("NEARLINE".equals(codeString)) - return new Enumeration(this, InstanceAvailability.NEARLINE); - if ("UNAVAILABLE".equals(codeString)) - return new Enumeration(this, InstanceAvailability.UNAVAILABLE); - throw new FHIRException("Unknown InstanceAvailability code '"+codeString+"'"); - } - public String toCode(InstanceAvailability code) { - if (code == InstanceAvailability.ONLINE) - return "ONLINE"; - if (code == InstanceAvailability.OFFLINE) - return "OFFLINE"; - if (code == InstanceAvailability.NEARLINE) - return "NEARLINE"; - if (code == InstanceAvailability.UNAVAILABLE) - return "UNAVAILABLE"; - return "?"; - } - public String toSystem(InstanceAvailability code) { - return code.getSystem(); - } - } - - @Block() - public static class ImagingStudySeriesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Formal identifier for this series. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Formal identifier for this series", formalDefinition="Formal identifier for this series." ) - protected OidType uid; - - /** - * The Numeric identifier of this series in the study. - */ - @Child(name = "number", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Numeric identifier of this series", formalDefinition="The Numeric identifier of this series in the study." ) - protected UnsignedIntType number; - - /** - * The modality of this series sequence. - */ - @Child(name = "modality", type = {Coding.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The modality of the instances in the series", formalDefinition="The modality of this series sequence." ) - protected Coding modality; - - /** - * A description of the series. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A short human readable summary of the series", formalDefinition="A description of the series." ) - protected StringType description; - - /** - * Number of SOP Instances in Series. - */ - @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of Series Related Instances", formalDefinition="Number of SOP Instances in Series." ) - protected UnsignedIntType numberOfInstances; - - /** - * Availability of series (online, offline or nearline). - */ - @Child(name = "availability", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE", formalDefinition="Availability of series (online, offline or nearline)." ) - protected Enumeration availability; - - /** - * URI/URL specifying the location of the referenced series using WADO-RS. - */ - @Child(name = "url", type = {UriType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Location of the referenced instance(s)", formalDefinition="URI/URL specifying the location of the referenced series using WADO-RS." ) - protected UriType url; - - /** - * Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT. - */ - @Child(name = "bodySite", type = {Coding.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Body part examined", formalDefinition="Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT." ) - protected Coding bodySite; - - /** - * Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code. - */ - @Child(name = "laterality", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Body part laterality", formalDefinition="Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code." ) - protected Coding laterality; - - /** - * The date and time the series was started. - */ - @Child(name = "started", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the series started", formalDefinition="The date and time the series was started." ) - protected DateTimeType started; - - /** - * A single SOP Instance within the series, e.g. an image, or presentation state. - */ - @Child(name = "instance", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A single SOP instance from the series", formalDefinition="A single SOP Instance within the series, e.g. an image, or presentation state." ) - protected List instance; - - private static final long serialVersionUID = 42813749L; - - /** - * Constructor - */ - public ImagingStudySeriesComponent() { - super(); - } - - /** - * Constructor - */ - public ImagingStudySeriesComponent(OidType uid, Coding modality, UnsignedIntType numberOfInstances) { - super(); - this.uid = uid; - this.modality = modality; - this.numberOfInstances = numberOfInstances; - } - - /** - * @return {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for this series.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudySeriesComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for this series. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for this series. - */ - public ImagingStudySeriesComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public UnsignedIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new UnsignedIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (The Numeric identifier of this series in the study.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public ImagingStudySeriesComponent setNumberElement(UnsignedIntType value) { - this.number = value; - return this; - } - - /** - * @return The Numeric identifier of this series in the study. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value The Numeric identifier of this series in the study. - */ - public ImagingStudySeriesComponent setNumber(int value) { - if (this.number == null) - this.number = new UnsignedIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #modality} (The modality of this series sequence.) - */ - public Coding getModality() { - if (this.modality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.modality"); - else if (Configuration.doAutoCreate()) - this.modality = new Coding(); // cc - return this.modality; - } - - public boolean hasModality() { - return this.modality != null && !this.modality.isEmpty(); - } - - /** - * @param value {@link #modality} (The modality of this series sequence.) - */ - public ImagingStudySeriesComponent setModality(Coding value) { - this.modality = value; - return this; - } - - /** - * @return {@link #description} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the series.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingStudySeriesComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the series. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the series. - */ - public ImagingStudySeriesComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public UnsignedIntType getNumberOfInstancesElement() { - if (this.numberOfInstances == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.numberOfInstances"); - else if (Configuration.doAutoCreate()) - this.numberOfInstances = new UnsignedIntType(); // bb - return this.numberOfInstances; - } - - public boolean hasNumberOfInstancesElement() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - public boolean hasNumberOfInstances() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - /** - * @param value {@link #numberOfInstances} (Number of SOP Instances in Series.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public ImagingStudySeriesComponent setNumberOfInstancesElement(UnsignedIntType value) { - this.numberOfInstances = value; - return this; - } - - /** - * @return Number of SOP Instances in Series. - */ - public int getNumberOfInstances() { - return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); - } - - /** - * @param value Number of SOP Instances in Series. - */ - public ImagingStudySeriesComponent setNumberOfInstances(int value) { - if (this.numberOfInstances == null) - this.numberOfInstances = new UnsignedIntType(); - this.numberOfInstances.setValue(value); - return this; - } - - /** - * @return {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public Enumeration getAvailabilityElement() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb - return this.availability; - } - - public boolean hasAvailabilityElement() { - return this.availability != null && !this.availability.isEmpty(); - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (Availability of series (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public ImagingStudySeriesComponent setAvailabilityElement(Enumeration value) { - this.availability = value; - return this; - } - - /** - * @return Availability of series (online, offline or nearline). - */ - public InstanceAvailability getAvailability() { - return this.availability == null ? null : this.availability.getValue(); - } - - /** - * @param value Availability of series (online, offline or nearline). - */ - public ImagingStudySeriesComponent setAvailability(InstanceAvailability value) { - if (value == null) - this.availability = null; - else { - if (this.availability == null) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); - this.availability.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (URI/URL specifying the location of the referenced series using WADO-RS.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (URI/URL specifying the location of the referenced series using WADO-RS.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudySeriesComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return URI/URL specifying the location of the referenced series using WADO-RS. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value URI/URL specifying the location of the referenced series using WADO-RS. - */ - public ImagingStudySeriesComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.) - */ - public Coding getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new Coding(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.) - */ - public ImagingStudySeriesComponent setBodySite(Coding value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #laterality} (Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.) - */ - public Coding getLaterality() { - if (this.laterality == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.laterality"); - else if (Configuration.doAutoCreate()) - this.laterality = new Coding(); // cc - return this.laterality; - } - - public boolean hasLaterality() { - return this.laterality != null && !this.laterality.isEmpty(); - } - - /** - * @param value {@link #laterality} (Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.) - */ - public ImagingStudySeriesComponent setLaterality(Coding value) { - this.laterality = value; - return this; - } - - /** - * @return {@link #started} (The date and time the series was started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public DateTimeType getStartedElement() { - if (this.started == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesComponent.started"); - else if (Configuration.doAutoCreate()) - this.started = new DateTimeType(); // bb - return this.started; - } - - public boolean hasStartedElement() { - return this.started != null && !this.started.isEmpty(); - } - - public boolean hasStarted() { - return this.started != null && !this.started.isEmpty(); - } - - /** - * @param value {@link #started} (The date and time the series was started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public ImagingStudySeriesComponent setStartedElement(DateTimeType value) { - this.started = value; - return this; - } - - /** - * @return The date and time the series was started. - */ - public Date getStarted() { - return this.started == null ? null : this.started.getValue(); - } - - /** - * @param value The date and time the series was started. - */ - public ImagingStudySeriesComponent setStarted(Date value) { - if (value == null) - this.started = null; - else { - if (this.started == null) - this.started = new DateTimeType(); - this.started.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (A single SOP Instance within the series, e.g. an image, or presentation state.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (ImagingStudySeriesInstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (A single SOP Instance within the series, e.g. an image, or presentation state.) - */ - // syntactic sugar - public ImagingStudySeriesInstanceComponent addInstance() { //3 - ImagingStudySeriesInstanceComponent t = new ImagingStudySeriesInstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - // syntactic sugar - public ImagingStudySeriesComponent addInstance(ImagingStudySeriesInstanceComponent t) { //3 - if (t == null) - return this; - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Formal identifier for this series.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("number", "unsignedInt", "The Numeric identifier of this series in the study.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("modality", "Coding", "The modality of this series sequence.", 0, java.lang.Integer.MAX_VALUE, modality)); - childrenList.add(new Property("description", "string", "A description of the series.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Series.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); - childrenList.add(new Property("availability", "code", "Availability of series (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("url", "uri", "URI/URL specifying the location of the referenced series using WADO-RS.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("bodySite", "Coding", "Body part examined. See DICOM Part 16 Annex L for the mapping from DICOM to Snomed CT.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("laterality", "Coding", "Laterality if body site is paired anatomic structure and laterality is not pre-coordinated in body site code.", 0, java.lang.Integer.MAX_VALUE, laterality)); - childrenList.add(new Property("started", "dateTime", "The date and time the series was started.", 0, java.lang.Integer.MAX_VALUE, started)); - childrenList.add(new Property("instance", "", "A single SOP Instance within the series, e.g. an image, or presentation state.", 0, java.lang.Integer.MAX_VALUE, instance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // UnsignedIntType - case -622722335: /*modality*/ return this.modality == null ? new Base[0] : new Base[] {this.modality}; // Coding - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1043544226: /*numberOfInstances*/ return this.numberOfInstances == null ? new Base[0] : new Base[] {this.numberOfInstances}; // UnsignedIntType - case 1997542747: /*availability*/ return this.availability == null ? new Base[0] : new Base[] {this.availability}; // Enumeration - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // Coding - case -170291817: /*laterality*/ return this.laterality == null ? new Base[0] : new Base[] {this.laterality}; // Coding - case -1897185151: /*started*/ return this.started == null ? new Base[0] : new Base[] {this.started}; // DateTimeType - case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // ImagingStudySeriesInstanceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case -1034364087: // number - this.number = castToUnsignedInt(value); // UnsignedIntType - break; - case -622722335: // modality - this.modality = castToCoding(value); // Coding - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1043544226: // numberOfInstances - this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType - break; - case 1997542747: // availability - this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 1702620169: // bodySite - this.bodySite = castToCoding(value); // Coding - break; - case -170291817: // laterality - this.laterality = castToCoding(value); // Coding - break; - case -1897185151: // started - this.started = castToDateTime(value); // DateTimeType - break; - case 555127957: // instance - this.getInstance().add((ImagingStudySeriesInstanceComponent) value); // ImagingStudySeriesInstanceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("number")) - this.number = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("modality")) - this.modality = castToCoding(value); // Coding - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("numberOfInstances")) - this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("availability")) - this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("bodySite")) - this.bodySite = castToCoding(value); // Coding - else if (name.equals("laterality")) - this.laterality = castToCoding(value); // Coding - else if (name.equals("started")) - this.started = castToDateTime(value); // DateTimeType - else if (name.equals("instance")) - this.getInstance().add((ImagingStudySeriesInstanceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // UnsignedIntType - case -622722335: return getModality(); // Coding - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1043544226: throw new FHIRException("Cannot make property numberOfInstances as it is not a complex type"); // UnsignedIntType - case 1997542747: throw new FHIRException("Cannot make property availability as it is not a complex type"); // Enumeration - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 1702620169: return getBodySite(); // Coding - case -170291817: return getLaterality(); // Coding - case -1897185151: throw new FHIRException("Cannot make property started as it is not a complex type"); // DateTimeType - case 555127957: return addInstance(); // ImagingStudySeriesInstanceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid"); - } - else if (name.equals("number")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.number"); - } - else if (name.equals("modality")) { - this.modality = new Coding(); - return this.modality; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.description"); - } - else if (name.equals("numberOfInstances")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfInstances"); - } - else if (name.equals("availability")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.availability"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.url"); - } - else if (name.equals("bodySite")) { - this.bodySite = new Coding(); - return this.bodySite; - } - else if (name.equals("laterality")) { - this.laterality = new Coding(); - return this.laterality; - } - else if (name.equals("started")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.started"); - } - else if (name.equals("instance")) { - return addInstance(); - } - else - return super.addChild(name); - } - - public ImagingStudySeriesComponent copy() { - ImagingStudySeriesComponent dst = new ImagingStudySeriesComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.number = number == null ? null : number.copy(); - dst.modality = modality == null ? null : modality.copy(); - dst.description = description == null ? null : description.copy(); - dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); - dst.availability = availability == null ? null : availability.copy(); - dst.url = url == null ? null : url.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.laterality = laterality == null ? null : laterality.copy(); - dst.started = started == null ? null : started.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (ImagingStudySeriesInstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingStudySeriesComponent)) - return false; - ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(number, o.number, true) && compareDeep(modality, o.modality, true) - && compareDeep(description, o.description, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) - && compareDeep(availability, o.availability, true) && compareDeep(url, o.url, true) && compareDeep(bodySite, o.bodySite, true) - && compareDeep(laterality, o.laterality, true) && compareDeep(started, o.started, true) && compareDeep(instance, o.instance, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingStudySeriesComponent)) - return false; - ImagingStudySeriesComponent o = (ImagingStudySeriesComponent) other; - return compareValues(uid, o.uid, true) && compareValues(number, o.number, true) && compareValues(description, o.description, true) - && compareValues(numberOfInstances, o.numberOfInstances, true) && compareValues(availability, o.availability, true) - && compareValues(url, o.url, true) && compareValues(started, o.started, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (number == null || number.isEmpty()) - && (modality == null || modality.isEmpty()) && (description == null || description.isEmpty()) - && (numberOfInstances == null || numberOfInstances.isEmpty()) && (availability == null || availability.isEmpty()) - && (url == null || url.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (laterality == null || laterality.isEmpty()) - && (started == null || started.isEmpty()) && (instance == null || instance.isEmpty()); - } - - public String fhirType() { - return "ImagingStudy.series"; - - } - - } - - @Block() - public static class ImagingStudySeriesInstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Formal identifier for this image or other content. - */ - @Child(name = "uid", type = {OidType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Formal identifier for this instance", formalDefinition="Formal identifier for this image or other content." ) - protected OidType uid; - - /** - * The number of instance in the series. - */ - @Child(name = "number", type = {UnsignedIntType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The number of this instance in the series", formalDefinition="The number of instance in the series." ) - protected UnsignedIntType number; - - /** - * DICOM instance type. - */ - @Child(name = "sopClass", type = {OidType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="DICOM class type", formalDefinition="DICOM instance type." ) - protected OidType sopClass; - - /** - * A human-friendly SOP Class name. - */ - @Child(name = "type", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of instance (image etc.)", formalDefinition="A human-friendly SOP Class name." ) - protected StringType type; - - /** - * The description of the instance. - */ - @Child(name = "title", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of instance", formalDefinition="The description of the instance." ) - protected StringType title; - - /** - * Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance. - */ - @Child(name = "content", type = {Attachment.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The instance payload, such as the image binary data or URL to it", formalDefinition="Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance." ) - protected List content; - - private static final long serialVersionUID = -693669901L; - - /** - * Constructor - */ - public ImagingStudySeriesInstanceComponent() { - super(); - } - - /** - * Constructor - */ - public ImagingStudySeriesInstanceComponent(OidType uid, OidType sopClass) { - super(); - this.uid = uid; - this.sopClass = sopClass; - } - - /** - * @return {@link #uid} (Formal identifier for this image or other content.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for this image or other content.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for this image or other content. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for this image or other content. - */ - public ImagingStudySeriesInstanceComponent setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #number} (The number of instance in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public UnsignedIntType getNumberElement() { - if (this.number == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.number"); - else if (Configuration.doAutoCreate()) - this.number = new UnsignedIntType(); // bb - return this.number; - } - - public boolean hasNumberElement() { - return this.number != null && !this.number.isEmpty(); - } - - public boolean hasNumber() { - return this.number != null && !this.number.isEmpty(); - } - - /** - * @param value {@link #number} (The number of instance in the series.). This is the underlying object with id, value and extensions. The accessor "getNumber" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setNumberElement(UnsignedIntType value) { - this.number = value; - return this; - } - - /** - * @return The number of instance in the series. - */ - public int getNumber() { - return this.number == null || this.number.isEmpty() ? 0 : this.number.getValue(); - } - - /** - * @param value The number of instance in the series. - */ - public ImagingStudySeriesInstanceComponent setNumber(int value) { - if (this.number == null) - this.number = new UnsignedIntType(); - this.number.setValue(value); - return this; - } - - /** - * @return {@link #sopClass} (DICOM instance type.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public OidType getSopClassElement() { - if (this.sopClass == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.sopClass"); - else if (Configuration.doAutoCreate()) - this.sopClass = new OidType(); // bb - return this.sopClass; - } - - public boolean hasSopClassElement() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - public boolean hasSopClass() { - return this.sopClass != null && !this.sopClass.isEmpty(); - } - - /** - * @param value {@link #sopClass} (DICOM instance type.). This is the underlying object with id, value and extensions. The accessor "getSopClass" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setSopClassElement(OidType value) { - this.sopClass = value; - return this; - } - - /** - * @return DICOM instance type. - */ - public String getSopClass() { - return this.sopClass == null ? null : this.sopClass.getValue(); - } - - /** - * @param value DICOM instance type. - */ - public ImagingStudySeriesInstanceComponent setSopClass(String value) { - if (this.sopClass == null) - this.sopClass = new OidType(); - this.sopClass.setValue(value); - return this; - } - - /** - * @return {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A human-friendly SOP Class name.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return A human-friendly SOP Class name. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A human-friendly SOP Class name. - */ - public ImagingStudySeriesInstanceComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudySeriesInstanceComponent.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The description of the instance.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public ImagingStudySeriesInstanceComponent setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The description of the instance. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The description of the instance. - */ - public ImagingStudySeriesInstanceComponent setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #content} (Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (Attachment item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.) - */ - // syntactic sugar - public Attachment addContent() { //3 - Attachment t = new Attachment(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public ImagingStudySeriesInstanceComponent addContent(Attachment t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Formal identifier for this image or other content.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("number", "unsignedInt", "The number of instance in the series.", 0, java.lang.Integer.MAX_VALUE, number)); - childrenList.add(new Property("sopClass", "oid", "DICOM instance type.", 0, java.lang.Integer.MAX_VALUE, sopClass)); - childrenList.add(new Property("type", "string", "A human-friendly SOP Class name.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("title", "string", "The description of the instance.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("content", "Attachment", "Content of the instance or a rendering thereof (e.g. a JPEG of an image, or an XML of a structured report). May be represented for example by inline encoding; by a URL reference to a WADO-RS service that makes the instance available; or to a FHIR Resource (e.g. Media, Document, etc.). Multiple content attachments may be used for alternate representations of the instance.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // UnsignedIntType - case 1560041540: /*sopClass*/ return this.sopClass == null ? new Base[0] : new Base[] {this.sopClass}; // OidType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // Attachment - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case -1034364087: // number - this.number = castToUnsignedInt(value); // UnsignedIntType - break; - case 1560041540: // sopClass - this.sopClass = castToOid(value); // OidType - break; - case 3575610: // type - this.type = castToString(value); // StringType - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 951530617: // content - this.getContent().add(castToAttachment(value)); // Attachment - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("number")) - this.number = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("sopClass")) - this.sopClass = castToOid(value); // OidType - else if (name.equals("type")) - this.type = castToString(value); // StringType - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("content")) - this.getContent().add(castToAttachment(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case -1034364087: throw new FHIRException("Cannot make property number as it is not a complex type"); // UnsignedIntType - case 1560041540: throw new FHIRException("Cannot make property sopClass as it is not a complex type"); // OidType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 951530617: return addContent(); // Attachment - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid"); - } - else if (name.equals("number")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.number"); - } - else if (name.equals("sopClass")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.sopClass"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.type"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.title"); - } - else if (name.equals("content")) { - return addContent(); - } - else - return super.addChild(name); - } - - public ImagingStudySeriesInstanceComponent copy() { - ImagingStudySeriesInstanceComponent dst = new ImagingStudySeriesInstanceComponent(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.number = number == null ? null : number.copy(); - dst.sopClass = sopClass == null ? null : sopClass.copy(); - dst.type = type == null ? null : type.copy(); - dst.title = title == null ? null : title.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (Attachment i : content) - dst.content.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingStudySeriesInstanceComponent)) - return false; - ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; - return compareDeep(uid, o.uid, true) && compareDeep(number, o.number, true) && compareDeep(sopClass, o.sopClass, true) - && compareDeep(type, o.type, true) && compareDeep(title, o.title, true) && compareDeep(content, o.content, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingStudySeriesInstanceComponent)) - return false; - ImagingStudySeriesInstanceComponent o = (ImagingStudySeriesInstanceComponent) other; - return compareValues(uid, o.uid, true) && compareValues(number, o.number, true) && compareValues(sopClass, o.sopClass, true) - && compareValues(type, o.type, true) && compareValues(title, o.title, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (number == null || number.isEmpty()) - && (sopClass == null || sopClass.isEmpty()) && (type == null || type.isEmpty()) && (title == null || title.isEmpty()) - && (content == null || content.isEmpty()); - } - - public String fhirType() { - return "ImagingStudy.series.instance"; - - } - - } - - /** - * Formal identifier for the study. - */ - @Child(name = "uid", type = {OidType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Formal identifier for the study", formalDefinition="Formal identifier for the study." ) - protected OidType uid; - - /** - * Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf). - */ - @Child(name = "accession", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Related workflow identifier (\"Accession Number\")", formalDefinition="Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf)." ) - protected Identifier accession; - - /** - * Other identifiers for the study. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other identifiers for the study", formalDefinition="Other identifiers for the study." ) - protected List identifier; - - /** - * Availability of study (online, offline or nearline). - */ - @Child(name = "availability", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="ONLINE | OFFLINE | NEARLINE | UNAVAILABLE (0008,0056)", formalDefinition="Availability of study (online, offline or nearline)." ) - protected Enumeration availability; - - /** - * 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). - */ - @Child(name = "modalityList", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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)." ) - protected List modalityList; - - /** - * The patient imaged in the study. - */ - @Child(name = "patient", type = {Patient.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who the images are of", formalDefinition="The patient imaged in the study." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient imaged in the study.) - */ - protected Patient patientTarget; - - /** - * Date and Time the study started. - */ - @Child(name = "started", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the study was started", formalDefinition="Date and Time the study started." ) - protected DateTimeType started; - - /** - * A list of the diagnostic orders that resulted in this imaging study being performed. - */ - @Child(name = "order", type = {DiagnosticOrder.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List order; - /** - * The actual objects that are the target of the reference (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - protected List orderTarget; - - - /** - * The requesting/referring physician. - */ - @Child(name = "referrer", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Referring physician (0008,0090)", formalDefinition="The requesting/referring physician." ) - protected Reference referrer; - - /** - * The actual object that is the target of the reference (The requesting/referring physician.) - */ - protected Practitioner referrerTarget; - - /** - * Who read the study and interpreted the images or other content. - */ - @Child(name = "interpreter", type = {Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who interpreted images", formalDefinition="Who read the study and interpreted the images or other content." ) - protected Reference interpreter; - - /** - * The actual object that is the target of the reference (Who read the study and interpreted the images or other content.) - */ - protected Practitioner interpreterTarget; - - /** - * WADO-RS resource where Study is available. - */ - @Child(name = "url", type = {UriType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Retrieve URI", formalDefinition="WADO-RS resource where Study is available." ) - protected UriType url; - - /** - * Number of Series in Study. - */ - @Child(name = "numberOfSeries", type = {UnsignedIntType.class}, order=11, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of Study Related Series", formalDefinition="Number of Series in Study." ) - protected UnsignedIntType numberOfSeries; - - /** - * Number of SOP Instances in Study. - */ - @Child(name = "numberOfInstances", type = {UnsignedIntType.class}, order=12, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of Study Related Instances", formalDefinition="Number of SOP Instances in Study." ) - protected UnsignedIntType numberOfInstances; - - /** - * Type of procedure performed. - */ - @Child(name = "procedure", type = {Procedure.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Type of procedure performed", formalDefinition="Type of procedure performed." ) - protected List procedure; - /** - * The actual objects that are the target of the reference (Type of procedure performed.) - */ - protected List procedureTarget; - - - /** - * Institution-generated description or classification of the Study performed. - */ - @Child(name = "description", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Institution-generated description", formalDefinition="Institution-generated description or classification of the Study performed." ) - protected StringType description; - - /** - * Each study has one or more series of images or other content. - */ - @Child(name = "series", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Each study has one or more series of instances", formalDefinition="Each study has one or more series of images or other content." ) - protected List series; - - private static final long serialVersionUID = 1998463596L; - - /** - * Constructor - */ - public ImagingStudy() { - super(); - } - - /** - * Constructor - */ - public ImagingStudy(OidType uid, Reference patient, UnsignedIntType numberOfSeries, UnsignedIntType numberOfInstances) { - super(); - this.uid = uid; - this.patient = patient; - this.numberOfSeries = numberOfSeries; - this.numberOfInstances = numberOfInstances; - } - - /** - * @return {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public OidType getUidElement() { - if (this.uid == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.uid"); - else if (Configuration.doAutoCreate()) - this.uid = new OidType(); // bb - return this.uid; - } - - public boolean hasUidElement() { - return this.uid != null && !this.uid.isEmpty(); - } - - public boolean hasUid() { - return this.uid != null && !this.uid.isEmpty(); - } - - /** - * @param value {@link #uid} (Formal identifier for the study.). This is the underlying object with id, value and extensions. The accessor "getUid" gives direct access to the value - */ - public ImagingStudy setUidElement(OidType value) { - this.uid = value; - return this; - } - - /** - * @return Formal identifier for the study. - */ - public String getUid() { - return this.uid == null ? null : this.uid.getValue(); - } - - /** - * @param value Formal identifier for the study. - */ - public ImagingStudy setUid(String value) { - if (this.uid == null) - this.uid = new OidType(); - this.uid.setValue(value); - return this; - } - - /** - * @return {@link #accession} (Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).) - */ - public Identifier getAccession() { - if (this.accession == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.accession"); - else if (Configuration.doAutoCreate()) - this.accession = new Identifier(); // cc - return this.accession; - } - - public boolean hasAccession() { - return this.accession != null && !this.accession.isEmpty(); - } - - /** - * @param value {@link #accession} (Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).) - */ - public ImagingStudy setAccession(Identifier value) { - this.accession = value; - return this; - } - - /** - * @return {@link #identifier} (Other identifiers for the study.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Other identifiers for the study.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public Enumeration getAvailabilityElement() { - if (this.availability == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.availability"); - else if (Configuration.doAutoCreate()) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); // bb - return this.availability; - } - - public boolean hasAvailabilityElement() { - return this.availability != null && !this.availability.isEmpty(); - } - - public boolean hasAvailability() { - return this.availability != null && !this.availability.isEmpty(); - } - - /** - * @param value {@link #availability} (Availability of study (online, offline or nearline).). This is the underlying object with id, value and extensions. The accessor "getAvailability" gives direct access to the value - */ - public ImagingStudy setAvailabilityElement(Enumeration value) { - this.availability = value; - return this; - } - - /** - * @return Availability of study (online, offline or nearline). - */ - public InstanceAvailability getAvailability() { - return this.availability == null ? null : this.availability.getValue(); - } - - /** - * @param value Availability of study (online, offline or nearline). - */ - public ImagingStudy setAvailability(InstanceAvailability value) { - if (value == null) - this.availability = null; - else { - if (this.availability == null) - this.availability = new Enumeration(new InstanceAvailabilityEnumFactory()); - this.availability.setValue(value); - } - return this; - } - - /** - * @return {@link #modalityList} (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 List getModalityList() { - if (this.modalityList == null) - this.modalityList = new ArrayList(); - return this.modalityList; - } - - public boolean hasModalityList() { - if (this.modalityList == null) - return false; - for (Coding item : this.modalityList) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #modalityList} (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).) - */ - // syntactic sugar - public Coding addModalityList() { //3 - Coding t = new Coding(); - if (this.modalityList == null) - this.modalityList = new ArrayList(); - this.modalityList.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addModalityList(Coding t) { //3 - if (t == null) - return this; - if (this.modalityList == null) - this.modalityList = new ArrayList(); - this.modalityList.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient imaged in the study.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient imaged in the study.) - */ - public ImagingStudy setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient imaged in the study.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient imaged in the study.) - */ - public ImagingStudy setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public DateTimeType getStartedElement() { - if (this.started == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.started"); - else if (Configuration.doAutoCreate()) - this.started = new DateTimeType(); // bb - return this.started; - } - - public boolean hasStartedElement() { - return this.started != null && !this.started.isEmpty(); - } - - public boolean hasStarted() { - return this.started != null && !this.started.isEmpty(); - } - - /** - * @param value {@link #started} (Date and Time the study started.). This is the underlying object with id, value and extensions. The accessor "getStarted" gives direct access to the value - */ - public ImagingStudy setStartedElement(DateTimeType value) { - this.started = value; - return this; - } - - /** - * @return Date and Time the study started. - */ - public Date getStarted() { - return this.started == null ? null : this.started.getValue(); - } - - /** - * @param value Date and Time the study started. - */ - public ImagingStudy setStarted(Date value) { - if (value == null) - this.started = null; - else { - if (this.started == null) - this.started = new DateTimeType(); - this.started.setValue(value); - } - return this; - } - - /** - * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public List getOrder() { - if (this.order == null) - this.order = new ArrayList(); - return this.order; - } - - public boolean hasOrder() { - if (this.order == null) - return false; - for (Reference item : this.order) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #order} (A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - // syntactic sugar - public Reference addOrder() { //3 - Reference t = new Reference(); - if (this.order == null) - this.order = new ArrayList(); - this.order.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addOrder(Reference t) { //3 - if (t == null) - return this; - if (this.order == null) - this.order = new ArrayList(); - this.order.add(t); - return this; - } - - /** - * @return {@link #order} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public List getOrderTarget() { - if (this.orderTarget == null) - this.orderTarget = new ArrayList(); - return this.orderTarget; - } - - // syntactic sugar - /** - * @return {@link #order} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A list of the diagnostic orders that resulted in this imaging study being performed.) - */ - public DiagnosticOrder addOrderTarget() { - DiagnosticOrder r = new DiagnosticOrder(); - if (this.orderTarget == null) - this.orderTarget = new ArrayList(); - this.orderTarget.add(r); - return r; - } - - /** - * @return {@link #referrer} (The requesting/referring physician.) - */ - public Reference getReferrer() { - if (this.referrer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.referrer"); - else if (Configuration.doAutoCreate()) - this.referrer = new Reference(); // cc - return this.referrer; - } - - public boolean hasReferrer() { - return this.referrer != null && !this.referrer.isEmpty(); - } - - /** - * @param value {@link #referrer} (The requesting/referring physician.) - */ - public ImagingStudy setReferrer(Reference value) { - this.referrer = value; - return this; - } - - /** - * @return {@link #referrer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The requesting/referring physician.) - */ - public Practitioner getReferrerTarget() { - if (this.referrerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.referrer"); - else if (Configuration.doAutoCreate()) - this.referrerTarget = new Practitioner(); // aa - return this.referrerTarget; - } - - /** - * @param value {@link #referrer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The requesting/referring physician.) - */ - public ImagingStudy setReferrerTarget(Practitioner value) { - this.referrerTarget = value; - return this; - } - - /** - * @return {@link #interpreter} (Who read the study and interpreted the images or other content.) - */ - public Reference getInterpreter() { - if (this.interpreter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.interpreter"); - else if (Configuration.doAutoCreate()) - this.interpreter = new Reference(); // cc - return this.interpreter; - } - - public boolean hasInterpreter() { - return this.interpreter != null && !this.interpreter.isEmpty(); - } - - /** - * @param value {@link #interpreter} (Who read the study and interpreted the images or other content.) - */ - public ImagingStudy setInterpreter(Reference value) { - this.interpreter = value; - return this; - } - - /** - * @return {@link #interpreter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who read the study and interpreted the images or other content.) - */ - public Practitioner getInterpreterTarget() { - if (this.interpreterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.interpreter"); - else if (Configuration.doAutoCreate()) - this.interpreterTarget = new Practitioner(); // aa - return this.interpreterTarget; - } - - /** - * @param value {@link #interpreter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who read the study and interpreted the images or other content.) - */ - public ImagingStudy setInterpreterTarget(Practitioner value) { - this.interpreterTarget = value; - return this; - } - - /** - * @return {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (WADO-RS resource where Study is available.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImagingStudy setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return WADO-RS resource where Study is available. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value WADO-RS resource where Study is available. - */ - public ImagingStudy setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value - */ - public UnsignedIntType getNumberOfSeriesElement() { - if (this.numberOfSeries == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.numberOfSeries"); - else if (Configuration.doAutoCreate()) - this.numberOfSeries = new UnsignedIntType(); // bb - return this.numberOfSeries; - } - - public boolean hasNumberOfSeriesElement() { - return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); - } - - public boolean hasNumberOfSeries() { - return this.numberOfSeries != null && !this.numberOfSeries.isEmpty(); - } - - /** - * @param value {@link #numberOfSeries} (Number of Series in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfSeries" gives direct access to the value - */ - public ImagingStudy setNumberOfSeriesElement(UnsignedIntType value) { - this.numberOfSeries = value; - return this; - } - - /** - * @return Number of Series in Study. - */ - public int getNumberOfSeries() { - return this.numberOfSeries == null || this.numberOfSeries.isEmpty() ? 0 : this.numberOfSeries.getValue(); - } - - /** - * @param value Number of Series in Study. - */ - public ImagingStudy setNumberOfSeries(int value) { - if (this.numberOfSeries == null) - this.numberOfSeries = new UnsignedIntType(); - this.numberOfSeries.setValue(value); - return this; - } - - /** - * @return {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public UnsignedIntType getNumberOfInstancesElement() { - if (this.numberOfInstances == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.numberOfInstances"); - else if (Configuration.doAutoCreate()) - this.numberOfInstances = new UnsignedIntType(); // bb - return this.numberOfInstances; - } - - public boolean hasNumberOfInstancesElement() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - public boolean hasNumberOfInstances() { - return this.numberOfInstances != null && !this.numberOfInstances.isEmpty(); - } - - /** - * @param value {@link #numberOfInstances} (Number of SOP Instances in Study.). This is the underlying object with id, value and extensions. The accessor "getNumberOfInstances" gives direct access to the value - */ - public ImagingStudy setNumberOfInstancesElement(UnsignedIntType value) { - this.numberOfInstances = value; - return this; - } - - /** - * @return Number of SOP Instances in Study. - */ - public int getNumberOfInstances() { - return this.numberOfInstances == null || this.numberOfInstances.isEmpty() ? 0 : this.numberOfInstances.getValue(); - } - - /** - * @param value Number of SOP Instances in Study. - */ - public ImagingStudy setNumberOfInstances(int value) { - if (this.numberOfInstances == null) - this.numberOfInstances = new UnsignedIntType(); - this.numberOfInstances.setValue(value); - return this; - } - - /** - * @return {@link #procedure} (Type of procedure performed.) - */ - public List getProcedure() { - if (this.procedure == null) - this.procedure = new ArrayList(); - return this.procedure; - } - - public boolean hasProcedure() { - if (this.procedure == null) - return false; - for (Reference item : this.procedure) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #procedure} (Type of procedure performed.) - */ - // syntactic sugar - public Reference addProcedure() { //3 - Reference t = new Reference(); - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addProcedure(Reference t) { //3 - if (t == null) - return this; - if (this.procedure == null) - this.procedure = new ArrayList(); - this.procedure.add(t); - return this; - } - - /** - * @return {@link #procedure} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Type of procedure performed.) - */ - public List getProcedureTarget() { - if (this.procedureTarget == null) - this.procedureTarget = new ArrayList(); - return this.procedureTarget; - } - - // syntactic sugar - /** - * @return {@link #procedure} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Type of procedure performed.) - */ - public Procedure addProcedureTarget() { - Procedure r = new Procedure(); - if (this.procedureTarget == null) - this.procedureTarget = new ArrayList(); - this.procedureTarget.add(r); - return r; - } - - /** - * @return {@link #description} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImagingStudy.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Institution-generated description or classification of the Study performed.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImagingStudy setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Institution-generated description or classification of the Study performed. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Institution-generated description or classification of the Study performed. - */ - public ImagingStudy setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #series} (Each study has one or more series of images or other content.) - */ - public List getSeries() { - if (this.series == null) - this.series = new ArrayList(); - return this.series; - } - - public boolean hasSeries() { - if (this.series == null) - return false; - for (ImagingStudySeriesComponent item : this.series) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #series} (Each study has one or more series of images or other content.) - */ - // syntactic sugar - public ImagingStudySeriesComponent addSeries() { //3 - ImagingStudySeriesComponent t = new ImagingStudySeriesComponent(); - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return t; - } - - // syntactic sugar - public ImagingStudy addSeries(ImagingStudySeriesComponent t) { //3 - if (t == null) - return this; - if (this.series == null) - this.series = new ArrayList(); - this.series.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("uid", "oid", "Formal identifier for the study.", 0, java.lang.Integer.MAX_VALUE, uid)); - childrenList.add(new Property("accession", "Identifier", "Accession Number is an identifier related to some aspect of imaging workflow and data management. Usage may vary across different institutions. See for instance [IHE Radiology Technical Framework Volume 1 Appendix A](http://www.ihe.net/uploadedFiles/Documents/Radiology/IHE_RAD_TF_Rev13.0_Vol1_FT_2014-07-30.pdf).", 0, java.lang.Integer.MAX_VALUE, accession)); - childrenList.add(new Property("identifier", "Identifier", "Other identifiers for the study.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("availability", "code", "Availability of study (online, offline or nearline).", 0, java.lang.Integer.MAX_VALUE, availability)); - childrenList.add(new Property("modalityList", "Coding", "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).", 0, java.lang.Integer.MAX_VALUE, modalityList)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient imaged in the study.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("started", "dateTime", "Date and Time the study started.", 0, java.lang.Integer.MAX_VALUE, started)); - childrenList.add(new Property("order", "Reference(DiagnosticOrder)", "A list of the diagnostic orders that resulted in this imaging study being performed.", 0, java.lang.Integer.MAX_VALUE, order)); - childrenList.add(new Property("referrer", "Reference(Practitioner)", "The requesting/referring physician.", 0, java.lang.Integer.MAX_VALUE, referrer)); - childrenList.add(new Property("interpreter", "Reference(Practitioner)", "Who read the study and interpreted the images or other content.", 0, java.lang.Integer.MAX_VALUE, interpreter)); - childrenList.add(new Property("url", "uri", "WADO-RS resource where Study is available.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("numberOfSeries", "unsignedInt", "Number of Series in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfSeries)); - childrenList.add(new Property("numberOfInstances", "unsignedInt", "Number of SOP Instances in Study.", 0, java.lang.Integer.MAX_VALUE, numberOfInstances)); - childrenList.add(new Property("procedure", "Reference(Procedure)", "Type of procedure performed.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("description", "string", "Institution-generated description or classification of the Study performed.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("series", "", "Each study has one or more series of images or other content.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 115792: /*uid*/ return this.uid == null ? new Base[0] : new Base[] {this.uid}; // OidType - case -2115028956: /*accession*/ return this.accession == null ? new Base[0] : new Base[] {this.accession}; // Identifier - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1997542747: /*availability*/ return this.availability == null ? new Base[0] : new Base[] {this.availability}; // Enumeration - case -1030238433: /*modalityList*/ return this.modalityList == null ? new Base[0] : this.modalityList.toArray(new Base[this.modalityList.size()]); // Coding - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1897185151: /*started*/ return this.started == null ? new Base[0] : new Base[] {this.started}; // DateTimeType - case 106006350: /*order*/ return this.order == null ? new Base[0] : this.order.toArray(new Base[this.order.size()]); // Reference - case -722568161: /*referrer*/ return this.referrer == null ? new Base[0] : new Base[] {this.referrer}; // Reference - case -2008009094: /*interpreter*/ return this.interpreter == null ? new Base[0] : new Base[] {this.interpreter}; // Reference - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 1920000407: /*numberOfSeries*/ return this.numberOfSeries == null ? new Base[0] : new Base[] {this.numberOfSeries}; // UnsignedIntType - case -1043544226: /*numberOfInstances*/ return this.numberOfInstances == null ? new Base[0] : new Base[] {this.numberOfInstances}; // UnsignedIntType - case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : this.procedure.toArray(new Base[this.procedure.size()]); // Reference - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -905838985: /*series*/ return this.series == null ? new Base[0] : this.series.toArray(new Base[this.series.size()]); // ImagingStudySeriesComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 115792: // uid - this.uid = castToOid(value); // OidType - break; - case -2115028956: // accession - this.accession = castToIdentifier(value); // Identifier - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1997542747: // availability - this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration - break; - case -1030238433: // modalityList - this.getModalityList().add(castToCoding(value)); // Coding - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1897185151: // started - this.started = castToDateTime(value); // DateTimeType - break; - case 106006350: // order - this.getOrder().add(castToReference(value)); // Reference - break; - case -722568161: // referrer - this.referrer = castToReference(value); // Reference - break; - case -2008009094: // interpreter - this.interpreter = castToReference(value); // Reference - break; - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 1920000407: // numberOfSeries - this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType - break; - case -1043544226: // numberOfInstances - this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType - break; - case -1095204141: // procedure - this.getProcedure().add(castToReference(value)); // Reference - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -905838985: // series - this.getSeries().add((ImagingStudySeriesComponent) value); // ImagingStudySeriesComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("uid")) - this.uid = castToOid(value); // OidType - else if (name.equals("accession")) - this.accession = castToIdentifier(value); // Identifier - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("availability")) - this.availability = new InstanceAvailabilityEnumFactory().fromType(value); // Enumeration - else if (name.equals("modalityList")) - this.getModalityList().add(castToCoding(value)); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("started")) - this.started = castToDateTime(value); // DateTimeType - else if (name.equals("order")) - this.getOrder().add(castToReference(value)); - else if (name.equals("referrer")) - this.referrer = castToReference(value); // Reference - else if (name.equals("interpreter")) - this.interpreter = castToReference(value); // Reference - else if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("numberOfSeries")) - this.numberOfSeries = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("numberOfInstances")) - this.numberOfInstances = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("procedure")) - this.getProcedure().add(castToReference(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("series")) - this.getSeries().add((ImagingStudySeriesComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 115792: throw new FHIRException("Cannot make property uid as it is not a complex type"); // OidType - case -2115028956: return getAccession(); // Identifier - case -1618432855: return addIdentifier(); // Identifier - case 1997542747: throw new FHIRException("Cannot make property availability as it is not a complex type"); // Enumeration - case -1030238433: return addModalityList(); // Coding - case -791418107: return getPatient(); // Reference - case -1897185151: throw new FHIRException("Cannot make property started as it is not a complex type"); // DateTimeType - case 106006350: return addOrder(); // Reference - case -722568161: return getReferrer(); // Reference - case -2008009094: return getInterpreter(); // Reference - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 1920000407: throw new FHIRException("Cannot make property numberOfSeries as it is not a complex type"); // UnsignedIntType - case -1043544226: throw new FHIRException("Cannot make property numberOfInstances as it is not a complex type"); // UnsignedIntType - case -1095204141: return addProcedure(); // Reference - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -905838985: return addSeries(); // ImagingStudySeriesComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("uid")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.uid"); - } - else if (name.equals("accession")) { - this.accession = new Identifier(); - return this.accession; - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("availability")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.availability"); - } - else if (name.equals("modalityList")) { - return addModalityList(); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("started")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.started"); - } - else if (name.equals("order")) { - return addOrder(); - } - else if (name.equals("referrer")) { - this.referrer = new Reference(); - return this.referrer; - } - else if (name.equals("interpreter")) { - this.interpreter = new Reference(); - return this.interpreter; - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.url"); - } - else if (name.equals("numberOfSeries")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfSeries"); - } - else if (name.equals("numberOfInstances")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.numberOfInstances"); - } - else if (name.equals("procedure")) { - return addProcedure(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImagingStudy.description"); - } - else if (name.equals("series")) { - return addSeries(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ImagingStudy"; - - } - - public ImagingStudy copy() { - ImagingStudy dst = new ImagingStudy(); - copyValues(dst); - dst.uid = uid == null ? null : uid.copy(); - dst.accession = accession == null ? null : accession.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.availability = availability == null ? null : availability.copy(); - if (modalityList != null) { - dst.modalityList = new ArrayList(); - for (Coding i : modalityList) - dst.modalityList.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.started = started == null ? null : started.copy(); - if (order != null) { - dst.order = new ArrayList(); - for (Reference i : order) - dst.order.add(i.copy()); - }; - dst.referrer = referrer == null ? null : referrer.copy(); - dst.interpreter = interpreter == null ? null : interpreter.copy(); - dst.url = url == null ? null : url.copy(); - dst.numberOfSeries = numberOfSeries == null ? null : numberOfSeries.copy(); - dst.numberOfInstances = numberOfInstances == null ? null : numberOfInstances.copy(); - if (procedure != null) { - dst.procedure = new ArrayList(); - for (Reference i : procedure) - dst.procedure.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (series != null) { - dst.series = new ArrayList(); - for (ImagingStudySeriesComponent i : series) - dst.series.add(i.copy()); - }; - return dst; - } - - protected ImagingStudy typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImagingStudy)) - return false; - ImagingStudy o = (ImagingStudy) other; - return compareDeep(uid, o.uid, true) && compareDeep(accession, o.accession, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(availability, o.availability, true) && compareDeep(modalityList, o.modalityList, true) - && compareDeep(patient, o.patient, true) && compareDeep(started, o.started, true) && compareDeep(order, o.order, true) - && compareDeep(referrer, o.referrer, true) && compareDeep(interpreter, o.interpreter, true) && compareDeep(url, o.url, true) - && compareDeep(numberOfSeries, o.numberOfSeries, true) && compareDeep(numberOfInstances, o.numberOfInstances, true) - && compareDeep(procedure, o.procedure, true) && compareDeep(description, o.description, true) && compareDeep(series, o.series, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImagingStudy)) - return false; - ImagingStudy o = (ImagingStudy) other; - return compareValues(uid, o.uid, true) && compareValues(availability, o.availability, true) && compareValues(started, o.started, true) - && compareValues(url, o.url, true) && compareValues(numberOfSeries, o.numberOfSeries, true) && compareValues(numberOfInstances, o.numberOfInstances, true) - && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (uid == null || uid.isEmpty()) && (accession == null || accession.isEmpty()) - && (identifier == null || identifier.isEmpty()) && (availability == null || availability.isEmpty()) - && (modalityList == null || modalityList.isEmpty()) && (patient == null || patient.isEmpty()) - && (started == null || started.isEmpty()) && (order == null || order.isEmpty()) && (referrer == null || referrer.isEmpty()) - && (interpreter == null || interpreter.isEmpty()) && (url == null || url.isEmpty()) && (numberOfSeries == null || numberOfSeries.isEmpty()) - && (numberOfInstances == null || numberOfInstances.isEmpty()) && (procedure == null || procedure.isEmpty()) - && (description == null || description.isEmpty()) && (series == null || series.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImagingStudy; - } - - /** - * Search parameter: uid - *

- * Description: The instance unique identifier
- * Type: uri
- * Path: ImagingStudy.series.instance.uid
- *

- */ - @SearchParamDefinition(name="uid", path="ImagingStudy.series.instance.uid", description="The instance unique identifier", type="uri" ) - public static final String SP_UID = "uid"; - /** - * Fluent Client search parameter constant for uid - *

- * Description: The instance unique identifier
- * Type: uri
- * Path: ImagingStudy.series.instance.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam UID = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_UID); - - /** - * Search parameter: series - *

- * Description: The identifier of the series of images
- * Type: uri
- * Path: ImagingStudy.series.uid
- *

- */ - @SearchParamDefinition(name="series", path="ImagingStudy.series.uid", description="The identifier of the series of images", type="uri" ) - public static final String SP_SERIES = "series"; - /** - * Fluent Client search parameter constant for series - *

- * Description: The identifier of the series of images
- * Type: uri
- * Path: ImagingStudy.series.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SERIES = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SERIES); - - /** - * Search parameter: patient - *

- * Description: Who the study is about
- * Type: reference
- * Path: ImagingStudy.patient
- *

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

- * Description: Who the study is about
- * Type: reference
- * Path: ImagingStudy.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingStudy:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImagingStudy:patient").toLocked(); - - /** - * Search parameter: order - *

- * Description: The order for the image
- * Type: reference
- * Path: ImagingStudy.order
- *

- */ - @SearchParamDefinition(name="order", path="ImagingStudy.order", description="The order for the image", type="reference" ) - public static final String SP_ORDER = "order"; - /** - * Fluent Client search parameter constant for order - *

- * Description: The order for the image
- * Type: reference
- * Path: ImagingStudy.order
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORDER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImagingStudy:order". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORDER = new ca.uhn.fhir.model.api.Include("ImagingStudy:order").toLocked(); - - /** - * Search parameter: bodysite - *

- * Description: The body site studied
- * Type: token
- * Path: ImagingStudy.series.bodySite
- *

- */ - @SearchParamDefinition(name="bodysite", path="ImagingStudy.series.bodySite", description="The body site studied", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - /** - * Fluent Client search parameter constant for bodysite - *

- * Description: The body site studied
- * Type: token
- * Path: ImagingStudy.series.bodySite
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODYSITE); - - /** - * Search parameter: accession - *

- * Description: The accession identifier for the study
- * Type: token
- * Path: ImagingStudy.accession
- *

- */ - @SearchParamDefinition(name="accession", path="ImagingStudy.accession", description="The accession identifier for the study", type="token" ) - public static final String SP_ACCESSION = "accession"; - /** - * Fluent Client search parameter constant for accession - *

- * Description: The accession identifier for the study
- * Type: token
- * Path: ImagingStudy.accession
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACCESSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACCESSION); - - /** - * Search parameter: study - *

- * Description: The study identifier for the image
- * Type: uri
- * Path: ImagingStudy.uid
- *

- */ - @SearchParamDefinition(name="study", path="ImagingStudy.uid", description="The study identifier for the image", type="uri" ) - public static final String SP_STUDY = "study"; - /** - * Fluent Client search parameter constant for study - *

- * Description: The study identifier for the image
- * Type: uri
- * Path: ImagingStudy.uid
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam STUDY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_STUDY); - - /** - * Search parameter: modality - *

- * Description: The modality of the series
- * Type: token
- * Path: ImagingStudy.series.modality
- *

- */ - @SearchParamDefinition(name="modality", path="ImagingStudy.series.modality", description="The modality of the series", type="token" ) - public static final String SP_MODALITY = "modality"; - /** - * Fluent Client search parameter constant for modality - *

- * Description: The modality of the series
- * Type: token
- * Path: ImagingStudy.series.modality
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam MODALITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_MODALITY); - - /** - * Search parameter: started - *

- * Description: When the study was started
- * Type: date
- * Path: ImagingStudy.started
- *

- */ - @SearchParamDefinition(name="started", path="ImagingStudy.started", description="When the study was started", type="date" ) - public static final String SP_STARTED = "started"; - /** - * Fluent Client search parameter constant for started - *

- * Description: When the study was started
- * Type: date
- * Path: ImagingStudy.started
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam STARTED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_STARTED); - - /** - * Search parameter: identifier - *

- * Description: Other identifiers for the Study
- * Type: token
- * Path: ImagingStudy.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ImagingStudy.identifier", description="Other identifiers for the Study", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Other identifiers for the Study
- * Type: token
- * Path: ImagingStudy.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: dicom-class - *

- * Description: The type of the instance
- * Type: uri
- * Path: ImagingStudy.series.instance.sopClass
- *

- */ - @SearchParamDefinition(name="dicom-class", path="ImagingStudy.series.instance.sopClass", description="The type of the instance", type="uri" ) - public static final String SP_DICOM_CLASS = "dicom-class"; - /** - * Fluent Client search parameter constant for dicom-class - *

- * Description: The type of the instance
- * Type: uri
- * Path: ImagingStudy.series.instance.sopClass
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam DICOM_CLASS = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DICOM_CLASS); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Immunization.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Immunization.java deleted file mode 100644 index c4c672f72c1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Immunization.java +++ /dev/null @@ -1,2910 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. - */ -@ResourceDef(name="Immunization", profile="http://hl7.org/fhir/Profile/Immunization") -public class Immunization extends DomainResource { - - @Block() - public static class ImmunizationExplanationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Reasons why a vaccine was administered. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Why immunization occurred", formalDefinition="Reasons why a vaccine was administered." ) - protected List reason; - - /** - * Reason why a vaccine was not administered. - */ - @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Why immunization did not occur", formalDefinition="Reason why a vaccine was not administered." ) - protected List reasonNotGiven; - - private static final long serialVersionUID = -539821866L; - - /** - * Constructor - */ - public ImmunizationExplanationComponent() { - super(); - } - - /** - * @return {@link #reason} (Reasons why a vaccine was administered.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Reasons why a vaccine was administered.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public ImmunizationExplanationComponent addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (Reason why a vaccine was not administered.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - // syntactic sugar - public ImmunizationExplanationComponent addReasonNotGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("reason", "CodeableConcept", "Reasons why a vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "Reason why a vaccine was not administered.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept - case 2101123790: /*reasonNotGiven*/ return this.reasonNotGiven == null ? new Base[0] : this.reasonNotGiven.toArray(new Base[this.reasonNotGiven.size()]); // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 2101123790: // reasonNotGiven - this.getReasonNotGiven().add(castToCodeableConcept(value)); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); - else if (name.equals("reasonNotGiven")) - this.getReasonNotGiven().add(castToCodeableConcept(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -934964668: return addReason(); // CodeableConcept - case 2101123790: return addReasonNotGiven(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("reasonNotGiven")) { - return addReasonNotGiven(); - } - else - return super.addChild(name); - } - - public ImmunizationExplanationComponent copy() { - ImmunizationExplanationComponent dst = new ImmunizationExplanationComponent(); - copyValues(dst); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationExplanationComponent)) - return false; - ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; - return compareDeep(reason, o.reason, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationExplanationComponent)) - return false; - ImmunizationExplanationComponent o = (ImmunizationExplanationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (reason == null || reason.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) - ; - } - - public String fhirType() { - return "Immunization.explanation"; - - } - - } - - @Block() - public static class ImmunizationReactionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Date of reaction to the immunization. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When reaction started", formalDefinition="Date of reaction to the immunization." ) - protected DateTimeType date; - - /** - * Details of the reaction. - */ - @Child(name = "detail", type = {Observation.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional information on reaction", formalDefinition="Details of the reaction." ) - protected Reference detail; - - /** - * The actual object that is the target of the reference (Details of the reaction.) - */ - protected Observation detailTarget; - - /** - * Self-reported indicator. - */ - @Child(name = "reported", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates self-reported reaction", formalDefinition="Self-reported indicator." ) - protected BooleanType reported; - - private static final long serialVersionUID = -1297668556L; - - /** - * Constructor - */ - public ImmunizationReactionComponent() { - super(); - } - - /** - * @return {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date of reaction to the immunization.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImmunizationReactionComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date of reaction to the immunization. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date of reaction to the immunization. - */ - public ImmunizationReactionComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #detail} (Details of the reaction.) - */ - public Reference getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new Reference(); // cc - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (Details of the reaction.) - */ - public ImmunizationReactionComponent setDetail(Reference value) { - this.detail = value; - return this; - } - - /** - * @return {@link #detail} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Details of the reaction.) - */ - public Observation getDetailTarget() { - if (this.detailTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detailTarget = new Observation(); // aa - return this.detailTarget; - } - - /** - * @param value {@link #detail} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Details of the reaction.) - */ - public ImmunizationReactionComponent setDetailTarget(Observation value) { - this.detailTarget = value; - return this; - } - - /** - * @return {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public BooleanType getReportedElement() { - if (this.reported == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationReactionComponent.reported"); - else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); // bb - return this.reported; - } - - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); - } - - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); - } - - /** - * @param value {@link #reported} (Self-reported indicator.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public ImmunizationReactionComponent setReportedElement(BooleanType value) { - this.reported = value; - return this; - } - - /** - * @return Self-reported indicator. - */ - public boolean getReported() { - return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); - } - - /** - * @param value Self-reported indicator. - */ - public ImmunizationReactionComponent setReported(boolean value) { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("date", "dateTime", "Date of reaction to the immunization.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("detail", "Reference(Observation)", "Details of the reaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("reported", "boolean", "Self-reported indicator.", 0, java.lang.Integer.MAX_VALUE, reported)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // Reference - case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // BooleanType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1335224239: // detail - this.detail = castToReference(value); // Reference - break; - case -427039533: // reported - this.reported = castToBoolean(value); // BooleanType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("detail")) - this.detail = castToReference(value); // Reference - else if (name.equals("reported")) - this.reported = castToBoolean(value); // BooleanType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1335224239: return getDetail(); // Reference - case -427039533: throw new FHIRException("Cannot make property reported as it is not a complex type"); // BooleanType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.date"); - } - else if (name.equals("detail")) { - this.detail = new Reference(); - return this.detail; - } - else if (name.equals("reported")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.reported"); - } - else - return super.addChild(name); - } - - public ImmunizationReactionComponent copy() { - ImmunizationReactionComponent dst = new ImmunizationReactionComponent(); - copyValues(dst); - dst.date = date == null ? null : date.copy(); - dst.detail = detail == null ? null : detail.copy(); - dst.reported = reported == null ? null : reported.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationReactionComponent)) - return false; - ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; - return compareDeep(date, o.date, true) && compareDeep(detail, o.detail, true) && compareDeep(reported, o.reported, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationReactionComponent)) - return false; - ImmunizationReactionComponent o = (ImmunizationReactionComponent) other; - return compareValues(date, o.date, true) && compareValues(reported, o.reported, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (date == null || date.isEmpty()) && (detail == null || detail.isEmpty()) - && (reported == null || reported.isEmpty()); - } - - public String fhirType() { - return "Immunization.reaction"; - - } - - } - - @Block() - public static class ImmunizationVaccinationProtocolComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Nominal position in a series. - */ - @Child(name = "doseSequence", type = {PositiveIntType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Dose number within series", formalDefinition="Nominal position in a series." ) - protected PositiveIntType doseSequence; - - /** - * Contains the description about the protocol under which the vaccine was administered. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Details of vaccine protocol", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) - protected StringType description; - - /** - * Indicates the authority who published the protocol. E.g. ACIP. - */ - @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol. E.g. ACIP." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (Indicates the authority who published the protocol. E.g. ACIP.) - */ - protected Organization authorityTarget; - - /** - * One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of vaccine series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) - protected StringType series; - - /** - * The recommended number of doses to achieve immunity. - */ - @Child(name = "seriesDoses", type = {PositiveIntType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Recommended number of doses for immunity", formalDefinition="The recommended number of doses to achieve immunity." ) - protected PositiveIntType seriesDoses; - - /** - * The targeted disease. - */ - @Child(name = "targetDisease", type = {CodeableConcept.class}, order=6, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Disease immunized against", formalDefinition="The targeted disease." ) - protected List targetDisease; - - /** - * Indicates if the immunization event should "count" against the protocol. - */ - @Child(name = "doseStatus", type = {CodeableConcept.class}, order=7, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates if dose counts towards immunity", formalDefinition="Indicates if the immunization event should \"count\" against the protocol." ) - protected CodeableConcept doseStatus; - - /** - * Provides an explanation as to why an immunization event should or should not count against the protocol. - */ - @Child(name = "doseStatusReason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why dose does (not) count", formalDefinition="Provides an explanation as to why an immunization event should or should not count against the protocol." ) - protected CodeableConcept doseStatusReason; - - private static final long serialVersionUID = 386814037L; - - /** - * Constructor - */ - public ImmunizationVaccinationProtocolComponent() { - super(); - } - - /** - * Constructor - */ - public ImmunizationVaccinationProtocolComponent(PositiveIntType doseSequence, CodeableConcept doseStatus) { - super(); - this.doseSequence = doseSequence; - this.doseStatus = doseStatus; - } - - /** - * @return {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public PositiveIntType getDoseSequenceElement() { - if (this.doseSequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseSequence"); - else if (Configuration.doAutoCreate()) - this.doseSequence = new PositiveIntType(); // bb - return this.doseSequence; - } - - public boolean hasDoseSequenceElement() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - public boolean hasDoseSequence() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - /** - * @param value {@link #doseSequence} (Nominal position in a series.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setDoseSequenceElement(PositiveIntType value) { - this.doseSequence = value; - return this; - } - - /** - * @return Nominal position in a series. - */ - public int getDoseSequence() { - return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); - } - - /** - * @param value Nominal position in a series. - */ - public ImmunizationVaccinationProtocolComponent setDoseSequence(int value) { - if (this.doseSequence == null) - this.doseSequence = new PositiveIntType(); - this.doseSequence.setValue(value); - return this; - } - - /** - * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Contains the description about the protocol under which the vaccine was administered. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Contains the description about the protocol under which the vaccine was administered. - */ - public ImmunizationVaccinationProtocolComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #authority} (Indicates the authority who published the protocol. E.g. ACIP.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); // cc - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (Indicates the authority who published the protocol. E.g. ACIP.) - */ - public ImmunizationVaccinationProtocolComponent setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol. E.g. ACIP.) - */ - public Organization getAuthorityTarget() { - if (this.authorityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authorityTarget = new Organization(); // aa - return this.authorityTarget; - } - - /** - * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol. E.g. ACIP.) - */ - public ImmunizationVaccinationProtocolComponent setAuthorityTarget(Organization value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public StringType getSeriesElement() { - if (this.series == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.series"); - else if (Configuration.doAutoCreate()) - this.series = new StringType(); // bb - return this.series; - } - - public boolean hasSeriesElement() { - return this.series != null && !this.series.isEmpty(); - } - - public boolean hasSeries() { - return this.series != null && !this.series.isEmpty(); - } - - /** - * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setSeriesElement(StringType value) { - this.series = value; - return this; - } - - /** - * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public String getSeries() { - return this.series == null ? null : this.series.getValue(); - } - - /** - * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public ImmunizationVaccinationProtocolComponent setSeries(String value) { - if (Utilities.noString(value)) - this.series = null; - else { - if (this.series == null) - this.series = new StringType(); - this.series.setValue(value); - } - return this; - } - - /** - * @return {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value - */ - public PositiveIntType getSeriesDosesElement() { - if (this.seriesDoses == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.seriesDoses"); - else if (Configuration.doAutoCreate()) - this.seriesDoses = new PositiveIntType(); // bb - return this.seriesDoses; - } - - public boolean hasSeriesDosesElement() { - return this.seriesDoses != null && !this.seriesDoses.isEmpty(); - } - - public boolean hasSeriesDoses() { - return this.seriesDoses != null && !this.seriesDoses.isEmpty(); - } - - /** - * @param value {@link #seriesDoses} (The recommended number of doses to achieve immunity.). This is the underlying object with id, value and extensions. The accessor "getSeriesDoses" gives direct access to the value - */ - public ImmunizationVaccinationProtocolComponent setSeriesDosesElement(PositiveIntType value) { - this.seriesDoses = value; - return this; - } - - /** - * @return The recommended number of doses to achieve immunity. - */ - public int getSeriesDoses() { - return this.seriesDoses == null || this.seriesDoses.isEmpty() ? 0 : this.seriesDoses.getValue(); - } - - /** - * @param value The recommended number of doses to achieve immunity. - */ - public ImmunizationVaccinationProtocolComponent setSeriesDoses(int value) { - if (this.seriesDoses == null) - this.seriesDoses = new PositiveIntType(); - this.seriesDoses.setValue(value); - return this; - } - - /** - * @return {@link #targetDisease} (The targeted disease.) - */ - public List getTargetDisease() { - if (this.targetDisease == null) - this.targetDisease = new ArrayList(); - return this.targetDisease; - } - - public boolean hasTargetDisease() { - if (this.targetDisease == null) - return false; - for (CodeableConcept item : this.targetDisease) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #targetDisease} (The targeted disease.) - */ - // syntactic sugar - public CodeableConcept addTargetDisease() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.targetDisease == null) - this.targetDisease = new ArrayList(); - this.targetDisease.add(t); - return t; - } - - // syntactic sugar - public ImmunizationVaccinationProtocolComponent addTargetDisease(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.targetDisease == null) - this.targetDisease = new ArrayList(); - this.targetDisease.add(t); - return this; - } - - /** - * @return {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) - */ - public CodeableConcept getDoseStatus() { - if (this.doseStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatus"); - else if (Configuration.doAutoCreate()) - this.doseStatus = new CodeableConcept(); // cc - return this.doseStatus; - } - - public boolean hasDoseStatus() { - return this.doseStatus != null && !this.doseStatus.isEmpty(); - } - - /** - * @param value {@link #doseStatus} (Indicates if the immunization event should "count" against the protocol.) - */ - public ImmunizationVaccinationProtocolComponent setDoseStatus(CodeableConcept value) { - this.doseStatus = value; - return this; - } - - /** - * @return {@link #doseStatusReason} (Provides an explanation as to why an immunization event should or should not count against the protocol.) - */ - public CodeableConcept getDoseStatusReason() { - if (this.doseStatusReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationVaccinationProtocolComponent.doseStatusReason"); - else if (Configuration.doAutoCreate()) - this.doseStatusReason = new CodeableConcept(); // cc - return this.doseStatusReason; - } - - public boolean hasDoseStatusReason() { - return this.doseStatusReason != null && !this.doseStatusReason.isEmpty(); - } - - /** - * @param value {@link #doseStatusReason} (Provides an explanation as to why an immunization event should or should not count against the protocol.) - */ - public ImmunizationVaccinationProtocolComponent setDoseStatusReason(CodeableConcept value) { - this.doseStatusReason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("doseSequence", "positiveInt", "Nominal position in a series.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); - childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol. E.g. ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); - childrenList.add(new Property("seriesDoses", "positiveInt", "The recommended number of doses to achieve immunity.", 0, java.lang.Integer.MAX_VALUE, seriesDoses)); - childrenList.add(new Property("targetDisease", "CodeableConcept", "The targeted disease.", 0, java.lang.Integer.MAX_VALUE, targetDisease)); - childrenList.add(new Property("doseStatus", "CodeableConcept", "Indicates if the immunization event should \"count\" against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatus)); - childrenList.add(new Property("doseStatusReason", "CodeableConcept", "Provides an explanation as to why an immunization event should or should not count against the protocol.", 0, java.lang.Integer.MAX_VALUE, doseStatusReason)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 550933246: /*doseSequence*/ return this.doseSequence == null ? new Base[0] : new Base[] {this.doseSequence}; // PositiveIntType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // Reference - case -905838985: /*series*/ return this.series == null ? new Base[0] : new Base[] {this.series}; // StringType - case -1936727105: /*seriesDoses*/ return this.seriesDoses == null ? new Base[0] : new Base[] {this.seriesDoses}; // PositiveIntType - case -319593813: /*targetDisease*/ return this.targetDisease == null ? new Base[0] : this.targetDisease.toArray(new Base[this.targetDisease.size()]); // CodeableConcept - case -745826705: /*doseStatus*/ return this.doseStatus == null ? new Base[0] : new Base[] {this.doseStatus}; // CodeableConcept - case 662783379: /*doseStatusReason*/ return this.doseStatusReason == null ? new Base[0] : new Base[] {this.doseStatusReason}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 550933246: // doseSequence - this.doseSequence = castToPositiveInt(value); // PositiveIntType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 1475610435: // authority - this.authority = castToReference(value); // Reference - break; - case -905838985: // series - this.series = castToString(value); // StringType - break; - case -1936727105: // seriesDoses - this.seriesDoses = castToPositiveInt(value); // PositiveIntType - break; - case -319593813: // targetDisease - this.getTargetDisease().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -745826705: // doseStatus - this.doseStatus = castToCodeableConcept(value); // CodeableConcept - break; - case 662783379: // doseStatusReason - this.doseStatusReason = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("doseSequence")) - this.doseSequence = castToPositiveInt(value); // PositiveIntType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("authority")) - this.authority = castToReference(value); // Reference - else if (name.equals("series")) - this.series = castToString(value); // StringType - else if (name.equals("seriesDoses")) - this.seriesDoses = castToPositiveInt(value); // PositiveIntType - else if (name.equals("targetDisease")) - this.getTargetDisease().add(castToCodeableConcept(value)); - else if (name.equals("doseStatus")) - this.doseStatus = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("doseStatusReason")) - this.doseStatusReason = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 550933246: throw new FHIRException("Cannot make property doseSequence as it is not a complex type"); // PositiveIntType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1475610435: return getAuthority(); // Reference - case -905838985: throw new FHIRException("Cannot make property series as it is not a complex type"); // StringType - case -1936727105: throw new FHIRException("Cannot make property seriesDoses as it is not a complex type"); // PositiveIntType - case -319593813: return addTargetDisease(); // CodeableConcept - case -745826705: return getDoseStatus(); // CodeableConcept - case 662783379: return getDoseStatusReason(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("doseSequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.doseSequence"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.description"); - } - else if (name.equals("authority")) { - this.authority = new Reference(); - return this.authority; - } - else if (name.equals("series")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.series"); - } - else if (name.equals("seriesDoses")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.seriesDoses"); - } - else if (name.equals("targetDisease")) { - return addTargetDisease(); - } - else if (name.equals("doseStatus")) { - this.doseStatus = new CodeableConcept(); - return this.doseStatus; - } - else if (name.equals("doseStatusReason")) { - this.doseStatusReason = new CodeableConcept(); - return this.doseStatusReason; - } - else - return super.addChild(name); - } - - public ImmunizationVaccinationProtocolComponent copy() { - ImmunizationVaccinationProtocolComponent dst = new ImmunizationVaccinationProtocolComponent(); - copyValues(dst); - dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); - dst.description = description == null ? null : description.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.series = series == null ? null : series.copy(); - dst.seriesDoses = seriesDoses == null ? null : seriesDoses.copy(); - if (targetDisease != null) { - dst.targetDisease = new ArrayList(); - for (CodeableConcept i : targetDisease) - dst.targetDisease.add(i.copy()); - }; - dst.doseStatus = doseStatus == null ? null : doseStatus.copy(); - dst.doseStatusReason = doseStatusReason == null ? null : doseStatusReason.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationVaccinationProtocolComponent)) - return false; - ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; - return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) - && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true) && compareDeep(seriesDoses, o.seriesDoses, true) - && compareDeep(targetDisease, o.targetDisease, true) && compareDeep(doseStatus, o.doseStatus, true) - && compareDeep(doseStatusReason, o.doseStatusReason, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationVaccinationProtocolComponent)) - return false; - ImmunizationVaccinationProtocolComponent o = (ImmunizationVaccinationProtocolComponent) other; - return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) - && compareValues(series, o.series, true) && compareValues(seriesDoses, o.seriesDoses, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) - && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()) && (seriesDoses == null || seriesDoses.isEmpty()) - && (targetDisease == null || targetDisease.isEmpty()) && (doseStatus == null || doseStatus.isEmpty()) - && (doseStatusReason == null || doseStatusReason.isEmpty()); - } - - public String fhirType() { - return "Immunization.vaccinationProtocol"; - - } - - } - - /** - * A unique identifier assigned to this immunization record. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this immunization record." ) - protected List identifier; - - /** - * Indicates the current status of the vaccination event. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="Indicates the current status of the vaccination event." ) - protected CodeType status; - - /** - * Date vaccine administered or was to be administered. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Vaccination administration date", formalDefinition="Date vaccine administered or was to be administered." ) - protected DateTimeType date; - - /** - * Vaccine that was administered or was to be administered. - */ - @Child(name = "vaccineCode", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Vaccine product administered", formalDefinition="Vaccine that was administered or was to be administered." ) - protected CodeableConcept vaccineCode; - - /** - * The patient who either received or did not receive the immunization. - */ - @Child(name = "patient", type = {Patient.class}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who was immunized", formalDefinition="The patient who either received or did not receive the immunization." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who either received or did not receive the immunization.) - */ - protected Patient patientTarget; - - /** - * Indicates if the vaccination was or was not given. - */ - @Child(name = "wasNotGiven", type = {BooleanType.class}, order=5, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="Flag for whether immunization was given", formalDefinition="Indicates if the vaccination was or was not given." ) - protected BooleanType wasNotGiven; - - /** - * True if this administration was reported rather than directly administered. - */ - @Child(name = "reported", type = {BooleanType.class}, order=6, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates a self-reported record", formalDefinition="True if this administration was reported rather than directly administered." ) - protected BooleanType reported; - - /** - * Clinician who administered the vaccine. - */ - @Child(name = "performer", type = {Practitioner.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who administered vaccine", formalDefinition="Clinician who administered the vaccine." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (Clinician who administered the vaccine.) - */ - protected Practitioner performerTarget; - - /** - * Clinician who ordered the vaccination. - */ - @Child(name = "requester", type = {Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who ordered vaccination", formalDefinition="Clinician who ordered the vaccination." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (Clinician who ordered the vaccination.) - */ - protected Practitioner requesterTarget; - - /** - * The visit or admission or other contact between patient and health care provider the immunization was performed as part of. - */ - @Child(name = "encounter", type = {Encounter.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit or admission or other contact between patient and health care provider the immunization was performed as part of." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - protected Encounter encounterTarget; - - /** - * Name of vaccine manufacturer. - */ - @Child(name = "manufacturer", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Vaccine manufacturer", formalDefinition="Name of vaccine manufacturer." ) - protected Reference manufacturer; - - /** - * The actual object that is the target of the reference (Name of vaccine manufacturer.) - */ - protected Organization manufacturerTarget; - - /** - * The service delivery location where the vaccine administration occurred. - */ - @Child(name = "location", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Where vaccination occurred", formalDefinition="The service delivery location where the vaccine administration occurred." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The service delivery location where the vaccine administration occurred.) - */ - protected Location locationTarget; - - /** - * Lot number of the vaccine product. - */ - @Child(name = "lotNumber", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Vaccine lot number", formalDefinition="Lot number of the vaccine product." ) - protected StringType lotNumber; - - /** - * Date vaccine batch expires. - */ - @Child(name = "expirationDate", type = {DateType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Vaccine expiration date", formalDefinition="Date vaccine batch expires." ) - protected DateType expirationDate; - - /** - * Body site where vaccine was administered. - */ - @Child(name = "site", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Body site vaccine was administered", formalDefinition="Body site where vaccine was administered." ) - protected CodeableConcept site; - - /** - * The path by which the vaccine product is taken into the body. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How vaccine entered body", formalDefinition="The path by which the vaccine product is taken into the body." ) - protected CodeableConcept route; - - /** - * The quantity of vaccine product that was administered. - */ - @Child(name = "doseQuantity", type = {SimpleQuantity.class}, order=16, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Amount of vaccine administered", formalDefinition="The quantity of vaccine product that was administered." ) - protected SimpleQuantity doseQuantity; - - /** - * Extra information about the immunization that is not conveyed by the other attributes. - */ - @Child(name = "note", type = {Annotation.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Vaccination notes", formalDefinition="Extra information about the immunization that is not conveyed by the other attributes." ) - protected List note; - - /** - * Reasons why a vaccine was or was not administered. - */ - @Child(name = "explanation", type = {}, order=18, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Administration/non-administration reasons", formalDefinition="Reasons why a vaccine was or was not administered." ) - protected ImmunizationExplanationComponent explanation; - - /** - * Categorical data indicating that an adverse event is associated in time to an immunization. - */ - @Child(name = "reaction", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Details of a reaction that follows immunization", formalDefinition="Categorical data indicating that an adverse event is associated in time to an immunization." ) - protected List reaction; - - /** - * Contains information about the protocol(s) under which the vaccine was administered. - */ - @Child(name = "vaccinationProtocol", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="What protocol was followed", formalDefinition="Contains information about the protocol(s) under which the vaccine was administered." ) - protected List vaccinationProtocol; - - private static final long serialVersionUID = 898786200L; - - /** - * Constructor - */ - public Immunization() { - super(); - } - - /** - * Constructor - */ - public Immunization(CodeType status, CodeableConcept vaccineCode, Reference patient, BooleanType wasNotGiven, BooleanType reported) { - super(); - this.status = status; - this.vaccineCode = vaccineCode; - this.patient = patient; - this.wasNotGiven = wasNotGiven; - this.reported = reported; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this immunization record.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this immunization record.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Immunization addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (Indicates the current status of the vaccination event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public CodeType getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.status"); - else if (Configuration.doAutoCreate()) - this.status = new CodeType(); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates the current status of the vaccination event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Immunization setStatusElement(CodeType value) { - this.status = value; - return this; - } - - /** - * @return Indicates the current status of the vaccination event. - */ - public String getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates the current status of the vaccination event. - */ - public Immunization setStatus(String value) { - if (this.status == null) - this.status = new CodeType(); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (Date vaccine administered or was to be administered.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Immunization setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return Date vaccine administered or was to be administered. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value Date vaccine administered or was to be administered. - */ - public Immunization setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #vaccineCode} (Vaccine that was administered or was to be administered.) - */ - public CodeableConcept getVaccineCode() { - if (this.vaccineCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.vaccineCode"); - else if (Configuration.doAutoCreate()) - this.vaccineCode = new CodeableConcept(); // cc - return this.vaccineCode; - } - - public boolean hasVaccineCode() { - return this.vaccineCode != null && !this.vaccineCode.isEmpty(); - } - - /** - * @param value {@link #vaccineCode} (Vaccine that was administered or was to be administered.) - */ - public Immunization setVaccineCode(CodeableConcept value) { - this.vaccineCode = value; - return this; - } - - /** - * @return {@link #patient} (The patient who either received or did not receive the immunization.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient who either received or did not receive the immunization.) - */ - public Immunization setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who either received or did not receive the immunization.) - */ - public Immunization setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); // bb - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Indicates if the vaccination was or was not given.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public Immunization setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Indicates if the vaccination was or was not given. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Indicates if the vaccination was or was not given. - */ - public Immunization setWasNotGiven(boolean value) { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - return this; - } - - /** - * @return {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public BooleanType getReportedElement() { - if (this.reported == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.reported"); - else if (Configuration.doAutoCreate()) - this.reported = new BooleanType(); // bb - return this.reported; - } - - public boolean hasReportedElement() { - return this.reported != null && !this.reported.isEmpty(); - } - - public boolean hasReported() { - return this.reported != null && !this.reported.isEmpty(); - } - - /** - * @param value {@link #reported} (True if this administration was reported rather than directly administered.). This is the underlying object with id, value and extensions. The accessor "getReported" gives direct access to the value - */ - public Immunization setReportedElement(BooleanType value) { - this.reported = value; - return this; - } - - /** - * @return True if this administration was reported rather than directly administered. - */ - public boolean getReported() { - return this.reported == null || this.reported.isEmpty() ? false : this.reported.getValue(); - } - - /** - * @param value True if this administration was reported rather than directly administered. - */ - public Immunization setReported(boolean value) { - if (this.reported == null) - this.reported = new BooleanType(); - this.reported.setValue(value); - return this; - } - - /** - * @return {@link #performer} (Clinician who administered the vaccine.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (Clinician who administered the vaccine.) - */ - public Immunization setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Clinician who administered the vaccine.) - */ - public Practitioner getPerformerTarget() { - if (this.performerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.performer"); - else if (Configuration.doAutoCreate()) - this.performerTarget = new Practitioner(); // aa - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Clinician who administered the vaccine.) - */ - public Immunization setPerformerTarget(Practitioner value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #requester} (Clinician who ordered the vaccination.) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (Clinician who ordered the vaccination.) - */ - public Immunization setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Clinician who ordered the vaccination.) - */ - public Practitioner getRequesterTarget() { - if (this.requesterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.requester"); - else if (Configuration.doAutoCreate()) - this.requesterTarget = new Practitioner(); // aa - return this.requesterTarget; - } - - /** - * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Clinician who ordered the vaccination.) - */ - public Immunization setRequesterTarget(Practitioner value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Immunization setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit or admission or other contact between patient and health care provider the immunization was performed as part of.) - */ - public Immunization setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #manufacturer} (Name of vaccine manufacturer.) - */ - public Reference getManufacturer() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new Reference(); // cc - return this.manufacturer; - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (Name of vaccine manufacturer.) - */ - public Immunization setManufacturer(Reference value) { - this.manufacturer = value; - return this; - } - - /** - * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.) - */ - public Organization getManufacturerTarget() { - if (this.manufacturerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturerTarget = new Organization(); // aa - return this.manufacturerTarget; - } - - /** - * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Name of vaccine manufacturer.) - */ - public Immunization setManufacturerTarget(Organization value) { - this.manufacturerTarget = value; - return this; - } - - /** - * @return {@link #location} (The service delivery location where the vaccine administration occurred.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The service delivery location where the vaccine administration occurred.) - */ - public Immunization setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The service delivery location where the vaccine administration occurred.) - */ - public Immunization setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); // bb - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (Lot number of the vaccine product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public Immunization setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return Lot number of the vaccine product. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value Lot number of the vaccine product. - */ - public Immunization setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public DateType getExpirationDateElement() { - if (this.expirationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.expirationDate"); - else if (Configuration.doAutoCreate()) - this.expirationDate = new DateType(); // bb - return this.expirationDate; - } - - public boolean hasExpirationDateElement() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - public boolean hasExpirationDate() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - /** - * @param value {@link #expirationDate} (Date vaccine batch expires.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public Immunization setExpirationDateElement(DateType value) { - this.expirationDate = value; - return this; - } - - /** - * @return Date vaccine batch expires. - */ - public Date getExpirationDate() { - return this.expirationDate == null ? null : this.expirationDate.getValue(); - } - - /** - * @param value Date vaccine batch expires. - */ - public Immunization setExpirationDate(Date value) { - if (value == null) - this.expirationDate = null; - else { - if (this.expirationDate == null) - this.expirationDate = new DateType(); - this.expirationDate.setValue(value); - } - return this; - } - - /** - * @return {@link #site} (Body site where vaccine was administered.) - */ - public CodeableConcept getSite() { - if (this.site == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.site"); - else if (Configuration.doAutoCreate()) - this.site = new CodeableConcept(); // cc - return this.site; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (Body site where vaccine was administered.) - */ - public Immunization setSite(CodeableConcept value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (The path by which the vaccine product is taken into the body.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (The path by which the vaccine product is taken into the body.) - */ - public Immunization setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #doseQuantity} (The quantity of vaccine product that was administered.) - */ - public SimpleQuantity getDoseQuantity() { - if (this.doseQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.doseQuantity"); - else if (Configuration.doAutoCreate()) - this.doseQuantity = new SimpleQuantity(); // cc - return this.doseQuantity; - } - - public boolean hasDoseQuantity() { - return this.doseQuantity != null && !this.doseQuantity.isEmpty(); - } - - /** - * @param value {@link #doseQuantity} (The quantity of vaccine product that was administered.) - */ - public Immunization setDoseQuantity(SimpleQuantity value) { - this.doseQuantity = value; - return this; - } - - /** - * @return {@link #note} (Extra information about the immunization that is not conveyed by the other attributes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Extra information about the immunization that is not conveyed by the other attributes.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public Immunization addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #explanation} (Reasons why a vaccine was or was not administered.) - */ - public ImmunizationExplanationComponent getExplanation() { - if (this.explanation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Immunization.explanation"); - else if (Configuration.doAutoCreate()) - this.explanation = new ImmunizationExplanationComponent(); // cc - return this.explanation; - } - - public boolean hasExplanation() { - return this.explanation != null && !this.explanation.isEmpty(); - } - - /** - * @param value {@link #explanation} (Reasons why a vaccine was or was not administered.) - */ - public Immunization setExplanation(ImmunizationExplanationComponent value) { - this.explanation = value; - return this; - } - - /** - * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) - */ - public List getReaction() { - if (this.reaction == null) - this.reaction = new ArrayList(); - return this.reaction; - } - - public boolean hasReaction() { - if (this.reaction == null) - return false; - for (ImmunizationReactionComponent item : this.reaction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reaction} (Categorical data indicating that an adverse event is associated in time to an immunization.) - */ - // syntactic sugar - public ImmunizationReactionComponent addReaction() { //3 - ImmunizationReactionComponent t = new ImmunizationReactionComponent(); - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return t; - } - - // syntactic sugar - public Immunization addReaction(ImmunizationReactionComponent t) { //3 - if (t == null) - return this; - if (this.reaction == null) - this.reaction = new ArrayList(); - this.reaction.add(t); - return this; - } - - /** - * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) - */ - public List getVaccinationProtocol() { - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - return this.vaccinationProtocol; - } - - public boolean hasVaccinationProtocol() { - if (this.vaccinationProtocol == null) - return false; - for (ImmunizationVaccinationProtocolComponent item : this.vaccinationProtocol) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #vaccinationProtocol} (Contains information about the protocol(s) under which the vaccine was administered.) - */ - // syntactic sugar - public ImmunizationVaccinationProtocolComponent addVaccinationProtocol() { //3 - ImmunizationVaccinationProtocolComponent t = new ImmunizationVaccinationProtocolComponent(); - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - this.vaccinationProtocol.add(t); - return t; - } - - // syntactic sugar - public Immunization addVaccinationProtocol(ImmunizationVaccinationProtocolComponent t) { //3 - if (t == null) - return this; - if (this.vaccinationProtocol == null) - this.vaccinationProtocol = new ArrayList(); - this.vaccinationProtocol.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this immunization record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Indicates the current status of the vaccination event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "Date vaccine administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("vaccineCode", "CodeableConcept", "Vaccine that was administered or was to be administered.", 0, java.lang.Integer.MAX_VALUE, vaccineCode)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who either received or did not receive the immunization.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("wasNotGiven", "boolean", "Indicates if the vaccination was or was not given.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reported", "boolean", "True if this administration was reported rather than directly administered.", 0, java.lang.Integer.MAX_VALUE, reported)); - childrenList.add(new Property("performer", "Reference(Practitioner)", "Clinician who administered the vaccine.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("requester", "Reference(Practitioner)", "Clinician who ordered the vaccination.", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit or admission or other contact between patient and health care provider the immunization was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("manufacturer", "Reference(Organization)", "Name of vaccine manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("location", "Reference(Location)", "The service delivery location where the vaccine administration occurred.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("lotNumber", "string", "Lot number of the vaccine product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("expirationDate", "date", "Date vaccine batch expires.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); - childrenList.add(new Property("site", "CodeableConcept", "Body site where vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "The path by which the vaccine product is taken into the body.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("doseQuantity", "SimpleQuantity", "The quantity of vaccine product that was administered.", 0, java.lang.Integer.MAX_VALUE, doseQuantity)); - childrenList.add(new Property("note", "Annotation", "Extra information about the immunization that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("explanation", "", "Reasons why a vaccine was or was not administered.", 0, java.lang.Integer.MAX_VALUE, explanation)); - childrenList.add(new Property("reaction", "", "Categorical data indicating that an adverse event is associated in time to an immunization.", 0, java.lang.Integer.MAX_VALUE, reaction)); - childrenList.add(new Property("vaccinationProtocol", "", "Contains information about the protocol(s) under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, vaccinationProtocol)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // CodeType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : new Base[] {this.vaccineCode}; // CodeableConcept - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1050911117: /*wasNotGiven*/ return this.wasNotGiven == null ? new Base[0] : new Base[] {this.wasNotGiven}; // BooleanType - case -427039533: /*reported*/ return this.reported == null ? new Base[0] : new Base[] {this.reported}; // BooleanType - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference - case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Reference - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType - case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateType - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // CodeableConcept - case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept - case -2083618872: /*doseQuantity*/ return this.doseQuantity == null ? new Base[0] : new Base[] {this.doseQuantity}; // SimpleQuantity - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -1105867239: /*explanation*/ return this.explanation == null ? new Base[0] : new Base[] {this.explanation}; // ImmunizationExplanationComponent - case -867509719: /*reaction*/ return this.reaction == null ? new Base[0] : this.reaction.toArray(new Base[this.reaction.size()]); // ImmunizationReactionComponent - case -179633155: /*vaccinationProtocol*/ return this.vaccinationProtocol == null ? new Base[0] : this.vaccinationProtocol.toArray(new Base[this.vaccinationProtocol.size()]); // ImmunizationVaccinationProtocolComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = castToCode(value); // CodeType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 664556354: // vaccineCode - this.vaccineCode = castToCodeableConcept(value); // CodeableConcept - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1050911117: // wasNotGiven - this.wasNotGiven = castToBoolean(value); // BooleanType - break; - case -427039533: // reported - this.reported = castToBoolean(value); // BooleanType - break; - case 481140686: // performer - this.performer = castToReference(value); // Reference - break; - case 693933948: // requester - this.requester = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1969347631: // manufacturer - this.manufacturer = castToReference(value); // Reference - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case 462547450: // lotNumber - this.lotNumber = castToString(value); // StringType - break; - case -668811523: // expirationDate - this.expirationDate = castToDate(value); // DateType - break; - case 3530567: // site - this.site = castToCodeableConcept(value); // CodeableConcept - break; - case 108704329: // route - this.route = castToCodeableConcept(value); // CodeableConcept - break; - case -2083618872: // doseQuantity - this.doseQuantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -1105867239: // explanation - this.explanation = (ImmunizationExplanationComponent) value; // ImmunizationExplanationComponent - break; - case -867509719: // reaction - this.getReaction().add((ImmunizationReactionComponent) value); // ImmunizationReactionComponent - break; - case -179633155: // vaccinationProtocol - this.getVaccinationProtocol().add((ImmunizationVaccinationProtocolComponent) value); // ImmunizationVaccinationProtocolComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = castToCode(value); // CodeType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("vaccineCode")) - this.vaccineCode = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("wasNotGiven")) - this.wasNotGiven = castToBoolean(value); // BooleanType - else if (name.equals("reported")) - this.reported = castToBoolean(value); // BooleanType - else if (name.equals("performer")) - this.performer = castToReference(value); // Reference - else if (name.equals("requester")) - this.requester = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("manufacturer")) - this.manufacturer = castToReference(value); // Reference - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("lotNumber")) - this.lotNumber = castToString(value); // StringType - else if (name.equals("expirationDate")) - this.expirationDate = castToDate(value); // DateType - else if (name.equals("site")) - this.site = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("route")) - this.route = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("doseQuantity")) - this.doseQuantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("explanation")) - this.explanation = (ImmunizationExplanationComponent) value; // ImmunizationExplanationComponent - else if (name.equals("reaction")) - this.getReaction().add((ImmunizationReactionComponent) value); - else if (name.equals("vaccinationProtocol")) - this.getVaccinationProtocol().add((ImmunizationVaccinationProtocolComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // CodeType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 664556354: return getVaccineCode(); // CodeableConcept - case -791418107: return getPatient(); // Reference - case -1050911117: throw new FHIRException("Cannot make property wasNotGiven as it is not a complex type"); // BooleanType - case -427039533: throw new FHIRException("Cannot make property reported as it is not a complex type"); // BooleanType - case 481140686: return getPerformer(); // Reference - case 693933948: return getRequester(); // Reference - case 1524132147: return getEncounter(); // Reference - case -1969347631: return getManufacturer(); // Reference - case 1901043637: return getLocation(); // Reference - case 462547450: throw new FHIRException("Cannot make property lotNumber as it is not a complex type"); // StringType - case -668811523: throw new FHIRException("Cannot make property expirationDate as it is not a complex type"); // DateType - case 3530567: return getSite(); // CodeableConcept - case 108704329: return getRoute(); // CodeableConcept - case -2083618872: return getDoseQuantity(); // SimpleQuantity - case 3387378: return addNote(); // Annotation - case -1105867239: return getExplanation(); // ImmunizationExplanationComponent - case -867509719: return addReaction(); // ImmunizationReactionComponent - case -179633155: return addVaccinationProtocol(); // ImmunizationVaccinationProtocolComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.status"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.date"); - } - else if (name.equals("vaccineCode")) { - this.vaccineCode = new CodeableConcept(); - return this.vaccineCode; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("wasNotGiven")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.wasNotGiven"); - } - else if (name.equals("reported")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.reported"); - } - else if (name.equals("performer")) { - this.performer = new Reference(); - return this.performer; - } - else if (name.equals("requester")) { - this.requester = new Reference(); - return this.requester; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("manufacturer")) { - this.manufacturer = new Reference(); - return this.manufacturer; - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("lotNumber")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.lotNumber"); - } - else if (name.equals("expirationDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Immunization.expirationDate"); - } - else if (name.equals("site")) { - this.site = new CodeableConcept(); - return this.site; - } - else if (name.equals("route")) { - this.route = new CodeableConcept(); - return this.route; - } - else if (name.equals("doseQuantity")) { - this.doseQuantity = new SimpleQuantity(); - return this.doseQuantity; - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("explanation")) { - this.explanation = new ImmunizationExplanationComponent(); - return this.explanation; - } - else if (name.equals("reaction")) { - return addReaction(); - } - else if (name.equals("vaccinationProtocol")) { - return addVaccinationProtocol(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Immunization"; - - } - - public Immunization copy() { - Immunization dst = new Immunization(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.vaccineCode = vaccineCode == null ? null : vaccineCode.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - dst.reported = reported == null ? null : reported.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.requester = requester == null ? null : requester.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.location = location == null ? null : location.copy(); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.doseQuantity = doseQuantity == null ? null : doseQuantity.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - dst.explanation = explanation == null ? null : explanation.copy(); - if (reaction != null) { - dst.reaction = new ArrayList(); - for (ImmunizationReactionComponent i : reaction) - dst.reaction.add(i.copy()); - }; - if (vaccinationProtocol != null) { - dst.vaccinationProtocol = new ArrayList(); - for (ImmunizationVaccinationProtocolComponent i : vaccinationProtocol) - dst.vaccinationProtocol.add(i.copy()); - }; - return dst; - } - - protected Immunization typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Immunization)) - return false; - Immunization o = (Immunization) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) - && compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(patient, o.patient, true) && compareDeep(wasNotGiven, o.wasNotGiven, true) - && compareDeep(reported, o.reported, true) && compareDeep(performer, o.performer, true) && compareDeep(requester, o.requester, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(manufacturer, o.manufacturer, true) - && compareDeep(location, o.location, true) && compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) - && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(doseQuantity, o.doseQuantity, true) - && compareDeep(note, o.note, true) && compareDeep(explanation, o.explanation, true) && compareDeep(reaction, o.reaction, true) - && compareDeep(vaccinationProtocol, o.vaccinationProtocol, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Immunization)) - return false; - Immunization o = (Immunization) other; - return compareValues(status, o.status, true) && compareValues(date, o.date, true) && compareValues(wasNotGiven, o.wasNotGiven, true) - && compareValues(reported, o.reported, true) && compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (date == null || date.isEmpty()) && (vaccineCode == null || vaccineCode.isEmpty()) && (patient == null || patient.isEmpty()) - && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reported == null || reported.isEmpty()) - && (performer == null || performer.isEmpty()) && (requester == null || requester.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (manufacturer == null || manufacturer.isEmpty()) - && (location == null || location.isEmpty()) && (lotNumber == null || lotNumber.isEmpty()) - && (expirationDate == null || expirationDate.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (doseQuantity == null || doseQuantity.isEmpty()) - && (note == null || note.isEmpty()) && (explanation == null || explanation.isEmpty()) && (reaction == null || reaction.isEmpty()) - && (vaccinationProtocol == null || vaccinationProtocol.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Immunization; - } - - /** - * Search parameter: reaction - *

- * Description: Additional information on reaction
- * Type: reference
- * Path: Immunization.reaction.detail
- *

- */ - @SearchParamDefinition(name="reaction", path="Immunization.reaction.detail", description="Additional information on reaction", type="reference" ) - public static final String SP_REACTION = "reaction"; - /** - * Fluent Client search parameter constant for reaction - *

- * Description: Additional information on reaction
- * Type: reference
- * Path: Immunization.reaction.detail
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REACTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REACTION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization:reaction". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REACTION = new ca.uhn.fhir.model.api.Include("Immunization:reaction").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization:requester". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("Immunization:requester").toLocked(); - - /** - * Search parameter: dose-sequence - *

- * Description: Dose number within series
- * Type: number
- * Path: Immunization.vaccinationProtocol.doseSequence
- *

- */ - @SearchParamDefinition(name="dose-sequence", path="Immunization.vaccinationProtocol.doseSequence", description="Dose number within series", type="number" ) - public static final String SP_DOSE_SEQUENCE = "dose-sequence"; - /** - * Fluent Client search parameter constant for dose-sequence - *

- * Description: Dose number within series
- * Type: number
- * Path: Immunization.vaccinationProtocol.doseSequence
- *

- */ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam DOSE_SEQUENCE = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DOSE_SEQUENCE); - - /** - * Search parameter: status - *

- * Description: Immunization event status
- * Type: token
- * Path: Immunization.status
- *

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

- * Description: Immunization event status
- * Type: token
- * Path: Immunization.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Immunization:location").toLocked(); - - /** - * Search parameter: reason - *

- * Description: Why immunization occurred
- * Type: token
- * Path: Immunization.explanation.reason
- *

- */ - @SearchParamDefinition(name="reason", path="Immunization.explanation.reason", description="Why immunization occurred", type="token" ) - public static final String SP_REASON = "reason"; - /** - * Fluent Client search parameter constant for reason - *

- * Description: Why immunization occurred
- * Type: token
- * Path: Immunization.explanation.reason
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON); - - /** - * Search parameter: reaction-date - *

- * Description: When reaction started
- * Type: date
- * Path: Immunization.reaction.date
- *

- */ - @SearchParamDefinition(name="reaction-date", path="Immunization.reaction.date", description="When reaction started", type="date" ) - public static final String SP_REACTION_DATE = "reaction-date"; - /** - * Fluent Client search parameter constant for reaction-date - *

- * Description: When reaction started
- * Type: date
- * Path: Immunization.reaction.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam REACTION_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_REACTION_DATE); - - /** - * Search parameter: notgiven - *

- * Description: Administrations which were not given
- * Type: token
- * Path: Immunization.wasNotGiven
- *

- */ - @SearchParamDefinition(name="notgiven", path="Immunization.wasNotGiven", description="Administrations which were not given", type="token" ) - public static final String SP_NOTGIVEN = "notgiven"; - /** - * Fluent Client search parameter constant for notgiven - *

- * Description: Administrations which were not given
- * Type: token
- * Path: Immunization.wasNotGiven
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam NOTGIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NOTGIVEN); - - /** - * Search parameter: date - *

- * Description: Vaccination (non)-Administration Date
- * Type: date
- * Path: Immunization.date
- *

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

- * Description: Vaccination (non)-Administration Date
- * Type: date
- * Path: Immunization.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: reason-not-given - *

- * Description: Explanation of reason vaccination was not administered
- * Type: token
- * Path: Immunization.explanation.reasonNotGiven
- *

- */ - @SearchParamDefinition(name="reason-not-given", path="Immunization.explanation.reasonNotGiven", description="Explanation of reason vaccination was not administered", type="token" ) - public static final String SP_REASON_NOT_GIVEN = "reason-not-given"; - /** - * Fluent Client search parameter constant for reason-not-given - *

- * Description: Explanation of reason vaccination was not administered
- * Type: token
- * Path: Immunization.explanation.reasonNotGiven
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REASON_NOT_GIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REASON_NOT_GIVEN); - - /** - * Search parameter: vaccine-code - *

- * Description: Vaccine Product Administered
- * Type: token
- * Path: Immunization.vaccineCode
- *

- */ - @SearchParamDefinition(name="vaccine-code", path="Immunization.vaccineCode", description="Vaccine Product Administered", type="token" ) - public static final String SP_VACCINE_CODE = "vaccine-code"; - /** - * Fluent Client search parameter constant for vaccine-code - *

- * Description: Vaccine Product Administered
- * Type: token
- * Path: Immunization.vaccineCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VACCINE_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VACCINE_CODE); - - /** - * Search parameter: patient - *

- * Description: The patient for the vaccination record
- * Type: reference
- * Path: Immunization.patient
- *

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

- * Description: The patient for the vaccination record
- * Type: reference
- * Path: Immunization.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Immunization:patient").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam LOT_NUMBER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_LOT_NUMBER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization:manufacturer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURER = new ca.uhn.fhir.model.api.Include("Immunization:manufacturer").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Immunization:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Immunization:performer").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Business identifier
- * Type: token
- * Path: Immunization.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Immunization.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Business identifier
- * Type: token
- * Path: Immunization.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java deleted file mode 100644 index 0dc07500a24..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImmunizationRecommendation.java +++ /dev/null @@ -1,1710 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility according to a published schedule) with optional supporting justification. - */ -@ResourceDef(name="ImmunizationRecommendation", profile="http://hl7.org/fhir/Profile/ImmunizationRecommendation") -public class ImmunizationRecommendation extends DomainResource { - - @Block() - public static class ImmunizationRecommendationRecommendationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The date the immunization recommendation was created. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date recommendation created", formalDefinition="The date the immunization recommendation was created." ) - protected DateTimeType date; - - /** - * Vaccine that pertains to the recommendation. - */ - @Child(name = "vaccineCode", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Vaccine recommendation applies to", formalDefinition="Vaccine that pertains to the recommendation." ) - protected CodeableConcept vaccineCode; - - /** - * This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - @Child(name = "doseNumber", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Recommended dose number", formalDefinition="This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose)." ) - protected PositiveIntType doseNumber; - - /** - * Vaccine administration status. - */ - @Child(name = "forecastStatus", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Vaccine administration status", formalDefinition="Vaccine administration status." ) - protected CodeableConcept forecastStatus; - - /** - * Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. - */ - @Child(name = "dateCriterion", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Dates governing proposed immunization", formalDefinition="Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc." ) - protected List dateCriterion; - - /** - * Contains information about the protocol under which the vaccine was administered. - */ - @Child(name = "protocol", type = {}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Protocol used by recommendation", formalDefinition="Contains information about the protocol under which the vaccine was administered." ) - protected ImmunizationRecommendationRecommendationProtocolComponent protocol; - - /** - * Immunization event history that supports the status and recommendation. - */ - @Child(name = "supportingImmunization", type = {Immunization.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Past immunizations supporting recommendation", formalDefinition="Immunization event history that supports the status and recommendation." ) - protected List supportingImmunization; - /** - * The actual objects that are the target of the reference (Immunization event history that supports the status and recommendation.) - */ - protected List supportingImmunizationTarget; - - - /** - * Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information. - */ - @Child(name = "supportingPatientInformation", type = {Observation.class, AllergyIntolerance.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List supportingPatientInformation; - /** - * The actual objects that are the target of the reference (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - protected List supportingPatientInformationTarget; - - - private static final long serialVersionUID = 1501347482L; - - /** - * Constructor - */ - public ImmunizationRecommendationRecommendationComponent() { - super(); - } - - /** - * Constructor - */ - public ImmunizationRecommendationRecommendationComponent(DateTimeType date, CodeableConcept vaccineCode, CodeableConcept forecastStatus) { - super(); - this.date = date; - this.vaccineCode = vaccineCode; - this.forecastStatus = forecastStatus; - } - - /** - * @return {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date the immunization recommendation was created.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date the immunization recommendation was created. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date the immunization recommendation was created. - */ - public ImmunizationRecommendationRecommendationComponent setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #vaccineCode} (Vaccine that pertains to the recommendation.) - */ - public CodeableConcept getVaccineCode() { - if (this.vaccineCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.vaccineCode"); - else if (Configuration.doAutoCreate()) - this.vaccineCode = new CodeableConcept(); // cc - return this.vaccineCode; - } - - public boolean hasVaccineCode() { - return this.vaccineCode != null && !this.vaccineCode.isEmpty(); - } - - /** - * @param value {@link #vaccineCode} (Vaccine that pertains to the recommendation.) - */ - public ImmunizationRecommendationRecommendationComponent setVaccineCode(CodeableConcept value) { - this.vaccineCode = value; - return this; - } - - /** - * @return {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value - */ - public PositiveIntType getDoseNumberElement() { - if (this.doseNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.doseNumber"); - else if (Configuration.doAutoCreate()) - this.doseNumber = new PositiveIntType(); // bb - return this.doseNumber; - } - - public boolean hasDoseNumberElement() { - return this.doseNumber != null && !this.doseNumber.isEmpty(); - } - - public boolean hasDoseNumber() { - return this.doseNumber != null && !this.doseNumber.isEmpty(); - } - - /** - * @param value {@link #doseNumber} (This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).). This is the underlying object with id, value and extensions. The accessor "getDoseNumber" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationComponent setDoseNumberElement(PositiveIntType value) { - this.doseNumber = value; - return this; - } - - /** - * @return This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - public int getDoseNumber() { - return this.doseNumber == null || this.doseNumber.isEmpty() ? 0 : this.doseNumber.getValue(); - } - - /** - * @param value This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose). - */ - public ImmunizationRecommendationRecommendationComponent setDoseNumber(int value) { - if (this.doseNumber == null) - this.doseNumber = new PositiveIntType(); - this.doseNumber.setValue(value); - return this; - } - - /** - * @return {@link #forecastStatus} (Vaccine administration status.) - */ - public CodeableConcept getForecastStatus() { - if (this.forecastStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.forecastStatus"); - else if (Configuration.doAutoCreate()) - this.forecastStatus = new CodeableConcept(); // cc - return this.forecastStatus; - } - - public boolean hasForecastStatus() { - return this.forecastStatus != null && !this.forecastStatus.isEmpty(); - } - - /** - * @param value {@link #forecastStatus} (Vaccine administration status.) - */ - public ImmunizationRecommendationRecommendationComponent setForecastStatus(CodeableConcept value) { - this.forecastStatus = value; - return this; - } - - /** - * @return {@link #dateCriterion} (Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc.) - */ - public List getDateCriterion() { - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - return this.dateCriterion; - } - - public boolean hasDateCriterion() { - if (this.dateCriterion == null) - return false; - for (ImmunizationRecommendationRecommendationDateCriterionComponent item : this.dateCriterion) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dateCriterion} (Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc.) - */ - // syntactic sugar - public ImmunizationRecommendationRecommendationDateCriterionComponent addDateCriterion() { //3 - ImmunizationRecommendationRecommendationDateCriterionComponent t = new ImmunizationRecommendationRecommendationDateCriterionComponent(); - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - this.dateCriterion.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addDateCriterion(ImmunizationRecommendationRecommendationDateCriterionComponent t) { //3 - if (t == null) - return this; - if (this.dateCriterion == null) - this.dateCriterion = new ArrayList(); - this.dateCriterion.add(t); - return this; - } - - /** - * @return {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent getProtocol() { - if (this.protocol == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationComponent.protocol"); - else if (Configuration.doAutoCreate()) - this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); // cc - return this.protocol; - } - - public boolean hasProtocol() { - return this.protocol != null && !this.protocol.isEmpty(); - } - - /** - * @param value {@link #protocol} (Contains information about the protocol under which the vaccine was administered.) - */ - public ImmunizationRecommendationRecommendationComponent setProtocol(ImmunizationRecommendationRecommendationProtocolComponent value) { - this.protocol = value; - return this; - } - - /** - * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) - */ - public List getSupportingImmunization() { - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - return this.supportingImmunization; - } - - public boolean hasSupportingImmunization() { - if (this.supportingImmunization == null) - return false; - for (Reference item : this.supportingImmunization) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingImmunization} (Immunization event history that supports the status and recommendation.) - */ - // syntactic sugar - public Reference addSupportingImmunization() { //3 - Reference t = new Reference(); - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - this.supportingImmunization.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addSupportingImmunization(Reference t) { //3 - if (t == null) - return this; - if (this.supportingImmunization == null) - this.supportingImmunization = new ArrayList(); - this.supportingImmunization.add(t); - return this; - } - - /** - * @return {@link #supportingImmunization} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Immunization event history that supports the status and recommendation.) - */ - public List getSupportingImmunizationTarget() { - if (this.supportingImmunizationTarget == null) - this.supportingImmunizationTarget = new ArrayList(); - return this.supportingImmunizationTarget; - } - - // syntactic sugar - /** - * @return {@link #supportingImmunization} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Immunization event history that supports the status and recommendation.) - */ - public Immunization addSupportingImmunizationTarget() { - Immunization r = new Immunization(); - if (this.supportingImmunizationTarget == null) - this.supportingImmunizationTarget = new ArrayList(); - this.supportingImmunizationTarget.add(r); - return r; - } - - /** - * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - public List getSupportingPatientInformation() { - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - return this.supportingPatientInformation; - } - - public boolean hasSupportingPatientInformation() { - if (this.supportingPatientInformation == null) - return false; - for (Reference item : this.supportingPatientInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingPatientInformation} (Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - // syntactic sugar - public Reference addSupportingPatientInformation() { //3 - Reference t = new Reference(); - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - this.supportingPatientInformation.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addSupportingPatientInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingPatientInformation == null) - this.supportingPatientInformation = new ArrayList(); - this.supportingPatientInformation.add(t); - return this; - } - - /** - * @return {@link #supportingPatientInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.) - */ - public List getSupportingPatientInformationTarget() { - if (this.supportingPatientInformationTarget == null) - this.supportingPatientInformationTarget = new ArrayList(); - return this.supportingPatientInformationTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("date", "dateTime", "The date the immunization recommendation was created.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("vaccineCode", "CodeableConcept", "Vaccine that pertains to the recommendation.", 0, java.lang.Integer.MAX_VALUE, vaccineCode)); - childrenList.add(new Property("doseNumber", "positiveInt", "This indicates the next recommended dose number (e.g. dose 2 is the next recommended dose).", 0, java.lang.Integer.MAX_VALUE, doseNumber)); - childrenList.add(new Property("forecastStatus", "CodeableConcept", "Vaccine administration status.", 0, java.lang.Integer.MAX_VALUE, forecastStatus)); - childrenList.add(new Property("dateCriterion", "", "Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc.", 0, java.lang.Integer.MAX_VALUE, dateCriterion)); - childrenList.add(new Property("protocol", "", "Contains information about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, protocol)); - childrenList.add(new Property("supportingImmunization", "Reference(Immunization)", "Immunization event history that supports the status and recommendation.", 0, java.lang.Integer.MAX_VALUE, supportingImmunization)); - childrenList.add(new Property("supportingPatientInformation", "Reference(Observation|AllergyIntolerance)", "Patient Information that supports the status and recommendation. This includes patient observations, adverse reactions and allergy/intolerance information.", 0, java.lang.Integer.MAX_VALUE, supportingPatientInformation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 664556354: /*vaccineCode*/ return this.vaccineCode == null ? new Base[0] : new Base[] {this.vaccineCode}; // CodeableConcept - case -887709242: /*doseNumber*/ return this.doseNumber == null ? new Base[0] : new Base[] {this.doseNumber}; // PositiveIntType - case 1904598477: /*forecastStatus*/ return this.forecastStatus == null ? new Base[0] : new Base[] {this.forecastStatus}; // CodeableConcept - case 2087518867: /*dateCriterion*/ return this.dateCriterion == null ? new Base[0] : this.dateCriterion.toArray(new Base[this.dateCriterion.size()]); // ImmunizationRecommendationRecommendationDateCriterionComponent - case -989163880: /*protocol*/ return this.protocol == null ? new Base[0] : new Base[] {this.protocol}; // ImmunizationRecommendationRecommendationProtocolComponent - case 1171592021: /*supportingImmunization*/ return this.supportingImmunization == null ? new Base[0] : this.supportingImmunization.toArray(new Base[this.supportingImmunization.size()]); // Reference - case -1234160646: /*supportingPatientInformation*/ return this.supportingPatientInformation == null ? new Base[0] : this.supportingPatientInformation.toArray(new Base[this.supportingPatientInformation.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 664556354: // vaccineCode - this.vaccineCode = castToCodeableConcept(value); // CodeableConcept - break; - case -887709242: // doseNumber - this.doseNumber = castToPositiveInt(value); // PositiveIntType - break; - case 1904598477: // forecastStatus - this.forecastStatus = castToCodeableConcept(value); // CodeableConcept - break; - case 2087518867: // dateCriterion - this.getDateCriterion().add((ImmunizationRecommendationRecommendationDateCriterionComponent) value); // ImmunizationRecommendationRecommendationDateCriterionComponent - break; - case -989163880: // protocol - this.protocol = (ImmunizationRecommendationRecommendationProtocolComponent) value; // ImmunizationRecommendationRecommendationProtocolComponent - break; - case 1171592021: // supportingImmunization - this.getSupportingImmunization().add(castToReference(value)); // Reference - break; - case -1234160646: // supportingPatientInformation - this.getSupportingPatientInformation().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("vaccineCode")) - this.vaccineCode = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("doseNumber")) - this.doseNumber = castToPositiveInt(value); // PositiveIntType - else if (name.equals("forecastStatus")) - this.forecastStatus = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("dateCriterion")) - this.getDateCriterion().add((ImmunizationRecommendationRecommendationDateCriterionComponent) value); - else if (name.equals("protocol")) - this.protocol = (ImmunizationRecommendationRecommendationProtocolComponent) value; // ImmunizationRecommendationRecommendationProtocolComponent - else if (name.equals("supportingImmunization")) - this.getSupportingImmunization().add(castToReference(value)); - else if (name.equals("supportingPatientInformation")) - this.getSupportingPatientInformation().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 664556354: return getVaccineCode(); // CodeableConcept - case -887709242: throw new FHIRException("Cannot make property doseNumber as it is not a complex type"); // PositiveIntType - case 1904598477: return getForecastStatus(); // CodeableConcept - case 2087518867: return addDateCriterion(); // ImmunizationRecommendationRecommendationDateCriterionComponent - case -989163880: return getProtocol(); // ImmunizationRecommendationRecommendationProtocolComponent - case 1171592021: return addSupportingImmunization(); // Reference - case -1234160646: return addSupportingPatientInformation(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.date"); - } - else if (name.equals("vaccineCode")) { - this.vaccineCode = new CodeableConcept(); - return this.vaccineCode; - } - else if (name.equals("doseNumber")) { - throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.doseNumber"); - } - else if (name.equals("forecastStatus")) { - this.forecastStatus = new CodeableConcept(); - return this.forecastStatus; - } - else if (name.equals("dateCriterion")) { - return addDateCriterion(); - } - else if (name.equals("protocol")) { - this.protocol = new ImmunizationRecommendationRecommendationProtocolComponent(); - return this.protocol; - } - else if (name.equals("supportingImmunization")) { - return addSupportingImmunization(); - } - else if (name.equals("supportingPatientInformation")) { - return addSupportingPatientInformation(); - } - else - return super.addChild(name); - } - - public ImmunizationRecommendationRecommendationComponent copy() { - ImmunizationRecommendationRecommendationComponent dst = new ImmunizationRecommendationRecommendationComponent(); - copyValues(dst); - dst.date = date == null ? null : date.copy(); - dst.vaccineCode = vaccineCode == null ? null : vaccineCode.copy(); - dst.doseNumber = doseNumber == null ? null : doseNumber.copy(); - dst.forecastStatus = forecastStatus == null ? null : forecastStatus.copy(); - if (dateCriterion != null) { - dst.dateCriterion = new ArrayList(); - for (ImmunizationRecommendationRecommendationDateCriterionComponent i : dateCriterion) - dst.dateCriterion.add(i.copy()); - }; - dst.protocol = protocol == null ? null : protocol.copy(); - if (supportingImmunization != null) { - dst.supportingImmunization = new ArrayList(); - for (Reference i : supportingImmunization) - dst.supportingImmunization.add(i.copy()); - }; - if (supportingPatientInformation != null) { - dst.supportingPatientInformation = new ArrayList(); - for (Reference i : supportingPatientInformation) - dst.supportingPatientInformation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) - return false; - ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; - return compareDeep(date, o.date, true) && compareDeep(vaccineCode, o.vaccineCode, true) && compareDeep(doseNumber, o.doseNumber, true) - && compareDeep(forecastStatus, o.forecastStatus, true) && compareDeep(dateCriterion, o.dateCriterion, true) - && compareDeep(protocol, o.protocol, true) && compareDeep(supportingImmunization, o.supportingImmunization, true) - && compareDeep(supportingPatientInformation, o.supportingPatientInformation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationComponent)) - return false; - ImmunizationRecommendationRecommendationComponent o = (ImmunizationRecommendationRecommendationComponent) other; - return compareValues(date, o.date, true) && compareValues(doseNumber, o.doseNumber, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (date == null || date.isEmpty()) && (vaccineCode == null || vaccineCode.isEmpty()) - && (doseNumber == null || doseNumber.isEmpty()) && (forecastStatus == null || forecastStatus.isEmpty()) - && (dateCriterion == null || dateCriterion.isEmpty()) && (protocol == null || protocol.isEmpty()) - && (supportingImmunization == null || supportingImmunization.isEmpty()) && (supportingPatientInformation == null || supportingPatientInformation.isEmpty()) - ; - } - - public String fhirType() { - return "ImmunizationRecommendation.recommendation"; - - } - - } - - @Block() - public static class ImmunizationRecommendationRecommendationDateCriterionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Date classification of recommendation. For example, earliest date to give, latest date to give, etc. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type of date", formalDefinition="Date classification of recommendation. For example, earliest date to give, latest date to give, etc." ) - protected CodeableConcept code; - - /** - * The date whose meaning is specified by dateCriterion.code. - */ - @Child(name = "value", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Recommended date", formalDefinition="The date whose meaning is specified by dateCriterion.code." ) - protected DateTimeType value; - - private static final long serialVersionUID = 1036994566L; - - /** - * Constructor - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent() { - super(); - } - - /** - * Constructor - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent(CodeableConcept code, DateTimeType value) { - super(); - this.code = code; - this.value = value; - } - - /** - * @return {@link #code} (Date classification of recommendation. For example, earliest date to give, latest date to give, etc.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Date classification of recommendation. For example, earliest date to give, latest date to give, etc.) - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (The date whose meaning is specified by dateCriterion.code.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DateTimeType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationDateCriterionComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new DateTimeType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The date whose meaning is specified by dateCriterion.code.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValueElement(DateTimeType value) { - this.value = value; - return this; - } - - /** - * @return The date whose meaning is specified by dateCriterion.code. - */ - public Date getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The date whose meaning is specified by dateCriterion.code. - */ - public ImmunizationRecommendationRecommendationDateCriterionComponent setValue(Date value) { - if (this.value == null) - this.value = new DateTimeType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Date classification of recommendation. For example, earliest date to give, latest date to give, etc.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value", "dateTime", "The date whose meaning is specified by dateCriterion.code.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DateTimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 111972721: // value - this.value = castToDateTime(value); // DateTimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("value")) - this.value = castToDateTime(value); // DateTimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DateTimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.value"); - } - else - return super.addChild(name); - } - - public ImmunizationRecommendationRecommendationDateCriterionComponent copy() { - ImmunizationRecommendationRecommendationDateCriterionComponent dst = new ImmunizationRecommendationRecommendationDateCriterionComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) - return false; - ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationDateCriterionComponent)) - return false; - ImmunizationRecommendationRecommendationDateCriterionComponent o = (ImmunizationRecommendationRecommendationDateCriterionComponent) other; - return compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "ImmunizationRecommendation.recommendation.dateCriterion"; - - } - - } - - @Block() - public static class ImmunizationRecommendationRecommendationProtocolComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - @Child(name = "doseSequence", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Dose number 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." ) - protected IntegerType doseSequence; - - /** - * Contains the description about the protocol under which the vaccine was administered. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Protocol details", formalDefinition="Contains the description about the protocol under which the vaccine was administered." ) - protected StringType description; - - /** - * Indicates the authority who published the protocol. For example, ACIP. - */ - @Child(name = "authority", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who is responsible for protocol", formalDefinition="Indicates the authority who published the protocol. For example, ACIP." ) - protected Reference authority; - - /** - * The actual object that is the target of the reference (Indicates the authority who published the protocol. For example, ACIP.) - */ - protected Organization authorityTarget; - - /** - * One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - @Child(name = "series", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of vaccination series", formalDefinition="One possible path to achieve presumed immunity against a disease - within the context of an authority." ) - protected StringType series; - - private static final long serialVersionUID = -512702014L; - - /** - * Constructor - */ - public ImmunizationRecommendationRecommendationProtocolComponent() { - super(); - } - - /** - * @return {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public IntegerType getDoseSequenceElement() { - if (this.doseSequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.doseSequence"); - else if (Configuration.doAutoCreate()) - this.doseSequence = new IntegerType(); // bb - return this.doseSequence; - } - - public boolean hasDoseSequenceElement() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - public boolean hasDoseSequence() { - return this.doseSequence != null && !this.doseSequence.isEmpty(); - } - - /** - * @param value {@link #doseSequence} (Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.). This is the underlying object with id, value and extensions. The accessor "getDoseSequence" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequenceElement(IntegerType value) { - this.doseSequence = value; - return this; - } - - /** - * @return Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - public int getDoseSequence() { - return this.doseSequence == null || this.doseSequence.isEmpty() ? 0 : this.doseSequence.getValue(); - } - - /** - * @param value Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDoseSequence(int value) { - if (this.doseSequence == null) - this.doseSequence = new IntegerType(); - this.doseSequence.setValue(value); - return this; - } - - /** - * @return {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Contains the description about the protocol under which the vaccine was administered.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Contains the description about the protocol under which the vaccine was administered. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Contains the description about the protocol under which the vaccine was administered. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #authority} (Indicates the authority who published the protocol. For example, ACIP.) - */ - public Reference getAuthority() { - if (this.authority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authority = new Reference(); // cc - return this.authority; - } - - public boolean hasAuthority() { - return this.authority != null && !this.authority.isEmpty(); - } - - /** - * @param value {@link #authority} (Indicates the authority who published the protocol. For example, ACIP.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent setAuthority(Reference value) { - this.authority = value; - return this; - } - - /** - * @return {@link #authority} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol. For example, ACIP.) - */ - public Organization getAuthorityTarget() { - if (this.authorityTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.authority"); - else if (Configuration.doAutoCreate()) - this.authorityTarget = new Organization(); // aa - return this.authorityTarget; - } - - /** - * @param value {@link #authority} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the authority who published the protocol. For example, ACIP.) - */ - public ImmunizationRecommendationRecommendationProtocolComponent setAuthorityTarget(Organization value) { - this.authorityTarget = value; - return this; - } - - /** - * @return {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public StringType getSeriesElement() { - if (this.series == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendationRecommendationProtocolComponent.series"); - else if (Configuration.doAutoCreate()) - this.series = new StringType(); // bb - return this.series; - } - - public boolean hasSeriesElement() { - return this.series != null && !this.series.isEmpty(); - } - - public boolean hasSeries() { - return this.series != null && !this.series.isEmpty(); - } - - /** - * @param value {@link #series} (One possible path to achieve presumed immunity against a disease - within the context of an authority.). This is the underlying object with id, value and extensions. The accessor "getSeries" gives direct access to the value - */ - public ImmunizationRecommendationRecommendationProtocolComponent setSeriesElement(StringType value) { - this.series = value; - return this; - } - - /** - * @return One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public String getSeries() { - return this.series == null ? null : this.series.getValue(); - } - - /** - * @param value One possible path to achieve presumed immunity against a disease - within the context of an authority. - */ - public ImmunizationRecommendationRecommendationProtocolComponent setSeries(String value) { - if (Utilities.noString(value)) - this.series = null; - else { - if (this.series == null) - this.series = new StringType(); - this.series.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("doseSequence", "integer", "Indicates the nominal position in a series of the next dose. This is the recommended dose number as per a specified protocol.", 0, java.lang.Integer.MAX_VALUE, doseSequence)); - childrenList.add(new Property("description", "string", "Contains the description about the protocol under which the vaccine was administered.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("authority", "Reference(Organization)", "Indicates the authority who published the protocol. For example, ACIP.", 0, java.lang.Integer.MAX_VALUE, authority)); - childrenList.add(new Property("series", "string", "One possible path to achieve presumed immunity against a disease - within the context of an authority.", 0, java.lang.Integer.MAX_VALUE, series)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 550933246: /*doseSequence*/ return this.doseSequence == null ? new Base[0] : new Base[] {this.doseSequence}; // IntegerType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1475610435: /*authority*/ return this.authority == null ? new Base[0] : new Base[] {this.authority}; // Reference - case -905838985: /*series*/ return this.series == null ? new Base[0] : new Base[] {this.series}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 550933246: // doseSequence - this.doseSequence = castToInteger(value); // IntegerType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 1475610435: // authority - this.authority = castToReference(value); // Reference - break; - case -905838985: // series - this.series = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("doseSequence")) - this.doseSequence = castToInteger(value); // IntegerType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("authority")) - this.authority = castToReference(value); // Reference - else if (name.equals("series")) - this.series = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 550933246: throw new FHIRException("Cannot make property doseSequence as it is not a complex type"); // IntegerType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1475610435: return getAuthority(); // Reference - case -905838985: throw new FHIRException("Cannot make property series as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("doseSequence")) { - throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.doseSequence"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.description"); - } - else if (name.equals("authority")) { - this.authority = new Reference(); - return this.authority; - } - else if (name.equals("series")) { - throw new FHIRException("Cannot call addChild on a primitive type ImmunizationRecommendation.series"); - } - else - return super.addChild(name); - } - - public ImmunizationRecommendationRecommendationProtocolComponent copy() { - ImmunizationRecommendationRecommendationProtocolComponent dst = new ImmunizationRecommendationRecommendationProtocolComponent(); - copyValues(dst); - dst.doseSequence = doseSequence == null ? null : doseSequence.copy(); - dst.description = description == null ? null : description.copy(); - dst.authority = authority == null ? null : authority.copy(); - dst.series = series == null ? null : series.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) - return false; - ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; - return compareDeep(doseSequence, o.doseSequence, true) && compareDeep(description, o.description, true) - && compareDeep(authority, o.authority, true) && compareDeep(series, o.series, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendationRecommendationProtocolComponent)) - return false; - ImmunizationRecommendationRecommendationProtocolComponent o = (ImmunizationRecommendationRecommendationProtocolComponent) other; - return compareValues(doseSequence, o.doseSequence, true) && compareValues(description, o.description, true) - && compareValues(series, o.series, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (doseSequence == null || doseSequence.isEmpty()) && (description == null || description.isEmpty()) - && (authority == null || authority.isEmpty()) && (series == null || series.isEmpty()); - } - - public String fhirType() { - return "ImmunizationRecommendation.recommendation.protocol"; - - } - - } - - /** - * A unique identifier assigned to this particular recommendation record. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business identifier", formalDefinition="A unique identifier assigned to this particular recommendation record." ) - protected List identifier; - - /** - * The patient for whom the recommendations are for. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who this profile is for", formalDefinition="The patient for whom the recommendations are for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient for whom the recommendations are for.) - */ - protected Patient patientTarget; - - /** - * Vaccine administration recommendations. - */ - @Child(name = "recommendation", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Vaccine administration recommendations", formalDefinition="Vaccine administration recommendations." ) - protected List recommendation; - - private static final long serialVersionUID = 641058495L; - - /** - * Constructor - */ - public ImmunizationRecommendation() { - super(); - } - - /** - * Constructor - */ - public ImmunizationRecommendation(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier assigned to this particular recommendation record.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendation addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient for whom the recommendations are for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient for whom the recommendations are for.) - */ - public ImmunizationRecommendation setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient for whom the recommendations are for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImmunizationRecommendation.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient for whom the recommendations are for.) - */ - public ImmunizationRecommendation setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #recommendation} (Vaccine administration recommendations.) - */ - public List getRecommendation() { - if (this.recommendation == null) - this.recommendation = new ArrayList(); - return this.recommendation; - } - - public boolean hasRecommendation() { - if (this.recommendation == null) - return false; - for (ImmunizationRecommendationRecommendationComponent item : this.recommendation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recommendation} (Vaccine administration recommendations.) - */ - // syntactic sugar - public ImmunizationRecommendationRecommendationComponent addRecommendation() { //3 - ImmunizationRecommendationRecommendationComponent t = new ImmunizationRecommendationRecommendationComponent(); - if (this.recommendation == null) - this.recommendation = new ArrayList(); - this.recommendation.add(t); - return t; - } - - // syntactic sugar - public ImmunizationRecommendation addRecommendation(ImmunizationRecommendationRecommendationComponent t) { //3 - if (t == null) - return this; - if (this.recommendation == null) - this.recommendation = new ArrayList(); - this.recommendation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier assigned to this particular recommendation record.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient for whom the recommendations are for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("recommendation", "", "Vaccine administration recommendations.", 0, java.lang.Integer.MAX_VALUE, recommendation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1028636743: /*recommendation*/ return this.recommendation == null ? new Base[0] : this.recommendation.toArray(new Base[this.recommendation.size()]); // ImmunizationRecommendationRecommendationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1028636743: // recommendation - this.getRecommendation().add((ImmunizationRecommendationRecommendationComponent) value); // ImmunizationRecommendationRecommendationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("recommendation")) - this.getRecommendation().add((ImmunizationRecommendationRecommendationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -791418107: return getPatient(); // Reference - case -1028636743: return addRecommendation(); // ImmunizationRecommendationRecommendationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("recommendation")) { - return addRecommendation(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ImmunizationRecommendation"; - - } - - public ImmunizationRecommendation copy() { - ImmunizationRecommendation dst = new ImmunizationRecommendation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - if (recommendation != null) { - dst.recommendation = new ArrayList(); - for (ImmunizationRecommendationRecommendationComponent i : recommendation) - dst.recommendation.add(i.copy()); - }; - return dst; - } - - protected ImmunizationRecommendation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImmunizationRecommendation)) - return false; - ImmunizationRecommendation o = (ImmunizationRecommendation) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(recommendation, o.recommendation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImmunizationRecommendation)) - return false; - ImmunizationRecommendation o = (ImmunizationRecommendation) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (recommendation == null || recommendation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImmunizationRecommendation; - } - - /** - * Search parameter: information - *

- * Description: Patient observations supporting recommendation
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingPatientInformation
- *

- */ - @SearchParamDefinition(name="information", path="ImmunizationRecommendation.recommendation.supportingPatientInformation", description="Patient observations supporting recommendation", type="reference" ) - public static final String SP_INFORMATION = "information"; - /** - * Fluent Client search parameter constant for information - *

- * Description: Patient observations supporting recommendation
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingPatientInformation
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INFORMATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INFORMATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImmunizationRecommendation:information". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_INFORMATION = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:information").toLocked(); - - /** - * Search parameter: dose-sequence - *

- * Description: Dose number within sequence
- * Type: number
- * Path: ImmunizationRecommendation.recommendation.protocol.doseSequence
- *

- */ - @SearchParamDefinition(name="dose-sequence", path="ImmunizationRecommendation.recommendation.protocol.doseSequence", description="Dose number within sequence", type="number" ) - public static final String SP_DOSE_SEQUENCE = "dose-sequence"; - /** - * Fluent Client search parameter constant for dose-sequence - *

- * Description: Dose number within sequence
- * Type: number
- * Path: ImmunizationRecommendation.recommendation.protocol.doseSequence
- *

- */ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam DOSE_SEQUENCE = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DOSE_SEQUENCE); - - /** - * Search parameter: patient - *

- * Description: Who this profile is for
- * Type: reference
- * Path: ImmunizationRecommendation.patient
- *

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

- * Description: Who this profile is for
- * Type: reference
- * Path: ImmunizationRecommendation.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImmunizationRecommendation:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:patient").toLocked(); - - /** - * Search parameter: support - *

- * Description: Past immunizations supporting recommendation
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingImmunization
- *

- */ - @SearchParamDefinition(name="support", path="ImmunizationRecommendation.recommendation.supportingImmunization", description="Past immunizations supporting recommendation", type="reference" ) - public static final String SP_SUPPORT = "support"; - /** - * Fluent Client search parameter constant for support - *

- * Description: Past immunizations supporting recommendation
- * Type: reference
- * Path: ImmunizationRecommendation.recommendation.supportingImmunization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPORT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPORT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImmunizationRecommendation:support". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPORT = new ca.uhn.fhir.model.api.Include("ImmunizationRecommendation:support").toLocked(); - - /** - * Search parameter: vaccine-type - *

- * Description: Vaccine recommendation applies to
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.vaccineCode
- *

- */ - @SearchParamDefinition(name="vaccine-type", path="ImmunizationRecommendation.recommendation.vaccineCode", description="Vaccine recommendation applies to", type="token" ) - public static final String SP_VACCINE_TYPE = "vaccine-type"; - /** - * Fluent Client search parameter constant for vaccine-type - *

- * Description: Vaccine recommendation applies to
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.vaccineCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VACCINE_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VACCINE_TYPE); - - /** - * Search parameter: status - *

- * Description: Vaccine administration status
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.forecastStatus
- *

- */ - @SearchParamDefinition(name="status", path="ImmunizationRecommendation.recommendation.forecastStatus", description="Vaccine administration status", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: Vaccine administration status
- * Type: token
- * Path: ImmunizationRecommendation.recommendation.forecastStatus
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: dose-number - *

- * Description: Recommended dose number
- * Type: number
- * Path: ImmunizationRecommendation.recommendation.doseNumber
- *

- */ - @SearchParamDefinition(name="dose-number", path="ImmunizationRecommendation.recommendation.doseNumber", description="Recommended dose number", type="number" ) - public static final String SP_DOSE_NUMBER = "dose-number"; - /** - * Fluent Client search parameter constant for dose-number - *

- * Description: Recommended dose number
- * Type: number
- * Path: ImmunizationRecommendation.recommendation.doseNumber
- *

- */ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam DOSE_NUMBER = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_DOSE_NUMBER); - - /** - * Search parameter: date - *

- * Description: Date recommendation created
- * Type: date
- * Path: ImmunizationRecommendation.recommendation.date
- *

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

- * Description: Date recommendation created
- * Type: date
- * Path: ImmunizationRecommendation.recommendation.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: Business identifier
- * Type: token
- * Path: ImmunizationRecommendation.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ImmunizationRecommendation.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Business identifier
- * Type: token
- * Path: ImmunizationRecommendation.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java deleted file mode 100644 index baf216d9807..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ImplementationGuide.java +++ /dev/null @@ -1,3830 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an implementation guide into a logical whole, and to publish a computable definition of all the parts. - */ -@ResourceDef(name="ImplementationGuide", profile="http://hl7.org/fhir/Profile/ImplementationGuide") -public class ImplementationGuide extends DomainResource { - - public enum GuideDependencyType { - /** - * The guide is referred to by URL. - */ - REFERENCE, - /** - * The guide is embedded in this guide when published. - */ - INCLUSION, - /** - * added to help the parsers - */ - NULL; - public static GuideDependencyType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("reference".equals(codeString)) - return REFERENCE; - if ("inclusion".equals(codeString)) - return INCLUSION; - throw new FHIRException("Unknown GuideDependencyType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REFERENCE: return "reference"; - case INCLUSION: return "inclusion"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REFERENCE: return "http://hl7.org/fhir/guide-dependency-type"; - case INCLUSION: return "http://hl7.org/fhir/guide-dependency-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REFERENCE: return "The guide is referred to by URL."; - case INCLUSION: return "The guide is embedded in this guide when published."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REFERENCE: return "Reference"; - case INCLUSION: return "Inclusion"; - default: return "?"; - } - } - } - - public static class GuideDependencyTypeEnumFactory implements EnumFactory { - public GuideDependencyType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("reference".equals(codeString)) - return GuideDependencyType.REFERENCE; - if ("inclusion".equals(codeString)) - return GuideDependencyType.INCLUSION; - throw new IllegalArgumentException("Unknown GuideDependencyType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("reference".equals(codeString)) - return new Enumeration(this, GuideDependencyType.REFERENCE); - if ("inclusion".equals(codeString)) - return new Enumeration(this, GuideDependencyType.INCLUSION); - throw new FHIRException("Unknown GuideDependencyType code '"+codeString+"'"); - } - public String toCode(GuideDependencyType code) { - if (code == GuideDependencyType.REFERENCE) - return "reference"; - if (code == GuideDependencyType.INCLUSION) - return "inclusion"; - return "?"; - } - public String toSystem(GuideDependencyType code) { - return code.getSystem(); - } - } - - public enum GuidePageKind { - /** - * This is a page of content that is included in the implementation guide. It has no particular function. - */ - PAGE, - /** - * This is a page that represents a human readable rendering of an example. - */ - EXAMPLE, - /** - * This is a page that represents a list of resources of one or more types. - */ - LIST, - /** - * This is a page showing where an included guide is injected. - */ - INCLUDE, - /** - * This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section. - */ - DIRECTORY, - /** - * This is a page that creates the listed resources as a dictionary. - */ - DICTIONARY, - /** - * This is a generated page that contains the table of contents. - */ - TOC, - /** - * This is a page that represents a presented resource. This is typically used for generated conformance resource presentations. - */ - RESOURCE, - /** - * added to help the parsers - */ - NULL; - public static GuidePageKind fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("page".equals(codeString)) - return PAGE; - if ("example".equals(codeString)) - return EXAMPLE; - if ("list".equals(codeString)) - return LIST; - if ("include".equals(codeString)) - return INCLUDE; - if ("directory".equals(codeString)) - return DIRECTORY; - if ("dictionary".equals(codeString)) - return DICTIONARY; - if ("toc".equals(codeString)) - return TOC; - if ("resource".equals(codeString)) - return RESOURCE; - throw new FHIRException("Unknown GuidePageKind code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PAGE: return "page"; - case EXAMPLE: return "example"; - case LIST: return "list"; - case INCLUDE: return "include"; - case DIRECTORY: return "directory"; - case DICTIONARY: return "dictionary"; - case TOC: return "toc"; - case RESOURCE: return "resource"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PAGE: return "http://hl7.org/fhir/guide-page-kind"; - case EXAMPLE: return "http://hl7.org/fhir/guide-page-kind"; - case LIST: return "http://hl7.org/fhir/guide-page-kind"; - case INCLUDE: return "http://hl7.org/fhir/guide-page-kind"; - case DIRECTORY: return "http://hl7.org/fhir/guide-page-kind"; - case DICTIONARY: return "http://hl7.org/fhir/guide-page-kind"; - case TOC: return "http://hl7.org/fhir/guide-page-kind"; - case RESOURCE: return "http://hl7.org/fhir/guide-page-kind"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PAGE: return "This is a page of content that is included in the implementation guide. It has no particular function."; - case EXAMPLE: return "This is a page that represents a human readable rendering of an example."; - case LIST: return "This is a page that represents a list of resources of one or more types."; - case INCLUDE: return "This is a page showing where an included guide is injected."; - case DIRECTORY: return "This is a page that lists the resources of a given type, and also creates pages for all the listed types as other pages in the section."; - case DICTIONARY: return "This is a page that creates the listed resources as a dictionary."; - case TOC: return "This is a generated page that contains the table of contents."; - case RESOURCE: return "This is a page that represents a presented resource. This is typically used for generated conformance resource presentations."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PAGE: return "Page"; - case EXAMPLE: return "Example"; - case LIST: return "List"; - case INCLUDE: return "Include"; - case DIRECTORY: return "Directory"; - case DICTIONARY: return "Dictionary"; - case TOC: return "Table Of Contents"; - case RESOURCE: return "Resource"; - default: return "?"; - } - } - } - - public static class GuidePageKindEnumFactory implements EnumFactory { - public GuidePageKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("page".equals(codeString)) - return GuidePageKind.PAGE; - if ("example".equals(codeString)) - return GuidePageKind.EXAMPLE; - if ("list".equals(codeString)) - return GuidePageKind.LIST; - if ("include".equals(codeString)) - return GuidePageKind.INCLUDE; - if ("directory".equals(codeString)) - return GuidePageKind.DIRECTORY; - if ("dictionary".equals(codeString)) - return GuidePageKind.DICTIONARY; - if ("toc".equals(codeString)) - return GuidePageKind.TOC; - if ("resource".equals(codeString)) - return GuidePageKind.RESOURCE; - throw new IllegalArgumentException("Unknown GuidePageKind code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("page".equals(codeString)) - return new Enumeration(this, GuidePageKind.PAGE); - if ("example".equals(codeString)) - return new Enumeration(this, GuidePageKind.EXAMPLE); - if ("list".equals(codeString)) - return new Enumeration(this, GuidePageKind.LIST); - if ("include".equals(codeString)) - return new Enumeration(this, GuidePageKind.INCLUDE); - if ("directory".equals(codeString)) - return new Enumeration(this, GuidePageKind.DIRECTORY); - if ("dictionary".equals(codeString)) - return new Enumeration(this, GuidePageKind.DICTIONARY); - if ("toc".equals(codeString)) - return new Enumeration(this, GuidePageKind.TOC); - if ("resource".equals(codeString)) - return new Enumeration(this, GuidePageKind.RESOURCE); - throw new FHIRException("Unknown GuidePageKind code '"+codeString+"'"); - } - public String toCode(GuidePageKind code) { - if (code == GuidePageKind.PAGE) - return "page"; - if (code == GuidePageKind.EXAMPLE) - return "example"; - if (code == GuidePageKind.LIST) - return "list"; - if (code == GuidePageKind.INCLUDE) - return "include"; - if (code == GuidePageKind.DIRECTORY) - return "directory"; - if (code == GuidePageKind.DICTIONARY) - return "dictionary"; - if (code == GuidePageKind.TOC) - return "toc"; - if (code == GuidePageKind.RESOURCE) - return "resource"; - return "?"; - } - public String toSystem(GuidePageKind code) { - return code.getSystem(); - } - } - - @Block() - public static class ImplementationGuideContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the implementation guide. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the implementation guide." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ImplementationGuideContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuideContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ImplementationGuideContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the implementation guide. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the implementation guide. - */ - public ImplementationGuideContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuideContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the implementation guide.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ImplementationGuideContactComponent copy() { - ImplementationGuideContactComponent dst = new ImplementationGuideContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuideContactComponent)) - return false; - ImplementationGuideContactComponent o = (ImplementationGuideContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuideContactComponent)) - return false; - ImplementationGuideContactComponent o = (ImplementationGuideContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "ImplementationGuide.contact"; - - } - - } - - @Block() - public static class ImplementationGuideDependencyComponent extends BackboneElement implements IBaseBackboneElement { - /** - * How the dependency is represented when the guide is published. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="reference | inclusion", formalDefinition="How the dependency is represented when the guide is published." ) - protected Enumeration type; - - /** - * Where the dependency is located. - */ - @Child(name = "uri", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where to find dependency", formalDefinition="Where the dependency is located." ) - protected UriType uri; - - private static final long serialVersionUID = 162447098L; - - /** - * Constructor - */ - public ImplementationGuideDependencyComponent() { - super(); - } - - /** - * Constructor - */ - public ImplementationGuideDependencyComponent(Enumeration type, UriType uri) { - super(); - this.type = type; - this.uri = uri; - } - - /** - * @return {@link #type} (How the dependency is represented when the guide is published.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuideDependencyComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new GuideDependencyTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (How the dependency is represented when the guide is published.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ImplementationGuideDependencyComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return How the dependency is represented when the guide is published. - */ - public GuideDependencyType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value How the dependency is represented when the guide is published. - */ - public ImplementationGuideDependencyComponent setType(GuideDependencyType value) { - if (this.type == null) - this.type = new Enumeration(new GuideDependencyTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #uri} (Where the dependency is located.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuideDependencyComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); // bb - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (Where the dependency is located.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public ImplementationGuideDependencyComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return Where the dependency is located. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value Where the dependency is located. - */ - public ImplementationGuideDependencyComponent setUri(String value) { - if (this.uri == null) - this.uri = new UriType(); - this.uri.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "How the dependency is represented when the guide is published.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("uri", "uri", "Where the dependency is located.", 0, java.lang.Integer.MAX_VALUE, uri)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new GuideDependencyTypeEnumFactory().fromType(value); // Enumeration - break; - case 116076: // uri - this.uri = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new GuideDependencyTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("uri")) - this.uri = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 116076: throw new FHIRException("Cannot make property uri as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type"); - } - else if (name.equals("uri")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.uri"); - } - else - return super.addChild(name); - } - - public ImplementationGuideDependencyComponent copy() { - ImplementationGuideDependencyComponent dst = new ImplementationGuideDependencyComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.uri = uri == null ? null : uri.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuideDependencyComponent)) - return false; - ImplementationGuideDependencyComponent o = (ImplementationGuideDependencyComponent) other; - return compareDeep(type, o.type, true) && compareDeep(uri, o.uri, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuideDependencyComponent)) - return false; - ImplementationGuideDependencyComponent o = (ImplementationGuideDependencyComponent) other; - return compareValues(type, o.type, true) && compareValues(uri, o.uri, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (uri == null || uri.isEmpty()) - ; - } - - public String fhirType() { - return "ImplementationGuide.dependency"; - - } - - } - - @Block() - public static class ImplementationGuidePackageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name for the group, as used in page.package. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name used .page.package", formalDefinition="The name for the group, as used in page.package." ) - protected StringType name; - - /** - * Human readable text describing the package. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Human readable text describing the package", formalDefinition="Human readable text describing the package." ) - protected StringType description; - - /** - * A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. - */ - @Child(name = "resource", type = {}, order=3, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Resource in the implementation guide", formalDefinition="A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource." ) - protected List resource; - - private static final long serialVersionUID = -701846580L; - - /** - * Constructor - */ - public ImplementationGuidePackageComponent() { - super(); - } - - /** - * Constructor - */ - public ImplementationGuidePackageComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name for the group, as used in page.package.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name for the group, as used in page.package.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ImplementationGuidePackageComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name for the group, as used in page.package. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name for the group, as used in page.package. - */ - public ImplementationGuidePackageComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #description} (Human readable text describing the package.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human readable text describing the package.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImplementationGuidePackageComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human readable text describing the package. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human readable text describing the package. - */ - public ImplementationGuidePackageComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #resource} (A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.) - */ - public List getResource() { - if (this.resource == null) - this.resource = new ArrayList(); - return this.resource; - } - - public boolean hasResource() { - if (this.resource == null) - return false; - for (ImplementationGuidePackageResourceComponent item : this.resource) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #resource} (A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.) - */ - // syntactic sugar - public ImplementationGuidePackageResourceComponent addResource() { //3 - ImplementationGuidePackageResourceComponent t = new ImplementationGuidePackageResourceComponent(); - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuidePackageComponent addResource(ImplementationGuidePackageResourceComponent t) { //3 - if (t == null) - return this; - if (this.resource == null) - this.resource = new ArrayList(); - this.resource.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name for the group, as used in page.package.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Human readable text describing the package.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("resource", "", "A resource that is part of the implementation guide. Conformance resources (value set, structure definition, conformance statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource.", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : this.resource.toArray(new Base[this.resource.size()]); // ImplementationGuidePackageResourceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -341064690: // resource - this.getResource().add((ImplementationGuidePackageResourceComponent) value); // ImplementationGuidePackageResourceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("resource")) - this.getResource().add((ImplementationGuidePackageResourceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -341064690: return addResource(); // ImplementationGuidePackageResourceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description"); - } - else if (name.equals("resource")) { - return addResource(); - } - else - return super.addChild(name); - } - - public ImplementationGuidePackageComponent copy() { - ImplementationGuidePackageComponent dst = new ImplementationGuidePackageComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - if (resource != null) { - dst.resource = new ArrayList(); - for (ImplementationGuidePackageResourceComponent i : resource) - dst.resource.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuidePackageComponent)) - return false; - ImplementationGuidePackageComponent o = (ImplementationGuidePackageComponent) other; - return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(resource, o.resource, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuidePackageComponent)) - return false; - ImplementationGuidePackageComponent o = (ImplementationGuidePackageComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) - && (resource == null || resource.isEmpty()); - } - - public String fhirType() { - return "ImplementationGuide.package"; - - } - - } - - @Block() - public static class ImplementationGuidePackageResourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide. - */ - @Child(name = "example", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="If not an example, has it's normal meaning", formalDefinition="Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide." ) - protected BooleanType example; - - /** - * A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human Name for the resource", formalDefinition="A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name)." ) - protected StringType name; - - /** - * A description of the reason that a resource has been included in the implementation guide. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reason why included in guide", formalDefinition="A description of the reason that a resource has been included in the implementation guide." ) - protected StringType description; - - /** - * A short code that may be used to identify the resource throughout the implementation guide. - */ - @Child(name = "acronym", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Short code to identify the resource", formalDefinition="A short code that may be used to identify the resource throughout the implementation guide." ) - protected StringType acronym; - - /** - * Where this resource is found. - */ - @Child(name = "source", type = {UriType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Location of the resource", formalDefinition="Where this resource is found." ) - protected Type source; - - /** - * Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions. - */ - @Child(name = "exampleFor", type = {StructureDefinition.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource this is an example of (if applicable)", formalDefinition="Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions." ) - protected Reference exampleFor; - - /** - * The actual object that is the target of the reference (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) - */ - protected StructureDefinition exampleForTarget; - - private static final long serialVersionUID = 2085404852L; - - /** - * Constructor - */ - public ImplementationGuidePackageResourceComponent() { - super(); - } - - /** - * Constructor - */ - public ImplementationGuidePackageResourceComponent(BooleanType example, Type source) { - super(); - this.example = example; - this.source = source; - } - - /** - * @return {@link #example} (Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.). This is the underlying object with id, value and extensions. The accessor "getExample" gives direct access to the value - */ - public BooleanType getExampleElement() { - if (this.example == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.example"); - else if (Configuration.doAutoCreate()) - this.example = new BooleanType(); // bb - return this.example; - } - - public boolean hasExampleElement() { - return this.example != null && !this.example.isEmpty(); - } - - public boolean hasExample() { - return this.example != null && !this.example.isEmpty(); - } - - /** - * @param value {@link #example} (Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.). This is the underlying object with id, value and extensions. The accessor "getExample" gives direct access to the value - */ - public ImplementationGuidePackageResourceComponent setExampleElement(BooleanType value) { - this.example = value; - return this; - } - - /** - * @return Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide. - */ - public boolean getExample() { - return this.example == null || this.example.isEmpty() ? false : this.example.getValue(); - } - - /** - * @param value Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide. - */ - public ImplementationGuidePackageResourceComponent setExample(boolean value) { - if (this.example == null) - this.example = new BooleanType(); - this.example.setValue(value); - return this; - } - - /** - * @return {@link #name} (A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ImplementationGuidePackageResourceComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name). - */ - public ImplementationGuidePackageResourceComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A description of the reason that a resource has been included in the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the reason that a resource has been included in the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImplementationGuidePackageResourceComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the reason that a resource has been included in the implementation guide. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the reason that a resource has been included in the implementation guide. - */ - public ImplementationGuidePackageResourceComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #acronym} (A short code that may be used to identify the resource throughout the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getAcronym" gives direct access to the value - */ - public StringType getAcronymElement() { - if (this.acronym == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.acronym"); - else if (Configuration.doAutoCreate()) - this.acronym = new StringType(); // bb - return this.acronym; - } - - public boolean hasAcronymElement() { - return this.acronym != null && !this.acronym.isEmpty(); - } - - public boolean hasAcronym() { - return this.acronym != null && !this.acronym.isEmpty(); - } - - /** - * @param value {@link #acronym} (A short code that may be used to identify the resource throughout the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getAcronym" gives direct access to the value - */ - public ImplementationGuidePackageResourceComponent setAcronymElement(StringType value) { - this.acronym = value; - return this; - } - - /** - * @return A short code that may be used to identify the resource throughout the implementation guide. - */ - public String getAcronym() { - return this.acronym == null ? null : this.acronym.getValue(); - } - - /** - * @param value A short code that may be used to identify the resource throughout the implementation guide. - */ - public ImplementationGuidePackageResourceComponent setAcronym(String value) { - if (Utilities.noString(value)) - this.acronym = null; - else { - if (this.acronym == null) - this.acronym = new StringType(); - this.acronym.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (Where this resource is found.) - */ - public Type getSource() { - return this.source; - } - - /** - * @return {@link #source} (Where this resource is found.) - */ - public UriType getSourceUriType() throws FHIRException { - if (!(this.source instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.source.getClass().getName()+" was encountered"); - return (UriType) this.source; - } - - public boolean hasSourceUriType() { - return this.source instanceof UriType; - } - - /** - * @return {@link #source} (Where this resource is found.) - */ - public Reference getSourceReference() throws FHIRException { - if (!(this.source instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.source.getClass().getName()+" was encountered"); - return (Reference) this.source; - } - - public boolean hasSourceReference() { - return this.source instanceof Reference; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Where this resource is found.) - */ - public ImplementationGuidePackageResourceComponent setSource(Type value) { - this.source = value; - return this; - } - - /** - * @return {@link #exampleFor} (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) - */ - public Reference getExampleFor() { - if (this.exampleFor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.exampleFor"); - else if (Configuration.doAutoCreate()) - this.exampleFor = new Reference(); // cc - return this.exampleFor; - } - - public boolean hasExampleFor() { - return this.exampleFor != null && !this.exampleFor.isEmpty(); - } - - /** - * @param value {@link #exampleFor} (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) - */ - public ImplementationGuidePackageResourceComponent setExampleFor(Reference value) { - this.exampleFor = value; - return this; - } - - /** - * @return {@link #exampleFor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) - */ - public StructureDefinition getExampleForTarget() { - if (this.exampleForTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePackageResourceComponent.exampleFor"); - else if (Configuration.doAutoCreate()) - this.exampleForTarget = new StructureDefinition(); // aa - return this.exampleForTarget; - } - - /** - * @param value {@link #exampleFor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.) - */ - public ImplementationGuidePackageResourceComponent setExampleForTarget(StructureDefinition value) { - this.exampleForTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("example", "boolean", "Whether a resource is included in the guide as part of the rules defined by the guide, or just as an example of a resource that conforms to the rules and/or help implementers understand the intent of the guide.", 0, java.lang.Integer.MAX_VALUE, example)); - childrenList.add(new Property("name", "string", "A human assigned name for the resource. All resources SHOULD have a name, but the name may be extracted from the resource (e.g. ValueSet.name).", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "A description of the reason that a resource has been included in the implementation guide.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("acronym", "string", "A short code that may be used to identify the resource throughout the implementation guide.", 0, java.lang.Integer.MAX_VALUE, acronym)); - childrenList.add(new Property("source[x]", "uri|Reference(Any)", "Where this resource is found.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("exampleFor", "Reference(StructureDefinition)", "Another resource that this resource is an example for. This is mostly used for resources that are included as examples of StructureDefinitions.", 0, java.lang.Integer.MAX_VALUE, exampleFor)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1322970774: /*example*/ return this.example == null ? new Base[0] : new Base[] {this.example}; // BooleanType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1163472445: /*acronym*/ return this.acronym == null ? new Base[0] : new Base[] {this.acronym}; // StringType - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Type - case -2002349313: /*exampleFor*/ return this.exampleFor == null ? new Base[0] : new Base[] {this.exampleFor}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1322970774: // example - this.example = castToBoolean(value); // BooleanType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1163472445: // acronym - this.acronym = castToString(value); // StringType - break; - case -896505829: // source - this.source = (Type) value; // Type - break; - case -2002349313: // exampleFor - this.exampleFor = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("example")) - this.example = castToBoolean(value); // BooleanType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("acronym")) - this.acronym = castToString(value); // StringType - else if (name.equals("source[x]")) - this.source = (Type) value; // Type - else if (name.equals("exampleFor")) - this.exampleFor = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1322970774: throw new FHIRException("Cannot make property example as it is not a complex type"); // BooleanType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1163472445: throw new FHIRException("Cannot make property acronym as it is not a complex type"); // StringType - case -1698413947: return getSource(); // Type - case -2002349313: return getExampleFor(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("example")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.example"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description"); - } - else if (name.equals("acronym")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.acronym"); - } - else if (name.equals("sourceUri")) { - this.source = new UriType(); - return this.source; - } - else if (name.equals("sourceReference")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("exampleFor")) { - this.exampleFor = new Reference(); - return this.exampleFor; - } - else - return super.addChild(name); - } - - public ImplementationGuidePackageResourceComponent copy() { - ImplementationGuidePackageResourceComponent dst = new ImplementationGuidePackageResourceComponent(); - copyValues(dst); - dst.example = example == null ? null : example.copy(); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.acronym = acronym == null ? null : acronym.copy(); - dst.source = source == null ? null : source.copy(); - dst.exampleFor = exampleFor == null ? null : exampleFor.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuidePackageResourceComponent)) - return false; - ImplementationGuidePackageResourceComponent o = (ImplementationGuidePackageResourceComponent) other; - return compareDeep(example, o.example, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) - && compareDeep(acronym, o.acronym, true) && compareDeep(source, o.source, true) && compareDeep(exampleFor, o.exampleFor, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuidePackageResourceComponent)) - return false; - ImplementationGuidePackageResourceComponent o = (ImplementationGuidePackageResourceComponent) other; - return compareValues(example, o.example, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) - && compareValues(acronym, o.acronym, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (example == null || example.isEmpty()) && (name == null || name.isEmpty()) - && (description == null || description.isEmpty()) && (acronym == null || acronym.isEmpty()) - && (source == null || source.isEmpty()) && (exampleFor == null || exampleFor.isEmpty()); - } - - public String fhirType() { - return "ImplementationGuide.package.resource"; - - } - - } - - @Block() - public static class ImplementationGuideGlobalComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of resource that all instances must conform to. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type this profiles applies to", formalDefinition="The type of resource that all instances must conform to." ) - protected CodeType type; - - /** - * A reference to the profile that all instances must conform to. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Profile that all resources must conform to", formalDefinition="A reference to the profile that all instances must conform to." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A reference to the profile that all instances must conform to.) - */ - protected StructureDefinition profileTarget; - - private static final long serialVersionUID = 2011731959L; - - /** - * Constructor - */ - public ImplementationGuideGlobalComponent() { - super(); - } - - /** - * Constructor - */ - public ImplementationGuideGlobalComponent(CodeType type, Reference profile) { - super(); - this.type = type; - this.profile = profile; - } - - /** - * @return {@link #type} (The type of resource that all instances must conform to.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of resource that all instances must conform to.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ImplementationGuideGlobalComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of resource that all instances must conform to. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of resource that all instances must conform to. - */ - public ImplementationGuideGlobalComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (A reference to the profile that all instances must conform to.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A reference to the profile that all instances must conform to.) - */ - public ImplementationGuideGlobalComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the profile that all instances must conform to.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuideGlobalComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the profile that all instances must conform to.) - */ - public ImplementationGuideGlobalComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of resource that all instances must conform to.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A reference to the profile that all instances must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return getProfile(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else - return super.addChild(name); - } - - public ImplementationGuideGlobalComponent copy() { - ImplementationGuideGlobalComponent dst = new ImplementationGuideGlobalComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuideGlobalComponent)) - return false; - ImplementationGuideGlobalComponent o = (ImplementationGuideGlobalComponent) other; - return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuideGlobalComponent)) - return false; - ImplementationGuideGlobalComponent o = (ImplementationGuideGlobalComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) - ; - } - - public String fhirType() { - return "ImplementationGuide.global"; - - } - - } - - @Block() - public static class ImplementationGuidePageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The source address for the page. - */ - @Child(name = "source", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where to find that page", formalDefinition="The source address for the page." ) - protected UriType source; - - /** - * A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Short name shown for navigational assistance", formalDefinition="A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc." ) - protected StringType name; - - /** - * The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest. - */ - @Child(name = "kind", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="page | example | list | include | directory | dictionary | toc | resource", formalDefinition="The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest." ) - protected Enumeration kind; - - /** - * For constructed pages, what kind of resources to include in the list. - */ - @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Kind of resource to include in the list", formalDefinition="For constructed pages, what kind of resources to include in the list." ) - protected List type; - - /** - * For constructed pages, a list of packages to include in the page (or else empty for everything). - */ - @Child(name = "package", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Name of package to include", formalDefinition="For constructed pages, a list of packages to include in the page (or else empty for everything)." ) - protected List package_; - - /** - * The format of the page. - */ - @Child(name = "format", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Format of the page (e.g. html, markdown, etc.)", formalDefinition="The format of the page." ) - protected CodeType format; - - /** - * Nested Pages/Sections under this page. - */ - @Child(name = "page", type = {ImplementationGuidePageComponent.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Nested Pages / Sections", formalDefinition="Nested Pages/Sections under this page." ) - protected List page; - - private static final long serialVersionUID = -1620890043L; - - /** - * Constructor - */ - public ImplementationGuidePageComponent() { - super(); - } - - /** - * Constructor - */ - public ImplementationGuidePageComponent(UriType source, StringType name, Enumeration kind) { - super(); - this.source = source; - this.name = name; - this.kind = kind; - } - - /** - * @return {@link #source} (The source address for the page.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public UriType getSourceElement() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePageComponent.source"); - else if (Configuration.doAutoCreate()) - this.source = new UriType(); // bb - return this.source; - } - - public boolean hasSourceElement() { - return this.source != null && !this.source.isEmpty(); - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source address for the page.). This is the underlying object with id, value and extensions. The accessor "getSource" gives direct access to the value - */ - public ImplementationGuidePageComponent setSourceElement(UriType value) { - this.source = value; - return this; - } - - /** - * @return The source address for the page. - */ - public String getSource() { - return this.source == null ? null : this.source.getValue(); - } - - /** - * @param value The source address for the page. - */ - public ImplementationGuidePageComponent setSource(String value) { - if (this.source == null) - this.source = new UriType(); - this.source.setValue(value); - return this; - } - - /** - * @return {@link #name} (A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePageComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ImplementationGuidePageComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc. - */ - public ImplementationGuidePageComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #kind} (The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePageComponent.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new GuidePageKindEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public ImplementationGuidePageComponent setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest. - */ - public GuidePageKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest. - */ - public ImplementationGuidePageComponent setKind(GuidePageKind value) { - if (this.kind == null) - this.kind = new Enumeration(new GuidePageKindEnumFactory()); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #type} (For constructed pages, what kind of resources to include in the list.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeType item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (For constructed pages, what kind of resources to include in the list.) - */ - // syntactic sugar - public CodeType addTypeElement() {//2 - CodeType t = new CodeType(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @param value {@link #type} (For constructed pages, what kind of resources to include in the list.) - */ - public ImplementationGuidePageComponent addType(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @param value {@link #type} (For constructed pages, what kind of resources to include in the list.) - */ - public boolean hasType(String value) { - if (this.type == null) - return false; - for (CodeType v : this.type) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) - */ - public List getPackage() { - if (this.package_ == null) - this.package_ = new ArrayList(); - return this.package_; - } - - public boolean hasPackage() { - if (this.package_ == null) - return false; - for (StringType item : this.package_) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) - */ - // syntactic sugar - public StringType addPackageElement() {//2 - StringType t = new StringType(); - if (this.package_ == null) - this.package_ = new ArrayList(); - this.package_.add(t); - return t; - } - - /** - * @param value {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) - */ - public ImplementationGuidePageComponent addPackage(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.package_ == null) - this.package_ = new ArrayList(); - this.package_.add(t); - return this; - } - - /** - * @param value {@link #package_} (For constructed pages, a list of packages to include in the page (or else empty for everything).) - */ - public boolean hasPackage(String value) { - if (this.package_ == null) - return false; - for (StringType v : this.package_) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #format} (The format of the page.). This is the underlying object with id, value and extensions. The accessor "getFormat" gives direct access to the value - */ - public CodeType getFormatElement() { - if (this.format == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuidePageComponent.format"); - else if (Configuration.doAutoCreate()) - this.format = new CodeType(); // bb - return this.format; - } - - public boolean hasFormatElement() { - return this.format != null && !this.format.isEmpty(); - } - - public boolean hasFormat() { - return this.format != null && !this.format.isEmpty(); - } - - /** - * @param value {@link #format} (The format of the page.). This is the underlying object with id, value and extensions. The accessor "getFormat" gives direct access to the value - */ - public ImplementationGuidePageComponent setFormatElement(CodeType value) { - this.format = value; - return this; - } - - /** - * @return The format of the page. - */ - public String getFormat() { - return this.format == null ? null : this.format.getValue(); - } - - /** - * @param value The format of the page. - */ - public ImplementationGuidePageComponent setFormat(String value) { - if (Utilities.noString(value)) - this.format = null; - else { - if (this.format == null) - this.format = new CodeType(); - this.format.setValue(value); - } - return this; - } - - /** - * @return {@link #page} (Nested Pages/Sections under this page.) - */ - public List getPage() { - if (this.page == null) - this.page = new ArrayList(); - return this.page; - } - - public boolean hasPage() { - if (this.page == null) - return false; - for (ImplementationGuidePageComponent item : this.page) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #page} (Nested Pages/Sections under this page.) - */ - // syntactic sugar - public ImplementationGuidePageComponent addPage() { //3 - ImplementationGuidePageComponent t = new ImplementationGuidePageComponent(); - if (this.page == null) - this.page = new ArrayList(); - this.page.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuidePageComponent addPage(ImplementationGuidePageComponent t) { //3 - if (t == null) - return this; - if (this.page == null) - this.page = new ArrayList(); - this.page.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("source", "uri", "The source address for the page.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("name", "string", "A short name used to represent this page in navigational structures such as table of contents, bread crumbs, etc.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("kind", "code", "The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so that tools can navigate the user to the page of interest.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("type", "code", "For constructed pages, what kind of resources to include in the list.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("package", "string", "For constructed pages, a list of packages to include in the page (or else empty for everything).", 0, java.lang.Integer.MAX_VALUE, package_)); - childrenList.add(new Property("format", "code", "The format of the page.", 0, java.lang.Integer.MAX_VALUE, format)); - childrenList.add(new Property("page", "@ImplementationGuide.page", "Nested Pages/Sections under this page.", 0, java.lang.Integer.MAX_VALUE, page)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // UriType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeType - case -807062458: /*package*/ return this.package_ == null ? new Base[0] : this.package_.toArray(new Base[this.package_.size()]); // StringType - case -1268779017: /*format*/ return this.format == null ? new Base[0] : new Base[] {this.format}; // CodeType - case 3433103: /*page*/ return this.page == null ? new Base[0] : this.page.toArray(new Base[this.page.size()]); // ImplementationGuidePageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -896505829: // source - this.source = castToUri(value); // UriType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 3292052: // kind - this.kind = new GuidePageKindEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.getType().add(castToCode(value)); // CodeType - break; - case -807062458: // package - this.getPackage().add(castToString(value)); // StringType - break; - case -1268779017: // format - this.format = castToCode(value); // CodeType - break; - case 3433103: // page - this.getPage().add((ImplementationGuidePageComponent) value); // ImplementationGuidePageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("source")) - this.source = castToUri(value); // UriType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("kind")) - this.kind = new GuidePageKindEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.getType().add(castToCode(value)); - else if (name.equals("package")) - this.getPackage().add(castToString(value)); - else if (name.equals("format")) - this.format = castToCode(value); // CodeType - else if (name.equals("page")) - this.getPage().add((ImplementationGuidePageComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -896505829: throw new FHIRException("Cannot make property source as it is not a complex type"); // UriType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -807062458: throw new FHIRException("Cannot make property package as it is not a complex type"); // StringType - case -1268779017: throw new FHIRException("Cannot make property format as it is not a complex type"); // CodeType - case 3433103: return addPage(); // ImplementationGuidePageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("source")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.source"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); - } - else if (name.equals("kind")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.kind"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.type"); - } - else if (name.equals("package")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.package"); - } - else if (name.equals("format")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.format"); - } - else if (name.equals("page")) { - return addPage(); - } - else - return super.addChild(name); - } - - public ImplementationGuidePageComponent copy() { - ImplementationGuidePageComponent dst = new ImplementationGuidePageComponent(); - copyValues(dst); - dst.source = source == null ? null : source.copy(); - dst.name = name == null ? null : name.copy(); - dst.kind = kind == null ? null : kind.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeType i : type) - dst.type.add(i.copy()); - }; - if (package_ != null) { - dst.package_ = new ArrayList(); - for (StringType i : package_) - dst.package_.add(i.copy()); - }; - dst.format = format == null ? null : format.copy(); - if (page != null) { - dst.page = new ArrayList(); - for (ImplementationGuidePageComponent i : page) - dst.page.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuidePageComponent)) - return false; - ImplementationGuidePageComponent o = (ImplementationGuidePageComponent) other; - return compareDeep(source, o.source, true) && compareDeep(name, o.name, true) && compareDeep(kind, o.kind, true) - && compareDeep(type, o.type, true) && compareDeep(package_, o.package_, true) && compareDeep(format, o.format, true) - && compareDeep(page, o.page, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuidePageComponent)) - return false; - ImplementationGuidePageComponent o = (ImplementationGuidePageComponent) other; - return compareValues(source, o.source, true) && compareValues(name, o.name, true) && compareValues(kind, o.kind, true) - && compareValues(type, o.type, true) && compareValues(package_, o.package_, true) && compareValues(format, o.format, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (source == null || source.isEmpty()) && (name == null || name.isEmpty()) - && (kind == null || kind.isEmpty()) && (type == null || type.isEmpty()) && (package_ == null || package_.isEmpty()) - && (format == null || format.isEmpty()) && (page == null || page.isEmpty()); - } - - public String fhirType() { - return "ImplementationGuide.page"; - - } - - } - - /** - * An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL used to reference this Implementation Guide", formalDefinition="An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published." ) - protected UriType url; - - /** - * The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id for this version of the Implementation Guide", formalDefinition="The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually." ) - protected StringType version; - - /** - * A free text natural language name identifying the Implementation Guide. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this Implementation Guide", formalDefinition="A free text natural language name identifying the Implementation Guide." ) - protected StringType name; - - /** - * The status of the Implementation Guide. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the Implementation Guide." ) - protected Enumeration status; - - /** - * This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the implementation guide. - */ - @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the implementation guide." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for this version of the Implementation Guide", formalDefinition="The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes." ) - protected DateTimeType date; - - /** - * A free text natural language description of the Implementation Guide and its use. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Natural language description of the Implementation Guide", formalDefinition="A free text natural language description of the Implementation Guide and its use." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The implementation guide is intended to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined." ) - protected List useContext; - - /** - * A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - @Child(name = "copyright", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) - protected StringType copyright; - - /** - * The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. - */ - @Child(name = "fhirVersion", type = {IdType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FHIR Version this Implementation Guide targets", formalDefinition="The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version." ) - protected IdType fhirVersion; - - /** - * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides. - */ - @Child(name = "dependency", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Another Implementation guide this depends on", formalDefinition="Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides." ) - protected List dependency; - - /** - * A logical group of resources. Logical groups can be used when building pages. - */ - @Child(name = "package", type = {}, order=13, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Group of resources as used in .page.package", formalDefinition="A logical group of resources. Logical groups can be used when building pages." ) - protected List package_; - - /** - * A set of profiles that all resources covered by this implementation guide must conform to. - */ - @Child(name = "global", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Profiles that apply globally", formalDefinition="A set of profiles that all resources covered by this implementation guide must conform to." ) - protected List global; - - /** - * A binary file that is included in the implementation guide when it is published. - */ - @Child(name = "binary", type = {UriType.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Image, css, script, etc.", formalDefinition="A binary file that is included in the implementation guide when it is published." ) - protected List binary; - - /** - * A page / section in the implementation guide. The root page is the implementation guide home page. - */ - @Child(name = "page", type = {}, order=16, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Page/Section in the Guide", formalDefinition="A page / section in the implementation guide. The root page is the implementation guide home page." ) - protected ImplementationGuidePageComponent page; - - private static final long serialVersionUID = 1150122415L; - - /** - * Constructor - */ - public ImplementationGuide() { - super(); - } - - /** - * Constructor - */ - public ImplementationGuide(UriType url, StringType name, Enumeration status, ImplementationGuidePageComponent page) { - super(); - this.url = url; - this.name = name; - this.status = status; - this.page = page; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ImplementationGuide setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published. - */ - public ImplementationGuide setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ImplementationGuide setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually. - */ - public ImplementationGuide setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the Implementation Guide.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the Implementation Guide.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ImplementationGuide setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the Implementation Guide. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the Implementation Guide. - */ - public ImplementationGuide setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the Implementation Guide.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the Implementation Guide.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ImplementationGuide setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the Implementation Guide. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the Implementation Guide. - */ - public ImplementationGuide setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ImplementationGuide setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ImplementationGuide setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the implementation guide.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ImplementationGuide setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the implementation guide. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the implementation guide. - */ - public ImplementationGuide setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ImplementationGuideContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ImplementationGuideContactComponent addContact() { //3 - ImplementationGuideContactComponent t = new ImplementationGuideContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuide addContact(ImplementationGuideContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ImplementationGuide setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes. - */ - public ImplementationGuide setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the Implementation Guide and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the Implementation Guide and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ImplementationGuide setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the Implementation Guide and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the Implementation Guide and its use. - */ - public ImplementationGuide setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuide addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ImplementationGuide setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public ImplementationGuide setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); // bb - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public ImplementationGuide setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. - */ - public ImplementationGuide setFhirVersion(String value) { - if (Utilities.noString(value)) - this.fhirVersion = null; - else { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - } - return this; - } - - /** - * @return {@link #dependency} (Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.) - */ - public List getDependency() { - if (this.dependency == null) - this.dependency = new ArrayList(); - return this.dependency; - } - - public boolean hasDependency() { - if (this.dependency == null) - return false; - for (ImplementationGuideDependencyComponent item : this.dependency) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dependency} (Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.) - */ - // syntactic sugar - public ImplementationGuideDependencyComponent addDependency() { //3 - ImplementationGuideDependencyComponent t = new ImplementationGuideDependencyComponent(); - if (this.dependency == null) - this.dependency = new ArrayList(); - this.dependency.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuide addDependency(ImplementationGuideDependencyComponent t) { //3 - if (t == null) - return this; - if (this.dependency == null) - this.dependency = new ArrayList(); - this.dependency.add(t); - return this; - } - - /** - * @return {@link #package_} (A logical group of resources. Logical groups can be used when building pages.) - */ - public List getPackage() { - if (this.package_ == null) - this.package_ = new ArrayList(); - return this.package_; - } - - public boolean hasPackage() { - if (this.package_ == null) - return false; - for (ImplementationGuidePackageComponent item : this.package_) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #package_} (A logical group of resources. Logical groups can be used when building pages.) - */ - // syntactic sugar - public ImplementationGuidePackageComponent addPackage() { //3 - ImplementationGuidePackageComponent t = new ImplementationGuidePackageComponent(); - if (this.package_ == null) - this.package_ = new ArrayList(); - this.package_.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuide addPackage(ImplementationGuidePackageComponent t) { //3 - if (t == null) - return this; - if (this.package_ == null) - this.package_ = new ArrayList(); - this.package_.add(t); - return this; - } - - /** - * @return {@link #global} (A set of profiles that all resources covered by this implementation guide must conform to.) - */ - public List getGlobal() { - if (this.global == null) - this.global = new ArrayList(); - return this.global; - } - - public boolean hasGlobal() { - if (this.global == null) - return false; - for (ImplementationGuideGlobalComponent item : this.global) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #global} (A set of profiles that all resources covered by this implementation guide must conform to.) - */ - // syntactic sugar - public ImplementationGuideGlobalComponent addGlobal() { //3 - ImplementationGuideGlobalComponent t = new ImplementationGuideGlobalComponent(); - if (this.global == null) - this.global = new ArrayList(); - this.global.add(t); - return t; - } - - // syntactic sugar - public ImplementationGuide addGlobal(ImplementationGuideGlobalComponent t) { //3 - if (t == null) - return this; - if (this.global == null) - this.global = new ArrayList(); - this.global.add(t); - return this; - } - - /** - * @return {@link #binary} (A binary file that is included in the implementation guide when it is published.) - */ - public List getBinary() { - if (this.binary == null) - this.binary = new ArrayList(); - return this.binary; - } - - public boolean hasBinary() { - if (this.binary == null) - return false; - for (UriType item : this.binary) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #binary} (A binary file that is included in the implementation guide when it is published.) - */ - // syntactic sugar - public UriType addBinaryElement() {//2 - UriType t = new UriType(); - if (this.binary == null) - this.binary = new ArrayList(); - this.binary.add(t); - return t; - } - - /** - * @param value {@link #binary} (A binary file that is included in the implementation guide when it is published.) - */ - public ImplementationGuide addBinary(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.binary == null) - this.binary = new ArrayList(); - this.binary.add(t); - return this; - } - - /** - * @param value {@link #binary} (A binary file that is included in the implementation guide when it is published.) - */ - public boolean hasBinary(String value) { - if (this.binary == null) - return false; - for (UriType v : this.binary) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #page} (A page / section in the implementation guide. The root page is the implementation guide home page.) - */ - public ImplementationGuidePageComponent getPage() { - if (this.page == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ImplementationGuide.page"); - else if (Configuration.doAutoCreate()) - this.page = new ImplementationGuidePageComponent(); // cc - return this.page; - } - - public boolean hasPage() { - return this.page != null && !this.page.isEmpty(); - } - - /** - * @param value {@link #page} (A page / section in the implementation guide. The root page is the implementation guide home page.) - */ - public ImplementationGuide setPage(ImplementationGuidePageComponent value) { - this.page = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this implementation guide when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this implementation guide is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the Implementation Guide when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the Implementation Guide author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the Implementation Guide.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the Implementation Guide.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This Implementation Guide was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the implementation guide.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date this version of the implementation guide was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the Implementation Guide and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of implementation guides. The most common use of this element is to represent the country / jurisdiction for which this implementation guide was defined.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the implementation guide and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this ImplementationGuide is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("dependency", "", "Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, profiles etc.defined in other implementation guides.", 0, java.lang.Integer.MAX_VALUE, dependency)); - childrenList.add(new Property("package", "", "A logical group of resources. Logical groups can be used when building pages.", 0, java.lang.Integer.MAX_VALUE, package_)); - childrenList.add(new Property("global", "", "A set of profiles that all resources covered by this implementation guide must conform to.", 0, java.lang.Integer.MAX_VALUE, global)); - childrenList.add(new Property("binary", "uri", "A binary file that is included in the implementation guide when it is published.", 0, java.lang.Integer.MAX_VALUE, binary)); - childrenList.add(new Property("page", "", "A page / section in the implementation guide. The root page is the implementation guide home page.", 0, java.lang.Integer.MAX_VALUE, page)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ImplementationGuideContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType - case -26291381: /*dependency*/ return this.dependency == null ? new Base[0] : this.dependency.toArray(new Base[this.dependency.size()]); // ImplementationGuideDependencyComponent - case -807062458: /*package*/ return this.package_ == null ? new Base[0] : this.package_.toArray(new Base[this.package_.size()]); // ImplementationGuidePackageComponent - case -1243020381: /*global*/ return this.global == null ? new Base[0] : this.global.toArray(new Base[this.global.size()]); // ImplementationGuideGlobalComponent - case -1388966911: /*binary*/ return this.binary == null ? new Base[0] : this.binary.toArray(new Base[this.binary.size()]); // UriType - case 3433103: /*page*/ return this.page == null ? new Base[0] : new Base[] {this.page}; // ImplementationGuidePageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ImplementationGuideContactComponent) value); // ImplementationGuideContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case 461006061: // fhirVersion - this.fhirVersion = castToId(value); // IdType - break; - case -26291381: // dependency - this.getDependency().add((ImplementationGuideDependencyComponent) value); // ImplementationGuideDependencyComponent - break; - case -807062458: // package - this.getPackage().add((ImplementationGuidePackageComponent) value); // ImplementationGuidePackageComponent - break; - case -1243020381: // global - this.getGlobal().add((ImplementationGuideGlobalComponent) value); // ImplementationGuideGlobalComponent - break; - case -1388966911: // binary - this.getBinary().add(castToUri(value)); // UriType - break; - case 3433103: // page - this.page = (ImplementationGuidePageComponent) value; // ImplementationGuidePageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ImplementationGuideContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("fhirVersion")) - this.fhirVersion = castToId(value); // IdType - else if (name.equals("dependency")) - this.getDependency().add((ImplementationGuideDependencyComponent) value); - else if (name.equals("package")) - this.getPackage().add((ImplementationGuidePackageComponent) value); - else if (name.equals("global")) - this.getGlobal().add((ImplementationGuideGlobalComponent) value); - else if (name.equals("binary")) - this.getBinary().add(castToUri(value)); - else if (name.equals("page")) - this.page = (ImplementationGuidePageComponent) value; // ImplementationGuidePageComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // ImplementationGuideContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType - case -26291381: return addDependency(); // ImplementationGuideDependencyComponent - case -807062458: return addPackage(); // ImplementationGuidePackageComponent - case -1243020381: return addGlobal(); // ImplementationGuideGlobalComponent - case -1388966911: throw new FHIRException("Cannot make property binary as it is not a complex type"); // UriType - case 3433103: return getPage(); // ImplementationGuidePageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.url"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.copyright"); - } - else if (name.equals("fhirVersion")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.fhirVersion"); - } - else if (name.equals("dependency")) { - return addDependency(); - } - else if (name.equals("package")) { - return addPackage(); - } - else if (name.equals("global")) { - return addGlobal(); - } - else if (name.equals("binary")) { - throw new FHIRException("Cannot call addChild on a primitive type ImplementationGuide.binary"); - } - else if (name.equals("page")) { - this.page = new ImplementationGuidePageComponent(); - return this.page; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ImplementationGuide"; - - } - - public ImplementationGuide copy() { - ImplementationGuide dst = new ImplementationGuide(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ImplementationGuideContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.copyright = copyright == null ? null : copyright.copy(); - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - if (dependency != null) { - dst.dependency = new ArrayList(); - for (ImplementationGuideDependencyComponent i : dependency) - dst.dependency.add(i.copy()); - }; - if (package_ != null) { - dst.package_ = new ArrayList(); - for (ImplementationGuidePackageComponent i : package_) - dst.package_.add(i.copy()); - }; - if (global != null) { - dst.global = new ArrayList(); - for (ImplementationGuideGlobalComponent i : global) - dst.global.add(i.copy()); - }; - if (binary != null) { - dst.binary = new ArrayList(); - for (UriType i : binary) - dst.binary.add(i.copy()); - }; - dst.page = page == null ? null : page.copy(); - return dst; - } - - protected ImplementationGuide typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ImplementationGuide)) - return false; - ImplementationGuide o = (ImplementationGuide) other; - return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) - && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) - && compareDeep(useContext, o.useContext, true) && compareDeep(copyright, o.copyright, true) && compareDeep(fhirVersion, o.fhirVersion, true) - && compareDeep(dependency, o.dependency, true) && compareDeep(package_, o.package_, true) && compareDeep(global, o.global, true) - && compareDeep(binary, o.binary, true) && compareDeep(page, o.page, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ImplementationGuide)) - return false; - ImplementationGuide o = (ImplementationGuide) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(copyright, o.copyright, true) - && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(binary, o.binary, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) - && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) - && (dependency == null || dependency.isEmpty()) && (package_ == null || package_.isEmpty()) - && (global == null || global.isEmpty()) && (binary == null || binary.isEmpty()) && (page == null || page.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ImplementationGuide; - } - - /** - * Search parameter: dependency - *

- * Description: Where to find dependency
- * Type: uri
- * Path: ImplementationGuide.dependency.uri
- *

- */ - @SearchParamDefinition(name="dependency", path="ImplementationGuide.dependency.uri", description="Where to find dependency", type="uri" ) - public static final String SP_DEPENDENCY = "dependency"; - /** - * Fluent Client search parameter constant for dependency - *

- * Description: Where to find dependency
- * Type: uri
- * Path: ImplementationGuide.dependency.uri
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam DEPENDENCY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEPENDENCY); - - /** - * Search parameter: status - *

- * Description: The current status of the implementation guide
- * Type: token
- * Path: ImplementationGuide.status
- *

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

- * Description: The current status of the implementation guide
- * Type: token
- * Path: ImplementationGuide.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search in the description of the implementation guide
- * Type: string
- * Path: ImplementationGuide.description
- *

- */ - @SearchParamDefinition(name="description", path="ImplementationGuide.description", description="Text search in the description of the implementation guide", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search in the description of the implementation guide
- * Type: string
- * Path: ImplementationGuide.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: Name of the implementation guide
- * Type: string
- * Path: ImplementationGuide.name
- *

- */ - @SearchParamDefinition(name="name", path="ImplementationGuide.name", description="Name of the implementation guide", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Name of the implementation guide
- * Type: string
- * Path: ImplementationGuide.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: resource - *

- * Description: Location of the resource
- * Type: reference
- * Path: ImplementationGuide.package.resource.source[x]
- *

- */ - @SearchParamDefinition(name="resource", path="ImplementationGuide.package.resource.source", description="Location of the resource", type="reference" ) - public static final String SP_RESOURCE = "resource"; - /** - * Fluent Client search parameter constant for resource - *

- * Description: Location of the resource
- * Type: reference
- * Path: ImplementationGuide.package.resource.source[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ImplementationGuide:resource". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RESOURCE = new ca.uhn.fhir.model.api.Include("ImplementationGuide:resource").toLocked(); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the structure
- * Type: token
- * Path: ImplementationGuide.useContext
- *

- */ - @SearchParamDefinition(name="context", path="ImplementationGuide.useContext", description="A use context assigned to the structure", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the structure
- * Type: token
- * Path: ImplementationGuide.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: experimental - *

- * Description: If for testing purposes, not real usage
- * Type: token
- * Path: ImplementationGuide.experimental
- *

- */ - @SearchParamDefinition(name="experimental", path="ImplementationGuide.experimental", description="If for testing purposes, not real usage", type="token" ) - public static final String SP_EXPERIMENTAL = "experimental"; - /** - * Fluent Client search parameter constant for experimental - *

- * Description: If for testing purposes, not real usage
- * Type: token
- * Path: ImplementationGuide.experimental
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL); - - /** - * Search parameter: date - *

- * Description: The implementation guide publication date
- * Type: date
- * Path: ImplementationGuide.date
- *

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

- * Description: The implementation guide publication date
- * Type: date
- * Path: ImplementationGuide.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: url - *

- * Description: Absolute URL used to reference this Implementation Guide
- * Type: uri
- * Path: ImplementationGuide.url
- *

- */ - @SearchParamDefinition(name="url", path="ImplementationGuide.url", description="Absolute URL used to reference this Implementation Guide", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Absolute URL used to reference this Implementation Guide
- * Type: uri
- * Path: ImplementationGuide.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher of the implementation guide
- * Type: string
- * Path: ImplementationGuide.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="ImplementationGuide.publisher", description="Name of the publisher of the implementation guide", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher of the implementation guide
- * Type: string
- * Path: ImplementationGuide.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: version - *

- * Description: The version identifier of the implementation guide
- * Type: token
- * Path: ImplementationGuide.version
- *

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

- * Description: The version identifier of the implementation guide
- * Type: token
- * Path: ImplementationGuide.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/InstantType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/InstantType.java deleted file mode 100644 index 3f81c8d260b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/InstantType.java +++ /dev/null @@ -1,223 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ -/** - * - */ -package org.hl7.fhir.dstu2016may.model; - -import java.util.Calendar; -import java.util.Date; -import java.util.TimeZone; -import java.util.zip.DataFormatException; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Represents a FHIR instant datatype. Valid precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ -@DatatypeDef(name="instant") -public class InstantType extends BaseDateTimeType { - - private static final long serialVersionUID = 3L; - - /** - * The default precision for this type - */ - public static final TemporalPrecisionEnum DEFAULT_PRECISION = TemporalPrecisionEnum.MILLI; - - /** - * Constructor which creates an InstantDt with no timne value. Note - * that unlike the default constructor for the Java {@link Date} or - * {@link Calendar} objects, this constructor does not initialize the object - * with the current time. - * - * @see #withCurrentTime() to create a new object that has been initialized - * with the current time. - */ - public InstantType() { - super(); - } - - /** - * Create a new DateTimeDt - */ - public InstantType(Calendar theCalendar) { - super(theCalendar.getTime(), DEFAULT_PRECISION, theCalendar.getTimeZone()); - } - - /** - * Create a new instance using the given date, precision level, and time zone - * - * @throws DataFormatException - * If the specified precision is not allowed for this type - */ - public InstantType(Date theDate, TemporalPrecisionEnum thePrecision, TimeZone theTimezone) { - super(theDate, thePrecision, theTimezone); - } - - - /** - * Create a new DateTimeDt using an existing value. Use this constructor with caution, - * as it may create more precision than warranted (since for example it is possible to pass in - * a DateTime with only a year, and this constructor will convert to an InstantDt with - * milliseconds precision). - */ - public InstantType(BaseDateTimeType theDateTime) { - // Do not call super(foo) here, we don't want to trigger a DataFormatException - setValue(theDateTime.getValue()); - setPrecision(DEFAULT_PRECISION); - setTimeZone(theDateTime.getTimeZone()); - } - - /** - * Create a new DateTimeDt with the given date/time and {@link TemporalPrecisionEnum#MILLI} precision - */ - public InstantType(Date theDate) { - super(theDate, DEFAULT_PRECISION, TimeZone.getDefault()); - } - - /** - * Constructor which accepts a date value and a precision value. Valid - * precisions values for this type are: - *
    - *
  • {@link TemporalPrecisionEnum#SECOND} - *
  • {@link TemporalPrecisionEnum#MILLI} - *
- */ - public InstantType(Date theDate, TemporalPrecisionEnum thePrecision) { - setValue(theDate); - setPrecision(thePrecision); - setTimeZone(TimeZone.getDefault()); - } - - /** - * Create a new InstantDt from a string value - * - * @param theString - * The string representation of the string. Must be in a valid - * format according to the FHIR specification - * @throws DataFormatException - */ - public InstantType(String theString) { - super(theString); - } - - /** - * Invokes {@link Date#after(Date)} on the contained Date against the given - * date - * - * @throws NullPointerException - * If the {@link #getValue() contained Date} is null - */ - public boolean after(Date theDate) { - return getValue().after(theDate); - } - - /** - * Invokes {@link Date#before(Date)} on the contained Date against the given - * date - * - * @throws NullPointerException - * If the {@link #getValue() contained Date} is null - */ - public boolean before(Date theDate) { - return getValue().before(theDate); - } - - /** - * Sets the value of this instant to the current time (from the system - * clock) and the local/default timezone (as retrieved using - * {@link TimeZone#getDefault()}. This TimeZone is generally obtained from - * the underlying OS. - */ - public void setToCurrentTimeInLocalTimeZone() { - setValue(new Date()); - setTimeZone(TimeZone.getDefault()); - } - - @Override - boolean isPrecisionAllowed(TemporalPrecisionEnum thePrecision) { - switch (thePrecision) { - case SECOND: - case MILLI: - return true; - default: - return false; - } - } - - /** - * Factory method which creates a new InstantDt with millisecond precision and initializes it with the - * current time and the system local timezone. - */ - public static InstantType withCurrentTime() { - return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); - } - - /** - * Returns the default precision for this datatype - * - * @see #DEFAULT_PRECISION - */ - @Override - protected TemporalPrecisionEnum getDefaultPrecisionForDatatype() { - return DEFAULT_PRECISION; - } - - - @Override - public InstantType copy() { - return new InstantType(getValueAsString()); - } - - /** - * Returns a new instance of DateTimeType with the current system time and MILLI precision and the system local time - * zone - */ - public static InstantType now() { - return new InstantType(new Date(), TemporalPrecisionEnum.MILLI, TimeZone.getDefault()); - } - - /** - * Creates a new instance by parsing an HL7 v3 format date time string - */ - public static InstantType parseV3(String theV3String) { - InstantType retVal = new InstantType(); - retVal.setValueAsV3String(theV3String); - return retVal; - } - - public String fhirType() { - return "instant"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/IntegerType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/IntegerType.java deleted file mode 100644 index 2756466996c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/IntegerType.java +++ /dev/null @@ -1,110 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -/** - * - */ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IBaseIntegerDatatype; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "integer") -public class IntegerType extends PrimitiveType implements IBaseIntegerDatatype { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public IntegerType() { - // nothing - } - - /** - * Constructor - */ - public IntegerType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public IntegerType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * Constructor - * - * @param theValue The value - * @throws IllegalArgumentException If the value is too large to fit in a signed integer - */ - public IntegerType(Long theValue) { - if (theValue < java.lang.Integer.MIN_VALUE || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } - if(theValue!=null) { - setValue((int)theValue.longValue()); - } - } - - @Override - protected Integer parse(String theValue) { - try { - return Integer.parseInt(theValue); - } catch (NumberFormatException e) { - throw new IllegalArgumentException(e); - } - } - - @Override - protected String encode(Integer theValue) { - return Integer.toString(theValue); - } - - @Override - public IntegerType copy() { - return new IntegerType(getValue()); - } - - public String fhirType() { - return "integer"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Library.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Library.java deleted file mode 100644 index a99bbff83f0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Library.java +++ /dev/null @@ -1,2090 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The Library resource provides a representation container for knowledge artifact component definitions. It is effectively an exposure of the header information for a CQL/ELM library. - */ -@ResourceDef(name="Library", profile="http://hl7.org/fhir/Profile/Library") -public class Library extends DomainResource { - - @Block() - public static class LibraryModelComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name element defines the local name of the model as used within the library. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the model", formalDefinition="The name element defines the local name of the model as used within the library." ) - protected StringType name; - - /** - * The identifier element specifies the global, non-version-specific identifier for the model. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The identifier of the model", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the model." ) - protected StringType identifier; - - /** - * The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The version of the model, if any", formalDefinition="The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied." ) - protected StringType version; - - private static final long serialVersionUID = -862601139L; - - /** - * Constructor - */ - public LibraryModelComponent() { - super(); - } - - /** - * Constructor - */ - public LibraryModelComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #name} (The name element defines the local name of the model as used within the library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryModelComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name element defines the local name of the model as used within the library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public LibraryModelComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name element defines the local name of the model as used within the library. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name element defines the local name of the model as used within the library. - */ - public LibraryModelComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryModelComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public LibraryModelComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier element specifies the global, non-version-specific identifier for the model. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier element specifies the global, non-version-specific identifier for the model. - */ - public LibraryModelComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryModelComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public LibraryModelComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied. - */ - public LibraryModelComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name element defines the local name of the model as used within the library.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the model.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version element, if present, identifies the specific version of the model to be used. If no version is specified, the most recent published version of the model is implied.", 0, java.lang.Integer.MAX_VALUE, version)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.version"); - } - else - return super.addChild(name); - } - - public LibraryModelComponent copy() { - LibraryModelComponent dst = new LibraryModelComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LibraryModelComponent)) - return false; - LibraryModelComponent o = (LibraryModelComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LibraryModelComponent)) - return false; - LibraryModelComponent o = (LibraryModelComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()); - } - - public String fhirType() { - return "Library.model"; - - } - - } - - @Block() - public static class LibraryLibraryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name element defines the local name of the referenced library. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the library", formalDefinition="The name element defines the local name of the referenced library." ) - protected StringType name; - - /** - * The identifier element specifies the global, non-version-specific identifier for the library. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The identifier of the library", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the library." ) - protected StringType identifier; - - /** - * The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The version of the library, if any", formalDefinition="The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied." ) - protected StringType version; - - /** - * The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document. - */ - @Child(name = "document", type = {Attachment.class, ModuleDefinition.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The content of the library", formalDefinition="The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document." ) - protected Type document; - - private static final long serialVersionUID = 1633488790L; - - /** - * Constructor - */ - public LibraryLibraryComponent() { - super(); - } - - /** - * Constructor - */ - public LibraryLibraryComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #name} (The name element defines the local name of the referenced library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryLibraryComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name element defines the local name of the referenced library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public LibraryLibraryComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name element defines the local name of the referenced library. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name element defines the local name of the referenced library. - */ - public LibraryLibraryComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryLibraryComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public LibraryLibraryComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier element specifies the global, non-version-specific identifier for the library. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier element specifies the global, non-version-specific identifier for the library. - */ - public LibraryLibraryComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryLibraryComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public LibraryLibraryComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied. - */ - public LibraryLibraryComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) - */ - public Type getDocument() { - return this.document; - } - - /** - * @return {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) - */ - public Attachment getDocumentAttachment() throws FHIRException { - if (!(this.document instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.document.getClass().getName()+" was encountered"); - return (Attachment) this.document; - } - - public boolean hasDocumentAttachment() { - return this.document instanceof Attachment; - } - - /** - * @return {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) - */ - public Reference getDocumentReference() throws FHIRException { - if (!(this.document instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.document.getClass().getName()+" was encountered"); - return (Reference) this.document; - } - - public boolean hasDocumentReference() { - return this.document instanceof Reference; - } - - public boolean hasDocument() { - return this.document != null && !this.document.isEmpty(); - } - - /** - * @param value {@link #document} (The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) - */ - public LibraryLibraryComponent setDocument(Type value) { - this.document = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name element defines the local name of the referenced library.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the library.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version element, if present, identifies the specific version of the library to be used. If no version is specified, the most recent published version of the library is implied.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("document[x]", "Attachment|Reference(ModuleDefinition)", "The content of the referenced library as an Attachment, or a reference to the Library resource. If the document is an attachment, it may be a reference to a url from which the library document may be retrieved, or it may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.", 0, java.lang.Integer.MAX_VALUE, document)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 861720859: // document - this.document = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("document[x]")) - this.document = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 506673541: return getDocument(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.version"); - } - else if (name.equals("documentAttachment")) { - this.document = new Attachment(); - return this.document; - } - else if (name.equals("documentReference")) { - this.document = new Reference(); - return this.document; - } - else - return super.addChild(name); - } - - public LibraryLibraryComponent copy() { - LibraryLibraryComponent dst = new LibraryLibraryComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.document = document == null ? null : document.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LibraryLibraryComponent)) - return false; - LibraryLibraryComponent o = (LibraryLibraryComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(document, o.document, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LibraryLibraryComponent)) - return false; - LibraryLibraryComponent o = (LibraryLibraryComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (document == null || document.isEmpty()); - } - - public String fhirType() { - return "Library.library"; - - } - - } - - @Block() - public static class LibraryCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the code system", formalDefinition="The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition." ) - protected StringType name; - - /** - * The identifier element specifies the global, non-version-specific identifier for the code system. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The identifier of the code system", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the code system." ) - protected StringType identifier; - - /** - * The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The version of the code system, if any", formalDefinition="The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied." ) - protected StringType version; - - private static final long serialVersionUID = -862601139L; - - /** - * Constructor - */ - public LibraryCodeSystemComponent() { - super(); - } - - /** - * Constructor - */ - public LibraryCodeSystemComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #name} (The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryCodeSystemComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public LibraryCodeSystemComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition. - */ - public LibraryCodeSystemComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the code system.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryCodeSystemComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the code system.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public LibraryCodeSystemComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier element specifies the global, non-version-specific identifier for the code system. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier element specifies the global, non-version-specific identifier for the code system. - */ - public LibraryCodeSystemComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryCodeSystemComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public LibraryCodeSystemComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied. - */ - public LibraryCodeSystemComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name element specifies the local name of the code system as used within the library. This name is also used when the code system is referenced from a value set element to determine the version of the code system to be used when computed the expansion of the value set definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the code system.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version element, if present, identifies the specific version of the library to be used. If no code system is specified, the most recent published version of the code system is implied.", 0, java.lang.Integer.MAX_VALUE, version)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.version"); - } - else - return super.addChild(name); - } - - public LibraryCodeSystemComponent copy() { - LibraryCodeSystemComponent dst = new LibraryCodeSystemComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LibraryCodeSystemComponent)) - return false; - LibraryCodeSystemComponent o = (LibraryCodeSystemComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LibraryCodeSystemComponent)) - return false; - LibraryCodeSystemComponent o = (LibraryCodeSystemComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()); - } - - public String fhirType() { - return "Library.codeSystem"; - - } - - } - - @Block() - public static class LibraryValueSetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name element specifies the local name of the value set used within the library. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the value set", formalDefinition="The name element specifies the local name of the value set used within the library." ) - protected StringType name; - - /** - * The identifier element specifies the global, non-version-specific identifier for the value set. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The identifier of the value set", formalDefinition="The identifier element specifies the global, non-version-specific identifier for the value set." ) - protected StringType identifier; - - /** - * The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The version of the value set", formalDefinition="The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied." ) - protected StringType version; - - /** - * The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version. - */ - @Child(name = "codeSystem", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The code system binding for this value set definition", formalDefinition="The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version." ) - protected List codeSystem; - - private static final long serialVersionUID = 338950096L; - - /** - * Constructor - */ - public LibraryValueSetComponent() { - super(); - } - - /** - * Constructor - */ - public LibraryValueSetComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #name} (The name element specifies the local name of the value set used within the library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryValueSetComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name element specifies the local name of the value set used within the library.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public LibraryValueSetComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name element specifies the local name of the value set used within the library. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name element specifies the local name of the value set used within the library. - */ - public LibraryValueSetComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the value set.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryValueSetComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier element specifies the global, non-version-specific identifier for the value set.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public LibraryValueSetComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier element specifies the global, non-version-specific identifier for the value set. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier element specifies the global, non-version-specific identifier for the value set. - */ - public LibraryValueSetComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LibraryValueSetComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public LibraryValueSetComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied. - */ - public LibraryValueSetComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) - */ - public List getCodeSystem() { - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - return this.codeSystem; - } - - public boolean hasCodeSystem() { - if (this.codeSystem == null) - return false; - for (StringType item : this.codeSystem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) - */ - // syntactic sugar - public StringType addCodeSystemElement() {//2 - StringType t = new StringType(); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return t; - } - - /** - * @param value {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) - */ - public LibraryValueSetComponent addCodeSystem(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return this; - } - - /** - * @param value {@link #codeSystem} (The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.) - */ - public boolean hasCodeSystem(String value) { - if (this.codeSystem == null) - return false; - for (StringType v : this.codeSystem) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name element specifies the local name of the value set used within the library.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The identifier element specifies the global, non-version-specific identifier for the value set.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version element, if present, determines the specific version of the value set definition that is used by the library. If no version is specified, the latest published version of the value set definition is implied.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("codeSystem", "string", "The codeSystem element determines which code system binding to use to compute the expansion of the value set definition. The codeSystem element specified here will correspond to a code system element, which is used to determine the code system version.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case -916511108: // codeSystem - this.getCodeSystem().add(castToString(value)); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("codeSystem")) - this.getCodeSystem().add(castToString(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case -916511108: throw new FHIRException("Cannot make property codeSystem as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.version"); - } - else if (name.equals("codeSystem")) { - throw new FHIRException("Cannot call addChild on a primitive type Library.codeSystem"); - } - else - return super.addChild(name); - } - - public LibraryValueSetComponent copy() { - LibraryValueSetComponent dst = new LibraryValueSetComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - if (codeSystem != null) { - dst.codeSystem = new ArrayList(); - for (StringType i : codeSystem) - dst.codeSystem.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LibraryValueSetComponent)) - return false; - LibraryValueSetComponent o = (LibraryValueSetComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(codeSystem, o.codeSystem, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LibraryValueSetComponent)) - return false; - LibraryValueSetComponent o = (LibraryValueSetComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - && compareValues(codeSystem, o.codeSystem, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) - ; - } - - public String fhirType() { - return "Library.valueSet"; - - } - - } - - /** - * The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence. - */ - @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The metadata information for the library", formalDefinition="The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence." ) - protected ModuleMetadata moduleMetadata; - - /** - * A model element describes the model and version used by the library. - */ - @Child(name = "model", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A model used by the library", formalDefinition="A model element describes the model and version used by the library." ) - protected List model; - - /** - * A library element describes a library referenced by this library. - */ - @Child(name = "library", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A library referenced by this library", formalDefinition="A library element describes a library referenced by this library." ) - protected List library; - - /** - * A code system definition used within the library. - */ - @Child(name = "codeSystem", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A code system used by the library", formalDefinition="A code system definition used within the library." ) - protected List codeSystem; - - /** - * A value set definition referenced by the library. - */ - @Child(name = "valueSet", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A value set used by the library", formalDefinition="A value set definition referenced by the library." ) - protected List valueSet; - - /** - * The parameter element defines parameters used by the library. - */ - @Child(name = "parameter", type = {ParameterDefinition.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Parameters defined by the library", formalDefinition="The parameter element defines parameters used by the library." ) - protected List parameter; - - /** - * The dataRequirement element specifies a data requirement used by some expression within the library. - */ - @Child(name = "dataRequirement", type = {DataRequirement.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Data requirements of the library", formalDefinition="The dataRequirement element specifies a data requirement used by some expression within the library." ) - protected List dataRequirement; - - /** - * The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document. - */ - @Child(name = "document", type = {Attachment.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The content of the library", formalDefinition="The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document." ) - protected Attachment document; - - private static final long serialVersionUID = 36997599L; - - /** - * Constructor - */ - public Library() { - super(); - } - - /** - * Constructor - */ - public Library(Attachment document) { - super(); - this.document = document; - } - - /** - * @return {@link #moduleMetadata} (The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public ModuleMetadata getModuleMetadata() { - if (this.moduleMetadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Library.moduleMetadata"); - else if (Configuration.doAutoCreate()) - this.moduleMetadata = new ModuleMetadata(); // cc - return this.moduleMetadata; - } - - public boolean hasModuleMetadata() { - return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); - } - - /** - * @param value {@link #moduleMetadata} (The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public Library setModuleMetadata(ModuleMetadata value) { - this.moduleMetadata = value; - return this; - } - - /** - * @return {@link #model} (A model element describes the model and version used by the library.) - */ - public List getModel() { - if (this.model == null) - this.model = new ArrayList(); - return this.model; - } - - public boolean hasModel() { - if (this.model == null) - return false; - for (LibraryModelComponent item : this.model) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #model} (A model element describes the model and version used by the library.) - */ - // syntactic sugar - public LibraryModelComponent addModel() { //3 - LibraryModelComponent t = new LibraryModelComponent(); - if (this.model == null) - this.model = new ArrayList(); - this.model.add(t); - return t; - } - - // syntactic sugar - public Library addModel(LibraryModelComponent t) { //3 - if (t == null) - return this; - if (this.model == null) - this.model = new ArrayList(); - this.model.add(t); - return this; - } - - /** - * @return {@link #library} (A library element describes a library referenced by this library.) - */ - public List getLibrary() { - if (this.library == null) - this.library = new ArrayList(); - return this.library; - } - - public boolean hasLibrary() { - if (this.library == null) - return false; - for (LibraryLibraryComponent item : this.library) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #library} (A library element describes a library referenced by this library.) - */ - // syntactic sugar - public LibraryLibraryComponent addLibrary() { //3 - LibraryLibraryComponent t = new LibraryLibraryComponent(); - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return t; - } - - // syntactic sugar - public Library addLibrary(LibraryLibraryComponent t) { //3 - if (t == null) - return this; - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return this; - } - - /** - * @return {@link #codeSystem} (A code system definition used within the library.) - */ - public List getCodeSystem() { - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - return this.codeSystem; - } - - public boolean hasCodeSystem() { - if (this.codeSystem == null) - return false; - for (LibraryCodeSystemComponent item : this.codeSystem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeSystem} (A code system definition used within the library.) - */ - // syntactic sugar - public LibraryCodeSystemComponent addCodeSystem() { //3 - LibraryCodeSystemComponent t = new LibraryCodeSystemComponent(); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return t; - } - - // syntactic sugar - public Library addCodeSystem(LibraryCodeSystemComponent t) { //3 - if (t == null) - return this; - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return this; - } - - /** - * @return {@link #valueSet} (A value set definition referenced by the library.) - */ - public List getValueSet() { - if (this.valueSet == null) - this.valueSet = new ArrayList(); - return this.valueSet; - } - - public boolean hasValueSet() { - if (this.valueSet == null) - return false; - for (LibraryValueSetComponent item : this.valueSet) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueSet} (A value set definition referenced by the library.) - */ - // syntactic sugar - public LibraryValueSetComponent addValueSet() { //3 - LibraryValueSetComponent t = new LibraryValueSetComponent(); - if (this.valueSet == null) - this.valueSet = new ArrayList(); - this.valueSet.add(t); - return t; - } - - // syntactic sugar - public Library addValueSet(LibraryValueSetComponent t) { //3 - if (t == null) - return this; - if (this.valueSet == null) - this.valueSet = new ArrayList(); - this.valueSet.add(t); - return this; - } - - /** - * @return {@link #parameter} (The parameter element defines parameters used by the library.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ParameterDefinition item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (The parameter element defines parameters used by the library.) - */ - // syntactic sugar - public ParameterDefinition addParameter() { //3 - ParameterDefinition t = new ParameterDefinition(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public Library addParameter(ParameterDefinition t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - /** - * @return {@link #dataRequirement} (The dataRequirement element specifies a data requirement used by some expression within the library.) - */ - public List getDataRequirement() { - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - return this.dataRequirement; - } - - public boolean hasDataRequirement() { - if (this.dataRequirement == null) - return false; - for (DataRequirement item : this.dataRequirement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dataRequirement} (The dataRequirement element specifies a data requirement used by some expression within the library.) - */ - // syntactic sugar - public DataRequirement addDataRequirement() { //3 - DataRequirement t = new DataRequirement(); - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - this.dataRequirement.add(t); - return t; - } - - // syntactic sugar - public Library addDataRequirement(DataRequirement t) { //3 - if (t == null) - return this; - if (this.dataRequirement == null) - this.dataRequirement = new ArrayList(); - this.dataRequirement.add(t); - return this; - } - - /** - * @return {@link #document} (The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) - */ - public Attachment getDocument() { - if (this.document == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Library.document"); - else if (Configuration.doAutoCreate()) - this.document = new Attachment(); // cc - return this.document; - } - - public boolean hasDocument() { - return this.document != null && !this.document.isEmpty(); - } - - /** - * @param value {@link #document} (The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.) - */ - public Library setDocument(Attachment value) { - this.document = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the library, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); - childrenList.add(new Property("model", "", "A model element describes the model and version used by the library.", 0, java.lang.Integer.MAX_VALUE, model)); - childrenList.add(new Property("library", "", "A library element describes a library referenced by this library.", 0, java.lang.Integer.MAX_VALUE, library)); - childrenList.add(new Property("codeSystem", "", "A code system definition used within the library.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("valueSet", "", "A value set definition referenced by the library.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - childrenList.add(new Property("parameter", "ParameterDefinition", "The parameter element defines parameters used by the library.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("dataRequirement", "DataRequirement", "The dataRequirement element specifies a data requirement used by some expression within the library.", 0, java.lang.Integer.MAX_VALUE, dataRequirement)); - childrenList.add(new Property("document", "Attachment", "The content of the library as an Attachment. The content may be a reference to a url, or may be directly embedded as a base-64 string. Either way, the content is expected to be a CQL or ELM document.", 0, java.lang.Integer.MAX_VALUE, document)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata - case 104069929: /*model*/ return this.model == null ? new Base[0] : this.model.toArray(new Base[this.model.size()]); // LibraryModelComponent - case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // LibraryLibraryComponent - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // LibraryCodeSystemComponent - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : this.valueSet.toArray(new Base[this.valueSet.size()]); // LibraryValueSetComponent - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParameterDefinition - case 629147193: /*dataRequirement*/ return this.dataRequirement == null ? new Base[0] : this.dataRequirement.toArray(new Base[this.dataRequirement.size()]); // DataRequirement - case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 455891387: // moduleMetadata - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - break; - case 104069929: // model - this.getModel().add((LibraryModelComponent) value); // LibraryModelComponent - break; - case 166208699: // library - this.getLibrary().add((LibraryLibraryComponent) value); // LibraryLibraryComponent - break; - case -916511108: // codeSystem - this.getCodeSystem().add((LibraryCodeSystemComponent) value); // LibraryCodeSystemComponent - break; - case -1410174671: // valueSet - this.getValueSet().add((LibraryValueSetComponent) value); // LibraryValueSetComponent - break; - case 1954460585: // parameter - this.getParameter().add(castToParameterDefinition(value)); // ParameterDefinition - break; - case 629147193: // dataRequirement - this.getDataRequirement().add(castToDataRequirement(value)); // DataRequirement - break; - case 861720859: // document - this.document = castToAttachment(value); // Attachment - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("moduleMetadata")) - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - else if (name.equals("model")) - this.getModel().add((LibraryModelComponent) value); - else if (name.equals("library")) - this.getLibrary().add((LibraryLibraryComponent) value); - else if (name.equals("codeSystem")) - this.getCodeSystem().add((LibraryCodeSystemComponent) value); - else if (name.equals("valueSet")) - this.getValueSet().add((LibraryValueSetComponent) value); - else if (name.equals("parameter")) - this.getParameter().add(castToParameterDefinition(value)); - else if (name.equals("dataRequirement")) - this.getDataRequirement().add(castToDataRequirement(value)); - else if (name.equals("document")) - this.document = castToAttachment(value); // Attachment - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 455891387: return getModuleMetadata(); // ModuleMetadata - case 104069929: return addModel(); // LibraryModelComponent - case 166208699: return addLibrary(); // LibraryLibraryComponent - case -916511108: return addCodeSystem(); // LibraryCodeSystemComponent - case -1410174671: return addValueSet(); // LibraryValueSetComponent - case 1954460585: return addParameter(); // ParameterDefinition - case 629147193: return addDataRequirement(); // DataRequirement - case 861720859: return getDocument(); // Attachment - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("moduleMetadata")) { - this.moduleMetadata = new ModuleMetadata(); - return this.moduleMetadata; - } - else if (name.equals("model")) { - return addModel(); - } - else if (name.equals("library")) { - return addLibrary(); - } - else if (name.equals("codeSystem")) { - return addCodeSystem(); - } - else if (name.equals("valueSet")) { - return addValueSet(); - } - else if (name.equals("parameter")) { - return addParameter(); - } - else if (name.equals("dataRequirement")) { - return addDataRequirement(); - } - else if (name.equals("document")) { - this.document = new Attachment(); - return this.document; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Library"; - - } - - public Library copy() { - Library dst = new Library(); - copyValues(dst); - dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); - if (model != null) { - dst.model = new ArrayList(); - for (LibraryModelComponent i : model) - dst.model.add(i.copy()); - }; - if (library != null) { - dst.library = new ArrayList(); - for (LibraryLibraryComponent i : library) - dst.library.add(i.copy()); - }; - if (codeSystem != null) { - dst.codeSystem = new ArrayList(); - for (LibraryCodeSystemComponent i : codeSystem) - dst.codeSystem.add(i.copy()); - }; - if (valueSet != null) { - dst.valueSet = new ArrayList(); - for (LibraryValueSetComponent i : valueSet) - dst.valueSet.add(i.copy()); - }; - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ParameterDefinition i : parameter) - dst.parameter.add(i.copy()); - }; - if (dataRequirement != null) { - dst.dataRequirement = new ArrayList(); - for (DataRequirement i : dataRequirement) - dst.dataRequirement.add(i.copy()); - }; - dst.document = document == null ? null : document.copy(); - return dst; - } - - protected Library typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Library)) - return false; - Library o = (Library) other; - return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(model, o.model, true) - && compareDeep(library, o.library, true) && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(valueSet, o.valueSet, true) - && compareDeep(parameter, o.parameter, true) && compareDeep(dataRequirement, o.dataRequirement, true) - && compareDeep(document, o.document, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Library)) - return false; - Library o = (Library) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (model == null || model.isEmpty()) - && (library == null || library.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) - && (valueSet == null || valueSet.isEmpty()) && (parameter == null || parameter.isEmpty()) - && (dataRequirement == null || dataRequirement.isEmpty()) && (document == null || document.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Library; - } - - /** - * Search parameter: topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: Library.moduleMetadata.topic
- *

- */ - @SearchParamDefinition(name="topic", path="Library.moduleMetadata.topic", description="Topics associated with the module", type="token" ) - public static final String SP_TOPIC = "topic"; - /** - * Fluent Client search parameter constant for topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: Library.moduleMetadata.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); - - /** - * Search parameter: title - *

- * Description: Text search against the title
- * Type: string
- * Path: Library.moduleMetadata.title
- *

- */ - @SearchParamDefinition(name="title", path="Library.moduleMetadata.title", description="Text search against the title", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Text search against the title
- * Type: string
- * Path: Library.moduleMetadata.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: status - *

- * Description: Status of the module
- * Type: token
- * Path: Library.moduleMetadata.status
- *

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

- * Description: Status of the module
- * Type: token
- * Path: Library.moduleMetadata.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search against the description
- * Type: string
- * Path: Library.moduleMetadata.description
- *

- */ - @SearchParamDefinition(name="description", path="Library.moduleMetadata.description", description="Text search against the description", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search against the description
- * Type: string
- * Path: Library.moduleMetadata.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: Library.moduleMetadata.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Library.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: Library.moduleMetadata.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: Library.moduleMetadata.version
- *

- */ - @SearchParamDefinition(name="version", path="Library.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: Library.moduleMetadata.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Linkage.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Linkage.java deleted file mode 100644 index 5d8938b6143..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Linkage.java +++ /dev/null @@ -1,660 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". - */ -@ResourceDef(name="Linkage", profile="http://hl7.org/fhir/Profile/Linkage") -public class Linkage extends DomainResource { - - public enum LinkageType { - /** - * The record represents the "source of truth" (from the perspective of this Linkage resource) for the underlying event/condition/etc. - */ - SOURCE, - /** - * The record represents the alternative view of the underlying event/condition/etc. The record may still be actively maintained, even though it is not considered to be the source of truth. - */ - ALTERNATE, - /** - * The record represents an obsolete record of the underlyng event/condition/etc. It is not expected to be actively maintained. - */ - HISTORICAL, - /** - * added to help the parsers - */ - NULL; - public static LinkageType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return SOURCE; - if ("alternate".equals(codeString)) - return ALTERNATE; - if ("historical".equals(codeString)) - return HISTORICAL; - throw new FHIRException("Unknown LinkageType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SOURCE: return "source"; - case ALTERNATE: return "alternate"; - case HISTORICAL: return "historical"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SOURCE: return "http://hl7.org/fhir/linkage-type"; - case ALTERNATE: return "http://hl7.org/fhir/linkage-type"; - case HISTORICAL: return "http://hl7.org/fhir/linkage-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SOURCE: return "The record represents the \"source of truth\" (from the perspective of this Linkage resource) for the underlying event/condition/etc."; - case ALTERNATE: return "The record represents the alternative view of the underlying event/condition/etc. The record may still be actively maintained, even though it is not considered to be the source of truth."; - case HISTORICAL: return "The record represents an obsolete record of the underlyng event/condition/etc. It is not expected to be actively maintained."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SOURCE: return "Source of truth"; - case ALTERNATE: return "Alternate record"; - case HISTORICAL: return "Historical/obsolete record"; - default: return "?"; - } - } - } - - public static class LinkageTypeEnumFactory implements EnumFactory { - public LinkageType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return LinkageType.SOURCE; - if ("alternate".equals(codeString)) - return LinkageType.ALTERNATE; - if ("historical".equals(codeString)) - return LinkageType.HISTORICAL; - throw new IllegalArgumentException("Unknown LinkageType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return new Enumeration(this, LinkageType.SOURCE); - if ("alternate".equals(codeString)) - return new Enumeration(this, LinkageType.ALTERNATE); - if ("historical".equals(codeString)) - return new Enumeration(this, LinkageType.HISTORICAL); - throw new FHIRException("Unknown LinkageType code '"+codeString+"'"); - } - public String toCode(LinkageType code) { - if (code == LinkageType.SOURCE) - return "source"; - if (code == LinkageType.ALTERNATE) - return "alternate"; - if (code == LinkageType.HISTORICAL) - return "historical"; - return "?"; - } - public String toSystem(LinkageType code) { - return code.getSystem(); - } - } - - @Block() - public static class LinkageItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="source | alternate | historical", formalDefinition="Distinguishes which item is \"source of truth\" (if any) and which items are no longer considered to be current representations." ) - protected Enumeration type; - - /** - * The resource instance being linked as part of the group. - */ - @Child(name = "resource", type = {Reference.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource being linked", formalDefinition="The resource instance being linked as part of the group." ) - protected Reference resource; - - private static final long serialVersionUID = 527428511L; - - /** - * Constructor - */ - public LinkageItemComponent() { - super(); - } - - /** - * Constructor - */ - public LinkageItemComponent(Enumeration type, Reference resource) { - super(); - this.type = type; - this.resource = resource; - } - - /** - * @return {@link #type} (Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LinkageItemComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new LinkageTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public LinkageItemComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. - */ - public LinkageType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current representations. - */ - public LinkageItemComponent setType(LinkageType value) { - if (this.type == null) - this.type = new Enumeration(new LinkageTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #resource} (The resource instance being linked as part of the group.) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LinkageItemComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The resource instance being linked as part of the group.) - */ - public LinkageItemComponent setResource(Reference value) { - this.resource = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Distinguishes which item is \"source of truth\" (if any) and which items are no longer considered to be current representations.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("resource", "Reference", "The resource instance being linked as part of the group.", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new LinkageTypeEnumFactory().fromType(value); // Enumeration - break; - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new LinkageTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -341064690: return getResource(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Linkage.type"); - } - else if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else - return super.addChild(name); - } - - public LinkageItemComponent copy() { - LinkageItemComponent dst = new LinkageItemComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.resource = resource == null ? null : resource.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LinkageItemComponent)) - return false; - LinkageItemComponent o = (LinkageItemComponent) other; - return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LinkageItemComponent)) - return false; - LinkageItemComponent o = (LinkageItemComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (resource == null || resource.isEmpty()) - ; - } - - public String fhirType() { - return "Linkage.item"; - - } - - } - - /** - * Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage. - */ - @Child(name = "author", type = {Practitioner.class, Organization.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who is responsible for linkages", formalDefinition="Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) - */ - protected Resource authorTarget; - - /** - * Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items. - */ - @Child(name = "item", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Item to be linked", formalDefinition="Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items." ) - protected List item; - - private static final long serialVersionUID = 371266420L; - - /** - * Constructor - */ - public Linkage() { - super(); - } - - /** - * @return {@link #author} (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Linkage.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) - */ - public Linkage setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.) - */ - public Linkage setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #item} (Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (LinkageItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.) - */ - // syntactic sugar - public LinkageItemComponent addItem() { //3 - LinkageItemComponent t = new LinkageItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public Linkage addItem(LinkageItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("author", "Reference(Practitioner|Organization)", "Identifies the user or organization responsible for asserting the linkages and who establishes the context for evaluating the nature of each linkage.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("item", "", "Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items hould be evaluated within the collection of linked items.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // LinkageItemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 3242771: // item - this.getItem().add((LinkageItemComponent) value); // LinkageItemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("item")) - this.getItem().add((LinkageItemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1406328437: return getAuthor(); // Reference - case 3242771: return addItem(); // LinkageItemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Linkage"; - - } - - public Linkage copy() { - Linkage dst = new Linkage(); - copyValues(dst); - dst.author = author == null ? null : author.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (LinkageItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - protected Linkage typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Linkage)) - return false; - Linkage o = (Linkage) other; - return compareDeep(author, o.author, true) && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Linkage)) - return false; - Linkage o = (Linkage) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (author == null || author.isEmpty()) && (item == null || item.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Linkage; - } - - /** - * Search parameter: author - *

- * Description: Author of the Linkage
- * Type: reference
- * Path: Linkage.author
- *

- */ - @SearchParamDefinition(name="author", path="Linkage.author", description="Author of the Linkage", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: Author of the Linkage
- * Type: reference
- * Path: Linkage.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Linkage:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("Linkage:author").toLocked(); - - /** - * Search parameter: source - *

- * Description: Matches on any item in the Linkage with a type of 'source'
- * Type: reference
- * Path: Linkage.item.resource
- *

- */ - @SearchParamDefinition(name="source", path="Linkage.item.resource", description="Matches on any item in the Linkage with a type of 'source'", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Matches on any item in the Linkage with a type of 'source'
- * Type: reference
- * Path: Linkage.item.resource
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Linkage:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("Linkage:source").toLocked(); - - /** - * Search parameter: item - *

- * Description: Matches on any item in the Linkage
- * Type: reference
- * Path: Linkage.item.resource
- *

- */ - @SearchParamDefinition(name="item", path="Linkage.item.resource", description="Matches on any item in the Linkage", type="reference" ) - public static final String SP_ITEM = "item"; - /** - * Fluent Client search parameter constant for item - *

- * Description: Matches on any item in the Linkage
- * Type: reference
- * Path: Linkage.item.resource
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ITEM); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Linkage:item". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ITEM = new ca.uhn.fhir.model.api.Include("Linkage:item").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ListResource.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ListResource.java deleted file mode 100644 index 6d2febe1179..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ListResource.java +++ /dev/null @@ -1,1761 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A set of information summarized from a list of other resources. - */ -@ResourceDef(name="List", profile="http://hl7.org/fhir/Profile/ListResource") -public class ListResource extends DomainResource { - - public enum ListStatus { - /** - * The list is considered to be an active part of the patient's record. - */ - CURRENT, - /** - * The list is "old" and should no longer be considered accurate or relevant. - */ - RETIRED, - /** - * The list was never accurate. It is retained for medico-legal purposes only. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ListStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return CURRENT; - if ("retired".equals(codeString)) - return RETIRED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown ListStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CURRENT: return "current"; - case RETIRED: return "retired"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CURRENT: return "http://hl7.org/fhir/list-status"; - case RETIRED: return "http://hl7.org/fhir/list-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/list-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CURRENT: return "The list is considered to be an active part of the patient's record."; - case RETIRED: return "The list is \"old\" and should no longer be considered accurate or relevant."; - case ENTEREDINERROR: return "The list was never accurate. It is retained for medico-legal purposes only."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CURRENT: return "Current"; - case RETIRED: return "Retired"; - case ENTEREDINERROR: return "Entered In Error"; - default: return "?"; - } - } - } - - public static class ListStatusEnumFactory implements EnumFactory { - public ListStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return ListStatus.CURRENT; - if ("retired".equals(codeString)) - return ListStatus.RETIRED; - if ("entered-in-error".equals(codeString)) - return ListStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ListStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("current".equals(codeString)) - return new Enumeration(this, ListStatus.CURRENT); - if ("retired".equals(codeString)) - return new Enumeration(this, ListStatus.RETIRED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, ListStatus.ENTEREDINERROR); - throw new FHIRException("Unknown ListStatus code '"+codeString+"'"); - } - public String toCode(ListStatus code) { - if (code == ListStatus.CURRENT) - return "current"; - if (code == ListStatus.RETIRED) - return "retired"; - if (code == ListStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(ListStatus code) { - return code.getSystem(); - } - } - - public enum ListMode { - /** - * This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes - */ - WORKING, - /** - * This list was prepared as a snapshot. It should not be assumed to be current - */ - SNAPSHOT, - /** - * A list that indicates where changes have been made or recommended - */ - CHANGES, - /** - * added to help the parsers - */ - NULL; - public static ListMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("working".equals(codeString)) - return WORKING; - if ("snapshot".equals(codeString)) - return SNAPSHOT; - if ("changes".equals(codeString)) - return CHANGES; - throw new FHIRException("Unknown ListMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case WORKING: return "working"; - case SNAPSHOT: return "snapshot"; - case CHANGES: return "changes"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case WORKING: return "http://hl7.org/fhir/list-mode"; - case SNAPSHOT: return "http://hl7.org/fhir/list-mode"; - case CHANGES: return "http://hl7.org/fhir/list-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case WORKING: return "This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is tracking changes"; - case SNAPSHOT: return "This list was prepared as a snapshot. It should not be assumed to be current"; - case CHANGES: return "A list that indicates where changes have been made or recommended"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case WORKING: return "Working List"; - case SNAPSHOT: return "Snapshot List"; - case CHANGES: return "Change List"; - default: return "?"; - } - } - } - - public static class ListModeEnumFactory implements EnumFactory { - public ListMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("working".equals(codeString)) - return ListMode.WORKING; - if ("snapshot".equals(codeString)) - return ListMode.SNAPSHOT; - if ("changes".equals(codeString)) - return ListMode.CHANGES; - throw new IllegalArgumentException("Unknown ListMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("working".equals(codeString)) - return new Enumeration(this, ListMode.WORKING); - if ("snapshot".equals(codeString)) - return new Enumeration(this, ListMode.SNAPSHOT); - if ("changes".equals(codeString)) - return new Enumeration(this, ListMode.CHANGES); - throw new FHIRException("Unknown ListMode code '"+codeString+"'"); - } - public String toCode(ListMode code) { - if (code == ListMode.WORKING) - return "working"; - if (code == ListMode.SNAPSHOT) - return "snapshot"; - if (code == ListMode.CHANGES) - return "changes"; - return "?"; - } - public String toSystem(ListMode code) { - return code.getSystem(); - } - } - - @Block() - public static class ListEntryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The flag allows the system constructing the list to indicate the role and significance of the item in the list. - */ - @Child(name = "flag", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Status/Workflow information about this item", formalDefinition="The flag allows the system constructing the list to indicate the role and significance of the item in the list." ) - protected CodeableConcept flag; - - /** - * True if this item is marked as deleted in the list. - */ - @Child(name = "deleted", type = {BooleanType.class}, order=2, min=0, max=1, modifier=true, summary=false) - @Description(shortDefinition="If this item is actually marked as deleted", formalDefinition="True if this item is marked as deleted in the list." ) - protected BooleanType deleted; - - /** - * When this item was added to the list. - */ - @Child(name = "date", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When item added to list", formalDefinition="When this item was added to the list." ) - protected DateTimeType date; - - /** - * A reference to the actual resource from which data was derived. - */ - @Child(name = "item", type = {}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Actual entry", formalDefinition="A reference to the actual resource from which data was derived." ) - protected Reference item; - - /** - * The actual object that is the target of the reference (A reference to the actual resource from which data was derived.) - */ - protected Resource itemTarget; - - private static final long serialVersionUID = -758164425L; - - /** - * Constructor - */ - public ListEntryComponent() { - super(); - } - - /** - * Constructor - */ - public ListEntryComponent(Reference item) { - super(); - this.item = item; - } - - /** - * @return {@link #flag} (The flag allows the system constructing the list to indicate the role and significance of the item in the list.) - */ - public CodeableConcept getFlag() { - if (this.flag == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.flag"); - else if (Configuration.doAutoCreate()) - this.flag = new CodeableConcept(); // cc - return this.flag; - } - - public boolean hasFlag() { - return this.flag != null && !this.flag.isEmpty(); - } - - /** - * @param value {@link #flag} (The flag allows the system constructing the list to indicate the role and significance of the item in the list.) - */ - public ListEntryComponent setFlag(CodeableConcept value) { - this.flag = value; - return this; - } - - /** - * @return {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value - */ - public BooleanType getDeletedElement() { - if (this.deleted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.deleted"); - else if (Configuration.doAutoCreate()) - this.deleted = new BooleanType(); // bb - return this.deleted; - } - - public boolean hasDeletedElement() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - public boolean hasDeleted() { - return this.deleted != null && !this.deleted.isEmpty(); - } - - /** - * @param value {@link #deleted} (True if this item is marked as deleted in the list.). This is the underlying object with id, value and extensions. The accessor "getDeleted" gives direct access to the value - */ - public ListEntryComponent setDeletedElement(BooleanType value) { - this.deleted = value; - return this; - } - - /** - * @return True if this item is marked as deleted in the list. - */ - public boolean getDeleted() { - return this.deleted == null || this.deleted.isEmpty() ? false : this.deleted.getValue(); - } - - /** - * @param value True if this item is marked as deleted in the list. - */ - public ListEntryComponent setDeleted(boolean value) { - if (this.deleted == null) - this.deleted = new BooleanType(); - this.deleted.setValue(value); - return this; - } - - /** - * @return {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When this item was added to the list.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ListEntryComponent setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When this item was added to the list. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When this item was added to the list. - */ - public ListEntryComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #item} (A reference to the actual resource from which data was derived.) - */ - public Reference getItem() { - if (this.item == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListEntryComponent.item"); - else if (Configuration.doAutoCreate()) - this.item = new Reference(); // cc - return this.item; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (A reference to the actual resource from which data was derived.) - */ - public ListEntryComponent setItem(Reference value) { - this.item = value; - return this; - } - - /** - * @return {@link #item} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.) - */ - public Resource getItemTarget() { - return this.itemTarget; - } - - /** - * @param value {@link #item} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the actual resource from which data was derived.) - */ - public ListEntryComponent setItemTarget(Resource value) { - this.itemTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("flag", "CodeableConcept", "The flag allows the system constructing the list to indicate the role and significance of the item in the list.", 0, java.lang.Integer.MAX_VALUE, flag)); - childrenList.add(new Property("deleted", "boolean", "True if this item is marked as deleted in the list.", 0, java.lang.Integer.MAX_VALUE, deleted)); - childrenList.add(new Property("date", "dateTime", "When this item was added to the list.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("item", "Reference(Any)", "A reference to the actual resource from which data was derived.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3145580: /*flag*/ return this.flag == null ? new Base[0] : new Base[] {this.flag}; // CodeableConcept - case 1550463001: /*deleted*/ return this.deleted == null ? new Base[0] : new Base[] {this.deleted}; // BooleanType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3145580: // flag - this.flag = castToCodeableConcept(value); // CodeableConcept - break; - case 1550463001: // deleted - this.deleted = castToBoolean(value); // BooleanType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 3242771: // item - this.item = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("flag")) - this.flag = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("deleted")) - this.deleted = castToBoolean(value); // BooleanType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("item")) - this.item = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3145580: return getFlag(); // CodeableConcept - case 1550463001: throw new FHIRException("Cannot make property deleted as it is not a complex type"); // BooleanType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 3242771: return getItem(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("flag")) { - this.flag = new CodeableConcept(); - return this.flag; - } - else if (name.equals("deleted")) { - throw new FHIRException("Cannot call addChild on a primitive type ListResource.deleted"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ListResource.date"); - } - else if (name.equals("item")) { - this.item = new Reference(); - return this.item; - } - else - return super.addChild(name); - } - - public ListEntryComponent copy() { - ListEntryComponent dst = new ListEntryComponent(); - copyValues(dst); - dst.flag = flag == null ? null : flag.copy(); - dst.deleted = deleted == null ? null : deleted.copy(); - dst.date = date == null ? null : date.copy(); - dst.item = item == null ? null : item.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ListEntryComponent)) - return false; - ListEntryComponent o = (ListEntryComponent) other; - return compareDeep(flag, o.flag, true) && compareDeep(deleted, o.deleted, true) && compareDeep(date, o.date, true) - && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ListEntryComponent)) - return false; - ListEntryComponent o = (ListEntryComponent) other; - return compareValues(deleted, o.deleted, true) && compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (flag == null || flag.isEmpty()) && (deleted == null || deleted.isEmpty()) - && (date == null || date.isEmpty()) && (item == null || item.isEmpty()); - } - - public String fhirType() { - return "List.entry"; - - } - - } - - /** - * Identifier for the List assigned for business purposes outside the context of FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Business identifier", formalDefinition="Identifier for the List assigned for business purposes outside the context of FHIR." ) - protected List identifier; - - /** - * Indicates the current state of this list. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="current | retired | entered-in-error", formalDefinition="Indicates the current state of this list." ) - protected Enumeration status; - - /** - * 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. - */ - @Child(name = "mode", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @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." ) - protected Enumeration mode; - - /** - * A label for the list assigned by the author. - */ - @Child(name = "title", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Descriptive name for the list", formalDefinition="A label for the list assigned by the author." ) - protected StringType title; - - /** - * This code defines the purpose of the list - why it was created. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="What the purpose of this list is", formalDefinition="This code defines the purpose of the list - why it was created." ) - protected CodeableConcept code; - - /** - * The common subject (or patient) of the resources that are in the list, if there is one. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - protected Resource subjectTarget; - - /** - * The encounter that is the context in which this list was created. - */ - @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Context in which list created", formalDefinition="The encounter that is the context in which this list was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter that is the context in which this list was created.) - */ - protected Encounter encounterTarget; - - /** - * The date that the list was prepared. - */ - @Child(name = "date", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the list was prepared", formalDefinition="The date that the list was prepared." ) - protected DateTimeType date; - - /** - * The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list. - */ - @Child(name = "source", type = {Practitioner.class, Patient.class, Device.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who and/or what defined the list contents (aka Author)", formalDefinition="The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) - */ - protected Resource sourceTarget; - - /** - * What order applies to the items in the list. - */ - @Child(name = "orderedBy", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="What order the list has", formalDefinition="What order applies to the items in the list." ) - protected CodeableConcept orderedBy; - - /** - * Comments that apply to the overall list. - */ - @Child(name = "note", type = {Annotation.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Comments about the list", formalDefinition="Comments that apply to the overall list." ) - protected List note; - - /** - * Entries in this list. - */ - @Child(name = "entry", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Entries in the list", formalDefinition="Entries in this list." ) - protected List entry; - - /** - * If the list is empty, why the list is empty. - */ - @Child(name = "emptyReason", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why list is empty", formalDefinition="If the list is empty, why the list is empty." ) - protected CodeableConcept emptyReason; - - private static final long serialVersionUID = 2071342704L; - - /** - * Constructor - */ - public ListResource() { - super(); - } - - /** - * Constructor - */ - public ListResource(Enumeration status, Enumeration mode) { - super(); - this.status = status; - this.mode = mode; - } - - /** - * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for the List assigned for business purposes outside the context of FHIR.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ListResource addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ListStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates the current state of this list.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ListResource setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates the current state of this list. - */ - public ListStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates the current state of this list. - */ - public ListResource setStatus(ListStatus value) { - if (this.status == null) - this.status = new Enumeration(new ListStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #mode} (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.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new ListModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (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.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public ListResource setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return 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 ListMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value 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(ListMode value) { - if (this.mode == null) - this.mode = new Enumeration(new ListModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A label for the list assigned by the author.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public ListResource setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A label for the list assigned by the author. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A label for the list assigned by the author. - */ - public ListResource setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (This code defines the purpose of the list - why it was created.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (This code defines the purpose of the list - why it was created.) - */ - public ListResource setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public ListResource setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The common subject (or patient) of the resources that are in the list, if there is one.) - */ - public ListResource setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter that is the context in which this list was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter that is the context in which this list was created.) - */ - public ListResource setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter that is the context in which this list was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter that is the context in which this list was created.) - */ - public ListResource setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the list was prepared.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ListResource setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the list was prepared. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the list was prepared. - */ - public ListResource setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) - */ - public ListResource setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.) - */ - public ListResource setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #orderedBy} (What order applies to the items in the list.) - */ - public CodeableConcept getOrderedBy() { - if (this.orderedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.orderedBy"); - else if (Configuration.doAutoCreate()) - this.orderedBy = new CodeableConcept(); // cc - return this.orderedBy; - } - - public boolean hasOrderedBy() { - return this.orderedBy != null && !this.orderedBy.isEmpty(); - } - - /** - * @param value {@link #orderedBy} (What order applies to the items in the list.) - */ - public ListResource setOrderedBy(CodeableConcept value) { - this.orderedBy = value; - return this; - } - - /** - * @return {@link #note} (Comments that apply to the overall list.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Comments that apply to the overall list.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public ListResource addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #entry} (Entries in this list.) - */ - public List getEntry() { - if (this.entry == null) - this.entry = new ArrayList(); - return this.entry; - } - - public boolean hasEntry() { - if (this.entry == null) - return false; - for (ListEntryComponent item : this.entry) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entry} (Entries in this list.) - */ - // syntactic sugar - public ListEntryComponent addEntry() { //3 - ListEntryComponent t = new ListEntryComponent(); - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return t; - } - - // syntactic sugar - public ListResource addEntry(ListEntryComponent t) { //3 - if (t == null) - return this; - if (this.entry == null) - this.entry = new ArrayList(); - this.entry.add(t); - return this; - } - - /** - * @return {@link #emptyReason} (If the list is empty, why the list is empty.) - */ - public CodeableConcept getEmptyReason() { - if (this.emptyReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ListResource.emptyReason"); - else if (Configuration.doAutoCreate()) - this.emptyReason = new CodeableConcept(); // cc - return this.emptyReason; - } - - public boolean hasEmptyReason() { - return this.emptyReason != null && !this.emptyReason.isEmpty(); - } - - /** - * @param value {@link #emptyReason} (If the list is empty, why the list is empty.) - */ - public ListResource setEmptyReason(CodeableConcept value) { - this.emptyReason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the List assigned for business purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Indicates the current state of this list.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("mode", "code", "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.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("title", "string", "A label for the list assigned by the author.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("code", "CodeableConcept", "This code defines the purpose of the list - why it was created.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The common subject (or patient) of the resources that are in the list, if there is one.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter that is the context in which this list was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("date", "dateTime", "The date that the list was prepared.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("source", "Reference(Practitioner|Patient|Device)", "The entity responsible for deciding what the contents of the list were. Where the list was created by a human, this is the same as the author of the list.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("orderedBy", "CodeableConcept", "What order applies to the items in the list.", 0, java.lang.Integer.MAX_VALUE, orderedBy)); - childrenList.add(new Property("note", "Annotation", "Comments that apply to the overall list.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("entry", "", "Entries in this list.", 0, java.lang.Integer.MAX_VALUE, entry)); - childrenList.add(new Property("emptyReason", "CodeableConcept", "If the list is empty, why the list is empty.", 0, java.lang.Integer.MAX_VALUE, emptyReason)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference - case -391079516: /*orderedBy*/ return this.orderedBy == null ? new Base[0] : new Base[] {this.orderedBy}; // CodeableConcept - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case 96667762: /*entry*/ return this.entry == null ? new Base[0] : this.entry.toArray(new Base[this.entry.size()]); // ListEntryComponent - case 1140135409: /*emptyReason*/ return this.emptyReason == null ? new Base[0] : new Base[] {this.emptyReason}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new ListStatusEnumFactory().fromType(value); // Enumeration - break; - case 3357091: // mode - this.mode = new ListModeEnumFactory().fromType(value); // Enumeration - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -896505829: // source - this.source = castToReference(value); // Reference - break; - case -391079516: // orderedBy - this.orderedBy = castToCodeableConcept(value); // CodeableConcept - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case 96667762: // entry - this.getEntry().add((ListEntryComponent) value); // ListEntryComponent - break; - case 1140135409: // emptyReason - this.emptyReason = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new ListStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("mode")) - this.mode = new ListModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("source")) - this.source = castToReference(value); // Reference - else if (name.equals("orderedBy")) - this.orderedBy = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("entry")) - this.getEntry().add((ListEntryComponent) value); - else if (name.equals("emptyReason")) - this.emptyReason = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 3059181: return getCode(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case 1524132147: return getEncounter(); // Reference - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -896505829: return getSource(); // Reference - case -391079516: return getOrderedBy(); // CodeableConcept - case 3387378: return addNote(); // Annotation - case 96667762: return addEntry(); // ListEntryComponent - case 1140135409: return getEmptyReason(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ListResource.status"); - } - else if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type ListResource.mode"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type ListResource.title"); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ListResource.date"); - } - else if (name.equals("source")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("orderedBy")) { - this.orderedBy = new CodeableConcept(); - return this.orderedBy; - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("entry")) { - return addEntry(); - } - else if (name.equals("emptyReason")) { - this.emptyReason = new CodeableConcept(); - return this.emptyReason; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "List"; - - } - - public ListResource copy() { - ListResource dst = new ListResource(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.title = title == null ? null : title.copy(); - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.date = date == null ? null : date.copy(); - dst.source = source == null ? null : source.copy(); - dst.orderedBy = orderedBy == null ? null : orderedBy.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - if (entry != null) { - dst.entry = new ArrayList(); - for (ListEntryComponent i : entry) - dst.entry.add(i.copy()); - }; - dst.emptyReason = emptyReason == null ? null : emptyReason.copy(); - return dst; - } - - protected ListResource typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ListResource)) - return false; - ListResource o = (ListResource) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(mode, o.mode, true) - && compareDeep(title, o.title, true) && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(date, o.date, true) && compareDeep(source, o.source, true) - && compareDeep(orderedBy, o.orderedBy, true) && compareDeep(note, o.note, true) && compareDeep(entry, o.entry, true) - && compareDeep(emptyReason, o.emptyReason, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ListResource)) - return false; - ListResource o = (ListResource) other; - return compareValues(status, o.status, true) && compareValues(mode, o.mode, true) && compareValues(title, o.title, true) - && compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (mode == null || mode.isEmpty()) && (title == null || title.isEmpty()) && (code == null || code.isEmpty()) - && (subject == null || subject.isEmpty()) && (encounter == null || encounter.isEmpty()) && (date == null || date.isEmpty()) - && (source == null || source.isEmpty()) && (orderedBy == null || orderedBy.isEmpty()) && (note == null || note.isEmpty()) - && (entry == null || entry.isEmpty()) && (emptyReason == null || emptyReason.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.List; - } - - /** - * Search parameter: title - *

- * Description: Descriptive name for the list
- * Type: string
- * Path: List.title
- *

- */ - @SearchParamDefinition(name="title", path="List.title", description="Descriptive name for the list", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Descriptive name for the list
- * Type: string
- * Path: List.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: patient - *

- * Description: If all resources have the same subject
- * Type: reference
- * Path: List.subject
- *

- */ - @SearchParamDefinition(name="patient", path="List.subject", description="If all resources have the same subject", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: If all resources have the same subject
- * Type: reference
- * Path: List.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ListResource:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ListResource:patient").toLocked(); - - /** - * Search parameter: source - *

- * Description: Who and/or what defined the list contents (aka Author)
- * Type: reference
- * Path: List.source
- *

- */ - @SearchParamDefinition(name="source", path="List.source", description="Who and/or what defined the list contents (aka Author)", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Who and/or what defined the list contents (aka Author)
- * Type: reference
- * Path: List.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ListResource:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("ListResource:source").toLocked(); - - /** - * Search parameter: status - *

- * Description: current | retired | entered-in-error
- * Type: token
- * Path: List.status
- *

- */ - @SearchParamDefinition(name="status", path="List.status", description="current | retired | entered-in-error", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: current | retired | entered-in-error
- * Type: token
- * Path: List.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: If all resources have the same subject
- * Type: reference
- * Path: List.subject
- *

- */ - @SearchParamDefinition(name="subject", path="List.subject", description="If all resources have the same subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: If all resources have the same subject
- * Type: reference
- * Path: List.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ListResource:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ListResource:subject").toLocked(); - - /** - * Search parameter: item - *

- * Description: Actual entry
- * Type: reference
- * Path: List.entry.item
- *

- */ - @SearchParamDefinition(name="item", path="List.entry.item", description="Actual entry", type="reference" ) - public static final String SP_ITEM = "item"; - /** - * Fluent Client search parameter constant for item - *

- * Description: Actual entry
- * Type: reference
- * Path: List.entry.item
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ITEM); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ListResource:item". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ITEM = new ca.uhn.fhir.model.api.Include("ListResource:item").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Context in which list created
- * Type: reference
- * Path: List.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="List.encounter", description="Context in which list created", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Context in which list created
- * Type: reference
- * Path: List.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ListResource:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("ListResource:encounter").toLocked(); - - /** - * Search parameter: code - *

- * Description: What the purpose of this list is
- * Type: token
- * Path: List.code
- *

- */ - @SearchParamDefinition(name="code", path="List.code", description="What the purpose of this list is", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: What the purpose of this list is
- * Type: token
- * Path: List.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: notes - *

- * Description: The annotation - text content
- * Type: string
- * Path: List.note.text
- *

- */ - @SearchParamDefinition(name="notes", path="List.note.text", description="The annotation - text content", type="string" ) - public static final String SP_NOTES = "notes"; - /** - * Fluent Client search parameter constant for notes - *

- * Description: The annotation - text content
- * Type: string
- * Path: List.note.text
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NOTES = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NOTES); - - /** - * Search parameter: date - *

- * Description: When the list was prepared
- * Type: date
- * Path: List.date
- *

- */ - @SearchParamDefinition(name="date", path="List.date", description="When the list was prepared", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When the list was prepared
- * Type: date
- * Path: List.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: empty-reason - *

- * Description: Why list is empty
- * Type: token
- * Path: List.emptyReason
- *

- */ - @SearchParamDefinition(name="empty-reason", path="List.emptyReason", description="Why list is empty", type="token" ) - public static final String SP_EMPTY_REASON = "empty-reason"; - /** - * Fluent Client search parameter constant for empty-reason - *

- * Description: Why list is empty
- * Type: token
- * Path: List.emptyReason
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMPTY_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMPTY_REASON); - - /** - * Search parameter: identifier - *

- * Description: Business identifier
- * Type: token
- * Path: List.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="List.identifier", description="Business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Business identifier
- * Type: token
- * Path: List.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Location.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Location.java deleted file mode 100644 index fc8db6c6daf..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Location.java +++ /dev/null @@ -1,1702 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained or accommodated. - */ -@ResourceDef(name="Location", profile="http://hl7.org/fhir/Profile/Location") -public class Location extends DomainResource { - - public enum LocationStatus { - /** - * The location is operational. - */ - ACTIVE, - /** - * The location is temporarily closed. - */ - SUSPENDED, - /** - * The location is no longer used. - */ - INACTIVE, - /** - * added to help the parsers - */ - NULL; - public static LocationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("inactive".equals(codeString)) - return INACTIVE; - throw new FHIRException("Unknown LocationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case SUSPENDED: return "suspended"; - case INACTIVE: return "inactive"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return "http://hl7.org/fhir/location-status"; - case SUSPENDED: return "http://hl7.org/fhir/location-status"; - case INACTIVE: return "http://hl7.org/fhir/location-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The location is operational."; - case SUSPENDED: return "The location is temporarily closed."; - case INACTIVE: return "The location is no longer used."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case SUSPENDED: return "Suspended"; - case INACTIVE: return "Inactive"; - default: return "?"; - } - } - } - - public static class LocationStatusEnumFactory implements EnumFactory { - public LocationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return LocationStatus.ACTIVE; - if ("suspended".equals(codeString)) - return LocationStatus.SUSPENDED; - if ("inactive".equals(codeString)) - return LocationStatus.INACTIVE; - throw new IllegalArgumentException("Unknown LocationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return new Enumeration(this, LocationStatus.ACTIVE); - if ("suspended".equals(codeString)) - return new Enumeration(this, LocationStatus.SUSPENDED); - if ("inactive".equals(codeString)) - return new Enumeration(this, LocationStatus.INACTIVE); - throw new FHIRException("Unknown LocationStatus code '"+codeString+"'"); - } - public String toCode(LocationStatus code) { - if (code == LocationStatus.ACTIVE) - return "active"; - if (code == LocationStatus.SUSPENDED) - return "suspended"; - if (code == LocationStatus.INACTIVE) - return "inactive"; - return "?"; - } - public String toSystem(LocationStatus code) { - return code.getSystem(); - } - } - - public enum LocationMode { - /** - * The Location resource represents a specific instance of a location (e.g. Operating Theatre 1A). - */ - INSTANCE, - /** - * The Location represents a class of locations (e.g. Any Operating Theatre) although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc.). - */ - KIND, - /** - * added to help the parsers - */ - NULL; - public static LocationMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return INSTANCE; - if ("kind".equals(codeString)) - return KIND; - throw new FHIRException("Unknown LocationMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INSTANCE: return "instance"; - case KIND: return "kind"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INSTANCE: return "http://hl7.org/fhir/location-mode"; - case KIND: return "http://hl7.org/fhir/location-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INSTANCE: return "The Location resource represents a specific instance of a location (e.g. Operating Theatre 1A)."; - case KIND: return "The Location represents a class of locations (e.g. Any Operating Theatre) although this class of locations could be constrained within a specific boundary (such as organization, or parent location, address etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INSTANCE: return "Instance"; - case KIND: return "Kind"; - default: return "?"; - } - } - } - - public static class LocationModeEnumFactory implements EnumFactory { - public LocationMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return LocationMode.INSTANCE; - if ("kind".equals(codeString)) - return LocationMode.KIND; - throw new IllegalArgumentException("Unknown LocationMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("instance".equals(codeString)) - return new Enumeration(this, LocationMode.INSTANCE); - if ("kind".equals(codeString)) - return new Enumeration(this, LocationMode.KIND); - throw new FHIRException("Unknown LocationMode code '"+codeString+"'"); - } - public String toCode(LocationMode code) { - if (code == LocationMode.INSTANCE) - return "instance"; - if (code == LocationMode.KIND) - return "kind"; - return "?"; - } - public String toSystem(LocationMode code) { - return code.getSystem(); - } - } - - @Block() - public static class LocationPositionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - @Child(name = "longitude", type = {DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Longitude with WGS84 datum", formalDefinition="Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below)." ) - protected DecimalType longitude; - - /** - * Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - @Child(name = "latitude", type = {DecimalType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Latitude with WGS84 datum", formalDefinition="Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below)." ) - protected DecimalType latitude; - - /** - * Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - @Child(name = "altitude", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Altitude with WGS84 datum", formalDefinition="Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below)." ) - protected DecimalType altitude; - - private static final long serialVersionUID = -74276134L; - - /** - * Constructor - */ - public LocationPositionComponent() { - super(); - } - - /** - * Constructor - */ - public LocationPositionComponent(DecimalType longitude, DecimalType latitude) { - super(); - this.longitude = longitude; - this.latitude = latitude; - } - - /** - * @return {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value - */ - public DecimalType getLongitudeElement() { - if (this.longitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.longitude"); - else if (Configuration.doAutoCreate()) - this.longitude = new DecimalType(); // bb - return this.longitude; - } - - public boolean hasLongitudeElement() { - return this.longitude != null && !this.longitude.isEmpty(); - } - - public boolean hasLongitude() { - return this.longitude != null && !this.longitude.isEmpty(); - } - - /** - * @param value {@link #longitude} (Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLongitude" gives direct access to the value - */ - public LocationPositionComponent setLongitudeElement(DecimalType value) { - this.longitude = value; - return this; - } - - /** - * @return Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public BigDecimal getLongitude() { - return this.longitude == null ? null : this.longitude.getValue(); - } - - /** - * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public LocationPositionComponent setLongitude(BigDecimal value) { - if (this.longitude == null) - this.longitude = new DecimalType(); - this.longitude.setValue(value); - return this; - } - - /** - * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public LocationPositionComponent setLongitude(long value) { - this.longitude = new DecimalType(); - this.longitude.setValue(value); - return this; - } - - /** - * @param value Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below). - */ - public LocationPositionComponent setLongitude(double value) { - this.longitude = new DecimalType(); - this.longitude.setValue(value); - return this; - } - - /** - * @return {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value - */ - public DecimalType getLatitudeElement() { - if (this.latitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.latitude"); - else if (Configuration.doAutoCreate()) - this.latitude = new DecimalType(); // bb - return this.latitude; - } - - public boolean hasLatitudeElement() { - return this.latitude != null && !this.latitude.isEmpty(); - } - - public boolean hasLatitude() { - return this.latitude != null && !this.latitude.isEmpty(); - } - - /** - * @param value {@link #latitude} (Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getLatitude" gives direct access to the value - */ - public LocationPositionComponent setLatitudeElement(DecimalType value) { - this.latitude = value; - return this; - } - - /** - * @return Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public BigDecimal getLatitude() { - return this.latitude == null ? null : this.latitude.getValue(); - } - - /** - * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public LocationPositionComponent setLatitude(BigDecimal value) { - if (this.latitude == null) - this.latitude = new DecimalType(); - this.latitude.setValue(value); - return this; - } - - /** - * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public LocationPositionComponent setLatitude(long value) { - this.latitude = new DecimalType(); - this.latitude.setValue(value); - return this; - } - - /** - * @param value Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below). - */ - public LocationPositionComponent setLatitude(double value) { - this.latitude = new DecimalType(); - this.latitude.setValue(value); - return this; - } - - /** - * @return {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value - */ - public DecimalType getAltitudeElement() { - if (this.altitude == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create LocationPositionComponent.altitude"); - else if (Configuration.doAutoCreate()) - this.altitude = new DecimalType(); // bb - return this.altitude; - } - - public boolean hasAltitudeElement() { - return this.altitude != null && !this.altitude.isEmpty(); - } - - public boolean hasAltitude() { - return this.altitude != null && !this.altitude.isEmpty(); - } - - /** - * @param value {@link #altitude} (Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).). This is the underlying object with id, value and extensions. The accessor "getAltitude" gives direct access to the value - */ - public LocationPositionComponent setAltitudeElement(DecimalType value) { - this.altitude = value; - return this; - } - - /** - * @return Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public BigDecimal getAltitude() { - return this.altitude == null ? null : this.altitude.getValue(); - } - - /** - * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public LocationPositionComponent setAltitude(BigDecimal value) { - if (value == null) - this.altitude = null; - else { - if (this.altitude == null) - this.altitude = new DecimalType(); - this.altitude.setValue(value); - } - return this; - } - - /** - * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public LocationPositionComponent setAltitude(long value) { - this.altitude = new DecimalType(); - this.altitude.setValue(value); - return this; - } - - /** - * @param value Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below). - */ - public LocationPositionComponent setAltitude(double value) { - this.altitude = new DecimalType(); - this.altitude.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("longitude", "decimal", "Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, longitude)); - childrenList.add(new Property("latitude", "decimal", "Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, latitude)); - childrenList.add(new Property("altitude", "decimal", "Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).", 0, java.lang.Integer.MAX_VALUE, altitude)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 137365935: /*longitude*/ return this.longitude == null ? new Base[0] : new Base[] {this.longitude}; // DecimalType - case -1439978388: /*latitude*/ return this.latitude == null ? new Base[0] : new Base[] {this.latitude}; // DecimalType - case 2036550306: /*altitude*/ return this.altitude == null ? new Base[0] : new Base[] {this.altitude}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 137365935: // longitude - this.longitude = castToDecimal(value); // DecimalType - break; - case -1439978388: // latitude - this.latitude = castToDecimal(value); // DecimalType - break; - case 2036550306: // altitude - this.altitude = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("longitude")) - this.longitude = castToDecimal(value); // DecimalType - else if (name.equals("latitude")) - this.latitude = castToDecimal(value); // DecimalType - else if (name.equals("altitude")) - this.altitude = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 137365935: throw new FHIRException("Cannot make property longitude as it is not a complex type"); // DecimalType - case -1439978388: throw new FHIRException("Cannot make property latitude as it is not a complex type"); // DecimalType - case 2036550306: throw new FHIRException("Cannot make property altitude as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("longitude")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.longitude"); - } - else if (name.equals("latitude")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.latitude"); - } - else if (name.equals("altitude")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.altitude"); - } - else - return super.addChild(name); - } - - public LocationPositionComponent copy() { - LocationPositionComponent dst = new LocationPositionComponent(); - copyValues(dst); - dst.longitude = longitude == null ? null : longitude.copy(); - dst.latitude = latitude == null ? null : latitude.copy(); - dst.altitude = altitude == null ? null : altitude.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof LocationPositionComponent)) - return false; - LocationPositionComponent o = (LocationPositionComponent) other; - return compareDeep(longitude, o.longitude, true) && compareDeep(latitude, o.latitude, true) && compareDeep(altitude, o.altitude, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof LocationPositionComponent)) - return false; - LocationPositionComponent o = (LocationPositionComponent) other; - return compareValues(longitude, o.longitude, true) && compareValues(latitude, o.latitude, true) && compareValues(altitude, o.altitude, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (longitude == null || longitude.isEmpty()) && (latitude == null || latitude.isEmpty()) - && (altitude == null || altitude.isEmpty()); - } - - public String fhirType() { - return "Location.position"; - - } - - } - - /** - * Unique code or number identifying the location to its users. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique code or number identifying the location to its users", formalDefinition="Unique code or number identifying the location to its users." ) - protected List identifier; - - /** - * active | suspended | inactive. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | suspended | inactive", formalDefinition="active | suspended | inactive." ) - protected Enumeration status; - - /** - * Name of the location as used by humans. Does not need to be unique. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType name; - - /** - * Description of the Location, which helps in finding or referencing the place. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional details about the location that could be displayed as further information to identify the location beyond its name", formalDefinition="Description of the Location, which helps in finding or referencing the place." ) - protected StringType description; - - /** - * Indicates whether a resource instance represents a specific location or a class of locations. - */ - @Child(name = "mode", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="instance | kind", formalDefinition="Indicates whether a resource instance represents a specific location or a class of locations." ) - protected Enumeration mode; - - /** - * Indicates the type of function performed at the location. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of function performed", formalDefinition="Indicates the type of function performed at the location." ) - protected CodeableConcept type; - - /** - * The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List telecom; - - /** - * Physical location. - */ - @Child(name = "address", type = {Address.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Physical location", formalDefinition="Physical location." ) - protected Address address; - - /** - * Physical form of the location, e.g. building, room, vehicle, road. - */ - @Child(name = "physicalType", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Physical form of the location", formalDefinition="Physical form of the location, e.g. building, room, vehicle, road." ) - protected CodeableConcept physicalType; - - /** - * The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML). - */ - @Child(name = "position", type = {}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The absolute geographic location", formalDefinition="The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML)." ) - protected LocationPositionComponent position; - - /** - * The organization responsible for the provisioning and upkeep of the location. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization responsible for provisioning and upkeep", formalDefinition="The organization responsible for the provisioning and upkeep of the location." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization responsible for the provisioning and upkeep of the location.) - */ - protected Organization managingOrganizationTarget; - - /** - * Another Location which this Location is physically part of. - */ - @Child(name = "partOf", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Another Location this one is physically part of", formalDefinition="Another Location which this Location is physically part of." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (Another Location which this Location is physically part of.) - */ - protected Location partOfTarget; - - private static final long serialVersionUID = -2100435761L; - - /** - * Constructor - */ - public Location() { - super(); - } - - /** - * @return {@link #identifier} (Unique code or number identifying the location to its users.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Unique code or number identifying the location to its users.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Location addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new LocationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (active | suspended | inactive.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Location setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return active | suspended | inactive. - */ - public LocationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value active | suspended | inactive. - */ - public Location setStatus(LocationStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new LocationStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name of the location as used by humans. Does not need to be unique.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Location setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Name of the location as used by humans. Does not need to be unique. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name of the location as used by humans. Does not need to be unique. - */ - public Location setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Description of the Location, which helps in finding or referencing the place.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Location setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of the Location, which helps in finding or referencing the place. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of the Location, which helps in finding or referencing the place. - */ - public Location setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new LocationModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Indicates whether a resource instance represents a specific location or a class of locations.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Location setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Indicates whether a resource instance represents a specific location or a class of locations. - */ - public LocationMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Indicates whether a resource instance represents a specific location or a class of locations. - */ - public Location setMode(LocationMode value) { - if (value == null) - this.mode = null; - else { - if (this.mode == null) - this.mode = new Enumeration(new LocationModeEnumFactory()); - this.mode.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Indicates the type of function performed at the location.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of function performed at the location.) - */ - public Location setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #telecom} (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 List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Location addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Physical location.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Physical location.) - */ - public Location setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) - */ - public CodeableConcept getPhysicalType() { - if (this.physicalType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.physicalType"); - else if (Configuration.doAutoCreate()) - this.physicalType = new CodeableConcept(); // cc - return this.physicalType; - } - - public boolean hasPhysicalType() { - return this.physicalType != null && !this.physicalType.isEmpty(); - } - - /** - * @param value {@link #physicalType} (Physical form of the location, e.g. building, room, vehicle, road.) - */ - public Location setPhysicalType(CodeableConcept value) { - this.physicalType = value; - return this; - } - - /** - * @return {@link #position} (The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).) - */ - public LocationPositionComponent getPosition() { - if (this.position == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.position"); - else if (Configuration.doAutoCreate()) - this.position = new LocationPositionComponent(); // cc - return this.position; - } - - public boolean hasPosition() { - return this.position != null && !this.position.isEmpty(); - } - - /** - * @param value {@link #position} (The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).) - */ - public Location setPosition(LocationPositionComponent value) { - this.position = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The organization responsible for the provisioning and upkeep of the location.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization responsible for the provisioning and upkeep of the location.) - */ - public Location setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization responsible for the provisioning and upkeep of the location.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization responsible for the provisioning and upkeep of the location.) - */ - public Location setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #partOf} (Another Location which this Location is physically part of.) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); // cc - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (Another Location which this Location is physically part of.) - */ - public Location setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.) - */ - public Location getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Location.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Location(); // aa - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another Location which this Location is physically part of.) - */ - public Location setPartOfTarget(Location value) { - this.partOfTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique code or number identifying the location to its users.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "active | suspended | inactive.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("name", "string", "Name of the location as used by humans. Does not need to be unique.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Description of the Location, which helps in finding or referencing the place.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("mode", "code", "Indicates whether a resource instance represents a specific location or a class of locations.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of function performed at the location.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("telecom", "ContactPoint", "The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Physical location.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("physicalType", "CodeableConcept", "Physical form of the location, e.g. building, room, vehicle, road.", 0, java.lang.Integer.MAX_VALUE, physicalType)); - childrenList.add(new Property("position", "", "The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).", 0, java.lang.Integer.MAX_VALUE, position)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization responsible for the provisioning and upkeep of the location.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("partOf", "Reference(Location)", "Another Location which this Location is physically part of.", 0, java.lang.Integer.MAX_VALUE, partOf)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address - case -1474715471: /*physicalType*/ return this.physicalType == null ? new Base[0] : new Base[] {this.physicalType}; // CodeableConcept - case 747804969: /*position*/ return this.position == null ? new Base[0] : new Base[] {this.position}; // LocationPositionComponent - case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference - case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new LocationStatusEnumFactory().fromType(value); // Enumeration - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 3357091: // mode - this.mode = new LocationModeEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1147692044: // address - this.address = castToAddress(value); // Address - break; - case -1474715471: // physicalType - this.physicalType = castToCodeableConcept(value); // CodeableConcept - break; - case 747804969: // position - this.position = (LocationPositionComponent) value; // LocationPositionComponent - break; - case -2058947787: // managingOrganization - this.managingOrganization = castToReference(value); // Reference - break; - case -995410646: // partOf - this.partOf = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new LocationStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("mode")) - this.mode = new LocationModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("address")) - this.address = castToAddress(value); // Address - else if (name.equals("physicalType")) - this.physicalType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("position")) - this.position = (LocationPositionComponent) value; // LocationPositionComponent - else if (name.equals("managingOrganization")) - this.managingOrganization = castToReference(value); // Reference - else if (name.equals("partOf")) - this.partOf = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 3575610: return getType(); // CodeableConcept - case -1429363305: return addTelecom(); // ContactPoint - case -1147692044: return getAddress(); // Address - case -1474715471: return getPhysicalType(); // CodeableConcept - case 747804969: return getPosition(); // LocationPositionComponent - case -2058947787: return getManagingOrganization(); // Reference - case -995410646: return getPartOf(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.status"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.description"); - } - else if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type Location.mode"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("address")) { - this.address = new Address(); - return this.address; - } - else if (name.equals("physicalType")) { - this.physicalType = new CodeableConcept(); - return this.physicalType; - } - else if (name.equals("position")) { - this.position = new LocationPositionComponent(); - return this.position; - } - else if (name.equals("managingOrganization")) { - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - else if (name.equals("partOf")) { - this.partOf = new Reference(); - return this.partOf; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Location"; - - } - - public Location copy() { - Location dst = new Location(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.type = type == null ? null : type.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.physicalType = physicalType == null ? null : physicalType.copy(); - dst.position = position == null ? null : position.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.partOf = partOf == null ? null : partOf.copy(); - return dst; - } - - protected Location typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Location)) - return false; - Location o = (Location) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(name, o.name, true) - && compareDeep(description, o.description, true) && compareDeep(mode, o.mode, true) && compareDeep(type, o.type, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(physicalType, o.physicalType, true) - && compareDeep(position, o.position, true) && compareDeep(managingOrganization, o.managingOrganization, true) - && compareDeep(partOf, o.partOf, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Location)) - return false; - Location o = (Location) other; - return compareValues(status, o.status, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) - && compareValues(mode, o.mode, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) && (mode == null || mode.isEmpty()) - && (type == null || type.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) - && (physicalType == null || physicalType.isEmpty()) && (position == null || position.isEmpty()) - && (managingOrganization == null || managingOrganization.isEmpty()) && (partOf == null || partOf.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Location; - } - - /** - * Search parameter: organization - *

- * Description: Searches for locations that are managed by the provided organization
- * Type: reference
- * Path: Location.managingOrganization
- *

- */ - @SearchParamDefinition(name="organization", path="Location.managingOrganization", description="Searches for locations that are managed by the provided organization", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - /** - * Fluent Client search parameter constant for organization - *

- * Description: Searches for locations that are managed by the provided organization
- * Type: reference
- * Path: Location.managingOrganization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Location:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Location:organization").toLocked(); - - /** - * Search parameter: address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Location.address.state
- *

- */ - @SearchParamDefinition(name="address-state", path="Location.address.state", description="A state specified in an address", type="string" ) - public static final String SP_ADDRESS_STATE = "address-state"; - /** - * Fluent Client search parameter constant for address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Location.address.state
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Location.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="Location.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Location.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - - /** - * Search parameter: near - *

- * Description: The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)
- * Type: token
- * Path: Location.position
- *

- */ - @SearchParamDefinition(name="near", path="Location.position", description="The coordinates expressed as [lat],[long] (using the WGS84 datum, 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 the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)
- * Type: token
- * Path: Location.position
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam NEAR = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NEAR); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Location:partof". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("Location:partof").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Location.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="Location.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Location.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Location.address.country
- *

- */ - @SearchParamDefinition(name="address-country", path="Location.address.country", description="A country specified in an address", type="string" ) - public static final String SP_ADDRESS_COUNTRY = "address-country"; - /** - * Fluent Client search parameter constant for address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Location.address.country
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); - - /** - * Search parameter: near-distance - *

- * Description: A distance quantity to limit the near search to locations within a specific distance
- * Type: token
- * Path: Location.position
- *

- */ - @SearchParamDefinition(name="near-distance", path="Location.position", 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: Location.position
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam NEAR_DISTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_NEAR_DISTANCE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: Unique code or number identifying the location to its users
- * Type: token
- * Path: Location.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Location.identifier", description="Unique code or number identifying the location to its users", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique code or number identifying the location to its users
- * Type: token
- * Path: Location.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: Location.address.postalCode
- *

- */ - @SearchParamDefinition(name="address-postalcode", path="Location.address.postalCode", description="A postal code specified in an address", type="string" ) - public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; - /** - * Fluent Client search parameter constant for address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: Location.address.postalCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MarkdownType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MarkdownType.java deleted file mode 100644 index a70353a1c50..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MarkdownType.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -package org.hl7.fhir.dstu2016may.model; - -import static org.apache.commons.lang3.StringUtils.defaultString; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "code" in FHIR, when not bound to an enumerated list of codes - */ -@DatatypeDef(name="markdown", profileOf=StringType.class) -public class MarkdownType extends StringType implements Comparable { - - private static final long serialVersionUID = 3L; - - public MarkdownType() { - super(); - } - - public MarkdownType(String theCode) { - setValue(theCode); - } - - public int compareTo(MarkdownType theCode) { - if (theCode == null) { - return 1; - } - return defaultString(getValue()).compareTo(defaultString(theCode.getValue())); - } - - @Override - protected String parse(String theValue) { - return theValue.trim(); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public MarkdownType copy() { - return new MarkdownType(getValue()); - } - - public String fhirType() { - return "markdown"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Measure.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Measure.java deleted file mode 100644 index 72e4946a20e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Measure.java +++ /dev/null @@ -1,3240 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The Measure resource provides the definition of a quality measure. - */ -@ResourceDef(name="Measure", profile="http://hl7.org/fhir/Profile/Measure") -public class Measure extends DomainResource { - - public enum MeasureScoring { - /** - * The measure score is defined using a proportion - */ - PROPORTION, - /** - * The measure score is defined using a ratio - */ - RATIO, - /** - * The score is defined by a calculation of some quantity - */ - CONTINUOUSVARIABLE, - /** - * The measure is a cohort definition - */ - COHORT, - /** - * added to help the parsers - */ - NULL; - public static MeasureScoring fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proportion".equals(codeString)) - return PROPORTION; - if ("ratio".equals(codeString)) - return RATIO; - if ("continuous-variable".equals(codeString)) - return CONTINUOUSVARIABLE; - if ("cohort".equals(codeString)) - return COHORT; - throw new FHIRException("Unknown MeasureScoring code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPORTION: return "proportion"; - case RATIO: return "ratio"; - case CONTINUOUSVARIABLE: return "continuous-variable"; - case COHORT: return "cohort"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPORTION: return "http://hl7.org/fhir/measure-scoring"; - case RATIO: return "http://hl7.org/fhir/measure-scoring"; - case CONTINUOUSVARIABLE: return "http://hl7.org/fhir/measure-scoring"; - case COHORT: return "http://hl7.org/fhir/measure-scoring"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPORTION: return "The measure score is defined using a proportion"; - case RATIO: return "The measure score is defined using a ratio"; - case CONTINUOUSVARIABLE: return "The score is defined by a calculation of some quantity"; - case COHORT: return "The measure is a cohort definition"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPORTION: return "Proportion"; - case RATIO: return "Ratio"; - case CONTINUOUSVARIABLE: return "Continuous Variable"; - case COHORT: return "Cohort"; - default: return "?"; - } - } - } - - public static class MeasureScoringEnumFactory implements EnumFactory { - public MeasureScoring fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proportion".equals(codeString)) - return MeasureScoring.PROPORTION; - if ("ratio".equals(codeString)) - return MeasureScoring.RATIO; - if ("continuous-variable".equals(codeString)) - return MeasureScoring.CONTINUOUSVARIABLE; - if ("cohort".equals(codeString)) - return MeasureScoring.COHORT; - throw new IllegalArgumentException("Unknown MeasureScoring code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proportion".equals(codeString)) - return new Enumeration(this, MeasureScoring.PROPORTION); - if ("ratio".equals(codeString)) - return new Enumeration(this, MeasureScoring.RATIO); - if ("continuous-variable".equals(codeString)) - return new Enumeration(this, MeasureScoring.CONTINUOUSVARIABLE); - if ("cohort".equals(codeString)) - return new Enumeration(this, MeasureScoring.COHORT); - throw new FHIRException("Unknown MeasureScoring code '"+codeString+"'"); - } - public String toCode(MeasureScoring code) { - if (code == MeasureScoring.PROPORTION) - return "proportion"; - if (code == MeasureScoring.RATIO) - return "ratio"; - if (code == MeasureScoring.CONTINUOUSVARIABLE) - return "continuous-variable"; - if (code == MeasureScoring.COHORT) - return "cohort"; - return "?"; - } - public String toSystem(MeasureScoring code) { - return code.getSystem(); - } - } - - public enum MeasureType { - /** - * The measure is a process measure - */ - PROCESS, - /** - * The measure is an outcome measure - */ - OUTCOME, - /** - * added to help the parsers - */ - NULL; - public static MeasureType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("process".equals(codeString)) - return PROCESS; - if ("outcome".equals(codeString)) - return OUTCOME; - throw new FHIRException("Unknown MeasureType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROCESS: return "process"; - case OUTCOME: return "outcome"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROCESS: return "http://hl7.org/fhir/measure-type"; - case OUTCOME: return "http://hl7.org/fhir/measure-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROCESS: return "The measure is a process measure"; - case OUTCOME: return "The measure is an outcome measure"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROCESS: return "Process"; - case OUTCOME: return "Outcome"; - default: return "?"; - } - } - } - - public static class MeasureTypeEnumFactory implements EnumFactory { - public MeasureType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("process".equals(codeString)) - return MeasureType.PROCESS; - if ("outcome".equals(codeString)) - return MeasureType.OUTCOME; - throw new IllegalArgumentException("Unknown MeasureType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("process".equals(codeString)) - return new Enumeration(this, MeasureType.PROCESS); - if ("outcome".equals(codeString)) - return new Enumeration(this, MeasureType.OUTCOME); - throw new FHIRException("Unknown MeasureType code '"+codeString+"'"); - } - public String toCode(MeasureType code) { - if (code == MeasureType.PROCESS) - return "process"; - if (code == MeasureType.OUTCOME) - return "outcome"; - return "?"; - } - public String toSystem(MeasureType code) { - return code.getSystem(); - } - } - - public enum MeasurePopulationType { - /** - * The initial population for the measure - */ - INITIALPOPULATION, - /** - * The numerator for the measure - */ - NUMERATOR, - /** - * The numerator exclusion for the measure - */ - NUMERATOREXCLUSION, - /** - * The denominator for the measure - */ - DENOMINATOR, - /** - * The denominator exclusion for the measure - */ - DENOMINATOREXCLUSION, - /** - * The denominator exception for the measure - */ - DENOMINATOREXCEPTION, - /** - * The measure population for the measure - */ - MEASUREPOPULATION, - /** - * The measure population exclusion for the measure - */ - MEASUREPOPULATIONEXCLUSION, - /** - * The measure score for the measure - */ - MEASURESCORE, - /** - * added to help the parsers - */ - NULL; - public static MeasurePopulationType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("initial-population".equals(codeString)) - return INITIALPOPULATION; - if ("numerator".equals(codeString)) - return NUMERATOR; - if ("numerator-exclusion".equals(codeString)) - return NUMERATOREXCLUSION; - if ("denominator".equals(codeString)) - return DENOMINATOR; - if ("denominator-exclusion".equals(codeString)) - return DENOMINATOREXCLUSION; - if ("denominator-exception".equals(codeString)) - return DENOMINATOREXCEPTION; - if ("measure-population".equals(codeString)) - return MEASUREPOPULATION; - if ("measure-population-exclusion".equals(codeString)) - return MEASUREPOPULATIONEXCLUSION; - if ("measure-score".equals(codeString)) - return MEASURESCORE; - throw new FHIRException("Unknown MeasurePopulationType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INITIALPOPULATION: return "initial-population"; - case NUMERATOR: return "numerator"; - case NUMERATOREXCLUSION: return "numerator-exclusion"; - case DENOMINATOR: return "denominator"; - case DENOMINATOREXCLUSION: return "denominator-exclusion"; - case DENOMINATOREXCEPTION: return "denominator-exception"; - case MEASUREPOPULATION: return "measure-population"; - case MEASUREPOPULATIONEXCLUSION: return "measure-population-exclusion"; - case MEASURESCORE: return "measure-score"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INITIALPOPULATION: return "http://hl7.org/fhir/measure-population"; - case NUMERATOR: return "http://hl7.org/fhir/measure-population"; - case NUMERATOREXCLUSION: return "http://hl7.org/fhir/measure-population"; - case DENOMINATOR: return "http://hl7.org/fhir/measure-population"; - case DENOMINATOREXCLUSION: return "http://hl7.org/fhir/measure-population"; - case DENOMINATOREXCEPTION: return "http://hl7.org/fhir/measure-population"; - case MEASUREPOPULATION: return "http://hl7.org/fhir/measure-population"; - case MEASUREPOPULATIONEXCLUSION: return "http://hl7.org/fhir/measure-population"; - case MEASURESCORE: return "http://hl7.org/fhir/measure-population"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INITIALPOPULATION: return "The initial population for the measure"; - case NUMERATOR: return "The numerator for the measure"; - case NUMERATOREXCLUSION: return "The numerator exclusion for the measure"; - case DENOMINATOR: return "The denominator for the measure"; - case DENOMINATOREXCLUSION: return "The denominator exclusion for the measure"; - case DENOMINATOREXCEPTION: return "The denominator exception for the measure"; - case MEASUREPOPULATION: return "The measure population for the measure"; - case MEASUREPOPULATIONEXCLUSION: return "The measure population exclusion for the measure"; - case MEASURESCORE: return "The measure score for the measure"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INITIALPOPULATION: return "Initial Population"; - case NUMERATOR: return "Numerator"; - case NUMERATOREXCLUSION: return "Numerator Exclusion"; - case DENOMINATOR: return "Denominator"; - case DENOMINATOREXCLUSION: return "Denominator Exclusion"; - case DENOMINATOREXCEPTION: return "Denominator Exception"; - case MEASUREPOPULATION: return "Measure Population"; - case MEASUREPOPULATIONEXCLUSION: return "Measure Population Exclusion"; - case MEASURESCORE: return "Measure Score"; - default: return "?"; - } - } - } - - public static class MeasurePopulationTypeEnumFactory implements EnumFactory { - public MeasurePopulationType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("initial-population".equals(codeString)) - return MeasurePopulationType.INITIALPOPULATION; - if ("numerator".equals(codeString)) - return MeasurePopulationType.NUMERATOR; - if ("numerator-exclusion".equals(codeString)) - return MeasurePopulationType.NUMERATOREXCLUSION; - if ("denominator".equals(codeString)) - return MeasurePopulationType.DENOMINATOR; - if ("denominator-exclusion".equals(codeString)) - return MeasurePopulationType.DENOMINATOREXCLUSION; - if ("denominator-exception".equals(codeString)) - return MeasurePopulationType.DENOMINATOREXCEPTION; - if ("measure-population".equals(codeString)) - return MeasurePopulationType.MEASUREPOPULATION; - if ("measure-population-exclusion".equals(codeString)) - return MeasurePopulationType.MEASUREPOPULATIONEXCLUSION; - if ("measure-score".equals(codeString)) - return MeasurePopulationType.MEASURESCORE; - throw new IllegalArgumentException("Unknown MeasurePopulationType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("initial-population".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.INITIALPOPULATION); - if ("numerator".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.NUMERATOR); - if ("numerator-exclusion".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.NUMERATOREXCLUSION); - if ("denominator".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.DENOMINATOR); - if ("denominator-exclusion".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.DENOMINATOREXCLUSION); - if ("denominator-exception".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.DENOMINATOREXCEPTION); - if ("measure-population".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.MEASUREPOPULATION); - if ("measure-population-exclusion".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.MEASUREPOPULATIONEXCLUSION); - if ("measure-score".equals(codeString)) - return new Enumeration(this, MeasurePopulationType.MEASURESCORE); - throw new FHIRException("Unknown MeasurePopulationType code '"+codeString+"'"); - } - public String toCode(MeasurePopulationType code) { - if (code == MeasurePopulationType.INITIALPOPULATION) - return "initial-population"; - if (code == MeasurePopulationType.NUMERATOR) - return "numerator"; - if (code == MeasurePopulationType.NUMERATOREXCLUSION) - return "numerator-exclusion"; - if (code == MeasurePopulationType.DENOMINATOR) - return "denominator"; - if (code == MeasurePopulationType.DENOMINATOREXCLUSION) - return "denominator-exclusion"; - if (code == MeasurePopulationType.DENOMINATOREXCEPTION) - return "denominator-exception"; - if (code == MeasurePopulationType.MEASUREPOPULATION) - return "measure-population"; - if (code == MeasurePopulationType.MEASUREPOPULATIONEXCLUSION) - return "measure-population-exclusion"; - if (code == MeasurePopulationType.MEASURESCORE) - return "measure-score"; - return "?"; - } - public String toSystem(MeasurePopulationType code) { - return code.getSystem(); - } - } - - public enum MeasureDataUsage { - /** - * The data is intended to be provided as additional information alongside the measure results - */ - SUPPLEMENTALDATA, - /** - * The data is intended to be used to calculate and apply a risk adjustment model for the measure - */ - RISKADJUSTMENTFACTOR, - /** - * added to help the parsers - */ - NULL; - public static MeasureDataUsage fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("supplemental-data".equals(codeString)) - return SUPPLEMENTALDATA; - if ("risk-adjustment-factor".equals(codeString)) - return RISKADJUSTMENTFACTOR; - throw new FHIRException("Unknown MeasureDataUsage code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SUPPLEMENTALDATA: return "supplemental-data"; - case RISKADJUSTMENTFACTOR: return "risk-adjustment-factor"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SUPPLEMENTALDATA: return "http://hl7.org/fhir/measure-data-usage"; - case RISKADJUSTMENTFACTOR: return "http://hl7.org/fhir/measure-data-usage"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SUPPLEMENTALDATA: return "The data is intended to be provided as additional information alongside the measure results"; - case RISKADJUSTMENTFACTOR: return "The data is intended to be used to calculate and apply a risk adjustment model for the measure"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SUPPLEMENTALDATA: return "Supplemental Data"; - case RISKADJUSTMENTFACTOR: return "Risk Adjustment Factor"; - default: return "?"; - } - } - } - - public static class MeasureDataUsageEnumFactory implements EnumFactory { - public MeasureDataUsage fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("supplemental-data".equals(codeString)) - return MeasureDataUsage.SUPPLEMENTALDATA; - if ("risk-adjustment-factor".equals(codeString)) - return MeasureDataUsage.RISKADJUSTMENTFACTOR; - throw new IllegalArgumentException("Unknown MeasureDataUsage code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("supplemental-data".equals(codeString)) - return new Enumeration(this, MeasureDataUsage.SUPPLEMENTALDATA); - if ("risk-adjustment-factor".equals(codeString)) - return new Enumeration(this, MeasureDataUsage.RISKADJUSTMENTFACTOR); - throw new FHIRException("Unknown MeasureDataUsage code '"+codeString+"'"); - } - public String toCode(MeasureDataUsage code) { - if (code == MeasureDataUsage.SUPPLEMENTALDATA) - return "supplemental-data"; - if (code == MeasureDataUsage.RISKADJUSTMENTFACTOR) - return "risk-adjustment-factor"; - return "?"; - } - public String toSystem(MeasureDataUsage code) { - return code.getSystem(); - } - } - - @Block() - public static class MeasureGroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A unique identifier for the group. This identifier will used to report data for the group in the measure report. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the group. This identifier will used to report data for the group in the measure report." ) - protected Identifier identifier; - - /** - * Optional name or short description of this group. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Short name", formalDefinition="Optional name or short description of this group." ) - protected StringType name; - - /** - * The human readable description of this population group. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Summary description", formalDefinition="The human readable description of this population group." ) - protected StringType description; - - /** - * A population criteria for the measure. - */ - @Child(name = "population", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Population criteria", formalDefinition="A population criteria for the measure." ) - protected List population; - - /** - * The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path. - */ - @Child(name = "stratifier", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Stratifier criteria for the measure", formalDefinition="The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path." ) - protected List stratifier; - - private static final long serialVersionUID = 1287622059L; - - /** - * Constructor - */ - public MeasureGroupComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureGroupComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (A unique identifier for the group. This identifier will used to report data for the group in the measure report.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A unique identifier for the group. This identifier will used to report data for the group in the measure report.) - */ - public MeasureGroupComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #name} (Optional name or short description of this group.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Optional name or short description of this group.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MeasureGroupComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Optional name or short description of this group. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Optional name or short description of this group. - */ - public MeasureGroupComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (The human readable description of this population group.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The human readable description of this population group.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public MeasureGroupComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The human readable description of this population group. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The human readable description of this population group. - */ - public MeasureGroupComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #population} (A population criteria for the measure.) - */ - public List getPopulation() { - if (this.population == null) - this.population = new ArrayList(); - return this.population; - } - - public boolean hasPopulation() { - if (this.population == null) - return false; - for (MeasureGroupPopulationComponent item : this.population) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #population} (A population criteria for the measure.) - */ - // syntactic sugar - public MeasureGroupPopulationComponent addPopulation() { //3 - MeasureGroupPopulationComponent t = new MeasureGroupPopulationComponent(); - if (this.population == null) - this.population = new ArrayList(); - this.population.add(t); - return t; - } - - // syntactic sugar - public MeasureGroupComponent addPopulation(MeasureGroupPopulationComponent t) { //3 - if (t == null) - return this; - if (this.population == null) - this.population = new ArrayList(); - this.population.add(t); - return this; - } - - /** - * @return {@link #stratifier} (The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.) - */ - public List getStratifier() { - if (this.stratifier == null) - this.stratifier = new ArrayList(); - return this.stratifier; - } - - public boolean hasStratifier() { - if (this.stratifier == null) - return false; - for (MeasureGroupStratifierComponent item : this.stratifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #stratifier} (The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.) - */ - // syntactic sugar - public MeasureGroupStratifierComponent addStratifier() { //3 - MeasureGroupStratifierComponent t = new MeasureGroupStratifierComponent(); - if (this.stratifier == null) - this.stratifier = new ArrayList(); - this.stratifier.add(t); - return t; - } - - // syntactic sugar - public MeasureGroupComponent addStratifier(MeasureGroupStratifierComponent t) { //3 - if (t == null) - return this; - if (this.stratifier == null) - this.stratifier = new ArrayList(); - this.stratifier.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the group. This identifier will used to report data for the group in the measure report.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "Optional name or short description of this group.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "The human readable description of this population group.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("population", "", "A population criteria for the measure.", 0, java.lang.Integer.MAX_VALUE, population)); - childrenList.add(new Property("stratifier", "", "The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a referenced library, or a valid FHIR Resource Path.", 0, java.lang.Integer.MAX_VALUE, stratifier)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureGroupPopulationComponent - case 90983669: /*stratifier*/ return this.stratifier == null ? new Base[0] : this.stratifier.toArray(new Base[this.stratifier.size()]); // MeasureGroupStratifierComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -2023558323: // population - this.getPopulation().add((MeasureGroupPopulationComponent) value); // MeasureGroupPopulationComponent - break; - case 90983669: // stratifier - this.getStratifier().add((MeasureGroupStratifierComponent) value); // MeasureGroupStratifierComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("population")) - this.getPopulation().add((MeasureGroupPopulationComponent) value); - else if (name.equals("stratifier")) - this.getStratifier().add((MeasureGroupStratifierComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -2023558323: return addPopulation(); // MeasureGroupPopulationComponent - case 90983669: return addStratifier(); // MeasureGroupStratifierComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.description"); - } - else if (name.equals("population")) { - return addPopulation(); - } - else if (name.equals("stratifier")) { - return addStratifier(); - } - else - return super.addChild(name); - } - - public MeasureGroupComponent copy() { - MeasureGroupComponent dst = new MeasureGroupComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - if (population != null) { - dst.population = new ArrayList(); - for (MeasureGroupPopulationComponent i : population) - dst.population.add(i.copy()); - }; - if (stratifier != null) { - dst.stratifier = new ArrayList(); - for (MeasureGroupStratifierComponent i : stratifier) - dst.stratifier.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureGroupComponent)) - return false; - MeasureGroupComponent o = (MeasureGroupComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(description, o.description, true) - && compareDeep(population, o.population, true) && compareDeep(stratifier, o.stratifier, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureGroupComponent)) - return false; - MeasureGroupComponent o = (MeasureGroupComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (description == null || description.isEmpty()) && (population == null || population.isEmpty()) - && (stratifier == null || stratifier.isEmpty()); - } - - public String fhirType() { - return "Measure.group"; - - } - - } - - @Block() - public static class MeasureGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of population criteria. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of population criteria." ) - protected Enumeration type; - - /** - * A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report. - */ - @Child(name = "identifier", type = {Identifier.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report." ) - protected Identifier identifier; - - /** - * Optional name or short description of this population. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Short name", formalDefinition="Optional name or short description of this population." ) - protected StringType name; - - /** - * The human readable description of this population criteria. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The human readable description of this population criteria", formalDefinition="The human readable description of this population criteria." ) - protected StringType description; - - /** - * The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria. - */ - @Child(name = "criteria", type = {StringType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria", formalDefinition="The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria." ) - protected StringType criteria; - - private static final long serialVersionUID = 1158202275L; - - /** - * Constructor - */ - public MeasureGroupPopulationComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureGroupPopulationComponent(Enumeration type, Identifier identifier, StringType criteria) { - super(); - this.type = type; - this.identifier = identifier; - this.criteria = criteria; - } - - /** - * @return {@link #type} (The type of population criteria.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new MeasurePopulationTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of population criteria.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public MeasureGroupPopulationComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of population criteria. - */ - public MeasurePopulationType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of population criteria. - */ - public MeasureGroupPopulationComponent setType(MeasurePopulationType value) { - if (this.type == null) - this.type = new Enumeration(new MeasurePopulationTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.) - */ - public MeasureGroupPopulationComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #name} (Optional name or short description of this population.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Optional name or short description of this population.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MeasureGroupPopulationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Optional name or short description of this population. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Optional name or short description of this population. - */ - public MeasureGroupPopulationComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (The human readable description of this population criteria.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The human readable description of this population criteria.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public MeasureGroupPopulationComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The human readable description of this population criteria. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The human readable description of this population criteria. - */ - public MeasureGroupPopulationComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #criteria} (The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public StringType getCriteriaElement() { - if (this.criteria == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupPopulationComponent.criteria"); - else if (Configuration.doAutoCreate()) - this.criteria = new StringType(); // bb - return this.criteria; - } - - public boolean hasCriteriaElement() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - public boolean hasCriteria() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - /** - * @param value {@link #criteria} (The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public MeasureGroupPopulationComponent setCriteriaElement(StringType value) { - this.criteria = value; - return this; - } - - /** - * @return The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria. - */ - public String getCriteria() { - return this.criteria == null ? null : this.criteria.getValue(); - } - - /** - * @param value The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria. - */ - public MeasureGroupPopulationComponent setCriteria(String value) { - if (this.criteria == null) - this.criteria = new StringType(); - this.criteria.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of population criteria.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the population criteria. This identifier is used to report data against this criteria within the measure report.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "string", "Optional name or short description of this population.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "The human readable description of this population criteria.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("criteria", "string", "The name of a valid referenced CQL expression (may be namespaced) that defines this population criteria.", 0, java.lang.Integer.MAX_VALUE, criteria)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new MeasurePopulationTypeEnumFactory().fromType(value); // Enumeration - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 1952046943: // criteria - this.criteria = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new MeasurePopulationTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("criteria")) - this.criteria = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -1618432855: return getIdentifier(); // Identifier - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.type"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.description"); - } - else if (name.equals("criteria")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.criteria"); - } - else - return super.addChild(name); - } - - public MeasureGroupPopulationComponent copy() { - MeasureGroupPopulationComponent dst = new MeasureGroupPopulationComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.criteria = criteria == null ? null : criteria.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureGroupPopulationComponent)) - return false; - MeasureGroupPopulationComponent o = (MeasureGroupPopulationComponent) other; - return compareDeep(type, o.type, true) && compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) - && compareDeep(description, o.description, true) && compareDeep(criteria, o.criteria, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureGroupPopulationComponent)) - return false; - MeasureGroupPopulationComponent o = (MeasureGroupPopulationComponent) other; - return compareValues(type, o.type, true) && compareValues(name, o.name, true) && compareValues(description, o.description, true) - && compareValues(criteria, o.criteria, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) && (criteria == null || criteria.isEmpty()) - ; - } - - public String fhirType() { - return "Measure.group.population"; - - } - - } - - @Block() - public static class MeasureGroupStratifierComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The identifier for the stratifier used to coordinate the reported data back to this stratifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The identifier for the stratifier used to coordinate the reported data back to this stratifier", formalDefinition="The identifier for the stratifier used to coordinate the reported data back to this stratifier." ) - protected Identifier identifier; - - /** - * The criteria for the stratifier. This must be the name of an expression defined within a referenced library. - */ - @Child(name = "criteria", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Stratifier criteria", formalDefinition="The criteria for the stratifier. This must be the name of an expression defined within a referenced library." ) - protected StringType criteria; - - /** - * The path to an element that defines the stratifier, specified as a valid FHIR resource path. - */ - @Child(name = "path", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Path to the stratifier", formalDefinition="The path to an element that defines the stratifier, specified as a valid FHIR resource path." ) - protected StringType path; - - private static final long serialVersionUID = -196134448L; - - /** - * Constructor - */ - public MeasureGroupStratifierComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureGroupStratifierComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (The identifier for the stratifier used to coordinate the reported data back to this stratifier.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupStratifierComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier for the stratifier used to coordinate the reported data back to this stratifier.) - */ - public MeasureGroupStratifierComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #criteria} (The criteria for the stratifier. This must be the name of an expression defined within a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public StringType getCriteriaElement() { - if (this.criteria == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupStratifierComponent.criteria"); - else if (Configuration.doAutoCreate()) - this.criteria = new StringType(); // bb - return this.criteria; - } - - public boolean hasCriteriaElement() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - public boolean hasCriteria() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - /** - * @param value {@link #criteria} (The criteria for the stratifier. This must be the name of an expression defined within a referenced library.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public MeasureGroupStratifierComponent setCriteriaElement(StringType value) { - this.criteria = value; - return this; - } - - /** - * @return The criteria for the stratifier. This must be the name of an expression defined within a referenced library. - */ - public String getCriteria() { - return this.criteria == null ? null : this.criteria.getValue(); - } - - /** - * @param value The criteria for the stratifier. This must be the name of an expression defined within a referenced library. - */ - public MeasureGroupStratifierComponent setCriteria(String value) { - if (Utilities.noString(value)) - this.criteria = null; - else { - if (this.criteria == null) - this.criteria = new StringType(); - this.criteria.setValue(value); - } - return this; - } - - /** - * @return {@link #path} (The path to an element that defines the stratifier, specified as a valid FHIR resource path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureGroupStratifierComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The path to an element that defines the stratifier, specified as a valid FHIR resource path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public MeasureGroupStratifierComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The path to an element that defines the stratifier, specified as a valid FHIR resource path. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The path to an element that defines the stratifier, specified as a valid FHIR resource path. - */ - public MeasureGroupStratifierComponent setPath(String value) { - if (Utilities.noString(value)) - this.path = null; - else { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The identifier for the stratifier used to coordinate the reported data back to this stratifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("criteria", "string", "The criteria for the stratifier. This must be the name of an expression defined within a referenced library.", 0, java.lang.Integer.MAX_VALUE, criteria)); - childrenList.add(new Property("path", "string", "The path to an element that defines the stratifier, specified as a valid FHIR resource path.", 0, java.lang.Integer.MAX_VALUE, path)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 1952046943: // criteria - this.criteria = castToString(value); // StringType - break; - case 3433509: // path - this.path = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("criteria")) - this.criteria = castToString(value); // StringType - else if (name.equals("path")) - this.path = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("criteria")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.criteria"); - } - else if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.path"); - } - else - return super.addChild(name); - } - - public MeasureGroupStratifierComponent copy() { - MeasureGroupStratifierComponent dst = new MeasureGroupStratifierComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.criteria = criteria == null ? null : criteria.copy(); - dst.path = path == null ? null : path.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureGroupStratifierComponent)) - return false; - MeasureGroupStratifierComponent o = (MeasureGroupStratifierComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(criteria, o.criteria, true) && compareDeep(path, o.path, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureGroupStratifierComponent)) - return false; - MeasureGroupStratifierComponent o = (MeasureGroupStratifierComponent) other; - return compareValues(criteria, o.criteria, true) && compareValues(path, o.path, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (criteria == null || criteria.isEmpty()) - && (path == null || path.isEmpty()); - } - - public String fhirType() { - return "Measure.group.stratifier"; - - } - - } - - @Block() - public static class MeasureSupplementalDataComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier for the supplemental data. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier, unique within the measure", formalDefinition="An identifier for the supplemental data." ) - protected Identifier identifier; - - /** - * An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation. - */ - @Child(name = "usage", type = {CodeType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="supplemental-data | risk-adjustment-factor", formalDefinition="An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation." ) - protected List> usage; - - /** - * The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element. - */ - @Child(name = "criteria", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Supplemental data criteria", formalDefinition="The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element." ) - protected StringType criteria; - - /** - * The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path. - */ - @Child(name = "path", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Path to the supplemental data element", formalDefinition="The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path." ) - protected StringType path; - - private static final long serialVersionUID = 1666728717L; - - /** - * Constructor - */ - public MeasureSupplementalDataComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureSupplementalDataComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (An identifier for the supplemental data.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureSupplementalDataComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (An identifier for the supplemental data.) - */ - public MeasureSupplementalDataComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) - */ - public List> getUsage() { - if (this.usage == null) - this.usage = new ArrayList>(); - return this.usage; - } - - public boolean hasUsage() { - if (this.usage == null) - return false; - for (Enumeration item : this.usage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) - */ - // syntactic sugar - public Enumeration addUsageElement() {//2 - Enumeration t = new Enumeration(new MeasureDataUsageEnumFactory()); - if (this.usage == null) - this.usage = new ArrayList>(); - this.usage.add(t); - return t; - } - - /** - * @param value {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) - */ - public MeasureSupplementalDataComponent addUsage(MeasureDataUsage value) { //1 - Enumeration t = new Enumeration(new MeasureDataUsageEnumFactory()); - t.setValue(value); - if (this.usage == null) - this.usage = new ArrayList>(); - this.usage.add(t); - return this; - } - - /** - * @param value {@link #usage} (An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.) - */ - public boolean hasUsage(MeasureDataUsage value) { - if (this.usage == null) - return false; - for (Enumeration v : this.usage) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #criteria} (The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public StringType getCriteriaElement() { - if (this.criteria == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureSupplementalDataComponent.criteria"); - else if (Configuration.doAutoCreate()) - this.criteria = new StringType(); // bb - return this.criteria; - } - - public boolean hasCriteriaElement() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - public boolean hasCriteria() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - /** - * @param value {@link #criteria} (The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public MeasureSupplementalDataComponent setCriteriaElement(StringType value) { - this.criteria = value; - return this; - } - - /** - * @return The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element. - */ - public String getCriteria() { - return this.criteria == null ? null : this.criteria.getValue(); - } - - /** - * @param value The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element. - */ - public MeasureSupplementalDataComponent setCriteria(String value) { - if (Utilities.noString(value)) - this.criteria = null; - else { - if (this.criteria == null) - this.criteria = new StringType(); - this.criteria.setValue(value); - } - return this; - } - - /** - * @return {@link #path} (The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureSupplementalDataComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public MeasureSupplementalDataComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path. - */ - public MeasureSupplementalDataComponent setPath(String value) { - if (Utilities.noString(value)) - this.path = null; - else { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier for the supplemental data.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("usage", "code", "An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is additional information requested to augment the measure information. Risk adjustment factor indicates the data is additional information used to calculate risk adjustment factors when applying a risk model to the measure calculation.", 0, java.lang.Integer.MAX_VALUE, usage)); - childrenList.add(new Property("criteria", "string", "The criteria for the supplemental data. This must be the name of a valid expression defined within a referenced library, and defines the data to be returned for this element.", 0, java.lang.Integer.MAX_VALUE, criteria)); - childrenList.add(new Property("path", "string", "The supplemental data to be supplied as part of the measure response, specified as a valid FHIR Resource Path.", 0, java.lang.Integer.MAX_VALUE, path)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 111574433: /*usage*/ return this.usage == null ? new Base[0] : this.usage.toArray(new Base[this.usage.size()]); // Enumeration - case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 111574433: // usage - this.getUsage().add(new MeasureDataUsageEnumFactory().fromType(value)); // Enumeration - break; - case 1952046943: // criteria - this.criteria = castToString(value); // StringType - break; - case 3433509: // path - this.path = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("usage")) - this.getUsage().add(new MeasureDataUsageEnumFactory().fromType(value)); - else if (name.equals("criteria")) - this.criteria = castToString(value); // StringType - else if (name.equals("path")) - this.path = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // Enumeration - case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("usage")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.usage"); - } - else if (name.equals("criteria")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.criteria"); - } - else if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.path"); - } - else - return super.addChild(name); - } - - public MeasureSupplementalDataComponent copy() { - MeasureSupplementalDataComponent dst = new MeasureSupplementalDataComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - if (usage != null) { - dst.usage = new ArrayList>(); - for (Enumeration i : usage) - dst.usage.add(i.copy()); - }; - dst.criteria = criteria == null ? null : criteria.copy(); - dst.path = path == null ? null : path.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureSupplementalDataComponent)) - return false; - MeasureSupplementalDataComponent o = (MeasureSupplementalDataComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(usage, o.usage, true) && compareDeep(criteria, o.criteria, true) - && compareDeep(path, o.path, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureSupplementalDataComponent)) - return false; - MeasureSupplementalDataComponent o = (MeasureSupplementalDataComponent) other; - return compareValues(usage, o.usage, true) && compareValues(criteria, o.criteria, true) && compareValues(path, o.path, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (usage == null || usage.isEmpty()) - && (criteria == null || criteria.isEmpty()) && (path == null || path.isEmpty()); - } - - public String fhirType() { - return "Measure.supplementalData"; - - } - - } - - /** - * The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence. - */ - @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Metadata for the measure", formalDefinition="The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence." ) - protected ModuleMetadata moduleMetadata; - - /** - * A reference to a Library resource containing the formal logic used by the measure. - */ - @Child(name = "library", type = {Library.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Logic used by the measure", formalDefinition="A reference to a Library resource containing the formal logic used by the measure." ) - protected List library; - /** - * The actual objects that are the target of the reference (A reference to a Library resource containing the formal logic used by the measure.) - */ - protected List libraryTarget; - - - /** - * A disclaimer for the use of the measure. - */ - @Child(name = "disclaimer", type = {MarkdownType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disclaimer for the measure", formalDefinition="A disclaimer for the use of the measure." ) - protected MarkdownType disclaimer; - - /** - * The measure scoring type, e.g. proportion, CV. - */ - @Child(name = "scoring", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="proportion | ratio | continuous-variable | cohort", formalDefinition="The measure scoring type, e.g. proportion, CV." ) - protected Enumeration scoring; - - /** - * The measure type, e.g. process, outcome. - */ - @Child(name = "type", type = {CodeType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="process | outcome", formalDefinition="The measure type, e.g. process, outcome." ) - protected List> type; - - /** - * A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. - */ - @Child(name = "riskAdjustment", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How is risk adjustment applied for this measure", formalDefinition="A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results." ) - protected StringType riskAdjustment; - - /** - * A description of the rate aggregation for the measure. - */ - @Child(name = "rateAggregation", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How is rate aggregation performed for this measure", formalDefinition="A description of the rate aggregation for the measure." ) - protected StringType rateAggregation; - - /** - * The rationale for the measure. - */ - @Child(name = "rationale", type = {MarkdownType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why does this measure exist", formalDefinition="The rationale for the measure." ) - protected MarkdownType rationale; - - /** - * The clinical recommendation statement for the measure. - */ - @Child(name = "clinicalRecommendationStatement", type = {MarkdownType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Clinical recommendation", formalDefinition="The clinical recommendation statement for the measure." ) - protected MarkdownType clinicalRecommendationStatement; - - /** - * Improvement notation for the measure, e.g. higher score indicates better quality. - */ - @Child(name = "improvementNotation", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Improvement notation for the measure, e.g. higher score indicates better quality", formalDefinition="Improvement notation for the measure, e.g. higher score indicates better quality." ) - protected StringType improvementNotation; - - /** - * A narrative description of the complete measure calculation. - */ - @Child(name = "definition", type = {MarkdownType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A natural language definition of the measure", formalDefinition="A narrative description of the complete measure calculation." ) - protected MarkdownType definition; - - /** - * Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. - */ - @Child(name = "guidance", type = {MarkdownType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The guidance for the measure", formalDefinition="Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure." ) - protected MarkdownType guidance; - - /** - * The measure set, e.g. Preventive Care and Screening. - */ - @Child(name = "set", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The measure set, e.g. Preventive Care and Screening", formalDefinition="The measure set, e.g. Preventive Care and Screening." ) - protected StringType set; - - /** - * A group of population criteria for the measure. - */ - @Child(name = "group", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Population criteria group", formalDefinition="A group of population criteria for the measure." ) - protected List group; - - /** - * The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path. - */ - @Child(name = "supplementalData", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Supplemental data", formalDefinition="The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path." ) - protected List supplementalData; - - private static final long serialVersionUID = -1000974672L; - - /** - * Constructor - */ - public Measure() { - super(); - } - - /** - * @return {@link #moduleMetadata} (The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public ModuleMetadata getModuleMetadata() { - if (this.moduleMetadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.moduleMetadata"); - else if (Configuration.doAutoCreate()) - this.moduleMetadata = new ModuleMetadata(); // cc - return this.moduleMetadata; - } - - public boolean hasModuleMetadata() { - return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); - } - - /** - * @param value {@link #moduleMetadata} (The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence.) - */ - public Measure setModuleMetadata(ModuleMetadata value) { - this.moduleMetadata = value; - return this; - } - - /** - * @return {@link #library} (A reference to a Library resource containing the formal logic used by the measure.) - */ - public List getLibrary() { - if (this.library == null) - this.library = new ArrayList(); - return this.library; - } - - public boolean hasLibrary() { - if (this.library == null) - return false; - for (Reference item : this.library) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #library} (A reference to a Library resource containing the formal logic used by the measure.) - */ - // syntactic sugar - public Reference addLibrary() { //3 - Reference t = new Reference(); - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return t; - } - - // syntactic sugar - public Measure addLibrary(Reference t) { //3 - if (t == null) - return this; - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return this; - } - - /** - * @return {@link #library} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A reference to a Library resource containing the formal logic used by the measure.) - */ - public List getLibraryTarget() { - if (this.libraryTarget == null) - this.libraryTarget = new ArrayList(); - return this.libraryTarget; - } - - // syntactic sugar - /** - * @return {@link #library} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A reference to a Library resource containing the formal logic used by the measure.) - */ - public Library addLibraryTarget() { - Library r = new Library(); - if (this.libraryTarget == null) - this.libraryTarget = new ArrayList(); - this.libraryTarget.add(r); - return r; - } - - /** - * @return {@link #disclaimer} (A disclaimer for the use of the measure.). This is the underlying object with id, value and extensions. The accessor "getDisclaimer" gives direct access to the value - */ - public MarkdownType getDisclaimerElement() { - if (this.disclaimer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.disclaimer"); - else if (Configuration.doAutoCreate()) - this.disclaimer = new MarkdownType(); // bb - return this.disclaimer; - } - - public boolean hasDisclaimerElement() { - return this.disclaimer != null && !this.disclaimer.isEmpty(); - } - - public boolean hasDisclaimer() { - return this.disclaimer != null && !this.disclaimer.isEmpty(); - } - - /** - * @param value {@link #disclaimer} (A disclaimer for the use of the measure.). This is the underlying object with id, value and extensions. The accessor "getDisclaimer" gives direct access to the value - */ - public Measure setDisclaimerElement(MarkdownType value) { - this.disclaimer = value; - return this; - } - - /** - * @return A disclaimer for the use of the measure. - */ - public String getDisclaimer() { - return this.disclaimer == null ? null : this.disclaimer.getValue(); - } - - /** - * @param value A disclaimer for the use of the measure. - */ - public Measure setDisclaimer(String value) { - if (value == null) - this.disclaimer = null; - else { - if (this.disclaimer == null) - this.disclaimer = new MarkdownType(); - this.disclaimer.setValue(value); - } - return this; - } - - /** - * @return {@link #scoring} (The measure scoring type, e.g. proportion, CV.). This is the underlying object with id, value and extensions. The accessor "getScoring" gives direct access to the value - */ - public Enumeration getScoringElement() { - if (this.scoring == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.scoring"); - else if (Configuration.doAutoCreate()) - this.scoring = new Enumeration(new MeasureScoringEnumFactory()); // bb - return this.scoring; - } - - public boolean hasScoringElement() { - return this.scoring != null && !this.scoring.isEmpty(); - } - - public boolean hasScoring() { - return this.scoring != null && !this.scoring.isEmpty(); - } - - /** - * @param value {@link #scoring} (The measure scoring type, e.g. proportion, CV.). This is the underlying object with id, value and extensions. The accessor "getScoring" gives direct access to the value - */ - public Measure setScoringElement(Enumeration value) { - this.scoring = value; - return this; - } - - /** - * @return The measure scoring type, e.g. proportion, CV. - */ - public MeasureScoring getScoring() { - return this.scoring == null ? null : this.scoring.getValue(); - } - - /** - * @param value The measure scoring type, e.g. proportion, CV. - */ - public Measure setScoring(MeasureScoring value) { - if (value == null) - this.scoring = null; - else { - if (this.scoring == null) - this.scoring = new Enumeration(new MeasureScoringEnumFactory()); - this.scoring.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The measure type, e.g. process, outcome.) - */ - public List> getType() { - if (this.type == null) - this.type = new ArrayList>(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Enumeration item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The measure type, e.g. process, outcome.) - */ - // syntactic sugar - public Enumeration addTypeElement() {//2 - Enumeration t = new Enumeration(new MeasureTypeEnumFactory()); - if (this.type == null) - this.type = new ArrayList>(); - this.type.add(t); - return t; - } - - /** - * @param value {@link #type} (The measure type, e.g. process, outcome.) - */ - public Measure addType(MeasureType value) { //1 - Enumeration t = new Enumeration(new MeasureTypeEnumFactory()); - t.setValue(value); - if (this.type == null) - this.type = new ArrayList>(); - this.type.add(t); - return this; - } - - /** - * @param value {@link #type} (The measure type, e.g. process, outcome.) - */ - public boolean hasType(MeasureType value) { - if (this.type == null) - return false; - for (Enumeration v : this.type) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #riskAdjustment} (A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.). This is the underlying object with id, value and extensions. The accessor "getRiskAdjustment" gives direct access to the value - */ - public StringType getRiskAdjustmentElement() { - if (this.riskAdjustment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.riskAdjustment"); - else if (Configuration.doAutoCreate()) - this.riskAdjustment = new StringType(); // bb - return this.riskAdjustment; - } - - public boolean hasRiskAdjustmentElement() { - return this.riskAdjustment != null && !this.riskAdjustment.isEmpty(); - } - - public boolean hasRiskAdjustment() { - return this.riskAdjustment != null && !this.riskAdjustment.isEmpty(); - } - - /** - * @param value {@link #riskAdjustment} (A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.). This is the underlying object with id, value and extensions. The accessor "getRiskAdjustment" gives direct access to the value - */ - public Measure setRiskAdjustmentElement(StringType value) { - this.riskAdjustment = value; - return this; - } - - /** - * @return A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. - */ - public String getRiskAdjustment() { - return this.riskAdjustment == null ? null : this.riskAdjustment.getValue(); - } - - /** - * @param value A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results. - */ - public Measure setRiskAdjustment(String value) { - if (Utilities.noString(value)) - this.riskAdjustment = null; - else { - if (this.riskAdjustment == null) - this.riskAdjustment = new StringType(); - this.riskAdjustment.setValue(value); - } - return this; - } - - /** - * @return {@link #rateAggregation} (A description of the rate aggregation for the measure.). This is the underlying object with id, value and extensions. The accessor "getRateAggregation" gives direct access to the value - */ - public StringType getRateAggregationElement() { - if (this.rateAggregation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.rateAggregation"); - else if (Configuration.doAutoCreate()) - this.rateAggregation = new StringType(); // bb - return this.rateAggregation; - } - - public boolean hasRateAggregationElement() { - return this.rateAggregation != null && !this.rateAggregation.isEmpty(); - } - - public boolean hasRateAggregation() { - return this.rateAggregation != null && !this.rateAggregation.isEmpty(); - } - - /** - * @param value {@link #rateAggregation} (A description of the rate aggregation for the measure.). This is the underlying object with id, value and extensions. The accessor "getRateAggregation" gives direct access to the value - */ - public Measure setRateAggregationElement(StringType value) { - this.rateAggregation = value; - return this; - } - - /** - * @return A description of the rate aggregation for the measure. - */ - public String getRateAggregation() { - return this.rateAggregation == null ? null : this.rateAggregation.getValue(); - } - - /** - * @param value A description of the rate aggregation for the measure. - */ - public Measure setRateAggregation(String value) { - if (Utilities.noString(value)) - this.rateAggregation = null; - else { - if (this.rateAggregation == null) - this.rateAggregation = new StringType(); - this.rateAggregation.setValue(value); - } - return this; - } - - /** - * @return {@link #rationale} (The rationale for the measure.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public MarkdownType getRationaleElement() { - if (this.rationale == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.rationale"); - else if (Configuration.doAutoCreate()) - this.rationale = new MarkdownType(); // bb - return this.rationale; - } - - public boolean hasRationaleElement() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - public boolean hasRationale() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - /** - * @param value {@link #rationale} (The rationale for the measure.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public Measure setRationaleElement(MarkdownType value) { - this.rationale = value; - return this; - } - - /** - * @return The rationale for the measure. - */ - public String getRationale() { - return this.rationale == null ? null : this.rationale.getValue(); - } - - /** - * @param value The rationale for the measure. - */ - public Measure setRationale(String value) { - if (value == null) - this.rationale = null; - else { - if (this.rationale == null) - this.rationale = new MarkdownType(); - this.rationale.setValue(value); - } - return this; - } - - /** - * @return {@link #clinicalRecommendationStatement} (The clinical recommendation statement for the measure.). This is the underlying object with id, value and extensions. The accessor "getClinicalRecommendationStatement" gives direct access to the value - */ - public MarkdownType getClinicalRecommendationStatementElement() { - if (this.clinicalRecommendationStatement == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.clinicalRecommendationStatement"); - else if (Configuration.doAutoCreate()) - this.clinicalRecommendationStatement = new MarkdownType(); // bb - return this.clinicalRecommendationStatement; - } - - public boolean hasClinicalRecommendationStatementElement() { - return this.clinicalRecommendationStatement != null && !this.clinicalRecommendationStatement.isEmpty(); - } - - public boolean hasClinicalRecommendationStatement() { - return this.clinicalRecommendationStatement != null && !this.clinicalRecommendationStatement.isEmpty(); - } - - /** - * @param value {@link #clinicalRecommendationStatement} (The clinical recommendation statement for the measure.). This is the underlying object with id, value and extensions. The accessor "getClinicalRecommendationStatement" gives direct access to the value - */ - public Measure setClinicalRecommendationStatementElement(MarkdownType value) { - this.clinicalRecommendationStatement = value; - return this; - } - - /** - * @return The clinical recommendation statement for the measure. - */ - public String getClinicalRecommendationStatement() { - return this.clinicalRecommendationStatement == null ? null : this.clinicalRecommendationStatement.getValue(); - } - - /** - * @param value The clinical recommendation statement for the measure. - */ - public Measure setClinicalRecommendationStatement(String value) { - if (value == null) - this.clinicalRecommendationStatement = null; - else { - if (this.clinicalRecommendationStatement == null) - this.clinicalRecommendationStatement = new MarkdownType(); - this.clinicalRecommendationStatement.setValue(value); - } - return this; - } - - /** - * @return {@link #improvementNotation} (Improvement notation for the measure, e.g. higher score indicates better quality.). This is the underlying object with id, value and extensions. The accessor "getImprovementNotation" gives direct access to the value - */ - public StringType getImprovementNotationElement() { - if (this.improvementNotation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.improvementNotation"); - else if (Configuration.doAutoCreate()) - this.improvementNotation = new StringType(); // bb - return this.improvementNotation; - } - - public boolean hasImprovementNotationElement() { - return this.improvementNotation != null && !this.improvementNotation.isEmpty(); - } - - public boolean hasImprovementNotation() { - return this.improvementNotation != null && !this.improvementNotation.isEmpty(); - } - - /** - * @param value {@link #improvementNotation} (Improvement notation for the measure, e.g. higher score indicates better quality.). This is the underlying object with id, value and extensions. The accessor "getImprovementNotation" gives direct access to the value - */ - public Measure setImprovementNotationElement(StringType value) { - this.improvementNotation = value; - return this; - } - - /** - * @return Improvement notation for the measure, e.g. higher score indicates better quality. - */ - public String getImprovementNotation() { - return this.improvementNotation == null ? null : this.improvementNotation.getValue(); - } - - /** - * @param value Improvement notation for the measure, e.g. higher score indicates better quality. - */ - public Measure setImprovementNotation(String value) { - if (Utilities.noString(value)) - this.improvementNotation = null; - else { - if (this.improvementNotation == null) - this.improvementNotation = new StringType(); - this.improvementNotation.setValue(value); - } - return this; - } - - /** - * @return {@link #definition} (A narrative description of the complete measure calculation.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public MarkdownType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new MarkdownType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (A narrative description of the complete measure calculation.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public Measure setDefinitionElement(MarkdownType value) { - this.definition = value; - return this; - } - - /** - * @return A narrative description of the complete measure calculation. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value A narrative description of the complete measure calculation. - */ - public Measure setDefinition(String value) { - if (value == null) - this.definition = null; - else { - if (this.definition == null) - this.definition = new MarkdownType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #guidance} (Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.). This is the underlying object with id, value and extensions. The accessor "getGuidance" gives direct access to the value - */ - public MarkdownType getGuidanceElement() { - if (this.guidance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.guidance"); - else if (Configuration.doAutoCreate()) - this.guidance = new MarkdownType(); // bb - return this.guidance; - } - - public boolean hasGuidanceElement() { - return this.guidance != null && !this.guidance.isEmpty(); - } - - public boolean hasGuidance() { - return this.guidance != null && !this.guidance.isEmpty(); - } - - /** - * @param value {@link #guidance} (Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.). This is the underlying object with id, value and extensions. The accessor "getGuidance" gives direct access to the value - */ - public Measure setGuidanceElement(MarkdownType value) { - this.guidance = value; - return this; - } - - /** - * @return Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. - */ - public String getGuidance() { - return this.guidance == null ? null : this.guidance.getValue(); - } - - /** - * @param value Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure. - */ - public Measure setGuidance(String value) { - if (value == null) - this.guidance = null; - else { - if (this.guidance == null) - this.guidance = new MarkdownType(); - this.guidance.setValue(value); - } - return this; - } - - /** - * @return {@link #set} (The measure set, e.g. Preventive Care and Screening.). This is the underlying object with id, value and extensions. The accessor "getSet" gives direct access to the value - */ - public StringType getSetElement() { - if (this.set == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Measure.set"); - else if (Configuration.doAutoCreate()) - this.set = new StringType(); // bb - return this.set; - } - - public boolean hasSetElement() { - return this.set != null && !this.set.isEmpty(); - } - - public boolean hasSet() { - return this.set != null && !this.set.isEmpty(); - } - - /** - * @param value {@link #set} (The measure set, e.g. Preventive Care and Screening.). This is the underlying object with id, value and extensions. The accessor "getSet" gives direct access to the value - */ - public Measure setSetElement(StringType value) { - this.set = value; - return this; - } - - /** - * @return The measure set, e.g. Preventive Care and Screening. - */ - public String getSet() { - return this.set == null ? null : this.set.getValue(); - } - - /** - * @param value The measure set, e.g. Preventive Care and Screening. - */ - public Measure setSet(String value) { - if (Utilities.noString(value)) - this.set = null; - else { - if (this.set == null) - this.set = new StringType(); - this.set.setValue(value); - } - return this; - } - - /** - * @return {@link #group} (A group of population criteria for the measure.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (MeasureGroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (A group of population criteria for the measure.) - */ - // syntactic sugar - public MeasureGroupComponent addGroup() { //3 - MeasureGroupComponent t = new MeasureGroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public Measure addGroup(MeasureGroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - /** - * @return {@link #supplementalData} (The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.) - */ - public List getSupplementalData() { - if (this.supplementalData == null) - this.supplementalData = new ArrayList(); - return this.supplementalData; - } - - public boolean hasSupplementalData() { - if (this.supplementalData == null) - return false; - for (MeasureSupplementalDataComponent item : this.supplementalData) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supplementalData} (The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.) - */ - // syntactic sugar - public MeasureSupplementalDataComponent addSupplementalData() { //3 - MeasureSupplementalDataComponent t = new MeasureSupplementalDataComponent(); - if (this.supplementalData == null) - this.supplementalData = new ArrayList(); - this.supplementalData.add(t); - return t; - } - - // syntactic sugar - public Measure addSupplementalData(MeasureSupplementalDataComponent t) { //3 - if (t == null) - return this; - if (this.supplementalData == null) - this.supplementalData = new ArrayList(); - this.supplementalData.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "The metadata for the measure, including publishing, life-cycle, version, documentation, and supporting evidence.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); - childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library resource containing the formal logic used by the measure.", 0, java.lang.Integer.MAX_VALUE, library)); - childrenList.add(new Property("disclaimer", "markdown", "A disclaimer for the use of the measure.", 0, java.lang.Integer.MAX_VALUE, disclaimer)); - childrenList.add(new Property("scoring", "code", "The measure scoring type, e.g. proportion, CV.", 0, java.lang.Integer.MAX_VALUE, scoring)); - childrenList.add(new Property("type", "code", "The measure type, e.g. process, outcome.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("riskAdjustment", "string", "A description of the risk adjustment factors that may impact the resulting score for the measure and how they may be accounted for when computing and reporting measure results.", 0, java.lang.Integer.MAX_VALUE, riskAdjustment)); - childrenList.add(new Property("rateAggregation", "string", "A description of the rate aggregation for the measure.", 0, java.lang.Integer.MAX_VALUE, rateAggregation)); - childrenList.add(new Property("rationale", "markdown", "The rationale for the measure.", 0, java.lang.Integer.MAX_VALUE, rationale)); - childrenList.add(new Property("clinicalRecommendationStatement", "markdown", "The clinical recommendation statement for the measure.", 0, java.lang.Integer.MAX_VALUE, clinicalRecommendationStatement)); - childrenList.add(new Property("improvementNotation", "string", "Improvement notation for the measure, e.g. higher score indicates better quality.", 0, java.lang.Integer.MAX_VALUE, improvementNotation)); - childrenList.add(new Property("definition", "markdown", "A narrative description of the complete measure calculation.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("guidance", "markdown", "Additional guidance for the measure including how it can be used in a clinical context, and the intent of the measure.", 0, java.lang.Integer.MAX_VALUE, guidance)); - childrenList.add(new Property("set", "string", "The measure set, e.g. Preventive Care and Screening.", 0, java.lang.Integer.MAX_VALUE, set)); - childrenList.add(new Property("group", "", "A group of population criteria for the measure.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("supplementalData", "", "The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a referenced library, or a valid FHIR Resource Path.", 0, java.lang.Integer.MAX_VALUE, supplementalData)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata - case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference - case 432371099: /*disclaimer*/ return this.disclaimer == null ? new Base[0] : new Base[] {this.disclaimer}; // MarkdownType - case 1924005583: /*scoring*/ return this.scoring == null ? new Base[0] : new Base[] {this.scoring}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Enumeration - case 93273500: /*riskAdjustment*/ return this.riskAdjustment == null ? new Base[0] : new Base[] {this.riskAdjustment}; // StringType - case 1254503906: /*rateAggregation*/ return this.rateAggregation == null ? new Base[0] : new Base[] {this.rateAggregation}; // StringType - case 345689335: /*rationale*/ return this.rationale == null ? new Base[0] : new Base[] {this.rationale}; // MarkdownType - case -18631389: /*clinicalRecommendationStatement*/ return this.clinicalRecommendationStatement == null ? new Base[0] : new Base[] {this.clinicalRecommendationStatement}; // MarkdownType - case -2085456136: /*improvementNotation*/ return this.improvementNotation == null ? new Base[0] : new Base[] {this.improvementNotation}; // StringType - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // MarkdownType - case -1314002088: /*guidance*/ return this.guidance == null ? new Base[0] : new Base[] {this.guidance}; // MarkdownType - case 113762: /*set*/ return this.set == null ? new Base[0] : new Base[] {this.set}; // StringType - case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureGroupComponent - case 1447496814: /*supplementalData*/ return this.supplementalData == null ? new Base[0] : this.supplementalData.toArray(new Base[this.supplementalData.size()]); // MeasureSupplementalDataComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 455891387: // moduleMetadata - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - break; - case 166208699: // library - this.getLibrary().add(castToReference(value)); // Reference - break; - case 432371099: // disclaimer - this.disclaimer = castToMarkdown(value); // MarkdownType - break; - case 1924005583: // scoring - this.scoring = new MeasureScoringEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.getType().add(new MeasureTypeEnumFactory().fromType(value)); // Enumeration - break; - case 93273500: // riskAdjustment - this.riskAdjustment = castToString(value); // StringType - break; - case 1254503906: // rateAggregation - this.rateAggregation = castToString(value); // StringType - break; - case 345689335: // rationale - this.rationale = castToMarkdown(value); // MarkdownType - break; - case -18631389: // clinicalRecommendationStatement - this.clinicalRecommendationStatement = castToMarkdown(value); // MarkdownType - break; - case -2085456136: // improvementNotation - this.improvementNotation = castToString(value); // StringType - break; - case -1014418093: // definition - this.definition = castToMarkdown(value); // MarkdownType - break; - case -1314002088: // guidance - this.guidance = castToMarkdown(value); // MarkdownType - break; - case 113762: // set - this.set = castToString(value); // StringType - break; - case 98629247: // group - this.getGroup().add((MeasureGroupComponent) value); // MeasureGroupComponent - break; - case 1447496814: // supplementalData - this.getSupplementalData().add((MeasureSupplementalDataComponent) value); // MeasureSupplementalDataComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("moduleMetadata")) - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - else if (name.equals("library")) - this.getLibrary().add(castToReference(value)); - else if (name.equals("disclaimer")) - this.disclaimer = castToMarkdown(value); // MarkdownType - else if (name.equals("scoring")) - this.scoring = new MeasureScoringEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.getType().add(new MeasureTypeEnumFactory().fromType(value)); - else if (name.equals("riskAdjustment")) - this.riskAdjustment = castToString(value); // StringType - else if (name.equals("rateAggregation")) - this.rateAggregation = castToString(value); // StringType - else if (name.equals("rationale")) - this.rationale = castToMarkdown(value); // MarkdownType - else if (name.equals("clinicalRecommendationStatement")) - this.clinicalRecommendationStatement = castToMarkdown(value); // MarkdownType - else if (name.equals("improvementNotation")) - this.improvementNotation = castToString(value); // StringType - else if (name.equals("definition")) - this.definition = castToMarkdown(value); // MarkdownType - else if (name.equals("guidance")) - this.guidance = castToMarkdown(value); // MarkdownType - else if (name.equals("set")) - this.set = castToString(value); // StringType - else if (name.equals("group")) - this.getGroup().add((MeasureGroupComponent) value); - else if (name.equals("supplementalData")) - this.getSupplementalData().add((MeasureSupplementalDataComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 455891387: return getModuleMetadata(); // ModuleMetadata - case 166208699: return addLibrary(); // Reference - case 432371099: throw new FHIRException("Cannot make property disclaimer as it is not a complex type"); // MarkdownType - case 1924005583: throw new FHIRException("Cannot make property scoring as it is not a complex type"); // Enumeration - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 93273500: throw new FHIRException("Cannot make property riskAdjustment as it is not a complex type"); // StringType - case 1254503906: throw new FHIRException("Cannot make property rateAggregation as it is not a complex type"); // StringType - case 345689335: throw new FHIRException("Cannot make property rationale as it is not a complex type"); // MarkdownType - case -18631389: throw new FHIRException("Cannot make property clinicalRecommendationStatement as it is not a complex type"); // MarkdownType - case -2085456136: throw new FHIRException("Cannot make property improvementNotation as it is not a complex type"); // StringType - case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // MarkdownType - case -1314002088: throw new FHIRException("Cannot make property guidance as it is not a complex type"); // MarkdownType - case 113762: throw new FHIRException("Cannot make property set as it is not a complex type"); // StringType - case 98629247: return addGroup(); // MeasureGroupComponent - case 1447496814: return addSupplementalData(); // MeasureSupplementalDataComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("moduleMetadata")) { - this.moduleMetadata = new ModuleMetadata(); - return this.moduleMetadata; - } - else if (name.equals("library")) { - return addLibrary(); - } - else if (name.equals("disclaimer")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.disclaimer"); - } - else if (name.equals("scoring")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.scoring"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.type"); - } - else if (name.equals("riskAdjustment")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.riskAdjustment"); - } - else if (name.equals("rateAggregation")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.rateAggregation"); - } - else if (name.equals("rationale")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.rationale"); - } - else if (name.equals("clinicalRecommendationStatement")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.clinicalRecommendationStatement"); - } - else if (name.equals("improvementNotation")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.improvementNotation"); - } - else if (name.equals("definition")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.definition"); - } - else if (name.equals("guidance")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.guidance"); - } - else if (name.equals("set")) { - throw new FHIRException("Cannot call addChild on a primitive type Measure.set"); - } - else if (name.equals("group")) { - return addGroup(); - } - else if (name.equals("supplementalData")) { - return addSupplementalData(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Measure"; - - } - - public Measure copy() { - Measure dst = new Measure(); - copyValues(dst); - dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); - if (library != null) { - dst.library = new ArrayList(); - for (Reference i : library) - dst.library.add(i.copy()); - }; - dst.disclaimer = disclaimer == null ? null : disclaimer.copy(); - dst.scoring = scoring == null ? null : scoring.copy(); - if (type != null) { - dst.type = new ArrayList>(); - for (Enumeration i : type) - dst.type.add(i.copy()); - }; - dst.riskAdjustment = riskAdjustment == null ? null : riskAdjustment.copy(); - dst.rateAggregation = rateAggregation == null ? null : rateAggregation.copy(); - dst.rationale = rationale == null ? null : rationale.copy(); - dst.clinicalRecommendationStatement = clinicalRecommendationStatement == null ? null : clinicalRecommendationStatement.copy(); - dst.improvementNotation = improvementNotation == null ? null : improvementNotation.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.guidance = guidance == null ? null : guidance.copy(); - dst.set = set == null ? null : set.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (MeasureGroupComponent i : group) - dst.group.add(i.copy()); - }; - if (supplementalData != null) { - dst.supplementalData = new ArrayList(); - for (MeasureSupplementalDataComponent i : supplementalData) - dst.supplementalData.add(i.copy()); - }; - return dst; - } - - protected Measure typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Measure)) - return false; - Measure o = (Measure) other; - return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(library, o.library, true) - && compareDeep(disclaimer, o.disclaimer, true) && compareDeep(scoring, o.scoring, true) && compareDeep(type, o.type, true) - && compareDeep(riskAdjustment, o.riskAdjustment, true) && compareDeep(rateAggregation, o.rateAggregation, true) - && compareDeep(rationale, o.rationale, true) && compareDeep(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) - && compareDeep(improvementNotation, o.improvementNotation, true) && compareDeep(definition, o.definition, true) - && compareDeep(guidance, o.guidance, true) && compareDeep(set, o.set, true) && compareDeep(group, o.group, true) - && compareDeep(supplementalData, o.supplementalData, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Measure)) - return false; - Measure o = (Measure) other; - return compareValues(disclaimer, o.disclaimer, true) && compareValues(scoring, o.scoring, true) && compareValues(type, o.type, true) - && compareValues(riskAdjustment, o.riskAdjustment, true) && compareValues(rateAggregation, o.rateAggregation, true) - && compareValues(rationale, o.rationale, true) && compareValues(clinicalRecommendationStatement, o.clinicalRecommendationStatement, true) - && compareValues(improvementNotation, o.improvementNotation, true) && compareValues(definition, o.definition, true) - && compareValues(guidance, o.guidance, true) && compareValues(set, o.set, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (library == null || library.isEmpty()) - && (disclaimer == null || disclaimer.isEmpty()) && (scoring == null || scoring.isEmpty()) - && (type == null || type.isEmpty()) && (riskAdjustment == null || riskAdjustment.isEmpty()) - && (rateAggregation == null || rateAggregation.isEmpty()) && (rationale == null || rationale.isEmpty()) - && (clinicalRecommendationStatement == null || clinicalRecommendationStatement.isEmpty()) - && (improvementNotation == null || improvementNotation.isEmpty()) && (definition == null || definition.isEmpty()) - && (guidance == null || guidance.isEmpty()) && (set == null || set.isEmpty()) && (group == null || group.isEmpty()) - && (supplementalData == null || supplementalData.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Measure; - } - - /** - * Search parameter: topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: Measure.moduleMetadata.topic
- *

- */ - @SearchParamDefinition(name="topic", path="Measure.moduleMetadata.topic", description="Topics associated with the module", type="token" ) - public static final String SP_TOPIC = "topic"; - /** - * Fluent Client search parameter constant for topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: Measure.moduleMetadata.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); - - /** - * Search parameter: title - *

- * Description: Text search against the title
- * Type: string
- * Path: Measure.moduleMetadata.title
- *

- */ - @SearchParamDefinition(name="title", path="Measure.moduleMetadata.title", description="Text search against the title", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Text search against the title
- * Type: string
- * Path: Measure.moduleMetadata.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: status - *

- * Description: Status of the module
- * Type: token
- * Path: Measure.moduleMetadata.status
- *

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

- * Description: Status of the module
- * Type: token
- * Path: Measure.moduleMetadata.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search against the description
- * Type: string
- * Path: Measure.moduleMetadata.description
- *

- */ - @SearchParamDefinition(name="description", path="Measure.moduleMetadata.description", description="Text search against the description", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search against the description
- * Type: string
- * Path: Measure.moduleMetadata.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: Measure.moduleMetadata.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Measure.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: Measure.moduleMetadata.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: Measure.moduleMetadata.version
- *

- */ - @SearchParamDefinition(name="version", path="Measure.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: Measure.moduleMetadata.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MeasureReport.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MeasureReport.java deleted file mode 100644 index c9d2227f9ea..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MeasureReport.java +++ /dev/null @@ -1,3001 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * The MeasureReport resource contains the results of evaluating a measure. - */ -@ResourceDef(name="MeasureReport", profile="http://hl7.org/fhir/Profile/MeasureReport") -public class MeasureReport extends DomainResource { - - public enum MeasureReportType { - /** - * An individual report that provides information on the performance for a given measure with respect to a single patient - */ - INDIVIDUAL, - /** - * A patient list report that includes a listing of patients that satisfied each population criteria in the measure - */ - PATIENTLIST, - /** - * A summary report that returns the number of patients in each population criteria for the measure - */ - SUMMARY, - /** - * added to help the parsers - */ - NULL; - public static MeasureReportType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("individual".equals(codeString)) - return INDIVIDUAL; - if ("patient-list".equals(codeString)) - return PATIENTLIST; - if ("summary".equals(codeString)) - return SUMMARY; - throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INDIVIDUAL: return "individual"; - case PATIENTLIST: return "patient-list"; - case SUMMARY: return "summary"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INDIVIDUAL: return "http://hl7.org/fhir/measure-report-type"; - case PATIENTLIST: return "http://hl7.org/fhir/measure-report-type"; - case SUMMARY: return "http://hl7.org/fhir/measure-report-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INDIVIDUAL: return "An individual report that provides information on the performance for a given measure with respect to a single patient"; - case PATIENTLIST: return "A patient list report that includes a listing of patients that satisfied each population criteria in the measure"; - case SUMMARY: return "A summary report that returns the number of patients in each population criteria for the measure"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INDIVIDUAL: return "Individual"; - case PATIENTLIST: return "Patient List"; - case SUMMARY: return "Summary"; - default: return "?"; - } - } - } - - public static class MeasureReportTypeEnumFactory implements EnumFactory { - public MeasureReportType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("individual".equals(codeString)) - return MeasureReportType.INDIVIDUAL; - if ("patient-list".equals(codeString)) - return MeasureReportType.PATIENTLIST; - if ("summary".equals(codeString)) - return MeasureReportType.SUMMARY; - throw new IllegalArgumentException("Unknown MeasureReportType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("individual".equals(codeString)) - return new Enumeration(this, MeasureReportType.INDIVIDUAL); - if ("patient-list".equals(codeString)) - return new Enumeration(this, MeasureReportType.PATIENTLIST); - if ("summary".equals(codeString)) - return new Enumeration(this, MeasureReportType.SUMMARY); - throw new FHIRException("Unknown MeasureReportType code '"+codeString+"'"); - } - public String toCode(MeasureReportType code) { - if (code == MeasureReportType.INDIVIDUAL) - return "individual"; - if (code == MeasureReportType.PATIENTLIST) - return "patient-list"; - if (code == MeasureReportType.SUMMARY) - return "summary"; - return "?"; - } - public String toSystem(MeasureReportType code) { - return code.getSystem(); - } - } - - public enum MeasureReportStatus { - /** - * The report is complete and ready for use - */ - COMPLETE, - /** - * The report is currently being generated - */ - PENDING, - /** - * An error occurred attempting to generate the report - */ - ERROR, - /** - * added to help the parsers - */ - NULL; - public static MeasureReportStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return COMPLETE; - if ("pending".equals(codeString)) - return PENDING; - if ("error".equals(codeString)) - return ERROR; - throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case COMPLETE: return "complete"; - case PENDING: return "pending"; - case ERROR: return "error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case COMPLETE: return "http://hl7.org/fhir/measure-report-status"; - case PENDING: return "http://hl7.org/fhir/measure-report-status"; - case ERROR: return "http://hl7.org/fhir/measure-report-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case COMPLETE: return "The report is complete and ready for use"; - case PENDING: return "The report is currently being generated"; - case ERROR: return "An error occurred attempting to generate the report"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case COMPLETE: return "Complete"; - case PENDING: return "Pending"; - case ERROR: return "Error"; - default: return "?"; - } - } - } - - public static class MeasureReportStatusEnumFactory implements EnumFactory { - public MeasureReportStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return MeasureReportStatus.COMPLETE; - if ("pending".equals(codeString)) - return MeasureReportStatus.PENDING; - if ("error".equals(codeString)) - return MeasureReportStatus.ERROR; - throw new IllegalArgumentException("Unknown MeasureReportStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("complete".equals(codeString)) - return new Enumeration(this, MeasureReportStatus.COMPLETE); - if ("pending".equals(codeString)) - return new Enumeration(this, MeasureReportStatus.PENDING); - if ("error".equals(codeString)) - return new Enumeration(this, MeasureReportStatus.ERROR); - throw new FHIRException("Unknown MeasureReportStatus code '"+codeString+"'"); - } - public String toCode(MeasureReportStatus code) { - if (code == MeasureReportStatus.COMPLETE) - return "complete"; - if (code == MeasureReportStatus.PENDING) - return "pending"; - if (code == MeasureReportStatus.ERROR) - return "error"; - return "?"; - } - public String toSystem(MeasureReportStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class MeasureReportGroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The identifier of the population group as defined in the measure definition. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of the population group being reported", formalDefinition="The identifier of the population group as defined in the measure definition." ) - protected Identifier identifier; - - /** - * The populations that make up the population group, one for each type of population appropriate for the measure. - */ - @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The populations in the group", formalDefinition="The populations that make up the population group, one for each type of population appropriate for the measure." ) - protected List population; - - /** - * The measure score. - */ - @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The measure score", formalDefinition="The measure score." ) - protected DecimalType measureScore; - - /** - * When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure. - */ - @Child(name = "stratifier", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Stratification results", formalDefinition="When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure." ) - protected List stratifier; - - /** - * Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations. - */ - @Child(name = "supplementalData", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Supplemental data elements for the measure", formalDefinition="Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations." ) - protected List supplementalData; - - private static final long serialVersionUID = -832029515L; - - /** - * Constructor - */ - public MeasureReportGroupComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (The identifier of the population group as defined in the measure definition.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of the population group as defined in the measure definition.) - */ - public MeasureReportGroupComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #population} (The populations that make up the population group, one for each type of population appropriate for the measure.) - */ - public List getPopulation() { - if (this.population == null) - this.population = new ArrayList(); - return this.population; - } - - public boolean hasPopulation() { - if (this.population == null) - return false; - for (MeasureReportGroupPopulationComponent item : this.population) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #population} (The populations that make up the population group, one for each type of population appropriate for the measure.) - */ - // syntactic sugar - public MeasureReportGroupPopulationComponent addPopulation() { //3 - MeasureReportGroupPopulationComponent t = new MeasureReportGroupPopulationComponent(); - if (this.population == null) - this.population = new ArrayList(); - this.population.add(t); - return t; - } - - // syntactic sugar - public MeasureReportGroupComponent addPopulation(MeasureReportGroupPopulationComponent t) { //3 - if (t == null) - return this; - if (this.population == null) - this.population = new ArrayList(); - this.population.add(t); - return this; - } - - /** - * @return {@link #measureScore} (The measure score.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value - */ - public DecimalType getMeasureScoreElement() { - if (this.measureScore == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupComponent.measureScore"); - else if (Configuration.doAutoCreate()) - this.measureScore = new DecimalType(); // bb - return this.measureScore; - } - - public boolean hasMeasureScoreElement() { - return this.measureScore != null && !this.measureScore.isEmpty(); - } - - public boolean hasMeasureScore() { - return this.measureScore != null && !this.measureScore.isEmpty(); - } - - /** - * @param value {@link #measureScore} (The measure score.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value - */ - public MeasureReportGroupComponent setMeasureScoreElement(DecimalType value) { - this.measureScore = value; - return this; - } - - /** - * @return The measure score. - */ - public BigDecimal getMeasureScore() { - return this.measureScore == null ? null : this.measureScore.getValue(); - } - - /** - * @param value The measure score. - */ - public MeasureReportGroupComponent setMeasureScore(BigDecimal value) { - if (value == null) - this.measureScore = null; - else { - if (this.measureScore == null) - this.measureScore = new DecimalType(); - this.measureScore.setValue(value); - } - return this; - } - - /** - * @param value The measure score. - */ - public MeasureReportGroupComponent setMeasureScore(long value) { - this.measureScore = new DecimalType(); - this.measureScore.setValue(value); - return this; - } - - /** - * @param value The measure score. - */ - public MeasureReportGroupComponent setMeasureScore(double value) { - this.measureScore = new DecimalType(); - this.measureScore.setValue(value); - return this; - } - - /** - * @return {@link #stratifier} (When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.) - */ - public List getStratifier() { - if (this.stratifier == null) - this.stratifier = new ArrayList(); - return this.stratifier; - } - - public boolean hasStratifier() { - if (this.stratifier == null) - return false; - for (MeasureReportGroupStratifierComponent item : this.stratifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #stratifier} (When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.) - */ - // syntactic sugar - public MeasureReportGroupStratifierComponent addStratifier() { //3 - MeasureReportGroupStratifierComponent t = new MeasureReportGroupStratifierComponent(); - if (this.stratifier == null) - this.stratifier = new ArrayList(); - this.stratifier.add(t); - return t; - } - - // syntactic sugar - public MeasureReportGroupComponent addStratifier(MeasureReportGroupStratifierComponent t) { //3 - if (t == null) - return this; - if (this.stratifier == null) - this.stratifier = new ArrayList(); - this.stratifier.add(t); - return this; - } - - /** - * @return {@link #supplementalData} (Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations.) - */ - public List getSupplementalData() { - if (this.supplementalData == null) - this.supplementalData = new ArrayList(); - return this.supplementalData; - } - - public boolean hasSupplementalData() { - if (this.supplementalData == null) - return false; - for (MeasureReportGroupSupplementalDataComponent item : this.supplementalData) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supplementalData} (Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations.) - */ - // syntactic sugar - public MeasureReportGroupSupplementalDataComponent addSupplementalData() { //3 - MeasureReportGroupSupplementalDataComponent t = new MeasureReportGroupSupplementalDataComponent(); - if (this.supplementalData == null) - this.supplementalData = new ArrayList(); - this.supplementalData.add(t); - return t; - } - - // syntactic sugar - public MeasureReportGroupComponent addSupplementalData(MeasureReportGroupSupplementalDataComponent t) { //3 - if (t == null) - return this; - if (this.supplementalData == null) - this.supplementalData = new ArrayList(); - this.supplementalData.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The identifier of the population group as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("population", "", "The populations that make up the population group, one for each type of population appropriate for the measure.", 0, java.lang.Integer.MAX_VALUE, population)); - childrenList.add(new Property("measureScore", "decimal", "The measure score.", 0, java.lang.Integer.MAX_VALUE, measureScore)); - childrenList.add(new Property("stratifier", "", "When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the measure.", 0, java.lang.Integer.MAX_VALUE, stratifier)); - childrenList.add(new Property("supplementalData", "", "Supplemental data elements for the measure provide additional information requested by the measure for each patient involved in the populations.", 0, java.lang.Integer.MAX_VALUE, supplementalData)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureReportGroupPopulationComponent - case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // DecimalType - case 90983669: /*stratifier*/ return this.stratifier == null ? new Base[0] : this.stratifier.toArray(new Base[this.stratifier.size()]); // MeasureReportGroupStratifierComponent - case 1447496814: /*supplementalData*/ return this.supplementalData == null ? new Base[0] : this.supplementalData.toArray(new Base[this.supplementalData.size()]); // MeasureReportGroupSupplementalDataComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -2023558323: // population - this.getPopulation().add((MeasureReportGroupPopulationComponent) value); // MeasureReportGroupPopulationComponent - break; - case -386313260: // measureScore - this.measureScore = castToDecimal(value); // DecimalType - break; - case 90983669: // stratifier - this.getStratifier().add((MeasureReportGroupStratifierComponent) value); // MeasureReportGroupStratifierComponent - break; - case 1447496814: // supplementalData - this.getSupplementalData().add((MeasureReportGroupSupplementalDataComponent) value); // MeasureReportGroupSupplementalDataComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("population")) - this.getPopulation().add((MeasureReportGroupPopulationComponent) value); - else if (name.equals("measureScore")) - this.measureScore = castToDecimal(value); // DecimalType - else if (name.equals("stratifier")) - this.getStratifier().add((MeasureReportGroupStratifierComponent) value); - else if (name.equals("supplementalData")) - this.getSupplementalData().add((MeasureReportGroupSupplementalDataComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -2023558323: return addPopulation(); // MeasureReportGroupPopulationComponent - case -386313260: throw new FHIRException("Cannot make property measureScore as it is not a complex type"); // DecimalType - case 90983669: return addStratifier(); // MeasureReportGroupStratifierComponent - case 1447496814: return addSupplementalData(); // MeasureReportGroupSupplementalDataComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("population")) { - return addPopulation(); - } - else if (name.equals("measureScore")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.measureScore"); - } - else if (name.equals("stratifier")) { - return addStratifier(); - } - else if (name.equals("supplementalData")) { - return addSupplementalData(); - } - else - return super.addChild(name); - } - - public MeasureReportGroupComponent copy() { - MeasureReportGroupComponent dst = new MeasureReportGroupComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - if (population != null) { - dst.population = new ArrayList(); - for (MeasureReportGroupPopulationComponent i : population) - dst.population.add(i.copy()); - }; - dst.measureScore = measureScore == null ? null : measureScore.copy(); - if (stratifier != null) { - dst.stratifier = new ArrayList(); - for (MeasureReportGroupStratifierComponent i : stratifier) - dst.stratifier.add(i.copy()); - }; - if (supplementalData != null) { - dst.supplementalData = new ArrayList(); - for (MeasureReportGroupSupplementalDataComponent i : supplementalData) - dst.supplementalData.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupComponent)) - return false; - MeasureReportGroupComponent o = (MeasureReportGroupComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(population, o.population, true) - && compareDeep(measureScore, o.measureScore, true) && compareDeep(stratifier, o.stratifier, true) - && compareDeep(supplementalData, o.supplementalData, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupComponent)) - return false; - MeasureReportGroupComponent o = (MeasureReportGroupComponent) other; - return compareValues(measureScore, o.measureScore, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (population == null || population.isEmpty()) - && (measureScore == null || measureScore.isEmpty()) && (stratifier == null || stratifier.isEmpty()) - && (supplementalData == null || supplementalData.isEmpty()); - } - - public String fhirType() { - return "MeasureReport.group"; - - } - - } - - @Block() - public static class MeasureReportGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of the population. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of the population." ) - protected CodeType type; - - /** - * The number of members of the population. - */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population." ) - protected IntegerType count; - - /** - * This element refers to a List of patient level MeasureReport resources, one for each patient in this population. - */ - @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population." ) - protected Reference patients; - - /** - * The actual object that is the target of the reference (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - protected ListResource patientsTarget; - - private static final long serialVersionUID = 407500224L; - - /** - * Constructor - */ - public MeasureReportGroupPopulationComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupPopulationComponent(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of the population.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the population.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public MeasureReportGroupPopulationComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of the population. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the population. - */ - public MeasureReportGroupPopulationComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #count} (The number of members of the population.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public IntegerType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.count"); - else if (Configuration.doAutoCreate()) - this.count = new IntegerType(); // bb - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (The number of members of the population.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public MeasureReportGroupPopulationComponent setCountElement(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return The number of members of the population. - */ - public int getCount() { - return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); - } - - /** - * @param value The number of members of the population. - */ - public MeasureReportGroupPopulationComponent setCount(int value) { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - return this; - } - - /** - * @return {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public Reference getPatients() { - if (this.patients == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.patients"); - else if (Configuration.doAutoCreate()) - this.patients = new Reference(); // cc - return this.patients; - } - - public boolean hasPatients() { - return this.patients != null && !this.patients.isEmpty(); - } - - /** - * @param value {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public MeasureReportGroupPopulationComponent setPatients(Reference value) { - this.patients = value; - return this; - } - - /** - * @return {@link #patients} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public ListResource getPatientsTarget() { - if (this.patientsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupPopulationComponent.patients"); - else if (Configuration.doAutoCreate()) - this.patientsTarget = new ListResource(); // aa - return this.patientsTarget; - } - - /** - * @param value {@link #patients} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public MeasureReportGroupPopulationComponent setPatientsTarget(ListResource value) { - this.patientsTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of the population.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("count", "integer", "The number of members of the population.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("patients", "Reference(List)", "This element refers to a List of patient level MeasureReport resources, one for each patient in this population.", 0, java.lang.Integer.MAX_VALUE, patients)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType - case 1235842574: /*patients*/ return this.patients == null ? new Base[0] : new Base[] {this.patients}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case 94851343: // count - this.count = castToInteger(value); // IntegerType - break; - case 1235842574: // patients - this.patients = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("count")) - this.count = castToInteger(value); // IntegerType - else if (name.equals("patients")) - this.patients = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType - case 1235842574: return getPatients(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type"); - } - else if (name.equals("count")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count"); - } - else if (name.equals("patients")) { - this.patients = new Reference(); - return this.patients; - } - else - return super.addChild(name); - } - - public MeasureReportGroupPopulationComponent copy() { - MeasureReportGroupPopulationComponent dst = new MeasureReportGroupPopulationComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.count = count == null ? null : count.copy(); - dst.patients = patients == null ? null : patients.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupPopulationComponent)) - return false; - MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other; - return compareDeep(type, o.type, true) && compareDeep(count, o.count, true) && compareDeep(patients, o.patients, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupPopulationComponent)) - return false; - MeasureReportGroupPopulationComponent o = (MeasureReportGroupPopulationComponent) other; - return compareValues(type, o.type, true) && compareValues(count, o.count, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (count == null || count.isEmpty()) - && (patients == null || patients.isEmpty()); - } - - public String fhirType() { - return "MeasureReport.group.population"; - - } - - } - - @Block() - public static class MeasureReportGroupStratifierComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The identifier of this stratifier, as defined in the measure definition. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of the stratifier", formalDefinition="The identifier of this stratifier, as defined in the measure definition." ) - protected Identifier identifier; - - /** - * This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value. - */ - @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Stratum results, one for each unique value in the stratifier", formalDefinition="This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value." ) - protected List group; - - private static final long serialVersionUID = -229867715L; - - /** - * Constructor - */ - public MeasureReportGroupStratifierComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupStratifierComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (The identifier of this stratifier, as defined in the measure definition.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of this stratifier, as defined in the measure definition.) - */ - public MeasureReportGroupStratifierComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #group} (This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (MeasureReportGroupStratifierGroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.) - */ - // syntactic sugar - public MeasureReportGroupStratifierGroupComponent addGroup() { //3 - MeasureReportGroupStratifierGroupComponent t = new MeasureReportGroupStratifierGroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public MeasureReportGroupStratifierComponent addGroup(MeasureReportGroupStratifierGroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The identifier of this stratifier, as defined in the measure definition.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("group", "", "This element contains the results for a single stratum within the stratifier. For example, when stratifying on administrative gender, there will be four strata, one for each possible gender value.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupStratifierGroupComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 98629247: // group - this.getGroup().add((MeasureReportGroupStratifierGroupComponent) value); // MeasureReportGroupStratifierGroupComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("group")) - this.getGroup().add((MeasureReportGroupStratifierGroupComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 98629247: return addGroup(); // MeasureReportGroupStratifierGroupComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("group")) { - return addGroup(); - } - else - return super.addChild(name); - } - - public MeasureReportGroupStratifierComponent copy() { - MeasureReportGroupStratifierComponent dst = new MeasureReportGroupStratifierComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (MeasureReportGroupStratifierGroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupStratifierComponent)) - return false; - MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(group, o.group, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupStratifierComponent)) - return false; - MeasureReportGroupStratifierComponent o = (MeasureReportGroupStratifierComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) - ; - } - - public String fhirType() { - return "MeasureReport.group.stratifier"; - - } - - } - - @Block() - public static class MeasureReportGroupStratifierGroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. - */ - @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The stratum value, e.g. male", formalDefinition="The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique." ) - protected StringType value; - - /** - * The populations that make up the stratum, one for each type of population appropriate to the measure. - */ - @Child(name = "population", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Population results in this stratum", formalDefinition="The populations that make up the stratum, one for each type of population appropriate to the measure." ) - protected List population; - - /** - * The measure score for this stratum. - */ - @Child(name = "measureScore", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The measure score", formalDefinition="The measure score for this stratum." ) - protected DecimalType measureScore; - - private static final long serialVersionUID = -1663404087L; - - /** - * Constructor - */ - public MeasureReportGroupStratifierGroupComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupStratifierGroupComponent(StringType value) { - super(); - this.value = value; - } - - /** - * @return {@link #value} (The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public MeasureReportGroupStratifierGroupComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique. - */ - public MeasureReportGroupStratifierGroupComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - /** - * @return {@link #population} (The populations that make up the stratum, one for each type of population appropriate to the measure.) - */ - public List getPopulation() { - if (this.population == null) - this.population = new ArrayList(); - return this.population; - } - - public boolean hasPopulation() { - if (this.population == null) - return false; - for (MeasureReportGroupStratifierGroupPopulationComponent item : this.population) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #population} (The populations that make up the stratum, one for each type of population appropriate to the measure.) - */ - // syntactic sugar - public MeasureReportGroupStratifierGroupPopulationComponent addPopulation() { //3 - MeasureReportGroupStratifierGroupPopulationComponent t = new MeasureReportGroupStratifierGroupPopulationComponent(); - if (this.population == null) - this.population = new ArrayList(); - this.population.add(t); - return t; - } - - // syntactic sugar - public MeasureReportGroupStratifierGroupComponent addPopulation(MeasureReportGroupStratifierGroupPopulationComponent t) { //3 - if (t == null) - return this; - if (this.population == null) - this.population = new ArrayList(); - this.population.add(t); - return this; - } - - /** - * @return {@link #measureScore} (The measure score for this stratum.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value - */ - public DecimalType getMeasureScoreElement() { - if (this.measureScore == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupComponent.measureScore"); - else if (Configuration.doAutoCreate()) - this.measureScore = new DecimalType(); // bb - return this.measureScore; - } - - public boolean hasMeasureScoreElement() { - return this.measureScore != null && !this.measureScore.isEmpty(); - } - - public boolean hasMeasureScore() { - return this.measureScore != null && !this.measureScore.isEmpty(); - } - - /** - * @param value {@link #measureScore} (The measure score for this stratum.). This is the underlying object with id, value and extensions. The accessor "getMeasureScore" gives direct access to the value - */ - public MeasureReportGroupStratifierGroupComponent setMeasureScoreElement(DecimalType value) { - this.measureScore = value; - return this; - } - - /** - * @return The measure score for this stratum. - */ - public BigDecimal getMeasureScore() { - return this.measureScore == null ? null : this.measureScore.getValue(); - } - - /** - * @param value The measure score for this stratum. - */ - public MeasureReportGroupStratifierGroupComponent setMeasureScore(BigDecimal value) { - if (value == null) - this.measureScore = null; - else { - if (this.measureScore == null) - this.measureScore = new DecimalType(); - this.measureScore.setValue(value); - } - return this; - } - - /** - * @param value The measure score for this stratum. - */ - public MeasureReportGroupStratifierGroupComponent setMeasureScore(long value) { - this.measureScore = new DecimalType(); - this.measureScore.setValue(value); - return this; - } - - /** - * @param value The measure score for this stratum. - */ - public MeasureReportGroupStratifierGroupComponent setMeasureScore(double value) { - this.measureScore = new DecimalType(); - this.measureScore.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value", "string", "The value for this stratum, expressed as a string. When defining stratifiers on complex values, the value must be rendered such that the value for each stratum within the stratifier is unique.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("population", "", "The populations that make up the stratum, one for each type of population appropriate to the measure.", 0, java.lang.Integer.MAX_VALUE, population)); - childrenList.add(new Property("measureScore", "decimal", "The measure score for this stratum.", 0, java.lang.Integer.MAX_VALUE, measureScore)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - case -2023558323: /*population*/ return this.population == null ? new Base[0] : this.population.toArray(new Base[this.population.size()]); // MeasureReportGroupStratifierGroupPopulationComponent - case -386313260: /*measureScore*/ return this.measureScore == null ? new Base[0] : new Base[] {this.measureScore}; // DecimalType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 111972721: // value - this.value = castToString(value); // StringType - break; - case -2023558323: // population - this.getPopulation().add((MeasureReportGroupStratifierGroupPopulationComponent) value); // MeasureReportGroupStratifierGroupPopulationComponent - break; - case -386313260: // measureScore - this.measureScore = castToDecimal(value); // DecimalType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("value")) - this.value = castToString(value); // StringType - else if (name.equals("population")) - this.getPopulation().add((MeasureReportGroupStratifierGroupPopulationComponent) value); - else if (name.equals("measureScore")) - this.measureScore = castToDecimal(value); // DecimalType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - case -2023558323: return addPopulation(); // MeasureReportGroupStratifierGroupPopulationComponent - case -386313260: throw new FHIRException("Cannot make property measureScore as it is not a complex type"); // DecimalType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.value"); - } - else if (name.equals("population")) { - return addPopulation(); - } - else if (name.equals("measureScore")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.measureScore"); - } - else - return super.addChild(name); - } - - public MeasureReportGroupStratifierGroupComponent copy() { - MeasureReportGroupStratifierGroupComponent dst = new MeasureReportGroupStratifierGroupComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - if (population != null) { - dst.population = new ArrayList(); - for (MeasureReportGroupStratifierGroupPopulationComponent i : population) - dst.population.add(i.copy()); - }; - dst.measureScore = measureScore == null ? null : measureScore.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupStratifierGroupComponent)) - return false; - MeasureReportGroupStratifierGroupComponent o = (MeasureReportGroupStratifierGroupComponent) other; - return compareDeep(value, o.value, true) && compareDeep(population, o.population, true) && compareDeep(measureScore, o.measureScore, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupStratifierGroupComponent)) - return false; - MeasureReportGroupStratifierGroupComponent o = (MeasureReportGroupStratifierGroupComponent) other; - return compareValues(value, o.value, true) && compareValues(measureScore, o.measureScore, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (population == null || population.isEmpty()) - && (measureScore == null || measureScore.isEmpty()); - } - - public String fhirType() { - return "MeasureReport.group.stratifier.group"; - - } - - } - - @Block() - public static class MeasureReportGroupStratifierGroupPopulationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of the population. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score", formalDefinition="The type of the population." ) - protected CodeType type; - - /** - * The number of members of the population in this stratum. - */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Size of the population", formalDefinition="The number of members of the population in this stratum." ) - protected IntegerType count; - - /** - * This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum. - */ - @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum." ) - protected Reference patients; - - /** - * The actual object that is the target of the reference (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) - */ - protected ListResource patientsTarget; - - private static final long serialVersionUID = 407500224L; - - /** - * Constructor - */ - public MeasureReportGroupStratifierGroupPopulationComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupStratifierGroupPopulationComponent(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of the population.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the population.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public MeasureReportGroupStratifierGroupPopulationComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of the population. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the population. - */ - public MeasureReportGroupStratifierGroupPopulationComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #count} (The number of members of the population in this stratum.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public IntegerType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.count"); - else if (Configuration.doAutoCreate()) - this.count = new IntegerType(); // bb - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (The number of members of the population in this stratum.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public MeasureReportGroupStratifierGroupPopulationComponent setCountElement(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return The number of members of the population in this stratum. - */ - public int getCount() { - return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); - } - - /** - * @param value The number of members of the population in this stratum. - */ - public MeasureReportGroupStratifierGroupPopulationComponent setCount(int value) { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - return this; - } - - /** - * @return {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) - */ - public Reference getPatients() { - if (this.patients == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.patients"); - else if (Configuration.doAutoCreate()) - this.patients = new Reference(); // cc - return this.patients; - } - - public boolean hasPatients() { - return this.patients != null && !this.patients.isEmpty(); - } - - /** - * @param value {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) - */ - public MeasureReportGroupStratifierGroupPopulationComponent setPatients(Reference value) { - this.patients = value; - return this; - } - - /** - * @return {@link #patients} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) - */ - public ListResource getPatientsTarget() { - if (this.patientsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupStratifierGroupPopulationComponent.patients"); - else if (Configuration.doAutoCreate()) - this.patientsTarget = new ListResource(); // aa - return this.patientsTarget; - } - - /** - * @param value {@link #patients} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.) - */ - public MeasureReportGroupStratifierGroupPopulationComponent setPatientsTarget(ListResource value) { - this.patientsTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of the population.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("count", "integer", "The number of members of the population in this stratum.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("patients", "Reference(List)", "This element refers to a List of patient level MeasureReport resources, one for each patient in this population in this stratum.", 0, java.lang.Integer.MAX_VALUE, patients)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType - case 1235842574: /*patients*/ return this.patients == null ? new Base[0] : new Base[] {this.patients}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case 94851343: // count - this.count = castToInteger(value); // IntegerType - break; - case 1235842574: // patients - this.patients = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("count")) - this.count = castToInteger(value); // IntegerType - else if (name.equals("patients")) - this.patients = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType - case 1235842574: return getPatients(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type"); - } - else if (name.equals("count")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count"); - } - else if (name.equals("patients")) { - this.patients = new Reference(); - return this.patients; - } - else - return super.addChild(name); - } - - public MeasureReportGroupStratifierGroupPopulationComponent copy() { - MeasureReportGroupStratifierGroupPopulationComponent dst = new MeasureReportGroupStratifierGroupPopulationComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.count = count == null ? null : count.copy(); - dst.patients = patients == null ? null : patients.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupStratifierGroupPopulationComponent)) - return false; - MeasureReportGroupStratifierGroupPopulationComponent o = (MeasureReportGroupStratifierGroupPopulationComponent) other; - return compareDeep(type, o.type, true) && compareDeep(count, o.count, true) && compareDeep(patients, o.patients, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupStratifierGroupPopulationComponent)) - return false; - MeasureReportGroupStratifierGroupPopulationComponent o = (MeasureReportGroupStratifierGroupPopulationComponent) other; - return compareValues(type, o.type, true) && compareValues(count, o.count, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (count == null || count.isEmpty()) - && (patients == null || patients.isEmpty()); - } - - public String fhirType() { - return "MeasureReport.group.stratifier.group.population"; - - } - - } - - @Block() - public static class MeasureReportGroupSupplementalDataComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The identifier of the supplemental data element as defined in the measure. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of the supplemental data element", formalDefinition="The identifier of the supplemental data element as defined in the measure." ) - protected Identifier identifier; - - /** - * This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value. - */ - @Child(name = "group", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Supplemental data results, one for each unique supplemental data value", formalDefinition="This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value." ) - protected List group; - - private static final long serialVersionUID = -1254392714L; - - /** - * Constructor - */ - public MeasureReportGroupSupplementalDataComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupSupplementalDataComponent(Identifier identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #identifier} (The identifier of the supplemental data element as defined in the measure.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of the supplemental data element as defined in the measure.) - */ - public MeasureReportGroupSupplementalDataComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #group} (This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (MeasureReportGroupSupplementalDataGroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value.) - */ - // syntactic sugar - public MeasureReportGroupSupplementalDataGroupComponent addGroup() { //3 - MeasureReportGroupSupplementalDataGroupComponent t = new MeasureReportGroupSupplementalDataGroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public MeasureReportGroupSupplementalDataComponent addGroup(MeasureReportGroupSupplementalDataGroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The identifier of the supplemental data element as defined in the measure.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("group", "", "This element contains the results for a single value within the supplemental data. For example, when reporting supplemental data for administrative gender, there will be four groups, one for each possible gender value.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupSupplementalDataGroupComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 98629247: // group - this.getGroup().add((MeasureReportGroupSupplementalDataGroupComponent) value); // MeasureReportGroupSupplementalDataGroupComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("group")) - this.getGroup().add((MeasureReportGroupSupplementalDataGroupComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 98629247: return addGroup(); // MeasureReportGroupSupplementalDataGroupComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("group")) { - return addGroup(); - } - else - return super.addChild(name); - } - - public MeasureReportGroupSupplementalDataComponent copy() { - MeasureReportGroupSupplementalDataComponent dst = new MeasureReportGroupSupplementalDataComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (MeasureReportGroupSupplementalDataGroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupSupplementalDataComponent)) - return false; - MeasureReportGroupSupplementalDataComponent o = (MeasureReportGroupSupplementalDataComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(group, o.group, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupSupplementalDataComponent)) - return false; - MeasureReportGroupSupplementalDataComponent o = (MeasureReportGroupSupplementalDataComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (group == null || group.isEmpty()) - ; - } - - public String fhirType() { - return "MeasureReport.group.supplementalData"; - - } - - } - - @Block() - public static class MeasureReportGroupSupplementalDataGroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. - */ - @Child(name = "value", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The data value, e.g. male", formalDefinition="The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique." ) - protected StringType value; - - /** - * The number of members in the supplemental data group. - */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of members in the group", formalDefinition="The number of members in the supplemental data group." ) - protected IntegerType count; - - /** - * This element refers to a List of patient level MeasureReport resources, one for each patient in this population. - */ - @Child(name = "patients", type = {ListResource.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="For patient-list reports, the patients in this population", formalDefinition="This element refers to a List of patient level MeasureReport resources, one for each patient in this population." ) - protected Reference patients; - - /** - * The actual object that is the target of the reference (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - protected ListResource patientsTarget; - - private static final long serialVersionUID = 1011446829L; - - /** - * Constructor - */ - public MeasureReportGroupSupplementalDataGroupComponent() { - super(); - } - - /** - * Constructor - */ - public MeasureReportGroupSupplementalDataGroupComponent(StringType value) { - super(); - this.value = value; - } - - /** - * @return {@link #value} (The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public MeasureReportGroupSupplementalDataGroupComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique. - */ - public MeasureReportGroupSupplementalDataGroupComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - /** - * @return {@link #count} (The number of members in the supplemental data group.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public IntegerType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.count"); - else if (Configuration.doAutoCreate()) - this.count = new IntegerType(); // bb - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (The number of members in the supplemental data group.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public MeasureReportGroupSupplementalDataGroupComponent setCountElement(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return The number of members in the supplemental data group. - */ - public int getCount() { - return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); - } - - /** - * @param value The number of members in the supplemental data group. - */ - public MeasureReportGroupSupplementalDataGroupComponent setCount(int value) { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - return this; - } - - /** - * @return {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public Reference getPatients() { - if (this.patients == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.patients"); - else if (Configuration.doAutoCreate()) - this.patients = new Reference(); // cc - return this.patients; - } - - public boolean hasPatients() { - return this.patients != null && !this.patients.isEmpty(); - } - - /** - * @param value {@link #patients} (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public MeasureReportGroupSupplementalDataGroupComponent setPatients(Reference value) { - this.patients = value; - return this; - } - - /** - * @return {@link #patients} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public ListResource getPatientsTarget() { - if (this.patientsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReportGroupSupplementalDataGroupComponent.patients"); - else if (Configuration.doAutoCreate()) - this.patientsTarget = new ListResource(); // aa - return this.patientsTarget; - } - - /** - * @param value {@link #patients} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (This element refers to a List of patient level MeasureReport resources, one for each patient in this population.) - */ - public MeasureReportGroupSupplementalDataGroupComponent setPatientsTarget(ListResource value) { - this.patientsTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value", "string", "The value for this supplemental data element, expressed as a string. When defining supplemental data on complex values, the value must be rendered such that the value for each group within the supplemental data element is unique.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("count", "integer", "The number of members in the supplemental data group.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("patients", "Reference(List)", "This element refers to a List of patient level MeasureReport resources, one for each patient in this population.", 0, java.lang.Integer.MAX_VALUE, patients)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType - case 1235842574: /*patients*/ return this.patients == null ? new Base[0] : new Base[] {this.patients}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 111972721: // value - this.value = castToString(value); // StringType - break; - case 94851343: // count - this.count = castToInteger(value); // IntegerType - break; - case 1235842574: // patients - this.patients = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("value")) - this.value = castToString(value); // StringType - else if (name.equals("count")) - this.count = castToInteger(value); // IntegerType - else if (name.equals("patients")) - this.patients = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType - case 1235842574: return getPatients(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.value"); - } - else if (name.equals("count")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.count"); - } - else if (name.equals("patients")) { - this.patients = new Reference(); - return this.patients; - } - else - return super.addChild(name); - } - - public MeasureReportGroupSupplementalDataGroupComponent copy() { - MeasureReportGroupSupplementalDataGroupComponent dst = new MeasureReportGroupSupplementalDataGroupComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.count = count == null ? null : count.copy(); - dst.patients = patients == null ? null : patients.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReportGroupSupplementalDataGroupComponent)) - return false; - MeasureReportGroupSupplementalDataGroupComponent o = (MeasureReportGroupSupplementalDataGroupComponent) other; - return compareDeep(value, o.value, true) && compareDeep(count, o.count, true) && compareDeep(patients, o.patients, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReportGroupSupplementalDataGroupComponent)) - return false; - MeasureReportGroupSupplementalDataGroupComponent o = (MeasureReportGroupSupplementalDataGroupComponent) other; - return compareValues(value, o.value, true) && compareValues(count, o.count, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (count == null || count.isEmpty()) - && (patients == null || patients.isEmpty()); - } - - public String fhirType() { - return "MeasureReport.group.supplementalData.group"; - - } - - } - - /** - * A reference to the Measure that was evaluated to produce this report. - */ - @Child(name = "measure", type = {Measure.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Measure that was evaluated", formalDefinition="A reference to the Measure that was evaluated to produce this report." ) - protected Reference measure; - - /** - * The actual object that is the target of the reference (A reference to the Measure that was evaluated to produce this report.) - */ - protected Measure measureTarget; - - /** - * The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="individual | patient-list | summary", formalDefinition="The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure." ) - protected Enumeration type; - - /** - * Optional Patient if the report was requested for a single patient. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Optional Patient", formalDefinition="Optional Patient if the report was requested for a single patient." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (Optional Patient if the report was requested for a single patient.) - */ - protected Patient patientTarget; - - /** - * The reporting period for which the report was calculated. - */ - @Child(name = "period", type = {Period.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reporting period", formalDefinition="The reporting period for which the report was calculated." ) - protected Period period; - - /** - * The report status. No data will be available until the report status is complete. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="complete | pending | error", formalDefinition="The report status. No data will be available until the report status is complete." ) - protected Enumeration status; - - /** - * The date this measure report was generated. - */ - @Child(name = "date", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date the report was generated", formalDefinition="The date this measure report was generated." ) - protected DateTimeType date; - - /** - * Reporting Organization. - */ - @Child(name = "reportingOrganization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reporting Organization", formalDefinition="Reporting Organization." ) - protected Reference reportingOrganization; - - /** - * The actual object that is the target of the reference (Reporting Organization.) - */ - protected Organization reportingOrganizationTarget; - - /** - * The results of the calculation, one for each population group in the measure. - */ - @Child(name = "group", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Measure results for each group", formalDefinition="The results of the calculation, one for each population group in the measure." ) - protected List group; - - /** - * A reference to a Bundle containing the Resources that were used in the evaluation of this report. - */ - @Child(name = "evaluatedResources", type = {Bundle.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Evaluated Resources", formalDefinition="A reference to a Bundle containing the Resources that were used in the evaluation of this report." ) - protected Reference evaluatedResources; - - /** - * The actual object that is the target of the reference (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) - */ - protected Bundle evaluatedResourcesTarget; - - private static final long serialVersionUID = -891268298L; - - /** - * Constructor - */ - public MeasureReport() { - super(); - } - - /** - * Constructor - */ - public MeasureReport(Reference measure, Enumeration type, Period period, Enumeration status) { - super(); - this.measure = measure; - this.type = type; - this.period = period; - this.status = status; - } - - /** - * @return {@link #measure} (A reference to the Measure that was evaluated to produce this report.) - */ - public Reference getMeasure() { - if (this.measure == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.measure"); - else if (Configuration.doAutoCreate()) - this.measure = new Reference(); // cc - return this.measure; - } - - public boolean hasMeasure() { - return this.measure != null && !this.measure.isEmpty(); - } - - /** - * @param value {@link #measure} (A reference to the Measure that was evaluated to produce this report.) - */ - public MeasureReport setMeasure(Reference value) { - this.measure = value; - return this; - } - - /** - * @return {@link #measure} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the Measure that was evaluated to produce this report.) - */ - public Measure getMeasureTarget() { - if (this.measureTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.measure"); - else if (Configuration.doAutoCreate()) - this.measureTarget = new Measure(); // aa - return this.measureTarget; - } - - /** - * @param value {@link #measure} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the Measure that was evaluated to produce this report.) - */ - public MeasureReport setMeasureTarget(Measure value) { - this.measureTarget = value; - return this; - } - - /** - * @return {@link #type} (The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new MeasureReportTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public MeasureReport setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure. - */ - public MeasureReportType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure. - */ - public MeasureReport setType(MeasureReportType value) { - if (this.type == null) - this.type = new Enumeration(new MeasureReportTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #patient} (Optional Patient if the report was requested for a single patient.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (Optional Patient if the report was requested for a single patient.) - */ - public MeasureReport setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Optional Patient if the report was requested for a single patient.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Optional Patient if the report was requested for a single patient.) - */ - public MeasureReport setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #period} (The reporting period for which the report was calculated.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The reporting period for which the report was calculated.) - */ - public MeasureReport setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #status} (The report status. No data will be available until the report status is complete.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MeasureReportStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The report status. No data will be available until the report status is complete.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MeasureReport setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The report status. No data will be available until the report status is complete. - */ - public MeasureReportStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The report status. No data will be available until the report status is complete. - */ - public MeasureReport setStatus(MeasureReportStatus value) { - if (this.status == null) - this.status = new Enumeration(new MeasureReportStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date this measure report was generated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this measure report was generated.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public MeasureReport setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this measure report was generated. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this measure report was generated. - */ - public MeasureReport setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #reportingOrganization} (Reporting Organization.) - */ - public Reference getReportingOrganization() { - if (this.reportingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.reportingOrganization"); - else if (Configuration.doAutoCreate()) - this.reportingOrganization = new Reference(); // cc - return this.reportingOrganization; - } - - public boolean hasReportingOrganization() { - return this.reportingOrganization != null && !this.reportingOrganization.isEmpty(); - } - - /** - * @param value {@link #reportingOrganization} (Reporting Organization.) - */ - public MeasureReport setReportingOrganization(Reference value) { - this.reportingOrganization = value; - return this; - } - - /** - * @return {@link #reportingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reporting Organization.) - */ - public Organization getReportingOrganizationTarget() { - if (this.reportingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.reportingOrganization"); - else if (Configuration.doAutoCreate()) - this.reportingOrganizationTarget = new Organization(); // aa - return this.reportingOrganizationTarget; - } - - /** - * @param value {@link #reportingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reporting Organization.) - */ - public MeasureReport setReportingOrganizationTarget(Organization value) { - this.reportingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #group} (The results of the calculation, one for each population group in the measure.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (MeasureReportGroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (The results of the calculation, one for each population group in the measure.) - */ - // syntactic sugar - public MeasureReportGroupComponent addGroup() { //3 - MeasureReportGroupComponent t = new MeasureReportGroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public MeasureReport addGroup(MeasureReportGroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - /** - * @return {@link #evaluatedResources} (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) - */ - public Reference getEvaluatedResources() { - if (this.evaluatedResources == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.evaluatedResources"); - else if (Configuration.doAutoCreate()) - this.evaluatedResources = new Reference(); // cc - return this.evaluatedResources; - } - - public boolean hasEvaluatedResources() { - return this.evaluatedResources != null && !this.evaluatedResources.isEmpty(); - } - - /** - * @param value {@link #evaluatedResources} (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) - */ - public MeasureReport setEvaluatedResources(Reference value) { - this.evaluatedResources = value; - return this; - } - - /** - * @return {@link #evaluatedResources} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) - */ - public Bundle getEvaluatedResourcesTarget() { - if (this.evaluatedResourcesTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MeasureReport.evaluatedResources"); - else if (Configuration.doAutoCreate()) - this.evaluatedResourcesTarget = new Bundle(); // aa - return this.evaluatedResourcesTarget; - } - - /** - * @param value {@link #evaluatedResources} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to a Bundle containing the Resources that were used in the evaluation of this report.) - */ - public MeasureReport setEvaluatedResourcesTarget(Bundle value) { - this.evaluatedResourcesTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("measure", "Reference(Measure)", "A reference to the Measure that was evaluated to produce this report.", 0, java.lang.Integer.MAX_VALUE, measure)); - childrenList.add(new Property("type", "code", "The type of measure report. This may be an individual report, which provides a single patient's score for the measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or a summary report, which returns a population count for each criteria in the measure.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("patient", "Reference(Patient)", "Optional Patient if the report was requested for a single patient.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("period", "Period", "The reporting period for which the report was calculated.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("status", "code", "The report status. No data will be available until the report status is complete.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date this measure report was generated.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("reportingOrganization", "Reference(Organization)", "Reporting Organization.", 0, java.lang.Integer.MAX_VALUE, reportingOrganization)); - childrenList.add(new Property("group", "", "The results of the calculation, one for each population group in the measure.", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("evaluatedResources", "Reference(Bundle)", "A reference to a Bundle containing the Resources that were used in the evaluation of this report.", 0, java.lang.Integer.MAX_VALUE, evaluatedResources)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 938321246: /*measure*/ return this.measure == null ? new Base[0] : new Base[] {this.measure}; // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -2053950847: /*reportingOrganization*/ return this.reportingOrganization == null ? new Base[0] : new Base[] {this.reportingOrganization}; // Reference - case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // MeasureReportGroupComponent - case 1599836026: /*evaluatedResources*/ return this.evaluatedResources == null ? new Base[0] : new Base[] {this.evaluatedResources}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 938321246: // measure - this.measure = castToReference(value); // Reference - break; - case 3575610: // type - this.type = new MeasureReportTypeEnumFactory().fromType(value); // Enumeration - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -892481550: // status - this.status = new MeasureReportStatusEnumFactory().fromType(value); // Enumeration - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -2053950847: // reportingOrganization - this.reportingOrganization = castToReference(value); // Reference - break; - case 98629247: // group - this.getGroup().add((MeasureReportGroupComponent) value); // MeasureReportGroupComponent - break; - case 1599836026: // evaluatedResources - this.evaluatedResources = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("measure")) - this.measure = castToReference(value); // Reference - else if (name.equals("type")) - this.type = new MeasureReportTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("status")) - this.status = new MeasureReportStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("reportingOrganization")) - this.reportingOrganization = castToReference(value); // Reference - else if (name.equals("group")) - this.getGroup().add((MeasureReportGroupComponent) value); - else if (name.equals("evaluatedResources")) - this.evaluatedResources = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 938321246: return getMeasure(); // Reference - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -791418107: return getPatient(); // Reference - case -991726143: return getPeriod(); // Period - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -2053950847: return getReportingOrganization(); // Reference - case 98629247: return addGroup(); // MeasureReportGroupComponent - case 1599836026: return getEvaluatedResources(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("measure")) { - this.measure = new Reference(); - return this.measure; - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.type"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.status"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type MeasureReport.date"); - } - else if (name.equals("reportingOrganization")) { - this.reportingOrganization = new Reference(); - return this.reportingOrganization; - } - else if (name.equals("group")) { - return addGroup(); - } - else if (name.equals("evaluatedResources")) { - this.evaluatedResources = new Reference(); - return this.evaluatedResources; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "MeasureReport"; - - } - - public MeasureReport copy() { - MeasureReport dst = new MeasureReport(); - copyValues(dst); - dst.measure = measure == null ? null : measure.copy(); - dst.type = type == null ? null : type.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.period = period == null ? null : period.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.reportingOrganization = reportingOrganization == null ? null : reportingOrganization.copy(); - if (group != null) { - dst.group = new ArrayList(); - for (MeasureReportGroupComponent i : group) - dst.group.add(i.copy()); - }; - dst.evaluatedResources = evaluatedResources == null ? null : evaluatedResources.copy(); - return dst; - } - - protected MeasureReport typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MeasureReport)) - return false; - MeasureReport o = (MeasureReport) other; - return compareDeep(measure, o.measure, true) && compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) - && compareDeep(period, o.period, true) && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) - && compareDeep(reportingOrganization, o.reportingOrganization, true) && compareDeep(group, o.group, true) - && compareDeep(evaluatedResources, o.evaluatedResources, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MeasureReport)) - return false; - MeasureReport o = (MeasureReport) other; - return compareValues(type, o.type, true) && compareValues(status, o.status, true) && compareValues(date, o.date, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (measure == null || measure.isEmpty()) && (type == null || type.isEmpty()) - && (patient == null || patient.isEmpty()) && (period == null || period.isEmpty()) && (status == null || status.isEmpty()) - && (date == null || date.isEmpty()) && (reportingOrganization == null || reportingOrganization.isEmpty()) - && (group == null || group.isEmpty()) && (evaluatedResources == null || evaluatedResources.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MeasureReport; - } - - /** - * Search parameter: patient - *

- * Description: The identity of a patient to search for individual measure report results for
- * Type: reference
- * Path: MeasureReport.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MeasureReport.patient", description="The identity of a patient to search for individual measure report results for", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of a patient to search for individual measure report results for
- * Type: reference
- * Path: MeasureReport.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MeasureReport:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MeasureReport:patient").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Media.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Media.java deleted file mode 100644 index 7d5ea189087..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Media.java +++ /dev/null @@ -1,1160 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by direct reference. - */ -@ResourceDef(name="Media", profile="http://hl7.org/fhir/Profile/Media") -public class Media extends DomainResource { - - public enum DigitalMediaType { - /** - * The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents - */ - PHOTO, - /** - * The media consists of a series of frames that capture a moving image - */ - VIDEO, - /** - * The media consists of a sound recording - */ - AUDIO, - /** - * added to help the parsers - */ - NULL; - public static DigitalMediaType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("photo".equals(codeString)) - return PHOTO; - if ("video".equals(codeString)) - return VIDEO; - if ("audio".equals(codeString)) - return AUDIO; - throw new FHIRException("Unknown DigitalMediaType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PHOTO: return "photo"; - case VIDEO: return "video"; - case AUDIO: return "audio"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PHOTO: return "http://hl7.org/fhir/digital-media-type"; - case VIDEO: return "http://hl7.org/fhir/digital-media-type"; - case AUDIO: return "http://hl7.org/fhir/digital-media-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PHOTO: return "The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, and scanned documents"; - case VIDEO: return "The media consists of a series of frames that capture a moving image"; - case AUDIO: return "The media consists of a sound recording"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PHOTO: return "Photo"; - case VIDEO: return "Video"; - case AUDIO: return "Audio"; - default: return "?"; - } - } - } - - public static class DigitalMediaTypeEnumFactory implements EnumFactory { - public DigitalMediaType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("photo".equals(codeString)) - return DigitalMediaType.PHOTO; - if ("video".equals(codeString)) - return DigitalMediaType.VIDEO; - if ("audio".equals(codeString)) - return DigitalMediaType.AUDIO; - throw new IllegalArgumentException("Unknown DigitalMediaType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("photo".equals(codeString)) - return new Enumeration(this, DigitalMediaType.PHOTO); - if ("video".equals(codeString)) - return new Enumeration(this, DigitalMediaType.VIDEO); - if ("audio".equals(codeString)) - return new Enumeration(this, DigitalMediaType.AUDIO); - throw new FHIRException("Unknown DigitalMediaType code '"+codeString+"'"); - } - public String toCode(DigitalMediaType code) { - if (code == DigitalMediaType.PHOTO) - return "photo"; - if (code == DigitalMediaType.VIDEO) - return "video"; - if (code == DigitalMediaType.AUDIO) - return "audio"; - return "?"; - } - public String toSystem(DigitalMediaType code) { - return code.getSystem(); - } - } - - /** - * 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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List identifier; - - /** - * Whether the media is a photo (still image), an audio recording, or a video recording. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="photo | video | audio", formalDefinition="Whether the media is a photo (still image), an audio recording, or a video recording." ) - protected Enumeration type; - - /** - * 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. - */ - @Child(name = "subtype", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept subtype; - - /** - * The name of the imaging view e.g. Lateral or Antero-posterior (AP). - */ - @Child(name = "view", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Imaging view, e.g. Lateral or Antero-posterior", formalDefinition="The name of the imaging view e.g. Lateral or Antero-posterior (AP)." ) - protected CodeableConcept view; - - /** - * Who/What this Media is a record of. - */ - @Child(name = "subject", type = {Patient.class, Practitioner.class, Group.class, Device.class, Specimen.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who/What this Media is a record of", formalDefinition="Who/What this Media is a record of." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Who/What this Media is a record of.) - */ - protected Resource subjectTarget; - - /** - * The person who administered the collection of the image. - */ - @Child(name = "operator", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The person who generated the image", formalDefinition="The person who administered the collection of the image." ) - protected Reference operator; - - /** - * The actual object that is the target of the reference (The person who administered the collection of the image.) - */ - protected Practitioner operatorTarget; - - /** - * The name of the device / manufacturer of the device that was used to make the recording. - */ - @Child(name = "deviceName", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the device/manufacturer", formalDefinition="The name of the device / manufacturer of the device that was used to make the recording." ) - protected StringType deviceName; - - /** - * Height of the image in pixels (photo/video). - */ - @Child(name = "height", type = {PositiveIntType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Height of the image in pixels (photo/video)", formalDefinition="Height of the image in pixels (photo/video)." ) - protected PositiveIntType height; - - /** - * Width of the image in pixels (photo/video). - */ - @Child(name = "width", type = {PositiveIntType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Width of the image in pixels (photo/video)", formalDefinition="Width of the image in pixels (photo/video)." ) - protected PositiveIntType width; - - /** - * 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. - */ - @Child(name = "frames", type = {PositiveIntType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @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." ) - protected PositiveIntType frames; - - /** - * The duration of the recording in seconds - for audio and video. - */ - @Child(name = "duration", type = {UnsignedIntType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Length in seconds (audio / video)", formalDefinition="The duration of the recording in seconds - for audio and video." ) - protected UnsignedIntType duration; - - /** - * The actual content of the media - inline or by direct reference to the media source file. - */ - @Child(name = "content", type = {Attachment.class}, order=11, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Actual Media - reference or data", formalDefinition="The actual content of the media - inline or by direct reference to the media source file." ) - protected Attachment content; - - private static final long serialVersionUID = -2144305643L; - - /** - * Constructor - */ - public Media() { - super(); - } - - /** - * Constructor - */ - public Media(Enumeration type, Attachment content) { - super(); - this.type = type; - this.content = content; - } - - /** - * @return {@link #identifier} (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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Media addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Whether the media is a photo (still image), an audio recording, or a video recording.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Media setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Whether the media is a photo (still image), an audio recording, or a video recording. - */ - public DigitalMediaType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Whether the media is a photo (still image), an audio recording, or a video recording. - */ - public Media setType(DigitalMediaType value) { - if (this.type == null) - this.type = new Enumeration(new DigitalMediaTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #subtype} (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 CodeableConcept getSubtype() { - if (this.subtype == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.subtype"); - else if (Configuration.doAutoCreate()) - this.subtype = new CodeableConcept(); // cc - return this.subtype; - } - - public boolean hasSubtype() { - return this.subtype != null && !this.subtype.isEmpty(); - } - - /** - * @param value {@link #subtype} (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(CodeableConcept value) { - this.subtype = value; - return this; - } - - /** - * @return {@link #view} (The name of the imaging view e.g. Lateral or Antero-posterior (AP).) - */ - public CodeableConcept getView() { - if (this.view == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.view"); - else if (Configuration.doAutoCreate()) - this.view = new CodeableConcept(); // cc - return this.view; - } - - public boolean hasView() { - return this.view != null && !this.view.isEmpty(); - } - - /** - * @param value {@link #view} (The name of the imaging view e.g. Lateral or Antero-posterior (AP).) - */ - public Media setView(CodeableConcept value) { - this.view = value; - return this; - } - - /** - * @return {@link #subject} (Who/What this Media is a record of.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Who/What this Media is a record of.) - */ - public Media setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who/What this Media is a record of.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who/What this Media is a record of.) - */ - public Media setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #operator} (The person who administered the collection of the image.) - */ - public Reference getOperator() { - if (this.operator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.operator"); - else if (Configuration.doAutoCreate()) - this.operator = new Reference(); // cc - return this.operator; - } - - public boolean hasOperator() { - return this.operator != null && !this.operator.isEmpty(); - } - - /** - * @param value {@link #operator} (The person who administered the collection of the image.) - */ - public Media setOperator(Reference value) { - this.operator = value; - return this; - } - - /** - * @return {@link #operator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) - */ - public Practitioner getOperatorTarget() { - if (this.operatorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.operator"); - else if (Configuration.doAutoCreate()) - this.operatorTarget = new Practitioner(); // aa - return this.operatorTarget; - } - - /** - * @param value {@link #operator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who administered the collection of the image.) - */ - public Media setOperatorTarget(Practitioner value) { - this.operatorTarget = value; - return this; - } - - /** - * @return {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value - */ - public StringType getDeviceNameElement() { - if (this.deviceName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.deviceName"); - else if (Configuration.doAutoCreate()) - this.deviceName = new StringType(); // bb - return this.deviceName; - } - - public boolean hasDeviceNameElement() { - return this.deviceName != null && !this.deviceName.isEmpty(); - } - - public boolean hasDeviceName() { - return this.deviceName != null && !this.deviceName.isEmpty(); - } - - /** - * @param value {@link #deviceName} (The name of the device / manufacturer of the device that was used to make the recording.). This is the underlying object with id, value and extensions. The accessor "getDeviceName" gives direct access to the value - */ - public Media setDeviceNameElement(StringType value) { - this.deviceName = value; - return this; - } - - /** - * @return The name of the device / manufacturer of the device that was used to make the recording. - */ - public String getDeviceName() { - return this.deviceName == null ? null : this.deviceName.getValue(); - } - - /** - * @param value The name of the device / manufacturer of the device that was used to make the recording. - */ - public Media setDeviceName(String value) { - if (Utilities.noString(value)) - this.deviceName = null; - else { - if (this.deviceName == null) - this.deviceName = new StringType(); - this.deviceName.setValue(value); - } - return this; - } - - /** - * @return {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public PositiveIntType getHeightElement() { - if (this.height == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.height"); - else if (Configuration.doAutoCreate()) - this.height = new PositiveIntType(); // bb - return this.height; - } - - public boolean hasHeightElement() { - return this.height != null && !this.height.isEmpty(); - } - - public boolean hasHeight() { - return this.height != null && !this.height.isEmpty(); - } - - /** - * @param value {@link #height} (Height of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getHeight" gives direct access to the value - */ - public Media setHeightElement(PositiveIntType value) { - this.height = value; - return this; - } - - /** - * @return Height of the image in pixels (photo/video). - */ - public int getHeight() { - return this.height == null || this.height.isEmpty() ? 0 : this.height.getValue(); - } - - /** - * @param value Height of the image in pixels (photo/video). - */ - public Media setHeight(int value) { - if (this.height == null) - this.height = new PositiveIntType(); - this.height.setValue(value); - return this; - } - - /** - * @return {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public PositiveIntType getWidthElement() { - if (this.width == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.width"); - else if (Configuration.doAutoCreate()) - this.width = new PositiveIntType(); // bb - return this.width; - } - - public boolean hasWidthElement() { - return this.width != null && !this.width.isEmpty(); - } - - public boolean hasWidth() { - return this.width != null && !this.width.isEmpty(); - } - - /** - * @param value {@link #width} (Width of the image in pixels (photo/video).). This is the underlying object with id, value and extensions. The accessor "getWidth" gives direct access to the value - */ - public Media setWidthElement(PositiveIntType value) { - this.width = value; - return this; - } - - /** - * @return Width of the image in pixels (photo/video). - */ - public int getWidth() { - return this.width == null || this.width.isEmpty() ? 0 : this.width.getValue(); - } - - /** - * @param value Width of the image in pixels (photo/video). - */ - public Media setWidth(int value) { - if (this.width == null) - this.width = new PositiveIntType(); - this.width.setValue(value); - return this; - } - - /** - * @return {@link #frames} (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.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public PositiveIntType getFramesElement() { - if (this.frames == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.frames"); - else if (Configuration.doAutoCreate()) - this.frames = new PositiveIntType(); // bb - return this.frames; - } - - public boolean hasFramesElement() { - return this.frames != null && !this.frames.isEmpty(); - } - - public boolean hasFrames() { - return this.frames != null && !this.frames.isEmpty(); - } - - /** - * @param value {@link #frames} (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.). This is the underlying object with id, value and extensions. The accessor "getFrames" gives direct access to the value - */ - public Media setFramesElement(PositiveIntType value) { - this.frames = value; - return this; - } - - /** - * @return 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 int getFrames() { - return this.frames == null || this.frames.isEmpty() ? 0 : this.frames.getValue(); - } - - /** - * @param value 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 value) { - if (this.frames == null) - this.frames = new PositiveIntType(); - this.frames.setValue(value); - return this; - } - - /** - * @return {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public UnsignedIntType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new UnsignedIntType(); // bb - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The duration of the recording in seconds - for audio and video.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public Media setDurationElement(UnsignedIntType value) { - this.duration = value; - return this; - } - - /** - * @return The duration of the recording in seconds - for audio and video. - */ - public int getDuration() { - return this.duration == null || this.duration.isEmpty() ? 0 : this.duration.getValue(); - } - - /** - * @param value The duration of the recording in seconds - for audio and video. - */ - public Media setDuration(int value) { - if (this.duration == null) - this.duration = new UnsignedIntType(); - this.duration.setValue(value); - return this; - } - - /** - * @return {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) - */ - public Attachment getContent() { - if (this.content == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Media.content"); - else if (Configuration.doAutoCreate()) - this.content = new Attachment(); // cc - return this.content; - } - - public boolean hasContent() { - return this.content != null && !this.content.isEmpty(); - } - - /** - * @param value {@link #content} (The actual content of the media - inline or by direct reference to the media source file.) - */ - public Media setContent(Attachment value) { - this.content = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "code", "Whether the media is a photo (still image), an audio recording, or a video recording.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subtype", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, subtype)); - childrenList.add(new Property("view", "CodeableConcept", "The name of the imaging view e.g. Lateral or Antero-posterior (AP).", 0, java.lang.Integer.MAX_VALUE, view)); - childrenList.add(new Property("subject", "Reference(Patient|Practitioner|Group|Device|Specimen)", "Who/What this Media is a record of.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("operator", "Reference(Practitioner)", "The person who administered the collection of the image.", 0, java.lang.Integer.MAX_VALUE, operator)); - childrenList.add(new Property("deviceName", "string", "The name of the device / manufacturer of the device that was used to make the recording.", 0, java.lang.Integer.MAX_VALUE, deviceName)); - childrenList.add(new Property("height", "positiveInt", "Height of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, height)); - childrenList.add(new Property("width", "positiveInt", "Width of the image in pixels (photo/video).", 0, java.lang.Integer.MAX_VALUE, width)); - childrenList.add(new Property("frames", "positiveInt", "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.", 0, java.lang.Integer.MAX_VALUE, frames)); - childrenList.add(new Property("duration", "unsignedInt", "The duration of the recording in seconds - for audio and video.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("content", "Attachment", "The actual content of the media - inline or by direct reference to the media source file.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : new Base[] {this.subtype}; // CodeableConcept - case 3619493: /*view*/ return this.view == null ? new Base[0] : new Base[] {this.view}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Reference - case 780988929: /*deviceName*/ return this.deviceName == null ? new Base[0] : new Base[] {this.deviceName}; // StringType - case -1221029593: /*height*/ return this.height == null ? new Base[0] : new Base[] {this.height}; // PositiveIntType - case 113126854: /*width*/ return this.width == null ? new Base[0] : new Base[] {this.width}; // PositiveIntType - case -1266514778: /*frames*/ return this.frames == null ? new Base[0] : new Base[] {this.frames}; // PositiveIntType - case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // UnsignedIntType - case 951530617: /*content*/ return this.content == null ? new Base[0] : new Base[] {this.content}; // Attachment - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3575610: // type - this.type = new DigitalMediaTypeEnumFactory().fromType(value); // Enumeration - break; - case -1867567750: // subtype - this.subtype = castToCodeableConcept(value); // CodeableConcept - break; - case 3619493: // view - this.view = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -500553564: // operator - this.operator = castToReference(value); // Reference - break; - case 780988929: // deviceName - this.deviceName = castToString(value); // StringType - break; - case -1221029593: // height - this.height = castToPositiveInt(value); // PositiveIntType - break; - case 113126854: // width - this.width = castToPositiveInt(value); // PositiveIntType - break; - case -1266514778: // frames - this.frames = castToPositiveInt(value); // PositiveIntType - break; - case -1992012396: // duration - this.duration = castToUnsignedInt(value); // UnsignedIntType - break; - case 951530617: // content - this.content = castToAttachment(value); // Attachment - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("type")) - this.type = new DigitalMediaTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("subtype")) - this.subtype = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("view")) - this.view = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("operator")) - this.operator = castToReference(value); // Reference - else if (name.equals("deviceName")) - this.deviceName = castToString(value); // StringType - else if (name.equals("height")) - this.height = castToPositiveInt(value); // PositiveIntType - else if (name.equals("width")) - this.width = castToPositiveInt(value); // PositiveIntType - else if (name.equals("frames")) - this.frames = castToPositiveInt(value); // PositiveIntType - else if (name.equals("duration")) - this.duration = castToUnsignedInt(value); // UnsignedIntType - else if (name.equals("content")) - this.content = castToAttachment(value); // Attachment - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -1867567750: return getSubtype(); // CodeableConcept - case 3619493: return getView(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case -500553564: return getOperator(); // Reference - case 780988929: throw new FHIRException("Cannot make property deviceName as it is not a complex type"); // StringType - case -1221029593: throw new FHIRException("Cannot make property height as it is not a complex type"); // PositiveIntType - case 113126854: throw new FHIRException("Cannot make property width as it is not a complex type"); // PositiveIntType - case -1266514778: throw new FHIRException("Cannot make property frames as it is not a complex type"); // PositiveIntType - case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // UnsignedIntType - case 951530617: return getContent(); // Attachment - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Media.type"); - } - else if (name.equals("subtype")) { - this.subtype = new CodeableConcept(); - return this.subtype; - } - else if (name.equals("view")) { - this.view = new CodeableConcept(); - return this.view; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("operator")) { - this.operator = new Reference(); - return this.operator; - } - else if (name.equals("deviceName")) { - throw new FHIRException("Cannot call addChild on a primitive type Media.deviceName"); - } - else if (name.equals("height")) { - throw new FHIRException("Cannot call addChild on a primitive type Media.height"); - } - else if (name.equals("width")) { - throw new FHIRException("Cannot call addChild on a primitive type Media.width"); - } - else if (name.equals("frames")) { - throw new FHIRException("Cannot call addChild on a primitive type Media.frames"); - } - else if (name.equals("duration")) { - throw new FHIRException("Cannot call addChild on a primitive type Media.duration"); - } - else if (name.equals("content")) { - this.content = new Attachment(); - return this.content; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Media"; - - } - - public Media copy() { - Media dst = new Media(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.subtype = subtype == null ? null : subtype.copy(); - dst.view = view == null ? null : view.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.operator = operator == null ? null : operator.copy(); - dst.deviceName = deviceName == null ? null : deviceName.copy(); - dst.height = height == null ? null : height.copy(); - dst.width = width == null ? null : width.copy(); - dst.frames = frames == null ? null : frames.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.content = content == null ? null : content.copy(); - return dst; - } - - protected Media typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Media)) - return false; - Media o = (Media) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) - && compareDeep(view, o.view, true) && compareDeep(subject, o.subject, true) && compareDeep(operator, o.operator, true) - && compareDeep(deviceName, o.deviceName, true) && compareDeep(height, o.height, true) && compareDeep(width, o.width, true) - && compareDeep(frames, o.frames, true) && compareDeep(duration, o.duration, true) && compareDeep(content, o.content, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Media)) - return false; - Media o = (Media) other; - return compareValues(type, o.type, true) && compareValues(deviceName, o.deviceName, true) && compareValues(height, o.height, true) - && compareValues(width, o.width, true) && compareValues(frames, o.frames, true) && compareValues(duration, o.duration, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (subtype == null || subtype.isEmpty()) && (view == null || view.isEmpty()) && (subject == null || subject.isEmpty()) - && (operator == null || operator.isEmpty()) && (deviceName == null || deviceName.isEmpty()) - && (height == null || height.isEmpty()) && (width == null || width.isEmpty()) && (frames == null || frames.isEmpty()) - && (duration == null || duration.isEmpty()) && (content == null || content.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Media; - } - - /** - * Search parameter: patient - *

- * Description: Who/What this Media is a record of
- * Type: reference
- * Path: Media.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Who/What this Media is a record of
- * Type: reference
- * Path: Media.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Media:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Media:patient").toLocked(); - - /** - * Search parameter: created - *

- * Description: Date attachment was first created
- * Type: date
- * Path: Media.content.creation
- *

- */ - @SearchParamDefinition(name="created", path="Media.content.creation", description="Date attachment was first created", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: Date attachment was first created
- * Type: date
- * Path: Media.content.creation
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: subject - *

- * Description: Who/What this Media is a record of
- * Type: reference
- * Path: Media.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Media.subject", description="Who/What this Media is a record of", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who/What this Media is a record of
- * Type: reference
- * Path: Media.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Media:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Media:subject").toLocked(); - - /** - * Search parameter: subtype - *

- * Description: The type of acquisition equipment/process
- * Type: token
- * Path: Media.subtype
- *

- */ - @SearchParamDefinition(name="subtype", path="Media.subtype", description="The type of acquisition equipment/process", type="token" ) - public static final String SP_SUBTYPE = "subtype"; - /** - * Fluent Client search parameter constant for subtype - *

- * Description: The type of acquisition equipment/process
- * Type: token
- * Path: Media.subtype
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUBTYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUBTYPE); - - /** - * Search parameter: view - *

- * Description: Imaging view, e.g. Lateral or Antero-posterior
- * Type: token
- * Path: Media.view
- *

- */ - @SearchParamDefinition(name="view", path="Media.view", description="Imaging view, e.g. Lateral or Antero-posterior", type="token" ) - public static final String SP_VIEW = "view"; - /** - * Fluent Client search parameter constant for view - *

- * Description: Imaging view, e.g. Lateral or Antero-posterior
- * Type: token
- * Path: Media.view
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VIEW = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VIEW); - - /** - * Search parameter: type - *

- * Description: photo | video | audio
- * Type: token
- * Path: Media.type
- *

- */ - @SearchParamDefinition(name="type", path="Media.type", description="photo | video | audio", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: photo | video | audio
- * Type: token
- * Path: Media.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: Identifier(s) for the image
- * Type: token
- * Path: Media.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Media.identifier", description="Identifier(s) for the image", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Identifier(s) for the image
- * Type: token
- * Path: Media.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: operator - *

- * Description: The person who generated the image
- * Type: reference
- * Path: Media.operator
- *

- */ - @SearchParamDefinition(name="operator", path="Media.operator", description="The person who generated the image", type="reference" ) - public static final String SP_OPERATOR = "operator"; - /** - * Fluent Client search parameter constant for operator - *

- * Description: The person who generated the image
- * Type: reference
- * Path: Media.operator
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OPERATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OPERATOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Media:operator". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_OPERATOR = new ca.uhn.fhir.model.api.Include("Media:operator").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Medication.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Medication.java deleted file mode 100644 index ee2edf9cef5..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Medication.java +++ /dev/null @@ -1,1696 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the packaging for a medication. - */ -@ResourceDef(name="Medication", profile="http://hl7.org/fhir/Profile/Medication") -public class Medication extends DomainResource { - - @Block() - public static class MedicationProductComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes the form of the item. Powder; tablets; carton. - */ - @Child(name = "form", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="powder | tablets | carton +", formalDefinition="Describes the form of the item. Powder; tablets; carton." ) - protected CodeableConcept form; - - /** - * Identifies a particular constituent of interest in the product. - */ - @Child(name = "ingredient", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Active or inactive ingredient", formalDefinition="Identifies a particular constituent of interest in the product." ) - protected List ingredient; - - /** - * Information about a group of medication produced or packaged from one production run. - */ - @Child(name = "batch", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="Information about a group of medication produced or packaged from one production run." ) - protected List batch; - - private static final long serialVersionUID = 1132853671L; - - /** - * Constructor - */ - public MedicationProductComponent() { - super(); - } - - /** - * @return {@link #form} (Describes the form of the item. Powder; tablets; carton.) - */ - public CodeableConcept getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductComponent.form"); - else if (Configuration.doAutoCreate()) - this.form = new CodeableConcept(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (Describes the form of the item. Powder; tablets; carton.) - */ - public MedicationProductComponent setForm(CodeableConcept value) { - this.form = value; - return this; - } - - /** - * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) - */ - public List getIngredient() { - if (this.ingredient == null) - this.ingredient = new ArrayList(); - return this.ingredient; - } - - public boolean hasIngredient() { - if (this.ingredient == null) - return false; - for (MedicationProductIngredientComponent item : this.ingredient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ingredient} (Identifies a particular constituent of interest in the product.) - */ - // syntactic sugar - public MedicationProductIngredientComponent addIngredient() { //3 - MedicationProductIngredientComponent t = new MedicationProductIngredientComponent(); - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return t; - } - - // syntactic sugar - public MedicationProductComponent addIngredient(MedicationProductIngredientComponent t) { //3 - if (t == null) - return this; - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return this; - } - - /** - * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) - */ - public List getBatch() { - if (this.batch == null) - this.batch = new ArrayList(); - return this.batch; - } - - public boolean hasBatch() { - if (this.batch == null) - return false; - for (MedicationProductBatchComponent item : this.batch) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #batch} (Information about a group of medication produced or packaged from one production run.) - */ - // syntactic sugar - public MedicationProductBatchComponent addBatch() { //3 - MedicationProductBatchComponent t = new MedicationProductBatchComponent(); - if (this.batch == null) - this.batch = new ArrayList(); - this.batch.add(t); - return t; - } - - // syntactic sugar - public MedicationProductComponent addBatch(MedicationProductBatchComponent t) { //3 - if (t == null) - return this; - if (this.batch == null) - this.batch = new ArrayList(); - this.batch.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("form", "CodeableConcept", "Describes the form of the item. Powder; tablets; carton.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("ingredient", "", "Identifies a particular constituent of interest in the product.", 0, java.lang.Integer.MAX_VALUE, ingredient)); - childrenList.add(new Property("batch", "", "Information about a group of medication produced or packaged from one production run.", 0, java.lang.Integer.MAX_VALUE, batch)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // CodeableConcept - case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // MedicationProductIngredientComponent - case 93509434: /*batch*/ return this.batch == null ? new Base[0] : this.batch.toArray(new Base[this.batch.size()]); // MedicationProductBatchComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3148996: // form - this.form = castToCodeableConcept(value); // CodeableConcept - break; - case -206409263: // ingredient - this.getIngredient().add((MedicationProductIngredientComponent) value); // MedicationProductIngredientComponent - break; - case 93509434: // batch - this.getBatch().add((MedicationProductBatchComponent) value); // MedicationProductBatchComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("form")) - this.form = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("ingredient")) - this.getIngredient().add((MedicationProductIngredientComponent) value); - else if (name.equals("batch")) - this.getBatch().add((MedicationProductBatchComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3148996: return getForm(); // CodeableConcept - case -206409263: return addIngredient(); // MedicationProductIngredientComponent - case 93509434: return addBatch(); // MedicationProductBatchComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("form")) { - this.form = new CodeableConcept(); - return this.form; - } - else if (name.equals("ingredient")) { - return addIngredient(); - } - else if (name.equals("batch")) { - return addBatch(); - } - else - return super.addChild(name); - } - - public MedicationProductComponent copy() { - MedicationProductComponent dst = new MedicationProductComponent(); - copyValues(dst); - dst.form = form == null ? null : form.copy(); - if (ingredient != null) { - dst.ingredient = new ArrayList(); - for (MedicationProductIngredientComponent i : ingredient) - dst.ingredient.add(i.copy()); - }; - if (batch != null) { - dst.batch = new ArrayList(); - for (MedicationProductBatchComponent i : batch) - dst.batch.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationProductComponent)) - return false; - MedicationProductComponent o = (MedicationProductComponent) other; - return compareDeep(form, o.form, true) && compareDeep(ingredient, o.ingredient, true) && compareDeep(batch, o.batch, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationProductComponent)) - return false; - MedicationProductComponent o = (MedicationProductComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (form == null || form.isEmpty()) && (ingredient == null || ingredient.isEmpty()) - && (batch == null || batch.isEmpty()); - } - - public String fhirType() { - return "Medication.product"; - - } - - } - - @Block() - public static class MedicationProductIngredientComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The actual ingredient - either a substance (simple ingredient) or another medication. - */ - @Child(name = "item", type = {CodeableConcept.class, Substance.class, Medication.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The product contained", formalDefinition="The actual ingredient - either a substance (simple ingredient) or another medication." ) - protected Type item; - - /** - * Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. - */ - @Child(name = "amount", type = {Ratio.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Quantity of ingredient present", formalDefinition="Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet." ) - protected Ratio amount; - - private static final long serialVersionUID = -651644952L; - - /** - * Constructor - */ - public MedicationProductIngredientComponent() { - super(); - } - - /** - * Constructor - */ - public MedicationProductIngredientComponent(Type item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public Type getItem() { - return this.item; - } - - /** - * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public CodeableConcept getItemCodeableConcept() throws FHIRException { - if (!(this.item instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered"); - return (CodeableConcept) this.item; - } - - public boolean hasItemCodeableConcept() { - return this.item instanceof CodeableConcept; - } - - /** - * @return {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public Reference getItemReference() throws FHIRException { - if (!(this.item instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered"); - return (Reference) this.item; - } - - public boolean hasItemReference() { - return this.item instanceof Reference; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (The actual ingredient - either a substance (simple ingredient) or another medication.) - */ - public MedicationProductIngredientComponent setItem(Type value) { - this.item = value; - return this; - } - - /** - * @return {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet.) - */ - public Ratio getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductIngredientComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Ratio(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet.) - */ - public MedicationProductIngredientComponent setAmount(Ratio value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item[x]", "CodeableConcept|Reference(Substance|Medication)", "The actual ingredient - either a substance (simple ingredient) or another medication.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("amount", "Ratio", "Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Type - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Ratio - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3242771: // item - this.item = (Type) value; // Type - break; - case -1413853096: // amount - this.amount = castToRatio(value); // Ratio - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("item[x]")) - this.item = (Type) value; // Type - else if (name.equals("amount")) - this.amount = castToRatio(value); // Ratio - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 2116201613: return getItem(); // Type - case -1413853096: return getAmount(); // Ratio - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("itemCodeableConcept")) { - this.item = new CodeableConcept(); - return this.item; - } - else if (name.equals("itemReference")) { - this.item = new Reference(); - return this.item; - } - else if (name.equals("amount")) { - this.amount = new Ratio(); - return this.amount; - } - else - return super.addChild(name); - } - - public MedicationProductIngredientComponent copy() { - MedicationProductIngredientComponent dst = new MedicationProductIngredientComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationProductIngredientComponent)) - return false; - MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; - return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationProductIngredientComponent)) - return false; - MedicationProductIngredientComponent o = (MedicationProductIngredientComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - public String fhirType() { - return "Medication.product.ingredient"; - - } - - } - - @Block() - public static class MedicationProductBatchComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The assigned lot number of a batch of the specified product. - */ - @Child(name = "lotNumber", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The assigned lot number of a batch of the specified product." ) - protected StringType lotNumber; - - /** - * When this specific batch of product will expire. - */ - @Child(name = "expirationDate", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="When this specific batch of product will expire." ) - protected DateTimeType expirationDate; - - private static final long serialVersionUID = 1982738755L; - - /** - * Constructor - */ - public MedicationProductBatchComponent() { - super(); - } - - /** - * @return {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public StringType getLotNumberElement() { - if (this.lotNumber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductBatchComponent.lotNumber"); - else if (Configuration.doAutoCreate()) - this.lotNumber = new StringType(); // bb - return this.lotNumber; - } - - public boolean hasLotNumberElement() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - public boolean hasLotNumber() { - return this.lotNumber != null && !this.lotNumber.isEmpty(); - } - - /** - * @param value {@link #lotNumber} (The assigned lot number of a batch of the specified product.). This is the underlying object with id, value and extensions. The accessor "getLotNumber" gives direct access to the value - */ - public MedicationProductBatchComponent setLotNumberElement(StringType value) { - this.lotNumber = value; - return this; - } - - /** - * @return The assigned lot number of a batch of the specified product. - */ - public String getLotNumber() { - return this.lotNumber == null ? null : this.lotNumber.getValue(); - } - - /** - * @param value The assigned lot number of a batch of the specified product. - */ - public MedicationProductBatchComponent setLotNumber(String value) { - if (Utilities.noString(value)) - this.lotNumber = null; - else { - if (this.lotNumber == null) - this.lotNumber = new StringType(); - this.lotNumber.setValue(value); - } - return this; - } - - /** - * @return {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public DateTimeType getExpirationDateElement() { - if (this.expirationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationProductBatchComponent.expirationDate"); - else if (Configuration.doAutoCreate()) - this.expirationDate = new DateTimeType(); // bb - return this.expirationDate; - } - - public boolean hasExpirationDateElement() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - public boolean hasExpirationDate() { - return this.expirationDate != null && !this.expirationDate.isEmpty(); - } - - /** - * @param value {@link #expirationDate} (When this specific batch of product will expire.). This is the underlying object with id, value and extensions. The accessor "getExpirationDate" gives direct access to the value - */ - public MedicationProductBatchComponent setExpirationDateElement(DateTimeType value) { - this.expirationDate = value; - return this; - } - - /** - * @return When this specific batch of product will expire. - */ - public Date getExpirationDate() { - return this.expirationDate == null ? null : this.expirationDate.getValue(); - } - - /** - * @param value When this specific batch of product will expire. - */ - public MedicationProductBatchComponent setExpirationDate(Date value) { - if (value == null) - this.expirationDate = null; - else { - if (this.expirationDate == null) - this.expirationDate = new DateTimeType(); - this.expirationDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("lotNumber", "string", "The assigned lot number of a batch of the specified product.", 0, java.lang.Integer.MAX_VALUE, lotNumber)); - childrenList.add(new Property("expirationDate", "dateTime", "When this specific batch of product will expire.", 0, java.lang.Integer.MAX_VALUE, expirationDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 462547450: /*lotNumber*/ return this.lotNumber == null ? new Base[0] : new Base[] {this.lotNumber}; // StringType - case -668811523: /*expirationDate*/ return this.expirationDate == null ? new Base[0] : new Base[] {this.expirationDate}; // DateTimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 462547450: // lotNumber - this.lotNumber = castToString(value); // StringType - break; - case -668811523: // expirationDate - this.expirationDate = castToDateTime(value); // DateTimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("lotNumber")) - this.lotNumber = castToString(value); // StringType - else if (name.equals("expirationDate")) - this.expirationDate = castToDateTime(value); // DateTimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 462547450: throw new FHIRException("Cannot make property lotNumber as it is not a complex type"); // StringType - case -668811523: throw new FHIRException("Cannot make property expirationDate as it is not a complex type"); // DateTimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("lotNumber")) { - throw new FHIRException("Cannot call addChild on a primitive type Medication.lotNumber"); - } - else if (name.equals("expirationDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Medication.expirationDate"); - } - else - return super.addChild(name); - } - - public MedicationProductBatchComponent copy() { - MedicationProductBatchComponent dst = new MedicationProductBatchComponent(); - copyValues(dst); - dst.lotNumber = lotNumber == null ? null : lotNumber.copy(); - dst.expirationDate = expirationDate == null ? null : expirationDate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationProductBatchComponent)) - return false; - MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; - return compareDeep(lotNumber, o.lotNumber, true) && compareDeep(expirationDate, o.expirationDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationProductBatchComponent)) - return false; - MedicationProductBatchComponent o = (MedicationProductBatchComponent) other; - return compareValues(lotNumber, o.lotNumber, true) && compareValues(expirationDate, o.expirationDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (lotNumber == null || lotNumber.isEmpty()) && (expirationDate == null || expirationDate.isEmpty()) - ; - } - - public String fhirType() { - return "Medication.product.batch"; - - } - - } - - @Block() - public static class MedicationPackageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of container that this package comes as. - */ - @Child(name = "container", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="E.g. box, vial, blister-pack", formalDefinition="The kind of container that this package comes as." ) - protected CodeableConcept container; - - /** - * A set of components that go to make up the described item. - */ - @Child(name = "content", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="What is in the package", formalDefinition="A set of components that go to make up the described item." ) - protected List content; - - private static final long serialVersionUID = 503772472L; - - /** - * Constructor - */ - public MedicationPackageComponent() { - super(); - } - - /** - * @return {@link #container} (The kind of container that this package comes as.) - */ - public CodeableConcept getContainer() { - if (this.container == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageComponent.container"); - else if (Configuration.doAutoCreate()) - this.container = new CodeableConcept(); // cc - return this.container; - } - - public boolean hasContainer() { - return this.container != null && !this.container.isEmpty(); - } - - /** - * @param value {@link #container} (The kind of container that this package comes as.) - */ - public MedicationPackageComponent setContainer(CodeableConcept value) { - this.container = value; - return this; - } - - /** - * @return {@link #content} (A set of components that go to make up the described item.) - */ - public List getContent() { - if (this.content == null) - this.content = new ArrayList(); - return this.content; - } - - public boolean hasContent() { - if (this.content == null) - return false; - for (MedicationPackageContentComponent item : this.content) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #content} (A set of components that go to make up the described item.) - */ - // syntactic sugar - public MedicationPackageContentComponent addContent() { //3 - MedicationPackageContentComponent t = new MedicationPackageContentComponent(); - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return t; - } - - // syntactic sugar - public MedicationPackageComponent addContent(MedicationPackageContentComponent t) { //3 - if (t == null) - return this; - if (this.content == null) - this.content = new ArrayList(); - this.content.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("container", "CodeableConcept", "The kind of container that this package comes as.", 0, java.lang.Integer.MAX_VALUE, container)); - childrenList.add(new Property("content", "", "A set of components that go to make up the described item.", 0, java.lang.Integer.MAX_VALUE, content)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -410956671: /*container*/ return this.container == null ? new Base[0] : new Base[] {this.container}; // CodeableConcept - case 951530617: /*content*/ return this.content == null ? new Base[0] : this.content.toArray(new Base[this.content.size()]); // MedicationPackageContentComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -410956671: // container - this.container = castToCodeableConcept(value); // CodeableConcept - break; - case 951530617: // content - this.getContent().add((MedicationPackageContentComponent) value); // MedicationPackageContentComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("container")) - this.container = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("content")) - this.getContent().add((MedicationPackageContentComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -410956671: return getContainer(); // CodeableConcept - case 951530617: return addContent(); // MedicationPackageContentComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("container")) { - this.container = new CodeableConcept(); - return this.container; - } - else if (name.equals("content")) { - return addContent(); - } - else - return super.addChild(name); - } - - public MedicationPackageComponent copy() { - MedicationPackageComponent dst = new MedicationPackageComponent(); - copyValues(dst); - dst.container = container == null ? null : container.copy(); - if (content != null) { - dst.content = new ArrayList(); - for (MedicationPackageContentComponent i : content) - dst.content.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPackageComponent)) - return false; - MedicationPackageComponent o = (MedicationPackageComponent) other; - return compareDeep(container, o.container, true) && compareDeep(content, o.content, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPackageComponent)) - return false; - MedicationPackageComponent o = (MedicationPackageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (container == null || container.isEmpty()) && (content == null || content.isEmpty()) - ; - } - - public String fhirType() { - return "Medication.package"; - - } - - } - - @Block() - public static class MedicationPackageContentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies one of the items in the package. - */ - @Child(name = "item", type = {CodeableConcept.class, Medication.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The item in the package", formalDefinition="Identifies one of the items in the package." ) - protected Type item; - - /** - * The amount of the product that is in the package. - */ - @Child(name = "amount", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Quantity present in the package", formalDefinition="The amount of the product that is in the package." ) - protected SimpleQuantity amount; - - private static final long serialVersionUID = 1669610080L; - - /** - * Constructor - */ - public MedicationPackageContentComponent() { - super(); - } - - /** - * Constructor - */ - public MedicationPackageContentComponent(Type item) { - super(); - this.item = item; - } - - /** - * @return {@link #item} (Identifies one of the items in the package.) - */ - public Type getItem() { - return this.item; - } - - /** - * @return {@link #item} (Identifies one of the items in the package.) - */ - public CodeableConcept getItemCodeableConcept() throws FHIRException { - if (!(this.item instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.item.getClass().getName()+" was encountered"); - return (CodeableConcept) this.item; - } - - public boolean hasItemCodeableConcept() { - return this.item instanceof CodeableConcept; - } - - /** - * @return {@link #item} (Identifies one of the items in the package.) - */ - public Reference getItemReference() throws FHIRException { - if (!(this.item instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.item.getClass().getName()+" was encountered"); - return (Reference) this.item; - } - - public boolean hasItemReference() { - return this.item instanceof Reference; - } - - public boolean hasItem() { - return this.item != null && !this.item.isEmpty(); - } - - /** - * @param value {@link #item} (Identifies one of the items in the package.) - */ - public MedicationPackageContentComponent setItem(Type value) { - this.item = value; - return this; - } - - /** - * @return {@link #amount} (The amount of the product that is in the package.) - */ - public SimpleQuantity getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationPackageContentComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new SimpleQuantity(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (The amount of the product that is in the package.) - */ - public MedicationPackageContentComponent setAmount(SimpleQuantity value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("item[x]", "CodeableConcept|Reference(Medication)", "Identifies one of the items in the package.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("amount", "SimpleQuantity", "The amount of the product that is in the package.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3242771: /*item*/ return this.item == null ? new Base[0] : new Base[] {this.item}; // Type - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SimpleQuantity - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3242771: // item - this.item = (Type) value; // Type - break; - case -1413853096: // amount - this.amount = castToSimpleQuantity(value); // SimpleQuantity - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("item[x]")) - this.item = (Type) value; // Type - else if (name.equals("amount")) - this.amount = castToSimpleQuantity(value); // SimpleQuantity - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 2116201613: return getItem(); // Type - case -1413853096: return getAmount(); // SimpleQuantity - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("itemCodeableConcept")) { - this.item = new CodeableConcept(); - return this.item; - } - else if (name.equals("itemReference")) { - this.item = new Reference(); - return this.item; - } - else if (name.equals("amount")) { - this.amount = new SimpleQuantity(); - return this.amount; - } - else - return super.addChild(name); - } - - public MedicationPackageContentComponent copy() { - MedicationPackageContentComponent dst = new MedicationPackageContentComponent(); - copyValues(dst); - dst.item = item == null ? null : item.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationPackageContentComponent)) - return false; - MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; - return compareDeep(item, o.item, true) && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationPackageContentComponent)) - return false; - MedicationPackageContentComponent o = (MedicationPackageContentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (item == null || item.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - public String fhirType() { - return "Medication.package.content"; - - } - - } - - /** - * A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Codes that identify this medication", formalDefinition="A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems." ) - protected CodeableConcept code; - - /** - * Set to true if the item is attributable to a specific manufacturer. - */ - @Child(name = "isBrand", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="True if a brand", formalDefinition="Set to true if the item is attributable to a specific manufacturer." ) - protected BooleanType isBrand; - - /** - * Describes the details of the manufacturer. - */ - @Child(name = "manufacturer", type = {Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Manufacturer of the item", formalDefinition="Describes the details of the manufacturer." ) - protected Reference manufacturer; - - /** - * The actual object that is the target of the reference (Describes the details of the manufacturer.) - */ - protected Organization manufacturerTarget; - - /** - * Information that only applies to products (not packages). - */ - @Child(name = "product", type = {}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Administrable medication details", formalDefinition="Information that only applies to products (not packages)." ) - protected MedicationProductComponent product; - - /** - * Information that only applies to packages (not products). - */ - @Child(name = "package", type = {}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Details about packaged medications", formalDefinition="Information that only applies to packages (not products)." ) - protected MedicationPackageComponent package_; - - private static final long serialVersionUID = 859308699L; - - /** - * Constructor - */ - public Medication() { - super(); - } - - /** - * @return {@link #code} (A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.) - */ - public Medication setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer.). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value - */ - public BooleanType getIsBrandElement() { - if (this.isBrand == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.isBrand"); - else if (Configuration.doAutoCreate()) - this.isBrand = new BooleanType(); // bb - return this.isBrand; - } - - public boolean hasIsBrandElement() { - return this.isBrand != null && !this.isBrand.isEmpty(); - } - - public boolean hasIsBrand() { - return this.isBrand != null && !this.isBrand.isEmpty(); - } - - /** - * @param value {@link #isBrand} (Set to true if the item is attributable to a specific manufacturer.). This is the underlying object with id, value and extensions. The accessor "getIsBrand" gives direct access to the value - */ - public Medication setIsBrandElement(BooleanType value) { - this.isBrand = value; - return this; - } - - /** - * @return Set to true if the item is attributable to a specific manufacturer. - */ - public boolean getIsBrand() { - return this.isBrand == null || this.isBrand.isEmpty() ? false : this.isBrand.getValue(); - } - - /** - * @param value Set to true if the item is attributable to a specific manufacturer. - */ - public Medication setIsBrand(boolean value) { - if (this.isBrand == null) - this.isBrand = new BooleanType(); - this.isBrand.setValue(value); - return this; - } - - /** - * @return {@link #manufacturer} (Describes the details of the manufacturer.) - */ - public Reference getManufacturer() { - if (this.manufacturer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturer = new Reference(); // cc - return this.manufacturer; - } - - public boolean hasManufacturer() { - return this.manufacturer != null && !this.manufacturer.isEmpty(); - } - - /** - * @param value {@link #manufacturer} (Describes the details of the manufacturer.) - */ - public Medication setManufacturer(Reference value) { - this.manufacturer = value; - return this; - } - - /** - * @return {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer.) - */ - public Organization getManufacturerTarget() { - if (this.manufacturerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.manufacturer"); - else if (Configuration.doAutoCreate()) - this.manufacturerTarget = new Organization(); // aa - return this.manufacturerTarget; - } - - /** - * @param value {@link #manufacturer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Describes the details of the manufacturer.) - */ - public Medication setManufacturerTarget(Organization value) { - this.manufacturerTarget = value; - return this; - } - - /** - * @return {@link #product} (Information that only applies to products (not packages).) - */ - public MedicationProductComponent getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.product"); - else if (Configuration.doAutoCreate()) - this.product = new MedicationProductComponent(); // cc - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Information that only applies to products (not packages).) - */ - public Medication setProduct(MedicationProductComponent value) { - this.product = value; - return this; - } - - /** - * @return {@link #package_} (Information that only applies to packages (not products).) - */ - public MedicationPackageComponent getPackage() { - if (this.package_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Medication.package_"); - else if (Configuration.doAutoCreate()) - this.package_ = new MedicationPackageComponent(); // cc - return this.package_; - } - - public boolean hasPackage() { - return this.package_ != null && !this.package_.isEmpty(); - } - - /** - * @param value {@link #package_} (Information that only applies to packages (not products).) - */ - public Medication setPackage(MedicationPackageComponent value) { - this.package_ = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("isBrand", "boolean", "Set to true if the item is attributable to a specific manufacturer.", 0, java.lang.Integer.MAX_VALUE, isBrand)); - childrenList.add(new Property("manufacturer", "Reference(Organization)", "Describes the details of the manufacturer.", 0, java.lang.Integer.MAX_VALUE, manufacturer)); - childrenList.add(new Property("product", "", "Information that only applies to products (not packages).", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("package", "", "Information that only applies to packages (not products).", 0, java.lang.Integer.MAX_VALUE, package_)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 2055403645: /*isBrand*/ return this.isBrand == null ? new Base[0] : new Base[] {this.isBrand}; // BooleanType - case -1969347631: /*manufacturer*/ return this.manufacturer == null ? new Base[0] : new Base[] {this.manufacturer}; // Reference - case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // MedicationProductComponent - case -807062458: /*package*/ return this.package_ == null ? new Base[0] : new Base[] {this.package_}; // MedicationPackageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 2055403645: // isBrand - this.isBrand = castToBoolean(value); // BooleanType - break; - case -1969347631: // manufacturer - this.manufacturer = castToReference(value); // Reference - break; - case -309474065: // product - this.product = (MedicationProductComponent) value; // MedicationProductComponent - break; - case -807062458: // package - this.package_ = (MedicationPackageComponent) value; // MedicationPackageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("isBrand")) - this.isBrand = castToBoolean(value); // BooleanType - else if (name.equals("manufacturer")) - this.manufacturer = castToReference(value); // Reference - else if (name.equals("product")) - this.product = (MedicationProductComponent) value; // MedicationProductComponent - else if (name.equals("package")) - this.package_ = (MedicationPackageComponent) value; // MedicationPackageComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case 2055403645: throw new FHIRException("Cannot make property isBrand as it is not a complex type"); // BooleanType - case -1969347631: return getManufacturer(); // Reference - case -309474065: return getProduct(); // MedicationProductComponent - case -807062458: return getPackage(); // MedicationPackageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("isBrand")) { - throw new FHIRException("Cannot call addChild on a primitive type Medication.isBrand"); - } - else if (name.equals("manufacturer")) { - this.manufacturer = new Reference(); - return this.manufacturer; - } - else if (name.equals("product")) { - this.product = new MedicationProductComponent(); - return this.product; - } - else if (name.equals("package")) { - this.package_ = new MedicationPackageComponent(); - return this.package_; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Medication"; - - } - - public Medication copy() { - Medication dst = new Medication(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.isBrand = isBrand == null ? null : isBrand.copy(); - dst.manufacturer = manufacturer == null ? null : manufacturer.copy(); - dst.product = product == null ? null : product.copy(); - dst.package_ = package_ == null ? null : package_.copy(); - return dst; - } - - protected Medication typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Medication)) - return false; - Medication o = (Medication) other; - return compareDeep(code, o.code, true) && compareDeep(isBrand, o.isBrand, true) && compareDeep(manufacturer, o.manufacturer, true) - && compareDeep(product, o.product, true) && compareDeep(package_, o.package_, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Medication)) - return false; - Medication o = (Medication) other; - return compareValues(isBrand, o.isBrand, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (isBrand == null || isBrand.isEmpty()) - && (manufacturer == null || manufacturer.isEmpty()) && (product == null || product.isEmpty()) - && (package_ == null || package_.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Medication; - } - - /** - * Search parameter: form - *

- * Description: powder | tablets | carton +
- * Type: token
- * Path: Medication.product.form
- *

- */ - @SearchParamDefinition(name="form", path="Medication.product.form", description="powder | tablets | carton +", type="token" ) - public static final String SP_FORM = "form"; - /** - * Fluent Client search parameter constant for form - *

- * Description: powder | tablets | carton +
- * Type: token
- * Path: Medication.product.form
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORM); - - /** - * Search parameter: container - *

- * Description: E.g. box, vial, blister-pack
- * Type: token
- * Path: Medication.package.container
- *

- */ - @SearchParamDefinition(name="container", path="Medication.package.container", description="E.g. box, vial, blister-pack", type="token" ) - public static final String SP_CONTAINER = "container"; - /** - * Fluent Client search parameter constant for container - *

- * Description: E.g. box, vial, blister-pack
- * Type: token
- * Path: Medication.package.container
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER); - - /** - * Search parameter: manufacturer - *

- * Description: Manufacturer of the item
- * Type: reference
- * Path: Medication.manufacturer
- *

- */ - @SearchParamDefinition(name="manufacturer", path="Medication.manufacturer", description="Manufacturer of the item", type="reference" ) - public static final String SP_MANUFACTURER = "manufacturer"; - /** - * Fluent Client search parameter constant for manufacturer - *

- * Description: Manufacturer of the item
- * Type: reference
- * Path: Medication.manufacturer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MANUFACTURER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MANUFACTURER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Medication:manufacturer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MANUFACTURER = new ca.uhn.fhir.model.api.Include("Medication:manufacturer").toLocked(); - - /** - * Search parameter: package-item-code - *

- * Description: The item in the package
- * Type: token
- * Path: Medication.package.content.itemCodeableConcept
- *

- */ - @SearchParamDefinition(name="package-item-code", path="Medication.package.content.item.as(CodeableConcept)", description="The item in the package", type="token" ) - public static final String SP_PACKAGE_ITEM_CODE = "package-item-code"; - /** - * Fluent Client search parameter constant for package-item-code - *

- * Description: The item in the package
- * Type: token
- * Path: Medication.package.content.itemCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PACKAGE_ITEM_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PACKAGE_ITEM_CODE); - - /** - * Search parameter: ingredient - *

- * Description: The product contained
- * Type: reference
- * Path: Medication.product.ingredient.itemReference
- *

- */ - @SearchParamDefinition(name="ingredient", path="Medication.product.ingredient.item.as(Reference)", description="The product contained", type="reference" ) - public static final String SP_INGREDIENT = "ingredient"; - /** - * Fluent Client search parameter constant for ingredient - *

- * Description: The product contained
- * Type: reference
- * Path: Medication.product.ingredient.itemReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam INGREDIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_INGREDIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Medication:ingredient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_INGREDIENT = new ca.uhn.fhir.model.api.Include("Medication:ingredient").toLocked(); - - /** - * Search parameter: package-item - *

- * Description: The item in the package
- * Type: reference
- * Path: Medication.package.content.itemReference
- *

- */ - @SearchParamDefinition(name="package-item", path="Medication.package.content.item.as(Reference)", description="The item in the package", type="reference" ) - public static final String SP_PACKAGE_ITEM = "package-item"; - /** - * Fluent Client search parameter constant for package-item - *

- * Description: The item in the package
- * Type: reference
- * Path: Medication.package.content.itemReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PACKAGE_ITEM = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PACKAGE_ITEM); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Medication:package-item". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PACKAGE_ITEM = new ca.uhn.fhir.model.api.Include("Medication:package-item").toLocked(); - - /** - * Search parameter: code - *

- * Description: Codes that identify this medication
- * Type: token
- * Path: Medication.code
- *

- */ - @SearchParamDefinition(name="code", path="Medication.code", description="Codes that identify this medication", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Codes that identify this medication
- * Type: token
- * Path: Medication.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: ingredient-code - *

- * Description: The product contained
- * Type: token
- * Path: Medication.product.ingredient.itemCodeableConcept
- *

- */ - @SearchParamDefinition(name="ingredient-code", path="Medication.product.ingredient.item.as(CodeableConcept)", description="The product contained", type="token" ) - public static final String SP_INGREDIENT_CODE = "ingredient-code"; - /** - * Fluent Client search parameter constant for ingredient-code - *

- * Description: The product contained
- * Type: token
- * Path: Medication.product.ingredient.itemCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam INGREDIENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INGREDIENT_CODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java deleted file mode 100644 index e09b4107802..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationAdministration.java +++ /dev/null @@ -1,1911 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Describes the event of a patient consuming or otherwise being administered 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. - */ -@ResourceDef(name="MedicationAdministration", profile="http://hl7.org/fhir/Profile/MedicationAdministration") -public class MedicationAdministration extends DomainResource { - - public enum MedicationAdministrationStatus { - /** - * The administration has started but has not yet completed. - */ - INPROGRESS, - /** - * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the administration have occurred. - */ - COMPLETED, - /** - * The administration was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the administration have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * added to help the parsers - */ - NULL; - public static MedicationAdministrationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - throw new FHIRException("Unknown MedicationAdministrationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/medication-admin-status"; - case ONHOLD: return "http://hl7.org/fhir/medication-admin-status"; - case COMPLETED: return "http://hl7.org/fhir/medication-admin-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/medication-admin-status"; - case STOPPED: return "http://hl7.org/fhir/medication-admin-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The administration has started but has not yet completed."; - case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called \"suspended\"."; - case COMPLETED: return "All actions that are implied by the administration have occurred."; - case ENTEREDINERROR: return "The administration was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the administration have been permanently halted, before all of them occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in Error"; - case STOPPED: return "Stopped"; - default: return "?"; - } - } - } - - public static class MedicationAdministrationStatusEnumFactory implements EnumFactory { - public MedicationAdministrationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return MedicationAdministrationStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return MedicationAdministrationStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationAdministrationStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationAdministrationStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationAdministrationStatus.STOPPED; - throw new IllegalArgumentException("Unknown MedicationAdministrationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, MedicationAdministrationStatus.INPROGRESS); - if ("on-hold".equals(codeString)) - return new Enumeration(this, MedicationAdministrationStatus.ONHOLD); - if ("completed".equals(codeString)) - return new Enumeration(this, MedicationAdministrationStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, MedicationAdministrationStatus.ENTEREDINERROR); - if ("stopped".equals(codeString)) - return new Enumeration(this, MedicationAdministrationStatus.STOPPED); - throw new FHIRException("Unknown MedicationAdministrationStatus code '"+codeString+"'"); - } - public String toCode(MedicationAdministrationStatus code) { - if (code == MedicationAdministrationStatus.INPROGRESS) - return "in-progress"; - if (code == MedicationAdministrationStatus.ONHOLD) - return "on-hold"; - if (code == MedicationAdministrationStatus.COMPLETED) - return "completed"; - if (code == MedicationAdministrationStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationAdministrationStatus.STOPPED) - return "stopped"; - return "?"; - } - public String toSystem(MedicationAdministrationStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class MedicationAdministrationDosageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) - protected StringType text; - - /** - * A coded specification of the anatomic site where the medication first entered the body. For example, "left arm". - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Body site administered to", formalDefinition="A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\"." ) - protected Type site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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. For example, topical, intravenous, etc." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How drug was administered", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV." ) - protected CodeableConcept method; - - /** - * 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. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected SimpleQuantity quantity; - - /** - * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. - */ - @Child(name = "rate", type = {Ratio.class, Range.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) - protected Type rate; - - private static final long serialVersionUID = -1772198879L; - - /** - * Constructor - */ - public MedicationAdministrationDosageComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationAdministrationDosageComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public MedicationAdministrationDosageComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) - */ - public CodeableConcept getSiteCodeableConcept() throws FHIRException { - if (!(this.site instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - public boolean hasSiteCodeableConcept() { - return this.site instanceof CodeableConcept; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) - */ - public Reference getSiteReference() throws FHIRException { - if (!(this.site instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSiteReference() { - return this.site instanceof Reference; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first entered the body. For example, "left arm".) - */ - public MedicationAdministrationDosageComponent setSite(Type value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.) - */ - public MedicationAdministrationDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) - */ - public MedicationAdministrationDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (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 SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministrationDosageComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (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 MedicationAdministrationDosageComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Type getRate() { - return this.rate; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Ratio getRateRatio() throws FHIRException { - if (!(this.rate instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Ratio) this.rate; - } - - public boolean hasRateRatio() { - return this.rate instanceof Ratio; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Range getRateRange() throws FHIRException { - if (!(this.rate instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Range) this.rate; - } - - public boolean hasRateRange() { - return this.rate instanceof Range; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public MedicationAdministrationDosageComponent setRate(Type value) { - this.rate = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first entered the body. For example, \"left arm\".", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto the patient. For example, topical, intravenous, etc.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity", "SimpleQuantity", "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.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate[x]", "Ratio|Range", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type - case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3556653: // text - this.text = castToString(value); // StringType - break; - case 3530567: // site - this.site = (Type) value; // Type - break; - case 108704329: // route - this.route = castToCodeableConcept(value); // CodeableConcept - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 3493088: // rate - this.rate = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("site[x]")) - this.site = (Type) value; // Type - else if (name.equals("route")) - this.route = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("rate[x]")) - this.rate = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case 2099997657: return getSite(); // Type - case 108704329: return getRoute(); // CodeableConcept - case -1077554975: return getMethod(); // CodeableConcept - case -1285004149: return getQuantity(); // SimpleQuantity - case 983460768: return getRate(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.text"); - } - else if (name.equals("siteCodeableConcept")) { - this.site = new CodeableConcept(); - return this.site; - } - else if (name.equals("siteReference")) { - this.site = new Reference(); - return this.site; - } - else if (name.equals("route")) { - this.route = new CodeableConcept(); - return this.route; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("rateRatio")) { - this.rate = new Ratio(); - return this.rate; - } - else if (name.equals("rateRange")) { - this.rate = new Range(); - return this.rate; - } - else - return super.addChild(name); - } - - public MedicationAdministrationDosageComponent copy() { - MedicationAdministrationDosageComponent dst = new MedicationAdministrationDosageComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationAdministrationDosageComponent)) - return false; - MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; - return compareDeep(text, o.text, true) && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) - && compareDeep(method, o.method, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationAdministrationDosageComponent)) - return false; - MedicationAdministrationDosageComponent o = (MedicationAdministrationDosageComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (rate == null || rate.isEmpty()); - } - - public String fhirType() { - return "MedicationAdministration.dosage"; - - } - - } - - /** - * External identifier - FHIR will generate its own internal identifiers (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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal identifiers (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." ) - protected List identifier; - - /** - * 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. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @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." ) - protected Enumeration status; - - /** - * 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. - */ - @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) - @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." ) - protected Type medication; - - /** - * The person or animal receiving the medication. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who received medication", formalDefinition="The person or animal receiving the medication." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person or animal receiving the medication.) - */ - protected Patient patientTarget; - - /** - * The visit, admission or other contact between patient and health care provider the medication administration was performed as part of. - */ - @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Encounter administered as part of", formalDefinition="The visit, admission or other contact between patient and health care provider the medication administration was performed as part of." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) - */ - protected Encounter encounterTarget; - - /** - * A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate. - */ - @Child(name = "effectiveTime", type = {DateTimeType.class, Period.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Start and end time of administration", formalDefinition="A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate." ) - protected Type effectiveTime; - - /** - * The individual who was responsible for giving the medication to the patient. - */ - @Child(name = "practitioner", type = {Practitioner.class, Patient.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who administered substance", formalDefinition="The individual who was responsible for giving the medication to the patient." ) - protected Reference practitioner; - - /** - * The actual object that is the target of the reference (The individual who was responsible for giving the medication to the patient.) - */ - protected Resource practitionerTarget; - - /** - * The original request, instruction or authority to perform the administration. - */ - @Child(name = "prescription", type = {MedicationOrder.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Order administration performed against", formalDefinition="The original request, instruction or authority to perform the administration." ) - protected Reference prescription; - - /** - * The actual object that is the target of the reference (The original request, instruction or authority to perform the administration.) - */ - protected MedicationOrder prescriptionTarget; - - /** - * Set this to true if the record is saying that the medication was NOT administered. - */ - @Child(name = "wasNotGiven", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="True if medication not administered", formalDefinition="Set this to true if the record is saying that the medication was NOT administered." ) - protected BooleanType wasNotGiven; - - /** - * A code indicating why the administration was not performed. - */ - @Child(name = "reasonNotGiven", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reason administration not performed", formalDefinition="A code indicating why the administration was not performed." ) - protected List reasonNotGiven; - - /** - * A code indicating why the medication was given. - */ - @Child(name = "reasonGiven", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reason administration performed", formalDefinition="A code indicating why the medication was given." ) - protected List reasonGiven; - - /** - * The device used in administering the medication to the patient. For example, a particular infusion pump. - */ - @Child(name = "device", type = {Device.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Device used to administer", formalDefinition="The device used in administering the medication to the patient. For example, a particular infusion pump." ) - protected List device; - /** - * The actual objects that are the target of the reference (The device used in administering the medication to the patient. For example, a particular infusion pump.) - */ - protected List deviceTarget; - - - /** - * Extra information about the medication administration that is not conveyed by the other attributes. - */ - @Child(name = "note", type = {Annotation.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Information about the administration", formalDefinition="Extra information about the medication administration that is not conveyed by the other attributes." ) - protected List note; - - /** - * Describes the medication dosage information details e.g. dose, rate, site, route, etc. - */ - @Child(name = "dosage", type = {}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Details of how medication was taken", formalDefinition="Describes the medication dosage information details e.g. dose, rate, site, route, etc." ) - protected MedicationAdministrationDosageComponent dosage; - - private static final long serialVersionUID = 1357790003L; - - /** - * Constructor - */ - public MedicationAdministration() { - super(); - } - - /** - * Constructor - */ - public MedicationAdministration(Enumeration status, Type medication, Reference patient, Type effectiveTime) { - super(); - this.status = status; - this.medication = medication; - this.patient = patient; - this.effectiveTime = effectiveTime; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal identifiers (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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal identifiers (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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationAdministrationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationAdministration setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return 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 MedicationAdministrationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value 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(MedicationAdministrationStatus value) { - if (this.status == null) - this.status = new Enumeration(new MedicationAdministrationStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #medication} (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 Type getMedication() { - return this.medication; - } - - /** - * @return {@link #medication} (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 CodeableConcept getMedicationCodeableConcept() throws FHIRException { - if (!(this.medication instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (CodeableConcept) this.medication; - } - - public boolean hasMedicationCodeableConcept() { - return this.medication instanceof CodeableConcept; - } - - /** - * @return {@link #medication} (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 Reference getMedicationReference() throws FHIRException { - if (!(this.medication instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (Reference) this.medication; - } - - public boolean hasMedicationReference() { - return this.medication instanceof Reference; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (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(Type value) { - this.medication = value; - return this; - } - - /** - * @return {@link #patient} (The person or animal receiving the medication.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person or animal receiving the medication.) - */ - public MedicationAdministration setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or animal receiving the medication.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or animal receiving the medication.) - */ - public MedicationAdministration setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public MedicationAdministration setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.) - */ - public MedicationAdministration setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public Type getEffectiveTime() { - return this.effectiveTime; - } - - /** - * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public DateTimeType getEffectiveTimeDateTimeType() throws FHIRException { - if (!(this.effectiveTime instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (DateTimeType) this.effectiveTime; - } - - public boolean hasEffectiveTimeDateTimeType() { - return this.effectiveTime instanceof DateTimeType; - } - - /** - * @return {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public Period getEffectiveTimePeriod() throws FHIRException { - if (!(this.effectiveTime instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effectiveTime.getClass().getName()+" was encountered"); - return (Period) this.effectiveTime; - } - - public boolean hasEffectiveTimePeriod() { - return this.effectiveTime instanceof Period; - } - - public boolean hasEffectiveTime() { - return this.effectiveTime != null && !this.effectiveTime.isEmpty(); - } - - /** - * @param value {@link #effectiveTime} (A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.) - */ - public MedicationAdministration setEffectiveTime(Type value) { - this.effectiveTime = value; - return this; - } - - /** - * @return {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) - */ - public Reference getPractitioner() { - if (this.practitioner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitioner = new Reference(); // cc - return this.practitioner; - } - - public boolean hasPractitioner() { - return this.practitioner != null && !this.practitioner.isEmpty(); - } - - /** - * @param value {@link #practitioner} (The individual who was responsible for giving the medication to the patient.) - */ - public MedicationAdministration setPractitioner(Reference value) { - this.practitioner = value; - return this; - } - - /** - * @return {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual who was responsible for giving the medication to the patient.) - */ - public Resource getPractitionerTarget() { - return this.practitionerTarget; - } - - /** - * @param value {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual who was responsible for giving the medication to the patient.) - */ - public MedicationAdministration setPractitionerTarget(Resource value) { - this.practitionerTarget = value; - return this; - } - - /** - * @return {@link #prescription} (The original request, instruction or authority to perform the administration.) - */ - public Reference getPrescription() { - if (this.prescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.prescription"); - else if (Configuration.doAutoCreate()) - this.prescription = new Reference(); // cc - return this.prescription; - } - - public boolean hasPrescription() { - return this.prescription != null && !this.prescription.isEmpty(); - } - - /** - * @param value {@link #prescription} (The original request, instruction or authority to perform the administration.) - */ - public MedicationAdministration setPrescription(Reference value) { - this.prescription = value; - return this; - } - - /** - * @return {@link #prescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The original request, instruction or authority to perform the administration.) - */ - public MedicationOrder getPrescriptionTarget() { - if (this.prescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.prescription"); - else if (Configuration.doAutoCreate()) - this.prescriptionTarget = new MedicationOrder(); // aa - return this.prescriptionTarget; - } - - /** - * @param value {@link #prescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The original request, instruction or authority to perform the administration.) - */ - public MedicationAdministration setPrescriptionTarget(MedicationOrder value) { - this.prescriptionTarget = value; - return this; - } - - /** - * @return {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public BooleanType getWasNotGivenElement() { - if (this.wasNotGiven == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.wasNotGiven"); - else if (Configuration.doAutoCreate()) - this.wasNotGiven = new BooleanType(); // bb - return this.wasNotGiven; - } - - public boolean hasWasNotGivenElement() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - public boolean hasWasNotGiven() { - return this.wasNotGiven != null && !this.wasNotGiven.isEmpty(); - } - - /** - * @param value {@link #wasNotGiven} (Set this to true if the record is saying that the medication was NOT administered.). This is the underlying object with id, value and extensions. The accessor "getWasNotGiven" gives direct access to the value - */ - public MedicationAdministration setWasNotGivenElement(BooleanType value) { - this.wasNotGiven = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the medication was NOT administered. - */ - public boolean getWasNotGiven() { - return this.wasNotGiven == null || this.wasNotGiven.isEmpty() ? false : this.wasNotGiven.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the medication was NOT administered. - */ - public MedicationAdministration setWasNotGiven(boolean value) { - if (this.wasNotGiven == null) - this.wasNotGiven = new BooleanType(); - this.wasNotGiven.setValue(value); - return this; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) - */ - public List getReasonNotGiven() { - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - return this.reasonNotGiven; - } - - public boolean hasReasonNotGiven() { - if (this.reasonNotGiven == null) - return false; - for (CodeableConcept item : this.reasonNotGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotGiven} (A code indicating why the administration was not performed.) - */ - // syntactic sugar - public CodeableConcept addReasonNotGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addReasonNotGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotGiven == null) - this.reasonNotGiven = new ArrayList(); - this.reasonNotGiven.add(t); - return this; - } - - /** - * @return {@link #reasonGiven} (A code indicating why the medication was given.) - */ - public List getReasonGiven() { - if (this.reasonGiven == null) - this.reasonGiven = new ArrayList(); - return this.reasonGiven; - } - - public boolean hasReasonGiven() { - if (this.reasonGiven == null) - return false; - for (CodeableConcept item : this.reasonGiven) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonGiven} (A code indicating why the medication was given.) - */ - // syntactic sugar - public CodeableConcept addReasonGiven() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonGiven == null) - this.reasonGiven = new ArrayList(); - this.reasonGiven.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addReasonGiven(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonGiven == null) - this.reasonGiven = new ArrayList(); - this.reasonGiven.add(t); - return this; - } - - /** - * @return {@link #device} (The device used in administering the medication to the patient. For example, a particular infusion pump.) - */ - public List getDevice() { - if (this.device == null) - this.device = new ArrayList(); - return this.device; - } - - public boolean hasDevice() { - if (this.device == null) - return false; - for (Reference item : this.device) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #device} (The device used in administering the medication to the patient. For example, a particular infusion pump.) - */ - // syntactic sugar - public Reference addDevice() { //3 - Reference t = new Reference(); - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addDevice(Reference t) { //3 - if (t == null) - return this; - if (this.device == null) - this.device = new ArrayList(); - this.device.add(t); - return this; - } - - /** - * @return {@link #device} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The device used in administering the medication to the patient. For example, a particular infusion pump.) - */ - public List getDeviceTarget() { - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - return this.deviceTarget; - } - - // syntactic sugar - /** - * @return {@link #device} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The device used in administering the medication to the patient. For example, a particular infusion pump.) - */ - public Device addDeviceTarget() { - Device r = new Device(); - if (this.deviceTarget == null) - this.deviceTarget = new ArrayList(); - this.deviceTarget.add(r); - return r; - } - - /** - * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Extra information about the medication administration that is not conveyed by the other attributes.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public MedicationAdministration addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.) - */ - public MedicationAdministrationDosageComponent getDosage() { - if (this.dosage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationAdministration.dosage"); - else if (Configuration.doAutoCreate()) - this.dosage = new MedicationAdministrationDosageComponent(); // cc - return this.dosage; - } - - public boolean hasDosage() { - return this.dosage != null && !this.dosage.isEmpty(); - } - - /** - * @param value {@link #dosage} (Describes the medication dosage information details e.g. dose, rate, site, route, etc.) - */ - public MedicationAdministration setDosage(MedicationAdministrationDosageComponent value) { - this.dosage = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal identifiers (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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "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.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "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.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal receiving the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The visit, admission or other contact between patient and health care provider the medication administration was performed as part of.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("effectiveTime[x]", "dateTime|Period", "A specific date/time or interval of time during which the administration took place (or did not take place, when the 'notGiven' attribute is true). For many administrations, such as swallowing a tablet the use of dateTime is more appropriate.", 0, java.lang.Integer.MAX_VALUE, effectiveTime)); - childrenList.add(new Property("practitioner", "Reference(Practitioner|Patient|RelatedPerson)", "The individual who was responsible for giving the medication to the patient.", 0, java.lang.Integer.MAX_VALUE, practitioner)); - childrenList.add(new Property("prescription", "Reference(MedicationOrder)", "The original request, instruction or authority to perform the administration.", 0, java.lang.Integer.MAX_VALUE, prescription)); - childrenList.add(new Property("wasNotGiven", "boolean", "Set this to true if the record is saying that the medication was NOT administered.", 0, java.lang.Integer.MAX_VALUE, wasNotGiven)); - childrenList.add(new Property("reasonNotGiven", "CodeableConcept", "A code indicating why the administration was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotGiven)); - childrenList.add(new Property("reasonGiven", "CodeableConcept", "A code indicating why the medication was given.", 0, java.lang.Integer.MAX_VALUE, reasonGiven)); - childrenList.add(new Property("device", "Reference(Device)", "The device used in administering the medication to the patient. For example, a particular infusion pump.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("note", "Annotation", "Extra information about the medication administration that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("dosage", "", "Describes the medication dosage information details e.g. dose, rate, site, route, etc.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -929905388: /*effectiveTime*/ return this.effectiveTime == null ? new Base[0] : new Base[] {this.effectiveTime}; // Type - case 574573338: /*practitioner*/ return this.practitioner == null ? new Base[0] : new Base[] {this.practitioner}; // Reference - case 460301338: /*prescription*/ return this.prescription == null ? new Base[0] : new Base[] {this.prescription}; // Reference - case -1050911117: /*wasNotGiven*/ return this.wasNotGiven == null ? new Base[0] : new Base[] {this.wasNotGiven}; // BooleanType - case 2101123790: /*reasonNotGiven*/ return this.reasonNotGiven == null ? new Base[0] : this.reasonNotGiven.toArray(new Base[this.reasonNotGiven.size()]); // CodeableConcept - case 914964377: /*reasonGiven*/ return this.reasonGiven == null ? new Base[0] : this.reasonGiven.toArray(new Base[this.reasonGiven.size()]); // CodeableConcept - case -1335157162: /*device*/ return this.device == null ? new Base[0] : this.device.toArray(new Base[this.device.size()]); // Reference - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : new Base[] {this.dosage}; // MedicationAdministrationDosageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new MedicationAdministrationStatusEnumFactory().fromType(value); // Enumeration - break; - case 1998965455: // medication - this.medication = (Type) value; // Type - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -929905388: // effectiveTime - this.effectiveTime = (Type) value; // Type - break; - case 574573338: // practitioner - this.practitioner = castToReference(value); // Reference - break; - case 460301338: // prescription - this.prescription = castToReference(value); // Reference - break; - case -1050911117: // wasNotGiven - this.wasNotGiven = castToBoolean(value); // BooleanType - break; - case 2101123790: // reasonNotGiven - this.getReasonNotGiven().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 914964377: // reasonGiven - this.getReasonGiven().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1335157162: // device - this.getDevice().add(castToReference(value)); // Reference - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -1326018889: // dosage - this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new MedicationAdministrationStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("medication[x]")) - this.medication = (Type) value; // Type - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("effectiveTime[x]")) - this.effectiveTime = (Type) value; // Type - else if (name.equals("practitioner")) - this.practitioner = castToReference(value); // Reference - else if (name.equals("prescription")) - this.prescription = castToReference(value); // Reference - else if (name.equals("wasNotGiven")) - this.wasNotGiven = castToBoolean(value); // BooleanType - else if (name.equals("reasonNotGiven")) - this.getReasonNotGiven().add(castToCodeableConcept(value)); - else if (name.equals("reasonGiven")) - this.getReasonGiven().add(castToCodeableConcept(value)); - else if (name.equals("device")) - this.getDevice().add(castToReference(value)); - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("dosage")) - this.dosage = (MedicationAdministrationDosageComponent) value; // MedicationAdministrationDosageComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1458402129: return getMedication(); // Type - case -791418107: return getPatient(); // Reference - case 1524132147: return getEncounter(); // Reference - case -272263444: return getEffectiveTime(); // Type - case 574573338: return getPractitioner(); // Reference - case 460301338: return getPrescription(); // Reference - case -1050911117: throw new FHIRException("Cannot make property wasNotGiven as it is not a complex type"); // BooleanType - case 2101123790: return addReasonNotGiven(); // CodeableConcept - case 914964377: return addReasonGiven(); // CodeableConcept - case -1335157162: return addDevice(); // Reference - case 3387378: return addNote(); // Annotation - case -1326018889: return getDosage(); // MedicationAdministrationDosageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.status"); - } - else if (name.equals("medicationCodeableConcept")) { - this.medication = new CodeableConcept(); - return this.medication; - } - else if (name.equals("medicationReference")) { - this.medication = new Reference(); - return this.medication; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("effectiveTimeDateTime")) { - this.effectiveTime = new DateTimeType(); - return this.effectiveTime; - } - else if (name.equals("effectiveTimePeriod")) { - this.effectiveTime = new Period(); - return this.effectiveTime; - } - else if (name.equals("practitioner")) { - this.practitioner = new Reference(); - return this.practitioner; - } - else if (name.equals("prescription")) { - this.prescription = new Reference(); - return this.prescription; - } - else if (name.equals("wasNotGiven")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationAdministration.wasNotGiven"); - } - else if (name.equals("reasonNotGiven")) { - return addReasonNotGiven(); - } - else if (name.equals("reasonGiven")) { - return addReasonGiven(); - } - else if (name.equals("device")) { - return addDevice(); - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("dosage")) { - this.dosage = new MedicationAdministrationDosageComponent(); - return this.dosage; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "MedicationAdministration"; - - } - - public MedicationAdministration copy() { - MedicationAdministration dst = new MedicationAdministration(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.medication = medication == null ? null : medication.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.effectiveTime = effectiveTime == null ? null : effectiveTime.copy(); - dst.practitioner = practitioner == null ? null : practitioner.copy(); - dst.prescription = prescription == null ? null : prescription.copy(); - dst.wasNotGiven = wasNotGiven == null ? null : wasNotGiven.copy(); - if (reasonNotGiven != null) { - dst.reasonNotGiven = new ArrayList(); - for (CodeableConcept i : reasonNotGiven) - dst.reasonNotGiven.add(i.copy()); - }; - if (reasonGiven != null) { - dst.reasonGiven = new ArrayList(); - for (CodeableConcept i : reasonGiven) - dst.reasonGiven.add(i.copy()); - }; - if (device != null) { - dst.device = new ArrayList(); - for (Reference i : device) - dst.device.add(i.copy()); - }; - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - dst.dosage = dosage == null ? null : dosage.copy(); - return dst; - } - - protected MedicationAdministration typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationAdministration)) - return false; - MedicationAdministration o = (MedicationAdministration) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) - && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(effectiveTime, o.effectiveTime, true) - && compareDeep(practitioner, o.practitioner, true) && compareDeep(prescription, o.prescription, true) - && compareDeep(wasNotGiven, o.wasNotGiven, true) && compareDeep(reasonNotGiven, o.reasonNotGiven, true) - && compareDeep(reasonGiven, o.reasonGiven, true) && compareDeep(device, o.device, true) && compareDeep(note, o.note, true) - && compareDeep(dosage, o.dosage, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationAdministration)) - return false; - MedicationAdministration o = (MedicationAdministration) other; - return compareValues(status, o.status, true) && compareValues(wasNotGiven, o.wasNotGiven, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (effectiveTime == null || effectiveTime.isEmpty()) - && (practitioner == null || practitioner.isEmpty()) && (prescription == null || prescription.isEmpty()) - && (wasNotGiven == null || wasNotGiven.isEmpty()) && (reasonNotGiven == null || reasonNotGiven.isEmpty()) - && (reasonGiven == null || reasonGiven.isEmpty()) && (device == null || device.isEmpty()) - && (note == null || note.isEmpty()) && (dosage == null || dosage.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationAdministration; - } - - /** - * Search parameter: medication - *

- * Description: Return administrations of this medication resource
- * Type: reference
- * Path: MedicationAdministration.medicationReference
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationAdministration.medication.as(Reference)", description="Return administrations of this medication resource", type="reference" ) - public static final String SP_MEDICATION = "medication"; - /** - * Fluent Client search parameter constant for medication - *

- * Description: Return administrations of this medication resource
- * Type: reference
- * Path: MedicationAdministration.medicationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration:medication". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationAdministration:medication").toLocked(); - - /** - * Search parameter: effectivetime - *

- * Description: Date administration happened (or did not happen)
- * Type: date
- * Path: MedicationAdministration.effectiveTime[x]
- *

- */ - @SearchParamDefinition(name="effectivetime", path="MedicationAdministration.effectiveTime", description="Date administration happened (or did not happen)", type="date" ) - public static final String SP_EFFECTIVETIME = "effectivetime"; - /** - * Fluent Client search parameter constant for effectivetime - *

- * Description: Date administration happened (or did not happen)
- * Type: date
- * Path: MedicationAdministration.effectiveTime[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVETIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVETIME); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationAdministration:patient").toLocked(); - - /** - * Search parameter: practitioner - *

- * Description: Who administered substance
- * Type: reference
- * Path: MedicationAdministration.practitioner
- *

- */ - @SearchParamDefinition(name="practitioner", path="MedicationAdministration.practitioner", description="Who administered substance", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - /** - * Fluent Client search parameter constant for practitioner - *

- * Description: Who administered substance
- * Type: reference
- * Path: MedicationAdministration.practitioner
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration:practitioner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:practitioner").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIPTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIPTION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration:prescription". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIPTION = new ca.uhn.fhir.model.api.Include("MedicationAdministration:prescription").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration:device". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("MedicationAdministration:device").toLocked(); - - /** - * Search parameter: code - *

- * Description: Return administrations of this medication code
- * Type: token
- * Path: MedicationAdministration.medicationCodeableConcept
- *

- */ - @SearchParamDefinition(name="code", path="MedicationAdministration.medication.as(CodeableConcept)", description="Return administrations of this medication code", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Return administrations of this medication code
- * Type: token
- * Path: MedicationAdministration.medicationCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationAdministration:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationAdministration:encounter").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Return administrations with this external identifier
- * Type: token
- * Path: MedicationAdministration.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationAdministration.identifier", description="Return administrations with this external identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return administrations with this external identifier
- * Type: token
- * Path: MedicationAdministration.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: wasnotgiven - *

- * Description: Administrations that were not made
- * Type: token
- * Path: MedicationAdministration.wasNotGiven
- *

- */ - @SearchParamDefinition(name="wasnotgiven", path="MedicationAdministration.wasNotGiven", description="Administrations that were not made", type="token" ) - public static final String SP_WASNOTGIVEN = "wasnotgiven"; - /** - * Fluent Client search parameter constant for wasnotgiven - *

- * Description: Administrations that were not made
- * Type: token
- * Path: MedicationAdministration.wasNotGiven
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam WASNOTGIVEN = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_WASNOTGIVEN); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationDispense.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationDispense.java deleted file mode 100644 index 59fcec37eea..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationDispense.java +++ /dev/null @@ -1,2561 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order. - */ -@ResourceDef(name="MedicationDispense", profile="http://hl7.org/fhir/Profile/MedicationDispense") -public class MedicationDispense extends DomainResource { - - public enum MedicationDispenseStatus { - /** - * The dispense has started but has not yet completed. - */ - INPROGRESS, - /** - * Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called "suspended" - */ - ONHOLD, - /** - * All actions that are implied by the dispense have occurred. - */ - COMPLETED, - /** - * The dispense was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * Actions implied by the dispense have been permanently halted, before all of them occurred. - */ - STOPPED, - /** - * added to help the parsers - */ - NULL; - public static MedicationDispenseStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - throw new FHIRException("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case STOPPED: return "stopped"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/medication-dispense-status"; - case ONHOLD: return "http://hl7.org/fhir/medication-dispense-status"; - case COMPLETED: return "http://hl7.org/fhir/medication-dispense-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/medication-dispense-status"; - case STOPPED: return "http://hl7.org/fhir/medication-dispense-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The dispense has started but has not yet completed."; - case ONHOLD: return "Actions implied by the administration have been temporarily halted, but are expected to continue later. May also be called \"suspended\""; - case COMPLETED: return "All actions that are implied by the dispense have occurred."; - case ENTEREDINERROR: return "The dispense was entered in error and therefore nullified."; - case STOPPED: return "Actions implied by the dispense have been permanently halted, before all of them occurred."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in-Error"; - case STOPPED: return "Stopped"; - default: return "?"; - } - } - } - - public static class MedicationDispenseStatusEnumFactory implements EnumFactory { - public MedicationDispenseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return MedicationDispenseStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return MedicationDispenseStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationDispenseStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationDispenseStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationDispenseStatus.STOPPED; - throw new IllegalArgumentException("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, MedicationDispenseStatus.INPROGRESS); - if ("on-hold".equals(codeString)) - return new Enumeration(this, MedicationDispenseStatus.ONHOLD); - if ("completed".equals(codeString)) - return new Enumeration(this, MedicationDispenseStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, MedicationDispenseStatus.ENTEREDINERROR); - if ("stopped".equals(codeString)) - return new Enumeration(this, MedicationDispenseStatus.STOPPED); - throw new FHIRException("Unknown MedicationDispenseStatus code '"+codeString+"'"); - } - public String toCode(MedicationDispenseStatus code) { - if (code == MedicationDispenseStatus.INPROGRESS) - return "in-progress"; - if (code == MedicationDispenseStatus.ONHOLD) - return "on-hold"; - if (code == MedicationDispenseStatus.COMPLETED) - return "completed"; - if (code == MedicationDispenseStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationDispenseStatus.STOPPED) - return "stopped"; - return "?"; - } - public String toSystem(MedicationDispenseStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class MedicationDispenseDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication." ) - protected StringType text; - - /** - * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. - */ - @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="E.g. \"Take with food\"", formalDefinition="Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded." ) - protected CodeableConcept additionalInstructions; - - /** - * 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". - */ - @Child(name = "timing", type = {Timing.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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\"." ) - protected Timing timing; - - /** - * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Take \"as needed\" f(or x)", formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected Type site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Technique for administering medication", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name = "dose", type = {Range.class, SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Type dose; - - /** - * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. - */ - @Child(name = "rate", type = {Ratio.class, Range.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) - protected Type rate; - - /** - * 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. - */ - @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -1470136646L; - - /** - * Constructor - */ - public MedicationDispenseDosageInstructionComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationDispenseDosageInstructionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. - */ - public MedicationDispenseDosageInstructionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public CodeableConcept getAdditionalInstructions() { - if (this.additionalInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.additionalInstructions"); - else if (Configuration.doAutoCreate()) - this.additionalInstructions = new CodeableConcept(); // cc - return this.additionalInstructions; - } - - public boolean hasAdditionalInstructions() { - return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); - } - - /** - * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public MedicationDispenseDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { - this.additionalInstructions = value; - return this; - } - - /** - * @return {@link #timing} (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 Timing getTiming() { - if (this.timing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.timing"); - else if (Configuration.doAutoCreate()) - this.timing = new Timing(); // cc - return this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (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 MedicationDispenseDosageInstructionComponent setTiming(Timing value) { - this.timing = value; - return this; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public BooleanType getAsNeededBooleanType() throws FHIRException { - if (!(this.asNeeded instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - public boolean hasAsNeededBooleanType() { - return this.asNeeded instanceof BooleanType; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeededCodeableConcept() { - return this.asNeeded instanceof CodeableConcept; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public MedicationDispenseDosageInstructionComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSiteCodeableConcept() throws FHIRException { - if (!(this.site instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - public boolean hasSiteCodeableConcept() { - return this.site instanceof CodeableConcept; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public Reference getSiteReference() throws FHIRException { - if (!(this.site instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSiteReference() { - return this.site instanceof Reference; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationDispenseDosageInstructionComponent setSite(Type value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public MedicationDispenseDosageInstructionComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.) - */ - public MedicationDispenseDosageInstructionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Type getDose() { - return this.dose; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Range getDoseRange() throws FHIRException { - if (!(this.dose instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (Range) this.dose; - } - - public boolean hasDoseRange() { - return this.dose instanceof Range; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public SimpleQuantity getDoseSimpleQuantity() throws FHIRException { - if (!(this.dose instanceof SimpleQuantity)) - throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (SimpleQuantity) this.dose; - } - - public boolean hasDoseSimpleQuantity() { - return this.dose instanceof SimpleQuantity; - } - - public boolean hasDose() { - return this.dose != null && !this.dose.isEmpty(); - } - - /** - * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationDispenseDosageInstructionComponent setDose(Type value) { - this.dose = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Type getRate() { - return this.rate; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Ratio getRateRatio() throws FHIRException { - if (!(this.rate instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Ratio) this.rate; - } - - public boolean hasRateRatio() { - return this.rate instanceof Ratio; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Range getRateRange() throws FHIRException { - if (!(this.rate instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Range) this.rate; - } - - public boolean hasRateRange() { - return this.rate instanceof Range; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public MedicationDispenseDosageInstructionComponent setRate(Type value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (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 Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseDosageInstructionComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); // cc - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (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 MedicationDispenseDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); - childrenList.add(new Property("timing", "Timing", "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\".", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("dose[x]", "Range|SimpleQuantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); - childrenList.add(new Property("rate[x]", "Ratio|Range", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "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.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -1206718612: /*additionalInstructions*/ return this.additionalInstructions == null ? new Base[0] : new Base[] {this.additionalInstructions}; // CodeableConcept - case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing - case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type - case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // Type - case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type - case 1506263709: /*maxDosePerPeriod*/ return this.maxDosePerPeriod == null ? new Base[0] : new Base[] {this.maxDosePerPeriod}; // Ratio - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3556653: // text - this.text = castToString(value); // StringType - break; - case -1206718612: // additionalInstructions - this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept - break; - case -873664438: // timing - this.timing = castToTiming(value); // Timing - break; - case -1432923513: // asNeeded - this.asNeeded = (Type) value; // Type - break; - case 3530567: // site - this.site = (Type) value; // Type - break; - case 108704329: // route - this.route = castToCodeableConcept(value); // CodeableConcept - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case 3089437: // dose - this.dose = (Type) value; // Type - break; - case 3493088: // rate - this.rate = (Type) value; // Type - break; - case 1506263709: // maxDosePerPeriod - this.maxDosePerPeriod = castToRatio(value); // Ratio - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("additionalInstructions")) - this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("timing")) - this.timing = castToTiming(value); // Timing - else if (name.equals("asNeeded[x]")) - this.asNeeded = (Type) value; // Type - else if (name.equals("site[x]")) - this.site = (Type) value; // Type - else if (name.equals("route")) - this.route = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("dose[x]")) - this.dose = (Type) value; // Type - else if (name.equals("rate[x]")) - this.rate = (Type) value; // Type - else if (name.equals("maxDosePerPeriod")) - this.maxDosePerPeriod = castToRatio(value); // Ratio - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -1206718612: return getAdditionalInstructions(); // CodeableConcept - case -873664438: return getTiming(); // Timing - case -544329575: return getAsNeeded(); // Type - case 2099997657: return getSite(); // Type - case 108704329: return getRoute(); // CodeableConcept - case -1077554975: return getMethod(); // CodeableConcept - case 1843195715: return getDose(); // Type - case 983460768: return getRate(); // Type - case 1506263709: return getMaxDosePerPeriod(); // Ratio - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.text"); - } - else if (name.equals("additionalInstructions")) { - this.additionalInstructions = new CodeableConcept(); - return this.additionalInstructions; - } - else if (name.equals("timing")) { - this.timing = new Timing(); - return this.timing; - } - else if (name.equals("asNeededBoolean")) { - this.asNeeded = new BooleanType(); - return this.asNeeded; - } - else if (name.equals("asNeededCodeableConcept")) { - this.asNeeded = new CodeableConcept(); - return this.asNeeded; - } - else if (name.equals("siteCodeableConcept")) { - this.site = new CodeableConcept(); - return this.site; - } - else if (name.equals("siteReference")) { - this.site = new Reference(); - return this.site; - } - else if (name.equals("route")) { - this.route = new CodeableConcept(); - return this.route; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("doseRange")) { - this.dose = new Range(); - return this.dose; - } - else if (name.equals("doseSimpleQuantity")) { - this.dose = new SimpleQuantity(); - return this.dose; - } - else if (name.equals("rateRatio")) { - this.rate = new Ratio(); - return this.rate; - } - else if (name.equals("rateRange")) { - this.rate = new Range(); - return this.rate; - } - else if (name.equals("maxDosePerPeriod")) { - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - else - return super.addChild(name); - } - - public MedicationDispenseDosageInstructionComponent copy() { - MedicationDispenseDosageInstructionComponent dst = new MedicationDispenseDosageInstructionComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.dose = dose == null ? null : dose.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationDispenseDosageInstructionComponent)) - return false; - MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; - return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) - && compareDeep(timing, o.timing, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) - && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) - && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationDispenseDosageInstructionComponent)) - return false; - MedicationDispenseDosageInstructionComponent o = (MedicationDispenseDosageInstructionComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) - && (timing == null || timing.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (dose == null || dose.isEmpty()) - && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - public String fhirType() { - return "MedicationDispense.dosageInstruction"; - - } - - } - - @Block() - public static class MedicationDispenseSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code signifying whether a different drug was dispensed from what was prescribed. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Code signifying whether a different drug was dispensed from what was prescribed", formalDefinition="A code signifying whether a different drug was dispensed from what was prescribed." ) - protected CodeableConcept type; - - /** - * Indicates the reason for the substitution of (or lack of substitution) from what was prescribed. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Why was substitution made", formalDefinition="Indicates the reason for the substitution of (or lack of substitution) from what was prescribed." ) - protected List reason; - - /** - * The person or organization that has primary responsibility for the substitution. - */ - @Child(name = "responsibleParty", type = {Practitioner.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who is responsible for the substitution", formalDefinition="The person or organization that has primary responsibility for the substitution." ) - protected List responsibleParty; - /** - * The actual objects that are the target of the reference (The person or organization that has primary responsibility for the substitution.) - */ - protected List responsiblePartyTarget; - - - private static final long serialVersionUID = 1218245830L; - - /** - * Constructor - */ - public MedicationDispenseSubstitutionComponent() { - super(); - } - - /** - * Constructor - */ - public MedicationDispenseSubstitutionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispenseSubstitutionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code signifying whether a different drug was dispensed from what was prescribed.) - */ - public MedicationDispenseSubstitutionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (CodeableConcept item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.) - */ - // syntactic sugar - public CodeableConcept addReason() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public MedicationDispenseSubstitutionComponent addReason(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) - */ - public List getResponsibleParty() { - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - return this.responsibleParty; - } - - public boolean hasResponsibleParty() { - if (this.responsibleParty == null) - return false; - for (Reference item : this.responsibleParty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #responsibleParty} (The person or organization that has primary responsibility for the substitution.) - */ - // syntactic sugar - public Reference addResponsibleParty() { //3 - Reference t = new Reference(); - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - this.responsibleParty.add(t); - return t; - } - - // syntactic sugar - public MedicationDispenseSubstitutionComponent addResponsibleParty(Reference t) { //3 - if (t == null) - return this; - if (this.responsibleParty == null) - this.responsibleParty = new ArrayList(); - this.responsibleParty.add(t); - return this; - } - - /** - * @return {@link #responsibleParty} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The person or organization that has primary responsibility for the substitution.) - */ - public List getResponsiblePartyTarget() { - if (this.responsiblePartyTarget == null) - this.responsiblePartyTarget = new ArrayList(); - return this.responsiblePartyTarget; - } - - // syntactic sugar - /** - * @return {@link #responsibleParty} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The person or organization that has primary responsibility for the substitution.) - */ - public Practitioner addResponsiblePartyTarget() { - Practitioner r = new Practitioner(); - if (this.responsiblePartyTarget == null) - this.responsiblePartyTarget = new ArrayList(); - this.responsiblePartyTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug was dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution of (or lack of substitution) from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("responsibleParty", "Reference(Practitioner)", "The person or organization that has primary responsibility for the substitution.", 0, java.lang.Integer.MAX_VALUE, responsibleParty)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // CodeableConcept - case 1511509392: /*responsibleParty*/ return this.responsibleParty == null ? new Base[0] : this.responsibleParty.toArray(new Base[this.responsibleParty.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -934964668: // reason - this.getReason().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1511509392: // responsibleParty - this.getResponsibleParty().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("reason")) - this.getReason().add(castToCodeableConcept(value)); - else if (name.equals("responsibleParty")) - this.getResponsibleParty().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -934964668: return addReason(); // CodeableConcept - case 1511509392: return addResponsibleParty(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("responsibleParty")) { - return addResponsibleParty(); - } - else - return super.addChild(name); - } - - public MedicationDispenseSubstitutionComponent copy() { - MedicationDispenseSubstitutionComponent dst = new MedicationDispenseSubstitutionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (CodeableConcept i : reason) - dst.reason.add(i.copy()); - }; - if (responsibleParty != null) { - dst.responsibleParty = new ArrayList(); - for (Reference i : responsibleParty) - dst.responsibleParty.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationDispenseSubstitutionComponent)) - return false; - MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; - return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true) && compareDeep(responsibleParty, o.responsibleParty, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationDispenseSubstitutionComponent)) - return false; - MedicationDispenseSubstitutionComponent o = (MedicationDispenseSubstitutionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - && (responsibleParty == null || responsibleParty.isEmpty()); - } - - public String fhirType() { - return "MedicationDispense.substitution"; - - } - - } - - /** - * Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR." ) - protected Identifier identifier; - - /** - * A code specifying the state of the set of dispense events. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | on-hold | completed | entered-in-error | stopped", formalDefinition="A code specifying the state of the set of dispense events." ) - protected Enumeration status; - - /** - * 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. - */ - @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) - @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." ) - protected Type medication; - - /** - * A link to a resource representing the person to whom the medication will be given. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who the dispense is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) - */ - protected Patient patientTarget; - - /** - * The individual responsible for dispensing the medication. - */ - @Child(name = "dispenser", type = {Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Practitioner responsible for dispensing medication", formalDefinition="The individual responsible for dispensing the medication." ) - protected Reference dispenser; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication.) - */ - protected Practitioner dispenserTarget; - - /** - * Indicates the medication order that is being dispensed against. - */ - @Child(name = "authorizingPrescription", type = {MedicationOrder.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Medication order that authorizes the dispense", formalDefinition="Indicates the medication order that is being dispensed against." ) - protected List authorizingPrescription; - /** - * The actual objects that are the target of the reference (Indicates the medication order that is being dispensed against.) - */ - protected List authorizingPrescriptionTarget; - - - /** - * Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Trial fill, partial fill, emergency fill, etc.", formalDefinition="Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc." ) - protected CodeableConcept type; - - /** - * The amount of medication that has been dispensed. Includes unit of measure. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of medication that has been dispensed. Includes unit of measure." ) - protected SimpleQuantity quantity; - - /** - * The amount of medication expressed as a timing amount. - */ - @Child(name = "daysSupply", type = {SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of medication expressed as a timing amount", formalDefinition="The amount of medication expressed as a timing amount." ) - protected SimpleQuantity daysSupply; - - /** - * The time when the dispensed product was packaged and reviewed. - */ - @Child(name = "whenPrepared", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Dispense processing time", formalDefinition="The time when the dispensed product was packaged and reviewed." ) - protected DateTimeType whenPrepared; - - /** - * The time the dispensed product was provided to the patient or their representative. - */ - @Child(name = "whenHandedOver", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When product was given out", formalDefinition="The time the dispensed product was provided to the patient or their representative." ) - protected DateTimeType whenHandedOver; - - /** - * Identification of the facility/location where the medication was shipped to, as part of the dispense event. - */ - @Child(name = "destination", type = {Location.class}, order=11, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional. - */ - @Child(name = "receiver", type = {Patient.class, Practitioner.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who collected the medication", formalDefinition="Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) - */ - protected List receiverTarget; - - - /** - * Extra information about the dispense that could not be conveyed in the other attributes. - */ - @Child(name = "note", type = {Annotation.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Information about the dispense", formalDefinition="Extra information about the dispense that could not be conveyed in the other attributes." ) - protected List note; - - /** - * Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed. - */ - @Child(name = "dosageInstruction", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Medicine administration instructions to the patient/caregiver", formalDefinition="Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed." ) - protected List dosageInstruction; - - /** - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why. - */ - @Child(name = "substitution", type = {}, order=15, min=0, max=1, modifier=false, summary=true) - @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 does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why." ) - protected MedicationDispenseSubstitutionComponent substitution; - - private static final long serialVersionUID = -634238241L; - - /** - * Constructor - */ - public MedicationDispense() { - super(); - } - - /** - * Constructor - */ - public MedicationDispense(Type medication) { - super(); - this.medication = medication; - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.) - */ - public MedicationDispense setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the set of dispense events.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationDispense setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the set of dispense events. - */ - public MedicationDispenseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the set of dispense events. - */ - public MedicationDispense setStatus(MedicationDispenseStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new MedicationDispenseStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #medication} (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 Type getMedication() { - return this.medication; - } - - /** - * @return {@link #medication} (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 CodeableConcept getMedicationCodeableConcept() throws FHIRException { - if (!(this.medication instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (CodeableConcept) this.medication; - } - - public boolean hasMedicationCodeableConcept() { - return this.medication instanceof CodeableConcept; - } - - /** - * @return {@link #medication} (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 Reference getMedicationReference() throws FHIRException { - if (!(this.medication instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (Reference) this.medication; - } - - public boolean hasMedicationReference() { - return this.medication instanceof Reference; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (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 MedicationDispense setMedication(Type value) { - this.medication = value; - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationDispense setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationDispense setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #dispenser} (The individual responsible for dispensing the medication.) - */ - public Reference getDispenser() { - if (this.dispenser == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.dispenser"); - else if (Configuration.doAutoCreate()) - this.dispenser = new Reference(); // cc - return this.dispenser; - } - - public boolean hasDispenser() { - return this.dispenser != null && !this.dispenser.isEmpty(); - } - - /** - * @param value {@link #dispenser} (The individual responsible for dispensing the medication.) - */ - public MedicationDispense setDispenser(Reference value) { - this.dispenser = value; - return this; - } - - /** - * @return {@link #dispenser} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication.) - */ - public Practitioner getDispenserTarget() { - if (this.dispenserTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.dispenser"); - else if (Configuration.doAutoCreate()) - this.dispenserTarget = new Practitioner(); // aa - return this.dispenserTarget; - } - - /** - * @param value {@link #dispenser} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication.) - */ - public MedicationDispense setDispenserTarget(Practitioner value) { - this.dispenserTarget = value; - return this; - } - - /** - * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) - */ - public List getAuthorizingPrescription() { - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - return this.authorizingPrescription; - } - - public boolean hasAuthorizingPrescription() { - if (this.authorizingPrescription == null) - return false; - for (Reference item : this.authorizingPrescription) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #authorizingPrescription} (Indicates the medication order that is being dispensed against.) - */ - // syntactic sugar - public Reference addAuthorizingPrescription() { //3 - Reference t = new Reference(); - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - this.authorizingPrescription.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addAuthorizingPrescription(Reference t) { //3 - if (t == null) - return this; - if (this.authorizingPrescription == null) - this.authorizingPrescription = new ArrayList(); - this.authorizingPrescription.add(t); - return this; - } - - /** - * @return {@link #authorizingPrescription} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the medication order that is being dispensed against.) - */ - public List getAuthorizingPrescriptionTarget() { - if (this.authorizingPrescriptionTarget == null) - this.authorizingPrescriptionTarget = new ArrayList(); - return this.authorizingPrescriptionTarget; - } - - // syntactic sugar - /** - * @return {@link #authorizingPrescription} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Indicates the medication order that is being dispensed against.) - */ - public MedicationOrder addAuthorizingPrescriptionTarget() { - MedicationOrder r = new MedicationOrder(); - if (this.authorizingPrescriptionTarget == null) - this.authorizingPrescriptionTarget = new ArrayList(); - this.authorizingPrescriptionTarget.add(r); - return r; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public MedicationDispense setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of medication that has been dispensed. Includes unit of measure.) - */ - public MedicationDispense setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #daysSupply} (The amount of medication expressed as a timing amount.) - */ - public SimpleQuantity getDaysSupply() { - if (this.daysSupply == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.daysSupply"); - else if (Configuration.doAutoCreate()) - this.daysSupply = new SimpleQuantity(); // cc - return this.daysSupply; - } - - public boolean hasDaysSupply() { - return this.daysSupply != null && !this.daysSupply.isEmpty(); - } - - /** - * @param value {@link #daysSupply} (The amount of medication expressed as a timing amount.) - */ - public MedicationDispense setDaysSupply(SimpleQuantity value) { - this.daysSupply = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value - */ - public DateTimeType getWhenPreparedElement() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new DateTimeType(); // bb - return this.whenPrepared; - } - - public boolean hasWhenPreparedElement() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time when the dispensed product was packaged and reviewed.). This is the underlying object with id, value and extensions. The accessor "getWhenPrepared" gives direct access to the value - */ - public MedicationDispense setWhenPreparedElement(DateTimeType value) { - this.whenPrepared = value; - return this; - } - - /** - * @return The time when the dispensed product was packaged and reviewed. - */ - public Date getWhenPrepared() { - return this.whenPrepared == null ? null : this.whenPrepared.getValue(); - } - - /** - * @param value The time when the dispensed product was packaged and reviewed. - */ - public MedicationDispense setWhenPrepared(Date value) { - if (value == null) - this.whenPrepared = null; - else { - if (this.whenPrepared == null) - this.whenPrepared = new DateTimeType(); - this.whenPrepared.setValue(value); - } - return this; - } - - /** - * @return {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public DateTimeType getWhenHandedOverElement() { - if (this.whenHandedOver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.whenHandedOver"); - else if (Configuration.doAutoCreate()) - this.whenHandedOver = new DateTimeType(); // bb - return this.whenHandedOver; - } - - public boolean hasWhenHandedOverElement() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - public boolean hasWhenHandedOver() { - return this.whenHandedOver != null && !this.whenHandedOver.isEmpty(); - } - - /** - * @param value {@link #whenHandedOver} (The time the dispensed product was provided to the patient or their representative.). This is the underlying object with id, value and extensions. The accessor "getWhenHandedOver" gives direct access to the value - */ - public MedicationDispense setWhenHandedOverElement(DateTimeType value) { - this.whenHandedOver = value; - return this; - } - - /** - * @return The time the dispensed product was provided to the patient or their representative. - */ - public Date getWhenHandedOver() { - return this.whenHandedOver == null ? null : this.whenHandedOver.getValue(); - } - - /** - * @param value The time the dispensed product was provided to the patient or their representative. - */ - public MedicationDispense setWhenHandedOver(Date value) { - if (value == null) - this.whenHandedOver = null; - else { - if (this.whenHandedOver == null) - this.whenHandedOver = new DateTimeType(); - this.whenHandedOver.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public MedicationDispense setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the medication was shipped to, as part of the dispense event.) - */ - public MedicationDispense setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addReceiver(Reference t) { //3 - if (t == null) - return this; - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return this; - } - - /** - * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - /** - * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Extra information about the dispense that could not be conveyed in the other attributes.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed.) - */ - public List getDosageInstruction() { - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - return this.dosageInstruction; - } - - public boolean hasDosageInstruction() { - if (this.dosageInstruction == null) - return false; - for (MedicationDispenseDosageInstructionComponent item : this.dosageInstruction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed.) - */ - // syntactic sugar - public MedicationDispenseDosageInstructionComponent addDosageInstruction() { //3 - MedicationDispenseDosageInstructionComponent t = new MedicationDispenseDosageInstructionComponent(); - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return t; - } - - // syntactic sugar - public MedicationDispense addDosageInstruction(MedicationDispenseDosageInstructionComponent t) { //3 - if (t == null) - return this; - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return this; - } - - /** - * @return {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why.) - */ - public MedicationDispenseSubstitutionComponent getSubstitution() { - if (this.substitution == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationDispense.substitution"); - else if (Configuration.doAutoCreate()) - this.substitution = new MedicationDispenseSubstitutionComponent(); // cc - return this.substitution; - } - - public boolean hasSubstitution() { - return this.substitution != null && !this.substitution.isEmpty(); - } - - /** - * @param value {@link #substitution} (Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why.) - */ - public MedicationDispense setSubstitution(MedicationDispenseSubstitutionComponent value) { - this.substitution = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility - this is an identifier assigned outside FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the set of dispense events.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "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.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("dispenser", "Reference(Practitioner)", "The individual responsible for dispensing the medication.", 0, java.lang.Integer.MAX_VALUE, dispenser)); - childrenList.add(new Property("authorizingPrescription", "Reference(MedicationOrder)", "Indicates the medication order that is being dispensed against.", 0, java.lang.Integer.MAX_VALUE, authorizingPrescription)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. For example, Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of medication that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("daysSupply", "SimpleQuantity", "The amount of medication expressed as a timing amount.", 0, java.lang.Integer.MAX_VALUE, daysSupply)); - childrenList.add(new Property("whenPrepared", "dateTime", "The time when the dispensed product was packaged and reviewed.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("whenHandedOver", "dateTime", "The time the dispensed product was provided to the patient or their representative.", 0, java.lang.Integer.MAX_VALUE, whenHandedOver)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the medication was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Patient|Practitioner)", "Identifies the person who picked up the medication. This will usually be a patient or their caregiver, but some cases exist where it can be a healthcare professional.", 0, java.lang.Integer.MAX_VALUE, receiver)); - childrenList.add(new Property("note", "Annotation", "Extra information about the dispense that could not be conveyed in the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient. The pharmacist reviews the medication order prior to dispense and updates the dosageInstruction based on the actual product being dispensed.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); - childrenList.add(new Property("substitution", "", "Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did or did not happen and why.", 0, java.lang.Integer.MAX_VALUE, substitution)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 241511093: /*dispenser*/ return this.dispenser == null ? new Base[0] : new Base[] {this.dispenser}; // Reference - case -1237557856: /*authorizingPrescription*/ return this.authorizingPrescription == null ? new Base[0] : this.authorizingPrescription.toArray(new Base[this.authorizingPrescription.size()]); // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case 197175334: /*daysSupply*/ return this.daysSupply == null ? new Base[0] : new Base[] {this.daysSupply}; // SimpleQuantity - case -562837097: /*whenPrepared*/ return this.whenPrepared == null ? new Base[0] : new Base[] {this.whenPrepared}; // DateTimeType - case -940241380: /*whenHandedOver*/ return this.whenHandedOver == null ? new Base[0] : new Base[] {this.whenHandedOver}; // DateTimeType - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference - case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : this.receiver.toArray(new Base[this.receiver.size()]); // Reference - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -1201373865: /*dosageInstruction*/ return this.dosageInstruction == null ? new Base[0] : this.dosageInstruction.toArray(new Base[this.dosageInstruction.size()]); // MedicationDispenseDosageInstructionComponent - case 826147581: /*substitution*/ return this.substitution == null ? new Base[0] : new Base[] {this.substitution}; // MedicationDispenseSubstitutionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -892481550: // status - this.status = new MedicationDispenseStatusEnumFactory().fromType(value); // Enumeration - break; - case 1998965455: // medication - this.medication = (Type) value; // Type - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 241511093: // dispenser - this.dispenser = castToReference(value); // Reference - break; - case -1237557856: // authorizingPrescription - this.getAuthorizingPrescription().add(castToReference(value)); // Reference - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 197175334: // daysSupply - this.daysSupply = castToSimpleQuantity(value); // SimpleQuantity - break; - case -562837097: // whenPrepared - this.whenPrepared = castToDateTime(value); // DateTimeType - break; - case -940241380: // whenHandedOver - this.whenHandedOver = castToDateTime(value); // DateTimeType - break; - case -1429847026: // destination - this.destination = castToReference(value); // Reference - break; - case -808719889: // receiver - this.getReceiver().add(castToReference(value)); // Reference - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -1201373865: // dosageInstruction - this.getDosageInstruction().add((MedicationDispenseDosageInstructionComponent) value); // MedicationDispenseDosageInstructionComponent - break; - case 826147581: // substitution - this.substitution = (MedicationDispenseSubstitutionComponent) value; // MedicationDispenseSubstitutionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("status")) - this.status = new MedicationDispenseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("medication[x]")) - this.medication = (Type) value; // Type - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("dispenser")) - this.dispenser = castToReference(value); // Reference - else if (name.equals("authorizingPrescription")) - this.getAuthorizingPrescription().add(castToReference(value)); - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("daysSupply")) - this.daysSupply = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("whenPrepared")) - this.whenPrepared = castToDateTime(value); // DateTimeType - else if (name.equals("whenHandedOver")) - this.whenHandedOver = castToDateTime(value); // DateTimeType - else if (name.equals("destination")) - this.destination = castToReference(value); // Reference - else if (name.equals("receiver")) - this.getReceiver().add(castToReference(value)); - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("dosageInstruction")) - this.getDosageInstruction().add((MedicationDispenseDosageInstructionComponent) value); - else if (name.equals("substitution")) - this.substitution = (MedicationDispenseSubstitutionComponent) value; // MedicationDispenseSubstitutionComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1458402129: return getMedication(); // Type - case -791418107: return getPatient(); // Reference - case 241511093: return getDispenser(); // Reference - case -1237557856: return addAuthorizingPrescription(); // Reference - case 3575610: return getType(); // CodeableConcept - case -1285004149: return getQuantity(); // SimpleQuantity - case 197175334: return getDaysSupply(); // SimpleQuantity - case -562837097: throw new FHIRException("Cannot make property whenPrepared as it is not a complex type"); // DateTimeType - case -940241380: throw new FHIRException("Cannot make property whenHandedOver as it is not a complex type"); // DateTimeType - case -1429847026: return getDestination(); // Reference - case -808719889: return addReceiver(); // Reference - case 3387378: return addNote(); // Annotation - case -1201373865: return addDosageInstruction(); // MedicationDispenseDosageInstructionComponent - case 826147581: return getSubstitution(); // MedicationDispenseSubstitutionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.status"); - } - else if (name.equals("medicationCodeableConcept")) { - this.medication = new CodeableConcept(); - return this.medication; - } - else if (name.equals("medicationReference")) { - this.medication = new Reference(); - return this.medication; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("dispenser")) { - this.dispenser = new Reference(); - return this.dispenser; - } - else if (name.equals("authorizingPrescription")) { - return addAuthorizingPrescription(); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("daysSupply")) { - this.daysSupply = new SimpleQuantity(); - return this.daysSupply; - } - else if (name.equals("whenPrepared")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.whenPrepared"); - } - else if (name.equals("whenHandedOver")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationDispense.whenHandedOver"); - } - else if (name.equals("destination")) { - this.destination = new Reference(); - return this.destination; - } - else if (name.equals("receiver")) { - return addReceiver(); - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("dosageInstruction")) { - return addDosageInstruction(); - } - else if (name.equals("substitution")) { - this.substitution = new MedicationDispenseSubstitutionComponent(); - return this.substitution; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "MedicationDispense"; - - } - - public MedicationDispense copy() { - MedicationDispense dst = new MedicationDispense(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.medication = medication == null ? null : medication.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.dispenser = dispenser == null ? null : dispenser.copy(); - if (authorizingPrescription != null) { - dst.authorizingPrescription = new ArrayList(); - for (Reference i : authorizingPrescription) - dst.authorizingPrescription.add(i.copy()); - }; - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.daysSupply = daysSupply == null ? null : daysSupply.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.whenHandedOver = whenHandedOver == null ? null : whenHandedOver.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - if (dosageInstruction != null) { - dst.dosageInstruction = new ArrayList(); - for (MedicationDispenseDosageInstructionComponent i : dosageInstruction) - dst.dosageInstruction.add(i.copy()); - }; - dst.substitution = substitution == null ? null : substitution.copy(); - return dst; - } - - protected MedicationDispense typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationDispense)) - return false; - MedicationDispense o = (MedicationDispense) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) - && compareDeep(patient, o.patient, true) && compareDeep(dispenser, o.dispenser, true) && compareDeep(authorizingPrescription, o.authorizingPrescription, true) - && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(daysSupply, o.daysSupply, true) - && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(whenHandedOver, o.whenHandedOver, true) - && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true) && compareDeep(note, o.note, true) - && compareDeep(dosageInstruction, o.dosageInstruction, true) && compareDeep(substitution, o.substitution, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationDispense)) - return false; - MedicationDispense o = (MedicationDispense) other; - return compareValues(status, o.status, true) && compareValues(whenPrepared, o.whenPrepared, true) && compareValues(whenHandedOver, o.whenHandedOver, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) - && (dispenser == null || dispenser.isEmpty()) && (authorizingPrescription == null || authorizingPrescription.isEmpty()) - && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) && (daysSupply == null || daysSupply.isEmpty()) - && (whenPrepared == null || whenPrepared.isEmpty()) && (whenHandedOver == null || whenHandedOver.isEmpty()) - && (destination == null || destination.isEmpty()) && (receiver == null || receiver.isEmpty()) - && (note == null || note.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) - && (substitution == null || substitution.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationDispense; - } - - /** - * Search parameter: medication - *

- * Description: Return dispenses of this medicine resource
- * Type: reference
- * Path: MedicationDispense.medicationReference
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationDispense.medication.as(Reference)", description="Return dispenses of this medicine resource", type="reference" ) - public static final String SP_MEDICATION = "medication"; - /** - * Fluent Client search parameter constant for medication - *

- * Description: Return dispenses of this medicine resource
- * Type: reference
- * Path: MedicationDispense.medicationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:medication". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:medication").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationDispense:patient").toLocked(); - - /** - * Search parameter: receiver - *

- * Description: Who collected the medication
- * Type: reference
- * Path: MedicationDispense.receiver
- *

- */ - @SearchParamDefinition(name="receiver", path="MedicationDispense.receiver", description="Who collected the medication", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - /** - * Fluent Client search parameter constant for receiver - *

- * Description: Who collected the medication
- * Type: reference
- * Path: MedicationDispense.receiver
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:receiver". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("MedicationDispense:receiver").toLocked(); - - /** - * Search parameter: status - *

- * Description: Status of the dispense
- * Type: token
- * Path: MedicationDispense.status
- *

- */ - @SearchParamDefinition(name="status", path="MedicationDispense.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.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIPTION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIPTION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:prescription". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIPTION = new ca.uhn.fhir.model.api.Include("MedicationDispense:prescription").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSIBLEPARTY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSIBLEPARTY); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:responsibleparty". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSIBLEPARTY = new ca.uhn.fhir.model.api.Include("MedicationDispense:responsibleparty").toLocked(); - - /** - * Search parameter: dispenser - *

- * Description: Return all dispenses performed by a specific individual
- * Type: reference
- * Path: MedicationDispense.dispenser
- *

- */ - @SearchParamDefinition(name="dispenser", path="MedicationDispense.dispenser", description="Return all dispenses performed by a specific individual", type="reference" ) - public static final String SP_DISPENSER = "dispenser"; - /** - * Fluent Client search parameter constant for dispenser - *

- * Description: Return all dispenses performed by a specific individual
- * Type: reference
- * Path: MedicationDispense.dispenser
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DISPENSER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DISPENSER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:dispenser". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DISPENSER = new ca.uhn.fhir.model.api.Include("MedicationDispense:dispenser").toLocked(); - - /** - * Search parameter: code - *

- * Description: Return dispenses of this medicine code
- * Type: token
- * Path: MedicationDispense.medicationCodeableConcept
- *

- */ - @SearchParamDefinition(name="code", path="MedicationDispense.medication.as(CodeableConcept)", description="Return dispenses of this medicine code", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Return dispenses of this medicine code
- * Type: token
- * Path: MedicationDispense.medicationCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: type - *

- * Description: Return all dispenses of a specific type
- * Type: token
- * Path: MedicationDispense.type
- *

- */ - @SearchParamDefinition(name="type", path="MedicationDispense.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.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: Return dispenses with this external identifier
- * Type: token
- * Path: MedicationDispense.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationDispense.identifier", description="Return dispenses with this external identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return dispenses with this external identifier
- * Type: token
- * Path: MedicationDispense.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: whenprepared - *

- * Description: Date when medication prepared
- * Type: date
- * Path: MedicationDispense.whenPrepared
- *

- */ - @SearchParamDefinition(name="whenprepared", path="MedicationDispense.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.whenPrepared
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam WHENPREPARED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHENPREPARED); - - /** - * Search parameter: whenhandedover - *

- * Description: Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)
- * Type: date
- * Path: MedicationDispense.whenHandedOver
- *

- */ - @SearchParamDefinition(name="whenhandedover", path="MedicationDispense.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.whenHandedOver
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam WHENHANDEDOVER = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHENHANDEDOVER); - - /** - * Search parameter: destination - *

- * Description: Return dispenses that should be sent to a specific destination
- * Type: reference
- * Path: MedicationDispense.destination
- *

- */ - @SearchParamDefinition(name="destination", path="MedicationDispense.destination", description="Return dispenses that should be sent to a specific 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 specific destination
- * Type: reference
- * Path: MedicationDispense.destination
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DESTINATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DESTINATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationDispense:destination". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DESTINATION = new ca.uhn.fhir.model.api.Include("MedicationDispense:destination").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationOrder.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationOrder.java deleted file mode 100644 index 26044d9026e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationOrder.java +++ /dev/null @@ -1,2744 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * An order for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationOrder" rather than "MedicationPrescription" to generalize the use across inpatient and outpatient settings as well as for care plans, etc. - */ -@ResourceDef(name="MedicationOrder", profile="http://hl7.org/fhir/Profile/MedicationOrder") -public class MedicationOrder extends DomainResource { - - public enum MedicationOrderStatus { - /** - * The prescription is 'actionable', but not all actions that are implied by it have occurred yet. - */ - ACTIVE, - /** - * Actions implied by the prescription are to be temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the prescription have occurred. - */ - COMPLETED, - /** - * The prescription was entered in error. - */ - ENTEREDINERROR, - /** - * Actions implied by the prescription are to be permanently halted, before all of them occurred. - */ - STOPPED, - /** - * The prescription is not yet 'actionable', i.e. it is a work in progress, requires sign-off or verification, and needs to be run through decision support process. - */ - DRAFT, - /** - * added to help the parsers - */ - NULL; - public static MedicationOrderStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("stopped".equals(codeString)) - return STOPPED; - if ("draft".equals(codeString)) - return DRAFT; - throw new FHIRException("Unknown MedicationOrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case STOPPED: return "stopped"; - case DRAFT: return "draft"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return "http://hl7.org/fhir/medication-order-status"; - case ONHOLD: return "http://hl7.org/fhir/medication-order-status"; - case COMPLETED: return "http://hl7.org/fhir/medication-order-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/medication-order-status"; - case STOPPED: return "http://hl7.org/fhir/medication-order-status"; - case DRAFT: return "http://hl7.org/fhir/medication-order-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The prescription is 'actionable', but not all actions that are implied by it have occurred yet."; - case ONHOLD: return "Actions implied by the prescription are to be temporarily halted, but are expected to continue later. May also be called \"suspended\"."; - case COMPLETED: return "All actions that are implied by the prescription have occurred."; - case ENTEREDINERROR: return "The prescription was entered in error."; - case STOPPED: return "Actions implied by the prescription are to be permanently halted, before all of them occurred."; - case DRAFT: return "The prescription is not yet 'actionable', i.e. it is a work in progress, requires sign-off or verification, and needs to be run through decision support process."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case ONHOLD: return "On Hold"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered In Error"; - case STOPPED: return "Stopped"; - case DRAFT: return "Draft"; - default: return "?"; - } - } - } - - public static class MedicationOrderStatusEnumFactory implements EnumFactory { - public MedicationOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return MedicationOrderStatus.ACTIVE; - if ("on-hold".equals(codeString)) - return MedicationOrderStatus.ONHOLD; - if ("completed".equals(codeString)) - return MedicationOrderStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationOrderStatus.ENTEREDINERROR; - if ("stopped".equals(codeString)) - return MedicationOrderStatus.STOPPED; - if ("draft".equals(codeString)) - return MedicationOrderStatus.DRAFT; - throw new IllegalArgumentException("Unknown MedicationOrderStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return new Enumeration(this, MedicationOrderStatus.ACTIVE); - if ("on-hold".equals(codeString)) - return new Enumeration(this, MedicationOrderStatus.ONHOLD); - if ("completed".equals(codeString)) - return new Enumeration(this, MedicationOrderStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, MedicationOrderStatus.ENTEREDINERROR); - if ("stopped".equals(codeString)) - return new Enumeration(this, MedicationOrderStatus.STOPPED); - if ("draft".equals(codeString)) - return new Enumeration(this, MedicationOrderStatus.DRAFT); - throw new FHIRException("Unknown MedicationOrderStatus code '"+codeString+"'"); - } - public String toCode(MedicationOrderStatus code) { - if (code == MedicationOrderStatus.ACTIVE) - return "active"; - if (code == MedicationOrderStatus.ONHOLD) - return "on-hold"; - if (code == MedicationOrderStatus.COMPLETED) - return "completed"; - if (code == MedicationOrderStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationOrderStatus.STOPPED) - return "stopped"; - if (code == MedicationOrderStatus.DRAFT) - return "draft"; - return "?"; - } - public String toSystem(MedicationOrderStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class MedicationOrderDosageInstructionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Free text dosage instructions e.g. SIG", formalDefinition="Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing." ) - protected StringType text; - - /** - * Additional instructions such as "Swallow with plenty of water" which may or may not be coded. - */ - @Child(name = "additionalInstructions", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept additionalInstructions; - - /** - * 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". - */ - @Child(name = "timing", type = {Timing.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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\"." ) - protected Timing timing; - - /** - * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Take \"as needed\" (for x)", formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept)." ) - protected Type asNeeded; - - /** - * A coded specification of the anatomic site where the medication first enters the body. - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Body site to administer to", formalDefinition="A coded specification of the anatomic site where the medication first enters the body." ) - protected Type site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @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's body." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=true) - @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. For examples, Slow Push; Deep IV." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name = "dose", type = {Range.class, SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of medication per dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Type dose; - - /** - * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. - */ - @Child(name = "rate", type = {Ratio.class, Range.class, SimpleQuantity.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of medication per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) - protected Type rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours. - */ - @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=10, min=0, max=1, modifier=false, summary=true) - @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. For example, 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = -1470136646L; - - /** - * Constructor - */ - public MedicationOrderDosageInstructionComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationOrderDosageInstructionComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. - */ - public MedicationOrderDosageInstructionComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public CodeableConcept getAdditionalInstructions() { - if (this.additionalInstructions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.additionalInstructions"); - else if (Configuration.doAutoCreate()) - this.additionalInstructions = new CodeableConcept(); // cc - return this.additionalInstructions; - } - - public boolean hasAdditionalInstructions() { - return this.additionalInstructions != null && !this.additionalInstructions.isEmpty(); - } - - /** - * @param value {@link #additionalInstructions} (Additional instructions such as "Swallow with plenty of water" which may or may not be coded.) - */ - public MedicationOrderDosageInstructionComponent setAdditionalInstructions(CodeableConcept value) { - this.additionalInstructions = value; - return this; - } - - /** - * @return {@link #timing} (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 Timing getTiming() { - if (this.timing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.timing"); - else if (Configuration.doAutoCreate()) - this.timing = new Timing(); // cc - return this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (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 MedicationOrderDosageInstructionComponent setTiming(Timing value) { - this.timing = value; - return this; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) - */ - public BooleanType getAsNeededBooleanType() throws FHIRException { - if (!(this.asNeeded instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - public boolean hasAsNeededBooleanType() { - return this.asNeeded instanceof BooleanType; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) - */ - public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeededCodeableConcept() { - return this.asNeeded instanceof CodeableConcept; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).) - */ - public MedicationOrderDosageInstructionComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSiteCodeableConcept() throws FHIRException { - if (!(this.site instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - public boolean hasSiteCodeableConcept() { - return this.site instanceof CodeableConcept; - } - - /** - * @return {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public Reference getSiteReference() throws FHIRException { - if (!(this.site instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSiteReference() { - return this.site instanceof Reference; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of the anatomic site where the medication first enters the body.) - */ - public MedicationOrderDosageInstructionComponent setSite(Type value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.) - */ - public MedicationOrderDosageInstructionComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.) - */ - public MedicationOrderDosageInstructionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Type getDose() { - return this.dose; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public Range getDoseRange() throws FHIRException { - if (!(this.dose instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (Range) this.dose; - } - - public boolean hasDoseRange() { - return this.dose instanceof Range; - } - - /** - * @return {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public SimpleQuantity getDoseSimpleQuantity() throws FHIRException { - if (!(this.dose instanceof SimpleQuantity)) - throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.dose.getClass().getName()+" was encountered"); - return (SimpleQuantity) this.dose; - } - - public boolean hasDoseSimpleQuantity() { - return this.dose instanceof SimpleQuantity; - } - - public boolean hasDose() { - return this.dose != null && !this.dose.isEmpty(); - } - - /** - * @param value {@link #dose} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationOrderDosageInstructionComponent setDose(Type value) { - this.dose = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Type getRate() { - return this.rate; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Ratio getRateRatio() throws FHIRException { - if (!(this.rate instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Ratio) this.rate; - } - - public boolean hasRateRatio() { - return this.rate instanceof Ratio; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Range getRateRange() throws FHIRException { - if (!(this.rate instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Range) this.rate; - } - - public boolean hasRateRange() { - return this.rate instanceof Range; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public SimpleQuantity getRateSimpleQuantity() throws FHIRException { - if (!(this.rate instanceof SimpleQuantity)) - throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (SimpleQuantity) this.rate; - } - - public boolean hasRateSimpleQuantity() { - return this.rate instanceof SimpleQuantity; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public MedicationOrderDosageInstructionComponent setRate(Type value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDosageInstructionComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); // cc - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) - */ - public MedicationOrderDosageInstructionComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("additionalInstructions", "CodeableConcept", "Additional instructions such as \"Swallow with plenty of water\" which may or may not be coded.", 0, java.lang.Integer.MAX_VALUE, additionalInstructions)); - childrenList.add(new Property("timing", "Timing", "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\".", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("dose[x]", "Range|SimpleQuantity", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, dose)); - childrenList.add(new Property("rate[x]", "Ratio|Range|SimpleQuantity", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -1206718612: /*additionalInstructions*/ return this.additionalInstructions == null ? new Base[0] : new Base[] {this.additionalInstructions}; // CodeableConcept - case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing - case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type - case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case 3089437: /*dose*/ return this.dose == null ? new Base[0] : new Base[] {this.dose}; // Type - case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type - case 1506263709: /*maxDosePerPeriod*/ return this.maxDosePerPeriod == null ? new Base[0] : new Base[] {this.maxDosePerPeriod}; // Ratio - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3556653: // text - this.text = castToString(value); // StringType - break; - case -1206718612: // additionalInstructions - this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept - break; - case -873664438: // timing - this.timing = castToTiming(value); // Timing - break; - case -1432923513: // asNeeded - this.asNeeded = (Type) value; // Type - break; - case 3530567: // site - this.site = (Type) value; // Type - break; - case 108704329: // route - this.route = castToCodeableConcept(value); // CodeableConcept - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case 3089437: // dose - this.dose = (Type) value; // Type - break; - case 3493088: // rate - this.rate = (Type) value; // Type - break; - case 1506263709: // maxDosePerPeriod - this.maxDosePerPeriod = castToRatio(value); // Ratio - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("additionalInstructions")) - this.additionalInstructions = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("timing")) - this.timing = castToTiming(value); // Timing - else if (name.equals("asNeeded[x]")) - this.asNeeded = (Type) value; // Type - else if (name.equals("site[x]")) - this.site = (Type) value; // Type - else if (name.equals("route")) - this.route = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("dose[x]")) - this.dose = (Type) value; // Type - else if (name.equals("rate[x]")) - this.rate = (Type) value; // Type - else if (name.equals("maxDosePerPeriod")) - this.maxDosePerPeriod = castToRatio(value); // Ratio - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -1206718612: return getAdditionalInstructions(); // CodeableConcept - case -873664438: return getTiming(); // Timing - case -544329575: return getAsNeeded(); // Type - case 2099997657: return getSite(); // Type - case 108704329: return getRoute(); // CodeableConcept - case -1077554975: return getMethod(); // CodeableConcept - case 1843195715: return getDose(); // Type - case 983460768: return getRate(); // Type - case 1506263709: return getMaxDosePerPeriod(); // Ratio - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.text"); - } - else if (name.equals("additionalInstructions")) { - this.additionalInstructions = new CodeableConcept(); - return this.additionalInstructions; - } - else if (name.equals("timing")) { - this.timing = new Timing(); - return this.timing; - } - else if (name.equals("asNeededBoolean")) { - this.asNeeded = new BooleanType(); - return this.asNeeded; - } - else if (name.equals("asNeededCodeableConcept")) { - this.asNeeded = new CodeableConcept(); - return this.asNeeded; - } - else if (name.equals("siteCodeableConcept")) { - this.site = new CodeableConcept(); - return this.site; - } - else if (name.equals("siteReference")) { - this.site = new Reference(); - return this.site; - } - else if (name.equals("route")) { - this.route = new CodeableConcept(); - return this.route; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("doseRange")) { - this.dose = new Range(); - return this.dose; - } - else if (name.equals("doseSimpleQuantity")) { - this.dose = new SimpleQuantity(); - return this.dose; - } - else if (name.equals("rateRatio")) { - this.rate = new Ratio(); - return this.rate; - } - else if (name.equals("rateRange")) { - this.rate = new Range(); - return this.rate; - } - else if (name.equals("rateSimpleQuantity")) { - this.rate = new SimpleQuantity(); - return this.rate; - } - else if (name.equals("maxDosePerPeriod")) { - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - else - return super.addChild(name); - } - - public MedicationOrderDosageInstructionComponent copy() { - MedicationOrderDosageInstructionComponent dst = new MedicationOrderDosageInstructionComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.additionalInstructions = additionalInstructions == null ? null : additionalInstructions.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.dose = dose == null ? null : dose.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationOrderDosageInstructionComponent)) - return false; - MedicationOrderDosageInstructionComponent o = (MedicationOrderDosageInstructionComponent) other; - return compareDeep(text, o.text, true) && compareDeep(additionalInstructions, o.additionalInstructions, true) - && compareDeep(timing, o.timing, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(site, o.site, true) - && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) && compareDeep(dose, o.dose, true) - && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationOrderDosageInstructionComponent)) - return false; - MedicationOrderDosageInstructionComponent o = (MedicationOrderDosageInstructionComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (additionalInstructions == null || additionalInstructions.isEmpty()) - && (timing == null || timing.isEmpty()) && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) - && (route == null || route.isEmpty()) && (method == null || method.isEmpty()) && (dose == null || dose.isEmpty()) - && (rate == null || rate.isEmpty()) && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()) - ; - } - - public String fhirType() { - return "MedicationOrder.dosageInstruction"; - - } - - } - - @Block() - public static class MedicationOrderDispenseRequestComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) - protected Type medication; - - /** - * This indicates the validity period of a prescription (stale dating the Prescription). - */ - @Child(name = "validityPeriod", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time period supply is authorized for", formalDefinition="This indicates the validity period of a prescription (stale dating the Prescription)." ) - protected Period validityPeriod; - - /** - * An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. - */ - @Child(name = "numberOfRepeatsAllowed", type = {PositiveIntType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of refills authorized", formalDefinition="An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus \"3 repeats\", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets." ) - protected PositiveIntType numberOfRepeatsAllowed; - - /** - * The amount that is to be dispensed for one fill. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of medication to supply per dispense", formalDefinition="The amount that is to be dispensed for one fill." ) - protected SimpleQuantity quantity; - - /** - * 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. - */ - @Child(name = "expectedSupplyDuration", type = {Duration.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of 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." ) - protected Duration expectedSupplyDuration; - - private static final long serialVersionUID = -1690502728L; - - /** - * Constructor - */ - public MedicationOrderDispenseRequestComponent() { - super(); - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Type getMedication() { - return this.medication; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public CodeableConcept getMedicationCodeableConcept() throws FHIRException { - if (!(this.medication instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (CodeableConcept) this.medication; - } - - public boolean hasMedicationCodeableConcept() { - return this.medication instanceof CodeableConcept; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedicationReference() throws FHIRException { - if (!(this.medication instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (Reference) this.medication; - } - - public boolean hasMedicationReference() { - return this.medication instanceof Reference; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationOrderDispenseRequestComponent setMedication(Type value) { - this.medication = value; - return this; - } - - /** - * @return {@link #validityPeriod} (This indicates the validity period of a prescription (stale dating the Prescription).) - */ - public Period getValidityPeriod() { - if (this.validityPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.validityPeriod"); - else if (Configuration.doAutoCreate()) - this.validityPeriod = new Period(); // cc - return this.validityPeriod; - } - - public boolean hasValidityPeriod() { - return this.validityPeriod != null && !this.validityPeriod.isEmpty(); - } - - /** - * @param value {@link #validityPeriod} (This indicates the validity period of a prescription (stale dating the Prescription).) - */ - public MedicationOrderDispenseRequestComponent setValidityPeriod(Period value) { - this.validityPeriod = value; - return this; - } - - /** - * @return {@link #numberOfRepeatsAllowed} (An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value - */ - public PositiveIntType getNumberOfRepeatsAllowedElement() { - if (this.numberOfRepeatsAllowed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.numberOfRepeatsAllowed"); - else if (Configuration.doAutoCreate()) - this.numberOfRepeatsAllowed = new PositiveIntType(); // bb - return this.numberOfRepeatsAllowed; - } - - public boolean hasNumberOfRepeatsAllowedElement() { - return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); - } - - public boolean hasNumberOfRepeatsAllowed() { - return this.numberOfRepeatsAllowed != null && !this.numberOfRepeatsAllowed.isEmpty(); - } - - /** - * @param value {@link #numberOfRepeatsAllowed} (An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.). This is the underlying object with id, value and extensions. The accessor "getNumberOfRepeatsAllowed" gives direct access to the value - */ - public MedicationOrderDispenseRequestComponent setNumberOfRepeatsAllowedElement(PositiveIntType value) { - this.numberOfRepeatsAllowed = value; - return this; - } - - /** - * @return An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. - */ - public int getNumberOfRepeatsAllowed() { - return this.numberOfRepeatsAllowed == null || this.numberOfRepeatsAllowed.isEmpty() ? 0 : this.numberOfRepeatsAllowed.getValue(); - } - - /** - * @param value An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. - */ - public MedicationOrderDispenseRequestComponent setNumberOfRepeatsAllowed(int value) { - if (this.numberOfRepeatsAllowed == null) - this.numberOfRepeatsAllowed = new PositiveIntType(); - this.numberOfRepeatsAllowed.setValue(value); - return this; - } - - /** - * @return {@link #quantity} (The amount that is to be dispensed for one fill.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount that is to be dispensed for one fill.) - */ - public MedicationOrderDispenseRequestComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #expectedSupplyDuration} (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.) - */ - public Duration getExpectedSupplyDuration() { - if (this.expectedSupplyDuration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderDispenseRequestComponent.expectedSupplyDuration"); - else if (Configuration.doAutoCreate()) - this.expectedSupplyDuration = new Duration(); // cc - return this.expectedSupplyDuration; - } - - public boolean hasExpectedSupplyDuration() { - return this.expectedSupplyDuration != null && !this.expectedSupplyDuration.isEmpty(); - } - - /** - * @param value {@link #expectedSupplyDuration} (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.) - */ - public MedicationOrderDispenseRequestComponent setExpectedSupplyDuration(Duration value) { - this.expectedSupplyDuration = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("validityPeriod", "Period", "This indicates the validity period of a prescription (stale dating the Prescription).", 0, java.lang.Integer.MAX_VALUE, validityPeriod)); - childrenList.add(new Property("numberOfRepeatsAllowed", "positiveInt", "An integer indicating the number of additional times (aka refills or repeats) the patient can receive the prescribed medication. Usage Notes: This integer does NOT include the original order dispense. This means that if an order indicates dispense 30 tablets plus \"3 repeats\", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets.", 0, java.lang.Integer.MAX_VALUE, numberOfRepeatsAllowed)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The amount that is to be dispensed for one fill.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("expectedSupplyDuration", "Duration", "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.", 0, java.lang.Integer.MAX_VALUE, expectedSupplyDuration)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type - case -1434195053: /*validityPeriod*/ return this.validityPeriod == null ? new Base[0] : new Base[] {this.validityPeriod}; // Period - case -239736976: /*numberOfRepeatsAllowed*/ return this.numberOfRepeatsAllowed == null ? new Base[0] : new Base[] {this.numberOfRepeatsAllowed}; // PositiveIntType - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -1910182789: /*expectedSupplyDuration*/ return this.expectedSupplyDuration == null ? new Base[0] : new Base[] {this.expectedSupplyDuration}; // Duration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1998965455: // medication - this.medication = (Type) value; // Type - break; - case -1434195053: // validityPeriod - this.validityPeriod = castToPeriod(value); // Period - break; - case -239736976: // numberOfRepeatsAllowed - this.numberOfRepeatsAllowed = castToPositiveInt(value); // PositiveIntType - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1910182789: // expectedSupplyDuration - this.expectedSupplyDuration = castToDuration(value); // Duration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("medication[x]")) - this.medication = (Type) value; // Type - else if (name.equals("validityPeriod")) - this.validityPeriod = castToPeriod(value); // Period - else if (name.equals("numberOfRepeatsAllowed")) - this.numberOfRepeatsAllowed = castToPositiveInt(value); // PositiveIntType - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("expectedSupplyDuration")) - this.expectedSupplyDuration = castToDuration(value); // Duration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1458402129: return getMedication(); // Type - case -1434195053: return getValidityPeriod(); // Period - case -239736976: throw new FHIRException("Cannot make property numberOfRepeatsAllowed as it is not a complex type"); // PositiveIntType - case -1285004149: return getQuantity(); // SimpleQuantity - case -1910182789: return getExpectedSupplyDuration(); // Duration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("medicationCodeableConcept")) { - this.medication = new CodeableConcept(); - return this.medication; - } - else if (name.equals("medicationReference")) { - this.medication = new Reference(); - return this.medication; - } - else if (name.equals("validityPeriod")) { - this.validityPeriod = new Period(); - return this.validityPeriod; - } - else if (name.equals("numberOfRepeatsAllowed")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.numberOfRepeatsAllowed"); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("expectedSupplyDuration")) { - this.expectedSupplyDuration = new Duration(); - return this.expectedSupplyDuration; - } - else - return super.addChild(name); - } - - public MedicationOrderDispenseRequestComponent copy() { - MedicationOrderDispenseRequestComponent dst = new MedicationOrderDispenseRequestComponent(); - copyValues(dst); - dst.medication = medication == null ? null : medication.copy(); - dst.validityPeriod = validityPeriod == null ? null : validityPeriod.copy(); - dst.numberOfRepeatsAllowed = numberOfRepeatsAllowed == null ? null : numberOfRepeatsAllowed.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.expectedSupplyDuration = expectedSupplyDuration == null ? null : expectedSupplyDuration.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationOrderDispenseRequestComponent)) - return false; - MedicationOrderDispenseRequestComponent o = (MedicationOrderDispenseRequestComponent) other; - return compareDeep(medication, o.medication, true) && compareDeep(validityPeriod, o.validityPeriod, true) - && compareDeep(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true) && compareDeep(quantity, o.quantity, true) - && compareDeep(expectedSupplyDuration, o.expectedSupplyDuration, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationOrderDispenseRequestComponent)) - return false; - MedicationOrderDispenseRequestComponent o = (MedicationOrderDispenseRequestComponent) other; - return compareValues(numberOfRepeatsAllowed, o.numberOfRepeatsAllowed, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (medication == null || medication.isEmpty()) && (validityPeriod == null || validityPeriod.isEmpty()) - && (numberOfRepeatsAllowed == null || numberOfRepeatsAllowed.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (expectedSupplyDuration == null || expectedSupplyDuration.isEmpty()); - } - - public String fhirType() { - return "MedicationOrder.dispenseRequest"; - - } - - } - - @Block() - public static class MedicationOrderSubstitutionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code signifying whether a different drug should be dispensed from what was prescribed. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="generic | formulary +", formalDefinition="A code signifying whether a different drug should be dispensed from what was prescribed." ) - protected CodeableConcept type; - - /** - * Indicates the reason for the substitution, or why substitution must or must not be performed. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why should (not) substitution be made", formalDefinition="Indicates the reason for the substitution, or why substitution must or must not be performed." ) - protected CodeableConcept reason; - - private static final long serialVersionUID = 1693602518L; - - /** - * Constructor - */ - public MedicationOrderSubstitutionComponent() { - super(); - } - - /** - * Constructor - */ - public MedicationOrderSubstitutionComponent(CodeableConcept type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderSubstitutionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code signifying whether a different drug should be dispensed from what was prescribed.) - */ - public MedicationOrderSubstitutionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrderSubstitutionComponent.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Indicates the reason for the substitution, or why substitution must or must not be performed.) - */ - public MedicationOrderSubstitutionComponent setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "A code signifying whether a different drug should be dispensed from what was prescribed.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reason", "CodeableConcept", "Indicates the reason for the substitution, or why substitution must or must not be performed.", 0, java.lang.Integer.MAX_VALUE, reason)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -934964668: // reason - this.reason = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("reason")) - this.reason = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -934964668: return getReason(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("reason")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else - return super.addChild(name); - } - - public MedicationOrderSubstitutionComponent copy() { - MedicationOrderSubstitutionComponent dst = new MedicationOrderSubstitutionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.reason = reason == null ? null : reason.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationOrderSubstitutionComponent)) - return false; - MedicationOrderSubstitutionComponent o = (MedicationOrderSubstitutionComponent) other; - return compareDeep(type, o.type, true) && compareDeep(reason, o.reason, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationOrderSubstitutionComponent)) - return false; - MedicationOrderSubstitutionComponent o = (MedicationOrderSubstitutionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (reason == null || reason.isEmpty()) - ; - } - - public String fhirType() { - return "MedicationOrder.substitution"; - - } - - } - - /** - * 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 entire workflow process where records have to be tracked through an entire system. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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 entire workflow process where records have to be tracked through an entire system." ) - protected List identifier; - - /** - * A code specifying the state of the order. Generally this will be active or completed state. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | on-hold | completed | entered-in-error | stopped | draft", formalDefinition="A code specifying the state of the order. Generally this will be active or completed state." ) - protected Enumeration status; - - /** - * Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications. - */ - @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Medication to be taken", formalDefinition="Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications." ) - protected Type medication; - - /** - * A link to a resource representing the person to whom the medication will be given. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the medication will be given." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the medication will be given.) - */ - protected Patient patientTarget; - - /** - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - */ - @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - protected Encounter encounterTarget; - - /** - * The date (and perhaps time) when the prescription was written. - */ - @Child(name = "dateWritten", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) - protected DateTimeType dateWritten; - - /** - * The healthcare professional responsible for authorizing the prescription. - */ - @Child(name = "prescriber", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who ordered the medication(s)", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) - protected Reference prescriber; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) - */ - protected Practitioner prescriberTarget; - - /** - * Can be the reason or the indication for writing the prescription. - */ - @Child(name = "reasonCode", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) - protected List reasonCode; - - /** - * Condition that supports why the prescription is being written. - */ - @Child(name = "reasonReference", type = {Condition.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Condition that supports why the prescription is being written", formalDefinition="Condition that supports why the prescription is being written." ) - protected List reasonReference; - /** - * The actual objects that are the target of the reference (Condition that supports why the prescription is being written.) - */ - protected List reasonReferenceTarget; - - - /** - * The date (and perhaps time) when the prescription was stopped. - */ - @Child(name = "dateEnded", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When prescription was stopped", formalDefinition="The date (and perhaps time) when the prescription was stopped." ) - protected DateTimeType dateEnded; - - /** - * The reason why the prescription was stopped, if it was. - */ - @Child(name = "reasonEnded", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why prescription was stopped", formalDefinition="The reason why the prescription was stopped, if it was." ) - protected CodeableConcept reasonEnded; - - /** - * Extra information about the prescription that could not be conveyed by the other attributes. - */ - @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Information about the prescription", formalDefinition="Extra information about the prescription that could not be conveyed by the other attributes." ) - protected List note; - - /** - * Indicates how the medication is to be used by the patient. - */ - @Child(name = "dosageInstruction", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="How medication should be taken", formalDefinition="Indicates how the medication is to be used by the patient." ) - protected List dosageInstruction; - - /** - * Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. - */ - @Child(name = "dispenseRequest", type = {}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Medication supply authorization", formalDefinition="Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department." ) - protected MedicationOrderDispenseRequestComponent dispenseRequest; - - /** - * 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. - */ - @Child(name = "substitution", type = {}, order=14, min=0, max=1, modifier=false, summary=true) - @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." ) - protected MedicationOrderSubstitutionComponent substitution; - - /** - * A link to a resource representing an earlier order or prescription that this order supersedes. - */ - @Child(name = "priorPrescription", type = {MedicationOrder.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="An order/prescription that this supersedes", formalDefinition="A link to a resource representing an earlier order or prescription that this order supersedes." ) - protected Reference priorPrescription; - - /** - * The actual object that is the target of the reference (A link to a resource representing an earlier order or prescription that this order supersedes.) - */ - protected MedicationOrder priorPrescriptionTarget; - - private static final long serialVersionUID = -1031457736L; - - /** - * Constructor - */ - public MedicationOrder() { - super(); - } - - /** - * Constructor - */ - public MedicationOrder(Type medication) { - super(); - this.medication = medication; - } - - /** - * @return {@link #identifier} (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 entire workflow process where records have to be tracked through an entire system.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (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 entire workflow process where records have to be tracked through an entire system.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public MedicationOrder addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the order. Generally this will be active or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the order. Generally this will be active or completed state. - */ - public MedicationOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the order. Generally this will be active or completed state. - */ - public MedicationOrder setStatus(MedicationOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new MedicationOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Type getMedication() { - return this.medication; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public CodeableConcept getMedicationCodeableConcept() throws FHIRException { - if (!(this.medication instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (CodeableConcept) this.medication; - } - - public boolean hasMedicationCodeableConcept() { - return this.medication instanceof CodeableConcept; - } - - /** - * @return {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public Reference getMedicationReference() throws FHIRException { - if (!(this.medication instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (Reference) this.medication; - } - - public boolean hasMedicationReference() { - return this.medication instanceof Reference; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.) - */ - public MedicationOrder setMedication(Type value) { - this.medication = value; - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationOrder setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the medication will be given.) - */ - public MedicationOrder setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public MedicationOrder setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public MedicationOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public DateTimeType getDateWrittenElement() { - if (this.dateWritten == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.dateWritten"); - else if (Configuration.doAutoCreate()) - this.dateWritten = new DateTimeType(); // bb - return this.dateWritten; - } - - public boolean hasDateWrittenElement() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - public boolean hasDateWritten() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - /** - * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public MedicationOrder setDateWrittenElement(DateTimeType value) { - this.dateWritten = value; - return this; - } - - /** - * @return The date (and perhaps time) when the prescription was written. - */ - public Date getDateWritten() { - return this.dateWritten == null ? null : this.dateWritten.getValue(); - } - - /** - * @param value The date (and perhaps time) when the prescription was written. - */ - public MedicationOrder setDateWritten(Date value) { - if (value == null) - this.dateWritten = null; - else { - if (this.dateWritten == null) - this.dateWritten = new DateTimeType(); - this.dateWritten.setValue(value); - } - return this; - } - - /** - * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public Reference getPrescriber() { - if (this.prescriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriber = new Reference(); // cc - return this.prescriber; - } - - public boolean hasPrescriber() { - return this.prescriber != null && !this.prescriber.isEmpty(); - } - - /** - * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public MedicationOrder setPrescriber(Reference value) { - this.prescriber = value; - return this; - } - - /** - * @return {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public Practitioner getPrescriberTarget() { - if (this.prescriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriberTarget = new Practitioner(); // aa - return this.prescriberTarget; - } - - /** - * @param value {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public MedicationOrder setPrescriberTarget(Practitioner value) { - this.prescriberTarget = value; - return this; - } - - /** - * @return {@link #reasonCode} (Can be the reason or the indication for writing the prescription.) - */ - public List getReasonCode() { - if (this.reasonCode == null) - this.reasonCode = new ArrayList(); - return this.reasonCode; - } - - public boolean hasReasonCode() { - if (this.reasonCode == null) - return false; - for (CodeableConcept item : this.reasonCode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonCode} (Can be the reason or the indication for writing the prescription.) - */ - // syntactic sugar - public CodeableConcept addReasonCode() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonCode == null) - this.reasonCode = new ArrayList(); - this.reasonCode.add(t); - return t; - } - - // syntactic sugar - public MedicationOrder addReasonCode(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonCode == null) - this.reasonCode = new ArrayList(); - this.reasonCode.add(t); - return this; - } - - /** - * @return {@link #reasonReference} (Condition that supports why the prescription is being written.) - */ - public List getReasonReference() { - if (this.reasonReference == null) - this.reasonReference = new ArrayList(); - return this.reasonReference; - } - - public boolean hasReasonReference() { - if (this.reasonReference == null) - return false; - for (Reference item : this.reasonReference) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonReference} (Condition that supports why the prescription is being written.) - */ - // syntactic sugar - public Reference addReasonReference() { //3 - Reference t = new Reference(); - if (this.reasonReference == null) - this.reasonReference = new ArrayList(); - this.reasonReference.add(t); - return t; - } - - // syntactic sugar - public MedicationOrder addReasonReference(Reference t) { //3 - if (t == null) - return this; - if (this.reasonReference == null) - this.reasonReference = new ArrayList(); - this.reasonReference.add(t); - return this; - } - - /** - * @return {@link #reasonReference} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Condition that supports why the prescription is being written.) - */ - public List getReasonReferenceTarget() { - if (this.reasonReferenceTarget == null) - this.reasonReferenceTarget = new ArrayList(); - return this.reasonReferenceTarget; - } - - // syntactic sugar - /** - * @return {@link #reasonReference} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Condition that supports why the prescription is being written.) - */ - public Condition addReasonReferenceTarget() { - Condition r = new Condition(); - if (this.reasonReferenceTarget == null) - this.reasonReferenceTarget = new ArrayList(); - this.reasonReferenceTarget.add(r); - return r; - } - - /** - * @return {@link #dateEnded} (The date (and perhaps time) when the prescription was stopped.). This is the underlying object with id, value and extensions. The accessor "getDateEnded" gives direct access to the value - */ - public DateTimeType getDateEndedElement() { - if (this.dateEnded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.dateEnded"); - else if (Configuration.doAutoCreate()) - this.dateEnded = new DateTimeType(); // bb - return this.dateEnded; - } - - public boolean hasDateEndedElement() { - return this.dateEnded != null && !this.dateEnded.isEmpty(); - } - - public boolean hasDateEnded() { - return this.dateEnded != null && !this.dateEnded.isEmpty(); - } - - /** - * @param value {@link #dateEnded} (The date (and perhaps time) when the prescription was stopped.). This is the underlying object with id, value and extensions. The accessor "getDateEnded" gives direct access to the value - */ - public MedicationOrder setDateEndedElement(DateTimeType value) { - this.dateEnded = value; - return this; - } - - /** - * @return The date (and perhaps time) when the prescription was stopped. - */ - public Date getDateEnded() { - return this.dateEnded == null ? null : this.dateEnded.getValue(); - } - - /** - * @param value The date (and perhaps time) when the prescription was stopped. - */ - public MedicationOrder setDateEnded(Date value) { - if (value == null) - this.dateEnded = null; - else { - if (this.dateEnded == null) - this.dateEnded = new DateTimeType(); - this.dateEnded.setValue(value); - } - return this; - } - - /** - * @return {@link #reasonEnded} (The reason why the prescription was stopped, if it was.) - */ - public CodeableConcept getReasonEnded() { - if (this.reasonEnded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.reasonEnded"); - else if (Configuration.doAutoCreate()) - this.reasonEnded = new CodeableConcept(); // cc - return this.reasonEnded; - } - - public boolean hasReasonEnded() { - return this.reasonEnded != null && !this.reasonEnded.isEmpty(); - } - - /** - * @param value {@link #reasonEnded} (The reason why the prescription was stopped, if it was.) - */ - public MedicationOrder setReasonEnded(CodeableConcept value) { - this.reasonEnded = value; - return this; - } - - /** - * @return {@link #note} (Extra information about the prescription that could not be conveyed by the other attributes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Extra information about the prescription that could not be conveyed by the other attributes.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public MedicationOrder addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - public List getDosageInstruction() { - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - return this.dosageInstruction; - } - - public boolean hasDosageInstruction() { - if (this.dosageInstruction == null) - return false; - for (MedicationOrderDosageInstructionComponent item : this.dosageInstruction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosageInstruction} (Indicates how the medication is to be used by the patient.) - */ - // syntactic sugar - public MedicationOrderDosageInstructionComponent addDosageInstruction() { //3 - MedicationOrderDosageInstructionComponent t = new MedicationOrderDosageInstructionComponent(); - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return t; - } - - // syntactic sugar - public MedicationOrder addDosageInstruction(MedicationOrderDosageInstructionComponent t) { //3 - if (t == null) - return this; - if (this.dosageInstruction == null) - this.dosageInstruction = new ArrayList(); - this.dosageInstruction.add(t); - return this; - } - - /** - * @return {@link #dispenseRequest} (Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.) - */ - public MedicationOrderDispenseRequestComponent getDispenseRequest() { - if (this.dispenseRequest == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.dispenseRequest"); - else if (Configuration.doAutoCreate()) - this.dispenseRequest = new MedicationOrderDispenseRequestComponent(); // cc - return this.dispenseRequest; - } - - public boolean hasDispenseRequest() { - return this.dispenseRequest != null && !this.dispenseRequest.isEmpty(); - } - - /** - * @param value {@link #dispenseRequest} (Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.) - */ - public MedicationOrder setDispenseRequest(MedicationOrderDispenseRequestComponent value) { - this.dispenseRequest = value; - return this; - } - - /** - * @return {@link #substitution} (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 MedicationOrderSubstitutionComponent getSubstitution() { - if (this.substitution == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.substitution"); - else if (Configuration.doAutoCreate()) - this.substitution = new MedicationOrderSubstitutionComponent(); // cc - return this.substitution; - } - - public boolean hasSubstitution() { - return this.substitution != null && !this.substitution.isEmpty(); - } - - /** - * @param value {@link #substitution} (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 MedicationOrder setSubstitution(MedicationOrderSubstitutionComponent value) { - this.substitution = value; - return this; - } - - /** - * @return {@link #priorPrescription} (A link to a resource representing an earlier order or prescription that this order supersedes.) - */ - public Reference getPriorPrescription() { - if (this.priorPrescription == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.priorPrescription"); - else if (Configuration.doAutoCreate()) - this.priorPrescription = new Reference(); // cc - return this.priorPrescription; - } - - public boolean hasPriorPrescription() { - return this.priorPrescription != null && !this.priorPrescription.isEmpty(); - } - - /** - * @param value {@link #priorPrescription} (A link to a resource representing an earlier order or prescription that this order supersedes.) - */ - public MedicationOrder setPriorPrescription(Reference value) { - this.priorPrescription = value; - return this; - } - - /** - * @return {@link #priorPrescription} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing an earlier order or prescription that this order supersedes.) - */ - public MedicationOrder getPriorPrescriptionTarget() { - if (this.priorPrescriptionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationOrder.priorPrescription"); - else if (Configuration.doAutoCreate()) - this.priorPrescriptionTarget = new MedicationOrder(); // aa - return this.priorPrescriptionTarget; - } - - /** - * @param value {@link #priorPrescription} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing an earlier order or prescription that this order supersedes.) - */ - public MedicationOrder setPriorPrescriptionTarget(MedicationOrder value) { - this.priorPrescriptionTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "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 entire workflow process where records have to be tracked through an entire system.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the order. Generally this will be active or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "Identifies the medication being administered. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the medication will be given.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); - childrenList.add(new Property("reasonCode", "CodeableConcept", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reasonCode)); - childrenList.add(new Property("reasonReference", "Reference(Condition)", "Condition that supports why the prescription is being written.", 0, java.lang.Integer.MAX_VALUE, reasonReference)); - childrenList.add(new Property("dateEnded", "dateTime", "The date (and perhaps time) when the prescription was stopped.", 0, java.lang.Integer.MAX_VALUE, dateEnded)); - childrenList.add(new Property("reasonEnded", "CodeableConcept", "The reason why the prescription was stopped, if it was.", 0, java.lang.Integer.MAX_VALUE, reasonEnded)); - childrenList.add(new Property("note", "Annotation", "Extra information about the prescription that could not be conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("dosageInstruction", "", "Indicates how the medication is to be used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosageInstruction)); - childrenList.add(new Property("dispenseRequest", "", "Indicates the specific details for the dispense or medication supply part of a medication order (also known as a Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.", 0, java.lang.Integer.MAX_VALUE, dispenseRequest)); - childrenList.add(new Property("substitution", "", "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.", 0, java.lang.Integer.MAX_VALUE, substitution)); - childrenList.add(new Property("priorPrescription", "Reference(MedicationOrder)", "A link to a resource representing an earlier order or prescription that this order supersedes.", 0, java.lang.Integer.MAX_VALUE, priorPrescription)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType - case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference - case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept - case -1146218137: /*reasonReference*/ return this.reasonReference == null ? new Base[0] : this.reasonReference.toArray(new Base[this.reasonReference.size()]); // Reference - case -273053780: /*dateEnded*/ return this.dateEnded == null ? new Base[0] : new Base[] {this.dateEnded}; // DateTimeType - case 913248982: /*reasonEnded*/ return this.reasonEnded == null ? new Base[0] : new Base[] {this.reasonEnded}; // CodeableConcept - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -1201373865: /*dosageInstruction*/ return this.dosageInstruction == null ? new Base[0] : this.dosageInstruction.toArray(new Base[this.dosageInstruction.size()]); // MedicationOrderDosageInstructionComponent - case 824620658: /*dispenseRequest*/ return this.dispenseRequest == null ? new Base[0] : new Base[] {this.dispenseRequest}; // MedicationOrderDispenseRequestComponent - case 826147581: /*substitution*/ return this.substitution == null ? new Base[0] : new Base[] {this.substitution}; // MedicationOrderSubstitutionComponent - case -486355964: /*priorPrescription*/ return this.priorPrescription == null ? new Base[0] : new Base[] {this.priorPrescription}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new MedicationOrderStatusEnumFactory().fromType(value); // Enumeration - break; - case 1998965455: // medication - this.medication = (Type) value; // Type - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1496880759: // dateWritten - this.dateWritten = castToDateTime(value); // DateTimeType - break; - case 1430631077: // prescriber - this.prescriber = castToReference(value); // Reference - break; - case 722137681: // reasonCode - this.getReasonCode().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1146218137: // reasonReference - this.getReasonReference().add(castToReference(value)); // Reference - break; - case -273053780: // dateEnded - this.dateEnded = castToDateTime(value); // DateTimeType - break; - case 913248982: // reasonEnded - this.reasonEnded = castToCodeableConcept(value); // CodeableConcept - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -1201373865: // dosageInstruction - this.getDosageInstruction().add((MedicationOrderDosageInstructionComponent) value); // MedicationOrderDosageInstructionComponent - break; - case 824620658: // dispenseRequest - this.dispenseRequest = (MedicationOrderDispenseRequestComponent) value; // MedicationOrderDispenseRequestComponent - break; - case 826147581: // substitution - this.substitution = (MedicationOrderSubstitutionComponent) value; // MedicationOrderSubstitutionComponent - break; - case -486355964: // priorPrescription - this.priorPrescription = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new MedicationOrderStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("medication[x]")) - this.medication = (Type) value; // Type - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("dateWritten")) - this.dateWritten = castToDateTime(value); // DateTimeType - else if (name.equals("prescriber")) - this.prescriber = castToReference(value); // Reference - else if (name.equals("reasonCode")) - this.getReasonCode().add(castToCodeableConcept(value)); - else if (name.equals("reasonReference")) - this.getReasonReference().add(castToReference(value)); - else if (name.equals("dateEnded")) - this.dateEnded = castToDateTime(value); // DateTimeType - else if (name.equals("reasonEnded")) - this.reasonEnded = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("dosageInstruction")) - this.getDosageInstruction().add((MedicationOrderDosageInstructionComponent) value); - else if (name.equals("dispenseRequest")) - this.dispenseRequest = (MedicationOrderDispenseRequestComponent) value; // MedicationOrderDispenseRequestComponent - else if (name.equals("substitution")) - this.substitution = (MedicationOrderSubstitutionComponent) value; // MedicationOrderSubstitutionComponent - else if (name.equals("priorPrescription")) - this.priorPrescription = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1458402129: return getMedication(); // Type - case -791418107: return getPatient(); // Reference - case 1524132147: return getEncounter(); // Reference - case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType - case 1430631077: return getPrescriber(); // Reference - case 722137681: return addReasonCode(); // CodeableConcept - case -1146218137: return addReasonReference(); // Reference - case -273053780: throw new FHIRException("Cannot make property dateEnded as it is not a complex type"); // DateTimeType - case 913248982: return getReasonEnded(); // CodeableConcept - case 3387378: return addNote(); // Annotation - case -1201373865: return addDosageInstruction(); // MedicationOrderDosageInstructionComponent - case 824620658: return getDispenseRequest(); // MedicationOrderDispenseRequestComponent - case 826147581: return getSubstitution(); // MedicationOrderSubstitutionComponent - case -486355964: return getPriorPrescription(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.status"); - } - else if (name.equals("medicationCodeableConcept")) { - this.medication = new CodeableConcept(); - return this.medication; - } - else if (name.equals("medicationReference")) { - this.medication = new Reference(); - return this.medication; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("dateWritten")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.dateWritten"); - } - else if (name.equals("prescriber")) { - this.prescriber = new Reference(); - return this.prescriber; - } - else if (name.equals("reasonCode")) { - return addReasonCode(); - } - else if (name.equals("reasonReference")) { - return addReasonReference(); - } - else if (name.equals("dateEnded")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationOrder.dateEnded"); - } - else if (name.equals("reasonEnded")) { - this.reasonEnded = new CodeableConcept(); - return this.reasonEnded; - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("dosageInstruction")) { - return addDosageInstruction(); - } - else if (name.equals("dispenseRequest")) { - this.dispenseRequest = new MedicationOrderDispenseRequestComponent(); - return this.dispenseRequest; - } - else if (name.equals("substitution")) { - this.substitution = new MedicationOrderSubstitutionComponent(); - return this.substitution; - } - else if (name.equals("priorPrescription")) { - this.priorPrescription = new Reference(); - return this.priorPrescription; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "MedicationOrder"; - - } - - public MedicationOrder copy() { - MedicationOrder dst = new MedicationOrder(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.medication = medication == null ? null : medication.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); - if (reasonCode != null) { - dst.reasonCode = new ArrayList(); - for (CodeableConcept i : reasonCode) - dst.reasonCode.add(i.copy()); - }; - if (reasonReference != null) { - dst.reasonReference = new ArrayList(); - for (Reference i : reasonReference) - dst.reasonReference.add(i.copy()); - }; - dst.dateEnded = dateEnded == null ? null : dateEnded.copy(); - dst.reasonEnded = reasonEnded == null ? null : reasonEnded.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - if (dosageInstruction != null) { - dst.dosageInstruction = new ArrayList(); - for (MedicationOrderDosageInstructionComponent i : dosageInstruction) - dst.dosageInstruction.add(i.copy()); - }; - dst.dispenseRequest = dispenseRequest == null ? null : dispenseRequest.copy(); - dst.substitution = substitution == null ? null : substitution.copy(); - dst.priorPrescription = priorPrescription == null ? null : priorPrescription.copy(); - return dst; - } - - protected MedicationOrder typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationOrder)) - return false; - MedicationOrder o = (MedicationOrder) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) - && compareDeep(patient, o.patient, true) && compareDeep(encounter, o.encounter, true) && compareDeep(dateWritten, o.dateWritten, true) - && compareDeep(prescriber, o.prescriber, true) && compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true) - && compareDeep(dateEnded, o.dateEnded, true) && compareDeep(reasonEnded, o.reasonEnded, true) && compareDeep(note, o.note, true) - && compareDeep(dosageInstruction, o.dosageInstruction, true) && compareDeep(dispenseRequest, o.dispenseRequest, true) - && compareDeep(substitution, o.substitution, true) && compareDeep(priorPrescription, o.priorPrescription, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationOrder)) - return false; - MedicationOrder o = (MedicationOrder) other; - return compareValues(status, o.status, true) && compareValues(dateWritten, o.dateWritten, true) && compareValues(dateEnded, o.dateEnded, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) - && (prescriber == null || prescriber.isEmpty()) && (reasonCode == null || reasonCode.isEmpty()) - && (reasonReference == null || reasonReference.isEmpty()) && (dateEnded == null || dateEnded.isEmpty()) - && (reasonEnded == null || reasonEnded.isEmpty()) && (note == null || note.isEmpty()) && (dosageInstruction == null || dosageInstruction.isEmpty()) - && (dispenseRequest == null || dispenseRequest.isEmpty()) && (substitution == null || substitution.isEmpty()) - && (priorPrescription == null || priorPrescription.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationOrder; - } - - /** - * Search parameter: medication - *

- * Description: Return administrations of this medication reference
- * Type: reference
- * Path: MedicationOrder.medicationReference
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationOrder.medication.as(Reference)", description="Return administrations of this medication reference", type="reference" ) - public static final String SP_MEDICATION = "medication"; - /** - * Fluent Client search parameter constant for medication - *

- * Description: Return administrations of this medication reference
- * Type: reference
- * Path: MedicationOrder.medicationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationOrder:medication". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationOrder:medication").toLocked(); - - /** - * Search parameter: datewritten - *

- * Description: Return prescriptions written on this date
- * Type: date
- * Path: MedicationOrder.dateWritten
- *

- */ - @SearchParamDefinition(name="datewritten", path="MedicationOrder.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: MedicationOrder.dateWritten
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATEWRITTEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATEWRITTEN); - - /** - * Search parameter: patient - *

- * Description: The identity of a patient to list orders for
- * Type: reference
- * Path: MedicationOrder.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MedicationOrder.patient", description="The identity of a patient to list orders 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 orders for
- * Type: reference
- * Path: MedicationOrder.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationOrder:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationOrder:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: Status of the prescription
- * Type: token
- * Path: MedicationOrder.status
- *

- */ - @SearchParamDefinition(name="status", path="MedicationOrder.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: MedicationOrder.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: prescriber - *

- * Description: Who ordered the medication(s)
- * Type: reference
- * Path: MedicationOrder.prescriber
- *

- */ - @SearchParamDefinition(name="prescriber", path="MedicationOrder.prescriber", description="Who ordered the medication(s)", type="reference" ) - public static final String SP_PRESCRIBER = "prescriber"; - /** - * Fluent Client search parameter constant for prescriber - *

- * Description: Who ordered the medication(s)
- * Type: reference
- * Path: MedicationOrder.prescriber
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIBER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationOrder:prescriber". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIBER = new ca.uhn.fhir.model.api.Include("MedicationOrder:prescriber").toLocked(); - - /** - * Search parameter: code - *

- * Description: Return administrations of this medication code
- * Type: token
- * Path: MedicationOrder.medicationCodeableConcept
- *

- */ - @SearchParamDefinition(name="code", path="MedicationOrder.medication.as(CodeableConcept)", description="Return administrations of this medication code", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Return administrations of this medication code
- * Type: token
- * Path: MedicationOrder.medicationCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: encounter - *

- * Description: Return prescriptions with this encounter identifier
- * Type: reference
- * Path: MedicationOrder.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="MedicationOrder.encounter", description="Return prescriptions with this encounter identifier", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Return prescriptions with this encounter identifier
- * Type: reference
- * Path: MedicationOrder.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationOrder:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("MedicationOrder:encounter").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Return prescriptions with this external identifier
- * Type: token
- * Path: MedicationOrder.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationOrder.identifier", description="Return prescriptions with this external identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return prescriptions with this external identifier
- * Type: token
- * Path: MedicationOrder.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationStatement.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationStatement.java deleted file mode 100644 index 93eefc07919..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MedicationStatement.java +++ /dev/null @@ -1,1935 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information. - */ -@ResourceDef(name="MedicationStatement", profile="http://hl7.org/fhir/Profile/MedicationStatement") -public class MedicationStatement extends DomainResource { - - public enum MedicationStatementStatus { - /** - * The medication is still being taken. - */ - ACTIVE, - /** - * The medication is no longer being taken. - */ - COMPLETED, - /** - * The statement was entered in error. - */ - ENTEREDINERROR, - /** - * The medication may be taken at some time in the future. - */ - INTENDED, - /** - * added to help the parsers - */ - NULL; - public static MedicationStatementStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return ACTIVE; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("intended".equals(codeString)) - return INTENDED; - throw new FHIRException("Unknown MedicationStatementStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ACTIVE: return "active"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - case INTENDED: return "intended"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ACTIVE: return "http://hl7.org/fhir/medication-statement-status"; - case COMPLETED: return "http://hl7.org/fhir/medication-statement-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/medication-statement-status"; - case INTENDED: return "http://hl7.org/fhir/medication-statement-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ACTIVE: return "The medication is still being taken."; - case COMPLETED: return "The medication is no longer being taken."; - case ENTEREDINERROR: return "The statement was entered in error."; - case INTENDED: return "The medication may be taken at some time in the future."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ACTIVE: return "Active"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in Error"; - case INTENDED: return "Intended"; - default: return "?"; - } - } - } - - public static class MedicationStatementStatusEnumFactory implements EnumFactory { - public MedicationStatementStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return MedicationStatementStatus.ACTIVE; - if ("completed".equals(codeString)) - return MedicationStatementStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return MedicationStatementStatus.ENTEREDINERROR; - if ("intended".equals(codeString)) - return MedicationStatementStatus.INTENDED; - throw new IllegalArgumentException("Unknown MedicationStatementStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("active".equals(codeString)) - return new Enumeration(this, MedicationStatementStatus.ACTIVE); - if ("completed".equals(codeString)) - return new Enumeration(this, MedicationStatementStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, MedicationStatementStatus.ENTEREDINERROR); - if ("intended".equals(codeString)) - return new Enumeration(this, MedicationStatementStatus.INTENDED); - throw new FHIRException("Unknown MedicationStatementStatus code '"+codeString+"'"); - } - public String toCode(MedicationStatementStatus code) { - if (code == MedicationStatementStatus.ACTIVE) - return "active"; - if (code == MedicationStatementStatus.COMPLETED) - return "completed"; - if (code == MedicationStatementStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == MedicationStatementStatus.INTENDED) - return "intended"; - return "?"; - } - public String toSystem(MedicationStatementStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class MedicationStatementDosageComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans. - */ - @Child(name = "text", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Free text dosage instructions as reported by the information source", formalDefinition="Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans." ) - protected StringType text; - - /** - * 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". - */ - @Child(name = "timing", type = {Timing.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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\"." ) - protected Timing timing; - - /** - * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Take \"as needed\" (for x)", formalDefinition="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule." ) - protected Type asNeeded; - - /** - * A coded specification of or a reference to the anatomic site where the medication first enters the body. - */ - @Child(name = "site", type = {CodeableConcept.class, BodySite.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where (on body) medication is/was administered", formalDefinition="A coded specification of or a reference to the anatomic site where the medication first enters the body." ) - protected Type site; - - /** - * A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject. - */ - @Child(name = "route", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How the medication entered the body", formalDefinition="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject." ) - protected CodeableConcept route; - - /** - * A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Technique used to administer medication", formalDefinition="A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV." ) - protected CodeableConcept method; - - /** - * The amount of therapeutic or other substance given at one administration event. - */ - @Child(name = "quantity", type = {SimpleQuantity.class, Range.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount administered in one dose", formalDefinition="The amount of therapeutic or other substance given at one administration event." ) - protected Type quantity; - - /** - * Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. - */ - @Child(name = "rate", type = {Ratio.class, Range.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Dose quantity per unit of time", formalDefinition="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours." ) - protected Type rate; - - /** - * The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours. - */ - @Child(name = "maxDosePerPeriod", type = {Ratio.class}, order=9, min=0, max=1, modifier=false, summary=true) - @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. For example, 1000mg in 24 hours." ) - protected Ratio maxDosePerPeriod; - - private static final long serialVersionUID = 246880733L; - - /** - * Constructor - */ - public MedicationStatementDosageComponent() { - super(); - } - - /** - * @return {@link #text} (Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public MedicationStatementDosageComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans. - */ - public MedicationStatementDosageComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #timing} (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 Timing getTiming() { - if (this.timing == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.timing"); - else if (Configuration.doAutoCreate()) - this.timing = new Timing(); // cc - return this.timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (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 MedicationStatementDosageComponent setTiming(Timing value) { - this.timing = value; - return this; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public BooleanType getAsNeededBooleanType() throws FHIRException { - if (!(this.asNeeded instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - public boolean hasAsNeededBooleanType() { - return this.asNeeded instanceof BooleanType; - } - - /** - * @return {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeededCodeableConcept() { - return this.asNeeded instanceof CodeableConcept; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). - -Specifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.) - */ - public MedicationStatementDosageComponent setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) - */ - public Type getSite() { - return this.site; - } - - /** - * @return {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) - */ - public CodeableConcept getSiteCodeableConcept() throws FHIRException { - if (!(this.site instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.site.getClass().getName()+" was encountered"); - return (CodeableConcept) this.site; - } - - public boolean hasSiteCodeableConcept() { - return this.site instanceof CodeableConcept; - } - - /** - * @return {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) - */ - public Reference getSiteReference() throws FHIRException { - if (!(this.site instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.site.getClass().getName()+" was encountered"); - return (Reference) this.site; - } - - public boolean hasSiteReference() { - return this.site instanceof Reference; - } - - public boolean hasSite() { - return this.site != null && !this.site.isEmpty(); - } - - /** - * @param value {@link #site} (A coded specification of or a reference to the anatomic site where the medication first enters the body.) - */ - public MedicationStatementDosageComponent setSite(Type value) { - this.site = value; - return this; - } - - /** - * @return {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public CodeableConcept getRoute() { - if (this.route == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.route"); - else if (Configuration.doAutoCreate()) - this.route = new CodeableConcept(); // cc - return this.route; - } - - public boolean hasRoute() { - return this.route != null && !this.route.isEmpty(); - } - - /** - * @param value {@link #route} (A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.) - */ - public MedicationStatementDosageComponent setRoute(CodeableConcept value) { - this.route = value; - return this; - } - - /** - * @return {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.) - */ - public MedicationStatementDosageComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public Type getQuantity() { - return this.quantity; - } - - /** - * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public SimpleQuantity getQuantitySimpleQuantity() throws FHIRException { - if (!(this.quantity instanceof SimpleQuantity)) - throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.quantity.getClass().getName()+" was encountered"); - return (SimpleQuantity) this.quantity; - } - - public boolean hasQuantitySimpleQuantity() { - return this.quantity instanceof SimpleQuantity; - } - - /** - * @return {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public Range getQuantityRange() throws FHIRException { - if (!(this.quantity instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.quantity.getClass().getName()+" was encountered"); - return (Range) this.quantity; - } - - public boolean hasQuantityRange() { - return this.quantity instanceof Range; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of therapeutic or other substance given at one administration event.) - */ - public MedicationStatementDosageComponent setQuantity(Type value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Type getRate() { - return this.rate; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Ratio getRateRatio() throws FHIRException { - if (!(this.rate instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Ratio) this.rate; - } - - public boolean hasRateRatio() { - return this.rate instanceof Ratio; - } - - /** - * @return {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public Range getRateRange() throws FHIRException { - if (!(this.rate instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Range) this.rate; - } - - public boolean hasRateRange() { - return this.rate instanceof Range; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.) - */ - public MedicationStatementDosageComponent setRate(Type value) { - this.rate = value; - return this; - } - - /** - * @return {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) - */ - public Ratio getMaxDosePerPeriod() { - if (this.maxDosePerPeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatementDosageComponent.maxDosePerPeriod"); - else if (Configuration.doAutoCreate()) - this.maxDosePerPeriod = new Ratio(); // cc - return this.maxDosePerPeriod; - } - - public boolean hasMaxDosePerPeriod() { - return this.maxDosePerPeriod != null && !this.maxDosePerPeriod.isEmpty(); - } - - /** - * @param value {@link #maxDosePerPeriod} (The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.) - */ - public MedicationStatementDosageComponent setMaxDosePerPeriod(Ratio value) { - this.maxDosePerPeriod = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("text", "string", "Free text dosage information as reported about a patient's medication use. When coded dosage information is present, the free text may still be present for display to humans.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("timing", "Timing", "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\".", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept). \n\nSpecifically if 'boolean' datatype is selected, then the following logic applies: If set to True, this indicates that the medication is only taken when needed, within the specified schedule.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("site[x]", "CodeableConcept|Reference(BodySite)", "A coded specification of or a reference to the anatomic site where the medication first enters the body.", 0, java.lang.Integer.MAX_VALUE, site)); - childrenList.add(new Property("route", "CodeableConcept", "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a subject.", 0, java.lang.Integer.MAX_VALUE, route)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value indicating the method by which the medication is intended to be or was introduced into or on the body. This attribute will most often NOT be populated. It is most commonly used for injections. For example, Slow Push, Deep IV.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("quantity[x]", "SimpleQuantity|Range", "The amount of therapeutic or other substance given at one administration event.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate[x]", "Ratio|Range", "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of '1' in the denominator, but this is being discussed. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.", 0, java.lang.Integer.MAX_VALUE, rate)); - childrenList.add(new Property("maxDosePerPeriod", "Ratio", "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxDosePerPeriod)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Timing - case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type - case 3530567: /*site*/ return this.site == null ? new Base[0] : new Base[] {this.site}; // Type - case 108704329: /*route*/ return this.route == null ? new Base[0] : new Base[] {this.route}; // CodeableConcept - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Type - case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type - case 1506263709: /*maxDosePerPeriod*/ return this.maxDosePerPeriod == null ? new Base[0] : new Base[] {this.maxDosePerPeriod}; // Ratio - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3556653: // text - this.text = castToString(value); // StringType - break; - case -873664438: // timing - this.timing = castToTiming(value); // Timing - break; - case -1432923513: // asNeeded - this.asNeeded = (Type) value; // Type - break; - case 3530567: // site - this.site = (Type) value; // Type - break; - case 108704329: // route - this.route = castToCodeableConcept(value); // CodeableConcept - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case -1285004149: // quantity - this.quantity = (Type) value; // Type - break; - case 3493088: // rate - this.rate = (Type) value; // Type - break; - case 1506263709: // maxDosePerPeriod - this.maxDosePerPeriod = castToRatio(value); // Ratio - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("timing")) - this.timing = castToTiming(value); // Timing - else if (name.equals("asNeeded[x]")) - this.asNeeded = (Type) value; // Type - else if (name.equals("site[x]")) - this.site = (Type) value; // Type - else if (name.equals("route")) - this.route = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("quantity[x]")) - this.quantity = (Type) value; // Type - else if (name.equals("rate[x]")) - this.rate = (Type) value; // Type - else if (name.equals("maxDosePerPeriod")) - this.maxDosePerPeriod = castToRatio(value); // Ratio - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -873664438: return getTiming(); // Timing - case -544329575: return getAsNeeded(); // Type - case 2099997657: return getSite(); // Type - case 108704329: return getRoute(); // CodeableConcept - case -1077554975: return getMethod(); // CodeableConcept - case -515002347: return getQuantity(); // Type - case 983460768: return getRate(); // Type - case 1506263709: return getMaxDosePerPeriod(); // Ratio - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.text"); - } - else if (name.equals("timing")) { - this.timing = new Timing(); - return this.timing; - } - else if (name.equals("asNeededBoolean")) { - this.asNeeded = new BooleanType(); - return this.asNeeded; - } - else if (name.equals("asNeededCodeableConcept")) { - this.asNeeded = new CodeableConcept(); - return this.asNeeded; - } - else if (name.equals("siteCodeableConcept")) { - this.site = new CodeableConcept(); - return this.site; - } - else if (name.equals("siteReference")) { - this.site = new Reference(); - return this.site; - } - else if (name.equals("route")) { - this.route = new CodeableConcept(); - return this.route; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("quantitySimpleQuantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("quantityRange")) { - this.quantity = new Range(); - return this.quantity; - } - else if (name.equals("rateRatio")) { - this.rate = new Ratio(); - return this.rate; - } - else if (name.equals("rateRange")) { - this.rate = new Range(); - return this.rate; - } - else if (name.equals("maxDosePerPeriod")) { - this.maxDosePerPeriod = new Ratio(); - return this.maxDosePerPeriod; - } - else - return super.addChild(name); - } - - public MedicationStatementDosageComponent copy() { - MedicationStatementDosageComponent dst = new MedicationStatementDosageComponent(); - copyValues(dst); - dst.text = text == null ? null : text.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.site = site == null ? null : site.copy(); - dst.route = route == null ? null : route.copy(); - dst.method = method == null ? null : method.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - dst.maxDosePerPeriod = maxDosePerPeriod == null ? null : maxDosePerPeriod.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationStatementDosageComponent)) - return false; - MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; - return compareDeep(text, o.text, true) && compareDeep(timing, o.timing, true) && compareDeep(asNeeded, o.asNeeded, true) - && compareDeep(site, o.site, true) && compareDeep(route, o.route, true) && compareDeep(method, o.method, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) && compareDeep(maxDosePerPeriod, o.maxDosePerPeriod, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationStatementDosageComponent)) - return false; - MedicationStatementDosageComponent o = (MedicationStatementDosageComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (text == null || text.isEmpty()) && (timing == null || timing.isEmpty()) - && (asNeeded == null || asNeeded.isEmpty()) && (site == null || site.isEmpty()) && (route == null || route.isEmpty()) - && (method == null || method.isEmpty()) && (quantity == null || quantity.isEmpty()) && (rate == null || rate.isEmpty()) - && (maxDosePerPeriod == null || maxDosePerPeriod.isEmpty()); - } - - public String fhirType() { - return "MedicationStatement.dosage"; - - } - - } - - /** - * External identifier - FHIR will generate its own internal identifiers (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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External identifier", formalDefinition="External identifier - FHIR will generate its own internal identifiers (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." ) - protected List identifier; - - /** - * A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="active | completed | entered-in-error | intended", formalDefinition="A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed." ) - protected Enumeration status; - - /** - * 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. - */ - @Child(name = "medication", type = {CodeableConcept.class, Medication.class}, order=2, min=1, max=1, modifier=false, summary=true) - @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." ) - protected Type medication; - - /** - * The person or animal who is/was taking the medication. - */ - @Child(name = "patient", type = {Patient.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who is/was taking the medication", formalDefinition="The person or animal who is/was taking the medication." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person or animal who is/was taking the medication.) - */ - protected Patient patientTarget; - - /** - * The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true). - */ - @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=4, min=0, max=1, modifier=false, summary=true) - @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 (or was not taking, when the wasNotGiven element is true)." ) - protected Type effective; - - /** - * The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder. - */ - @Child(name = "informationSource", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Person who provided the information about the taking of this medication", formalDefinition="The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder." ) - protected Reference informationSource; - - /** - * The actual object that is the target of the reference (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) - */ - protected Resource informationSourceTarget; - - /** - * Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement. - */ - @Child(name = "supportingInformation", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional supporting information", formalDefinition="Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) - */ - protected List supportingInformationTarget; - - - /** - * The date when the medication statement was asserted by the information source. - */ - @Child(name = "dateAsserted", type = {DateTimeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the statement was asserted?", formalDefinition="The date when the medication statement was asserted by the information source." ) - protected DateTimeType dateAsserted; - - /** - * Set this to true if the record is saying that the medication was NOT taken. - */ - @Child(name = "wasNotTaken", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true) - @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." ) - protected BooleanType wasNotTaken; - - /** - * A code indicating why the medication was not taken. - */ - @Child(name = "reasonNotTaken", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="True if asserting medication was not given", formalDefinition="A code indicating why the medication was not taken." ) - protected List reasonNotTaken; - - /** - * A reason for why the medication is being/was taken. - */ - @Child(name = "reasonForUse", type = {CodeableConcept.class, Condition.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="A reason for why the medication is being/was taken." ) - protected Type reasonForUse; - - /** - * Provides extra information about the medication statement that is not conveyed by the other attributes. - */ - @Child(name = "note", type = {Annotation.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Further information about the statement", formalDefinition="Provides extra information about the medication statement that is not conveyed by the other attributes." ) - protected List note; - - /** - * Indicates how the medication is/was used by the patient. - */ - @Child(name = "dosage", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Details of how medication was taken", formalDefinition="Indicates how the medication is/was used by the patient." ) - protected List dosage; - - private static final long serialVersionUID = -425948910L; - - /** - * Constructor - */ - public MedicationStatement() { - super(); - } - - /** - * Constructor - */ - public MedicationStatement(Enumeration status, Type medication, Reference patient) { - super(); - this.status = status; - this.medication = medication; - this.patient = patient; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal identifiers (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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External identifier - FHIR will generate its own internal identifiers (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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public MedicationStatement setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed. - */ - public MedicationStatementStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed. - */ - public MedicationStatement setStatus(MedicationStatementStatus value) { - if (this.status == null) - this.status = new Enumeration(new MedicationStatementStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #medication} (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 Type getMedication() { - return this.medication; - } - - /** - * @return {@link #medication} (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 CodeableConcept getMedicationCodeableConcept() throws FHIRException { - if (!(this.medication instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (CodeableConcept) this.medication; - } - - public boolean hasMedicationCodeableConcept() { - return this.medication instanceof CodeableConcept; - } - - /** - * @return {@link #medication} (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 Reference getMedicationReference() throws FHIRException { - if (!(this.medication instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.medication.getClass().getName()+" was encountered"); - return (Reference) this.medication; - } - - public boolean hasMedicationReference() { - return this.medication instanceof Reference; - } - - public boolean hasMedication() { - return this.medication != null && !this.medication.isEmpty(); - } - - /** - * @param value {@link #medication} (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(Type value) { - this.medication = value; - return this; - } - - /** - * @return {@link #patient} (The person or animal who is/was taking the medication.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person or animal who is/was taking the medication.) - */ - public MedicationStatement setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person or animal who is/was taking the medication.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person or animal who is/was taking the medication.) - */ - public MedicationStatement setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) - */ - public Type getEffective() { - return this.effective; - } - - /** - * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) - */ - public DateTimeType getEffectiveDateTimeType() throws FHIRException { - if (!(this.effective instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (DateTimeType) this.effective; - } - - public boolean hasEffectiveDateTimeType() { - return this.effective instanceof DateTimeType; - } - - /** - * @return {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) - */ - public Period getEffectivePeriod() throws FHIRException { - if (!(this.effective instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (Period) this.effective; - } - - public boolean hasEffectivePeriod() { - return this.effective instanceof Period; - } - - public boolean hasEffective() { - return this.effective != null && !this.effective.isEmpty(); - } - - /** - * @param value {@link #effective} (The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).) - */ - public MedicationStatement setEffective(Type value) { - this.effective = value; - return this; - } - - /** - * @return {@link #informationSource} (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) - */ - public Reference getInformationSource() { - if (this.informationSource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.informationSource"); - else if (Configuration.doAutoCreate()) - this.informationSource = new Reference(); // cc - return this.informationSource; - } - - public boolean hasInformationSource() { - return this.informationSource != null && !this.informationSource.isEmpty(); - } - - /** - * @param value {@link #informationSource} (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) - */ - public MedicationStatement setInformationSource(Reference value) { - this.informationSource = value; - return this; - } - - /** - * @return {@link #informationSource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) - */ - public Resource getInformationSourceTarget() { - return this.informationSourceTarget; - } - - /** - * @param value {@link #informationSource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.) - */ - public MedicationStatement setInformationSourceTarget(Resource value) { - this.informationSourceTarget = value; - return this; - } - - /** - * @return {@link #supportingInformation} (Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addSupportingInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - /** - * @return {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public DateTimeType getDateAssertedElement() { - if (this.dateAsserted == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.dateAsserted"); - else if (Configuration.doAutoCreate()) - this.dateAsserted = new DateTimeType(); // bb - return this.dateAsserted; - } - - public boolean hasDateAssertedElement() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - public boolean hasDateAsserted() { - return this.dateAsserted != null && !this.dateAsserted.isEmpty(); - } - - /** - * @param value {@link #dateAsserted} (The date when the medication statement was asserted by the information source.). This is the underlying object with id, value and extensions. The accessor "getDateAsserted" gives direct access to the value - */ - public MedicationStatement setDateAssertedElement(DateTimeType value) { - this.dateAsserted = value; - return this; - } - - /** - * @return The date when the medication statement was asserted by the information source. - */ - public Date getDateAsserted() { - return this.dateAsserted == null ? null : this.dateAsserted.getValue(); - } - - /** - * @param value The date when the medication statement was asserted by the information source. - */ - public MedicationStatement setDateAsserted(Date value) { - if (value == null) - this.dateAsserted = null; - else { - if (this.dateAsserted == null) - this.dateAsserted = new DateTimeType(); - this.dateAsserted.setValue(value); - } - return this; - } - - /** - * @return {@link #wasNotTaken} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotTaken" gives direct access to the value - */ - public BooleanType getWasNotTakenElement() { - if (this.wasNotTaken == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MedicationStatement.wasNotTaken"); - else if (Configuration.doAutoCreate()) - this.wasNotTaken = new BooleanType(); // bb - return this.wasNotTaken; - } - - public boolean hasWasNotTakenElement() { - return this.wasNotTaken != null && !this.wasNotTaken.isEmpty(); - } - - public boolean hasWasNotTaken() { - return this.wasNotTaken != null && !this.wasNotTaken.isEmpty(); - } - - /** - * @param value {@link #wasNotTaken} (Set this to true if the record is saying that the medication was NOT taken.). This is the underlying object with id, value and extensions. The accessor "getWasNotTaken" gives direct access to the value - */ - public MedicationStatement setWasNotTakenElement(BooleanType value) { - this.wasNotTaken = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the medication was NOT taken. - */ - public boolean getWasNotTaken() { - return this.wasNotTaken == null || this.wasNotTaken.isEmpty() ? false : this.wasNotTaken.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the medication was NOT taken. - */ - public MedicationStatement setWasNotTaken(boolean value) { - if (this.wasNotTaken == null) - this.wasNotTaken = new BooleanType(); - this.wasNotTaken.setValue(value); - return this; - } - - /** - * @return {@link #reasonNotTaken} (A code indicating why the medication was not taken.) - */ - public List getReasonNotTaken() { - if (this.reasonNotTaken == null) - this.reasonNotTaken = new ArrayList(); - return this.reasonNotTaken; - } - - public boolean hasReasonNotTaken() { - if (this.reasonNotTaken == null) - return false; - for (CodeableConcept item : this.reasonNotTaken) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotTaken} (A code indicating why the medication was not taken.) - */ - // syntactic sugar - public CodeableConcept addReasonNotTaken() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotTaken == null) - this.reasonNotTaken = new ArrayList(); - this.reasonNotTaken.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addReasonNotTaken(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotTaken == null) - this.reasonNotTaken = new ArrayList(); - this.reasonNotTaken.add(t); - return this; - } - - /** - * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public Type getReasonForUse() { - return this.reasonForUse; - } - - /** - * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public CodeableConcept getReasonForUseCodeableConcept() throws FHIRException { - if (!(this.reasonForUse instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reasonForUse; - } - - public boolean hasReasonForUseCodeableConcept() { - return this.reasonForUse instanceof CodeableConcept; - } - - /** - * @return {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public Reference getReasonForUseReference() throws FHIRException { - if (!(this.reasonForUse instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reasonForUse.getClass().getName()+" was encountered"); - return (Reference) this.reasonForUse; - } - - public boolean hasReasonForUseReference() { - return this.reasonForUse instanceof Reference; - } - - public boolean hasReasonForUse() { - return this.reasonForUse != null && !this.reasonForUse.isEmpty(); - } - - /** - * @param value {@link #reasonForUse} (A reason for why the medication is being/was taken.) - */ - public MedicationStatement setReasonForUse(Type value) { - this.reasonForUse = value; - return this; - } - - /** - * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (Annotation item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Provides extra information about the medication statement that is not conveyed by the other attributes.) - */ - // syntactic sugar - public Annotation addNote() { //3 - Annotation t = new Annotation(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addNote(Annotation t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - public List getDosage() { - if (this.dosage == null) - this.dosage = new ArrayList(); - return this.dosage; - } - - public boolean hasDosage() { - if (this.dosage == null) - return false; - for (MedicationStatementDosageComponent item : this.dosage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dosage} (Indicates how the medication is/was used by the patient.) - */ - // syntactic sugar - public MedicationStatementDosageComponent addDosage() { //3 - MedicationStatementDosageComponent t = new MedicationStatementDosageComponent(); - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return t; - } - - // syntactic sugar - public MedicationStatement addDosage(MedicationStatementDosageComponent t) { //3 - if (t == null) - return this; - if (this.dosage == null) - this.dosage = new ArrayList(); - this.dosage.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External identifier - FHIR will generate its own internal identifiers (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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("medication[x]", "CodeableConcept|Reference(Medication)", "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.", 0, java.lang.Integer.MAX_VALUE, medication)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person or animal who is/was taking the medication.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("effective[x]", "dateTime|Period", "The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).", 0, java.lang.Integer.MAX_VALUE, effective)); - childrenList.add(new Property("informationSource", "Reference(Patient|Practitioner|RelatedPerson)", "The person who provided the information about the taking of this medication. Note: A MedicationStatement may be derived from supportingInformation e.g claims or medicationOrder.", 0, java.lang.Integer.MAX_VALUE, informationSource)); - childrenList.add(new Property("supportingInformation", "Reference(Any)", "Allows linking the MedicationStatement to the underlying MedicationOrder, or to other information that supports or is used to derive the MedicationStatement.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - childrenList.add(new Property("dateAsserted", "dateTime", "The date when the medication statement was asserted by the information source.", 0, java.lang.Integer.MAX_VALUE, dateAsserted)); - childrenList.add(new Property("wasNotTaken", "boolean", "Set this to true if the record is saying that the medication was NOT taken.", 0, java.lang.Integer.MAX_VALUE, wasNotTaken)); - childrenList.add(new Property("reasonNotTaken", "CodeableConcept", "A code indicating why the medication was not taken.", 0, java.lang.Integer.MAX_VALUE, reasonNotTaken)); - childrenList.add(new Property("reasonForUse[x]", "CodeableConcept|Reference(Condition)", "A reason for why the medication is being/was taken.", 0, java.lang.Integer.MAX_VALUE, reasonForUse)); - childrenList.add(new Property("note", "Annotation", "Provides extra information about the medication statement that is not conveyed by the other attributes.", 0, java.lang.Integer.MAX_VALUE, note)); - childrenList.add(new Property("dosage", "", "Indicates how the medication is/was used by the patient.", 0, java.lang.Integer.MAX_VALUE, dosage)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 1998965455: /*medication*/ return this.medication == null ? new Base[0] : new Base[] {this.medication}; // Type - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type - case -2123220889: /*informationSource*/ return this.informationSource == null ? new Base[0] : new Base[] {this.informationSource}; // Reference - case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference - case -1980855245: /*dateAsserted*/ return this.dateAsserted == null ? new Base[0] : new Base[] {this.dateAsserted}; // DateTimeType - case -1039154243: /*wasNotTaken*/ return this.wasNotTaken == null ? new Base[0] : new Base[] {this.wasNotTaken}; // BooleanType - case 2112880664: /*reasonNotTaken*/ return this.reasonNotTaken == null ? new Base[0] : this.reasonNotTaken.toArray(new Base[this.reasonNotTaken.size()]); // CodeableConcept - case -1724097694: /*reasonForUse*/ return this.reasonForUse == null ? new Base[0] : new Base[] {this.reasonForUse}; // Type - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // Annotation - case -1326018889: /*dosage*/ return this.dosage == null ? new Base[0] : this.dosage.toArray(new Base[this.dosage.size()]); // MedicationStatementDosageComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new MedicationStatementStatusEnumFactory().fromType(value); // Enumeration - break; - case 1998965455: // medication - this.medication = (Type) value; // Type - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -1468651097: // effective - this.effective = (Type) value; // Type - break; - case -2123220889: // informationSource - this.informationSource = castToReference(value); // Reference - break; - case -1248768647: // supportingInformation - this.getSupportingInformation().add(castToReference(value)); // Reference - break; - case -1980855245: // dateAsserted - this.dateAsserted = castToDateTime(value); // DateTimeType - break; - case -1039154243: // wasNotTaken - this.wasNotTaken = castToBoolean(value); // BooleanType - break; - case 2112880664: // reasonNotTaken - this.getReasonNotTaken().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1724097694: // reasonForUse - this.reasonForUse = (Type) value; // Type - break; - case 3387378: // note - this.getNote().add(castToAnnotation(value)); // Annotation - break; - case -1326018889: // dosage - this.getDosage().add((MedicationStatementDosageComponent) value); // MedicationStatementDosageComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new MedicationStatementStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("medication[x]")) - this.medication = (Type) value; // Type - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("effective[x]")) - this.effective = (Type) value; // Type - else if (name.equals("informationSource")) - this.informationSource = castToReference(value); // Reference - else if (name.equals("supportingInformation")) - this.getSupportingInformation().add(castToReference(value)); - else if (name.equals("dateAsserted")) - this.dateAsserted = castToDateTime(value); // DateTimeType - else if (name.equals("wasNotTaken")) - this.wasNotTaken = castToBoolean(value); // BooleanType - else if (name.equals("reasonNotTaken")) - this.getReasonNotTaken().add(castToCodeableConcept(value)); - else if (name.equals("reasonForUse[x]")) - this.reasonForUse = (Type) value; // Type - else if (name.equals("note")) - this.getNote().add(castToAnnotation(value)); - else if (name.equals("dosage")) - this.getDosage().add((MedicationStatementDosageComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 1458402129: return getMedication(); // Type - case -791418107: return getPatient(); // Reference - case 247104889: return getEffective(); // Type - case -2123220889: return getInformationSource(); // Reference - case -1248768647: return addSupportingInformation(); // Reference - case -1980855245: throw new FHIRException("Cannot make property dateAsserted as it is not a complex type"); // DateTimeType - case -1039154243: throw new FHIRException("Cannot make property wasNotTaken as it is not a complex type"); // BooleanType - case 2112880664: return addReasonNotTaken(); // CodeableConcept - case 919582174: return getReasonForUse(); // Type - case 3387378: return addNote(); // Annotation - case -1326018889: return addDosage(); // MedicationStatementDosageComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.status"); - } - else if (name.equals("medicationCodeableConcept")) { - this.medication = new CodeableConcept(); - return this.medication; - } - else if (name.equals("medicationReference")) { - this.medication = new Reference(); - return this.medication; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("effectiveDateTime")) { - this.effective = new DateTimeType(); - return this.effective; - } - else if (name.equals("effectivePeriod")) { - this.effective = new Period(); - return this.effective; - } - else if (name.equals("informationSource")) { - this.informationSource = new Reference(); - return this.informationSource; - } - else if (name.equals("supportingInformation")) { - return addSupportingInformation(); - } - else if (name.equals("dateAsserted")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.dateAsserted"); - } - else if (name.equals("wasNotTaken")) { - throw new FHIRException("Cannot call addChild on a primitive type MedicationStatement.wasNotTaken"); - } - else if (name.equals("reasonNotTaken")) { - return addReasonNotTaken(); - } - else if (name.equals("reasonForUseCodeableConcept")) { - this.reasonForUse = new CodeableConcept(); - return this.reasonForUse; - } - else if (name.equals("reasonForUseReference")) { - this.reasonForUse = new Reference(); - return this.reasonForUse; - } - else if (name.equals("note")) { - return addNote(); - } - else if (name.equals("dosage")) { - return addDosage(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "MedicationStatement"; - - } - - public MedicationStatement copy() { - MedicationStatement dst = new MedicationStatement(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.medication = medication == null ? null : medication.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.effective = effective == null ? null : effective.copy(); - dst.informationSource = informationSource == null ? null : informationSource.copy(); - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - dst.dateAsserted = dateAsserted == null ? null : dateAsserted.copy(); - dst.wasNotTaken = wasNotTaken == null ? null : wasNotTaken.copy(); - if (reasonNotTaken != null) { - dst.reasonNotTaken = new ArrayList(); - for (CodeableConcept i : reasonNotTaken) - dst.reasonNotTaken.add(i.copy()); - }; - dst.reasonForUse = reasonForUse == null ? null : reasonForUse.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (Annotation i : note) - dst.note.add(i.copy()); - }; - if (dosage != null) { - dst.dosage = new ArrayList(); - for (MedicationStatementDosageComponent i : dosage) - dst.dosage.add(i.copy()); - }; - return dst; - } - - protected MedicationStatement typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MedicationStatement)) - return false; - MedicationStatement o = (MedicationStatement) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(medication, o.medication, true) - && compareDeep(patient, o.patient, true) && compareDeep(effective, o.effective, true) && compareDeep(informationSource, o.informationSource, true) - && compareDeep(supportingInformation, o.supportingInformation, true) && compareDeep(dateAsserted, o.dateAsserted, true) - && compareDeep(wasNotTaken, o.wasNotTaken, true) && compareDeep(reasonNotTaken, o.reasonNotTaken, true) - && compareDeep(reasonForUse, o.reasonForUse, true) && compareDeep(note, o.note, true) && compareDeep(dosage, o.dosage, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MedicationStatement)) - return false; - MedicationStatement o = (MedicationStatement) other; - return compareValues(status, o.status, true) && compareValues(dateAsserted, o.dateAsserted, true) && compareValues(wasNotTaken, o.wasNotTaken, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (medication == null || medication.isEmpty()) && (patient == null || patient.isEmpty()) - && (effective == null || effective.isEmpty()) && (informationSource == null || informationSource.isEmpty()) - && (supportingInformation == null || supportingInformation.isEmpty()) && (dateAsserted == null || dateAsserted.isEmpty()) - && (wasNotTaken == null || wasNotTaken.isEmpty()) && (reasonNotTaken == null || reasonNotTaken.isEmpty()) - && (reasonForUse == null || reasonForUse.isEmpty()) && (note == null || note.isEmpty()) && (dosage == null || dosage.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MedicationStatement; - } - - /** - * Search parameter: medication - *

- * Description: Return administrations of this medication reference
- * Type: reference
- * Path: MedicationStatement.medicationReference
- *

- */ - @SearchParamDefinition(name="medication", path="MedicationStatement.medication.as(Reference)", description="Return administrations of this medication reference", type="reference" ) - public static final String SP_MEDICATION = "medication"; - /** - * Fluent Client search parameter constant for medication - *

- * Description: Return administrations of this medication reference
- * Type: reference
- * Path: MedicationStatement.medicationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam MEDICATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_MEDICATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement:medication". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_MEDICATION = new ca.uhn.fhir.model.api.Include("MedicationStatement:medication").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The identity of a patient to list statements for
- * Type: reference
- * Path: MedicationStatement.patient
- *

- */ - @SearchParamDefinition(name="patient", path="MedicationStatement.patient", description="The identity of a patient to list statements 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 statements for
- * Type: reference
- * Path: MedicationStatement.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("MedicationStatement:patient").toLocked(); - - /** - * Search parameter: source - *

- * Description: Who the information in the statement came from
- * Type: reference
- * Path: MedicationStatement.informationSource
- *

- */ - @SearchParamDefinition(name="source", path="MedicationStatement.informationSource", description="Who the information in the statement came from", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Who the information in the statement came from
- * Type: reference
- * Path: MedicationStatement.informationSource
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MedicationStatement:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("MedicationStatement:source").toLocked(); - - /** - * Search parameter: status - *

- * Description: Return statements that match the given status
- * Type: token
- * Path: MedicationStatement.status
- *

- */ - @SearchParamDefinition(name="status", path="MedicationStatement.status", description="Return statements that match the given status", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: Return statements that match the given status
- * Type: token
- * Path: MedicationStatement.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: code - *

- * Description: Return administrations of this medication code
- * Type: token
- * Path: MedicationStatement.medicationCodeableConcept
- *

- */ - @SearchParamDefinition(name="code", path="MedicationStatement.medication.as(CodeableConcept)", description="Return administrations of this medication code", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Return administrations of this medication code
- * Type: token
- * Path: MedicationStatement.medicationCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: identifier - *

- * Description: Return statements with this external identifier
- * Type: token
- * Path: MedicationStatement.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="MedicationStatement.identifier", description="Return statements with this external identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return statements with this external identifier
- * Type: token
- * Path: MedicationStatement.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: effective - *

- * Description: Date when patient was taking (or not taking) the medication
- * Type: date
- * Path: MedicationStatement.effective[x]
- *

- */ - @SearchParamDefinition(name="effective", path="MedicationStatement.effective", description="Date when patient was taking (or not taking) the medication", type="date" ) - public static final String SP_EFFECTIVE = "effective"; - /** - * Fluent Client search parameter constant for effective - *

- * Description: Date when patient was taking (or not taking) the medication
- * Type: date
- * Path: MedicationStatement.effective[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam EFFECTIVE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EFFECTIVE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MessageHeader.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MessageHeader.java deleted file mode 100644 index 12da302dd3d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/MessageHeader.java +++ /dev/null @@ -1,2236 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The header for a message exchange that is either requesting or responding to an action. The reference(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. - */ -@ResourceDef(name="MessageHeader", profile="http://hl7.org/fhir/Profile/MessageHeader") -public class MessageHeader extends DomainResource { - - public enum ResponseType { - /** - * The message was accepted and processed without error. - */ - OK, - /** - * Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required. - */ - TRANSIENTERROR, - /** - * The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe the issue. - */ - FATALERROR, - /** - * added to help the parsers - */ - NULL; - public static ResponseType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return OK; - if ("transient-error".equals(codeString)) - return TRANSIENTERROR; - if ("fatal-error".equals(codeString)) - return FATALERROR; - throw new FHIRException("Unknown ResponseType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OK: return "ok"; - case TRANSIENTERROR: return "transient-error"; - case FATALERROR: return "fatal-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OK: return "http://hl7.org/fhir/response-code"; - case TRANSIENTERROR: return "http://hl7.org/fhir/response-code"; - case FATALERROR: return "http://hl7.org/fhir/response-code"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OK: return "The message was accepted and processed without error."; - case TRANSIENTERROR: return "Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like database unavailable, which may be expected to resolve, though human intervention may be required."; - case FATALERROR: return "The message was rejected because of some content in it. There is no point in re-sending without change. The response narrative SHALL describe the issue."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OK: return "OK"; - case TRANSIENTERROR: return "Transient Error"; - case FATALERROR: return "Fatal Error"; - default: return "?"; - } - } - } - - public static class ResponseTypeEnumFactory implements EnumFactory { - public ResponseType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return ResponseType.OK; - if ("transient-error".equals(codeString)) - return ResponseType.TRANSIENTERROR; - if ("fatal-error".equals(codeString)) - return ResponseType.FATALERROR; - throw new IllegalArgumentException("Unknown ResponseType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("ok".equals(codeString)) - return new Enumeration(this, ResponseType.OK); - if ("transient-error".equals(codeString)) - return new Enumeration(this, ResponseType.TRANSIENTERROR); - if ("fatal-error".equals(codeString)) - return new Enumeration(this, ResponseType.FATALERROR); - throw new FHIRException("Unknown ResponseType code '"+codeString+"'"); - } - public String toCode(ResponseType code) { - if (code == ResponseType.OK) - return "ok"; - if (code == ResponseType.TRANSIENTERROR) - return "transient-error"; - if (code == ResponseType.FATALERROR) - return "fatal-error"; - return "?"; - } - public String toSystem(ResponseType code) { - return code.getSystem(); - } - } - - @Block() - public static class MessageHeaderResponseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The id of the message that this message is a response to. - */ - @Child(name = "identifier", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Id of original message", formalDefinition="The id of the message that this message is a response to." ) - protected IdType identifier; - - /** - * Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not. - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @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." ) - protected Enumeration code; - - /** - * Full details of any issues found in the message. - */ - @Child(name = "details", type = {OperationOutcome.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific list of hints/warnings/errors", formalDefinition="Full details of any issues found in the message." ) - protected Reference details; - - /** - * The actual object that is the target of the reference (Full details of any issues found in the message.) - */ - protected OperationOutcome detailsTarget; - - private static final long serialVersionUID = -1008716838L; - - /** - * Constructor - */ - public MessageHeaderResponseComponent() { - super(); - } - - /** - * Constructor - */ - public MessageHeaderResponseComponent(IdType identifier, Enumeration code) { - super(); - this.identifier = identifier; - this.code = code; - } - - /** - * @return {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public IdType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new IdType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The id of the message that this message is a response to.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public MessageHeaderResponseComponent setIdentifierElement(IdType value) { - this.identifier = value; - return this; - } - - /** - * @return The id of the message that this message is a response to. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The id of the message that this message is a response to. - */ - public MessageHeaderResponseComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new IdType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new ResponseTypeEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public MessageHeaderResponseComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return 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 ResponseType getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value 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 MessageHeaderResponseComponent setCode(ResponseType value) { - if (this.code == null) - this.code = new Enumeration(new ResponseTypeEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #details} (Full details of any issues found in the message.) - */ - public Reference getDetails() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new Reference(); // cc - return this.details; - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (Full details of any issues found in the message.) - */ - public MessageHeaderResponseComponent setDetails(Reference value) { - this.details = value; - return this; - } - - /** - * @return {@link #details} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) - */ - public OperationOutcome getDetailsTarget() { - if (this.detailsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeaderResponseComponent.details"); - else if (Configuration.doAutoCreate()) - this.detailsTarget = new OperationOutcome(); // aa - return this.detailsTarget; - } - - /** - * @param value {@link #details} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Full details of any issues found in the message.) - */ - public MessageHeaderResponseComponent setDetailsTarget(OperationOutcome value) { - this.detailsTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "id", "The id of the message that this message is a response to.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "code", "Code that identifies the type of response to the message - whether it was successful or not, and whether it should be resent or not.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("details", "Reference(OperationOutcome)", "Full details of any issues found in the message.", 0, java.lang.Integer.MAX_VALUE, details)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // IdType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case 1557721666: /*details*/ return this.details == null ? new Base[0] : new Base[] {this.details}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToId(value); // IdType - break; - case 3059181: // code - this.code = new ResponseTypeEnumFactory().fromType(value); // Enumeration - break; - case 1557721666: // details - this.details = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToId(value); // IdType - else if (name.equals("code")) - this.code = new ResponseTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("details")) - this.details = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // IdType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case 1557721666: return getDetails(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.identifier"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.code"); - } - else if (name.equals("details")) { - this.details = new Reference(); - return this.details; - } - else - return super.addChild(name); - } - - public MessageHeaderResponseComponent copy() { - MessageHeaderResponseComponent dst = new MessageHeaderResponseComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.code = code == null ? null : code.copy(); - dst.details = details == null ? null : details.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageHeaderResponseComponent)) - return false; - MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageHeaderResponseComponent)) - return false; - MessageHeaderResponseComponent o = (MessageHeaderResponseComponent) other; - return compareValues(identifier, o.identifier, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (details == null || details.isEmpty()); - } - - public String fhirType() { - return "MessageHeader.response"; - - } - - } - - @Block() - public static class MessageSourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human-readable name for the source system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the source system." ) - protected StringType name; - - /** - * May include configuration or other information useful in debugging. - */ - @Child(name = "software", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of software running the system", formalDefinition="May include configuration or other information useful in debugging." ) - protected StringType software; - - /** - * Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Version of software running", formalDefinition="Can convey versions of multiple systems in situations where a message passes through multiple hands." ) - protected StringType version; - - /** - * An e-mail, phone, website or other contact point to use to resolve issues with message communications. - */ - @Child(name = "contact", type = {ContactPoint.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human contact for problems", formalDefinition="An e-mail, phone, website or other contact point to use to resolve issues with message communications." ) - protected ContactPoint contact; - - /** - * Identifies the routing target to send acknowledgements to. - */ - @Child(name = "endpoint", type = {UriType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Actual message source address or id", formalDefinition="Identifies the routing target to send acknowledgements to." ) - protected UriType endpoint; - - private static final long serialVersionUID = -115878196L; - - /** - * Constructor - */ - public MessageSourceComponent() { - super(); - } - - /** - * Constructor - */ - public MessageSourceComponent(UriType endpoint) { - super(); - this.endpoint = endpoint; - } - - /** - * @return {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Human-readable name for the source system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MessageSourceComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-readable name for the source system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-readable name for the source system. - */ - public MessageSourceComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value - */ - public StringType getSoftwareElement() { - if (this.software == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.software"); - else if (Configuration.doAutoCreate()) - this.software = new StringType(); // bb - return this.software; - } - - public boolean hasSoftwareElement() { - return this.software != null && !this.software.isEmpty(); - } - - public boolean hasSoftware() { - return this.software != null && !this.software.isEmpty(); - } - - /** - * @param value {@link #software} (May include configuration or other information useful in debugging.). This is the underlying object with id, value and extensions. The accessor "getSoftware" gives direct access to the value - */ - public MessageSourceComponent setSoftwareElement(StringType value) { - this.software = value; - return this; - } - - /** - * @return May include configuration or other information useful in debugging. - */ - public String getSoftware() { - return this.software == null ? null : this.software.getValue(); - } - - /** - * @param value May include configuration or other information useful in debugging. - */ - public MessageSourceComponent setSoftware(String value) { - if (Utilities.noString(value)) - this.software = null; - else { - if (this.software == null) - this.software = new StringType(); - this.software.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Can convey versions of multiple systems in situations where a message passes through multiple hands.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public MessageSourceComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Can convey versions of multiple systems in situations where a message passes through multiple hands. - */ - public MessageSourceComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) - */ - public ContactPoint getContact() { - if (this.contact == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.contact"); - else if (Configuration.doAutoCreate()) - this.contact = new ContactPoint(); // cc - return this.contact; - } - - public boolean hasContact() { - return this.contact != null && !this.contact.isEmpty(); - } - - /** - * @param value {@link #contact} (An e-mail, phone, website or other contact point to use to resolve issues with message communications.) - */ - public MessageSourceComponent setContact(ContactPoint value) { - this.contact = value; - return this; - } - - /** - * @return {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageSourceComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (Identifies the routing target to send acknowledgements to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public MessageSourceComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return Identifies the routing target to send acknowledgements to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value Identifies the routing target to send acknowledgements to. - */ - public MessageSourceComponent setEndpoint(String value) { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Human-readable name for the source system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("software", "string", "May include configuration or other information useful in debugging.", 0, java.lang.Integer.MAX_VALUE, software)); - childrenList.add(new Property("version", "string", "Can convey versions of multiple systems in situations where a message passes through multiple hands.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("contact", "ContactPoint", "An e-mail, phone, website or other contact point to use to resolve issues with message communications.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("endpoint", "uri", "Identifies the routing target to send acknowledgements to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 1319330215: /*software*/ return this.software == null ? new Base[0] : new Base[] {this.software}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : new Base[] {this.contact}; // ContactPoint - case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 1319330215: // software - this.software = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 951526432: // contact - this.contact = castToContactPoint(value); // ContactPoint - break; - case 1741102485: // endpoint - this.endpoint = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("software")) - this.software = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("contact")) - this.contact = castToContactPoint(value); // ContactPoint - else if (name.equals("endpoint")) - this.endpoint = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 1319330215: throw new FHIRException("Cannot make property software as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 951526432: return getContact(); // ContactPoint - case 1741102485: throw new FHIRException("Cannot make property endpoint as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.name"); - } - else if (name.equals("software")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.software"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.version"); - } - else if (name.equals("contact")) { - this.contact = new ContactPoint(); - return this.contact; - } - else if (name.equals("endpoint")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.endpoint"); - } - else - return super.addChild(name); - } - - public MessageSourceComponent copy() { - MessageSourceComponent dst = new MessageSourceComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.software = software == null ? null : software.copy(); - dst.version = version == null ? null : version.copy(); - dst.contact = contact == null ? null : contact.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageSourceComponent)) - return false; - MessageSourceComponent o = (MessageSourceComponent) other; - return compareDeep(name, o.name, true) && compareDeep(software, o.software, true) && compareDeep(version, o.version, true) - && compareDeep(contact, o.contact, true) && compareDeep(endpoint, o.endpoint, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageSourceComponent)) - return false; - MessageSourceComponent o = (MessageSourceComponent) other; - return compareValues(name, o.name, true) && compareValues(software, o.software, true) && compareValues(version, o.version, true) - && compareValues(endpoint, o.endpoint, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (software == null || software.isEmpty()) - && (version == null || version.isEmpty()) && (contact == null || contact.isEmpty()) && (endpoint == null || endpoint.isEmpty()) - ; - } - - public String fhirType() { - return "MessageHeader.source"; - - } - - } - - @Block() - public static class MessageDestinationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human-readable name for the target system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of system", formalDefinition="Human-readable name for the target system." ) - protected StringType name; - - /** - * Identifies the target end system in situations where the initial message transmission is to an intermediary system. - */ - @Child(name = "target", type = {Device.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - protected Device targetTarget; - - /** - * Indicates where the message should be routed to. - */ - @Child(name = "endpoint", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Actual destination address or id", formalDefinition="Indicates where the message should be routed to." ) - protected UriType endpoint; - - private static final long serialVersionUID = -2097633309L; - - /** - * Constructor - */ - public MessageDestinationComponent() { - super(); - } - - /** - * Constructor - */ - public MessageDestinationComponent(UriType endpoint) { - super(); - this.endpoint = endpoint; - } - - /** - * @return {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Human-readable name for the target system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public MessageDestinationComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Human-readable name for the target system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Human-readable name for the target system. - */ - public MessageDestinationComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public MessageDestinationComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public Device getTargetTarget() { - if (this.targetTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.target"); - else if (Configuration.doAutoCreate()) - this.targetTarget = new Device(); // aa - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the target end system in situations where the initial message transmission is to an intermediary system.) - */ - public MessageDestinationComponent setTargetTarget(Device value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageDestinationComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (Indicates where the message should be routed to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public MessageDestinationComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return Indicates where the message should be routed to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value Indicates where the message should be routed to. - */ - public MessageDestinationComponent setEndpoint(String value) { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Human-readable name for the target system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("target", "Reference(Device)", "Identifies the target end system in situations where the initial message transmission is to an intermediary system.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("endpoint", "uri", "Indicates where the message should be routed to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference - case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -880905839: // target - this.target = castToReference(value); // Reference - break; - case 1741102485: // endpoint - this.endpoint = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("target")) - this.target = castToReference(value); // Reference - else if (name.equals("endpoint")) - this.endpoint = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -880905839: return getTarget(); // Reference - case 1741102485: throw new FHIRException("Cannot make property endpoint as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.name"); - } - else if (name.equals("target")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("endpoint")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.endpoint"); - } - else - return super.addChild(name); - } - - public MessageDestinationComponent copy() { - MessageDestinationComponent dst = new MessageDestinationComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.target = target == null ? null : target.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageDestinationComponent)) - return false; - MessageDestinationComponent o = (MessageDestinationComponent) other; - return compareDeep(name, o.name, true) && compareDeep(target, o.target, true) && compareDeep(endpoint, o.endpoint, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageDestinationComponent)) - return false; - MessageDestinationComponent o = (MessageDestinationComponent) other; - return compareValues(name, o.name, true) && compareValues(endpoint, o.endpoint, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (target == null || target.isEmpty()) - && (endpoint == null || endpoint.isEmpty()); - } - - public String fhirType() { - return "MessageHeader.destination"; - - } - - } - - /** - * The time that the message was sent. - */ - @Child(name = "timestamp", type = {InstantType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Time that the message was sent", formalDefinition="The time that the message was sent." ) - protected InstantType timestamp; - - /** - * Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events". - */ - @Child(name = "event", type = {Coding.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="Code for the event this message represents", formalDefinition="Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-events\"." ) - protected Coding event; - - /** - * Information about the message that this message is a response to. Only present if this message is a response. - */ - @Child(name = "response", type = {}, order=2, min=0, max=1, modifier=true, summary=true) - @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." ) - protected MessageHeaderResponseComponent response; - - /** - * The source application from which this message originated. - */ - @Child(name = "source", type = {}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Message Source Application", formalDefinition="The source application from which this message originated." ) - protected MessageSourceComponent source; - - /** - * The destination application which the message is intended for. - */ - @Child(name = "destination", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Message Destination Application(s)", formalDefinition="The destination application which the message is intended for." ) - protected List destination; - - /** - * 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. - */ - @Child(name = "enterer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference enterer; - - /** - * The actual object that is the target of the reference (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.) - */ - protected Practitioner entererTarget; - - /** - * 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. - */ - @Child(name = "author", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (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.) - */ - protected Practitioner authorTarget; - - /** - * Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient. - */ - @Child(name = "receiver", type = {Practitioner.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference receiver; - - /** - * The actual object that is the target of the reference (Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.) - */ - protected Resource receiverTarget; - - /** - * 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. - */ - @Child(name = "responsible", type = {Practitioner.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference responsible; - - /** - * The actual object that is the target of the reference (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.) - */ - protected Resource responsibleTarget; - - /** - * Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Cause of event", formalDefinition="Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message." ) - protected CodeableConcept reason; - - /** - * The actual data of the message - a reference to the root/focus class of the event. - */ - @Child(name = "data", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List data; - /** - * The actual objects that are the target of the reference (The actual data of the message - a reference to the root/focus class of the event.) - */ - protected List dataTarget; - - - private static final long serialVersionUID = 1429728517L; - - /** - * Constructor - */ - public MessageHeader() { - super(); - } - - /** - * Constructor - */ - public MessageHeader(InstantType timestamp, Coding event, MessageSourceComponent source) { - super(); - this.timestamp = timestamp; - this.event = event; - this.source = source; - } - - /** - * @return {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public InstantType getTimestampElement() { - if (this.timestamp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.timestamp"); - else if (Configuration.doAutoCreate()) - this.timestamp = new InstantType(); // bb - return this.timestamp; - } - - public boolean hasTimestampElement() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - public boolean hasTimestamp() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - /** - * @param value {@link #timestamp} (The time that the message was sent.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public MessageHeader setTimestampElement(InstantType value) { - this.timestamp = value; - return this; - } - - /** - * @return The time that the message was sent. - */ - public Date getTimestamp() { - return this.timestamp == null ? null : this.timestamp.getValue(); - } - - /** - * @param value The time that the message was sent. - */ - public MessageHeader setTimestamp(Date value) { - if (this.timestamp == null) - this.timestamp = new InstantType(); - this.timestamp.setValue(value); - return this; - } - - /** - * @return {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events".) - */ - public Coding getEvent() { - if (this.event == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.event"); - else if (Configuration.doAutoCreate()) - this.event = new Coding(); // cc - return this.event; - } - - public boolean hasEvent() { - return this.event != null && !this.event.isEmpty(); - } - - /** - * @param value {@link #event} (Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value "http://hl7.org/fhir/message-events".) - */ - public MessageHeader setEvent(Coding value) { - this.event = value; - return this; - } - - /** - * @return {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) - */ - public MessageHeaderResponseComponent getResponse() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.response"); - else if (Configuration.doAutoCreate()) - this.response = new MessageHeaderResponseComponent(); // cc - return this.response; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Information about the message that this message is a response to. Only present if this message is a response.) - */ - public MessageHeader setResponse(MessageHeaderResponseComponent value) { - this.response = value; - return this; - } - - /** - * @return {@link #source} (The source application from which this message originated.) - */ - public MessageSourceComponent getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.source"); - else if (Configuration.doAutoCreate()) - this.source = new MessageSourceComponent(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The source application from which this message originated.) - */ - public MessageHeader setSource(MessageSourceComponent value) { - this.source = value; - return this; - } - - /** - * @return {@link #destination} (The destination application which the message is intended for.) - */ - public List getDestination() { - if (this.destination == null) - this.destination = new ArrayList(); - return this.destination; - } - - public boolean hasDestination() { - if (this.destination == null) - return false; - for (MessageDestinationComponent item : this.destination) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #destination} (The destination application which the message is intended for.) - */ - // syntactic sugar - public MessageDestinationComponent addDestination() { //3 - MessageDestinationComponent t = new MessageDestinationComponent(); - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return t; - } - - // syntactic sugar - public MessageHeader addDestination(MessageDestinationComponent t) { //3 - if (t == null) - return this; - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return this; - } - - /** - * @return {@link #enterer} (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 Reference getEnterer() { - if (this.enterer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.enterer"); - else if (Configuration.doAutoCreate()) - this.enterer = new Reference(); // cc - return this.enterer; - } - - public boolean hasEnterer() { - return this.enterer != null && !this.enterer.isEmpty(); - } - - /** - * @param value {@link #enterer} (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(Reference value) { - this.enterer = value; - return this; - } - - /** - * @return {@link #enterer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (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 Practitioner getEntererTarget() { - if (this.entererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.enterer"); - else if (Configuration.doAutoCreate()) - this.entererTarget = new Practitioner(); // aa - return this.entererTarget; - } - - /** - * @param value {@link #enterer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (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 setEntererTarget(Practitioner value) { - this.entererTarget = value; - return this; - } - - /** - * @return {@link #author} (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 Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (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(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (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 Practitioner getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Practitioner(); // aa - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (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 setAuthorTarget(Practitioner value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #receiver} (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 Reference getReceiver() { - if (this.receiver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.receiver"); - else if (Configuration.doAutoCreate()) - this.receiver = new Reference(); // cc - return this.receiver; - } - - public boolean hasReceiver() { - return this.receiver != null && !this.receiver.isEmpty(); - } - - /** - * @param value {@link #receiver} (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(Reference value) { - this.receiver = value; - return this; - } - - /** - * @return {@link #receiver} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (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 Resource getReceiverTarget() { - return this.receiverTarget; - } - - /** - * @param value {@link #receiver} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (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 setReceiverTarget(Resource value) { - this.receiverTarget = value; - return this; - } - - /** - * @return {@link #responsible} (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 Reference getResponsible() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new Reference(); // cc - return this.responsible; - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (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(Reference value) { - this.responsible = value; - return this; - } - - /** - * @return {@link #responsible} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (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 Resource getResponsibleTarget() { - return this.responsibleTarget; - } - - /** - * @param value {@link #responsible} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (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 setResponsibleTarget(Resource value) { - this.responsibleTarget = value; - return this; - } - - /** - * @return {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create MessageHeader.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.) - */ - public MessageHeader setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) - */ - public List getData() { - if (this.data == null) - this.data = new ArrayList(); - return this.data; - } - - public boolean hasData() { - if (this.data == null) - return false; - for (Reference item : this.data) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #data} (The actual data of the message - a reference to the root/focus class of the event.) - */ - // syntactic sugar - public Reference addData() { //3 - Reference t = new Reference(); - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return t; - } - - // syntactic sugar - public MessageHeader addData(Reference t) { //3 - if (t == null) - return this; - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return this; - } - - /** - * @return {@link #data} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The actual data of the message - a reference to the root/focus class of the event.) - */ - public List getDataTarget() { - if (this.dataTarget == null) - this.dataTarget = new ArrayList(); - return this.dataTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("timestamp", "instant", "The time that the message was sent.", 0, java.lang.Integer.MAX_VALUE, timestamp)); - childrenList.add(new Property("event", "Coding", "Code that identifies the event this message represents and connects it with its definition. Events defined as part of the FHIR specification have the system value \"http://hl7.org/fhir/message-events\".", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("response", "", "Information about the message that this message is a response to. Only present if this message is a response.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("source", "", "The source application from which this message originated.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("destination", "", "The destination application which the message is intended for.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("enterer", "Reference(Practitioner)", "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.", 0, java.lang.Integer.MAX_VALUE, enterer)); - childrenList.add(new Property("author", "Reference(Practitioner)", "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.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("receiver", "Reference(Practitioner|Organization)", "Allows data conveyed by a message to be addressed to a particular person or department when routing to a specific application isn't sufficient.", 0, java.lang.Integer.MAX_VALUE, receiver)); - childrenList.add(new Property("responsible", "Reference(Practitioner|Organization)", "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.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("reason", "CodeableConcept", "Coded indication of the cause for the event - indicates a reason for the occurrence of the event that is a focus of this message.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("data", "Reference(Any)", "The actual data of the message - a reference to the root/focus class of the event.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 55126294: /*timestamp*/ return this.timestamp == null ? new Base[0] : new Base[] {this.timestamp}; // InstantType - case 96891546: /*event*/ return this.event == null ? new Base[0] : new Base[] {this.event}; // Coding - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // MessageHeaderResponseComponent - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // MessageSourceComponent - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : this.destination.toArray(new Base[this.destination.size()]); // MessageDestinationComponent - case -1591951995: /*enterer*/ return this.enterer == null ? new Base[0] : new Base[] {this.enterer}; // Reference - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : new Base[] {this.receiver}; // Reference - case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept - case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 55126294: // timestamp - this.timestamp = castToInstant(value); // InstantType - break; - case 96891546: // event - this.event = castToCoding(value); // Coding - break; - case -340323263: // response - this.response = (MessageHeaderResponseComponent) value; // MessageHeaderResponseComponent - break; - case -896505829: // source - this.source = (MessageSourceComponent) value; // MessageSourceComponent - break; - case -1429847026: // destination - this.getDestination().add((MessageDestinationComponent) value); // MessageDestinationComponent - break; - case -1591951995: // enterer - this.enterer = castToReference(value); // Reference - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case -808719889: // receiver - this.receiver = castToReference(value); // Reference - break; - case 1847674614: // responsible - this.responsible = castToReference(value); // Reference - break; - case -934964668: // reason - this.reason = castToCodeableConcept(value); // CodeableConcept - break; - case 3076010: // data - this.getData().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("timestamp")) - this.timestamp = castToInstant(value); // InstantType - else if (name.equals("event")) - this.event = castToCoding(value); // Coding - else if (name.equals("response")) - this.response = (MessageHeaderResponseComponent) value; // MessageHeaderResponseComponent - else if (name.equals("source")) - this.source = (MessageSourceComponent) value; // MessageSourceComponent - else if (name.equals("destination")) - this.getDestination().add((MessageDestinationComponent) value); - else if (name.equals("enterer")) - this.enterer = castToReference(value); // Reference - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("receiver")) - this.receiver = castToReference(value); // Reference - else if (name.equals("responsible")) - this.responsible = castToReference(value); // Reference - else if (name.equals("reason")) - this.reason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("data")) - this.getData().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 55126294: throw new FHIRException("Cannot make property timestamp as it is not a complex type"); // InstantType - case 96891546: return getEvent(); // Coding - case -340323263: return getResponse(); // MessageHeaderResponseComponent - case -896505829: return getSource(); // MessageSourceComponent - case -1429847026: return addDestination(); // MessageDestinationComponent - case -1591951995: return getEnterer(); // Reference - case -1406328437: return getAuthor(); // Reference - case -808719889: return getReceiver(); // Reference - case 1847674614: return getResponsible(); // Reference - case -934964668: return getReason(); // CodeableConcept - case 3076010: return addData(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("timestamp")) { - throw new FHIRException("Cannot call addChild on a primitive type MessageHeader.timestamp"); - } - else if (name.equals("event")) { - this.event = new Coding(); - return this.event; - } - else if (name.equals("response")) { - this.response = new MessageHeaderResponseComponent(); - return this.response; - } - else if (name.equals("source")) { - this.source = new MessageSourceComponent(); - return this.source; - } - else if (name.equals("destination")) { - return addDestination(); - } - else if (name.equals("enterer")) { - this.enterer = new Reference(); - return this.enterer; - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("receiver")) { - this.receiver = new Reference(); - return this.receiver; - } - else if (name.equals("responsible")) { - this.responsible = new Reference(); - return this.responsible; - } - else if (name.equals("reason")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("data")) { - return addData(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "MessageHeader"; - - } - - public MessageHeader copy() { - MessageHeader dst = new MessageHeader(); - copyValues(dst); - dst.timestamp = timestamp == null ? null : timestamp.copy(); - dst.event = event == null ? null : event.copy(); - dst.response = response == null ? null : response.copy(); - dst.source = source == null ? null : source.copy(); - if (destination != null) { - dst.destination = new ArrayList(); - for (MessageDestinationComponent i : destination) - dst.destination.add(i.copy()); - }; - dst.enterer = enterer == null ? null : enterer.copy(); - dst.author = author == null ? null : author.copy(); - dst.receiver = receiver == null ? null : receiver.copy(); - dst.responsible = responsible == null ? null : responsible.copy(); - dst.reason = reason == null ? null : reason.copy(); - if (data != null) { - dst.data = new ArrayList(); - for (Reference i : data) - dst.data.add(i.copy()); - }; - return dst; - } - - protected MessageHeader typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof MessageHeader)) - return false; - MessageHeader o = (MessageHeader) other; - return compareDeep(timestamp, o.timestamp, true) && compareDeep(event, o.event, true) && compareDeep(response, o.response, true) - && compareDeep(source, o.source, true) && compareDeep(destination, o.destination, true) && compareDeep(enterer, o.enterer, true) - && compareDeep(author, o.author, true) && compareDeep(receiver, o.receiver, true) && compareDeep(responsible, o.responsible, true) - && compareDeep(reason, o.reason, true) && compareDeep(data, o.data, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof MessageHeader)) - return false; - MessageHeader o = (MessageHeader) other; - return compareValues(timestamp, o.timestamp, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (timestamp == null || timestamp.isEmpty()) && (event == null || event.isEmpty()) - && (response == null || response.isEmpty()) && (source == null || source.isEmpty()) && (destination == null || destination.isEmpty()) - && (enterer == null || enterer.isEmpty()) && (author == null || author.isEmpty()) && (receiver == null || receiver.isEmpty()) - && (responsible == null || responsible.isEmpty()) && (reason == null || reason.isEmpty()) - && (data == null || data.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.MessageHeader; - } - - /** - * Search parameter: destination-uri - *

- * Description: Actual destination address or id
- * Type: uri
- * Path: MessageHeader.destination.endpoint
- *

- */ - @SearchParamDefinition(name="destination-uri", path="MessageHeader.destination.endpoint", description="Actual destination address or id", type="uri" ) - public static final String SP_DESTINATION_URI = "destination-uri"; - /** - * Fluent Client search parameter constant for destination-uri - *

- * Description: Actual destination address or id
- * Type: uri
- * Path: MessageHeader.destination.endpoint
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam DESTINATION_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DESTINATION_URI); - - /** - * Search parameter: receiver - *

- * Description: Intended "real-world" recipient for the data
- * Type: reference
- * Path: MessageHeader.receiver
- *

- */ - @SearchParamDefinition(name="receiver", path="MessageHeader.receiver", description="Intended \"real-world\" recipient for the data", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - /** - * Fluent Client search parameter constant for receiver - *

- * Description: Intended "real-world" recipient for the data
- * Type: reference
- * Path: MessageHeader.receiver
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MessageHeader:receiver". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("MessageHeader:receiver").toLocked(); - - /** - * Search parameter: responsible - *

- * Description: Final responsibility for event
- * Type: reference
- * Path: MessageHeader.responsible
- *

- */ - @SearchParamDefinition(name="responsible", path="MessageHeader.responsible", description="Final responsibility for event", type="reference" ) - public static final String SP_RESPONSIBLE = "responsible"; - /** - * Fluent Client search parameter constant for responsible - *

- * Description: Final responsibility for event
- * Type: reference
- * Path: MessageHeader.responsible
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSIBLE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSIBLE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MessageHeader:responsible". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSIBLE = new ca.uhn.fhir.model.api.Include("MessageHeader:responsible").toLocked(); - - /** - * Search parameter: data - *

- * Description: The actual content of the message
- * Type: reference
- * Path: MessageHeader.data
- *

- */ - @SearchParamDefinition(name="data", path="MessageHeader.data", description="The actual content of the message", type="reference" ) - public static final String SP_DATA = "data"; - /** - * Fluent Client search parameter constant for data - *

- * Description: The actual content of the message
- * Type: reference
- * Path: MessageHeader.data
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DATA = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DATA); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MessageHeader:data". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DATA = new ca.uhn.fhir.model.api.Include("MessageHeader:data").toLocked(); - - /** - * Search parameter: code - *

- * Description: ok | transient-error | fatal-error
- * Type: token
- * Path: MessageHeader.response.code
- *

- */ - @SearchParamDefinition(name="code", path="MessageHeader.response.code", description="ok | transient-error | fatal-error", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: ok | transient-error | fatal-error
- * Type: token
- * Path: MessageHeader.response.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: response-id - *

- * Description: Id of original message
- * Type: token
- * Path: MessageHeader.response.identifier
- *

- */ - @SearchParamDefinition(name="response-id", path="MessageHeader.response.identifier", description="Id of original message", type="token" ) - public static final String SP_RESPONSE_ID = "response-id"; - /** - * Fluent Client search parameter constant for response-id - *

- * Description: Id of original message
- * Type: token
- * Path: MessageHeader.response.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESPONSE_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESPONSE_ID); - - /** - * Search parameter: destination - *

- * Description: Name of system
- * Type: string
- * Path: MessageHeader.destination.name
- *

- */ - @SearchParamDefinition(name="destination", path="MessageHeader.destination.name", description="Name of system", type="string" ) - public static final String SP_DESTINATION = "destination"; - /** - * Fluent Client search parameter constant for destination - *

- * Description: Name of system
- * Type: string
- * Path: MessageHeader.destination.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESTINATION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESTINATION); - - /** - * Search parameter: timestamp - *

- * Description: Time that the message was sent
- * Type: date
- * Path: MessageHeader.timestamp
- *

- */ - @SearchParamDefinition(name="timestamp", path="MessageHeader.timestamp", description="Time that the message was sent", type="date" ) - public static final String SP_TIMESTAMP = "timestamp"; - /** - * Fluent Client search parameter constant for timestamp - *

- * Description: Time that the message was sent
- * Type: date
- * Path: MessageHeader.timestamp
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam TIMESTAMP = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_TIMESTAMP); - - /** - * Search parameter: author - *

- * Description: The source of the decision
- * Type: reference
- * Path: MessageHeader.author
- *

- */ - @SearchParamDefinition(name="author", path="MessageHeader.author", description="The source of the decision", type="reference" ) - public static final String SP_AUTHOR = "author"; - /** - * Fluent Client search parameter constant for author - *

- * Description: The source of the decision
- * Type: reference
- * Path: MessageHeader.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MessageHeader:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("MessageHeader:author").toLocked(); - - /** - * Search parameter: source-uri - *

- * Description: Actual message source address or id
- * Type: uri
- * Path: MessageHeader.source.endpoint
- *

- */ - @SearchParamDefinition(name="source-uri", path="MessageHeader.source.endpoint", description="Actual message source address or id", type="uri" ) - public static final String SP_SOURCE_URI = "source-uri"; - /** - * Fluent Client search parameter constant for source-uri - *

- * Description: Actual message source address or id
- * Type: uri
- * Path: MessageHeader.source.endpoint
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam SOURCE_URI = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_SOURCE_URI); - - /** - * Search parameter: source - *

- * Description: Name of system
- * Type: string
- * Path: MessageHeader.source.name
- *

- */ - @SearchParamDefinition(name="source", path="MessageHeader.source.name", description="Name of system", type="string" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Name of system
- * Type: string
- * Path: MessageHeader.source.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam SOURCE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_SOURCE); - - /** - * Search parameter: enterer - *

- * Description: The source of the data entry
- * Type: reference
- * Path: MessageHeader.enterer
- *

- */ - @SearchParamDefinition(name="enterer", path="MessageHeader.enterer", description="The source of the data entry", type="reference" ) - public static final String SP_ENTERER = "enterer"; - /** - * Fluent Client search parameter constant for enterer - *

- * Description: The source of the data entry
- * Type: reference
- * Path: MessageHeader.enterer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENTERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENTERER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MessageHeader:enterer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENTERER = new ca.uhn.fhir.model.api.Include("MessageHeader:enterer").toLocked(); - - /** - * Search parameter: event - *

- * Description: Code for the event this message represents
- * Type: token
- * Path: MessageHeader.event
- *

- */ - @SearchParamDefinition(name="event", path="MessageHeader.event", description="Code for the event this message represents", type="token" ) - public static final String SP_EVENT = "event"; - /** - * Fluent Client search parameter constant for event - *

- * Description: Code for the event this message represents
- * Type: token
- * Path: MessageHeader.event
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EVENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EVENT); - - /** - * Search parameter: target - *

- * Description: Particular delivery destination within the destination
- * Type: reference
- * Path: MessageHeader.destination.target
- *

- */ - @SearchParamDefinition(name="target", path="MessageHeader.destination.target", description="Particular delivery destination within the destination", type="reference" ) - public static final String SP_TARGET = "target"; - /** - * Fluent Client search parameter constant for target - *

- * Description: Particular delivery destination within the destination
- * Type: reference
- * Path: MessageHeader.destination.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "MessageHeader:target". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("MessageHeader:target").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Meta.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Meta.java deleted file mode 100644 index b7a8636b61d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Meta.java +++ /dev/null @@ -1,533 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseMetaType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ -@DatatypeDef(name="Meta") -public class Meta extends Type implements IBaseMetaType { - - /** - * The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted. - */ - @Child(name = "versionId", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Version specific identifier", formalDefinition="The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted." ) - protected IdType versionId; - - /** - * When the resource last changed - e.g. when the version changed. - */ - @Child(name = "lastUpdated", type = {InstantType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the resource version last changed", formalDefinition="When the resource last changed - e.g. when the version changed." ) - protected InstantType lastUpdated; - - /** - * A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]. - */ - @Child(name = "profile", type = {UriType.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Profiles this resource claims to conform to", formalDefinition="A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]]." ) - protected List profile; - - /** - * Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure. - */ - @Child(name = "security", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Security Labels applied to this resource", formalDefinition="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." ) - protected List security; - - /** - * Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource. - */ - @Child(name = "tag", type = {Coding.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Tags applied to this resource", formalDefinition="Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." ) - protected List tag; - - private static final long serialVersionUID = 867134915L; - - /** - * Constructor - */ - public Meta() { - super(); - } - - /** - * @return {@link #versionId} (The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public IdType getVersionIdElement() { - if (this.versionId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Meta.versionId"); - else if (Configuration.doAutoCreate()) - this.versionId = new IdType(); // bb - return this.versionId; - } - - public boolean hasVersionIdElement() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - public boolean hasVersionId() { - return this.versionId != null && !this.versionId.isEmpty(); - } - - /** - * @param value {@link #versionId} (The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.). This is the underlying object with id, value and extensions. The accessor "getVersionId" gives direct access to the value - */ - public Meta setVersionIdElement(IdType value) { - this.versionId = value; - return this; - } - - /** - * @return The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted. - */ - public String getVersionId() { - return this.versionId == null ? null : this.versionId.getValue(); - } - - /** - * @param value The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted. - */ - public Meta setVersionId(String value) { - if (Utilities.noString(value)) - this.versionId = null; - else { - if (this.versionId == null) - this.versionId = new IdType(); - this.versionId.setValue(value); - } - return this; - } - - /** - * @return {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value - */ - public InstantType getLastUpdatedElement() { - if (this.lastUpdated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Meta.lastUpdated"); - else if (Configuration.doAutoCreate()) - this.lastUpdated = new InstantType(); // bb - return this.lastUpdated; - } - - public boolean hasLastUpdatedElement() { - return this.lastUpdated != null && !this.lastUpdated.isEmpty(); - } - - public boolean hasLastUpdated() { - return this.lastUpdated != null && !this.lastUpdated.isEmpty(); - } - - /** - * @param value {@link #lastUpdated} (When the resource last changed - e.g. when the version changed.). This is the underlying object with id, value and extensions. The accessor "getLastUpdated" gives direct access to the value - */ - public Meta setLastUpdatedElement(InstantType value) { - this.lastUpdated = value; - return this; - } - - /** - * @return When the resource last changed - e.g. when the version changed. - */ - public Date getLastUpdated() { - return this.lastUpdated == null ? null : this.lastUpdated.getValue(); - } - - /** - * @param value When the resource last changed - e.g. when the version changed. - */ - public Meta setLastUpdated(Date value) { - if (value == null) - this.lastUpdated = null; - else { - if (this.lastUpdated == null) - this.lastUpdated = new InstantType(); - this.lastUpdated.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (UriType item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - // syntactic sugar - public UriType addProfileElement() {//2 - UriType t = new UriType(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - /** - * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - public Meta addProfile(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @param value {@link #profile} (A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].) - */ - public boolean hasProfile(String value) { - if (this.profile == null) - return false; - for (UriType v : this.profile) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) - */ - public List getSecurity() { - if (this.security == null) - this.security = new ArrayList(); - return this.security; - } - - public boolean hasSecurity() { - if (this.security == null) - return false; - for (Coding item : this.security) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #security} (Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.) - */ - // syntactic sugar - public Coding addSecurity() { //3 - Coding t = new Coding(); - if (this.security == null) - this.security = new ArrayList(); - this.security.add(t); - return t; - } - - // syntactic sugar - public Meta addSecurity(Coding t) { //3 - if (t == null) - return this; - if (this.security == null) - this.security = new ArrayList(); - this.security.add(t); - return this; - } - - /** - * @return {@link #tag} (Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) - */ - public List getTag() { - if (this.tag == null) - this.tag = new ArrayList(); - return this.tag; - } - - public boolean hasTag() { - if (this.tag == null) - return false; - for (Coding item : this.tag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #tag} (Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.) - */ - // syntactic sugar - public Coding addTag() { //3 - Coding t = new Coding(); - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return t; - } - - // syntactic sugar - public Meta addTag(Coding t) { //3 - if (t == null) - return this; - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return this; - } - - /** - * Convenience method which adds a tag - * - * @param theSystem The code system - * @param theCode The code - * @param theDisplay The display name - * @return Returns a reference to this for easy chaining - */ - public Meta addTag(String theSystem, String theCode, String theDisplay) { - addTag().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); - return this; - } - /** - * Convenience method which adds a security tag - * - * @param theSystem The code system - * @param theCode The code - * @param theDisplay The display name - * @return Returns a reference to this for easy chaining - */ - public Meta addSecurity(String theSystem, String theCode, String theDisplay) { - addSecurity().setSystem(theSystem).setCode(theCode).setDisplay(theDisplay); - return this; - } - /** - * Returns the first tag (if any) that has the given system and code, or returns - * null if none - */ - public Coding getTag(String theSystem, String theCode) { - for (Coding next : getTag()) { - if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) { - return next; - } - } - return null; - } - - /** - * Returns the first security label (if any) that has the given system and code, or returns - * null if none - */ - public Coding getSecurity(String theSystem, String theCode) { - for (Coding next : getTag()) { - if (ca.uhn.fhir.util.ObjectUtil.equals(next.getSystem(), theSystem) && ca.uhn.fhir.util.ObjectUtil.equals(next.getCode(), theCode)) { - return next; - } - } - return null; - } - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("versionId", "id", "The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.", 0, java.lang.Integer.MAX_VALUE, versionId)); - childrenList.add(new Property("lastUpdated", "instant", "When the resource last changed - e.g. when the version changed.", 0, java.lang.Integer.MAX_VALUE, lastUpdated)); - childrenList.add(new Property("profile", "uri", "A list of profiles [[[StructureDefinition]]]s that this resource claims to conform to. The URL is a reference to [[[StructureDefinition.url]]].", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("security", "Coding", "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.", 0, java.lang.Integer.MAX_VALUE, security)); - childrenList.add(new Property("tag", "Coding", "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.", 0, java.lang.Integer.MAX_VALUE, tag)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1407102957: /*versionId*/ return this.versionId == null ? new Base[0] : new Base[] {this.versionId}; // IdType - case 1649733957: /*lastUpdated*/ return this.lastUpdated == null ? new Base[0] : new Base[] {this.lastUpdated}; // InstantType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // UriType - case 949122880: /*security*/ return this.security == null ? new Base[0] : this.security.toArray(new Base[this.security.size()]); // Coding - case 114586: /*tag*/ return this.tag == null ? new Base[0] : this.tag.toArray(new Base[this.tag.size()]); // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1407102957: // versionId - this.versionId = castToId(value); // IdType - break; - case 1649733957: // lastUpdated - this.lastUpdated = castToInstant(value); // InstantType - break; - case -309425751: // profile - this.getProfile().add(castToUri(value)); // UriType - break; - case 949122880: // security - this.getSecurity().add(castToCoding(value)); // Coding - break; - case 114586: // tag - this.getTag().add(castToCoding(value)); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("versionId")) - this.versionId = castToId(value); // IdType - else if (name.equals("lastUpdated")) - this.lastUpdated = castToInstant(value); // InstantType - else if (name.equals("profile")) - this.getProfile().add(castToUri(value)); - else if (name.equals("security")) - this.getSecurity().add(castToCoding(value)); - else if (name.equals("tag")) - this.getTag().add(castToCoding(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1407102957: throw new FHIRException("Cannot make property versionId as it is not a complex type"); // IdType - case 1649733957: throw new FHIRException("Cannot make property lastUpdated as it is not a complex type"); // InstantType - case -309425751: throw new FHIRException("Cannot make property profile as it is not a complex type"); // UriType - case 949122880: return addSecurity(); // Coding - case 114586: return addTag(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("versionId")) { - throw new FHIRException("Cannot call addChild on a primitive type Meta.versionId"); - } - else if (name.equals("lastUpdated")) { - throw new FHIRException("Cannot call addChild on a primitive type Meta.lastUpdated"); - } - else if (name.equals("profile")) { - throw new FHIRException("Cannot call addChild on a primitive type Meta.profile"); - } - else if (name.equals("security")) { - return addSecurity(); - } - else if (name.equals("tag")) { - return addTag(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Meta"; - - } - - public Meta copy() { - Meta dst = new Meta(); - copyValues(dst); - dst.versionId = versionId == null ? null : versionId.copy(); - dst.lastUpdated = lastUpdated == null ? null : lastUpdated.copy(); - if (profile != null) { - dst.profile = new ArrayList(); - for (UriType i : profile) - dst.profile.add(i.copy()); - }; - if (security != null) { - dst.security = new ArrayList(); - for (Coding i : security) - dst.security.add(i.copy()); - }; - if (tag != null) { - dst.tag = new ArrayList(); - for (Coding i : tag) - dst.tag.add(i.copy()); - }; - return dst; - } - - protected Meta typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Meta)) - return false; - Meta o = (Meta) other; - return compareDeep(versionId, o.versionId, true) && compareDeep(lastUpdated, o.lastUpdated, true) - && compareDeep(profile, o.profile, true) && compareDeep(security, o.security, true) && compareDeep(tag, o.tag, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Meta)) - return false; - Meta o = (Meta) other; - return compareValues(versionId, o.versionId, true) && compareValues(lastUpdated, o.lastUpdated, true) - && compareValues(profile, o.profile, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (versionId == null || versionId.isEmpty()) && (lastUpdated == null || lastUpdated.isEmpty()) - && (profile == null || profile.isEmpty()) && (security == null || security.isEmpty()) && (tag == null || tag.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java deleted file mode 100644 index 5d9b5edfcb4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ModuleDefinition.java +++ /dev/null @@ -1,3382 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The ModuleDefinition resource defines the data requirements for a quality artifact. - */ -@ResourceDef(name="ModuleDefinition", profile="http://hl7.org/fhir/Profile/ModuleDefinition") -public class ModuleDefinition extends DomainResource { - - @Block() - public static class ModuleDefinitionModelComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the model. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The name of the model." ) - protected StringType name; - - /** - * The identifier of the model. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The identifier of the model." ) - protected StringType identifier; - - /** - * The version of the model. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The version of the model." ) - protected StringType version; - - private static final long serialVersionUID = -862601139L; - - /** - * Constructor - */ - public ModuleDefinitionModelComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionModelComponent(StringType identifier) { - super(); - this.identifier = identifier; - } - - /** - * @return {@link #name} (The name of the model.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionModelComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the model.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleDefinitionModelComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the model. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the model. - */ - public ModuleDefinitionModelComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (The identifier of the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionModelComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of the model.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ModuleDefinitionModelComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier of the model. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier of the model. - */ - public ModuleDefinitionModelComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the model.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionModelComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the model.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ModuleDefinitionModelComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the model. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the model. - */ - public ModuleDefinitionModelComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the model.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The identifier of the model.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version of the model.", 0, java.lang.Integer.MAX_VALUE, version)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); - } - else - return super.addChild(name); - } - - public ModuleDefinitionModelComponent copy() { - ModuleDefinitionModelComponent dst = new ModuleDefinitionModelComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionModelComponent)) - return false; - ModuleDefinitionModelComponent o = (ModuleDefinitionModelComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionModelComponent)) - return false; - ModuleDefinitionModelComponent o = (ModuleDefinitionModelComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()); - } - - public String fhirType() { - return "ModuleDefinition.model"; - - } - - } - - @Block() - public static class ModuleDefinitionLibraryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The local name for the library reference. If no local name is provided, the name of the referenced library is assumed. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The local name for the library", formalDefinition="The local name for the library reference. If no local name is provided, the name of the referenced library is assumed." ) - protected StringType name; - - /** - * The identifier of the library. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The identifier of the library." ) - protected StringType identifier; - - /** - * The version of the library. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The version of the library." ) - protected StringType version; - - /** - * A reference to the library. - */ - @Child(name = "document", type = {Attachment.class, ModuleDefinition.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="A reference to the library." ) - protected Type document; - - private static final long serialVersionUID = 1633488790L; - - /** - * Constructor - */ - public ModuleDefinitionLibraryComponent() { - super(); - } - - /** - * @return {@link #name} (The local name for the library reference. If no local name is provided, the name of the referenced library is assumed.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionLibraryComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The local name for the library reference. If no local name is provided, the name of the referenced library is assumed.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleDefinitionLibraryComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The local name for the library reference. If no local name is provided, the name of the referenced library is assumed. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The local name for the library reference. If no local name is provided, the name of the referenced library is assumed. - */ - public ModuleDefinitionLibraryComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (The identifier of the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionLibraryComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The identifier of the library.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ModuleDefinitionLibraryComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The identifier of the library. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The identifier of the library. - */ - public ModuleDefinitionLibraryComponent setIdentifier(String value) { - if (Utilities.noString(value)) - this.identifier = null; - else { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The version of the library.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionLibraryComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the library.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ModuleDefinitionLibraryComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the library. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the library. - */ - public ModuleDefinitionLibraryComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #document} (A reference to the library.) - */ - public Type getDocument() { - return this.document; - } - - /** - * @return {@link #document} (A reference to the library.) - */ - public Attachment getDocumentAttachment() throws FHIRException { - if (!(this.document instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.document.getClass().getName()+" was encountered"); - return (Attachment) this.document; - } - - public boolean hasDocumentAttachment() { - return this.document instanceof Attachment; - } - - /** - * @return {@link #document} (A reference to the library.) - */ - public Reference getDocumentReference() throws FHIRException { - if (!(this.document instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.document.getClass().getName()+" was encountered"); - return (Reference) this.document; - } - - public boolean hasDocumentReference() { - return this.document instanceof Reference; - } - - public boolean hasDocument() { - return this.document != null && !this.document.isEmpty(); - } - - /** - * @param value {@link #document} (A reference to the library.) - */ - public ModuleDefinitionLibraryComponent setDocument(Type value) { - this.document = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The local name for the library reference. If no local name is provided, the name of the referenced library is assumed.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The identifier of the library.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version of the library.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("document[x]", "Attachment|Reference(ModuleDefinition)", "A reference to the library.", 0, java.lang.Integer.MAX_VALUE, document)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 861720859: // document - this.document = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("document[x]")) - this.document = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 506673541: return getDocument(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); - } - else if (name.equals("documentAttachment")) { - this.document = new Attachment(); - return this.document; - } - else if (name.equals("documentReference")) { - this.document = new Reference(); - return this.document; - } - else - return super.addChild(name); - } - - public ModuleDefinitionLibraryComponent copy() { - ModuleDefinitionLibraryComponent dst = new ModuleDefinitionLibraryComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.document = document == null ? null : document.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionLibraryComponent)) - return false; - ModuleDefinitionLibraryComponent o = (ModuleDefinitionLibraryComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(document, o.document, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionLibraryComponent)) - return false; - ModuleDefinitionLibraryComponent o = (ModuleDefinitionLibraryComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (document == null || document.isEmpty()); - } - - public String fhirType() { - return "ModuleDefinition.library"; - - } - - } - - @Block() - public static class ModuleDefinitionCodeSystemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The local name for the code system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The local name for the code system." ) - protected StringType name; - - /** - * The code system uri. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The code system uri." ) - protected StringType identifier; - - /** - * The code system version, if any. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The code system version, if any." ) - protected StringType version; - - private static final long serialVersionUID = -862601139L; - - /** - * Constructor - */ - public ModuleDefinitionCodeSystemComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionCodeSystemComponent(StringType name, StringType identifier) { - super(); - this.name = name; - this.identifier = identifier; - } - - /** - * @return {@link #name} (The local name for the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionCodeSystemComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The local name for the code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleDefinitionCodeSystemComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The local name for the code system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The local name for the code system. - */ - public ModuleDefinitionCodeSystemComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (The code system uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionCodeSystemComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The code system uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ModuleDefinitionCodeSystemComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The code system uri. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The code system uri. - */ - public ModuleDefinitionCodeSystemComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The code system version, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionCodeSystemComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The code system version, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ModuleDefinitionCodeSystemComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The code system version, if any. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The code system version, if any. - */ - public ModuleDefinitionCodeSystemComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The local name for the code system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The code system uri.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The code system version, if any.", 0, java.lang.Integer.MAX_VALUE, version)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); - } - else - return super.addChild(name); - } - - public ModuleDefinitionCodeSystemComponent copy() { - ModuleDefinitionCodeSystemComponent dst = new ModuleDefinitionCodeSystemComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionCodeSystemComponent)) - return false; - ModuleDefinitionCodeSystemComponent o = (ModuleDefinitionCodeSystemComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionCodeSystemComponent)) - return false; - ModuleDefinitionCodeSystemComponent o = (ModuleDefinitionCodeSystemComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()); - } - - public String fhirType() { - return "ModuleDefinition.codeSystem"; - - } - - } - - @Block() - public static class ModuleDefinitionValueSetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The local name for the value set. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The local name for the value set." ) - protected StringType name; - - /** - * The value set uri. - */ - @Child(name = "identifier", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The value set uri." ) - protected StringType identifier; - - /** - * The version of the value set, if any. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The version of the value set, if any." ) - protected StringType version; - - /** - * The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library. - */ - @Child(name = "codeSystem", type = {StringType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library." ) - protected List codeSystem; - - private static final long serialVersionUID = 338950096L; - - /** - * Constructor - */ - public ModuleDefinitionValueSetComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionValueSetComponent(StringType name, StringType identifier) { - super(); - this.name = name; - this.identifier = identifier; - } - - /** - * @return {@link #name} (The local name for the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionValueSetComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The local name for the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleDefinitionValueSetComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The local name for the value set. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The local name for the value set. - */ - public ModuleDefinitionValueSetComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (The value set uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public StringType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionValueSetComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new StringType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The value set uri.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ModuleDefinitionValueSetComponent setIdentifierElement(StringType value) { - this.identifier = value; - return this; - } - - /** - * @return The value set uri. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value The value set uri. - */ - public ModuleDefinitionValueSetComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new StringType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the value set, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionValueSetComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the value set, if any.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ModuleDefinitionValueSetComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the value set, if any. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the value set, if any. - */ - public ModuleDefinitionValueSetComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) - */ - public List getCodeSystem() { - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - return this.codeSystem; - } - - public boolean hasCodeSystem() { - if (this.codeSystem == null) - return false; - for (StringType item : this.codeSystem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) - */ - // syntactic sugar - public StringType addCodeSystemElement() {//2 - StringType t = new StringType(); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return t; - } - - /** - * @param value {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) - */ - public ModuleDefinitionValueSetComponent addCodeSystem(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return this; - } - - /** - * @param value {@link #codeSystem} (The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.) - */ - public boolean hasCodeSystem(String value) { - if (this.codeSystem == null) - return false; - for (StringType v : this.codeSystem) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The local name for the value set.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("identifier", "string", "The value set uri.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version of the value set, if any.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("codeSystem", "string", "The code systems in use within the value set. These must refer to previously defined code systems within this knowledge module or a referenced library.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // StringType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1618432855: // identifier - this.identifier = castToString(value); // StringType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case -916511108: // codeSystem - this.getCodeSystem().add(castToString(value)); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("identifier")) - this.identifier = castToString(value); // StringType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("codeSystem")) - this.getCodeSystem().add(castToString(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // StringType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case -916511108: throw new FHIRException("Cannot make property codeSystem as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); - } - else if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.identifier"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); - } - else if (name.equals("codeSystem")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.codeSystem"); - } - else - return super.addChild(name); - } - - public ModuleDefinitionValueSetComponent copy() { - ModuleDefinitionValueSetComponent dst = new ModuleDefinitionValueSetComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - if (codeSystem != null) { - dst.codeSystem = new ArrayList(); - for (StringType i : codeSystem) - dst.codeSystem.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionValueSetComponent)) - return false; - ModuleDefinitionValueSetComponent o = (ModuleDefinitionValueSetComponent) other; - return compareDeep(name, o.name, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(codeSystem, o.codeSystem, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionValueSetComponent)) - return false; - ModuleDefinitionValueSetComponent o = (ModuleDefinitionValueSetComponent) other; - return compareValues(name, o.name, true) && compareValues(identifier, o.identifier, true) && compareValues(version, o.version, true) - && compareValues(codeSystem, o.codeSystem, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) - ; - } - - public String fhirType() { - return "ModuleDefinition.valueSet"; - - } - - } - - @Block() - public static class ModuleDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the parameter. - */ - @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The name of the parameter." ) - protected CodeType name; - - /** - * Whether the parameter is input or output for the module. - */ - @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="Whether the parameter is input or output for the module." ) - protected CodeType use; - - /** - * A brief description of the parameter. - */ - @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="A brief description of the parameter." ) - protected StringType documentation; - - /** - * The type of the parameter. - */ - @Child(name = "type", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The type of the parameter." ) - protected CodeType type; - - /** - * The profile of the parameter, if any. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="The profile of the parameter, if any." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (The profile of the parameter, if any.) - */ - protected StructureDefinition profileTarget; - - private static final long serialVersionUID = 1572548838L; - - /** - * Constructor - */ - public ModuleDefinitionParameterComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionParameterComponent(CodeType name, CodeType use, CodeType type) { - super(); - this.name = name; - this.use = use; - this.type = type; - } - - /** - * @return {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleDefinitionParameterComponent setNameElement(CodeType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter. - */ - public ModuleDefinitionParameterComponent setName(String value) { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public CodeType getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new CodeType(); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public ModuleDefinitionParameterComponent setUseElement(CodeType value) { - this.use = value; - return this; - } - - /** - * @return Whether the parameter is input or output for the module. - */ - public String getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Whether the parameter is input or output for the module. - */ - public ModuleDefinitionParameterComponent setUse(String value) { - if (this.use == null) - this.use = new CodeType(); - this.use.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (A brief description of the parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (A brief description of the parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ModuleDefinitionParameterComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return A brief description of the parameter. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value A brief description of the parameter. - */ - public ModuleDefinitionParameterComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ModuleDefinitionParameterComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of the parameter. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the parameter. - */ - public ModuleDefinitionParameterComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (The profile of the parameter, if any.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (The profile of the parameter, if any.) - */ - public ModuleDefinitionParameterComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The profile of the parameter, if any.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionParameterComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The profile of the parameter, if any.) - */ - public ModuleDefinitionParameterComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "code", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("use", "code", "Whether the parameter is input or output for the module.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("documentation", "string", "A brief description of the parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("type", "code", "The type of the parameter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the parameter, if any.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // CodeType - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToCode(value); // CodeType - break; - case 116103: // use - this.use = castToCode(value); // CodeType - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = castToCode(value); // CodeType - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // CodeType - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // CodeType - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return getProfile(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.name"); - } - else if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.use"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.documentation"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.type"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else - return super.addChild(name); - } - - public ModuleDefinitionParameterComponent copy() { - ModuleDefinitionParameterComponent dst = new ModuleDefinitionParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.use = use == null ? null : use.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionParameterComponent)) - return false; - ModuleDefinitionParameterComponent o = (ModuleDefinitionParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(documentation, o.documentation, true) - && compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionParameterComponent)) - return false; - ModuleDefinitionParameterComponent o = (ModuleDefinitionParameterComponent) other; - return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(documentation, o.documentation, true) - && compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) - && (documentation == null || documentation.isEmpty()) && (type == null || type.isEmpty()) - && (profile == null || profile.isEmpty()); - } - - public String fhirType() { - return "ModuleDefinition.parameter"; - - } - - } - - @Block() - public static class ModuleDefinitionDataComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The type of the required data", formalDefinition="The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile." ) - protected CodeType type; - - /** - * The profile of the required data, specified as the uri of the profile definition. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The profile of the required data", formalDefinition="The profile of the required data, specified as the uri of the profile definition." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (The profile of the required data, specified as the uri of the profile definition.) - */ - protected StructureDefinition profileTarget; - - /** - * Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available. - */ - @Child(name = "mustSupport", type = {StringType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Indicates that specific structure elements are referenced by the knowledge module", formalDefinition="Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available." ) - protected List mustSupport; - - /** - * Code filters for the required data, if any. - */ - @Child(name = "codeFilter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="Code filters for the required data, if any." ) - protected List codeFilter; - - /** - * Date filters for the required data, if any. - */ - @Child(name = "dateFilter", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="Date filters for the required data, if any." ) - protected List dateFilter; - - private static final long serialVersionUID = -777236908L; - - /** - * Constructor - */ - public ModuleDefinitionDataComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionDataComponent(CodeType type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionDataComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ModuleDefinitionDataComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile. - */ - public ModuleDefinitionDataComponent setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionDataComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (The profile of the required data, specified as the uri of the profile definition.) - */ - public ModuleDefinitionDataComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The profile of the required data, specified as the uri of the profile definition.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionDataComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The profile of the required data, specified as the uri of the profile definition.) - */ - public ModuleDefinitionDataComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - public List getMustSupport() { - if (this.mustSupport == null) - this.mustSupport = new ArrayList(); - return this.mustSupport; - } - - public boolean hasMustSupport() { - if (this.mustSupport == null) - return false; - for (StringType item : this.mustSupport) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - // syntactic sugar - public StringType addMustSupportElement() {//2 - StringType t = new StringType(); - if (this.mustSupport == null) - this.mustSupport = new ArrayList(); - this.mustSupport.add(t); - return t; - } - - /** - * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - public ModuleDefinitionDataComponent addMustSupport(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.mustSupport == null) - this.mustSupport = new ArrayList(); - this.mustSupport.add(t); - return this; - } - - /** - * @param value {@link #mustSupport} (Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.) - */ - public boolean hasMustSupport(String value) { - if (this.mustSupport == null) - return false; - for (StringType v : this.mustSupport) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #codeFilter} (Code filters for the required data, if any.) - */ - public List getCodeFilter() { - if (this.codeFilter == null) - this.codeFilter = new ArrayList(); - return this.codeFilter; - } - - public boolean hasCodeFilter() { - if (this.codeFilter == null) - return false; - for (ModuleDefinitionDataCodeFilterComponent item : this.codeFilter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeFilter} (Code filters for the required data, if any.) - */ - // syntactic sugar - public ModuleDefinitionDataCodeFilterComponent addCodeFilter() { //3 - ModuleDefinitionDataCodeFilterComponent t = new ModuleDefinitionDataCodeFilterComponent(); - if (this.codeFilter == null) - this.codeFilter = new ArrayList(); - this.codeFilter.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinitionDataComponent addCodeFilter(ModuleDefinitionDataCodeFilterComponent t) { //3 - if (t == null) - return this; - if (this.codeFilter == null) - this.codeFilter = new ArrayList(); - this.codeFilter.add(t); - return this; - } - - /** - * @return {@link #dateFilter} (Date filters for the required data, if any.) - */ - public List getDateFilter() { - if (this.dateFilter == null) - this.dateFilter = new ArrayList(); - return this.dateFilter; - } - - public boolean hasDateFilter() { - if (this.dateFilter == null) - return false; - for (ModuleDefinitionDataDateFilterComponent item : this.dateFilter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dateFilter} (Date filters for the required data, if any.) - */ - // syntactic sugar - public ModuleDefinitionDataDateFilterComponent addDateFilter() { //3 - ModuleDefinitionDataDateFilterComponent t = new ModuleDefinitionDataDateFilterComponent(); - if (this.dateFilter == null) - this.dateFilter = new ArrayList(); - this.dateFilter.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinitionDataComponent addDateFilter(ModuleDefinitionDataDateFilterComponent t) { //3 - if (t == null) - return this; - if (this.dateFilter == null) - this.dateFilter = new ArrayList(); - this.dateFilter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of the required data, specified as the type name of a resource. For profiles, this value is set to the type of the base resource of the profile.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "The profile of the required data, specified as the uri of the profile definition.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("mustSupport", "string", "Indicates that specific elements of the type are referenced by the knowledge module and must be supported by the consumer in order to obtain an effective evaluation. This does not mean that a value is required for this element, only that the consuming system must understand the element and be able to provide values for it if they are available.", 0, java.lang.Integer.MAX_VALUE, mustSupport)); - childrenList.add(new Property("codeFilter", "", "Code filters for the required data, if any.", 0, java.lang.Integer.MAX_VALUE, codeFilter)); - childrenList.add(new Property("dateFilter", "", "Date filters for the required data, if any.", 0, java.lang.Integer.MAX_VALUE, dateFilter)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - case -1402857082: /*mustSupport*/ return this.mustSupport == null ? new Base[0] : this.mustSupport.toArray(new Base[this.mustSupport.size()]); // StringType - case -1303674939: /*codeFilter*/ return this.codeFilter == null ? new Base[0] : this.codeFilter.toArray(new Base[this.codeFilter.size()]); // ModuleDefinitionDataCodeFilterComponent - case 149531846: /*dateFilter*/ return this.dateFilter == null ? new Base[0] : this.dateFilter.toArray(new Base[this.dateFilter.size()]); // ModuleDefinitionDataDateFilterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - case -1402857082: // mustSupport - this.getMustSupport().add(castToString(value)); // StringType - break; - case -1303674939: // codeFilter - this.getCodeFilter().add((ModuleDefinitionDataCodeFilterComponent) value); // ModuleDefinitionDataCodeFilterComponent - break; - case 149531846: // dateFilter - this.getDateFilter().add((ModuleDefinitionDataDateFilterComponent) value); // ModuleDefinitionDataDateFilterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else if (name.equals("mustSupport")) - this.getMustSupport().add(castToString(value)); - else if (name.equals("codeFilter")) - this.getCodeFilter().add((ModuleDefinitionDataCodeFilterComponent) value); - else if (name.equals("dateFilter")) - this.getDateFilter().add((ModuleDefinitionDataDateFilterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return getProfile(); // Reference - case -1402857082: throw new FHIRException("Cannot make property mustSupport as it is not a complex type"); // StringType - case -1303674939: return addCodeFilter(); // ModuleDefinitionDataCodeFilterComponent - case 149531846: return addDateFilter(); // ModuleDefinitionDataDateFilterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.type"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else if (name.equals("mustSupport")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.mustSupport"); - } - else if (name.equals("codeFilter")) { - return addCodeFilter(); - } - else if (name.equals("dateFilter")) { - return addDateFilter(); - } - else - return super.addChild(name); - } - - public ModuleDefinitionDataComponent copy() { - ModuleDefinitionDataComponent dst = new ModuleDefinitionDataComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - if (mustSupport != null) { - dst.mustSupport = new ArrayList(); - for (StringType i : mustSupport) - dst.mustSupport.add(i.copy()); - }; - if (codeFilter != null) { - dst.codeFilter = new ArrayList(); - for (ModuleDefinitionDataCodeFilterComponent i : codeFilter) - dst.codeFilter.add(i.copy()); - }; - if (dateFilter != null) { - dst.dateFilter = new ArrayList(); - for (ModuleDefinitionDataDateFilterComponent i : dateFilter) - dst.dateFilter.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionDataComponent)) - return false; - ModuleDefinitionDataComponent o = (ModuleDefinitionDataComponent) other; - return compareDeep(type, o.type, true) && compareDeep(profile, o.profile, true) && compareDeep(mustSupport, o.mustSupport, true) - && compareDeep(codeFilter, o.codeFilter, true) && compareDeep(dateFilter, o.dateFilter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionDataComponent)) - return false; - ModuleDefinitionDataComponent o = (ModuleDefinitionDataComponent) other; - return compareValues(type, o.type, true) && compareValues(mustSupport, o.mustSupport, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()) - && (mustSupport == null || mustSupport.isEmpty()) && (codeFilter == null || codeFilter.isEmpty()) - && (dateFilter == null || dateFilter.isEmpty()); - } - - public String fhirType() { - return "ModuleDefinition.data"; - - } - - } - - @Block() - public static class ModuleDefinitionDataCodeFilterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. - */ - @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The code-valued attribute of the filter", formalDefinition="The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept." ) - protected StringType path; - - /** - * The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset. - */ - @Child(name = "valueSet", type = {StringType.class, ValueSet.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The valueset for the code filter", formalDefinition="The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset." ) - protected Type valueSet; - - /** - * The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts. - */ - @Child(name = "codeableConcept", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The codeableConcepts for the filter", formalDefinition="The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts." ) - protected List codeableConcept; - - private static final long serialVersionUID = -666343535L; - - /** - * Constructor - */ - public ModuleDefinitionDataCodeFilterComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionDataCodeFilterComponent(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionDataCodeFilterComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ModuleDefinitionDataCodeFilterComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept. - */ - public ModuleDefinitionDataCodeFilterComponent setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public Type getValueSet() { - return this.valueSet; - } - - /** - * @return {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public StringType getValueSetStringType() throws FHIRException { - if (!(this.valueSet instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (StringType) this.valueSet; - } - - public boolean hasValueSetStringType() { - return this.valueSet instanceof StringType; - } - - /** - * @return {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public Reference getValueSetReference() throws FHIRException { - if (!(this.valueSet instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (Reference) this.valueSet; - } - - public boolean hasValueSetReference() { - return this.valueSet instanceof Reference; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.) - */ - public ModuleDefinitionDataCodeFilterComponent setValueSet(Type value) { - this.valueSet = value; - return this; - } - - /** - * @return {@link #codeableConcept} (The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts.) - */ - public List getCodeableConcept() { - if (this.codeableConcept == null) - this.codeableConcept = new ArrayList(); - return this.codeableConcept; - } - - public boolean hasCodeableConcept() { - if (this.codeableConcept == null) - return false; - for (CodeableConcept item : this.codeableConcept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeableConcept} (The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts.) - */ - // syntactic sugar - public CodeableConcept addCodeableConcept() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.codeableConcept == null) - this.codeableConcept = new ArrayList(); - this.codeableConcept.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinitionDataCodeFilterComponent addCodeableConcept(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.codeableConcept == null) - this.codeableConcept = new ArrayList(); - this.codeableConcept.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The code-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type code, Coding, or CodeableConcept.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("valueSet[x]", "string|Reference(ValueSet)", "The valueset for the code filter. The valueSet or codeableConcept elements are exclusive. If valueSet is specified, the filter will return only those data items for which the value of the code-valued element specified in the path is a member of the specified valueset.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - childrenList.add(new Property("codeableConcept", "CodeableConcept", "The codeable concept for the code filter. Only one of valueSet or codeableConcept may be specified. If codeableConcepts are given, the filter will return only those data items for which the code-valued attribute specified by the path has a value that is one of the specified codeable concepts.", 0, java.lang.Integer.MAX_VALUE, codeableConcept)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type - case -156504159: /*codeableConcept*/ return this.codeableConcept == null ? new Base[0] : this.codeableConcept.toArray(new Base[this.codeableConcept.size()]); // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case -1410174671: // valueSet - this.valueSet = (Type) value; // Type - break; - case -156504159: // codeableConcept - this.getCodeableConcept().add(castToCodeableConcept(value)); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("valueSet[x]")) - this.valueSet = (Type) value; // Type - else if (name.equals("codeableConcept")) - this.getCodeableConcept().add(castToCodeableConcept(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -1438410321: return getValueSet(); // Type - case -156504159: return addCodeableConcept(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.path"); - } - else if (name.equals("valueSetString")) { - this.valueSet = new StringType(); - return this.valueSet; - } - else if (name.equals("valueSetReference")) { - this.valueSet = new Reference(); - return this.valueSet; - } - else if (name.equals("codeableConcept")) { - return addCodeableConcept(); - } - else - return super.addChild(name); - } - - public ModuleDefinitionDataCodeFilterComponent copy() { - ModuleDefinitionDataCodeFilterComponent dst = new ModuleDefinitionDataCodeFilterComponent(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - if (codeableConcept != null) { - dst.codeableConcept = new ArrayList(); - for (CodeableConcept i : codeableConcept) - dst.codeableConcept.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionDataCodeFilterComponent)) - return false; - ModuleDefinitionDataCodeFilterComponent o = (ModuleDefinitionDataCodeFilterComponent) other; - return compareDeep(path, o.path, true) && compareDeep(valueSet, o.valueSet, true) && compareDeep(codeableConcept, o.codeableConcept, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionDataCodeFilterComponent)) - return false; - ModuleDefinitionDataCodeFilterComponent o = (ModuleDefinitionDataCodeFilterComponent) other; - return compareValues(path, o.path, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (valueSet == null || valueSet.isEmpty()) - && (codeableConcept == null || codeableConcept.isEmpty()); - } - - public String fhirType() { - return "ModuleDefinition.data.codeFilter"; - - } - - } - - @Block() - public static class ModuleDefinitionDataDateFilterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. - */ - @Child(name = "path", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The date-valued attribute of the filter", formalDefinition="The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing." ) - protected StringType path; - - /** - * The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime. - */ - @Child(name = "value", type = {DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The value of the filter, as a Period or dateTime value", formalDefinition="The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime." ) - protected Type value; - - private static final long serialVersionUID = 1791957163L; - - /** - * Constructor - */ - public ModuleDefinitionDataDateFilterComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleDefinitionDataDateFilterComponent(StringType path) { - super(); - this.path = path; - } - - /** - * @return {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinitionDataDateFilterComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public ModuleDefinitionDataDateFilterComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing. - */ - public ModuleDefinitionDataDateFilterComponent setPath(String value) { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public DateTimeType getValueDateTimeType() throws FHIRException { - if (!(this.value instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - public boolean hasValueDateTimeType() { - return this.value instanceof DateTimeType; - } - - /** - * @return {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public Period getValuePeriod() throws FHIRException { - if (!(this.value instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Period) this.value; - } - - public boolean hasValuePeriod() { - return this.value instanceof Period; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.) - */ - public ModuleDefinitionDataDateFilterComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("path", "string", "The date-valued attribute of the filter. The specified path must be resolvable from the type of the required data. The path is allowed to contain qualifiers (.) to traverse sub-elements, as well as indexers ([x]) to traverse multiple-cardinality sub-elements. Note that the index must be an integer constant. The path must resolve to an element of type dateTime, Period, Schedule, or Timing.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("value[x]", "dateTime|Period", "The value of the filter. If period is specified, the filter will return only those data items that fall within the bounds determined by the Period, inclusive of the period boundaries. If dateTime is specified, the filter will return only those data items that are equal to the specified dateTime.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3433509: // path - this.path = castToString(value); // StringType - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.path"); - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else - return super.addChild(name); - } - - public ModuleDefinitionDataDateFilterComponent copy() { - ModuleDefinitionDataDateFilterComponent dst = new ModuleDefinitionDataDateFilterComponent(); - copyValues(dst); - dst.path = path == null ? null : path.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinitionDataDateFilterComponent)) - return false; - ModuleDefinitionDataDateFilterComponent o = (ModuleDefinitionDataDateFilterComponent) other; - return compareDeep(path, o.path, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinitionDataDateFilterComponent)) - return false; - ModuleDefinitionDataDateFilterComponent o = (ModuleDefinitionDataDateFilterComponent) other; - return compareValues(path, o.path, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (path == null || path.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "ModuleDefinition.data.dateFilter"; - - } - - } - - /** - * A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Logical identifier", formalDefinition="A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact." ) - protected List identifier; - - /** - * The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The version of the module, if any", formalDefinition="The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification." ) - protected StringType version; - - /** - * A model reference used by the content. - */ - @Child(name = "model", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="A model reference used by the content." ) - protected List model; - - /** - * A library referenced by the module. The reference must consist of either an id, or a document reference. - */ - @Child(name = "library", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A library referenced by the module", formalDefinition="A library referenced by the module. The reference must consist of either an id, or a document reference." ) - protected List library; - - /** - * A code system definition used within the knowledge module. - */ - @Child(name = "codeSystem", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="A code system definition used within the knowledge module." ) - protected List codeSystem; - - /** - * A value set definition used by the knowledge module. - */ - @Child(name = "valueSet", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="A value set definition used by the knowledge module." ) - protected List valueSet; - - /** - * Parameters to the module. - */ - @Child(name = "parameter", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="", formalDefinition="Parameters to the module." ) - protected List parameter; - - /** - * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data. - */ - @Child(name = "data", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Describes a required data item", formalDefinition="Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data." ) - protected List data; - - private static final long serialVersionUID = -1288058693L; - - /** - * Constructor - */ - public ModuleDefinition() { - super(); - } - - /** - * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleDefinition.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ModuleDefinition setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. - */ - public ModuleDefinition setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #model} (A model reference used by the content.) - */ - public List getModel() { - if (this.model == null) - this.model = new ArrayList(); - return this.model; - } - - public boolean hasModel() { - if (this.model == null) - return false; - for (ModuleDefinitionModelComponent item : this.model) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #model} (A model reference used by the content.) - */ - // syntactic sugar - public ModuleDefinitionModelComponent addModel() { //3 - ModuleDefinitionModelComponent t = new ModuleDefinitionModelComponent(); - if (this.model == null) - this.model = new ArrayList(); - this.model.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addModel(ModuleDefinitionModelComponent t) { //3 - if (t == null) - return this; - if (this.model == null) - this.model = new ArrayList(); - this.model.add(t); - return this; - } - - /** - * @return {@link #library} (A library referenced by the module. The reference must consist of either an id, or a document reference.) - */ - public List getLibrary() { - if (this.library == null) - this.library = new ArrayList(); - return this.library; - } - - public boolean hasLibrary() { - if (this.library == null) - return false; - for (ModuleDefinitionLibraryComponent item : this.library) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #library} (A library referenced by the module. The reference must consist of either an id, or a document reference.) - */ - // syntactic sugar - public ModuleDefinitionLibraryComponent addLibrary() { //3 - ModuleDefinitionLibraryComponent t = new ModuleDefinitionLibraryComponent(); - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addLibrary(ModuleDefinitionLibraryComponent t) { //3 - if (t == null) - return this; - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return this; - } - - /** - * @return {@link #codeSystem} (A code system definition used within the knowledge module.) - */ - public List getCodeSystem() { - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - return this.codeSystem; - } - - public boolean hasCodeSystem() { - if (this.codeSystem == null) - return false; - for (ModuleDefinitionCodeSystemComponent item : this.codeSystem) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #codeSystem} (A code system definition used within the knowledge module.) - */ - // syntactic sugar - public ModuleDefinitionCodeSystemComponent addCodeSystem() { //3 - ModuleDefinitionCodeSystemComponent t = new ModuleDefinitionCodeSystemComponent(); - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addCodeSystem(ModuleDefinitionCodeSystemComponent t) { //3 - if (t == null) - return this; - if (this.codeSystem == null) - this.codeSystem = new ArrayList(); - this.codeSystem.add(t); - return this; - } - - /** - * @return {@link #valueSet} (A value set definition used by the knowledge module.) - */ - public List getValueSet() { - if (this.valueSet == null) - this.valueSet = new ArrayList(); - return this.valueSet; - } - - public boolean hasValueSet() { - if (this.valueSet == null) - return false; - for (ModuleDefinitionValueSetComponent item : this.valueSet) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #valueSet} (A value set definition used by the knowledge module.) - */ - // syntactic sugar - public ModuleDefinitionValueSetComponent addValueSet() { //3 - ModuleDefinitionValueSetComponent t = new ModuleDefinitionValueSetComponent(); - if (this.valueSet == null) - this.valueSet = new ArrayList(); - this.valueSet.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addValueSet(ModuleDefinitionValueSetComponent t) { //3 - if (t == null) - return this; - if (this.valueSet == null) - this.valueSet = new ArrayList(); - this.valueSet.add(t); - return this; - } - - /** - * @return {@link #parameter} (Parameters to the module.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ModuleDefinitionParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (Parameters to the module.) - */ - // syntactic sugar - public ModuleDefinitionParameterComponent addParameter() { //3 - ModuleDefinitionParameterComponent t = new ModuleDefinitionParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addParameter(ModuleDefinitionParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - /** - * @return {@link #data} (Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data.) - */ - public List getData() { - if (this.data == null) - this.data = new ArrayList(); - return this.data; - } - - public boolean hasData() { - if (this.data == null) - return false; - for (ModuleDefinitionDataComponent item : this.data) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #data} (Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data.) - */ - // syntactic sugar - public ModuleDefinitionDataComponent addData() { //3 - ModuleDefinitionDataComponent t = new ModuleDefinitionDataComponent(); - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return t; - } - - // syntactic sugar - public ModuleDefinition addData(ModuleDefinitionDataComponent t) { //3 - if (t == null) - return this; - if (this.data == null) - this.data = new ArrayList(); - this.data.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("model", "", "A model reference used by the content.", 0, java.lang.Integer.MAX_VALUE, model)); - childrenList.add(new Property("library", "", "A library referenced by the module. The reference must consist of either an id, or a document reference.", 0, java.lang.Integer.MAX_VALUE, library)); - childrenList.add(new Property("codeSystem", "", "A code system definition used within the knowledge module.", 0, java.lang.Integer.MAX_VALUE, codeSystem)); - childrenList.add(new Property("valueSet", "", "A value set definition used by the knowledge module.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - childrenList.add(new Property("parameter", "", "Parameters to the module.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("data", "", "Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of the data.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 104069929: /*model*/ return this.model == null ? new Base[0] : this.model.toArray(new Base[this.model.size()]); // ModuleDefinitionModelComponent - case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // ModuleDefinitionLibraryComponent - case -916511108: /*codeSystem*/ return this.codeSystem == null ? new Base[0] : this.codeSystem.toArray(new Base[this.codeSystem.size()]); // ModuleDefinitionCodeSystemComponent - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : this.valueSet.toArray(new Base[this.valueSet.size()]); // ModuleDefinitionValueSetComponent - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ModuleDefinitionParameterComponent - case 3076010: /*data*/ return this.data == null ? new Base[0] : this.data.toArray(new Base[this.data.size()]); // ModuleDefinitionDataComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 104069929: // model - this.getModel().add((ModuleDefinitionModelComponent) value); // ModuleDefinitionModelComponent - break; - case 166208699: // library - this.getLibrary().add((ModuleDefinitionLibraryComponent) value); // ModuleDefinitionLibraryComponent - break; - case -916511108: // codeSystem - this.getCodeSystem().add((ModuleDefinitionCodeSystemComponent) value); // ModuleDefinitionCodeSystemComponent - break; - case -1410174671: // valueSet - this.getValueSet().add((ModuleDefinitionValueSetComponent) value); // ModuleDefinitionValueSetComponent - break; - case 1954460585: // parameter - this.getParameter().add((ModuleDefinitionParameterComponent) value); // ModuleDefinitionParameterComponent - break; - case 3076010: // data - this.getData().add((ModuleDefinitionDataComponent) value); // ModuleDefinitionDataComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("model")) - this.getModel().add((ModuleDefinitionModelComponent) value); - else if (name.equals("library")) - this.getLibrary().add((ModuleDefinitionLibraryComponent) value); - else if (name.equals("codeSystem")) - this.getCodeSystem().add((ModuleDefinitionCodeSystemComponent) value); - else if (name.equals("valueSet")) - this.getValueSet().add((ModuleDefinitionValueSetComponent) value); - else if (name.equals("parameter")) - this.getParameter().add((ModuleDefinitionParameterComponent) value); - else if (name.equals("data")) - this.getData().add((ModuleDefinitionDataComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 104069929: return addModel(); // ModuleDefinitionModelComponent - case 166208699: return addLibrary(); // ModuleDefinitionLibraryComponent - case -916511108: return addCodeSystem(); // ModuleDefinitionCodeSystemComponent - case -1410174671: return addValueSet(); // ModuleDefinitionValueSetComponent - case 1954460585: return addParameter(); // ModuleDefinitionParameterComponent - case 3076010: return addData(); // ModuleDefinitionDataComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleDefinition.version"); - } - else if (name.equals("model")) { - return addModel(); - } - else if (name.equals("library")) { - return addLibrary(); - } - else if (name.equals("codeSystem")) { - return addCodeSystem(); - } - else if (name.equals("valueSet")) { - return addValueSet(); - } - else if (name.equals("parameter")) { - return addParameter(); - } - else if (name.equals("data")) { - return addData(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ModuleDefinition"; - - } - - public ModuleDefinition copy() { - ModuleDefinition dst = new ModuleDefinition(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - if (model != null) { - dst.model = new ArrayList(); - for (ModuleDefinitionModelComponent i : model) - dst.model.add(i.copy()); - }; - if (library != null) { - dst.library = new ArrayList(); - for (ModuleDefinitionLibraryComponent i : library) - dst.library.add(i.copy()); - }; - if (codeSystem != null) { - dst.codeSystem = new ArrayList(); - for (ModuleDefinitionCodeSystemComponent i : codeSystem) - dst.codeSystem.add(i.copy()); - }; - if (valueSet != null) { - dst.valueSet = new ArrayList(); - for (ModuleDefinitionValueSetComponent i : valueSet) - dst.valueSet.add(i.copy()); - }; - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ModuleDefinitionParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - if (data != null) { - dst.data = new ArrayList(); - for (ModuleDefinitionDataComponent i : data) - dst.data.add(i.copy()); - }; - return dst; - } - - protected ModuleDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleDefinition)) - return false; - ModuleDefinition o = (ModuleDefinition) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) && compareDeep(model, o.model, true) - && compareDeep(library, o.library, true) && compareDeep(codeSystem, o.codeSystem, true) && compareDeep(valueSet, o.valueSet, true) - && compareDeep(parameter, o.parameter, true) && compareDeep(data, o.data, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleDefinition)) - return false; - ModuleDefinition o = (ModuleDefinition) other; - return compareValues(version, o.version, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (version == null || version.isEmpty()) - && (model == null || model.isEmpty()) && (library == null || library.isEmpty()) && (codeSystem == null || codeSystem.isEmpty()) - && (valueSet == null || valueSet.isEmpty()) && (parameter == null || parameter.isEmpty()) - && (data == null || data.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ModuleDefinition; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java deleted file mode 100644 index ec59c15fbba..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ModuleMetadata.java +++ /dev/null @@ -1,3227 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * The ModuleMetadata structure defines the common metadata elements used by quality improvement artifacts. This information includes descriptive and topical metadata to enable repository searches, as well as governance and evidentiary support information. - */ -@DatatypeDef(name="ModuleMetadata") -public class ModuleMetadata extends Type implements ICompositeType { - - public enum ModuleMetadataType { - /** - * The resource is a description of a knowledge module - */ - MODULE, - /** - * The resource is a shareable library of formalized knowledge - */ - LIBRARY, - /** - * An Event-Condition-Action Rule Artifact - */ - DECISIONSUPPORTRULE, - /** - * A Documentation Template Artifact - */ - DOCUMENTATIONTEMPLATE, - /** - * An Order Set Artifact - */ - ORDERSET, - /** - * added to help the parsers - */ - NULL; - public static ModuleMetadataType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("module".equals(codeString)) - return MODULE; - if ("library".equals(codeString)) - return LIBRARY; - if ("decision-support-rule".equals(codeString)) - return DECISIONSUPPORTRULE; - if ("documentation-template".equals(codeString)) - return DOCUMENTATIONTEMPLATE; - if ("order-set".equals(codeString)) - return ORDERSET; - throw new FHIRException("Unknown ModuleMetadataType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case MODULE: return "module"; - case LIBRARY: return "library"; - case DECISIONSUPPORTRULE: return "decision-support-rule"; - case DOCUMENTATIONTEMPLATE: return "documentation-template"; - case ORDERSET: return "order-set"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case MODULE: return "http://hl7.org/fhir/module-metadata-type"; - case LIBRARY: return "http://hl7.org/fhir/module-metadata-type"; - case DECISIONSUPPORTRULE: return "http://hl7.org/fhir/module-metadata-type"; - case DOCUMENTATIONTEMPLATE: return "http://hl7.org/fhir/module-metadata-type"; - case ORDERSET: return "http://hl7.org/fhir/module-metadata-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case MODULE: return "The resource is a description of a knowledge module"; - case LIBRARY: return "The resource is a shareable library of formalized knowledge"; - case DECISIONSUPPORTRULE: return "An Event-Condition-Action Rule Artifact"; - case DOCUMENTATIONTEMPLATE: return "A Documentation Template Artifact"; - case ORDERSET: return "An Order Set Artifact"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case MODULE: return "Module"; - case LIBRARY: return "Library"; - case DECISIONSUPPORTRULE: return "Decision Support Rule"; - case DOCUMENTATIONTEMPLATE: return "Documentation Template"; - case ORDERSET: return "Order Set"; - default: return "?"; - } - } - } - - public static class ModuleMetadataTypeEnumFactory implements EnumFactory { - public ModuleMetadataType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("module".equals(codeString)) - return ModuleMetadataType.MODULE; - if ("library".equals(codeString)) - return ModuleMetadataType.LIBRARY; - if ("decision-support-rule".equals(codeString)) - return ModuleMetadataType.DECISIONSUPPORTRULE; - if ("documentation-template".equals(codeString)) - return ModuleMetadataType.DOCUMENTATIONTEMPLATE; - if ("order-set".equals(codeString)) - return ModuleMetadataType.ORDERSET; - throw new IllegalArgumentException("Unknown ModuleMetadataType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("module".equals(codeString)) - return new Enumeration(this, ModuleMetadataType.MODULE); - if ("library".equals(codeString)) - return new Enumeration(this, ModuleMetadataType.LIBRARY); - if ("decision-support-rule".equals(codeString)) - return new Enumeration(this, ModuleMetadataType.DECISIONSUPPORTRULE); - if ("documentation-template".equals(codeString)) - return new Enumeration(this, ModuleMetadataType.DOCUMENTATIONTEMPLATE); - if ("order-set".equals(codeString)) - return new Enumeration(this, ModuleMetadataType.ORDERSET); - throw new FHIRException("Unknown ModuleMetadataType code '"+codeString+"'"); - } - public String toCode(ModuleMetadataType code) { - if (code == ModuleMetadataType.MODULE) - return "module"; - if (code == ModuleMetadataType.LIBRARY) - return "library"; - if (code == ModuleMetadataType.DECISIONSUPPORTRULE) - return "decision-support-rule"; - if (code == ModuleMetadataType.DOCUMENTATIONTEMPLATE) - return "documentation-template"; - if (code == ModuleMetadataType.ORDERSET) - return "order-set"; - return "?"; - } - public String toSystem(ModuleMetadataType code) { - return code.getSystem(); - } - } - - public enum ModuleMetadataStatus { - /** - * The module is in draft state - */ - DRAFT, - /** - * The module is active - */ - ACTIVE, - /** - * The module is inactive, either rejected before publication, or retired after publication - */ - INACTIVE, - /** - * added to help the parsers - */ - NULL; - public static ModuleMetadataStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("inactive".equals(codeString)) - return INACTIVE; - throw new FHIRException("Unknown ModuleMetadataStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case INACTIVE: return "inactive"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return "http://hl7.org/fhir/module-metadata-status"; - case ACTIVE: return "http://hl7.org/fhir/module-metadata-status"; - case INACTIVE: return "http://hl7.org/fhir/module-metadata-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "The module is in draft state"; - case ACTIVE: return "The module is active"; - case INACTIVE: return "The module is inactive, either rejected before publication, or retired after publication"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case ACTIVE: return "Active"; - case INACTIVE: return "Inactive"; - default: return "?"; - } - } - } - - public static class ModuleMetadataStatusEnumFactory implements EnumFactory { - public ModuleMetadataStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ModuleMetadataStatus.DRAFT; - if ("active".equals(codeString)) - return ModuleMetadataStatus.ACTIVE; - if ("inactive".equals(codeString)) - return ModuleMetadataStatus.INACTIVE; - throw new IllegalArgumentException("Unknown ModuleMetadataStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return new Enumeration(this, ModuleMetadataStatus.DRAFT); - if ("active".equals(codeString)) - return new Enumeration(this, ModuleMetadataStatus.ACTIVE); - if ("inactive".equals(codeString)) - return new Enumeration(this, ModuleMetadataStatus.INACTIVE); - throw new FHIRException("Unknown ModuleMetadataStatus code '"+codeString+"'"); - } - public String toCode(ModuleMetadataStatus code) { - if (code == ModuleMetadataStatus.DRAFT) - return "draft"; - if (code == ModuleMetadataStatus.ACTIVE) - return "active"; - if (code == ModuleMetadataStatus.INACTIVE) - return "inactive"; - return "?"; - } - public String toSystem(ModuleMetadataStatus code) { - return code.getSystem(); - } - } - - public enum ModuleMetadataContributorType { - /** - * An author of the content of the module - */ - AUTHOR, - /** - * An editor of the content of the module - */ - EDITOR, - /** - * A reviewer of the content of the module - */ - REVIEWER, - /** - * An endorser of the content of the module - */ - ENDORSER, - /** - * added to help the parsers - */ - NULL; - public static ModuleMetadataContributorType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("author".equals(codeString)) - return AUTHOR; - if ("editor".equals(codeString)) - return EDITOR; - if ("reviewer".equals(codeString)) - return REVIEWER; - if ("endorser".equals(codeString)) - return ENDORSER; - throw new FHIRException("Unknown ModuleMetadataContributorType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AUTHOR: return "author"; - case EDITOR: return "editor"; - case REVIEWER: return "reviewer"; - case ENDORSER: return "endorser"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AUTHOR: return "http://hl7.org/fhir/module-metadata-contributor"; - case EDITOR: return "http://hl7.org/fhir/module-metadata-contributor"; - case REVIEWER: return "http://hl7.org/fhir/module-metadata-contributor"; - case ENDORSER: return "http://hl7.org/fhir/module-metadata-contributor"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AUTHOR: return "An author of the content of the module"; - case EDITOR: return "An editor of the content of the module"; - case REVIEWER: return "A reviewer of the content of the module"; - case ENDORSER: return "An endorser of the content of the module"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AUTHOR: return "Author"; - case EDITOR: return "Editor"; - case REVIEWER: return "Reviewer"; - case ENDORSER: return "Endorser"; - default: return "?"; - } - } - } - - public static class ModuleMetadataContributorTypeEnumFactory implements EnumFactory { - public ModuleMetadataContributorType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("author".equals(codeString)) - return ModuleMetadataContributorType.AUTHOR; - if ("editor".equals(codeString)) - return ModuleMetadataContributorType.EDITOR; - if ("reviewer".equals(codeString)) - return ModuleMetadataContributorType.REVIEWER; - if ("endorser".equals(codeString)) - return ModuleMetadataContributorType.ENDORSER; - throw new IllegalArgumentException("Unknown ModuleMetadataContributorType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("author".equals(codeString)) - return new Enumeration(this, ModuleMetadataContributorType.AUTHOR); - if ("editor".equals(codeString)) - return new Enumeration(this, ModuleMetadataContributorType.EDITOR); - if ("reviewer".equals(codeString)) - return new Enumeration(this, ModuleMetadataContributorType.REVIEWER); - if ("endorser".equals(codeString)) - return new Enumeration(this, ModuleMetadataContributorType.ENDORSER); - throw new FHIRException("Unknown ModuleMetadataContributorType code '"+codeString+"'"); - } - public String toCode(ModuleMetadataContributorType code) { - if (code == ModuleMetadataContributorType.AUTHOR) - return "author"; - if (code == ModuleMetadataContributorType.EDITOR) - return "editor"; - if (code == ModuleMetadataContributorType.REVIEWER) - return "reviewer"; - if (code == ModuleMetadataContributorType.ENDORSER) - return "endorser"; - return "?"; - } - public String toSystem(ModuleMetadataContributorType code) { - return code.getSystem(); - } - } - - public enum ModuleMetadataResourceType { - /** - * Additional documentation for the module. This would include additional instructions on usage as well additional information on clinical context or appropriateness - */ - DOCUMENTATION, - /** - * A summary of the justification for the artifact including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the module available to the consumer of interventions or results produced by the artifact - */ - JUSTIFICATION, - /** - * Bibliographic citation for papers, references, or other relevant material for the module. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this module - */ - CITATION, - /** - * The previous version of the module - */ - PREDECESSOR, - /** - * The next version of the module - */ - SUCCESSOR, - /** - * The module is derived from the resource. This is intended to capture the relationship when a particular module is based on the content of another module, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting - */ - DERIVEDFROM, - /** - * added to help the parsers - */ - NULL; - public static ModuleMetadataResourceType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("documentation".equals(codeString)) - return DOCUMENTATION; - if ("justification".equals(codeString)) - return JUSTIFICATION; - if ("citation".equals(codeString)) - return CITATION; - if ("predecessor".equals(codeString)) - return PREDECESSOR; - if ("successor".equals(codeString)) - return SUCCESSOR; - if ("derived-from".equals(codeString)) - return DERIVEDFROM; - throw new FHIRException("Unknown ModuleMetadataResourceType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DOCUMENTATION: return "documentation"; - case JUSTIFICATION: return "justification"; - case CITATION: return "citation"; - case PREDECESSOR: return "predecessor"; - case SUCCESSOR: return "successor"; - case DERIVEDFROM: return "derived-from"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DOCUMENTATION: return "http://hl7.org/fhir/module-metadata-resource-type"; - case JUSTIFICATION: return "http://hl7.org/fhir/module-metadata-resource-type"; - case CITATION: return "http://hl7.org/fhir/module-metadata-resource-type"; - case PREDECESSOR: return "http://hl7.org/fhir/module-metadata-resource-type"; - case SUCCESSOR: return "http://hl7.org/fhir/module-metadata-resource-type"; - case DERIVEDFROM: return "http://hl7.org/fhir/module-metadata-resource-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DOCUMENTATION: return "Additional documentation for the module. This would include additional instructions on usage as well additional information on clinical context or appropriateness"; - case JUSTIFICATION: return "A summary of the justification for the artifact including supporting evidence, relevant guidelines, or other clinically important information. This information is intended to provide a way to make the justification for the module available to the consumer of interventions or results produced by the artifact"; - case CITATION: return "Bibliographic citation for papers, references, or other relevant material for the module. This is intended to allow for citation of related material, but that was not necessarily specifically prepared in connection with this module"; - case PREDECESSOR: return "The previous version of the module"; - case SUCCESSOR: return "The next version of the module"; - case DERIVEDFROM: return "The module is derived from the resource. This is intended to capture the relationship when a particular module is based on the content of another module, but is modified to capture either a different set of overall requirements, or a more specific set of requirements such as those involved in a particular institution or clinical setting"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DOCUMENTATION: return "Documentation"; - case JUSTIFICATION: return "Justification"; - case CITATION: return "Citation"; - case PREDECESSOR: return "Predecessor"; - case SUCCESSOR: return "Successor"; - case DERIVEDFROM: return "Derived From"; - default: return "?"; - } - } - } - - public static class ModuleMetadataResourceTypeEnumFactory implements EnumFactory { - public ModuleMetadataResourceType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("documentation".equals(codeString)) - return ModuleMetadataResourceType.DOCUMENTATION; - if ("justification".equals(codeString)) - return ModuleMetadataResourceType.JUSTIFICATION; - if ("citation".equals(codeString)) - return ModuleMetadataResourceType.CITATION; - if ("predecessor".equals(codeString)) - return ModuleMetadataResourceType.PREDECESSOR; - if ("successor".equals(codeString)) - return ModuleMetadataResourceType.SUCCESSOR; - if ("derived-from".equals(codeString)) - return ModuleMetadataResourceType.DERIVEDFROM; - throw new IllegalArgumentException("Unknown ModuleMetadataResourceType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("documentation".equals(codeString)) - return new Enumeration(this, ModuleMetadataResourceType.DOCUMENTATION); - if ("justification".equals(codeString)) - return new Enumeration(this, ModuleMetadataResourceType.JUSTIFICATION); - if ("citation".equals(codeString)) - return new Enumeration(this, ModuleMetadataResourceType.CITATION); - if ("predecessor".equals(codeString)) - return new Enumeration(this, ModuleMetadataResourceType.PREDECESSOR); - if ("successor".equals(codeString)) - return new Enumeration(this, ModuleMetadataResourceType.SUCCESSOR); - if ("derived-from".equals(codeString)) - return new Enumeration(this, ModuleMetadataResourceType.DERIVEDFROM); - throw new FHIRException("Unknown ModuleMetadataResourceType code '"+codeString+"'"); - } - public String toCode(ModuleMetadataResourceType code) { - if (code == ModuleMetadataResourceType.DOCUMENTATION) - return "documentation"; - if (code == ModuleMetadataResourceType.JUSTIFICATION) - return "justification"; - if (code == ModuleMetadataResourceType.CITATION) - return "citation"; - if (code == ModuleMetadataResourceType.PREDECESSOR) - return "predecessor"; - if (code == ModuleMetadataResourceType.SUCCESSOR) - return "successor"; - if (code == ModuleMetadataResourceType.DERIVEDFROM) - return "derived-from"; - return "?"; - } - public String toSystem(ModuleMetadataResourceType code) { - return code.getSystem(); - } - } - - @Block() - public static class ModuleMetadataCoverageComponent extends Element implements IBaseDatatypeElement { - /** - * Specifies the focus of the coverage attribute. - */ - @Child(name = "focus", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="patient-gender | patient-age-group | clinical-focus | target-user | workflow-setting | workflow-task | clinical-venue | jurisdiction", formalDefinition="Specifies the focus of the coverage attribute." ) - protected Coding focus; - - /** - * Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus. - */ - @Child(name = "value", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Value of the coverage attribute", formalDefinition="Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus." ) - protected CodeableConcept value; - - private static final long serialVersionUID = 65126300L; - - /** - * Constructor - */ - public ModuleMetadataCoverageComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleMetadataCoverageComponent(Coding focus, CodeableConcept value) { - super(); - this.focus = focus; - this.value = value; - } - - /** - * @return {@link #focus} (Specifies the focus of the coverage attribute.) - */ - public Coding getFocus() { - if (this.focus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataCoverageComponent.focus"); - else if (Configuration.doAutoCreate()) - this.focus = new Coding(); // cc - return this.focus; - } - - public boolean hasFocus() { - return this.focus != null && !this.focus.isEmpty(); - } - - /** - * @param value {@link #focus} (Specifies the focus of the coverage attribute.) - */ - public ModuleMetadataCoverageComponent setFocus(Coding value) { - this.focus = value; - return this; - } - - /** - * @return {@link #value} (Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.) - */ - public CodeableConcept getValue() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataCoverageComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new CodeableConcept(); // cc - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.) - */ - public ModuleMetadataCoverageComponent setValue(CodeableConcept value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("focus", "Coding", "Specifies the focus of the coverage attribute.", 0, java.lang.Integer.MAX_VALUE, focus)); - childrenList.add(new Property("value", "CodeableConcept", "Provides a value for the coverage attribute. Different values are appropriate in different focus areas, as specified in the description of values for focus.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 97604824: /*focus*/ return this.focus == null ? new Base[0] : new Base[] {this.focus}; // Coding - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 97604824: // focus - this.focus = castToCoding(value); // Coding - break; - case 111972721: // value - this.value = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("focus")) - this.focus = castToCoding(value); // Coding - else if (name.equals("value")) - this.value = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 97604824: return getFocus(); // Coding - case 111972721: return getValue(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("focus")) { - this.focus = new Coding(); - return this.focus; - } - else if (name.equals("value")) { - this.value = new CodeableConcept(); - return this.value; - } - else - return super.addChild(name); - } - - public ModuleMetadataCoverageComponent copy() { - ModuleMetadataCoverageComponent dst = new ModuleMetadataCoverageComponent(); - copyValues(dst); - dst.focus = focus == null ? null : focus.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleMetadataCoverageComponent)) - return false; - ModuleMetadataCoverageComponent o = (ModuleMetadataCoverageComponent) other; - return compareDeep(focus, o.focus, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleMetadataCoverageComponent)) - return false; - ModuleMetadataCoverageComponent o = (ModuleMetadataCoverageComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (focus == null || focus.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "ModuleMetadata.coverage"; - - } - - } - - @Block() - public static class ModuleMetadataContributorComponent extends Element implements IBaseDatatypeElement { - /** - * The type of contributor. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="author | editor | reviewer | endorser", formalDefinition="The type of contributor." ) - protected Enumeration type; - - /** - * The name of the individual or organization responsible for the contribution. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of the contributor", formalDefinition="The name of the individual or organization responsible for the contribution." ) - protected StringType name; - - /** - * Contacts to assist a user in finding and communicating with the contributor. - */ - @Child(name = "contact", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contact details of the contributor", formalDefinition="Contacts to assist a user in finding and communicating with the contributor." ) - protected List contact; - - private static final long serialVersionUID = 1033333886L; - - /** - * Constructor - */ - public ModuleMetadataContributorComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleMetadataContributorComponent(Enumeration type, StringType name) { - super(); - this.type = type; - this.name = name; - } - - /** - * @return {@link #type} (The type of contributor.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataContributorComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ModuleMetadataContributorTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of contributor.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ModuleMetadataContributorComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of contributor. - */ - public ModuleMetadataContributorType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of contributor. - */ - public ModuleMetadataContributorComponent setType(ModuleMetadataContributorType value) { - if (this.type == null) - this.type = new Enumeration(new ModuleMetadataContributorTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #name} (The name of the individual or organization responsible for the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataContributorComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the individual or organization responsible for the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleMetadataContributorComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the individual or organization responsible for the contribution. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the individual or organization responsible for the contribution. - */ - public ModuleMetadataContributorComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the contributor.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ModuleMetadataContributorContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the contributor.) - */ - // syntactic sugar - public ModuleMetadataContributorContactComponent addContact() { //3 - ModuleMetadataContributorContactComponent t = new ModuleMetadataContributorContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadataContributorComponent addContact(ModuleMetadataContributorContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of contributor.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("name", "string", "The name of the individual or organization responsible for the contribution.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the contributor.", 0, java.lang.Integer.MAX_VALUE, contact)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ModuleMetadataContributorContactComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new ModuleMetadataContributorTypeEnumFactory().fromType(value); // Enumeration - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ModuleMetadataContributorContactComponent) value); // ModuleMetadataContributorContactComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new ModuleMetadataContributorTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ModuleMetadataContributorContactComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 951526432: return addContact(); // ModuleMetadataContributorContactComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); - } - else if (name.equals("contact")) { - return addContact(); - } - else - return super.addChild(name); - } - - public ModuleMetadataContributorComponent copy() { - ModuleMetadataContributorComponent dst = new ModuleMetadataContributorComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.name = name == null ? null : name.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ModuleMetadataContributorContactComponent i : contact) - dst.contact.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleMetadataContributorComponent)) - return false; - ModuleMetadataContributorComponent o = (ModuleMetadataContributorComponent) other; - return compareDeep(type, o.type, true) && compareDeep(name, o.name, true) && compareDeep(contact, o.contact, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleMetadataContributorComponent)) - return false; - ModuleMetadataContributorComponent o = (ModuleMetadataContributorComponent) other; - return compareValues(type, o.type, true) && compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) - && (contact == null || contact.isEmpty()); - } - - public String fhirType() { - return "ModuleMetadata.contributor"; - - } - - } - - @Block() - public static class ModuleMetadataContributorContactComponent extends Element implements IBaseDatatypeElement { - /** - * The name of an individual to contact regarding the contribution. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the contribution." ) - protected StringType name; - - /** - * Contact details for the individual (if a name was provided) or the contributor. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contact details for an individual or contributor", formalDefinition="Contact details for the individual (if a name was provided) or the contributor." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ModuleMetadataContributorContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataContributorContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the contribution.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleMetadataContributorContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the contribution. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the contribution. - */ - public ModuleMetadataContributorContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the contributor.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the contributor.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadataContributorContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the contribution.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for the individual (if a name was provided) or the contributor.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ModuleMetadataContributorContactComponent copy() { - ModuleMetadataContributorContactComponent dst = new ModuleMetadataContributorContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleMetadataContributorContactComponent)) - return false; - ModuleMetadataContributorContactComponent o = (ModuleMetadataContributorContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleMetadataContributorContactComponent)) - return false; - ModuleMetadataContributorContactComponent o = (ModuleMetadataContributorContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "ModuleMetadata.contributor.contact"; - - } - - } - - @Block() - public static class ModuleMetadataContactComponent extends Element implements IBaseDatatypeElement { - /** - * The name of an individual to contact regarding the module. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the module." ) - protected StringType name; - - /** - * Contact details for the individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contact details for an individual or publisher", formalDefinition="Contact details for the individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ModuleMetadataContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the module.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the module.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleMetadataContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the module. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the module. - */ - public ModuleMetadataContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for the individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadataContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the module.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for the individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ModuleMetadataContactComponent copy() { - ModuleMetadataContactComponent dst = new ModuleMetadataContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleMetadataContactComponent)) - return false; - ModuleMetadataContactComponent o = (ModuleMetadataContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleMetadataContactComponent)) - return false; - ModuleMetadataContactComponent o = (ModuleMetadataContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "ModuleMetadata.contact"; - - } - - } - - @Block() - public static class ModuleMetadataRelatedResourceComponent extends Element implements IBaseDatatypeElement { - /** - * The type of related resource. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="documentation | justification | citation | predecessor | successor | derived-from", formalDefinition="The type of related resource." ) - protected Enumeration type; - - /** - * The document being referenced, represented as an attachment. This is exclusive with the resource element. - */ - @Child(name = "document", type = {Attachment.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The related document", formalDefinition="The document being referenced, represented as an attachment. This is exclusive with the resource element." ) - protected Attachment document; - - /** - * The related resource, such as a library, value set, profile, or other module. - */ - @Child(name = "resource", type = {}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The related resource", formalDefinition="The related resource, such as a library, value set, profile, or other module." ) - protected Reference resource; - - /** - * The actual object that is the target of the reference (The related resource, such as a library, value set, profile, or other module.) - */ - protected Resource resourceTarget; - - private static final long serialVersionUID = -1400982664L; - - /** - * Constructor - */ - public ModuleMetadataRelatedResourceComponent() { - super(); - } - - /** - * Constructor - */ - public ModuleMetadataRelatedResourceComponent(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of related resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ModuleMetadataResourceTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of related resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ModuleMetadataRelatedResourceComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of related resource. - */ - public ModuleMetadataResourceType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of related resource. - */ - public ModuleMetadataRelatedResourceComponent setType(ModuleMetadataResourceType value) { - if (this.type == null) - this.type = new Enumeration(new ModuleMetadataResourceTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.) - */ - public Attachment getDocument() { - if (this.document == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.document"); - else if (Configuration.doAutoCreate()) - this.document = new Attachment(); // cc - return this.document; - } - - public boolean hasDocument() { - return this.document != null && !this.document.isEmpty(); - } - - /** - * @param value {@link #document} (The document being referenced, represented as an attachment. This is exclusive with the resource element.) - */ - public ModuleMetadataRelatedResourceComponent setDocument(Attachment value) { - this.document = value; - return this; - } - - /** - * @return {@link #resource} (The related resource, such as a library, value set, profile, or other module.) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadataRelatedResourceComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The related resource, such as a library, value set, profile, or other module.) - */ - public ModuleMetadataRelatedResourceComponent setResource(Reference value) { - this.resource = value; - return this; - } - - /** - * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The related resource, such as a library, value set, profile, or other module.) - */ - public Resource getResourceTarget() { - return this.resourceTarget; - } - - /** - * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The related resource, such as a library, value set, profile, or other module.) - */ - public ModuleMetadataRelatedResourceComponent setResourceTarget(Resource value) { - this.resourceTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of related resource.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("document", "Attachment", "The document being referenced, represented as an attachment. This is exclusive with the resource element.", 0, java.lang.Integer.MAX_VALUE, document)); - childrenList.add(new Property("resource", "Reference(Any)", "The related resource, such as a library, value set, profile, or other module.", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 861720859: /*document*/ return this.document == null ? new Base[0] : new Base[] {this.document}; // Attachment - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new ModuleMetadataResourceTypeEnumFactory().fromType(value); // Enumeration - break; - case 861720859: // document - this.document = castToAttachment(value); // Attachment - break; - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new ModuleMetadataResourceTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("document")) - this.document = castToAttachment(value); // Attachment - else if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 861720859: return getDocument(); // Attachment - case -341064690: return getResource(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type"); - } - else if (name.equals("document")) { - this.document = new Attachment(); - return this.document; - } - else if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else - return super.addChild(name); - } - - public ModuleMetadataRelatedResourceComponent copy() { - ModuleMetadataRelatedResourceComponent dst = new ModuleMetadataRelatedResourceComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.document = document == null ? null : document.copy(); - dst.resource = resource == null ? null : resource.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleMetadataRelatedResourceComponent)) - return false; - ModuleMetadataRelatedResourceComponent o = (ModuleMetadataRelatedResourceComponent) other; - return compareDeep(type, o.type, true) && compareDeep(document, o.document, true) && compareDeep(resource, o.resource, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleMetadataRelatedResourceComponent)) - return false; - ModuleMetadataRelatedResourceComponent o = (ModuleMetadataRelatedResourceComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (document == null || document.isEmpty()) - && (resource == null || resource.isEmpty()); - } - - public String fhirType() { - return "ModuleMetadata.relatedResource"; - - } - - } - - /** - * An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical URL to reference this module", formalDefinition="An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published." ) - protected UriType url; - - /** - * A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Logical identifier(s) for the module", formalDefinition="A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact." ) - protected List identifier; - - /** - * The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The version of the module, if any", formalDefinition="The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact." ) - protected StringType version; - - /** - * A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A machine-friendly name for the module", formalDefinition="A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation." ) - protected StringType name; - - /** - * A short, descriptive, user-friendly title for the module. - */ - @Child(name = "title", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A user-friendly title for the module", formalDefinition="A short, descriptive, user-friendly title for the module." ) - protected StringType title; - - /** - * Identifies the type of knowledge module, such as a rule, library, documentation template, or measure. - */ - @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="module | library | decision-support-rule | documentation-template | order-set", formalDefinition="Identifies the type of knowledge module, such as a rule, library, documentation template, or measure." ) - protected Enumeration type; - - /** - * The status of the module. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | inactive", formalDefinition="The status of the module." ) - protected Enumeration status; - - /** - * Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=7, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments." ) - protected BooleanType experimental; - - /** - * A free text natural language description of the module from the consumer's perspective. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Natural language description of the module", formalDefinition="A free text natural language description of the module from the consumer's perspective." ) - protected StringType description; - - /** - * A brief description of the purpose of the module. - */ - @Child(name = "purpose", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Describes the purpose of the module", formalDefinition="A brief description of the purpose of the module." ) - protected StringType purpose; - - /** - * A detailed description of how the module is used from a clinical perspective. - */ - @Child(name = "usage", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Describes the clinical usage of the module", formalDefinition="A detailed description of how the module is used from a clinical perspective." ) - protected StringType usage; - - /** - * The date on which the module was published. - */ - @Child(name = "publicationDate", type = {DateType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Publication date for this version of the module", formalDefinition="The date on which the module was published." ) - protected DateType publicationDate; - - /** - * The date on which the module content was last reviewed. - */ - @Child(name = "lastReviewDate", type = {DateType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Last review date for the module", formalDefinition="The date on which the module content was last reviewed." ) - protected DateType lastReviewDate; - - /** - * The period during which the module content is effective. - */ - @Child(name = "effectivePeriod", type = {Period.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The effective date range for the module", formalDefinition="The period during which the module content is effective." ) - protected Period effectivePeriod; - - /** - * Specifies various attributes of the patient population for whom and/or environment of care in which the knowledge module is applicable. - */ - @Child(name = "coverage", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Describes the context of use for this module", formalDefinition="Specifies various attributes of the patient population for whom and/or environment of care in which the knowledge module is applicable." ) - protected List coverage; - - /** - * Clinical topics related to the content of the module. - */ - @Child(name = "topic", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Descriptional topics for the module", formalDefinition="Clinical topics related to the content of the module." ) - protected List topic; - - /** - * A contributor to the content of the module, including authors, editors, reviewers, and endorsers. - */ - @Child(name = "contributor", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A content contributor", formalDefinition="A contributor to the content of the module, including authors, editors, reviewers, and endorsers." ) - protected List contributor; - - /** - * The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts. - */ - @Child(name = "publisher", type = {StringType.class}, order=17, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module. - */ - @Child(name = "copyright", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module." ) - protected StringType copyright; - - /** - * Related resources such as additional documentation, justification, or bibliographic references. - */ - @Child(name = "relatedResource", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Related resources for the module", formalDefinition="Related resources such as additional documentation, justification, or bibliographic references." ) - protected List relatedResource; - - private static final long serialVersionUID = 1528493169L; - - /** - * Constructor - */ - public ModuleMetadata() { - super(); - } - - /** - * Constructor - */ - public ModuleMetadata(Enumeration type, Enumeration status) { - super(); - this.type = type; - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ModuleMetadata setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published. - */ - public ModuleMetadata setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadata addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ModuleMetadata setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact. - */ - public ModuleMetadata setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ModuleMetadata setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation. - */ - public ModuleMetadata setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #title} (A short, descriptive, user-friendly title for the module.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (A short, descriptive, user-friendly title for the module.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public ModuleMetadata setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return A short, descriptive, user-friendly title for the module. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value A short, descriptive, user-friendly title for the module. - */ - public ModuleMetadata setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ModuleMetadataTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ModuleMetadata setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the type of knowledge module, such as a rule, library, documentation template, or measure. - */ - public ModuleMetadataType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the type of knowledge module, such as a rule, library, documentation template, or measure. - */ - public ModuleMetadata setType(ModuleMetadataType value) { - if (this.type == null) - this.type = new Enumeration(new ModuleMetadataTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the module.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ModuleMetadataStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the module.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ModuleMetadata setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the module. - */ - public ModuleMetadataStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the module. - */ - public ModuleMetadata setStatus(ModuleMetadataStatus value) { - if (this.status == null) - this.status = new Enumeration(new ModuleMetadataStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ModuleMetadata setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments. - */ - public ModuleMetadata setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the module from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the module from the consumer's perspective.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ModuleMetadata setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the module from the consumer's perspective. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the module from the consumer's perspective. - */ - public ModuleMetadata setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #purpose} (A brief description of the purpose of the module.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value - */ - public StringType getPurposeElement() { - if (this.purpose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.purpose"); - else if (Configuration.doAutoCreate()) - this.purpose = new StringType(); // bb - return this.purpose; - } - - public boolean hasPurposeElement() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - public boolean hasPurpose() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - /** - * @param value {@link #purpose} (A brief description of the purpose of the module.). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value - */ - public ModuleMetadata setPurposeElement(StringType value) { - this.purpose = value; - return this; - } - - /** - * @return A brief description of the purpose of the module. - */ - public String getPurpose() { - return this.purpose == null ? null : this.purpose.getValue(); - } - - /** - * @param value A brief description of the purpose of the module. - */ - public ModuleMetadata setPurpose(String value) { - if (Utilities.noString(value)) - this.purpose = null; - else { - if (this.purpose == null) - this.purpose = new StringType(); - this.purpose.setValue(value); - } - return this; - } - - /** - * @return {@link #usage} (A detailed description of how the module is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public StringType getUsageElement() { - if (this.usage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.usage"); - else if (Configuration.doAutoCreate()) - this.usage = new StringType(); // bb - return this.usage; - } - - public boolean hasUsageElement() { - return this.usage != null && !this.usage.isEmpty(); - } - - public boolean hasUsage() { - return this.usage != null && !this.usage.isEmpty(); - } - - /** - * @param value {@link #usage} (A detailed description of how the module is used from a clinical perspective.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public ModuleMetadata setUsageElement(StringType value) { - this.usage = value; - return this; - } - - /** - * @return A detailed description of how the module is used from a clinical perspective. - */ - public String getUsage() { - return this.usage == null ? null : this.usage.getValue(); - } - - /** - * @param value A detailed description of how the module is used from a clinical perspective. - */ - public ModuleMetadata setUsage(String value) { - if (Utilities.noString(value)) - this.usage = null; - else { - if (this.usage == null) - this.usage = new StringType(); - this.usage.setValue(value); - } - return this; - } - - /** - * @return {@link #publicationDate} (The date on which the module was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value - */ - public DateType getPublicationDateElement() { - if (this.publicationDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.publicationDate"); - else if (Configuration.doAutoCreate()) - this.publicationDate = new DateType(); // bb - return this.publicationDate; - } - - public boolean hasPublicationDateElement() { - return this.publicationDate != null && !this.publicationDate.isEmpty(); - } - - public boolean hasPublicationDate() { - return this.publicationDate != null && !this.publicationDate.isEmpty(); - } - - /** - * @param value {@link #publicationDate} (The date on which the module was published.). This is the underlying object with id, value and extensions. The accessor "getPublicationDate" gives direct access to the value - */ - public ModuleMetadata setPublicationDateElement(DateType value) { - this.publicationDate = value; - return this; - } - - /** - * @return The date on which the module was published. - */ - public Date getPublicationDate() { - return this.publicationDate == null ? null : this.publicationDate.getValue(); - } - - /** - * @param value The date on which the module was published. - */ - public ModuleMetadata setPublicationDate(Date value) { - if (value == null) - this.publicationDate = null; - else { - if (this.publicationDate == null) - this.publicationDate = new DateType(); - this.publicationDate.setValue(value); - } - return this; - } - - /** - * @return {@link #lastReviewDate} (The date on which the module content was last reviewed.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value - */ - public DateType getLastReviewDateElement() { - if (this.lastReviewDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.lastReviewDate"); - else if (Configuration.doAutoCreate()) - this.lastReviewDate = new DateType(); // bb - return this.lastReviewDate; - } - - public boolean hasLastReviewDateElement() { - return this.lastReviewDate != null && !this.lastReviewDate.isEmpty(); - } - - public boolean hasLastReviewDate() { - return this.lastReviewDate != null && !this.lastReviewDate.isEmpty(); - } - - /** - * @param value {@link #lastReviewDate} (The date on which the module content was last reviewed.). This is the underlying object with id, value and extensions. The accessor "getLastReviewDate" gives direct access to the value - */ - public ModuleMetadata setLastReviewDateElement(DateType value) { - this.lastReviewDate = value; - return this; - } - - /** - * @return The date on which the module content was last reviewed. - */ - public Date getLastReviewDate() { - return this.lastReviewDate == null ? null : this.lastReviewDate.getValue(); - } - - /** - * @param value The date on which the module content was last reviewed. - */ - public ModuleMetadata setLastReviewDate(Date value) { - if (value == null) - this.lastReviewDate = null; - else { - if (this.lastReviewDate == null) - this.lastReviewDate = new DateType(); - this.lastReviewDate.setValue(value); - } - return this; - } - - /** - * @return {@link #effectivePeriod} (The period during which the module content is effective.) - */ - public Period getEffectivePeriod() { - if (this.effectivePeriod == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.effectivePeriod"); - else if (Configuration.doAutoCreate()) - this.effectivePeriod = new Period(); // cc - return this.effectivePeriod; - } - - public boolean hasEffectivePeriod() { - return this.effectivePeriod != null && !this.effectivePeriod.isEmpty(); - } - - /** - * @param value {@link #effectivePeriod} (The period during which the module content is effective.) - */ - public ModuleMetadata setEffectivePeriod(Period value) { - this.effectivePeriod = value; - return this; - } - - /** - * @return {@link #coverage} (Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.) - */ - public List getCoverage() { - if (this.coverage == null) - this.coverage = new ArrayList(); - return this.coverage; - } - - public boolean hasCoverage() { - if (this.coverage == null) - return false; - for (ModuleMetadataCoverageComponent item : this.coverage) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #coverage} (Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.) - */ - // syntactic sugar - public ModuleMetadataCoverageComponent addCoverage() { //3 - ModuleMetadataCoverageComponent t = new ModuleMetadataCoverageComponent(); - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadata addCoverage(ModuleMetadataCoverageComponent t) { //3 - if (t == null) - return this; - if (this.coverage == null) - this.coverage = new ArrayList(); - this.coverage.add(t); - return this; - } - - /** - * @return {@link #topic} (Clinical topics related to the content of the module.) - */ - public List getTopic() { - if (this.topic == null) - this.topic = new ArrayList(); - return this.topic; - } - - public boolean hasTopic() { - if (this.topic == null) - return false; - for (CodeableConcept item : this.topic) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #topic} (Clinical topics related to the content of the module.) - */ - // syntactic sugar - public CodeableConcept addTopic() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.topic == null) - this.topic = new ArrayList(); - this.topic.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadata addTopic(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.topic == null) - this.topic = new ArrayList(); - this.topic.add(t); - return this; - } - - /** - * @return {@link #contributor} (A contributor to the content of the module, including authors, editors, reviewers, and endorsers.) - */ - public List getContributor() { - if (this.contributor == null) - this.contributor = new ArrayList(); - return this.contributor; - } - - public boolean hasContributor() { - if (this.contributor == null) - return false; - for (ModuleMetadataContributorComponent item : this.contributor) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contributor} (A contributor to the content of the module, including authors, editors, reviewers, and endorsers.) - */ - // syntactic sugar - public ModuleMetadataContributorComponent addContributor() { //3 - ModuleMetadataContributorComponent t = new ModuleMetadataContributorComponent(); - if (this.contributor == null) - this.contributor = new ArrayList(); - this.contributor.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadata addContributor(ModuleMetadataContributorComponent t) { //3 - if (t == null) - return this; - if (this.contributor == null) - this.contributor = new ArrayList(); - this.contributor.add(t); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ModuleMetadata setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts. - */ - public ModuleMetadata setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ModuleMetadataContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ModuleMetadataContactComponent addContact() { //3 - ModuleMetadataContactComponent t = new ModuleMetadataContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadata addContact(ModuleMetadataContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ModuleMetadata.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ModuleMetadata setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module. - */ - public ModuleMetadata setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #relatedResource} (Related resources such as additional documentation, justification, or bibliographic references.) - */ - public List getRelatedResource() { - if (this.relatedResource == null) - this.relatedResource = new ArrayList(); - return this.relatedResource; - } - - public boolean hasRelatedResource() { - if (this.relatedResource == null) - return false; - for (ModuleMetadataRelatedResourceComponent item : this.relatedResource) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatedResource} (Related resources such as additional documentation, justification, or bibliographic references.) - */ - // syntactic sugar - public ModuleMetadataRelatedResourceComponent addRelatedResource() { //3 - ModuleMetadataRelatedResourceComponent t = new ModuleMetadataRelatedResourceComponent(); - if (this.relatedResource == null) - this.relatedResource = new ArrayList(); - this.relatedResource.add(t); - return t; - } - - // syntactic sugar - public ModuleMetadata addRelatedResource(ModuleMetadataRelatedResourceComponent t) { //3 - if (t == null) - return this; - if (this.relatedResource == null) - this.relatedResource = new ArrayList(); - this.relatedResource.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this module when it is referenced. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this module definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "A logical identifier for the module such as the CMS or NQF identifiers for a measure artifact.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version of the module, if any. To provide a version consistent with the Decision Support Service specification, use the format Major.Minor.Revision (e.g. 1.0.0). For more information on versioning knowledge modules, refer to the Decision Support Service specification. Note that the version is required for non-experimental published artifact.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A machine-friendly name for the module. This name should be usable as an identifier for the module by machine processing applications such as code generation.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("title", "string", "A short, descriptive, user-friendly title for the module.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("type", "code", "Identifies the type of knowledge module, such as a rule, library, documentation template, or measure.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("status", "code", "The status of the module.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "Determines whether the module was developed for testing purposes (or education/evaluation/marketing), and is not intended to be used in production environments.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("description", "string", "A free text natural language description of the module from the consumer's perspective.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("purpose", "string", "A brief description of the purpose of the module.", 0, java.lang.Integer.MAX_VALUE, purpose)); - childrenList.add(new Property("usage", "string", "A detailed description of how the module is used from a clinical perspective.", 0, java.lang.Integer.MAX_VALUE, usage)); - childrenList.add(new Property("publicationDate", "date", "The date on which the module was published.", 0, java.lang.Integer.MAX_VALUE, publicationDate)); - childrenList.add(new Property("lastReviewDate", "date", "The date on which the module content was last reviewed.", 0, java.lang.Integer.MAX_VALUE, lastReviewDate)); - childrenList.add(new Property("effectivePeriod", "Period", "The period during which the module content is effective.", 0, java.lang.Integer.MAX_VALUE, effectivePeriod)); - childrenList.add(new Property("coverage", "", "Specifies various attributes of the patient population for whom and/or environment of care in which, the knowledge module is applicable.", 0, java.lang.Integer.MAX_VALUE, coverage)); - childrenList.add(new Property("topic", "CodeableConcept", "Clinical topics related to the content of the module.", 0, java.lang.Integer.MAX_VALUE, topic)); - childrenList.add(new Property("contributor", "", "A contributor to the content of the module, including authors, editors, reviewers, and endorsers.", 0, java.lang.Integer.MAX_VALUE, contributor)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the module (also known as the steward for the module). This information is required for non-experimental published artifacts.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the module and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the module.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("relatedResource", "", "Related resources such as additional documentation, justification, or bibliographic references.", 0, java.lang.Integer.MAX_VALUE, relatedResource)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // StringType - case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType - case 1470566394: /*publicationDate*/ return this.publicationDate == null ? new Base[0] : new Base[] {this.publicationDate}; // DateType - case -1687512484: /*lastReviewDate*/ return this.lastReviewDate == null ? new Base[0] : new Base[] {this.lastReviewDate}; // DateType - case -403934648: /*effectivePeriod*/ return this.effectivePeriod == null ? new Base[0] : new Base[] {this.effectivePeriod}; // Period - case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : this.coverage.toArray(new Base[this.coverage.size()]); // ModuleMetadataCoverageComponent - case 110546223: /*topic*/ return this.topic == null ? new Base[0] : this.topic.toArray(new Base[this.topic.size()]); // CodeableConcept - case -1895276325: /*contributor*/ return this.contributor == null ? new Base[0] : this.contributor.toArray(new Base[this.contributor.size()]); // ModuleMetadataContributorComponent - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ModuleMetadataContactComponent - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case 1554540889: /*relatedResource*/ return this.relatedResource == null ? new Base[0] : this.relatedResource.toArray(new Base[this.relatedResource.size()]); // ModuleMetadataRelatedResourceComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 3575610: // type - this.type = new ModuleMetadataTypeEnumFactory().fromType(value); // Enumeration - break; - case -892481550: // status - this.status = new ModuleMetadataStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -220463842: // purpose - this.purpose = castToString(value); // StringType - break; - case 111574433: // usage - this.usage = castToString(value); // StringType - break; - case 1470566394: // publicationDate - this.publicationDate = castToDate(value); // DateType - break; - case -1687512484: // lastReviewDate - this.lastReviewDate = castToDate(value); // DateType - break; - case -403934648: // effectivePeriod - this.effectivePeriod = castToPeriod(value); // Period - break; - case -351767064: // coverage - this.getCoverage().add((ModuleMetadataCoverageComponent) value); // ModuleMetadataCoverageComponent - break; - case 110546223: // topic - this.getTopic().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1895276325: // contributor - this.getContributor().add((ModuleMetadataContributorComponent) value); // ModuleMetadataContributorComponent - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ModuleMetadataContactComponent) value); // ModuleMetadataContactComponent - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case 1554540889: // relatedResource - this.getRelatedResource().add((ModuleMetadataRelatedResourceComponent) value); // ModuleMetadataRelatedResourceComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("type")) - this.type = new ModuleMetadataTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("status")) - this.status = new ModuleMetadataStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("purpose")) - this.purpose = castToString(value); // StringType - else if (name.equals("usage")) - this.usage = castToString(value); // StringType - else if (name.equals("publicationDate")) - this.publicationDate = castToDate(value); // DateType - else if (name.equals("lastReviewDate")) - this.lastReviewDate = castToDate(value); // DateType - else if (name.equals("effectivePeriod")) - this.effectivePeriod = castToPeriod(value); // Period - else if (name.equals("coverage")) - this.getCoverage().add((ModuleMetadataCoverageComponent) value); - else if (name.equals("topic")) - this.getTopic().add(castToCodeableConcept(value)); - else if (name.equals("contributor")) - this.getContributor().add((ModuleMetadataContributorComponent) value); - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ModuleMetadataContactComponent) value); - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("relatedResource")) - this.getRelatedResource().add((ModuleMetadataRelatedResourceComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return addIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -220463842: throw new FHIRException("Cannot make property purpose as it is not a complex type"); // StringType - case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // StringType - case 1470566394: throw new FHIRException("Cannot make property publicationDate as it is not a complex type"); // DateType - case -1687512484: throw new FHIRException("Cannot make property lastReviewDate as it is not a complex type"); // DateType - case -403934648: return getEffectivePeriod(); // Period - case -351767064: return addCoverage(); // ModuleMetadataCoverageComponent - case 110546223: return addTopic(); // CodeableConcept - case -1895276325: return addContributor(); // ModuleMetadataContributorComponent - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // ModuleMetadataContactComponent - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case 1554540889: return addRelatedResource(); // ModuleMetadataRelatedResourceComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.url"); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.name"); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.title"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.type"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.experimental"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.description"); - } - else if (name.equals("purpose")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.purpose"); - } - else if (name.equals("usage")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.usage"); - } - else if (name.equals("publicationDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.publicationDate"); - } - else if (name.equals("lastReviewDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.lastReviewDate"); - } - else if (name.equals("effectivePeriod")) { - this.effectivePeriod = new Period(); - return this.effectivePeriod; - } - else if (name.equals("coverage")) { - return addCoverage(); - } - else if (name.equals("topic")) { - return addTopic(); - } - else if (name.equals("contributor")) { - return addContributor(); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type ModuleMetadata.copyright"); - } - else if (name.equals("relatedResource")) { - return addRelatedResource(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ModuleMetadata"; - - } - - public ModuleMetadata copy() { - ModuleMetadata dst = new ModuleMetadata(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.title = title == null ? null : title.copy(); - dst.type = type == null ? null : type.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.description = description == null ? null : description.copy(); - dst.purpose = purpose == null ? null : purpose.copy(); - dst.usage = usage == null ? null : usage.copy(); - dst.publicationDate = publicationDate == null ? null : publicationDate.copy(); - dst.lastReviewDate = lastReviewDate == null ? null : lastReviewDate.copy(); - dst.effectivePeriod = effectivePeriod == null ? null : effectivePeriod.copy(); - if (coverage != null) { - dst.coverage = new ArrayList(); - for (ModuleMetadataCoverageComponent i : coverage) - dst.coverage.add(i.copy()); - }; - if (topic != null) { - dst.topic = new ArrayList(); - for (CodeableConcept i : topic) - dst.topic.add(i.copy()); - }; - if (contributor != null) { - dst.contributor = new ArrayList(); - for (ModuleMetadataContributorComponent i : contributor) - dst.contributor.add(i.copy()); - }; - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ModuleMetadataContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.copyright = copyright == null ? null : copyright.copy(); - if (relatedResource != null) { - dst.relatedResource = new ArrayList(); - for (ModuleMetadataRelatedResourceComponent i : relatedResource) - dst.relatedResource.add(i.copy()); - }; - return dst; - } - - protected ModuleMetadata typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ModuleMetadata)) - return false; - ModuleMetadata o = (ModuleMetadata) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(title, o.title, true) && compareDeep(type, o.type, true) - && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) && compareDeep(description, o.description, true) - && compareDeep(purpose, o.purpose, true) && compareDeep(usage, o.usage, true) && compareDeep(publicationDate, o.publicationDate, true) - && compareDeep(lastReviewDate, o.lastReviewDate, true) && compareDeep(effectivePeriod, o.effectivePeriod, true) - && compareDeep(coverage, o.coverage, true) && compareDeep(topic, o.topic, true) && compareDeep(contributor, o.contributor, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(relatedResource, o.relatedResource, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ModuleMetadata)) - return false; - ModuleMetadata o = (ModuleMetadata) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(title, o.title, true) && compareValues(type, o.type, true) && compareValues(status, o.status, true) - && compareValues(experimental, o.experimental, true) && compareValues(description, o.description, true) - && compareValues(purpose, o.purpose, true) && compareValues(usage, o.usage, true) && compareValues(publicationDate, o.publicationDate, true) - && compareValues(lastReviewDate, o.lastReviewDate, true) && compareValues(publisher, o.publisher, true) - && compareValues(copyright, o.copyright, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (title == null || title.isEmpty()) - && (type == null || type.isEmpty()) && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (description == null || description.isEmpty()) && (purpose == null || purpose.isEmpty()) - && (usage == null || usage.isEmpty()) && (publicationDate == null || publicationDate.isEmpty()) - && (lastReviewDate == null || lastReviewDate.isEmpty()) && (effectivePeriod == null || effectivePeriod.isEmpty()) - && (coverage == null || coverage.isEmpty()) && (topic == null || topic.isEmpty()) && (contributor == null || contributor.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (copyright == null || copyright.isEmpty()) - && (relatedResource == null || relatedResource.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Money.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Money.java deleted file mode 100644 index fb29324e494..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Money.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Money", profileOf=Quantity.class) -public class Money extends Quantity { - - private static final long serialVersionUID = 1069574054L; - - public Money copy() { - Money dst = new Money(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Money typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Money)) - return false; - Money o = (Money) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Money)) - return false; - Money o = (Money) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/NamingSystem.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/NamingSystem.java deleted file mode 100644 index c5e287ffbc5..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/NamingSystem.java +++ /dev/null @@ -1,2065 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ -@ResourceDef(name="NamingSystem", profile="http://hl7.org/fhir/Profile/NamingSystem") -public class NamingSystem extends DomainResource { - - public enum NamingSystemType { - /** - * The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC code, local lab codes, etc. - */ - CODESYSTEM, - /** - * The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.). - */ - IDENTIFIER, - /** - * The naming system is used as the root for other identifiers and naming systems. - */ - ROOT, - /** - * added to help the parsers - */ - NULL; - public static NamingSystemType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("codesystem".equals(codeString)) - return CODESYSTEM; - if ("identifier".equals(codeString)) - return IDENTIFIER; - if ("root".equals(codeString)) - return ROOT; - throw new FHIRException("Unknown NamingSystemType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CODESYSTEM: return "codesystem"; - case IDENTIFIER: return "identifier"; - case ROOT: return "root"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CODESYSTEM: return "http://hl7.org/fhir/namingsystem-type"; - case IDENTIFIER: return "http://hl7.org/fhir/namingsystem-type"; - case ROOT: return "http://hl7.org/fhir/namingsystem-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CODESYSTEM: return "The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC code, local lab codes, etc."; - case IDENTIFIER: return "The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.)."; - case ROOT: return "The naming system is used as the root for other identifiers and naming systems."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CODESYSTEM: return "Code System"; - case IDENTIFIER: return "Identifier"; - case ROOT: return "Root"; - default: return "?"; - } - } - } - - public static class NamingSystemTypeEnumFactory implements EnumFactory { - public NamingSystemType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("codesystem".equals(codeString)) - return NamingSystemType.CODESYSTEM; - if ("identifier".equals(codeString)) - return NamingSystemType.IDENTIFIER; - if ("root".equals(codeString)) - return NamingSystemType.ROOT; - throw new IllegalArgumentException("Unknown NamingSystemType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("codesystem".equals(codeString)) - return new Enumeration(this, NamingSystemType.CODESYSTEM); - if ("identifier".equals(codeString)) - return new Enumeration(this, NamingSystemType.IDENTIFIER); - if ("root".equals(codeString)) - return new Enumeration(this, NamingSystemType.ROOT); - throw new FHIRException("Unknown NamingSystemType code '"+codeString+"'"); - } - public String toCode(NamingSystemType code) { - if (code == NamingSystemType.CODESYSTEM) - return "codesystem"; - if (code == NamingSystemType.IDENTIFIER) - return "identifier"; - if (code == NamingSystemType.ROOT) - return "root"; - return "?"; - } - public String toSystem(NamingSystemType code) { - return code.getSystem(); - } - } - - public enum NamingSystemIdentifierType { - /** - * An ISO object identifier; e.g. 1.2.3.4.5. - */ - OID, - /** - * A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. - */ - UUID, - /** - * A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org. - */ - URI, - /** - * Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC. - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static NamingSystemIdentifierType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("oid".equals(codeString)) - return OID; - if ("uuid".equals(codeString)) - return UUID; - if ("uri".equals(codeString)) - return URI; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown NamingSystemIdentifierType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OID: return "oid"; - case UUID: return "uuid"; - case URI: return "uri"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OID: return "http://hl7.org/fhir/namingsystem-identifier-type"; - case UUID: return "http://hl7.org/fhir/namingsystem-identifier-type"; - case URI: return "http://hl7.org/fhir/namingsystem-identifier-type"; - case OTHER: return "http://hl7.org/fhir/namingsystem-identifier-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OID: return "An ISO object identifier; e.g. 1.2.3.4.5."; - case UUID: return "A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11."; - case URI: return "A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org."; - case OTHER: return "Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OID: return "OID"; - case UUID: return "UUID"; - case URI: return "URI"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class NamingSystemIdentifierTypeEnumFactory implements EnumFactory { - public NamingSystemIdentifierType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("oid".equals(codeString)) - return NamingSystemIdentifierType.OID; - if ("uuid".equals(codeString)) - return NamingSystemIdentifierType.UUID; - if ("uri".equals(codeString)) - return NamingSystemIdentifierType.URI; - if ("other".equals(codeString)) - return NamingSystemIdentifierType.OTHER; - throw new IllegalArgumentException("Unknown NamingSystemIdentifierType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("oid".equals(codeString)) - return new Enumeration(this, NamingSystemIdentifierType.OID); - if ("uuid".equals(codeString)) - return new Enumeration(this, NamingSystemIdentifierType.UUID); - if ("uri".equals(codeString)) - return new Enumeration(this, NamingSystemIdentifierType.URI); - if ("other".equals(codeString)) - return new Enumeration(this, NamingSystemIdentifierType.OTHER); - throw new FHIRException("Unknown NamingSystemIdentifierType code '"+codeString+"'"); - } - public String toCode(NamingSystemIdentifierType code) { - if (code == NamingSystemIdentifierType.OID) - return "oid"; - if (code == NamingSystemIdentifierType.UUID) - return "uuid"; - if (code == NamingSystemIdentifierType.URI) - return "uri"; - if (code == NamingSystemIdentifierType.OTHER) - return "other"; - return "?"; - } - public String toSystem(NamingSystemIdentifierType code) { - return code.getSystem(); - } - } - - @Block() - public static class NamingSystemContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the naming system. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the naming system." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public NamingSystemContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the naming system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public NamingSystemContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the naming system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the naming system. - */ - public NamingSystemContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public NamingSystemContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the naming system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public NamingSystemContactComponent copy() { - NamingSystemContactComponent dst = new NamingSystemContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NamingSystemContactComponent)) - return false; - NamingSystemContactComponent o = (NamingSystemContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NamingSystemContactComponent)) - return false; - NamingSystemContactComponent o = (NamingSystemContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "NamingSystem.contact"; - - } - - } - - @Block() - public static class NamingSystemUniqueIdComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the unique identifier scheme used for this particular identifier. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="oid | uuid | uri | other", formalDefinition="Identifies the unique identifier scheme used for this particular identifier." ) - protected Enumeration type; - - /** - * The string that should be sent over the wire to identify the code system or identifier system. - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The unique identifier", formalDefinition="The string that should be sent over the wire to identify the code system or identifier system." ) - protected StringType value; - - /** - * Indicates whether this identifier is the "preferred" identifier of this type. - */ - @Child(name = "preferred", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Is this the id that should be used for this type", formalDefinition="Indicates whether this identifier is the \"preferred\" identifier of this type." ) - protected BooleanType preferred; - - /** - * Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic. - */ - @Child(name = "period", type = {Period.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When is identifier valid?", formalDefinition="Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic." ) - protected Period period; - - private static final long serialVersionUID = -193711840L; - - /** - * Constructor - */ - public NamingSystemUniqueIdComponent() { - super(); - } - - /** - * Constructor - */ - public NamingSystemUniqueIdComponent(Enumeration type, StringType value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new NamingSystemIdentifierTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifies the unique identifier scheme used for this particular identifier.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the unique identifier scheme used for this particular identifier. - */ - public NamingSystemIdentifierType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the unique identifier scheme used for this particular identifier. - */ - public NamingSystemUniqueIdComponent setType(NamingSystemIdentifierType value) { - if (this.type == null) - this.type = new Enumeration(new NamingSystemIdentifierTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The string that should be sent over the wire to identify the code system or identifier system.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The string that should be sent over the wire to identify the code system or identifier system. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The string that should be sent over the wire to identify the code system or identifier system. - */ - public NamingSystemUniqueIdComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - /** - * @return {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public BooleanType getPreferredElement() { - if (this.preferred == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.preferred"); - else if (Configuration.doAutoCreate()) - this.preferred = new BooleanType(); // bb - return this.preferred; - } - - public boolean hasPreferredElement() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - public boolean hasPreferred() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - /** - * @param value {@link #preferred} (Indicates whether this identifier is the "preferred" identifier of this type.). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public NamingSystemUniqueIdComponent setPreferredElement(BooleanType value) { - this.preferred = value; - return this; - } - - /** - * @return Indicates whether this identifier is the "preferred" identifier of this type. - */ - public boolean getPreferred() { - return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); - } - - /** - * @param value Indicates whether this identifier is the "preferred" identifier of this type. - */ - public NamingSystemUniqueIdComponent setPreferred(boolean value) { - if (this.preferred == null) - this.preferred = new BooleanType(); - this.preferred.setValue(value); - return this; - } - - /** - * @return {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystemUniqueIdComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic.) - */ - public NamingSystemUniqueIdComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Identifies the unique identifier scheme used for this particular identifier.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value", "string", "The string that should be sent over the wire to identify the code system or identifier system.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("preferred", "boolean", "Indicates whether this identifier is the \"preferred\" identifier of this type.", 0, java.lang.Integer.MAX_VALUE, preferred)); - childrenList.add(new Property("period", "Period", "Identifies the period of time over which this identifier is considered appropriate to refer to the naming system. Outside of this window, the identifier might be non-deterministic.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new NamingSystemIdentifierTypeEnumFactory().fromType(value); // Enumeration - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - case -1294005119: // preferred - this.preferred = castToBoolean(value); // BooleanType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new NamingSystemIdentifierTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("value")) - this.value = castToString(value); // StringType - else if (name.equals("preferred")) - this.preferred = castToBoolean(value); // BooleanType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - case -1294005119: throw new FHIRException("Cannot make property preferred as it is not a complex type"); // BooleanType - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.type"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.value"); - } - else if (name.equals("preferred")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.preferred"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public NamingSystemUniqueIdComponent copy() { - NamingSystemUniqueIdComponent dst = new NamingSystemUniqueIdComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - dst.preferred = preferred == null ? null : preferred.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NamingSystemUniqueIdComponent)) - return false; - NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true) && compareDeep(preferred, o.preferred, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NamingSystemUniqueIdComponent)) - return false; - NamingSystemUniqueIdComponent o = (NamingSystemUniqueIdComponent) other; - return compareValues(type, o.type, true) && compareValues(value, o.value, true) && compareValues(preferred, o.preferred, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - && (preferred == null || preferred.isEmpty()) && (period == null || period.isEmpty()); - } - - public String fhirType() { - return "NamingSystem.uniqueId"; - - } - - } - - /** - * The descriptive name of this particular identifier type or code system. - */ - @Child(name = "name", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Human-readable label", formalDefinition="The descriptive name of this particular identifier type or code system." ) - protected StringType name; - - /** - * Indicates whether the naming system is "ready for use" or not. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="draft | active | retired", formalDefinition="Indicates whether the naming system is \"ready for use\" or not." ) - protected Enumeration status; - - /** - * Indicates the purpose for the naming system - what kinds of things does it make unique? - */ - @Child(name = "kind", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="codesystem | identifier | root", formalDefinition="Indicates the purpose for the naming system - what kinds of things does it make unique?" ) - protected Enumeration kind; - - /** - * The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes." ) - protected DateTimeType date; - - /** - * The name of the individual or organization that published the naming system. - */ - @Child(name = "publisher", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the naming system." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - @Child(name = "responsible", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Who maintains system namespace?", formalDefinition="The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision." ) - protected StringType responsible; - - /** - * Categorizes a naming system for easier search by grouping related naming systems. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="e.g. driver, provider, patient, bank etc.", formalDefinition="Categorizes a naming system for easier search by grouping related naming systems." ) - protected CodeableConcept type; - - /** - * Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="What does naming system identify?", formalDefinition="Details about what the namespace identifies including scope, granularity, version labeling, etc." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems." ) - protected List useContext; - - /** - * Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - @Child(name = "usage", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How/where is it used", formalDefinition="Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc." ) - protected StringType usage; - - /** - * Indicates how the system may be identified when referenced in electronic exchange. - */ - @Child(name = "uniqueId", type = {}, order=11, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Unique identifiers used for system", formalDefinition="Indicates how the system may be identified when referenced in electronic exchange." ) - protected List uniqueId; - - /** - * For naming systems that are retired, indicates the naming system that should be used in their place (if any). - */ - @Child(name = "replacedBy", type = {NamingSystem.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use this instead", formalDefinition="For naming systems that are retired, indicates the naming system that should be used in their place (if any)." ) - protected Reference replacedBy; - - /** - * The actual object that is the target of the reference (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) - */ - protected NamingSystem replacedByTarget; - - private static final long serialVersionUID = -1633030631L; - - /** - * Constructor - */ - public NamingSystem() { - super(); - } - - /** - * Constructor - */ - public NamingSystem(StringType name, Enumeration status, Enumeration kind, DateTimeType date) { - super(); - this.name = name; - this.status = status; - this.kind = kind; - this.date = date; - } - - /** - * @return {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The descriptive name of this particular identifier type or code system.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public NamingSystem setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The descriptive name of this particular identifier type or code system. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The descriptive name of this particular identifier type or code system. - */ - public NamingSystem setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (Indicates whether the naming system is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Indicates whether the naming system is "ready for use" or not.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public NamingSystem setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Indicates whether the naming system is "ready for use" or not. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Indicates whether the naming system is "ready for use" or not. - */ - public NamingSystem setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #kind} (Indicates the purpose for the naming system - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new NamingSystemTypeEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Indicates the purpose for the naming system - what kinds of things does it make unique?). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public NamingSystem setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Indicates the purpose for the naming system - what kinds of things does it make unique? - */ - public NamingSystemType getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Indicates the purpose for the naming system - what kinds of things does it make unique? - */ - public NamingSystem setKind(NamingSystemType value) { - if (this.kind == null) - this.kind = new Enumeration(new NamingSystemTypeEnumFactory()); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public NamingSystem setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes. - */ - public NamingSystem setDate(Date value) { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the naming system.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public NamingSystem setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the naming system. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the naming system. - */ - public NamingSystem setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (NamingSystemContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public NamingSystemContactComponent addContact() { //3 - NamingSystemContactComponent t = new NamingSystemContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public NamingSystem addContact(NamingSystemContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public StringType getResponsibleElement() { - if (this.responsible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.responsible"); - else if (Configuration.doAutoCreate()) - this.responsible = new StringType(); // bb - return this.responsible; - } - - public boolean hasResponsibleElement() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - public boolean hasResponsible() { - return this.responsible != null && !this.responsible.isEmpty(); - } - - /** - * @param value {@link #responsible} (The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.). This is the underlying object with id, value and extensions. The accessor "getResponsible" gives direct access to the value - */ - public NamingSystem setResponsibleElement(StringType value) { - this.responsible = value; - return this; - } - - /** - * @return The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - public String getResponsible() { - return this.responsible == null ? null : this.responsible.getValue(); - } - - /** - * @param value The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision. - */ - public NamingSystem setResponsible(String value) { - if (Utilities.noString(value)) - this.responsible = null; - else { - if (this.responsible == null) - this.responsible = new StringType(); - this.responsible.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Categorizes a naming system for easier search by grouping related naming systems.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Categorizes a naming system for easier search by grouping related naming systems.) - */ - public NamingSystem setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Details about what the namespace identifies including scope, granularity, version labeling, etc.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public NamingSystem setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Details about what the namespace identifies including scope, granularity, version labeling, etc. - */ - public NamingSystem setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public NamingSystem addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public StringType getUsageElement() { - if (this.usage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.usage"); - else if (Configuration.doAutoCreate()) - this.usage = new StringType(); // bb - return this.usage; - } - - public boolean hasUsageElement() { - return this.usage != null && !this.usage.isEmpty(); - } - - public boolean hasUsage() { - return this.usage != null && !this.usage.isEmpty(); - } - - /** - * @param value {@link #usage} (Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.). This is the underlying object with id, value and extensions. The accessor "getUsage" gives direct access to the value - */ - public NamingSystem setUsageElement(StringType value) { - this.usage = value; - return this; - } - - /** - * @return Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - public String getUsage() { - return this.usage == null ? null : this.usage.getValue(); - } - - /** - * @param value Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc. - */ - public NamingSystem setUsage(String value) { - if (Utilities.noString(value)) - this.usage = null; - else { - if (this.usage == null) - this.usage = new StringType(); - this.usage.setValue(value); - } - return this; - } - - /** - * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) - */ - public List getUniqueId() { - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - return this.uniqueId; - } - - public boolean hasUniqueId() { - if (this.uniqueId == null) - return false; - for (NamingSystemUniqueIdComponent item : this.uniqueId) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #uniqueId} (Indicates how the system may be identified when referenced in electronic exchange.) - */ - // syntactic sugar - public NamingSystemUniqueIdComponent addUniqueId() { //3 - NamingSystemUniqueIdComponent t = new NamingSystemUniqueIdComponent(); - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - this.uniqueId.add(t); - return t; - } - - // syntactic sugar - public NamingSystem addUniqueId(NamingSystemUniqueIdComponent t) { //3 - if (t == null) - return this; - if (this.uniqueId == null) - this.uniqueId = new ArrayList(); - this.uniqueId.add(t); - return this; - } - - /** - * @return {@link #replacedBy} (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) - */ - public Reference getReplacedBy() { - if (this.replacedBy == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.replacedBy"); - else if (Configuration.doAutoCreate()) - this.replacedBy = new Reference(); // cc - return this.replacedBy; - } - - public boolean hasReplacedBy() { - return this.replacedBy != null && !this.replacedBy.isEmpty(); - } - - /** - * @param value {@link #replacedBy} (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) - */ - public NamingSystem setReplacedBy(Reference value) { - this.replacedBy = value; - return this; - } - - /** - * @return {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) - */ - public NamingSystem getReplacedByTarget() { - if (this.replacedByTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NamingSystem.replacedBy"); - else if (Configuration.doAutoCreate()) - this.replacedByTarget = new NamingSystem(); // aa - return this.replacedByTarget; - } - - /** - * @param value {@link #replacedBy} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For naming systems that are retired, indicates the naming system that should be used in their place (if any).) - */ - public NamingSystem setReplacedByTarget(NamingSystem value) { - this.replacedByTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The descriptive name of this particular identifier type or code system.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "Indicates whether the naming system is \"ready for use\" or not.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("kind", "code", "Indicates the purpose for the naming system - what kinds of things does it make unique?", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the system was registered or published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the registration changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the naming system.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("responsible", "string", "The name of the organization that is responsible for issuing identifiers or codes for this namespace and ensuring their non-collision.", 0, java.lang.Integer.MAX_VALUE, responsible)); - childrenList.add(new Property("type", "CodeableConcept", "Categorizes a naming system for easier search by grouping related naming systems.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "Details about what the namespace identifies including scope, granularity, version labeling, etc.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of naming systems.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("usage", "string", "Provides guidance on the use of the namespace, including the handling of formatting characters, use of upper vs. lower case, etc.", 0, java.lang.Integer.MAX_VALUE, usage)); - childrenList.add(new Property("uniqueId", "", "Indicates how the system may be identified when referenced in electronic exchange.", 0, java.lang.Integer.MAX_VALUE, uniqueId)); - childrenList.add(new Property("replacedBy", "Reference(NamingSystem)", "For naming systems that are retired, indicates the naming system that should be used in their place (if any).", 0, java.lang.Integer.MAX_VALUE, replacedBy)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // NamingSystemContactComponent - case 1847674614: /*responsible*/ return this.responsible == null ? new Base[0] : new Base[] {this.responsible}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case 111574433: /*usage*/ return this.usage == null ? new Base[0] : new Base[] {this.usage}; // StringType - case -294460212: /*uniqueId*/ return this.uniqueId == null ? new Base[0] : this.uniqueId.toArray(new Base[this.uniqueId.size()]); // NamingSystemUniqueIdComponent - case -1233035097: /*replacedBy*/ return this.replacedBy == null ? new Base[0] : new Base[] {this.replacedBy}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case 3292052: // kind - this.kind = new NamingSystemTypeEnumFactory().fromType(value); // Enumeration - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((NamingSystemContactComponent) value); // NamingSystemContactComponent - break; - case 1847674614: // responsible - this.responsible = castToString(value); // StringType - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 111574433: // usage - this.usage = castToString(value); // StringType - break; - case -294460212: // uniqueId - this.getUniqueId().add((NamingSystemUniqueIdComponent) value); // NamingSystemUniqueIdComponent - break; - case -1233035097: // replacedBy - this.replacedBy = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("kind")) - this.kind = new NamingSystemTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((NamingSystemContactComponent) value); - else if (name.equals("responsible")) - this.responsible = castToString(value); // StringType - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("usage")) - this.usage = castToString(value); // StringType - else if (name.equals("uniqueId")) - this.getUniqueId().add((NamingSystemUniqueIdComponent) value); - else if (name.equals("replacedBy")) - this.replacedBy = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // NamingSystemContactComponent - case 1847674614: throw new FHIRException("Cannot make property responsible as it is not a complex type"); // StringType - case 3575610: return getType(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case 111574433: throw new FHIRException("Cannot make property usage as it is not a complex type"); // StringType - case -294460212: return addUniqueId(); // NamingSystemUniqueIdComponent - case -1233035097: return getReplacedBy(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.status"); - } - else if (name.equals("kind")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.kind"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.date"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("responsible")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.responsible"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("usage")) { - throw new FHIRException("Cannot call addChild on a primitive type NamingSystem.usage"); - } - else if (name.equals("uniqueId")) { - return addUniqueId(); - } - else if (name.equals("replacedBy")) { - this.replacedBy = new Reference(); - return this.replacedBy; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "NamingSystem"; - - } - - public NamingSystem copy() { - NamingSystem dst = new NamingSystem(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (NamingSystemContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.responsible = responsible == null ? null : responsible.copy(); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.usage = usage == null ? null : usage.copy(); - if (uniqueId != null) { - dst.uniqueId = new ArrayList(); - for (NamingSystemUniqueIdComponent i : uniqueId) - dst.uniqueId.add(i.copy()); - }; - dst.replacedBy = replacedBy == null ? null : replacedBy.copy(); - return dst; - } - - protected NamingSystem typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NamingSystem)) - return false; - NamingSystem o = (NamingSystem) other; - return compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) - && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) - && compareDeep(responsible, o.responsible, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true) - && compareDeep(useContext, o.useContext, true) && compareDeep(usage, o.usage, true) && compareDeep(uniqueId, o.uniqueId, true) - && compareDeep(replacedBy, o.replacedBy, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NamingSystem)) - return false; - NamingSystem o = (NamingSystem) other; - return compareValues(name, o.name, true) && compareValues(status, o.status, true) && compareValues(kind, o.kind, true) - && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(responsible, o.responsible, true) - && compareValues(description, o.description, true) && compareValues(usage, o.usage, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (kind == null || kind.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (responsible == null || responsible.isEmpty()) - && (type == null || type.isEmpty()) && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (usage == null || usage.isEmpty()) && (uniqueId == null || uniqueId.isEmpty()) && (replacedBy == null || replacedBy.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.NamingSystem; - } - - /** - * Search parameter: responsible - *

- * Description: Who maintains system namespace?
- * Type: string
- * Path: NamingSystem.responsible
- *

- */ - @SearchParamDefinition(name="responsible", path="NamingSystem.responsible", description="Who maintains system namespace?", type="string" ) - public static final String SP_RESPONSIBLE = "responsible"; - /** - * Fluent Client search parameter constant for responsible - *

- * Description: Who maintains system namespace?
- * Type: string
- * Path: NamingSystem.responsible
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam RESPONSIBLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_RESPONSIBLE); - - /** - * Search parameter: status - *

- * Description: draft | active | retired
- * Type: token
- * Path: NamingSystem.status
- *

- */ - @SearchParamDefinition(name="status", path="NamingSystem.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: draft | active | retired
- * Type: token
- * Path: NamingSystem.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: type - *

- * Description: e.g. driver, provider, patient, bank etc.
- * Type: token
- * Path: NamingSystem.type
- *

- */ - @SearchParamDefinition(name="type", path="NamingSystem.type", description="e.g. driver, provider, patient, bank etc.", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: e.g. driver, provider, patient, bank etc.
- * Type: token
- * Path: NamingSystem.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: Publication Date(/time)
- * Type: date
- * Path: NamingSystem.date
- *

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

- * Description: Publication Date(/time)
- * Type: date
- * Path: NamingSystem.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: period - *

- * Description: When is identifier valid?
- * Type: date
- * Path: NamingSystem.uniqueId.period
- *

- */ - @SearchParamDefinition(name="period", path="NamingSystem.uniqueId.period", description="When is identifier valid?", type="date" ) - public static final String SP_PERIOD = "period"; - /** - * Fluent Client search parameter constant for period - *

- * Description: When is identifier valid?
- * Type: date
- * Path: NamingSystem.uniqueId.period
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam PERIOD = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_PERIOD); - - /** - * Search parameter: contact - *

- * Description: Name of an individual to contact
- * Type: string
- * Path: NamingSystem.contact.name
- *

- */ - @SearchParamDefinition(name="contact", path="NamingSystem.contact.name", description="Name of an individual to contact", type="string" ) - public static final String SP_CONTACT = "contact"; - /** - * Fluent Client search parameter constant for contact - *

- * Description: Name of an individual to contact
- * Type: string
- * Path: NamingSystem.contact.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam CONTACT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CONTACT); - - /** - * Search parameter: kind - *

- * Description: codesystem | identifier | root
- * Type: token
- * Path: NamingSystem.kind
- *

- */ - @SearchParamDefinition(name="kind", path="NamingSystem.kind", description="codesystem | identifier | root", type="token" ) - public static final String SP_KIND = "kind"; - /** - * Fluent Client search parameter constant for kind - *

- * Description: codesystem | identifier | root
- * Type: token
- * Path: NamingSystem.kind
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher (Organization or individual)
- * Type: string
- * Path: NamingSystem.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="NamingSystem.publisher", description="Name of the publisher (Organization or individual)", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher (Organization or individual)
- * Type: string
- * Path: NamingSystem.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: id-type - *

- * Description: oid | uuid | uri | other
- * Type: token
- * Path: NamingSystem.uniqueId.type
- *

- */ - @SearchParamDefinition(name="id-type", path="NamingSystem.uniqueId.type", description="oid | uuid | uri | other", type="token" ) - public static final String SP_ID_TYPE = "id-type"; - /** - * Fluent Client search parameter constant for id-type - *

- * Description: oid | uuid | uri | other
- * Type: token
- * Path: NamingSystem.uniqueId.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ID_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ID_TYPE); - - /** - * Search parameter: name - *

- * Description: Human-readable label
- * Type: string
- * Path: NamingSystem.name
- *

- */ - @SearchParamDefinition(name="name", path="NamingSystem.name", description="Human-readable label", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Human-readable label
- * Type: string
- * Path: NamingSystem.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: Content intends to support these contexts
- * Type: token
- * Path: NamingSystem.useContext
- *

- */ - @SearchParamDefinition(name="context", path="NamingSystem.useContext", description="Content intends to support these contexts", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: Content intends to support these contexts
- * Type: token
- * Path: NamingSystem.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: value - *

- * Description: The unique identifier
- * Type: string
- * Path: NamingSystem.uniqueId.value
- *

- */ - @SearchParamDefinition(name="value", path="NamingSystem.uniqueId.value", description="The unique identifier", type="string" ) - public static final String SP_VALUE = "value"; - /** - * Fluent Client search parameter constant for value - *

- * Description: The unique identifier
- * Type: string
- * Path: NamingSystem.uniqueId.value
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VALUE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VALUE); - - /** - * Search parameter: telecom - *

- * Description: Contact details for individual or publisher
- * Type: token
- * Path: NamingSystem.contact.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="NamingSystem.contact.telecom", description="Contact details for individual or publisher", type="token" ) - public static final String SP_TELECOM = "telecom"; - /** - * Fluent Client search parameter constant for telecom - *

- * Description: Contact details for individual or publisher
- * Type: token
- * Path: NamingSystem.contact.telecom
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); - - /** - * Search parameter: replaced-by - *

- * Description: Use this instead
- * Type: reference
- * Path: NamingSystem.replacedBy
- *

- */ - @SearchParamDefinition(name="replaced-by", path="NamingSystem.replacedBy", description="Use this instead", type="reference" ) - public static final String SP_REPLACED_BY = "replaced-by"; - /** - * Fluent Client search parameter constant for replaced-by - *

- * Description: Use this instead
- * Type: reference
- * Path: NamingSystem.replacedBy
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REPLACED_BY = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REPLACED_BY); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "NamingSystem:replaced-by". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REPLACED_BY = new ca.uhn.fhir.model.api.Include("NamingSystem:replaced-by").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Narrative.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Narrative.java deleted file mode 100644 index fffd6906a30..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Narrative.java +++ /dev/null @@ -1,363 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.INarrative; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A human-readable formatted text, including images. - */ -@DatatypeDef(name="Narrative") -public class Narrative extends BaseNarrative implements INarrative { - - public enum NarrativeStatus { - /** - * The contents of the narrative are entirely generated from the structured data in the content. - */ - GENERATED, - /** - * The contents of the narrative are entirely generated from the structured data in the content and some of the content is generated from extensions - */ - EXTENSIONS, - /** - * The contents of the narrative contain additional information not found in the structured data - */ - ADDITIONAL, - /** - * The contents of the narrative are some equivalent of "No human-readable text provided in this case" - */ - EMPTY, - /** - * added to help the parsers - */ - NULL; - public static NarrativeStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("generated".equals(codeString)) - return GENERATED; - if ("extensions".equals(codeString)) - return EXTENSIONS; - if ("additional".equals(codeString)) - return ADDITIONAL; - if ("empty".equals(codeString)) - return EMPTY; - throw new FHIRException("Unknown NarrativeStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case GENERATED: return "generated"; - case EXTENSIONS: return "extensions"; - case ADDITIONAL: return "additional"; - case EMPTY: return "empty"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case GENERATED: return "http://hl7.org/fhir/narrative-status"; - case EXTENSIONS: return "http://hl7.org/fhir/narrative-status"; - case ADDITIONAL: return "http://hl7.org/fhir/narrative-status"; - case EMPTY: return "http://hl7.org/fhir/narrative-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case GENERATED: return "The contents of the narrative are entirely generated from the structured data in the content."; - case EXTENSIONS: return "The contents of the narrative are entirely generated from the structured data in the content and some of the content is generated from extensions"; - case ADDITIONAL: return "The contents of the narrative contain additional information not found in the structured data"; - case EMPTY: return "The contents of the narrative are some equivalent of \"No human-readable text provided in this case\""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case GENERATED: return "Generated"; - case EXTENSIONS: return "Extensions"; - case ADDITIONAL: return "Additional"; - case EMPTY: return "Empty"; - default: return "?"; - } - } - } - - public static class NarrativeStatusEnumFactory implements EnumFactory { - public NarrativeStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("generated".equals(codeString)) - return NarrativeStatus.GENERATED; - if ("extensions".equals(codeString)) - return NarrativeStatus.EXTENSIONS; - if ("additional".equals(codeString)) - return NarrativeStatus.ADDITIONAL; - if ("empty".equals(codeString)) - return NarrativeStatus.EMPTY; - throw new IllegalArgumentException("Unknown NarrativeStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("generated".equals(codeString)) - return new Enumeration(this, NarrativeStatus.GENERATED); - if ("extensions".equals(codeString)) - return new Enumeration(this, NarrativeStatus.EXTENSIONS); - if ("additional".equals(codeString)) - return new Enumeration(this, NarrativeStatus.ADDITIONAL); - if ("empty".equals(codeString)) - return new Enumeration(this, NarrativeStatus.EMPTY); - throw new FHIRException("Unknown NarrativeStatus code '"+codeString+"'"); - } - public String toCode(NarrativeStatus code) { - if (code == NarrativeStatus.GENERATED) - return "generated"; - if (code == NarrativeStatus.EXTENSIONS) - return "extensions"; - if (code == NarrativeStatus.ADDITIONAL) - return "additional"; - if (code == NarrativeStatus.EMPTY) - return "empty"; - return "?"; - } - public String toSystem(NarrativeStatus code) { - return code.getSystem(); - } - } - - /** - * 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. - */ - @Child(name = "status", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="generated | extensions | additional | empty", formalDefinition="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." ) - protected Enumeration status; - - /** - * The actual narrative content, a stripped down version of XHTML. - */ - @Child(name = "div", type = {}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Limited xhtml content", formalDefinition="The actual narrative content, a stripped down version of XHTML." ) - protected XhtmlNode div; - - private static final long serialVersionUID = 1463852859L; - - /** - * Constructor - */ - public Narrative() { - super(); - } - - /** - * Constructor - */ - public Narrative(Enumeration status, XhtmlNode div) { - super(); - this.status = status; - this.div = div; - } - - /** - * @return {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Narrative.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new NarrativeStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (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.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Narrative setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return 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 NarrativeStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value 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 Narrative setStatus(NarrativeStatus value) { - if (this.status == null) - this.status = new Enumeration(new NarrativeStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #div} (The actual narrative content, a stripped down version of XHTML.) - */ - public XhtmlNode getDiv() { - if (this.div == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Narrative.div"); - else if (Configuration.doAutoCreate()) - this.div = new XhtmlNode(); // cc - return this.div; - } - - public boolean hasDiv() { - return this.div != null && !this.div.isEmpty(); - } - - /** - * @param value {@link #div} (The actual narrative content, a stripped down version of XHTML.) - */ - public Narrative setDiv(XhtmlNode value) { - this.div = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("status", "code", "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.", 0, java.lang.Integer.MAX_VALUE, status)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -892481550: // status - this.status = new NarrativeStatusEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("status")) - this.status = new NarrativeStatusEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Narrative.status"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Narrative"; - - } - - public Narrative copy() { - Narrative dst = new Narrative(); - copyValues(dst); - dst.status = status == null ? null : status.copy(); - dst.div = div == null ? null : div.copy(); - return dst; - } - - protected Narrative typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Narrative)) - return false; - Narrative o = (Narrative) other; - return compareDeep(status, o.status, true) && compareDeep(div, o.div, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Narrative)) - return false; - Narrative o = (Narrative) other; - return compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (status == null || status.isEmpty()) && (div == null || div.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/NutritionOrder.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/NutritionOrder.java deleted file mode 100644 index da384519ed1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/NutritionOrder.java +++ /dev/null @@ -1,3390 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ -@ResourceDef(name="NutritionOrder", profile="http://hl7.org/fhir/Profile/NutritionOrder") -public class NutritionOrder extends DomainResource { - - public enum NutritionOrderStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request is in preliminary form prior to being sent. - */ - DRAFT, - /** - * The request has been planned. - */ - PLANNED, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The request is 'actionable', but not all actions that are implied by it have occurred yet. - */ - ACTIVE, - /** - * Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called "suspended". - */ - ONHOLD, - /** - * All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit). - */ - COMPLETED, - /** - * The request has been withdrawn and is no longer actionable. - */ - CANCELLED, - /** - * The request was entered in error and voided. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static NutritionOrderStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("planned".equals(codeString)) - return PLANNED; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("completed".equals(codeString)) - return COMPLETED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case PLANNED: return "planned"; - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case ONHOLD: return "on-hold"; - case COMPLETED: return "completed"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/nutrition-order-status"; - case DRAFT: return "http://hl7.org/fhir/nutrition-order-status"; - case PLANNED: return "http://hl7.org/fhir/nutrition-order-status"; - case REQUESTED: return "http://hl7.org/fhir/nutrition-order-status"; - case ACTIVE: return "http://hl7.org/fhir/nutrition-order-status"; - case ONHOLD: return "http://hl7.org/fhir/nutrition-order-status"; - case COMPLETED: return "http://hl7.org/fhir/nutrition-order-status"; - case CANCELLED: return "http://hl7.org/fhir/nutrition-order-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/nutrition-order-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case DRAFT: return "The request is in preliminary form prior to being sent."; - case PLANNED: return "The request has been planned."; - case REQUESTED: return "The request has been placed."; - case ACTIVE: return "The request is 'actionable', but not all actions that are implied by it have occurred yet."; - case ONHOLD: return "Actions implied by the request have been temporarily halted, but are expected to continue later. May also be called \"suspended\"."; - case COMPLETED: return "All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made explicit)."; - case CANCELLED: return "The request has been withdrawn and is no longer actionable."; - case ENTEREDINERROR: return "The request was entered in error and voided."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Draft"; - case PLANNED: return "Planned"; - case REQUESTED: return "Requested"; - case ACTIVE: return "Active"; - case ONHOLD: return "On-Hold"; - case COMPLETED: return "Completed"; - case CANCELLED: return "Cancelled"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class NutritionOrderStatusEnumFactory implements EnumFactory { - public NutritionOrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return NutritionOrderStatus.PROPOSED; - if ("draft".equals(codeString)) - return NutritionOrderStatus.DRAFT; - if ("planned".equals(codeString)) - return NutritionOrderStatus.PLANNED; - if ("requested".equals(codeString)) - return NutritionOrderStatus.REQUESTED; - if ("active".equals(codeString)) - return NutritionOrderStatus.ACTIVE; - if ("on-hold".equals(codeString)) - return NutritionOrderStatus.ONHOLD; - if ("completed".equals(codeString)) - return NutritionOrderStatus.COMPLETED; - if ("cancelled".equals(codeString)) - return NutritionOrderStatus.CANCELLED; - if ("entered-in-error".equals(codeString)) - return NutritionOrderStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.PROPOSED); - if ("draft".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.DRAFT); - if ("planned".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.PLANNED); - if ("requested".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.REQUESTED); - if ("active".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.ACTIVE); - if ("on-hold".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.ONHOLD); - if ("completed".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.COMPLETED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.CANCELLED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, NutritionOrderStatus.ENTEREDINERROR); - throw new FHIRException("Unknown NutritionOrderStatus code '"+codeString+"'"); - } - public String toCode(NutritionOrderStatus code) { - if (code == NutritionOrderStatus.PROPOSED) - return "proposed"; - if (code == NutritionOrderStatus.DRAFT) - return "draft"; - if (code == NutritionOrderStatus.PLANNED) - return "planned"; - if (code == NutritionOrderStatus.REQUESTED) - return "requested"; - if (code == NutritionOrderStatus.ACTIVE) - return "active"; - if (code == NutritionOrderStatus.ONHOLD) - return "on-hold"; - if (code == NutritionOrderStatus.COMPLETED) - return "completed"; - if (code == NutritionOrderStatus.CANCELLED) - return "cancelled"; - if (code == NutritionOrderStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(NutritionOrderStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class NutritionOrderOralDietComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Type of oral diet or diet restrictions that describe what can be consumed orally", formalDefinition="The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet." ) - protected List type; - - /** - * The time period and frequency at which the diet should be given. - */ - @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Scheduled frequency of diet", formalDefinition="The time period and frequency at which the diet should be given." ) - protected List schedule; - - /** - * Class that defines the quantity and type of nutrient modifications required for the oral diet. - */ - @Child(name = "nutrient", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Required nutrient modifications", formalDefinition="Class that defines the quantity and type of nutrient modifications required for the oral diet." ) - protected List nutrient; - - /** - * Class that describes any texture modifications required for the patient to safely consume various types of solid foods. - */ - @Child(name = "texture", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Required texture modifications", formalDefinition="Class that describes any texture modifications required for the patient to safely consume various types of solid foods." ) - protected List texture; - - /** - * The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient. - */ - @Child(name = "fluidConsistencyType", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The required consistency of fluids and liquids provided to the patient", formalDefinition="The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient." ) - protected List fluidConsistencyType; - - /** - * Free text or additional instructions or information pertaining to the oral diet. - */ - @Child(name = "instruction", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Instructions or additional information about the oral diet", formalDefinition="Free text or additional instructions or information pertaining to the oral diet." ) - protected StringType instruction; - - private static final long serialVersionUID = 973058412L; - - /** - * Constructor - */ - public NutritionOrderOralDietComponent() { - super(); - } - - /** - * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeableConcept item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.) - */ - // syntactic sugar - public CodeableConcept addType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #schedule} (The time period and frequency at which the diet should be given.) - */ - public List getSchedule() { - if (this.schedule == null) - this.schedule = new ArrayList(); - return this.schedule; - } - - public boolean hasSchedule() { - if (this.schedule == null) - return false; - for (Timing item : this.schedule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #schedule} (The time period and frequency at which the diet should be given.) - */ - // syntactic sugar - public Timing addSchedule() { //3 - Timing t = new Timing(); - if (this.schedule == null) - this.schedule = new ArrayList(); - this.schedule.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addSchedule(Timing t) { //3 - if (t == null) - return this; - if (this.schedule == null) - this.schedule = new ArrayList(); - this.schedule.add(t); - return this; - } - - /** - * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) - */ - public List getNutrient() { - if (this.nutrient == null) - this.nutrient = new ArrayList(); - return this.nutrient; - } - - public boolean hasNutrient() { - if (this.nutrient == null) - return false; - for (NutritionOrderOralDietNutrientComponent item : this.nutrient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #nutrient} (Class that defines the quantity and type of nutrient modifications required for the oral diet.) - */ - // syntactic sugar - public NutritionOrderOralDietNutrientComponent addNutrient() { //3 - NutritionOrderOralDietNutrientComponent t = new NutritionOrderOralDietNutrientComponent(); - if (this.nutrient == null) - this.nutrient = new ArrayList(); - this.nutrient.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addNutrient(NutritionOrderOralDietNutrientComponent t) { //3 - if (t == null) - return this; - if (this.nutrient == null) - this.nutrient = new ArrayList(); - this.nutrient.add(t); - return this; - } - - /** - * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) - */ - public List getTexture() { - if (this.texture == null) - this.texture = new ArrayList(); - return this.texture; - } - - public boolean hasTexture() { - if (this.texture == null) - return false; - for (NutritionOrderOralDietTextureComponent item : this.texture) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #texture} (Class that describes any texture modifications required for the patient to safely consume various types of solid foods.) - */ - // syntactic sugar - public NutritionOrderOralDietTextureComponent addTexture() { //3 - NutritionOrderOralDietTextureComponent t = new NutritionOrderOralDietTextureComponent(); - if (this.texture == null) - this.texture = new ArrayList(); - this.texture.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addTexture(NutritionOrderOralDietTextureComponent t) { //3 - if (t == null) - return this; - if (this.texture == null) - this.texture = new ArrayList(); - this.texture.add(t); - return this; - } - - /** - * @return {@link #fluidConsistencyType} (The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) - */ - public List getFluidConsistencyType() { - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - return this.fluidConsistencyType; - } - - public boolean hasFluidConsistencyType() { - if (this.fluidConsistencyType == null) - return false; - for (CodeableConcept item : this.fluidConsistencyType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fluidConsistencyType} (The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.) - */ - // syntactic sugar - public CodeableConcept addFluidConsistencyType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - this.fluidConsistencyType.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderOralDietComponent addFluidConsistencyType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.fluidConsistencyType == null) - this.fluidConsistencyType = new ArrayList(); - this.fluidConsistencyType.add(t); - return this; - } - - /** - * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public StringType getInstructionElement() { - if (this.instruction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietComponent.instruction"); - else if (Configuration.doAutoCreate()) - this.instruction = new StringType(); // bb - return this.instruction; - } - - public boolean hasInstructionElement() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - public boolean hasInstruction() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - /** - * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral diet.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public NutritionOrderOralDietComponent setInstructionElement(StringType value) { - this.instruction = value; - return this; - } - - /** - * @return Free text or additional instructions or information pertaining to the oral diet. - */ - public String getInstruction() { - return this.instruction == null ? null : this.instruction.getValue(); - } - - /** - * @param value Free text or additional instructions or information pertaining to the oral diet. - */ - public NutritionOrderOralDietComponent setInstruction(String value) { - if (Utilities.noString(value)) - this.instruction = null; - else { - if (this.instruction == null) - this.instruction = new StringType(); - this.instruction.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The kind of diet or dietary restriction such as fiber restricted diet or diabetic diet.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the diet should be given.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("nutrient", "", "Class that defines the quantity and type of nutrient modifications required for the oral diet.", 0, java.lang.Integer.MAX_VALUE, nutrient)); - childrenList.add(new Property("texture", "", "Class that describes any texture modifications required for the patient to safely consume various types of solid foods.", 0, java.lang.Integer.MAX_VALUE, texture)); - childrenList.add(new Property("fluidConsistencyType", "CodeableConcept", "The required consistency (e.g. honey-thick, nectar-thick, thin, thickened.) of liquids or fluids served to the patient.", 0, java.lang.Integer.MAX_VALUE, fluidConsistencyType)); - childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral diet.", 0, java.lang.Integer.MAX_VALUE, instruction)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeableConcept - case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : this.schedule.toArray(new Base[this.schedule.size()]); // Timing - case -1671151641: /*nutrient*/ return this.nutrient == null ? new Base[0] : this.nutrient.toArray(new Base[this.nutrient.size()]); // NutritionOrderOralDietNutrientComponent - case -1417816805: /*texture*/ return this.texture == null ? new Base[0] : this.texture.toArray(new Base[this.texture.size()]); // NutritionOrderOralDietTextureComponent - case -525105592: /*fluidConsistencyType*/ return this.fluidConsistencyType == null ? new Base[0] : this.fluidConsistencyType.toArray(new Base[this.fluidConsistencyType.size()]); // CodeableConcept - case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.getType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -697920873: // schedule - this.getSchedule().add(castToTiming(value)); // Timing - break; - case -1671151641: // nutrient - this.getNutrient().add((NutritionOrderOralDietNutrientComponent) value); // NutritionOrderOralDietNutrientComponent - break; - case -1417816805: // texture - this.getTexture().add((NutritionOrderOralDietTextureComponent) value); // NutritionOrderOralDietTextureComponent - break; - case -525105592: // fluidConsistencyType - this.getFluidConsistencyType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 301526158: // instruction - this.instruction = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.getType().add(castToCodeableConcept(value)); - else if (name.equals("schedule")) - this.getSchedule().add(castToTiming(value)); - else if (name.equals("nutrient")) - this.getNutrient().add((NutritionOrderOralDietNutrientComponent) value); - else if (name.equals("texture")) - this.getTexture().add((NutritionOrderOralDietTextureComponent) value); - else if (name.equals("fluidConsistencyType")) - this.getFluidConsistencyType().add(castToCodeableConcept(value)); - else if (name.equals("instruction")) - this.instruction = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return addType(); // CodeableConcept - case -697920873: return addSchedule(); // Timing - case -1671151641: return addNutrient(); // NutritionOrderOralDietNutrientComponent - case -1417816805: return addTexture(); // NutritionOrderOralDietTextureComponent - case -525105592: return addFluidConsistencyType(); // CodeableConcept - case 301526158: throw new FHIRException("Cannot make property instruction as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - return addType(); - } - else if (name.equals("schedule")) { - return addSchedule(); - } - else if (name.equals("nutrient")) { - return addNutrient(); - } - else if (name.equals("texture")) { - return addTexture(); - } - else if (name.equals("fluidConsistencyType")) { - return addFluidConsistencyType(); - } - else if (name.equals("instruction")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.instruction"); - } - else - return super.addChild(name); - } - - public NutritionOrderOralDietComponent copy() { - NutritionOrderOralDietComponent dst = new NutritionOrderOralDietComponent(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (CodeableConcept i : type) - dst.type.add(i.copy()); - }; - if (schedule != null) { - dst.schedule = new ArrayList(); - for (Timing i : schedule) - dst.schedule.add(i.copy()); - }; - if (nutrient != null) { - dst.nutrient = new ArrayList(); - for (NutritionOrderOralDietNutrientComponent i : nutrient) - dst.nutrient.add(i.copy()); - }; - if (texture != null) { - dst.texture = new ArrayList(); - for (NutritionOrderOralDietTextureComponent i : texture) - dst.texture.add(i.copy()); - }; - if (fluidConsistencyType != null) { - dst.fluidConsistencyType = new ArrayList(); - for (CodeableConcept i : fluidConsistencyType) - dst.fluidConsistencyType.add(i.copy()); - }; - dst.instruction = instruction == null ? null : instruction.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderOralDietComponent)) - return false; - NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; - return compareDeep(type, o.type, true) && compareDeep(schedule, o.schedule, true) && compareDeep(nutrient, o.nutrient, true) - && compareDeep(texture, o.texture, true) && compareDeep(fluidConsistencyType, o.fluidConsistencyType, true) - && compareDeep(instruction, o.instruction, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderOralDietComponent)) - return false; - NutritionOrderOralDietComponent o = (NutritionOrderOralDietComponent) other; - return compareValues(instruction, o.instruction, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (schedule == null || schedule.isEmpty()) - && (nutrient == null || nutrient.isEmpty()) && (texture == null || texture.isEmpty()) && (fluidConsistencyType == null || fluidConsistencyType.isEmpty()) - && (instruction == null || instruction.isEmpty()); - } - - public String fhirType() { - return "NutritionOrder.oralDiet"; - - } - - } - - @Block() - public static class NutritionOrderOralDietNutrientComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The nutrient that is being modified such as carbohydrate or sodium. - */ - @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type of nutrient that is being modified", formalDefinition="The nutrient that is being modified such as carbohydrate or sodium." ) - protected CodeableConcept modifier; - - /** - * The quantity of the specified nutrient to include in diet. - */ - @Child(name = "amount", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Quantity of the specified nutrient", formalDefinition="The quantity of the specified nutrient to include in diet." ) - protected SimpleQuantity amount; - - private static final long serialVersionUID = 465107295L; - - /** - * Constructor - */ - public NutritionOrderOralDietNutrientComponent() { - super(); - } - - /** - * @return {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) - */ - public CodeableConcept getModifier() { - if (this.modifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.modifier"); - else if (Configuration.doAutoCreate()) - this.modifier = new CodeableConcept(); // cc - return this.modifier; - } - - public boolean hasModifier() { - return this.modifier != null && !this.modifier.isEmpty(); - } - - /** - * @param value {@link #modifier} (The nutrient that is being modified such as carbohydrate or sodium.) - */ - public NutritionOrderOralDietNutrientComponent setModifier(CodeableConcept value) { - this.modifier = value; - return this; - } - - /** - * @return {@link #amount} (The quantity of the specified nutrient to include in diet.) - */ - public SimpleQuantity getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietNutrientComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new SimpleQuantity(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (The quantity of the specified nutrient to include in diet.) - */ - public NutritionOrderOralDietNutrientComponent setAmount(SimpleQuantity value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("modifier", "CodeableConcept", "The nutrient that is being modified such as carbohydrate or sodium.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("amount", "SimpleQuantity", "The quantity of the specified nutrient to include in diet.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : new Base[] {this.modifier}; // CodeableConcept - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // SimpleQuantity - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -615513385: // modifier - this.modifier = castToCodeableConcept(value); // CodeableConcept - break; - case -1413853096: // amount - this.amount = castToSimpleQuantity(value); // SimpleQuantity - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("modifier")) - this.modifier = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("amount")) - this.amount = castToSimpleQuantity(value); // SimpleQuantity - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -615513385: return getModifier(); // CodeableConcept - case -1413853096: return getAmount(); // SimpleQuantity - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("modifier")) { - this.modifier = new CodeableConcept(); - return this.modifier; - } - else if (name.equals("amount")) { - this.amount = new SimpleQuantity(); - return this.amount; - } - else - return super.addChild(name); - } - - public NutritionOrderOralDietNutrientComponent copy() { - NutritionOrderOralDietNutrientComponent dst = new NutritionOrderOralDietNutrientComponent(); - copyValues(dst); - dst.modifier = modifier == null ? null : modifier.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderOralDietNutrientComponent)) - return false; - NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; - return compareDeep(modifier, o.modifier, true) && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderOralDietNutrientComponent)) - return false; - NutritionOrderOralDietNutrientComponent o = (NutritionOrderOralDietNutrientComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - public String fhirType() { - return "NutritionOrder.oralDiet.nutrient"; - - } - - } - - @Block() - public static class NutritionOrderOralDietTextureComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed. - */ - @Child(name = "modifier", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code to indicate how to alter the texture of the foods, e.g. pureed", formalDefinition="Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed." ) - protected CodeableConcept modifier; - - /** - * The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types. - */ - @Child(name = "foodType", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Concepts that are used to identify an entity that is ingested for nutritional purposes", formalDefinition="The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types." ) - protected CodeableConcept foodType; - - private static final long serialVersionUID = -56402817L; - - /** - * Constructor - */ - public NutritionOrderOralDietTextureComponent() { - super(); - } - - /** - * @return {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) - */ - public CodeableConcept getModifier() { - if (this.modifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.modifier"); - else if (Configuration.doAutoCreate()) - this.modifier = new CodeableConcept(); // cc - return this.modifier; - } - - public boolean hasModifier() { - return this.modifier != null && !this.modifier.isEmpty(); - } - - /** - * @param value {@link #modifier} (Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.) - */ - public NutritionOrderOralDietTextureComponent setModifier(CodeableConcept value) { - this.modifier = value; - return this; - } - - /** - * @return {@link #foodType} (The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types.) - */ - public CodeableConcept getFoodType() { - if (this.foodType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderOralDietTextureComponent.foodType"); - else if (Configuration.doAutoCreate()) - this.foodType = new CodeableConcept(); // cc - return this.foodType; - } - - public boolean hasFoodType() { - return this.foodType != null && !this.foodType.isEmpty(); - } - - /** - * @param value {@link #foodType} (The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types.) - */ - public NutritionOrderOralDietTextureComponent setFoodType(CodeableConcept value) { - this.foodType = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("modifier", "CodeableConcept", "Any texture modifications (for solid foods) that should be made, e.g. easy to chew, chopped, ground, and pureed.", 0, java.lang.Integer.MAX_VALUE, modifier)); - childrenList.add(new Property("foodType", "CodeableConcept", "The food type(s) (e.g. meats, all foods) that the texture modification applies to. This could be all foods types.", 0, java.lang.Integer.MAX_VALUE, foodType)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -615513385: /*modifier*/ return this.modifier == null ? new Base[0] : new Base[] {this.modifier}; // CodeableConcept - case 379498680: /*foodType*/ return this.foodType == null ? new Base[0] : new Base[] {this.foodType}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -615513385: // modifier - this.modifier = castToCodeableConcept(value); // CodeableConcept - break; - case 379498680: // foodType - this.foodType = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("modifier")) - this.modifier = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("foodType")) - this.foodType = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -615513385: return getModifier(); // CodeableConcept - case 379498680: return getFoodType(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("modifier")) { - this.modifier = new CodeableConcept(); - return this.modifier; - } - else if (name.equals("foodType")) { - this.foodType = new CodeableConcept(); - return this.foodType; - } - else - return super.addChild(name); - } - - public NutritionOrderOralDietTextureComponent copy() { - NutritionOrderOralDietTextureComponent dst = new NutritionOrderOralDietTextureComponent(); - copyValues(dst); - dst.modifier = modifier == null ? null : modifier.copy(); - dst.foodType = foodType == null ? null : foodType.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderOralDietTextureComponent)) - return false; - NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; - return compareDeep(modifier, o.modifier, true) && compareDeep(foodType, o.foodType, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderOralDietTextureComponent)) - return false; - NutritionOrderOralDietTextureComponent o = (NutritionOrderOralDietTextureComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (modifier == null || modifier.isEmpty()) && (foodType == null || foodType.isEmpty()) - ; - } - - public String fhirType() { - return "NutritionOrder.oralDiet.texture"; - - } - - } - - @Block() - public static class NutritionOrderSupplementComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of supplement product requested", formalDefinition="The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement." ) - protected CodeableConcept type; - - /** - * The product or brand name of the nutritional supplement such as "Acme Protein Shake". - */ - @Child(name = "productName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Product or brand name of the nutritional supplement", formalDefinition="The product or brand name of the nutritional supplement such as \"Acme Protein Shake\"." ) - protected StringType productName; - - /** - * The time period and frequency at which the supplement(s) should be given. - */ - @Child(name = "schedule", type = {Timing.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Scheduled frequency of supplement", formalDefinition="The time period and frequency at which the supplement(s) should be given." ) - protected List schedule; - - /** - * The amount of the nutritional supplement to be given. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Amount of the nutritional supplement", formalDefinition="The amount of the nutritional supplement to be given." ) - protected SimpleQuantity quantity; - - /** - * Free text or additional instructions or information pertaining to the oral supplement. - */ - @Child(name = "instruction", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Instructions or additional information about the oral supplement", formalDefinition="Free text or additional instructions or information pertaining to the oral supplement." ) - protected StringType instruction; - - private static final long serialVersionUID = 297545236L; - - /** - * Constructor - */ - public NutritionOrderSupplementComponent() { - super(); - } - - /** - * @return {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.) - */ - public NutritionOrderSupplementComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value - */ - public StringType getProductNameElement() { - if (this.productName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.productName"); - else if (Configuration.doAutoCreate()) - this.productName = new StringType(); // bb - return this.productName; - } - - public boolean hasProductNameElement() { - return this.productName != null && !this.productName.isEmpty(); - } - - public boolean hasProductName() { - return this.productName != null && !this.productName.isEmpty(); - } - - /** - * @param value {@link #productName} (The product or brand name of the nutritional supplement such as "Acme Protein Shake".). This is the underlying object with id, value and extensions. The accessor "getProductName" gives direct access to the value - */ - public NutritionOrderSupplementComponent setProductNameElement(StringType value) { - this.productName = value; - return this; - } - - /** - * @return The product or brand name of the nutritional supplement such as "Acme Protein Shake". - */ - public String getProductName() { - return this.productName == null ? null : this.productName.getValue(); - } - - /** - * @param value The product or brand name of the nutritional supplement such as "Acme Protein Shake". - */ - public NutritionOrderSupplementComponent setProductName(String value) { - if (Utilities.noString(value)) - this.productName = null; - else { - if (this.productName == null) - this.productName = new StringType(); - this.productName.setValue(value); - } - return this; - } - - /** - * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) - */ - public List getSchedule() { - if (this.schedule == null) - this.schedule = new ArrayList(); - return this.schedule; - } - - public boolean hasSchedule() { - if (this.schedule == null) - return false; - for (Timing item : this.schedule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #schedule} (The time period and frequency at which the supplement(s) should be given.) - */ - // syntactic sugar - public Timing addSchedule() { //3 - Timing t = new Timing(); - if (this.schedule == null) - this.schedule = new ArrayList(); - this.schedule.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderSupplementComponent addSchedule(Timing t) { //3 - if (t == null) - return this; - if (this.schedule == null) - this.schedule = new ArrayList(); - this.schedule.add(t); - return this; - } - - /** - * @return {@link #quantity} (The amount of the nutritional supplement to be given.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the nutritional supplement to be given.) - */ - public NutritionOrderSupplementComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public StringType getInstructionElement() { - if (this.instruction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderSupplementComponent.instruction"); - else if (Configuration.doAutoCreate()) - this.instruction = new StringType(); // bb - return this.instruction; - } - - public boolean hasInstructionElement() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - public boolean hasInstruction() { - return this.instruction != null && !this.instruction.isEmpty(); - } - - /** - * @param value {@link #instruction} (Free text or additional instructions or information pertaining to the oral supplement.). This is the underlying object with id, value and extensions. The accessor "getInstruction" gives direct access to the value - */ - public NutritionOrderSupplementComponent setInstructionElement(StringType value) { - this.instruction = value; - return this; - } - - /** - * @return Free text or additional instructions or information pertaining to the oral supplement. - */ - public String getInstruction() { - return this.instruction == null ? null : this.instruction.getValue(); - } - - /** - * @param value Free text or additional instructions or information pertaining to the oral supplement. - */ - public NutritionOrderSupplementComponent setInstruction(String value) { - if (Utilities.noString(value)) - this.instruction = null; - else { - if (this.instruction == null) - this.instruction = new StringType(); - this.instruction.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The kind of nutritional supplement product required such as a high protein or pediatric clear liquid supplement.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("productName", "string", "The product or brand name of the nutritional supplement such as \"Acme Protein Shake\".", 0, java.lang.Integer.MAX_VALUE, productName)); - childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the supplement(s) should be given.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of the nutritional supplement to be given.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("instruction", "string", "Free text or additional instructions or information pertaining to the oral supplement.", 0, java.lang.Integer.MAX_VALUE, instruction)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1491817446: /*productName*/ return this.productName == null ? new Base[0] : new Base[] {this.productName}; // StringType - case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : this.schedule.toArray(new Base[this.schedule.size()]); // Timing - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case 301526158: /*instruction*/ return this.instruction == null ? new Base[0] : new Base[] {this.instruction}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1491817446: // productName - this.productName = castToString(value); // StringType - break; - case -697920873: // schedule - this.getSchedule().add(castToTiming(value)); // Timing - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 301526158: // instruction - this.instruction = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("productName")) - this.productName = castToString(value); // StringType - else if (name.equals("schedule")) - this.getSchedule().add(castToTiming(value)); - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("instruction")) - this.instruction = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -1491817446: throw new FHIRException("Cannot make property productName as it is not a complex type"); // StringType - case -697920873: return addSchedule(); // Timing - case -1285004149: return getQuantity(); // SimpleQuantity - case 301526158: throw new FHIRException("Cannot make property instruction as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("productName")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.productName"); - } - else if (name.equals("schedule")) { - return addSchedule(); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("instruction")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.instruction"); - } - else - return super.addChild(name); - } - - public NutritionOrderSupplementComponent copy() { - NutritionOrderSupplementComponent dst = new NutritionOrderSupplementComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.productName = productName == null ? null : productName.copy(); - if (schedule != null) { - dst.schedule = new ArrayList(); - for (Timing i : schedule) - dst.schedule.add(i.copy()); - }; - dst.quantity = quantity == null ? null : quantity.copy(); - dst.instruction = instruction == null ? null : instruction.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderSupplementComponent)) - return false; - NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; - return compareDeep(type, o.type, true) && compareDeep(productName, o.productName, true) && compareDeep(schedule, o.schedule, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(instruction, o.instruction, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderSupplementComponent)) - return false; - NutritionOrderSupplementComponent o = (NutritionOrderSupplementComponent) other; - return compareValues(productName, o.productName, true) && compareValues(instruction, o.instruction, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (productName == null || productName.isEmpty()) - && (schedule == null || schedule.isEmpty()) && (quantity == null || quantity.isEmpty()) && (instruction == null || instruction.isEmpty()) - ; - } - - public String fhirType() { - return "NutritionOrder.supplement"; - - } - - } - - @Block() - public static class NutritionOrderEnteralFormulaComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula. - */ - @Child(name = "baseFormulaType", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of enteral or infant formula", formalDefinition="The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula." ) - protected CodeableConcept baseFormulaType; - - /** - * The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". - */ - @Child(name = "baseFormulaProductName", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Product or brand name of the enteral or infant formula", formalDefinition="The product or brand name of the enteral or infant formula product such as \"ACME Adult Standard Formula\"." ) - protected StringType baseFormulaProductName; - - /** - * Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula. - */ - @Child(name = "additiveType", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Type of modular component to add to the feeding", formalDefinition="Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula." ) - protected CodeableConcept additiveType; - - /** - * The product or brand name of the type of modular component to be added to the formula. - */ - @Child(name = "additiveProductName", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Product or brand name of the modular additive", formalDefinition="The product or brand name of the type of modular component to be added to the formula." ) - protected StringType additiveProductName; - - /** - * The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL. - */ - @Child(name = "caloricDensity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Amount of energy per specified volume that is required", formalDefinition="The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL." ) - protected SimpleQuantity caloricDensity; - - /** - * The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube. - */ - @Child(name = "routeofAdministration", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How the formula should enter the patient's gastrointestinal tract", formalDefinition="The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube." ) - protected CodeableConcept routeofAdministration; - - /** - * Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours. - */ - @Child(name = "administration", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Formula feeding instruction as structured data", formalDefinition="Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours." ) - protected List administration; - - /** - * The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours. - */ - @Child(name = "maxVolumeToDeliver", type = {SimpleQuantity.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Upper limit on formula volume per unit of time", formalDefinition="The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours." ) - protected SimpleQuantity maxVolumeToDeliver; - - /** - * Free text formula administration, feeding instructions or additional instructions or information. - */ - @Child(name = "administrationInstruction", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Formula feeding instructions expressed as text", formalDefinition="Free text formula administration, feeding instructions or additional instructions or information." ) - protected StringType administrationInstruction; - - private static final long serialVersionUID = 292116061L; - - /** - * Constructor - */ - public NutritionOrderEnteralFormulaComponent() { - super(); - } - - /** - * @return {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) - */ - public CodeableConcept getBaseFormulaType() { - if (this.baseFormulaType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaType"); - else if (Configuration.doAutoCreate()) - this.baseFormulaType = new CodeableConcept(); // cc - return this.baseFormulaType; - } - - public boolean hasBaseFormulaType() { - return this.baseFormulaType != null && !this.baseFormulaType.isEmpty(); - } - - /** - * @param value {@link #baseFormulaType} (The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.) - */ - public NutritionOrderEnteralFormulaComponent setBaseFormulaType(CodeableConcept value) { - this.baseFormulaType = value; - return this; - } - - /** - * @return {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value - */ - public StringType getBaseFormulaProductNameElement() { - if (this.baseFormulaProductName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.baseFormulaProductName"); - else if (Configuration.doAutoCreate()) - this.baseFormulaProductName = new StringType(); // bb - return this.baseFormulaProductName; - } - - public boolean hasBaseFormulaProductNameElement() { - return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); - } - - public boolean hasBaseFormulaProductName() { - return this.baseFormulaProductName != null && !this.baseFormulaProductName.isEmpty(); - } - - /** - * @param value {@link #baseFormulaProductName} (The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula".). This is the underlying object with id, value and extensions. The accessor "getBaseFormulaProductName" gives direct access to the value - */ - public NutritionOrderEnteralFormulaComponent setBaseFormulaProductNameElement(StringType value) { - this.baseFormulaProductName = value; - return this; - } - - /** - * @return The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". - */ - public String getBaseFormulaProductName() { - return this.baseFormulaProductName == null ? null : this.baseFormulaProductName.getValue(); - } - - /** - * @param value The product or brand name of the enteral or infant formula product such as "ACME Adult Standard Formula". - */ - public NutritionOrderEnteralFormulaComponent setBaseFormulaProductName(String value) { - if (Utilities.noString(value)) - this.baseFormulaProductName = null; - else { - if (this.baseFormulaProductName == null) - this.baseFormulaProductName = new StringType(); - this.baseFormulaProductName.setValue(value); - } - return this; - } - - /** - * @return {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) - */ - public CodeableConcept getAdditiveType() { - if (this.additiveType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveType"); - else if (Configuration.doAutoCreate()) - this.additiveType = new CodeableConcept(); // cc - return this.additiveType; - } - - public boolean hasAdditiveType() { - return this.additiveType != null && !this.additiveType.isEmpty(); - } - - /** - * @param value {@link #additiveType} (Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.) - */ - public NutritionOrderEnteralFormulaComponent setAdditiveType(CodeableConcept value) { - this.additiveType = value; - return this; - } - - /** - * @return {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value - */ - public StringType getAdditiveProductNameElement() { - if (this.additiveProductName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.additiveProductName"); - else if (Configuration.doAutoCreate()) - this.additiveProductName = new StringType(); // bb - return this.additiveProductName; - } - - public boolean hasAdditiveProductNameElement() { - return this.additiveProductName != null && !this.additiveProductName.isEmpty(); - } - - public boolean hasAdditiveProductName() { - return this.additiveProductName != null && !this.additiveProductName.isEmpty(); - } - - /** - * @param value {@link #additiveProductName} (The product or brand name of the type of modular component to be added to the formula.). This is the underlying object with id, value and extensions. The accessor "getAdditiveProductName" gives direct access to the value - */ - public NutritionOrderEnteralFormulaComponent setAdditiveProductNameElement(StringType value) { - this.additiveProductName = value; - return this; - } - - /** - * @return The product or brand name of the type of modular component to be added to the formula. - */ - public String getAdditiveProductName() { - return this.additiveProductName == null ? null : this.additiveProductName.getValue(); - } - - /** - * @param value The product or brand name of the type of modular component to be added to the formula. - */ - public NutritionOrderEnteralFormulaComponent setAdditiveProductName(String value) { - if (Utilities.noString(value)) - this.additiveProductName = null; - else { - if (this.additiveProductName == null) - this.additiveProductName = new StringType(); - this.additiveProductName.setValue(value); - } - return this; - } - - /** - * @return {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) - */ - public SimpleQuantity getCaloricDensity() { - if (this.caloricDensity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.caloricDensity"); - else if (Configuration.doAutoCreate()) - this.caloricDensity = new SimpleQuantity(); // cc - return this.caloricDensity; - } - - public boolean hasCaloricDensity() { - return this.caloricDensity != null && !this.caloricDensity.isEmpty(); - } - - /** - * @param value {@link #caloricDensity} (The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.) - */ - public NutritionOrderEnteralFormulaComponent setCaloricDensity(SimpleQuantity value) { - this.caloricDensity = value; - return this; - } - - /** - * @return {@link #routeofAdministration} (The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube.) - */ - public CodeableConcept getRouteofAdministration() { - if (this.routeofAdministration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.routeofAdministration"); - else if (Configuration.doAutoCreate()) - this.routeofAdministration = new CodeableConcept(); // cc - return this.routeofAdministration; - } - - public boolean hasRouteofAdministration() { - return this.routeofAdministration != null && !this.routeofAdministration.isEmpty(); - } - - /** - * @param value {@link #routeofAdministration} (The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube.) - */ - public NutritionOrderEnteralFormulaComponent setRouteofAdministration(CodeableConcept value) { - this.routeofAdministration = value; - return this; - } - - /** - * @return {@link #administration} (Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.) - */ - public List getAdministration() { - if (this.administration == null) - this.administration = new ArrayList(); - return this.administration; - } - - public boolean hasAdministration() { - if (this.administration == null) - return false; - for (NutritionOrderEnteralFormulaAdministrationComponent item : this.administration) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #administration} (Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.) - */ - // syntactic sugar - public NutritionOrderEnteralFormulaAdministrationComponent addAdministration() { //3 - NutritionOrderEnteralFormulaAdministrationComponent t = new NutritionOrderEnteralFormulaAdministrationComponent(); - if (this.administration == null) - this.administration = new ArrayList(); - this.administration.add(t); - return t; - } - - // syntactic sugar - public NutritionOrderEnteralFormulaComponent addAdministration(NutritionOrderEnteralFormulaAdministrationComponent t) { //3 - if (t == null) - return this; - if (this.administration == null) - this.administration = new ArrayList(); - this.administration.add(t); - return this; - } - - /** - * @return {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.) - */ - public SimpleQuantity getMaxVolumeToDeliver() { - if (this.maxVolumeToDeliver == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.maxVolumeToDeliver"); - else if (Configuration.doAutoCreate()) - this.maxVolumeToDeliver = new SimpleQuantity(); // cc - return this.maxVolumeToDeliver; - } - - public boolean hasMaxVolumeToDeliver() { - return this.maxVolumeToDeliver != null && !this.maxVolumeToDeliver.isEmpty(); - } - - /** - * @param value {@link #maxVolumeToDeliver} (The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.) - */ - public NutritionOrderEnteralFormulaComponent setMaxVolumeToDeliver(SimpleQuantity value) { - this.maxVolumeToDeliver = value; - return this; - } - - /** - * @return {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value - */ - public StringType getAdministrationInstructionElement() { - if (this.administrationInstruction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaComponent.administrationInstruction"); - else if (Configuration.doAutoCreate()) - this.administrationInstruction = new StringType(); // bb - return this.administrationInstruction; - } - - public boolean hasAdministrationInstructionElement() { - return this.administrationInstruction != null && !this.administrationInstruction.isEmpty(); - } - - public boolean hasAdministrationInstruction() { - return this.administrationInstruction != null && !this.administrationInstruction.isEmpty(); - } - - /** - * @param value {@link #administrationInstruction} (Free text formula administration, feeding instructions or additional instructions or information.). This is the underlying object with id, value and extensions. The accessor "getAdministrationInstruction" gives direct access to the value - */ - public NutritionOrderEnteralFormulaComponent setAdministrationInstructionElement(StringType value) { - this.administrationInstruction = value; - return this; - } - - /** - * @return Free text formula administration, feeding instructions or additional instructions or information. - */ - public String getAdministrationInstruction() { - return this.administrationInstruction == null ? null : this.administrationInstruction.getValue(); - } - - /** - * @param value Free text formula administration, feeding instructions or additional instructions or information. - */ - public NutritionOrderEnteralFormulaComponent setAdministrationInstruction(String value) { - if (Utilities.noString(value)) - this.administrationInstruction = null; - else { - if (this.administrationInstruction == null) - this.administrationInstruction = new StringType(); - this.administrationInstruction.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("baseFormulaType", "CodeableConcept", "The type of enteral or infant formula such as an adult standard formula with fiber or a soy-based infant formula.", 0, java.lang.Integer.MAX_VALUE, baseFormulaType)); - childrenList.add(new Property("baseFormulaProductName", "string", "The product or brand name of the enteral or infant formula product such as \"ACME Adult Standard Formula\".", 0, java.lang.Integer.MAX_VALUE, baseFormulaProductName)); - childrenList.add(new Property("additiveType", "CodeableConcept", "Indicates the type of modular component such as protein, carbohydrate, fat or fiber to be provided in addition to or mixed with the base formula.", 0, java.lang.Integer.MAX_VALUE, additiveType)); - childrenList.add(new Property("additiveProductName", "string", "The product or brand name of the type of modular component to be added to the formula.", 0, java.lang.Integer.MAX_VALUE, additiveProductName)); - childrenList.add(new Property("caloricDensity", "SimpleQuantity", "The amount of energy (Calories) that the formula should provide per specified volume, typically per mL or fluid oz. For example, an infant may require a formula that provides 24 Calories per fluid ounce or an adult may require an enteral formula that provides 1.5 Calorie/mL.", 0, java.lang.Integer.MAX_VALUE, caloricDensity)); - childrenList.add(new Property("routeofAdministration", "CodeableConcept", "The route or physiological path of administration into the patient's gastrointestinal tract for purposes of providing the formula feeding, e.g. nasogastric tube.", 0, java.lang.Integer.MAX_VALUE, routeofAdministration)); - childrenList.add(new Property("administration", "", "Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding every 2 hours.", 0, java.lang.Integer.MAX_VALUE, administration)); - childrenList.add(new Property("maxVolumeToDeliver", "SimpleQuantity", "The maximum total quantity of formula that may be administered to a subject over the period of time, e.g. 1440 mL over 24 hours.", 0, java.lang.Integer.MAX_VALUE, maxVolumeToDeliver)); - childrenList.add(new Property("administrationInstruction", "string", "Free text formula administration, feeding instructions or additional instructions or information.", 0, java.lang.Integer.MAX_VALUE, administrationInstruction)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -138930641: /*baseFormulaType*/ return this.baseFormulaType == null ? new Base[0] : new Base[] {this.baseFormulaType}; // CodeableConcept - case -1267705979: /*baseFormulaProductName*/ return this.baseFormulaProductName == null ? new Base[0] : new Base[] {this.baseFormulaProductName}; // StringType - case -470746842: /*additiveType*/ return this.additiveType == null ? new Base[0] : new Base[] {this.additiveType}; // CodeableConcept - case 488079534: /*additiveProductName*/ return this.additiveProductName == null ? new Base[0] : new Base[] {this.additiveProductName}; // StringType - case 186983261: /*caloricDensity*/ return this.caloricDensity == null ? new Base[0] : new Base[] {this.caloricDensity}; // SimpleQuantity - case -1710107042: /*routeofAdministration*/ return this.routeofAdministration == null ? new Base[0] : new Base[] {this.routeofAdministration}; // CodeableConcept - case 1255702622: /*administration*/ return this.administration == null ? new Base[0] : this.administration.toArray(new Base[this.administration.size()]); // NutritionOrderEnteralFormulaAdministrationComponent - case 2017924652: /*maxVolumeToDeliver*/ return this.maxVolumeToDeliver == null ? new Base[0] : new Base[] {this.maxVolumeToDeliver}; // SimpleQuantity - case 427085136: /*administrationInstruction*/ return this.administrationInstruction == null ? new Base[0] : new Base[] {this.administrationInstruction}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -138930641: // baseFormulaType - this.baseFormulaType = castToCodeableConcept(value); // CodeableConcept - break; - case -1267705979: // baseFormulaProductName - this.baseFormulaProductName = castToString(value); // StringType - break; - case -470746842: // additiveType - this.additiveType = castToCodeableConcept(value); // CodeableConcept - break; - case 488079534: // additiveProductName - this.additiveProductName = castToString(value); // StringType - break; - case 186983261: // caloricDensity - this.caloricDensity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1710107042: // routeofAdministration - this.routeofAdministration = castToCodeableConcept(value); // CodeableConcept - break; - case 1255702622: // administration - this.getAdministration().add((NutritionOrderEnteralFormulaAdministrationComponent) value); // NutritionOrderEnteralFormulaAdministrationComponent - break; - case 2017924652: // maxVolumeToDeliver - this.maxVolumeToDeliver = castToSimpleQuantity(value); // SimpleQuantity - break; - case 427085136: // administrationInstruction - this.administrationInstruction = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("baseFormulaType")) - this.baseFormulaType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("baseFormulaProductName")) - this.baseFormulaProductName = castToString(value); // StringType - else if (name.equals("additiveType")) - this.additiveType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("additiveProductName")) - this.additiveProductName = castToString(value); // StringType - else if (name.equals("caloricDensity")) - this.caloricDensity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("routeofAdministration")) - this.routeofAdministration = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("administration")) - this.getAdministration().add((NutritionOrderEnteralFormulaAdministrationComponent) value); - else if (name.equals("maxVolumeToDeliver")) - this.maxVolumeToDeliver = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("administrationInstruction")) - this.administrationInstruction = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -138930641: return getBaseFormulaType(); // CodeableConcept - case -1267705979: throw new FHIRException("Cannot make property baseFormulaProductName as it is not a complex type"); // StringType - case -470746842: return getAdditiveType(); // CodeableConcept - case 488079534: throw new FHIRException("Cannot make property additiveProductName as it is not a complex type"); // StringType - case 186983261: return getCaloricDensity(); // SimpleQuantity - case -1710107042: return getRouteofAdministration(); // CodeableConcept - case 1255702622: return addAdministration(); // NutritionOrderEnteralFormulaAdministrationComponent - case 2017924652: return getMaxVolumeToDeliver(); // SimpleQuantity - case 427085136: throw new FHIRException("Cannot make property administrationInstruction as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("baseFormulaType")) { - this.baseFormulaType = new CodeableConcept(); - return this.baseFormulaType; - } - else if (name.equals("baseFormulaProductName")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.baseFormulaProductName"); - } - else if (name.equals("additiveType")) { - this.additiveType = new CodeableConcept(); - return this.additiveType; - } - else if (name.equals("additiveProductName")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.additiveProductName"); - } - else if (name.equals("caloricDensity")) { - this.caloricDensity = new SimpleQuantity(); - return this.caloricDensity; - } - else if (name.equals("routeofAdministration")) { - this.routeofAdministration = new CodeableConcept(); - return this.routeofAdministration; - } - else if (name.equals("administration")) { - return addAdministration(); - } - else if (name.equals("maxVolumeToDeliver")) { - this.maxVolumeToDeliver = new SimpleQuantity(); - return this.maxVolumeToDeliver; - } - else if (name.equals("administrationInstruction")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.administrationInstruction"); - } - else - return super.addChild(name); - } - - public NutritionOrderEnteralFormulaComponent copy() { - NutritionOrderEnteralFormulaComponent dst = new NutritionOrderEnteralFormulaComponent(); - copyValues(dst); - dst.baseFormulaType = baseFormulaType == null ? null : baseFormulaType.copy(); - dst.baseFormulaProductName = baseFormulaProductName == null ? null : baseFormulaProductName.copy(); - dst.additiveType = additiveType == null ? null : additiveType.copy(); - dst.additiveProductName = additiveProductName == null ? null : additiveProductName.copy(); - dst.caloricDensity = caloricDensity == null ? null : caloricDensity.copy(); - dst.routeofAdministration = routeofAdministration == null ? null : routeofAdministration.copy(); - if (administration != null) { - dst.administration = new ArrayList(); - for (NutritionOrderEnteralFormulaAdministrationComponent i : administration) - dst.administration.add(i.copy()); - }; - dst.maxVolumeToDeliver = maxVolumeToDeliver == null ? null : maxVolumeToDeliver.copy(); - dst.administrationInstruction = administrationInstruction == null ? null : administrationInstruction.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderEnteralFormulaComponent)) - return false; - NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; - return compareDeep(baseFormulaType, o.baseFormulaType, true) && compareDeep(baseFormulaProductName, o.baseFormulaProductName, true) - && compareDeep(additiveType, o.additiveType, true) && compareDeep(additiveProductName, o.additiveProductName, true) - && compareDeep(caloricDensity, o.caloricDensity, true) && compareDeep(routeofAdministration, o.routeofAdministration, true) - && compareDeep(administration, o.administration, true) && compareDeep(maxVolumeToDeliver, o.maxVolumeToDeliver, true) - && compareDeep(administrationInstruction, o.administrationInstruction, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderEnteralFormulaComponent)) - return false; - NutritionOrderEnteralFormulaComponent o = (NutritionOrderEnteralFormulaComponent) other; - return compareValues(baseFormulaProductName, o.baseFormulaProductName, true) && compareValues(additiveProductName, o.additiveProductName, true) - && compareValues(administrationInstruction, o.administrationInstruction, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (baseFormulaType == null || baseFormulaType.isEmpty()) && (baseFormulaProductName == null || baseFormulaProductName.isEmpty()) - && (additiveType == null || additiveType.isEmpty()) && (additiveProductName == null || additiveProductName.isEmpty()) - && (caloricDensity == null || caloricDensity.isEmpty()) && (routeofAdministration == null || routeofAdministration.isEmpty()) - && (administration == null || administration.isEmpty()) && (maxVolumeToDeliver == null || maxVolumeToDeliver.isEmpty()) - && (administrationInstruction == null || administrationInstruction.isEmpty()); - } - - public String fhirType() { - return "NutritionOrder.enteralFormula"; - - } - - } - - @Block() - public static class NutritionOrderEnteralFormulaAdministrationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The time period and frequency at which the enteral formula should be delivered to the patient. - */ - @Child(name = "schedule", type = {Timing.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Scheduled frequency of enteral feeding", formalDefinition="The time period and frequency at which the enteral formula should be delivered to the patient." ) - protected Timing schedule; - - /** - * The volume of formula to provide to the patient per the specified administration schedule. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The volume of formula to provide", formalDefinition="The volume of formula to provide to the patient per the specified administration schedule." ) - protected SimpleQuantity quantity; - - /** - * The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule. - */ - @Child(name = "rate", type = {SimpleQuantity.class, Ratio.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Speed with which the formula is provided per period of time", formalDefinition="The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule." ) - protected Type rate; - - private static final long serialVersionUID = 1895031997L; - - /** - * Constructor - */ - public NutritionOrderEnteralFormulaAdministrationComponent() { - super(); - } - - /** - * @return {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The time period and frequency at which the enteral formula should be delivered to the patient.) - */ - public NutritionOrderEnteralFormulaAdministrationComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrderEnteralFormulaAdministrationComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The volume of formula to provide to the patient per the specified administration schedule.) - */ - public NutritionOrderEnteralFormulaAdministrationComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) - */ - public Type getRate() { - return this.rate; - } - - /** - * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) - */ - public SimpleQuantity getRateSimpleQuantity() throws FHIRException { - if (!(this.rate instanceof SimpleQuantity)) - throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (SimpleQuantity) this.rate; - } - - public boolean hasRateSimpleQuantity() { - return this.rate instanceof SimpleQuantity; - } - - /** - * @return {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) - */ - public Ratio getRateRatio() throws FHIRException { - if (!(this.rate instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.rate.getClass().getName()+" was encountered"); - return (Ratio) this.rate; - } - - public boolean hasRateRatio() { - return this.rate instanceof Ratio; - } - - public boolean hasRate() { - return this.rate != null && !this.rate.isEmpty(); - } - - /** - * @param value {@link #rate} (The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.) - */ - public NutritionOrderEnteralFormulaAdministrationComponent setRate(Type value) { - this.rate = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("schedule", "Timing", "The time period and frequency at which the enteral formula should be delivered to the patient.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The volume of formula to provide to the patient per the specified administration schedule.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("rate[x]", "SimpleQuantity|Ratio", "The rate of administration of formula via a feeding pump, e.g. 60 mL per hour, according to the specified schedule.", 0, java.lang.Integer.MAX_VALUE, rate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case 3493088: /*rate*/ return this.rate == null ? new Base[0] : new Base[] {this.rate}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -697920873: // schedule - this.schedule = castToTiming(value); // Timing - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 3493088: // rate - this.rate = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("schedule")) - this.schedule = castToTiming(value); // Timing - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("rate[x]")) - this.rate = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -697920873: return getSchedule(); // Timing - case -1285004149: return getQuantity(); // SimpleQuantity - case 983460768: return getRate(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("schedule")) { - this.schedule = new Timing(); - return this.schedule; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("rateSimpleQuantity")) { - this.rate = new SimpleQuantity(); - return this.rate; - } - else if (name.equals("rateRatio")) { - this.rate = new Ratio(); - return this.rate; - } - else - return super.addChild(name); - } - - public NutritionOrderEnteralFormulaAdministrationComponent copy() { - NutritionOrderEnteralFormulaAdministrationComponent dst = new NutritionOrderEnteralFormulaAdministrationComponent(); - copyValues(dst); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.rate = rate == null ? null : rate.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrderEnteralFormulaAdministrationComponent)) - return false; - NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other; - return compareDeep(schedule, o.schedule, true) && compareDeep(quantity, o.quantity, true) && compareDeep(rate, o.rate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrderEnteralFormulaAdministrationComponent)) - return false; - NutritionOrderEnteralFormulaAdministrationComponent o = (NutritionOrderEnteralFormulaAdministrationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (schedule == null || schedule.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (rate == null || rate.isEmpty()); - } - - public String fhirType() { - return "NutritionOrder.enteralFormula.administration"; - - } - - } - - /** - * Identifiers assigned to this order by the order sender or by the order receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Identifiers assigned to this order", formalDefinition="Identifiers assigned to this order by the order sender or by the order receiver." ) - protected List identifier; - - /** - * The workflow status of the nutrition order/request. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | draft | planned | requested | active | on-hold | completed | cancelled | entered-in-error", formalDefinition="The workflow status of the nutrition order/request." ) - protected Enumeration status; - - /** - * The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The person who requires the diet, formula or nutritional supplement", formalDefinition="The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - protected Patient patientTarget; - - /** - * An encounter that provides additional information about the healthcare context in which this request is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The encounter associated with this nutrition order", formalDefinition="An encounter that provides additional information about the healthcare context in which this request is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - protected Encounter encounterTarget; - - /** - * The date and time that this nutrition order was requested. - */ - @Child(name = "dateTime", type = {DateTimeType.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date and time the nutrition order was requested", formalDefinition="The date and time that this nutrition order was requested." ) - protected DateTimeType dateTime; - - /** - * The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings. - */ - @Child(name = "orderer", type = {Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who ordered the diet, formula or nutritional supplement", formalDefinition="The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - protected Practitioner ordererTarget; - - /** - * A link to a record of allergies or intolerances which should be included in the nutrition order. - */ - @Child(name = "allergyIntolerance", type = {AllergyIntolerance.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="List of the patient's food and nutrition-related allergies and intolerances", formalDefinition="A link to a record of allergies or intolerances which should be included in the nutrition order." ) - protected List allergyIntolerance; - /** - * The actual objects that are the target of the reference (A link to a record of allergies or intolerances which should be included in the nutrition order.) - */ - protected List allergyIntoleranceTarget; - - - /** - * This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. - */ - @Child(name = "foodPreferenceModifier", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Order-specific modifier about the type of food that should be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) - protected List foodPreferenceModifier; - - /** - * This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings. - */ - @Child(name = "excludeFoodModifier", type = {CodeableConcept.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Order-specific modifier about the type of food that should not be given", formalDefinition="This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings." ) - protected List excludeFoodModifier; - - /** - * Diet given orally in contrast to enteral (tube) feeding. - */ - @Child(name = "oralDiet", type = {}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Oral diet components", formalDefinition="Diet given orally in contrast to enteral (tube) feeding." ) - protected NutritionOrderOralDietComponent oralDiet; - - /** - * Oral nutritional products given in order to add further nutritional value to the patient's diet. - */ - @Child(name = "supplement", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Supplement components", formalDefinition="Oral nutritional products given in order to add further nutritional value to the patient's diet." ) - protected List supplement; - - /** - * Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity. - */ - @Child(name = "enteralFormula", type = {}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Enteral formula components", formalDefinition="Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity." ) - protected NutritionOrderEnteralFormulaComponent enteralFormula; - - private static final long serialVersionUID = 1429947433L; - - /** - * Constructor - */ - public NutritionOrder() { - super(); - } - - /** - * Constructor - */ - public NutritionOrder(Reference patient, DateTimeType dateTime) { - super(); - this.patient = patient; - this.dateTime = dateTime; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order sender or by the order receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The workflow status of the nutrition order/request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public NutritionOrder setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The workflow status of the nutrition order/request. - */ - public NutritionOrderStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The workflow status of the nutrition order/request. - */ - public NutritionOrder setStatus(NutritionOrderStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new NutritionOrderStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public NutritionOrder setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.) - */ - public NutritionOrder setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public NutritionOrder setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (An encounter that provides additional information about the healthcare context in which this request is made.) - */ - public NutritionOrder setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public DateTimeType getDateTimeElement() { - if (this.dateTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.dateTime"); - else if (Configuration.doAutoCreate()) - this.dateTime = new DateTimeType(); // bb - return this.dateTime; - } - - public boolean hasDateTimeElement() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - public boolean hasDateTime() { - return this.dateTime != null && !this.dateTime.isEmpty(); - } - - /** - * @param value {@link #dateTime} (The date and time that this nutrition order was requested.). This is the underlying object with id, value and extensions. The accessor "getDateTime" gives direct access to the value - */ - public NutritionOrder setDateTimeElement(DateTimeType value) { - this.dateTime = value; - return this; - } - - /** - * @return The date and time that this nutrition order was requested. - */ - public Date getDateTime() { - return this.dateTime == null ? null : this.dateTime.getValue(); - } - - /** - * @param value The date and time that this nutrition order was requested. - */ - public NutritionOrder setDateTime(Date value) { - if (this.dateTime == null) - this.dateTime = new DateTimeType(); - this.dateTime.setValue(value); - return this; - } - - /** - * @return {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); // cc - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public NutritionOrder setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public Practitioner getOrdererTarget() { - if (this.ordererTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.orderer"); - else if (Configuration.doAutoCreate()) - this.ordererTarget = new Practitioner(); // aa - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.) - */ - public NutritionOrder setOrdererTarget(Practitioner value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #allergyIntolerance} (A link to a record of allergies or intolerances which should be included in the nutrition order.) - */ - public List getAllergyIntolerance() { - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - return this.allergyIntolerance; - } - - public boolean hasAllergyIntolerance() { - if (this.allergyIntolerance == null) - return false; - for (Reference item : this.allergyIntolerance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #allergyIntolerance} (A link to a record of allergies or intolerances which should be included in the nutrition order.) - */ - // syntactic sugar - public Reference addAllergyIntolerance() { //3 - Reference t = new Reference(); - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - this.allergyIntolerance.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addAllergyIntolerance(Reference t) { //3 - if (t == null) - return this; - if (this.allergyIntolerance == null) - this.allergyIntolerance = new ArrayList(); - this.allergyIntolerance.add(t); - return this; - } - - /** - * @return {@link #allergyIntolerance} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A link to a record of allergies or intolerances which should be included in the nutrition order.) - */ - public List getAllergyIntoleranceTarget() { - if (this.allergyIntoleranceTarget == null) - this.allergyIntoleranceTarget = new ArrayList(); - return this.allergyIntoleranceTarget; - } - - // syntactic sugar - /** - * @return {@link #allergyIntolerance} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A link to a record of allergies or intolerances which should be included in the nutrition order.) - */ - public AllergyIntolerance addAllergyIntoleranceTarget() { - AllergyIntolerance r = new AllergyIntolerance(); - if (this.allergyIntoleranceTarget == null) - this.allergyIntoleranceTarget = new ArrayList(); - this.allergyIntoleranceTarget.add(r); - return r; - } - - /** - * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - public List getFoodPreferenceModifier() { - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - return this.foodPreferenceModifier; - } - - public boolean hasFoodPreferenceModifier() { - if (this.foodPreferenceModifier == null) - return false; - for (CodeableConcept item : this.foodPreferenceModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #foodPreferenceModifier} (This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - // syntactic sugar - public CodeableConcept addFoodPreferenceModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - this.foodPreferenceModifier.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addFoodPreferenceModifier(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.foodPreferenceModifier == null) - this.foodPreferenceModifier = new ArrayList(); - this.foodPreferenceModifier.add(t); - return this; - } - - /** - * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - public List getExcludeFoodModifier() { - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - return this.excludeFoodModifier; - } - - public boolean hasExcludeFoodModifier() { - if (this.excludeFoodModifier == null) - return false; - for (CodeableConcept item : this.excludeFoodModifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #excludeFoodModifier} (This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.) - */ - // syntactic sugar - public CodeableConcept addExcludeFoodModifier() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - this.excludeFoodModifier.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addExcludeFoodModifier(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.excludeFoodModifier == null) - this.excludeFoodModifier = new ArrayList(); - this.excludeFoodModifier.add(t); - return this; - } - - /** - * @return {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) - */ - public NutritionOrderOralDietComponent getOralDiet() { - if (this.oralDiet == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.oralDiet"); - else if (Configuration.doAutoCreate()) - this.oralDiet = new NutritionOrderOralDietComponent(); // cc - return this.oralDiet; - } - - public boolean hasOralDiet() { - return this.oralDiet != null && !this.oralDiet.isEmpty(); - } - - /** - * @param value {@link #oralDiet} (Diet given orally in contrast to enteral (tube) feeding.) - */ - public NutritionOrder setOralDiet(NutritionOrderOralDietComponent value) { - this.oralDiet = value; - return this; - } - - /** - * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) - */ - public List getSupplement() { - if (this.supplement == null) - this.supplement = new ArrayList(); - return this.supplement; - } - - public boolean hasSupplement() { - if (this.supplement == null) - return false; - for (NutritionOrderSupplementComponent item : this.supplement) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supplement} (Oral nutritional products given in order to add further nutritional value to the patient's diet.) - */ - // syntactic sugar - public NutritionOrderSupplementComponent addSupplement() { //3 - NutritionOrderSupplementComponent t = new NutritionOrderSupplementComponent(); - if (this.supplement == null) - this.supplement = new ArrayList(); - this.supplement.add(t); - return t; - } - - // syntactic sugar - public NutritionOrder addSupplement(NutritionOrderSupplementComponent t) { //3 - if (t == null) - return this; - if (this.supplement == null) - this.supplement = new ArrayList(); - this.supplement.add(t); - return this; - } - - /** - * @return {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) - */ - public NutritionOrderEnteralFormulaComponent getEnteralFormula() { - if (this.enteralFormula == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NutritionOrder.enteralFormula"); - else if (Configuration.doAutoCreate()) - this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); // cc - return this.enteralFormula; - } - - public boolean hasEnteralFormula() { - return this.enteralFormula != null && !this.enteralFormula.isEmpty(); - } - - /** - * @param value {@link #enteralFormula} (Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.) - */ - public NutritionOrder setEnteralFormula(NutritionOrderEnteralFormulaComponent value) { - this.enteralFormula = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order sender or by the order receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "The workflow status of the nutrition order/request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "The person (patient) who needs the nutrition order for an oral diet, nutritional supplement and/or enteral or formula feeding.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "An encounter that provides additional information about the healthcare context in which this request is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("dateTime", "dateTime", "The date and time that this nutrition order was requested.", 0, java.lang.Integer.MAX_VALUE, dateTime)); - childrenList.add(new Property("orderer", "Reference(Practitioner)", "The practitioner that holds legal responsibility for ordering the diet, nutritional supplement, or formula feedings.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("allergyIntolerance", "Reference(AllergyIntolerance)", "A link to a record of allergies or intolerances which should be included in the nutrition order.", 0, java.lang.Integer.MAX_VALUE, allergyIntolerance)); - childrenList.add(new Property("foodPreferenceModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should be given. These can be derived from patient allergies, intolerances, or preferences such as Halal, Vegan or Kosher. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, foodPreferenceModifier)); - childrenList.add(new Property("excludeFoodModifier", "CodeableConcept", "This modifier is used to convey order-specific modifiers about the type of food that should NOT be given. These can be derived from patient allergies, intolerances, or preferences such as No Red Meat, No Soy or No Wheat or Gluten-Free. While it should not be necessary to repeat allergy or intolerance information captured in the referenced allergyIntolerance resource in the excludeFoodModifier, this element may be used to convey additional specificity related to foods that should be eliminated from the patient’s diet for any reason. This modifier applies to the entire nutrition order inclusive of the oral diet, nutritional supplements and enteral formula feedings.", 0, java.lang.Integer.MAX_VALUE, excludeFoodModifier)); - childrenList.add(new Property("oralDiet", "", "Diet given orally in contrast to enteral (tube) feeding.", 0, java.lang.Integer.MAX_VALUE, oralDiet)); - childrenList.add(new Property("supplement", "", "Oral nutritional products given in order to add further nutritional value to the patient's diet.", 0, java.lang.Integer.MAX_VALUE, supplement)); - childrenList.add(new Property("enteralFormula", "", "Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the oral cavity.", 0, java.lang.Integer.MAX_VALUE, enteralFormula)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 1792749467: /*dateTime*/ return this.dateTime == null ? new Base[0] : new Base[] {this.dateTime}; // DateTimeType - case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference - case -120164120: /*allergyIntolerance*/ return this.allergyIntolerance == null ? new Base[0] : this.allergyIntolerance.toArray(new Base[this.allergyIntolerance.size()]); // Reference - case 659473872: /*foodPreferenceModifier*/ return this.foodPreferenceModifier == null ? new Base[0] : this.foodPreferenceModifier.toArray(new Base[this.foodPreferenceModifier.size()]); // CodeableConcept - case 1760260175: /*excludeFoodModifier*/ return this.excludeFoodModifier == null ? new Base[0] : this.excludeFoodModifier.toArray(new Base[this.excludeFoodModifier.size()]); // CodeableConcept - case 1153521250: /*oralDiet*/ return this.oralDiet == null ? new Base[0] : new Base[] {this.oralDiet}; // NutritionOrderOralDietComponent - case -711993159: /*supplement*/ return this.supplement == null ? new Base[0] : this.supplement.toArray(new Base[this.supplement.size()]); // NutritionOrderSupplementComponent - case -671083805: /*enteralFormula*/ return this.enteralFormula == null ? new Base[0] : new Base[] {this.enteralFormula}; // NutritionOrderEnteralFormulaComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new NutritionOrderStatusEnumFactory().fromType(value); // Enumeration - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 1792749467: // dateTime - this.dateTime = castToDateTime(value); // DateTimeType - break; - case -1207109509: // orderer - this.orderer = castToReference(value); // Reference - break; - case -120164120: // allergyIntolerance - this.getAllergyIntolerance().add(castToReference(value)); // Reference - break; - case 659473872: // foodPreferenceModifier - this.getFoodPreferenceModifier().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1760260175: // excludeFoodModifier - this.getExcludeFoodModifier().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1153521250: // oralDiet - this.oralDiet = (NutritionOrderOralDietComponent) value; // NutritionOrderOralDietComponent - break; - case -711993159: // supplement - this.getSupplement().add((NutritionOrderSupplementComponent) value); // NutritionOrderSupplementComponent - break; - case -671083805: // enteralFormula - this.enteralFormula = (NutritionOrderEnteralFormulaComponent) value; // NutritionOrderEnteralFormulaComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new NutritionOrderStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("dateTime")) - this.dateTime = castToDateTime(value); // DateTimeType - else if (name.equals("orderer")) - this.orderer = castToReference(value); // Reference - else if (name.equals("allergyIntolerance")) - this.getAllergyIntolerance().add(castToReference(value)); - else if (name.equals("foodPreferenceModifier")) - this.getFoodPreferenceModifier().add(castToCodeableConcept(value)); - else if (name.equals("excludeFoodModifier")) - this.getExcludeFoodModifier().add(castToCodeableConcept(value)); - else if (name.equals("oralDiet")) - this.oralDiet = (NutritionOrderOralDietComponent) value; // NutritionOrderOralDietComponent - else if (name.equals("supplement")) - this.getSupplement().add((NutritionOrderSupplementComponent) value); - else if (name.equals("enteralFormula")) - this.enteralFormula = (NutritionOrderEnteralFormulaComponent) value; // NutritionOrderEnteralFormulaComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -791418107: return getPatient(); // Reference - case 1524132147: return getEncounter(); // Reference - case 1792749467: throw new FHIRException("Cannot make property dateTime as it is not a complex type"); // DateTimeType - case -1207109509: return getOrderer(); // Reference - case -120164120: return addAllergyIntolerance(); // Reference - case 659473872: return addFoodPreferenceModifier(); // CodeableConcept - case 1760260175: return addExcludeFoodModifier(); // CodeableConcept - case 1153521250: return getOralDiet(); // NutritionOrderOralDietComponent - case -711993159: return addSupplement(); // NutritionOrderSupplementComponent - case -671083805: return getEnteralFormula(); // NutritionOrderEnteralFormulaComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.status"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("dateTime")) { - throw new FHIRException("Cannot call addChild on a primitive type NutritionOrder.dateTime"); - } - else if (name.equals("orderer")) { - this.orderer = new Reference(); - return this.orderer; - } - else if (name.equals("allergyIntolerance")) { - return addAllergyIntolerance(); - } - else if (name.equals("foodPreferenceModifier")) { - return addFoodPreferenceModifier(); - } - else if (name.equals("excludeFoodModifier")) { - return addExcludeFoodModifier(); - } - else if (name.equals("oralDiet")) { - this.oralDiet = new NutritionOrderOralDietComponent(); - return this.oralDiet; - } - else if (name.equals("supplement")) { - return addSupplement(); - } - else if (name.equals("enteralFormula")) { - this.enteralFormula = new NutritionOrderEnteralFormulaComponent(); - return this.enteralFormula; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "NutritionOrder"; - - } - - public NutritionOrder copy() { - NutritionOrder dst = new NutritionOrder(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.dateTime = dateTime == null ? null : dateTime.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - if (allergyIntolerance != null) { - dst.allergyIntolerance = new ArrayList(); - for (Reference i : allergyIntolerance) - dst.allergyIntolerance.add(i.copy()); - }; - if (foodPreferenceModifier != null) { - dst.foodPreferenceModifier = new ArrayList(); - for (CodeableConcept i : foodPreferenceModifier) - dst.foodPreferenceModifier.add(i.copy()); - }; - if (excludeFoodModifier != null) { - dst.excludeFoodModifier = new ArrayList(); - for (CodeableConcept i : excludeFoodModifier) - dst.excludeFoodModifier.add(i.copy()); - }; - dst.oralDiet = oralDiet == null ? null : oralDiet.copy(); - if (supplement != null) { - dst.supplement = new ArrayList(); - for (NutritionOrderSupplementComponent i : supplement) - dst.supplement.add(i.copy()); - }; - dst.enteralFormula = enteralFormula == null ? null : enteralFormula.copy(); - return dst; - } - - protected NutritionOrder typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NutritionOrder)) - return false; - NutritionOrder o = (NutritionOrder) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(dateTime, o.dateTime, true) && compareDeep(orderer, o.orderer, true) - && compareDeep(allergyIntolerance, o.allergyIntolerance, true) && compareDeep(foodPreferenceModifier, o.foodPreferenceModifier, true) - && compareDeep(excludeFoodModifier, o.excludeFoodModifier, true) && compareDeep(oralDiet, o.oralDiet, true) - && compareDeep(supplement, o.supplement, true) && compareDeep(enteralFormula, o.enteralFormula, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NutritionOrder)) - return false; - NutritionOrder o = (NutritionOrder) other; - return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (encounter == null || encounter.isEmpty()) && (dateTime == null || dateTime.isEmpty()) - && (orderer == null || orderer.isEmpty()) && (allergyIntolerance == null || allergyIntolerance.isEmpty()) - && (foodPreferenceModifier == null || foodPreferenceModifier.isEmpty()) && (excludeFoodModifier == null || excludeFoodModifier.isEmpty()) - && (oralDiet == null || oralDiet.isEmpty()) && (supplement == null || supplement.isEmpty()) - && (enteralFormula == null || enteralFormula.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.NutritionOrder; - } - - /** - * Search parameter: patient - *

- * Description: The identity of the person who requires the diet, formula or nutritional supplement
- * Type: reference
- * Path: NutritionOrder.patient
- *

- */ - @SearchParamDefinition(name="patient", path="NutritionOrder.patient", description="The identity of the person who requires the diet, formula or nutritional supplement", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The identity of the person who requires the diet, formula or nutritional supplement
- * Type: reference
- * Path: NutritionOrder.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "NutritionOrder:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("NutritionOrder:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: Status of the nutrition order.
- * Type: token
- * Path: NutritionOrder.status
- *

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

- * Description: Status of the nutrition order.
- * Type: token
- * Path: NutritionOrder.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: supplement - *

- * Description: Type of supplement product requested
- * Type: token
- * Path: NutritionOrder.supplement.type
- *

- */ - @SearchParamDefinition(name="supplement", path="NutritionOrder.supplement.type", description="Type of supplement product requested", type="token" ) - public static final String SP_SUPPLEMENT = "supplement"; - /** - * Fluent Client search parameter constant for supplement - *

- * Description: Type of supplement product requested
- * Type: token
- * Path: NutritionOrder.supplement.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SUPPLEMENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SUPPLEMENT); - - /** - * Search parameter: oraldiet - *

- * Description: Type of diet that can be consumed orally (i.e., take via the mouth).
- * Type: token
- * Path: NutritionOrder.oralDiet.type
- *

- */ - @SearchParamDefinition(name="oraldiet", path="NutritionOrder.oralDiet.type", description="Type of diet that can be consumed orally (i.e., take via the mouth).", type="token" ) - public static final String SP_ORALDIET = "oraldiet"; - /** - * Fluent Client search parameter constant for oraldiet - *

- * Description: Type of diet that can be consumed orally (i.e., take via the mouth).
- * Type: token
- * Path: NutritionOrder.oralDiet.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORALDIET = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORALDIET); - - /** - * Search parameter: provider - *

- * Description: The identify of the provider who placed the nutrition order
- * Type: reference
- * Path: NutritionOrder.orderer
- *

- */ - @SearchParamDefinition(name="provider", path="NutritionOrder.orderer", description="The identify of the provider who placed the nutrition order", type="reference" ) - public static final String SP_PROVIDER = "provider"; - /** - * Fluent Client search parameter constant for provider - *

- * Description: The identify of the provider who placed the nutrition order
- * Type: reference
- * Path: NutritionOrder.orderer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "NutritionOrder:provider". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDER = new ca.uhn.fhir.model.api.Include("NutritionOrder:provider").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Return nutrition orders with this encounter identifier
- * Type: reference
- * Path: NutritionOrder.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="NutritionOrder.encounter", description="Return nutrition orders with this encounter identifier", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Return nutrition orders with this encounter identifier
- * Type: reference
- * Path: NutritionOrder.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "NutritionOrder:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("NutritionOrder:encounter").toLocked(); - - /** - * Search parameter: datetime - *

- * Description: Return nutrition orders requested on this date
- * Type: date
- * Path: NutritionOrder.dateTime
- *

- */ - @SearchParamDefinition(name="datetime", path="NutritionOrder.dateTime", description="Return nutrition orders requested on this date", type="date" ) - public static final String SP_DATETIME = "datetime"; - /** - * Fluent Client search parameter constant for datetime - *

- * Description: Return nutrition orders requested on this date
- * Type: date
- * Path: NutritionOrder.dateTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATETIME = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATETIME); - - /** - * Search parameter: additive - *

- * Description: Type of module component to add to the feeding
- * Type: token
- * Path: NutritionOrder.enteralFormula.additiveType
- *

- */ - @SearchParamDefinition(name="additive", path="NutritionOrder.enteralFormula.additiveType", description="Type of module component to add to the feeding", type="token" ) - public static final String SP_ADDITIVE = "additive"; - /** - * Fluent Client search parameter constant for additive - *

- * Description: Type of module component to add to the feeding
- * Type: token
- * Path: NutritionOrder.enteralFormula.additiveType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDITIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDITIVE); - - /** - * Search parameter: identifier - *

- * Description: Return nutrition orders with this external identifier
- * Type: token
- * Path: NutritionOrder.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="NutritionOrder.identifier", description="Return nutrition orders with this external identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return nutrition orders with this external identifier
- * Type: token
- * Path: NutritionOrder.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: formula - *

- * Description: Type of enteral or infant formula
- * Type: token
- * Path: NutritionOrder.enteralFormula.baseFormulaType
- *

- */ - @SearchParamDefinition(name="formula", path="NutritionOrder.enteralFormula.baseFormulaType", description="Type of enteral or infant formula", type="token" ) - public static final String SP_FORMULA = "formula"; - /** - * Fluent Client search parameter constant for formula - *

- * Description: Type of enteral or infant formula
- * Type: token
- * Path: NutritionOrder.enteralFormula.baseFormulaType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FORMULA = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FORMULA); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Observation.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Observation.java deleted file mode 100644 index bd5dc8693ff..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Observation.java +++ /dev/null @@ -1,3523 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Measurements and simple assertions made about a patient, device or other subject. - */ -@ResourceDef(name="Observation", profile="http://hl7.org/fhir/Profile/Observation") -public class Observation extends DomainResource { - - public enum ObservationStatus { - /** - * The existence of the observation is registered, but there is no result yet available. - */ - REGISTERED, - /** - * This is an initial or interim observation: data may be incomplete or unverified. - */ - PRELIMINARY, - /** - * The observation is complete and verified by an authorized person (who may be the same person who entered the observation based on policy). - */ - FINAL, - /** - * The observation has been modified subsequent to being Final, and is complete and verified by an authorized person. - */ - AMENDED, - /** - * The observation is unavailable because the measurement was not started or not completed (also sometimes called "aborted"). - */ - CANCELLED, - /** - * The observation has been withdrawn following previous final release. - */ - ENTEREDINERROR, - /** - * The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be made to provide a meaningful value other than "unknown". - */ - UNKNOWN, - /** - * added to help the parsers - */ - NULL; - public static ObservationStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return REGISTERED; - if ("preliminary".equals(codeString)) - return PRELIMINARY; - if ("final".equals(codeString)) - return FINAL; - if ("amended".equals(codeString)) - return AMENDED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - if ("unknown".equals(codeString)) - return UNKNOWN; - throw new FHIRException("Unknown ObservationStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REGISTERED: return "registered"; - case PRELIMINARY: return "preliminary"; - case FINAL: return "final"; - case AMENDED: return "amended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "entered-in-error"; - case UNKNOWN: return "unknown"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REGISTERED: return "http://hl7.org/fhir/observation-status"; - case PRELIMINARY: return "http://hl7.org/fhir/observation-status"; - case FINAL: return "http://hl7.org/fhir/observation-status"; - case AMENDED: return "http://hl7.org/fhir/observation-status"; - case CANCELLED: return "http://hl7.org/fhir/observation-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/observation-status"; - case UNKNOWN: return "http://hl7.org/fhir/observation-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REGISTERED: return "The existence of the observation is registered, but there is no result yet available."; - case PRELIMINARY: return "This is an initial or interim observation: data may be incomplete or unverified."; - case FINAL: return "The observation is complete and verified by an authorized person (who may be the same person who entered the observation based on policy)."; - case AMENDED: return "The observation has been modified subsequent to being Final, and is complete and verified by an authorized person."; - case CANCELLED: return "The observation is unavailable because the measurement was not started or not completed (also sometimes called \"aborted\")."; - case ENTEREDINERROR: return "The observation has been withdrawn following previous final release."; - case UNKNOWN: return "The observation status is unknown. Note that \"unknown\" is a value of last resort and every attempt should be made to provide a meaningful value other than \"unknown\"."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REGISTERED: return "Registered"; - case PRELIMINARY: return "Preliminary"; - case FINAL: return "Final"; - case AMENDED: return "Amended"; - case CANCELLED: return "cancelled"; - case ENTEREDINERROR: return "Entered in Error"; - case UNKNOWN: return "Unknown Status"; - default: return "?"; - } - } - } - - public static class ObservationStatusEnumFactory implements EnumFactory { - public ObservationStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return ObservationStatus.REGISTERED; - if ("preliminary".equals(codeString)) - return ObservationStatus.PRELIMINARY; - if ("final".equals(codeString)) - return ObservationStatus.FINAL; - if ("amended".equals(codeString)) - return ObservationStatus.AMENDED; - if ("cancelled".equals(codeString)) - return ObservationStatus.CANCELLED; - if ("entered-in-error".equals(codeString)) - return ObservationStatus.ENTEREDINERROR; - if ("unknown".equals(codeString)) - return ObservationStatus.UNKNOWN; - throw new IllegalArgumentException("Unknown ObservationStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("registered".equals(codeString)) - return new Enumeration(this, ObservationStatus.REGISTERED); - if ("preliminary".equals(codeString)) - return new Enumeration(this, ObservationStatus.PRELIMINARY); - if ("final".equals(codeString)) - return new Enumeration(this, ObservationStatus.FINAL); - if ("amended".equals(codeString)) - return new Enumeration(this, ObservationStatus.AMENDED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, ObservationStatus.CANCELLED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, ObservationStatus.ENTEREDINERROR); - if ("unknown".equals(codeString)) - return new Enumeration(this, ObservationStatus.UNKNOWN); - throw new FHIRException("Unknown ObservationStatus code '"+codeString+"'"); - } - public String toCode(ObservationStatus code) { - if (code == ObservationStatus.REGISTERED) - return "registered"; - if (code == ObservationStatus.PRELIMINARY) - return "preliminary"; - if (code == ObservationStatus.FINAL) - return "final"; - if (code == ObservationStatus.AMENDED) - return "amended"; - if (code == ObservationStatus.CANCELLED) - return "cancelled"; - if (code == ObservationStatus.ENTEREDINERROR) - return "entered-in-error"; - if (code == ObservationStatus.UNKNOWN) - return "unknown"; - return "?"; - } - public String toSystem(ObservationStatus code) { - return code.getSystem(); - } - } - - public enum ObservationRelationshipType { - /** - * This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group. - */ - HASMEMBER, - /** - * The target resource (Observation or QuestionnaireResponse) is part of the information from which this observation value is derived. (e.g. calculated anion gap, Apgar score) NOTE: "derived-from" is only logical choice when referencing QuestionnaireResponse. - */ - DERIVEDFROM, - /** - * This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). - */ - SEQUELTO, - /** - * This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. - */ - REPLACES, - /** - * The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipemia measure target from a plasma measure). - */ - QUALIFIEDBY, - /** - * The value of the target observation interferes (degrades quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value). - */ - INTERFEREDBY, - /** - * added to help the parsers - */ - NULL; - public static ObservationRelationshipType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("has-member".equals(codeString)) - return HASMEMBER; - if ("derived-from".equals(codeString)) - return DERIVEDFROM; - if ("sequel-to".equals(codeString)) - return SEQUELTO; - if ("replaces".equals(codeString)) - return REPLACES; - if ("qualified-by".equals(codeString)) - return QUALIFIEDBY; - if ("interfered-by".equals(codeString)) - return INTERFEREDBY; - throw new FHIRException("Unknown ObservationRelationshipType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HASMEMBER: return "has-member"; - case DERIVEDFROM: return "derived-from"; - case SEQUELTO: return "sequel-to"; - case REPLACES: return "replaces"; - case QUALIFIEDBY: return "qualified-by"; - case INTERFEREDBY: return "interfered-by"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HASMEMBER: return "http://hl7.org/fhir/observation-relationshiptypes"; - case DERIVEDFROM: return "http://hl7.org/fhir/observation-relationshiptypes"; - case SEQUELTO: return "http://hl7.org/fhir/observation-relationshiptypes"; - case REPLACES: return "http://hl7.org/fhir/observation-relationshiptypes"; - case QUALIFIEDBY: return "http://hl7.org/fhir/observation-relationshiptypes"; - case INTERFEREDBY: return "http://hl7.org/fhir/observation-relationshiptypes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HASMEMBER: return "This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group."; - case DERIVEDFROM: return "The target resource (Observation or QuestionnaireResponse) is part of the information from which this observation value is derived. (e.g. calculated anion gap, Apgar score) NOTE: \"derived-from\" is only logical choice when referencing QuestionnaireResponse."; - case SEQUELTO: return "This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test)."; - case REPLACES: return "This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete."; - case QUALIFIEDBY: return "The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipemia measure target from a plasma measure)."; - case INTERFEREDBY: return "The value of the target observation interferes (degrades quality, or prevents valid observation) with the semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has no value)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HASMEMBER: return "Has Member"; - case DERIVEDFROM: return "Derived From"; - case SEQUELTO: return "Sequel To"; - case REPLACES: return "Replaces"; - case QUALIFIEDBY: return "Qualified By"; - case INTERFEREDBY: return "Interfered By"; - default: return "?"; - } - } - } - - public static class ObservationRelationshipTypeEnumFactory implements EnumFactory { - public ObservationRelationshipType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("has-member".equals(codeString)) - return ObservationRelationshipType.HASMEMBER; - if ("derived-from".equals(codeString)) - return ObservationRelationshipType.DERIVEDFROM; - if ("sequel-to".equals(codeString)) - return ObservationRelationshipType.SEQUELTO; - if ("replaces".equals(codeString)) - return ObservationRelationshipType.REPLACES; - if ("qualified-by".equals(codeString)) - return ObservationRelationshipType.QUALIFIEDBY; - if ("interfered-by".equals(codeString)) - return ObservationRelationshipType.INTERFEREDBY; - throw new IllegalArgumentException("Unknown ObservationRelationshipType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("has-member".equals(codeString)) - return new Enumeration(this, ObservationRelationshipType.HASMEMBER); - if ("derived-from".equals(codeString)) - return new Enumeration(this, ObservationRelationshipType.DERIVEDFROM); - if ("sequel-to".equals(codeString)) - return new Enumeration(this, ObservationRelationshipType.SEQUELTO); - if ("replaces".equals(codeString)) - return new Enumeration(this, ObservationRelationshipType.REPLACES); - if ("qualified-by".equals(codeString)) - return new Enumeration(this, ObservationRelationshipType.QUALIFIEDBY); - if ("interfered-by".equals(codeString)) - return new Enumeration(this, ObservationRelationshipType.INTERFEREDBY); - throw new FHIRException("Unknown ObservationRelationshipType code '"+codeString+"'"); - } - public String toCode(ObservationRelationshipType code) { - if (code == ObservationRelationshipType.HASMEMBER) - return "has-member"; - if (code == ObservationRelationshipType.DERIVEDFROM) - return "derived-from"; - if (code == ObservationRelationshipType.SEQUELTO) - return "sequel-to"; - if (code == ObservationRelationshipType.REPLACES) - return "replaces"; - if (code == ObservationRelationshipType.QUALIFIEDBY) - return "qualified-by"; - if (code == ObservationRelationshipType.INTERFEREDBY) - return "interfered-by"; - return "?"; - } - public String toSystem(ObservationRelationshipType code) { - return code.getSystem(); - } - } - - @Block() - public static class ObservationReferenceRangeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3). - */ - @Child(name = "low", type = {SimpleQuantity.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Low Range, if relevant", formalDefinition="The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3)." ) - protected SimpleQuantity low; - - /** - * The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3). - */ - @Child(name = "high", type = {SimpleQuantity.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="High Range, if relevant", formalDefinition="The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3)." ) - protected SimpleQuantity high; - - /** - * Code for the meaning of the reference range. - */ - @Child(name = "meaning", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates the meaning/use of this range of this range", formalDefinition="Code for the meaning of the reference range." ) - protected CodeableConcept meaning; - - /** - * 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. - */ - @Child(name = "age", type = {Range.class}, order=4, min=0, max=1, modifier=false, summary=false) - @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." ) - protected Range age; - - /** - * Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - @Child(name = "text", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Text based reference range in an observation", formalDefinition="Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of 'normals'." ) - protected StringType text; - - private static final long serialVersionUID = -238694788L; - - /** - * Constructor - */ - public ObservationReferenceRangeComponent() { - super(); - } - - /** - * @return {@link #low} (The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).) - */ - public SimpleQuantity getLow() { - if (this.low == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.low"); - else if (Configuration.doAutoCreate()) - this.low = new SimpleQuantity(); // cc - return this.low; - } - - public boolean hasLow() { - return this.low != null && !this.low.isEmpty(); - } - - /** - * @param value {@link #low} (The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).) - */ - public ObservationReferenceRangeComponent setLow(SimpleQuantity value) { - this.low = value; - return this; - } - - /** - * @return {@link #high} (The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).) - */ - public SimpleQuantity getHigh() { - if (this.high == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.high"); - else if (Configuration.doAutoCreate()) - this.high = new SimpleQuantity(); // cc - return this.high; - } - - public boolean hasHigh() { - return this.high != null && !this.high.isEmpty(); - } - - /** - * @param value {@link #high} (The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).) - */ - public ObservationReferenceRangeComponent setHigh(SimpleQuantity value) { - this.high = value; - return this; - } - - /** - * @return {@link #meaning} (Code for the meaning of the reference range.) - */ - public CodeableConcept getMeaning() { - if (this.meaning == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.meaning"); - else if (Configuration.doAutoCreate()) - this.meaning = new CodeableConcept(); // cc - return this.meaning; - } - - public boolean hasMeaning() { - return this.meaning != null && !this.meaning.isEmpty(); - } - - /** - * @param value {@link #meaning} (Code for the meaning of the reference range.) - */ - public ObservationReferenceRangeComponent setMeaning(CodeableConcept value) { - this.meaning = value; - return this; - } - - /** - * @return {@link #age} (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 Range getAge() { - if (this.age == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.age"); - else if (Configuration.doAutoCreate()) - this.age = new Range(); // cc - return this.age; - } - - public boolean hasAge() { - return this.age != null && !this.age.isEmpty(); - } - - /** - * @param value {@link #age} (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 ObservationReferenceRangeComponent setAge(Range value) { - this.age = value; - return this; - } - - /** - * @return {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationReferenceRangeComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public ObservationReferenceRangeComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of "Negative" or a list or table of 'normals'. - */ - public ObservationReferenceRangeComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("low", "SimpleQuantity", "The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).", 0, java.lang.Integer.MAX_VALUE, low)); - childrenList.add(new Property("high", "SimpleQuantity", "The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).", 0, java.lang.Integer.MAX_VALUE, high)); - childrenList.add(new Property("meaning", "CodeableConcept", "Code for the meaning of the reference range.", 0, java.lang.Integer.MAX_VALUE, meaning)); - childrenList.add(new Property("age", "Range", "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.", 0, java.lang.Integer.MAX_VALUE, age)); - childrenList.add(new Property("text", "string", "Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of 'normals'.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 107348: /*low*/ return this.low == null ? new Base[0] : new Base[] {this.low}; // SimpleQuantity - case 3202466: /*high*/ return this.high == null ? new Base[0] : new Base[] {this.high}; // SimpleQuantity - case 938160637: /*meaning*/ return this.meaning == null ? new Base[0] : new Base[] {this.meaning}; // CodeableConcept - case 96511: /*age*/ return this.age == null ? new Base[0] : new Base[] {this.age}; // Range - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 107348: // low - this.low = castToSimpleQuantity(value); // SimpleQuantity - break; - case 3202466: // high - this.high = castToSimpleQuantity(value); // SimpleQuantity - break; - case 938160637: // meaning - this.meaning = castToCodeableConcept(value); // CodeableConcept - break; - case 96511: // age - this.age = castToRange(value); // Range - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("low")) - this.low = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("high")) - this.high = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("meaning")) - this.meaning = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("age")) - this.age = castToRange(value); // Range - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 107348: return getLow(); // SimpleQuantity - case 3202466: return getHigh(); // SimpleQuantity - case 938160637: return getMeaning(); // CodeableConcept - case 96511: return getAge(); // Range - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("low")) { - this.low = new SimpleQuantity(); - return this.low; - } - else if (name.equals("high")) { - this.high = new SimpleQuantity(); - return this.high; - } - else if (name.equals("meaning")) { - this.meaning = new CodeableConcept(); - return this.meaning; - } - else if (name.equals("age")) { - this.age = new Range(); - return this.age; - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type Observation.text"); - } - else - return super.addChild(name); - } - - public ObservationReferenceRangeComponent copy() { - ObservationReferenceRangeComponent dst = new ObservationReferenceRangeComponent(); - copyValues(dst); - dst.low = low == null ? null : low.copy(); - dst.high = high == null ? null : high.copy(); - dst.meaning = meaning == null ? null : meaning.copy(); - dst.age = age == null ? null : age.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ObservationReferenceRangeComponent)) - return false; - ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; - return compareDeep(low, o.low, true) && compareDeep(high, o.high, true) && compareDeep(meaning, o.meaning, true) - && compareDeep(age, o.age, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ObservationReferenceRangeComponent)) - return false; - ObservationReferenceRangeComponent o = (ObservationReferenceRangeComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) - && (meaning == null || meaning.isEmpty()) && (age == null || age.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - public String fhirType() { - return "Observation.referenceRange"; - - } - - } - - @Block() - public static class ObservationRelatedComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code specifying the kind of relationship that exists with the target resource. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", formalDefinition="A code specifying the kind of relationship that exists with the target resource." ) - protected Enumeration type; - - /** - * A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation. - */ - @Child(name = "target", type = {Observation.class, QuestionnaireResponse.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource that is related to this one", formalDefinition="A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) - */ - protected Resource targetTarget; - - private static final long serialVersionUID = 1541802577L; - - /** - * Constructor - */ - public ObservationRelatedComponent() { - super(); - } - - /** - * Constructor - */ - public ObservationRelatedComponent(Reference target) { - super(); - this.target = target; - } - - /** - * @return {@link #type} (A code specifying the kind of relationship that exists with the target resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ObservationRelationshipTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code specifying the kind of relationship that exists with the target resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ObservationRelatedComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return A code specifying the kind of relationship that exists with the target resource. - */ - public ObservationRelationshipType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A code specifying the kind of relationship that exists with the target resource. - */ - public ObservationRelatedComponent setType(ObservationRelationshipType value) { - if (value == null) - this.type = null; - else { - if (this.type == null) - this.type = new Enumeration(new ObservationRelationshipTypeEnumFactory()); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationRelatedComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) - */ - public ObservationRelatedComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.) - */ - public ObservationRelatedComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "A code specifying the kind of relationship that exists with the target resource.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "Reference(Observation|QuestionnaireResponse)", "A reference to the observation or [[[QuestionnaireResponse]]] resource that is related to this observation.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new ObservationRelationshipTypeEnumFactory().fromType(value); // Enumeration - break; - case -880905839: // target - this.target = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new ObservationRelationshipTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("target")) - this.target = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -880905839: return getTarget(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Observation.type"); - } - else if (name.equals("target")) { - this.target = new Reference(); - return this.target; - } - else - return super.addChild(name); - } - - public ObservationRelatedComponent copy() { - ObservationRelatedComponent dst = new ObservationRelatedComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ObservationRelatedComponent)) - return false; - ObservationRelatedComponent o = (ObservationRelatedComponent) other; - return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ObservationRelatedComponent)) - return false; - ObservationRelatedComponent o = (ObservationRelatedComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - public String fhirType() { - return "Observation.related"; - - } - - } - - @Block() - public static class ObservationComponentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Describes what was observed. Sometimes this is called the observation "code". - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of component observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation \"code\"." ) - protected CodeableConcept code; - - /** - * The information determined as a result of making the observation, if the information has a simple value. - */ - @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Actual component result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) - protected Type value; - - /** - * Provides a reason why the expected value in the element Observation.value[x] is missing. - */ - @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why the component result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) - protected CodeableConcept dataAbsentReason; - - /** - * Guidance on how to interpret the value by comparison to a normal or recommended range. - */ - @Child(name = "referenceRange", type = {ObservationReferenceRangeComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Provides guide for interpretation of component result", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) - protected List referenceRange; - - private static final long serialVersionUID = 946602904L; - - /** - * Constructor - */ - public ObservationComponentComponent() { - super(); - } - - /** - * Constructor - */ - public ObservationComponentComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationComponentComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "code".) - */ - public ObservationComponentComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Quantity getValueQuantity() throws FHIRException { - if (!(this.value instanceof Quantity)) - throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - public boolean hasValueQuantity() { - return this.value instanceof Quantity; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public CodeableConcept getValueCodeableConcept() throws FHIRException { - if (!(this.value instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - public boolean hasValueCodeableConcept() { - return this.value instanceof CodeableConcept; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Range getValueRange() throws FHIRException { - if (!(this.value instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - public boolean hasValueRange() { - return this.value instanceof Range; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Ratio getValueRatio() throws FHIRException { - if (!(this.value instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Ratio) this.value; - } - - public boolean hasValueRatio() { - return this.value instanceof Ratio; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public SampledData getValueSampledData() throws FHIRException { - if (!(this.value instanceof SampledData)) - throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); - return (SampledData) this.value; - } - - public boolean hasValueSampledData() { - return this.value instanceof SampledData; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Attachment getValueAttachment() throws FHIRException { - if (!(this.value instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - public boolean hasValueAttachment() { - return this.value instanceof Attachment; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public TimeType getValueTimeType() throws FHIRException { - if (!(this.value instanceof TimeType)) - throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - public boolean hasValueTimeType() { - return this.value instanceof TimeType; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public DateTimeType getValueDateTimeType() throws FHIRException { - if (!(this.value instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - public boolean hasValueDateTimeType() { - return this.value instanceof DateTimeType; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Period getValuePeriod() throws FHIRException { - if (!(this.value instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Period) this.value; - } - - public boolean hasValuePeriod() { - return this.value instanceof Period; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public ObservationComponentComponent setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) - */ - public CodeableConcept getDataAbsentReason() { - if (this.dataAbsentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ObservationComponentComponent.dataAbsentReason"); - else if (Configuration.doAutoCreate()) - this.dataAbsentReason = new CodeableConcept(); // cc - return this.dataAbsentReason; - } - - public boolean hasDataAbsentReason() { - return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); - } - - /** - * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) - */ - public ObservationComponentComponent setDataAbsentReason(CodeableConcept value) { - this.dataAbsentReason = value; - return this; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - public List getReferenceRange() { - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - return this.referenceRange; - } - - public boolean hasReferenceRange() { - if (this.referenceRange == null) - return false; - for (ObservationReferenceRangeComponent item : this.referenceRange) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - // syntactic sugar - public ObservationReferenceRangeComponent addReferenceRange() { //3 - ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return t; - } - - // syntactic sugar - public ObservationComponentComponent addReferenceRange(ObservationReferenceRangeComponent t) { //3 - if (t == null) - return this; - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"code\".", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); - childrenList.add(new Property("referenceRange", "@Observation.referenceRange", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept - case -1912545102: /*referenceRange*/ return this.referenceRange == null ? new Base[0] : this.referenceRange.toArray(new Base[this.referenceRange.size()]); // ObservationReferenceRangeComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - case 1034315687: // dataAbsentReason - this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept - break; - case -1912545102: // referenceRange - this.getReferenceRange().add((ObservationReferenceRangeComponent) value); // ObservationReferenceRangeComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else if (name.equals("dataAbsentReason")) - this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("referenceRange")) - this.getReferenceRange().add((ObservationReferenceRangeComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -1410166417: return getValue(); // Type - case 1034315687: return getDataAbsentReason(); // CodeableConcept - case -1912545102: return addReferenceRange(); // ObservationReferenceRangeComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("valueRatio")) { - this.value = new Ratio(); - return this.value; - } - else if (name.equals("valueSampledData")) { - this.value = new SampledData(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else if (name.equals("dataAbsentReason")) { - this.dataAbsentReason = new CodeableConcept(); - return this.dataAbsentReason; - } - else if (name.equals("referenceRange")) { - return addReferenceRange(); - } - else - return super.addChild(name); - } - - public ObservationComponentComponent copy() { - ObservationComponentComponent dst = new ObservationComponentComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.value = value == null ? null : value.copy(); - dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); - if (referenceRange != null) { - dst.referenceRange = new ArrayList(); - for (ObservationReferenceRangeComponent i : referenceRange) - dst.referenceRange.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ObservationComponentComponent)) - return false; - ObservationComponentComponent o = (ObservationComponentComponent) other; - return compareDeep(code, o.code, true) && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true) - && compareDeep(referenceRange, o.referenceRange, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ObservationComponentComponent)) - return false; - ObservationComponentComponent o = (ObservationComponentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (value == null || value.isEmpty()) - && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) - ; - } - - public String fhirType() { - return "Observation.component"; - - } - - } - - /** - * A unique identifier for the simple observation instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Unique Id for this particular observation", formalDefinition="A unique identifier for the simple observation instance." ) - protected List identifier; - - /** - * The status of the result value. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="registered | preliminary | final | amended +", formalDefinition="The status of the result value." ) - protected Enumeration status; - - /** - * A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Classification of type of observation", formalDefinition="A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes." ) - protected CodeableConcept category; - - /** - * Describes what was observed. Sometimes this is called the observation "name". - */ - @Child(name = "code", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of observation (code / type)", formalDefinition="Describes what was observed. Sometimes this is called the observation \"name\"." ) - protected CodeableConcept code; - - /** - * The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Location.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) - */ - protected Resource subjectTarget; - - /** - * The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made. - */ - @Child(name = "encounter", type = {Encounter.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Healthcare event during which this observation is made", formalDefinition="The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) - */ - protected Encounter encounterTarget; - - /** - * 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. - */ - @Child(name = "effective", type = {DateTimeType.class, Period.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Clinically 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." ) - protected Type effective; - - /** - * The date and time this observation was made available to providers, typically after the results have been reviewed and verified. - */ - @Child(name = "issued", type = {InstantType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date/Time this was made available", formalDefinition="The date and time this observation was made available to providers, typically after the results have been reviewed and verified." ) - protected InstantType issued; - - /** - * Who was responsible for asserting the observed value as "true". - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who is responsible for the observation", formalDefinition="Who was responsible for asserting the observed value as \"true\"." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Who was responsible for asserting the observed value as "true".) - */ - protected List performerTarget; - - - /** - * The information determined as a result of making the observation, if the information has a simple value. - */ - @Child(name = "value", type = {Quantity.class, CodeableConcept.class, StringType.class, Range.class, Ratio.class, SampledData.class, Attachment.class, TimeType.class, DateTimeType.class, Period.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Actual result", formalDefinition="The information determined as a result of making the observation, if the information has a simple value." ) - protected Type value; - - /** - * Provides a reason why the expected value in the element Observation.value[x] is missing. - */ - @Child(name = "dataAbsentReason", type = {CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why the result is missing", formalDefinition="Provides a reason why the expected value in the element Observation.value[x] is missing." ) - protected CodeableConcept dataAbsentReason; - - /** - * The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag. - */ - @Child(name = "interpretation", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="High, low, normal, etc.", formalDefinition="The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag." ) - protected CodeableConcept interpretation; - - /** - * 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. - */ - @Child(name = "comment", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @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." ) - protected StringType comment; - - /** - * Indicates the site on the subject's body where the observation was made (i.e. the target site). - */ - @Child(name = "bodySite", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Observed body part", formalDefinition="Indicates the site on the subject's body where the observation was made (i.e. the target site)." ) - protected CodeableConcept bodySite; - - /** - * Indicates the mechanism used to perform the observation. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How it was done", formalDefinition="Indicates the mechanism used to perform the observation." ) - protected CodeableConcept method; - - /** - * The specimen that was used when this observation was made. - */ - @Child(name = "specimen", type = {Specimen.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Specimen used for this observation", formalDefinition="The specimen that was used when this observation was made." ) - protected Reference specimen; - - /** - * The actual object that is the target of the reference (The specimen that was used when this observation was made.) - */ - protected Specimen specimenTarget; - - /** - * The device used to generate the observation data. - */ - @Child(name = "device", type = {Device.class, DeviceMetric.class}, order=16, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="(Measurement) Device", formalDefinition="The device used to generate the observation data." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The device used to generate the observation data.) - */ - protected Resource deviceTarget; - - /** - * Guidance on how to interpret the value by comparison to a normal or recommended range. - */ - @Child(name = "referenceRange", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Provides guide for interpretation", formalDefinition="Guidance on how to interpret the value by comparison to a normal or recommended range." ) - protected List referenceRange; - - /** - * A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code. - */ - @Child(name = "related", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Resource related to this observation", formalDefinition="A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code." ) - protected List related; - - /** - * Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations. - */ - @Child(name = "component", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Component results", formalDefinition="Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations." ) - protected List component; - - private static final long serialVersionUID = -1812700333L; - - /** - * Constructor - */ - public Observation() { - super(); - } - - /** - * Constructor - */ - public Observation(Enumeration status, CodeableConcept code) { - super(); - this.status = status; - this.code = code; - } - - /** - * @return {@link #identifier} (A unique identifier for the simple observation instance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier for the simple observation instance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Observation addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ObservationStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the result value.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Observation setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the result value. - */ - public ObservationStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the result value. - */ - public Observation setStatus(ObservationStatus value) { - if (this.status == null) - this.status = new Enumeration(new ObservationStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #category} (A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes.) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes.) - */ - public Observation setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #code} (Describes what was observed. Sometimes this is called the observation "name".) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Describes what was observed. Sometimes this is called the observation "name".) - */ - public Observation setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Observation setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.) - */ - public Observation setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) - */ - public Observation setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.) - */ - public Observation setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #effective} (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 Type getEffective() { - return this.effective; - } - - /** - * @return {@link #effective} (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 DateTimeType getEffectiveDateTimeType() throws FHIRException { - if (!(this.effective instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (DateTimeType) this.effective; - } - - public boolean hasEffectiveDateTimeType() { - return this.effective instanceof DateTimeType; - } - - /** - * @return {@link #effective} (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 Period getEffectivePeriod() throws FHIRException { - if (!(this.effective instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.effective.getClass().getName()+" was encountered"); - return (Period) this.effective; - } - - public boolean hasEffectivePeriod() { - return this.effective instanceof Period; - } - - public boolean hasEffective() { - return this.effective != null && !this.effective.isEmpty(); - } - - /** - * @param value {@link #effective} (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 setEffective(Type value) { - this.effective = value; - return this; - } - - /** - * @return {@link #issued} (The date and time this observation was made available to providers, typically after the results have been reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public InstantType getIssuedElement() { - if (this.issued == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.issued"); - else if (Configuration.doAutoCreate()) - this.issued = new InstantType(); // bb - return this.issued; - } - - public boolean hasIssuedElement() { - return this.issued != null && !this.issued.isEmpty(); - } - - public boolean hasIssued() { - return this.issued != null && !this.issued.isEmpty(); - } - - /** - * @param value {@link #issued} (The date and time this observation was made available to providers, typically after the results have been reviewed and verified.). This is the underlying object with id, value and extensions. The accessor "getIssued" gives direct access to the value - */ - public Observation setIssuedElement(InstantType value) { - this.issued = value; - return this; - } - - /** - * @return The date and time this observation was made available to providers, typically after the results have been reviewed and verified. - */ - public Date getIssued() { - return this.issued == null ? null : this.issued.getValue(); - } - - /** - * @param value The date and time this observation was made available to providers, typically after the results have been reviewed and verified. - */ - public Observation setIssued(Date value) { - if (value == null) - this.issued = null; - else { - if (this.issued == null) - this.issued = new InstantType(); - this.issued.setValue(value); - } - return this; - } - - /** - * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Who was responsible for asserting the observed value as "true".) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public Observation addPerformer(Reference t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Who was responsible for asserting the observed value as "true".) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Quantity getValueQuantity() throws FHIRException { - if (!(this.value instanceof Quantity)) - throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - public boolean hasValueQuantity() { - return this.value instanceof Quantity; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public CodeableConcept getValueCodeableConcept() throws FHIRException { - if (!(this.value instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - public boolean hasValueCodeableConcept() { - return this.value instanceof CodeableConcept; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Range getValueRange() throws FHIRException { - if (!(this.value instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - public boolean hasValueRange() { - return this.value instanceof Range; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Ratio getValueRatio() throws FHIRException { - if (!(this.value instanceof Ratio)) - throw new FHIRException("Type mismatch: the type Ratio was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Ratio) this.value; - } - - public boolean hasValueRatio() { - return this.value instanceof Ratio; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public SampledData getValueSampledData() throws FHIRException { - if (!(this.value instanceof SampledData)) - throw new FHIRException("Type mismatch: the type SampledData was expected, but "+this.value.getClass().getName()+" was encountered"); - return (SampledData) this.value; - } - - public boolean hasValueSampledData() { - return this.value instanceof SampledData; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Attachment getValueAttachment() throws FHIRException { - if (!(this.value instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - public boolean hasValueAttachment() { - return this.value instanceof Attachment; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public TimeType getValueTimeType() throws FHIRException { - if (!(this.value instanceof TimeType)) - throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - public boolean hasValueTimeType() { - return this.value instanceof TimeType; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public DateTimeType getValueDateTimeType() throws FHIRException { - if (!(this.value instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - public boolean hasValueDateTimeType() { - return this.value instanceof DateTimeType; - } - - /** - * @return {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Period getValuePeriod() throws FHIRException { - if (!(this.value instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Period) this.value; - } - - public boolean hasValuePeriod() { - return this.value instanceof Period; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The information determined as a result of making the observation, if the information has a simple value.) - */ - public Observation setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) - */ - public CodeableConcept getDataAbsentReason() { - if (this.dataAbsentReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.dataAbsentReason"); - else if (Configuration.doAutoCreate()) - this.dataAbsentReason = new CodeableConcept(); // cc - return this.dataAbsentReason; - } - - public boolean hasDataAbsentReason() { - return this.dataAbsentReason != null && !this.dataAbsentReason.isEmpty(); - } - - /** - * @param value {@link #dataAbsentReason} (Provides a reason why the expected value in the element Observation.value[x] is missing.) - */ - public Observation setDataAbsentReason(CodeableConcept value) { - this.dataAbsentReason = value; - return this; - } - - /** - * @return {@link #interpretation} (The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.) - */ - public CodeableConcept getInterpretation() { - if (this.interpretation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.interpretation"); - else if (Configuration.doAutoCreate()) - this.interpretation = new CodeableConcept(); // cc - return this.interpretation; - } - - public boolean hasInterpretation() { - return this.interpretation != null && !this.interpretation.isEmpty(); - } - - /** - * @param value {@link #interpretation} (The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.) - */ - public Observation setInterpretation(CodeableConcept value) { - this.interpretation = value; - return this; - } - - /** - * @return {@link #comment} (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.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (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.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Observation setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return 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 String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value 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 setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #bodySite} (Indicates the site on the subject's body where the observation was made (i.e. the target site).) - */ - public CodeableConcept getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new CodeableConcept(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Indicates the site on the subject's body where the observation was made (i.e. the target site).) - */ - public Observation setBodySite(CodeableConcept value) { - this.bodySite = value; - return this; - } - - /** - * @return {@link #method} (Indicates the mechanism used to perform the observation.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (Indicates the mechanism used to perform the observation.) - */ - public Observation setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #specimen} (The specimen that was used when this observation was made.) - */ - public Reference getSpecimen() { - if (this.specimen == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.specimen"); - else if (Configuration.doAutoCreate()) - this.specimen = new Reference(); // cc - return this.specimen; - } - - public boolean hasSpecimen() { - return this.specimen != null && !this.specimen.isEmpty(); - } - - /** - * @param value {@link #specimen} (The specimen that was used when this observation was made.) - */ - public Observation setSpecimen(Reference value) { - this.specimen = value; - return this; - } - - /** - * @return {@link #specimen} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.) - */ - public Specimen getSpecimenTarget() { - if (this.specimenTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.specimen"); - else if (Configuration.doAutoCreate()) - this.specimenTarget = new Specimen(); // aa - return this.specimenTarget; - } - - /** - * @param value {@link #specimen} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The specimen that was used when this observation was made.) - */ - public Observation setSpecimenTarget(Specimen value) { - this.specimenTarget = value; - return this; - } - - /** - * @return {@link #device} (The device used to generate the observation data.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Observation.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The device used to generate the observation data.) - */ - public Observation setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.) - */ - public Resource getDeviceTarget() { - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device used to generate the observation data.) - */ - public Observation setDeviceTarget(Resource value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - public List getReferenceRange() { - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - return this.referenceRange; - } - - public boolean hasReferenceRange() { - if (this.referenceRange == null) - return false; - for (ObservationReferenceRangeComponent item : this.referenceRange) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referenceRange} (Guidance on how to interpret the value by comparison to a normal or recommended range.) - */ - // syntactic sugar - public ObservationReferenceRangeComponent addReferenceRange() { //3 - ObservationReferenceRangeComponent t = new ObservationReferenceRangeComponent(); - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return t; - } - - // syntactic sugar - public Observation addReferenceRange(ObservationReferenceRangeComponent t) { //3 - if (t == null) - return this; - if (this.referenceRange == null) - this.referenceRange = new ArrayList(); - this.referenceRange.add(t); - return this; - } - - /** - * @return {@link #related} (A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code.) - */ - public List getRelated() { - if (this.related == null) - this.related = new ArrayList(); - return this.related; - } - - public boolean hasRelated() { - if (this.related == null) - return false; - for (ObservationRelatedComponent item : this.related) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #related} (A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code.) - */ - // syntactic sugar - public ObservationRelatedComponent addRelated() { //3 - ObservationRelatedComponent t = new ObservationRelatedComponent(); - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return t; - } - - // syntactic sugar - public Observation addRelated(ObservationRelatedComponent t) { //3 - if (t == null) - return this; - if (this.related == null) - this.related = new ArrayList(); - this.related.add(t); - return this; - } - - /** - * @return {@link #component} (Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.) - */ - public List getComponent() { - if (this.component == null) - this.component = new ArrayList(); - return this.component; - } - - public boolean hasComponent() { - if (this.component == null) - return false; - for (ObservationComponentComponent item : this.component) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #component} (Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.) - */ - // syntactic sugar - public ObservationComponentComponent addComponent() { //3 - ObservationComponentComponent t = new ObservationComponentComponent(); - if (this.component == null) - this.component = new ArrayList(); - this.component.add(t); - return t; - } - - // syntactic sugar - public Observation addComponent(ObservationComponentComponent t) { //3 - if (t == null) - return this; - if (this.component == null) - this.component = new ArrayList(); - this.component.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the simple observation instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "The status of the result value.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the general type of observation being made. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "Describes what was observed. Sometimes this is called the observation \"name\".", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Location)", "The patient, or group of patients, location, or device whose characteristics (direct or indirect) are described by the observation and into whose record the observation is placed. Comments: Indirect characteristics may be those of a specimen, fetus, donor, other observer (for example a relative or EMT), or any observation made about the subject.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("effective[x]", "dateTime|Period", "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.", 0, java.lang.Integer.MAX_VALUE, effective)); - childrenList.add(new Property("issued", "instant", "The date and time this observation was made available to providers, typically after the results have been reviewed and verified.", 0, java.lang.Integer.MAX_VALUE, issued)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "Who was responsible for asserting the observed value as \"true\".", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("value[x]", "Quantity|CodeableConcept|string|Range|Ratio|SampledData|Attachment|time|dateTime|Period", "The information determined as a result of making the observation, if the information has a simple value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("dataAbsentReason", "CodeableConcept", "Provides a reason why the expected value in the element Observation.value[x] is missing.", 0, java.lang.Integer.MAX_VALUE, dataAbsentReason)); - childrenList.add(new Property("interpretation", "CodeableConcept", "The assessment made based on the result of the observation. Intended as a simple compact code often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result. Otherwise known as abnormal flag.", 0, java.lang.Integer.MAX_VALUE, interpretation)); - childrenList.add(new Property("comment", "string", "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.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the site on the subject's body where the observation was made (i.e. the target site).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("method", "CodeableConcept", "Indicates the mechanism used to perform the observation.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "The specimen that was used when this observation was made.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("device", "Reference(Device|DeviceMetric)", "The device used to generate the observation data.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("referenceRange", "", "Guidance on how to interpret the value by comparison to a normal or recommended range.", 0, java.lang.Integer.MAX_VALUE, referenceRange)); - childrenList.add(new Property("related", "", "A reference to another resource (usually another Observation but could also be a QuestionnaireAnswer) whose relationship is defined by the relationship type code.", 0, java.lang.Integer.MAX_VALUE, related)); - childrenList.add(new Property("component", "", "Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.", 0, java.lang.Integer.MAX_VALUE, component)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -1468651097: /*effective*/ return this.effective == null ? new Base[0] : new Base[] {this.effective}; // Type - case -1179159893: /*issued*/ return this.issued == null ? new Base[0] : new Base[] {this.issued}; // InstantType - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - case 1034315687: /*dataAbsentReason*/ return this.dataAbsentReason == null ? new Base[0] : new Base[] {this.dataAbsentReason}; // CodeableConcept - case -297950712: /*interpretation*/ return this.interpretation == null ? new Base[0] : new Base[] {this.interpretation}; // CodeableConcept - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference - case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference - case -1912545102: /*referenceRange*/ return this.referenceRange == null ? new Base[0] : this.referenceRange.toArray(new Base[this.referenceRange.size()]); // ObservationReferenceRangeComponent - case 1090493483: /*related*/ return this.related == null ? new Base[0] : this.related.toArray(new Base[this.related.size()]); // ObservationRelatedComponent - case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // ObservationComponentComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -892481550: // status - this.status = new ObservationStatusEnumFactory().fromType(value); // Enumeration - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -1468651097: // effective - this.effective = (Type) value; // Type - break; - case -1179159893: // issued - this.issued = castToInstant(value); // InstantType - break; - case 481140686: // performer - this.getPerformer().add(castToReference(value)); // Reference - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - case 1034315687: // dataAbsentReason - this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept - break; - case -297950712: // interpretation - this.interpretation = castToCodeableConcept(value); // CodeableConcept - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - case 1702620169: // bodySite - this.bodySite = castToCodeableConcept(value); // CodeableConcept - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case -2132868344: // specimen - this.specimen = castToReference(value); // Reference - break; - case -1335157162: // device - this.device = castToReference(value); // Reference - break; - case -1912545102: // referenceRange - this.getReferenceRange().add((ObservationReferenceRangeComponent) value); // ObservationReferenceRangeComponent - break; - case 1090493483: // related - this.getRelated().add((ObservationRelatedComponent) value); // ObservationRelatedComponent - break; - case -1399907075: // component - this.getComponent().add((ObservationComponentComponent) value); // ObservationComponentComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("status")) - this.status = new ObservationStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("effective[x]")) - this.effective = (Type) value; // Type - else if (name.equals("issued")) - this.issued = castToInstant(value); // InstantType - else if (name.equals("performer")) - this.getPerformer().add(castToReference(value)); - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else if (name.equals("dataAbsentReason")) - this.dataAbsentReason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("interpretation")) - this.interpretation = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else if (name.equals("bodySite")) - this.bodySite = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("specimen")) - this.specimen = castToReference(value); // Reference - else if (name.equals("device")) - this.device = castToReference(value); // Reference - else if (name.equals("referenceRange")) - this.getReferenceRange().add((ObservationReferenceRangeComponent) value); - else if (name.equals("related")) - this.getRelated().add((ObservationRelatedComponent) value); - else if (name.equals("component")) - this.getComponent().add((ObservationComponentComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 50511102: return getCategory(); // CodeableConcept - case 3059181: return getCode(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case 1524132147: return getEncounter(); // Reference - case 247104889: return getEffective(); // Type - case -1179159893: throw new FHIRException("Cannot make property issued as it is not a complex type"); // InstantType - case 481140686: return addPerformer(); // Reference - case -1410166417: return getValue(); // Type - case 1034315687: return getDataAbsentReason(); // CodeableConcept - case -297950712: return getInterpretation(); // CodeableConcept - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - case 1702620169: return getBodySite(); // CodeableConcept - case -1077554975: return getMethod(); // CodeableConcept - case -2132868344: return getSpecimen(); // Reference - case -1335157162: return getDevice(); // Reference - case -1912545102: return addReferenceRange(); // ObservationReferenceRangeComponent - case 1090493483: return addRelated(); // ObservationRelatedComponent - case -1399907075: return addComponent(); // ObservationComponentComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Observation.status"); - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("effectiveDateTime")) { - this.effective = new DateTimeType(); - return this.effective; - } - else if (name.equals("effectivePeriod")) { - this.effective = new Period(); - return this.effective; - } - else if (name.equals("issued")) { - throw new FHIRException("Cannot call addChild on a primitive type Observation.issued"); - } - else if (name.equals("performer")) { - return addPerformer(); - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("valueRatio")) { - this.value = new Ratio(); - return this.value; - } - else if (name.equals("valueSampledData")) { - this.value = new SampledData(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else if (name.equals("dataAbsentReason")) { - this.dataAbsentReason = new CodeableConcept(); - return this.dataAbsentReason; - } - else if (name.equals("interpretation")) { - this.interpretation = new CodeableConcept(); - return this.interpretation; - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type Observation.comment"); - } - else if (name.equals("bodySite")) { - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("specimen")) { - this.specimen = new Reference(); - return this.specimen; - } - else if (name.equals("device")) { - this.device = new Reference(); - return this.device; - } - else if (name.equals("referenceRange")) { - return addReferenceRange(); - } - else if (name.equals("related")) { - return addRelated(); - } - else if (name.equals("component")) { - return addComponent(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Observation"; - - } - - public Observation copy() { - Observation dst = new Observation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.status = status == null ? null : status.copy(); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.effective = effective == null ? null : effective.copy(); - dst.issued = issued == null ? null : issued.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.value = value == null ? null : value.copy(); - dst.dataAbsentReason = dataAbsentReason == null ? null : dataAbsentReason.copy(); - dst.interpretation = interpretation == null ? null : interpretation.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - dst.method = method == null ? null : method.copy(); - dst.specimen = specimen == null ? null : specimen.copy(); - dst.device = device == null ? null : device.copy(); - if (referenceRange != null) { - dst.referenceRange = new ArrayList(); - for (ObservationReferenceRangeComponent i : referenceRange) - dst.referenceRange.add(i.copy()); - }; - if (related != null) { - dst.related = new ArrayList(); - for (ObservationRelatedComponent i : related) - dst.related.add(i.copy()); - }; - if (component != null) { - dst.component = new ArrayList(); - for (ObservationComponentComponent i : component) - dst.component.add(i.copy()); - }; - return dst; - } - - protected Observation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Observation)) - return false; - Observation o = (Observation) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) - && compareDeep(code, o.code, true) && compareDeep(subject, o.subject, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(effective, o.effective, true) && compareDeep(issued, o.issued, true) && compareDeep(performer, o.performer, true) - && compareDeep(value, o.value, true) && compareDeep(dataAbsentReason, o.dataAbsentReason, true) - && compareDeep(interpretation, o.interpretation, true) && compareDeep(comment, o.comment, true) - && compareDeep(bodySite, o.bodySite, true) && compareDeep(method, o.method, true) && compareDeep(specimen, o.specimen, true) - && compareDeep(device, o.device, true) && compareDeep(referenceRange, o.referenceRange, true) && compareDeep(related, o.related, true) - && compareDeep(component, o.component, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Observation)) - return false; - Observation o = (Observation) other; - return compareValues(status, o.status, true) && compareValues(issued, o.issued, true) && compareValues(comment, o.comment, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) && (subject == null || subject.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (effective == null || effective.isEmpty()) - && (issued == null || issued.isEmpty()) && (performer == null || performer.isEmpty()) && (value == null || value.isEmpty()) - && (dataAbsentReason == null || dataAbsentReason.isEmpty()) && (interpretation == null || interpretation.isEmpty()) - && (comment == null || comment.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (method == null || method.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (device == null || device.isEmpty()) && (referenceRange == null || referenceRange.isEmpty()) - && (related == null || related.isEmpty()) && (component == null || component.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Observation; - } - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Observation:subject").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Healthcare event related to the observation
- * Type: reference
- * Path: Observation.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Observation.encounter", description="Healthcare event related to the observation", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Healthcare event related to the observation
- * Type: reference
- * Path: Observation.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Observation:encounter").toLocked(); - - /** - * Search parameter: date - *

- * Description: Obtained date/time. If the obtained element is a period, a date that falls in the period
- * Type: date
- * Path: Observation.effective[x]
- *

- */ - @SearchParamDefinition(name="date", path="Observation.effective", 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.effective[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: component-value-quantity - *

- * Description: The value of the component 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.component.valueQuantity
- *

- */ - @SearchParamDefinition(name="component-value-quantity", path="Observation.component.value.as(Quantity)", description="The value of the component 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_COMPONENT_VALUE_QUANTITY = "component-value-quantity"; - /** - * Fluent Client search parameter constant for component-value-quantity - *

- * Description: The value of the component 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.component.valueQuantity
- *

- */ - public static final ca.uhn.fhir.rest.gclient.QuantityClientParam COMPONENT_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_COMPONENT_VALUE_QUANTITY); - - /** - * Search parameter: related - *

- * Description: Related Observations - search on related-type and related-target together
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="related", path="", description="Related Observations - search on related-type and related-target together", type="composite", compositeOf={"related-target", "related-type"} ) - public static final String SP_RELATED = "related"; - /** - * Fluent Client search parameter constant for related - *

- * Description: Related Observations - search on related-type and related-target together
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam RELATED = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_RELATED); - - /** - * Search parameter: patient - *

- * Description: The subject that the observation is about (if patient)
- * Type: reference
- * Path: Observation.subject
- *

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

- * Description: The subject that the observation is about (if patient)
- * Type: reference
- * Path: Observation.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Observation:patient").toLocked(); - - /** - * Search parameter: specimen - *

- * Description: Specimen used for this observation
- * Type: reference
- * Path: Observation.specimen
- *

- */ - @SearchParamDefinition(name="specimen", path="Observation.specimen", description="Specimen used for this observation", type="reference" ) - public static final String SP_SPECIMEN = "specimen"; - /** - * Fluent Client search parameter constant for specimen - *

- * Description: Specimen used for this observation
- * Type: reference
- * Path: Observation.specimen
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SPECIMEN = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SPECIMEN); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation:specimen". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SPECIMEN = new ca.uhn.fhir.model.api.Include("Observation:specimen").toLocked(); - - /** - * Search parameter: component-value-concept - *

- * Description: The value of the component observation, if the value is a CodeableConcept
- * Type: token
- * Path: Observation.component.valueCodeableConcept
- *

- */ - @SearchParamDefinition(name="component-value-concept", path="Observation.component.value.as(CodeableConcept)", description="The value of the component observation, if the value is a CodeableConcept", type="token" ) - public static final String SP_COMPONENT_VALUE_CONCEPT = "component-value-concept"; - /** - * Fluent Client search parameter constant for component-value-concept - *

- * Description: The value of the component observation, if the value is a CodeableConcept
- * Type: token
- * Path: Observation.component.valueCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_VALUE_CONCEPT); - - /** - * Search parameter: component-code-value-quantity - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="component-code-value-quantity", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-quantity"} ) - public static final String SP_COMPONENT_CODE_VALUE_QUANTITY = "component-code-value-quantity"; - /** - * Fluent Client search parameter constant for component-code-value-quantity - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_QUANTITY); - - /** - * Search parameter: component-code-value-date - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="component-code-value-date", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-date"} ) - public static final String SP_COMPONENT_CODE_VALUE_DATE = "component-code-value-date"; - /** - * Fluent Client search parameter constant for component-code-value-date - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_DATE); - - /** - * Search parameter: component-code-value-string - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="component-code-value-string", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-string"} ) - public static final String SP_COMPONENT_CODE_VALUE_STRING = "component-code-value-string"; - /** - * Fluent Client search parameter constant for component-code-value-string - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_STRING); - - /** - * Search parameter: component-code-value-concept - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="component-code-value-concept", path="", description="Both component code and one of the component value parameters", type="composite", compositeOf={"component-code", "value-concept"} ) - public static final String SP_COMPONENT_CODE_VALUE_CONCEPT = "component-code-value-concept"; - /** - * Fluent Client search parameter constant for component-code-value-concept - *

- * Description: Both component code and one of the component value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COMPONENT_CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COMPONENT_CODE_VALUE_CONCEPT); - - /** - * Search parameter: 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.valueQuantity
- *

- */ - @SearchParamDefinition(name="value-quantity", path="Observation.value.as(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" ) - 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.valueQuantity
- *

- */ - public static final ca.uhn.fhir.rest.gclient.QuantityClientParam VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_VALUE_QUANTITY); - - /** - * Search parameter: value-date - *

- * Description: The value of the observation, if the value is a date or period of time
- * Type: date
- * Path: Observation.valueDateTime, Observation.valuePeriod
- *

- */ - @SearchParamDefinition(name="value-date", path="Observation.value.as(DateTime) | Observation.value.as(Period)", description="The value of the observation, if the value is a date or period of time", 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 date or period of time
- * Type: date
- * Path: Observation.valueDateTime, Observation.valuePeriod
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam VALUE_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_VALUE_DATE); - - /** - * Search parameter: value-string - *

- * Description: The value of the observation, if the value is a string, and also searches in CodeableConcept.text
- * Type: string
- * Path: Observation.valueString
- *

- */ - @SearchParamDefinition(name="value-string", path="Observation.value.as(String)", 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.valueString
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VALUE_STRING = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VALUE_STRING); - - /** - * Search parameter: component-code - *

- * Description: The component code of the observation type
- * Type: token
- * Path: Observation.component.code
- *

- */ - @SearchParamDefinition(name="component-code", path="Observation.component.code", description="The component code of the observation type", type="token" ) - public static final String SP_COMPONENT_CODE = "component-code"; - /** - * Fluent Client search parameter constant for component-code - *

- * Description: The component code of the observation type
- * Type: token
- * Path: Observation.component.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_CODE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: value-concept - *

- * Description: The value of the observation, if the value is a CodeableConcept
- * Type: token
- * Path: Observation.valueCodeableConcept
- *

- */ - @SearchParamDefinition(name="value-concept", path="Observation.value.as(CodeableConcept)", 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.valueCodeableConcept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VALUE_CONCEPT); - - /** - * Search parameter: code - *

- * Description: The code of the observation type
- * Type: token
- * Path: Observation.code
- *

- */ - @SearchParamDefinition(name="code", path="Observation.code", description="The code of the observation type", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: The code of the observation type
- * Type: token
- * Path: Observation.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: related-target - *

- * Description: Resource that is related to this one
- * Type: reference
- * Path: Observation.related.target
- *

- */ - @SearchParamDefinition(name="related-target", path="Observation.related.target", description="Resource that is related to this one", type="reference" ) - public static final String SP_RELATED_TARGET = "related-target"; - /** - * Fluent Client search parameter constant for related-target - *

- * Description: Resource that is related to this one
- * Type: reference
- * Path: Observation.related.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATED_TARGET = new ca.uhn.fhir.rest.gclient.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 ca.uhn.fhir.model.api.Include INCLUDE_RELATED_TARGET = new ca.uhn.fhir.model.api.Include("Observation:related-target").toLocked(); - - /** - * Search parameter: data-absent-reason - *

- * Description: The reason why the expected value in the element Observation.value[x] is missing.
- * Type: token
- * Path: Observation.dataAbsentReason
- *

- */ - @SearchParamDefinition(name="data-absent-reason", path="Observation.dataAbsentReason", description="The reason why the expected value in the element Observation.value[x] is missing.", type="token" ) - public static final String SP_DATA_ABSENT_REASON = "data-absent-reason"; - /** - * Fluent Client search parameter constant for data-absent-reason - *

- * Description: The reason why the expected value in the element Observation.value[x] is missing.
- * Type: token
- * Path: Observation.dataAbsentReason
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DATA_ABSENT_REASON); - - /** - * Search parameter: category - *

- * Description: The classification of the type of observation
- * Type: token
- * Path: Observation.category
- *

- */ - @SearchParamDefinition(name="category", path="Observation.category", description="The classification of the type of observation", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: The classification of the type of observation
- * Type: token
- * Path: Observation.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: component-data-absent-reason - *

- * Description: The reason why the expected value in the element Observation.component.value[x] is missing.
- * Type: token
- * Path: Observation.component.dataAbsentReason
- *

- */ - @SearchParamDefinition(name="component-data-absent-reason", path="Observation.component.dataAbsentReason", description="The reason why the expected value in the element Observation.component.value[x] is missing.", type="token" ) - public static final String SP_COMPONENT_DATA_ABSENT_REASON = "component-data-absent-reason"; - /** - * Fluent Client search parameter constant for component-data-absent-reason - *

- * Description: The reason why the expected value in the element Observation.component.value[x] is missing.
- * Type: token
- * Path: Observation.component.dataAbsentReason
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMPONENT_DATA_ABSENT_REASON = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMPONENT_DATA_ABSENT_REASON); - - /** - * Search parameter: device - *

- * Description: The Device that generated the observation data.
- * Type: reference
- * Path: Observation.device
- *

- */ - @SearchParamDefinition(name="device", path="Observation.device", description="The Device that generated the observation data.", type="reference" ) - public static final String SP_DEVICE = "device"; - /** - * Fluent Client search parameter constant for device - *

- * Description: The Device that generated the observation data.
- * Type: reference
- * Path: Observation.device
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DEVICE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DEVICE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation:device". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DEVICE = new ca.uhn.fhir.model.api.Include("Observation:device").toLocked(); - - /** - * Search parameter: related-type - *

- * Description: has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by
- * Type: token
- * Path: Observation.related.type
- *

- */ - @SearchParamDefinition(name="related-type", path="Observation.related.type", description="has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by", type="token" ) - public static final String SP_RELATED_TYPE = "related-type"; - /** - * Fluent Client search parameter constant for related-type - *

- * Description: has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by
- * Type: token
- * Path: Observation.related.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RELATED_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RELATED_TYPE); - - /** - * Search parameter: performer - *

- * Description: Who performed the observation
- * Type: reference
- * Path: Observation.performer
- *

- */ - @SearchParamDefinition(name="performer", path="Observation.performer", description="Who performed the observation", type="reference" ) - public static final String SP_PERFORMER = "performer"; - /** - * Fluent Client search parameter constant for performer - *

- * Description: Who performed the observation
- * Type: reference
- * Path: Observation.performer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Observation:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Observation:performer").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The unique id for a particular observation
- * Type: token
- * Path: Observation.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Observation.identifier", description="The unique id for a particular observation", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The unique id for a particular observation
- * Type: token
- * Path: Observation.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: code-value-quantity - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-quantity", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-quantity"} ) - public static final String SP_CODE_VALUE_QUANTITY = "code-value-quantity"; - /** - * Fluent Client search parameter constant for code-value-quantity - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_QUANTITY = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_QUANTITY); - - /** - * Search parameter: code-value-date - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-date", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-date"} ) - public static final String SP_CODE_VALUE_DATE = "code-value-date"; - /** - * Fluent Client search parameter constant for code-value-date - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_DATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_DATE); - - /** - * Search parameter: code-value-string - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-string", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-string"} ) - public static final String SP_CODE_VALUE_STRING = "code-value-string"; - /** - * Fluent Client search parameter constant for code-value-string - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_STRING = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_STRING); - - /** - * Search parameter: code-value-concept - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="code-value-concept", path="", description="Both code and one of the value parameters", type="composite", compositeOf={"code", "value-concept"} ) - public static final String SP_CODE_VALUE_CONCEPT = "code-value-concept"; - /** - * Fluent Client search parameter constant for code-value-concept - *

- * Description: Both code and one of the value parameters
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam CODE_VALUE_CONCEPT = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_CODE_VALUE_CONCEPT); - - /** - * Search parameter: component-value-string - *

- * Description: The value of the component observation, if the value is a string, and also searches in CodeableConcept.text
- * Type: string
- * Path: Observation.component.valueString
- *

- */ - @SearchParamDefinition(name="component-value-string", path="Observation.component.value.as(String)", description="The value of the component observation, if the value is a string, and also searches in CodeableConcept.text", type="string" ) - public static final String SP_COMPONENT_VALUE_STRING = "component-value-string"; - /** - * Fluent Client search parameter constant for component-value-string - *

- * Description: The value of the component observation, if the value is a string, and also searches in CodeableConcept.text
- * Type: string
- * Path: Observation.component.valueString
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam COMPONENT_VALUE_STRING = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_COMPONENT_VALUE_STRING); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OidType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OidType.java deleted file mode 100644 index 89fdda65a98..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OidType.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -package org.hl7.fhir.dstu2016may.model; - -import java.net.URI; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "oid" in FHIR: an OID represented as urn:oid:0.1.2.3.4... - */ -@DatatypeDef(name="oid", profileOf=UriType.class) -public class OidType extends UriType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public OidType() { - super(); - } - - /** - * Constructor - */ - public OidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public OidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public OidType copy() { - return new OidType(getValue()); - } - - public String fhirType() { - return "oid"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OperationDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OperationDefinition.java deleted file mode 100644 index 175e2992bc0..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OperationDefinition.java +++ /dev/null @@ -1,3169 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength; -import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType; -import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search interaction). - */ -@ResourceDef(name="OperationDefinition", profile="http://hl7.org/fhir/Profile/OperationDefinition") -public class OperationDefinition extends DomainResource { - - public enum OperationKind { - /** - * This operation is invoked as an operation. - */ - OPERATION, - /** - * This operation is a named query, invoked using the search mechanism. - */ - QUERY, - /** - * added to help the parsers - */ - NULL; - public static OperationKind fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("operation".equals(codeString)) - return OPERATION; - if ("query".equals(codeString)) - return QUERY; - throw new FHIRException("Unknown OperationKind code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OPERATION: return "operation"; - case QUERY: return "query"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OPERATION: return "http://hl7.org/fhir/operation-kind"; - case QUERY: return "http://hl7.org/fhir/operation-kind"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OPERATION: return "This operation is invoked as an operation."; - case QUERY: return "This operation is a named query, invoked using the search mechanism."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OPERATION: return "Operation"; - case QUERY: return "Query"; - default: return "?"; - } - } - } - - public static class OperationKindEnumFactory implements EnumFactory { - public OperationKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("operation".equals(codeString)) - return OperationKind.OPERATION; - if ("query".equals(codeString)) - return OperationKind.QUERY; - throw new IllegalArgumentException("Unknown OperationKind code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("operation".equals(codeString)) - return new Enumeration(this, OperationKind.OPERATION); - if ("query".equals(codeString)) - return new Enumeration(this, OperationKind.QUERY); - throw new FHIRException("Unknown OperationKind code '"+codeString+"'"); - } - public String toCode(OperationKind code) { - if (code == OperationKind.OPERATION) - return "operation"; - if (code == OperationKind.QUERY) - return "query"; - return "?"; - } - public String toSystem(OperationKind code) { - return code.getSystem(); - } - } - - public enum OperationParameterUse { - /** - * This is an input parameter. - */ - IN, - /** - * This is an output parameter. - */ - OUT, - /** - * added to help the parsers - */ - NULL; - public static OperationParameterUse fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in".equals(codeString)) - return IN; - if ("out".equals(codeString)) - return OUT; - throw new FHIRException("Unknown OperationParameterUse code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case IN: return "http://hl7.org/fhir/operation-parameter-use"; - case OUT: return "http://hl7.org/fhir/operation-parameter-use"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case IN: return "This is an input parameter."; - case OUT: return "This is an output parameter."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case IN: return "In"; - case OUT: return "Out"; - default: return "?"; - } - } - } - - public static class OperationParameterUseEnumFactory implements EnumFactory { - public OperationParameterUse fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in".equals(codeString)) - return OperationParameterUse.IN; - if ("out".equals(codeString)) - return OperationParameterUse.OUT; - throw new IllegalArgumentException("Unknown OperationParameterUse code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in".equals(codeString)) - return new Enumeration(this, OperationParameterUse.IN); - if ("out".equals(codeString)) - return new Enumeration(this, OperationParameterUse.OUT); - throw new FHIRException("Unknown OperationParameterUse code '"+codeString+"'"); - } - public String toCode(OperationParameterUse code) { - if (code == OperationParameterUse.IN) - return "in"; - if (code == OperationParameterUse.OUT) - return "out"; - return "?"; - } - public String toSystem(OperationParameterUse code) { - return code.getSystem(); - } - } - - @Block() - public static class OperationDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the operation definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the operation definition." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public OperationDefinitionContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the operation definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinitionContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the operation definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the operation definition. - */ - public OperationDefinitionContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public OperationDefinitionContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the operation definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public OperationDefinitionContactComponent copy() { - OperationDefinitionContactComponent dst = new OperationDefinitionContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinitionContactComponent)) - return false; - OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinitionContactComponent)) - return false; - OperationDefinitionContactComponent o = (OperationDefinitionContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "OperationDefinition.contact"; - - } - - } - - @Block() - public static class OperationDefinitionParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of used to identify the parameter. - */ - @Child(name = "name", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name in Parameters.parameter.name or in URL", formalDefinition="The name of used to identify the parameter." ) - protected CodeType name; - - /** - * Whether this is an input or an output parameter. - */ - @Child(name = "use", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="in | out", formalDefinition="Whether this is an input or an output parameter." ) - protected Enumeration use; - - /** - * The minimum number of times this parameter SHALL appear in the request or response. - */ - @Child(name = "min", type = {IntegerType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Minimum Cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) - protected IntegerType min; - - /** - * The maximum number of times this element is permitted to appear in the request or response. - */ - @Child(name = "max", type = {StringType.class}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Maximum Cardinality (a number or *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) - protected StringType max; - - /** - * Describes the meaning or use of this parameter. - */ - @Child(name = "documentation", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description of meaning/use", formalDefinition="Describes the meaning or use of this parameter." ) - protected StringType documentation; - - /** - * The type for this parameter. - */ - @Child(name = "type", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="What type this parameter has", formalDefinition="The type for this parameter." ) - protected CodeType type; - - /** - * How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. - */ - @Child(name = "searchType", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'." ) - protected Enumeration searchType; - - /** - * A profile the specifies the rules that this parameter must conform to. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Profile on the type", formalDefinition="A profile the specifies the rules that this parameter must conform to." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (A profile the specifies the rules that this parameter must conform to.) - */ - protected StructureDefinition profileTarget; - - /** - * Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). - */ - @Child(name = "binding", type = {}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="ValueSet details if this is coded", formalDefinition="Binds to a value set if this parameter is coded (code, Coding, CodeableConcept)." ) - protected OperationDefinitionParameterBindingComponent binding; - - /** - * The parts of a Tuple Parameter. - */ - @Child(name = "part", type = {OperationDefinitionParameterComponent.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Parts of a Tuple Parameter", formalDefinition="The parts of a Tuple Parameter." ) - protected List part; - - private static final long serialVersionUID = -885506257L; - - /** - * Constructor - */ - public OperationDefinitionParameterComponent() { - super(); - } - - /** - * Constructor - */ - public OperationDefinitionParameterComponent(CodeType name, Enumeration use, IntegerType min, StringType max) { - super(); - this.name = name; - this.use = use; - this.min = min; - this.max = max; - } - - /** - * @return {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of used to identify the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinitionParameterComponent setNameElement(CodeType value) { - this.name = value; - return this; - } - - /** - * @return The name of used to identify the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of used to identify the parameter. - */ - public OperationDefinitionParameterComponent setName(String value) { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public Enumeration getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Enumeration(new OperationParameterUseEnumFactory()); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Whether this is an input or an output parameter.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public OperationDefinitionParameterComponent setUseElement(Enumeration value) { - this.use = value; - return this; - } - - /** - * @return Whether this is an input or an output parameter. - */ - public OperationParameterUse getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Whether this is an input or an output parameter. - */ - public OperationDefinitionParameterComponent setUse(OperationParameterUse value) { - if (this.use == null) - this.use = new Enumeration(new OperationParameterUseEnumFactory()); - this.use.setValue(value); - return this; - } - - /** - * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public IntegerType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.min"); - else if (Configuration.doAutoCreate()) - this.min = new IntegerType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public OperationDefinitionParameterComponent setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this parameter SHALL appear in the request or response. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value The minimum number of times this parameter SHALL appear in the request or response. - */ - public OperationDefinitionParameterComponent setMin(int value) { - if (this.min == null) - this.min = new IntegerType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public OperationDefinitionParameterComponent setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the request or response. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value The maximum number of times this element is permitted to appear in the request or response. - */ - public OperationDefinitionParameterComponent setMax(String value) { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Describes the meaning or use of this parameter.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public OperationDefinitionParameterComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Describes the meaning or use of this parameter. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Describes the meaning or use of this parameter. - */ - public OperationDefinitionParameterComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type for this parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public OperationDefinitionParameterComponent setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type for this parameter. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type for this parameter. - */ - public OperationDefinitionParameterComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #searchType} (How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.). This is the underlying object with id, value and extensions. The accessor "getSearchType" gives direct access to the value - */ - public Enumeration getSearchTypeElement() { - if (this.searchType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.searchType"); - else if (Configuration.doAutoCreate()) - this.searchType = new Enumeration(new SearchParamTypeEnumFactory()); // bb - return this.searchType; - } - - public boolean hasSearchTypeElement() { - return this.searchType != null && !this.searchType.isEmpty(); - } - - public boolean hasSearchType() { - return this.searchType != null && !this.searchType.isEmpty(); - } - - /** - * @param value {@link #searchType} (How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.). This is the underlying object with id, value and extensions. The accessor "getSearchType" gives direct access to the value - */ - public OperationDefinitionParameterComponent setSearchTypeElement(Enumeration value) { - this.searchType = value; - return this; - } - - /** - * @return How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. - */ - public SearchParamType getSearchType() { - return this.searchType == null ? null : this.searchType.getValue(); - } - - /** - * @param value How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. - */ - public OperationDefinitionParameterComponent setSearchType(SearchParamType value) { - if (value == null) - this.searchType = null; - else { - if (this.searchType == null) - this.searchType = new Enumeration(new SearchParamTypeEnumFactory()); - this.searchType.setValue(value); - } - return this; - } - - /** - * @return {@link #profile} (A profile the specifies the rules that this parameter must conform to.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (A profile the specifies the rules that this parameter must conform to.) - */ - public OperationDefinitionParameterComponent setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A profile the specifies the rules that this parameter must conform to.) - */ - public OperationDefinitionParameterComponent setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - /** - * @return {@link #binding} (Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).) - */ - public OperationDefinitionParameterBindingComponent getBinding() { - if (this.binding == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterComponent.binding"); - else if (Configuration.doAutoCreate()) - this.binding = new OperationDefinitionParameterBindingComponent(); // cc - return this.binding; - } - - public boolean hasBinding() { - return this.binding != null && !this.binding.isEmpty(); - } - - /** - * @param value {@link #binding} (Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).) - */ - public OperationDefinitionParameterComponent setBinding(OperationDefinitionParameterBindingComponent value) { - this.binding = value; - return this; - } - - /** - * @return {@link #part} (The parts of a Tuple Parameter.) - */ - public List getPart() { - if (this.part == null) - this.part = new ArrayList(); - return this.part; - } - - public boolean hasPart() { - if (this.part == null) - return false; - for (OperationDefinitionParameterComponent item : this.part) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #part} (The parts of a Tuple Parameter.) - */ - // syntactic sugar - public OperationDefinitionParameterComponent addPart() { //3 - OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return t; - } - - // syntactic sugar - public OperationDefinitionParameterComponent addPart(OperationDefinitionParameterComponent t) { //3 - if (t == null) - return this; - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "code", "The name of used to identify the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("use", "code", "Whether this is an input or an output parameter.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("documentation", "string", "Describes the meaning or use of this parameter.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("type", "code", "The type for this parameter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("searchType", "code", "How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'.", 0, java.lang.Integer.MAX_VALUE, searchType)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "A profile the specifies the rules that this parameter must conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("binding", "", "Binds to a value set if this parameter is coded (code, Coding, CodeableConcept).", 0, java.lang.Integer.MAX_VALUE, binding)); - childrenList.add(new Property("part", "@OperationDefinition.parameter", "The parts of a Tuple Parameter.", 0, java.lang.Integer.MAX_VALUE, part)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Enumeration - case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType - case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -710454014: /*searchType*/ return this.searchType == null ? new Base[0] : new Base[] {this.searchType}; // Enumeration - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - case -108220795: /*binding*/ return this.binding == null ? new Base[0] : new Base[] {this.binding}; // OperationDefinitionParameterBindingComponent - case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // OperationDefinitionParameterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToCode(value); // CodeType - break; - case 116103: // use - this.use = new OperationParameterUseEnumFactory().fromType(value); // Enumeration - break; - case 108114: // min - this.min = castToInteger(value); // IntegerType - break; - case 107876: // max - this.max = castToString(value); // StringType - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -710454014: // searchType - this.searchType = new SearchParamTypeEnumFactory().fromType(value); // Enumeration - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - case -108220795: // binding - this.binding = (OperationDefinitionParameterBindingComponent) value; // OperationDefinitionParameterBindingComponent - break; - case 3433459: // part - this.getPart().add((OperationDefinitionParameterComponent) value); // OperationDefinitionParameterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = new OperationParameterUseEnumFactory().fromType(value); // Enumeration - else if (name.equals("min")) - this.min = castToInteger(value); // IntegerType - else if (name.equals("max")) - this.max = castToString(value); // StringType - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("searchType")) - this.searchType = new SearchParamTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else if (name.equals("binding")) - this.binding = (OperationDefinitionParameterBindingComponent) value; // OperationDefinitionParameterBindingComponent - else if (name.equals("part")) - this.getPart().add((OperationDefinitionParameterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // CodeType - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // Enumeration - case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType - case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -710454014: throw new FHIRException("Cannot make property searchType as it is not a complex type"); // Enumeration - case -309425751: return getProfile(); // Reference - case -108220795: return getBinding(); // OperationDefinitionParameterBindingComponent - case 3433459: return addPart(); // OperationDefinitionParameterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name"); - } - else if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.use"); - } - else if (name.equals("min")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.min"); - } - else if (name.equals("max")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.max"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.documentation"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.type"); - } - else if (name.equals("searchType")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.searchType"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else if (name.equals("binding")) { - this.binding = new OperationDefinitionParameterBindingComponent(); - return this.binding; - } - else if (name.equals("part")) { - return addPart(); - } - else - return super.addChild(name); - } - - public OperationDefinitionParameterComponent copy() { - OperationDefinitionParameterComponent dst = new OperationDefinitionParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.use = use == null ? null : use.copy(); - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.type = type == null ? null : type.copy(); - dst.searchType = searchType == null ? null : searchType.copy(); - dst.profile = profile == null ? null : profile.copy(); - dst.binding = binding == null ? null : binding.copy(); - if (part != null) { - dst.part = new ArrayList(); - for (OperationDefinitionParameterComponent i : part) - dst.part.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinitionParameterComponent)) - return false; - OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) - && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) - && compareDeep(searchType, o.searchType, true) && compareDeep(profile, o.profile, true) && compareDeep(binding, o.binding, true) - && compareDeep(part, o.part, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinitionParameterComponent)) - return false; - OperationDefinitionParameterComponent o = (OperationDefinitionParameterComponent) other; - return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) - && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) - && compareValues(searchType, o.searchType, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) - && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (type == null || type.isEmpty()) && (searchType == null || searchType.isEmpty()) && (profile == null || profile.isEmpty()) - && (binding == null || binding.isEmpty()) && (part == null || part.isEmpty()); - } - - public String fhirType() { - return "OperationDefinition.parameter"; - - } - - } - - @Block() - public static class OperationDefinitionParameterBindingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - @Child(name = "strength", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="required | extensible | preferred | example", formalDefinition="Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances." ) - protected Enumeration strength; - - /** - * Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used. - */ - @Child(name = "valueSet", type = {UriType.class, ValueSet.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Source of value set", formalDefinition="Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used." ) - protected Type valueSet; - - private static final long serialVersionUID = 857140521L; - - /** - * Constructor - */ - public OperationDefinitionParameterBindingComponent() { - super(); - } - - /** - * Constructor - */ - public OperationDefinitionParameterBindingComponent(Enumeration strength, Type valueSet) { - super(); - this.strength = strength; - this.valueSet = valueSet; - } - - /** - * @return {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value - */ - public Enumeration getStrengthElement() { - if (this.strength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinitionParameterBindingComponent.strength"); - else if (Configuration.doAutoCreate()) - this.strength = new Enumeration(new BindingStrengthEnumFactory()); // bb - return this.strength; - } - - public boolean hasStrengthElement() { - return this.strength != null && !this.strength.isEmpty(); - } - - public boolean hasStrength() { - return this.strength != null && !this.strength.isEmpty(); - } - - /** - * @param value {@link #strength} (Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.). This is the underlying object with id, value and extensions. The accessor "getStrength" gives direct access to the value - */ - public OperationDefinitionParameterBindingComponent setStrengthElement(Enumeration value) { - this.strength = value; - return this; - } - - /** - * @return Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - public BindingStrength getStrength() { - return this.strength == null ? null : this.strength.getValue(); - } - - /** - * @param value Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances. - */ - public OperationDefinitionParameterBindingComponent setStrength(BindingStrength value) { - if (this.strength == null) - this.strength = new Enumeration(new BindingStrengthEnumFactory()); - this.strength.setValue(value); - return this; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public Type getValueSet() { - return this.valueSet; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public UriType getValueSetUriType() throws FHIRException { - if (!(this.valueSet instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (UriType) this.valueSet; - } - - public boolean hasValueSetUriType() { - return this.valueSet instanceof UriType; - } - - /** - * @return {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public Reference getValueSetReference() throws FHIRException { - if (!(this.valueSet instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.valueSet.getClass().getName()+" was encountered"); - return (Reference) this.valueSet; - } - - public boolean hasValueSetReference() { - return this.valueSet instanceof Reference; - } - - public boolean hasValueSet() { - return this.valueSet != null && !this.valueSet.isEmpty(); - } - - /** - * @param value {@link #valueSet} (Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.) - */ - public OperationDefinitionParameterBindingComponent setValueSet(Type value) { - this.valueSet = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("strength", "code", "Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the provided value set must be adhered to in the instances.", 0, java.lang.Integer.MAX_VALUE, strength)); - childrenList.add(new Property("valueSet[x]", "uri|Reference(ValueSet)", "Points to the value set or external definition (e.g. implicit value set) that identifies the set of codes to be used.", 0, java.lang.Integer.MAX_VALUE, valueSet)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1791316033: /*strength*/ return this.strength == null ? new Base[0] : new Base[] {this.strength}; // Enumeration - case -1410174671: /*valueSet*/ return this.valueSet == null ? new Base[0] : new Base[] {this.valueSet}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1791316033: // strength - this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration - break; - case -1410174671: // valueSet - this.valueSet = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("strength")) - this.strength = new BindingStrengthEnumFactory().fromType(value); // Enumeration - else if (name.equals("valueSet[x]")) - this.valueSet = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1791316033: throw new FHIRException("Cannot make property strength as it is not a complex type"); // Enumeration - case -1438410321: return getValueSet(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("strength")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.strength"); - } - else if (name.equals("valueSetUri")) { - this.valueSet = new UriType(); - return this.valueSet; - } - else if (name.equals("valueSetReference")) { - this.valueSet = new Reference(); - return this.valueSet; - } - else - return super.addChild(name); - } - - public OperationDefinitionParameterBindingComponent copy() { - OperationDefinitionParameterBindingComponent dst = new OperationDefinitionParameterBindingComponent(); - copyValues(dst); - dst.strength = strength == null ? null : strength.copy(); - dst.valueSet = valueSet == null ? null : valueSet.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinitionParameterBindingComponent)) - return false; - OperationDefinitionParameterBindingComponent o = (OperationDefinitionParameterBindingComponent) other; - return compareDeep(strength, o.strength, true) && compareDeep(valueSet, o.valueSet, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinitionParameterBindingComponent)) - return false; - OperationDefinitionParameterBindingComponent o = (OperationDefinitionParameterBindingComponent) other; - return compareValues(strength, o.strength, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (strength == null || strength.isEmpty()) && (valueSet == null || valueSet.isEmpty()) - ; - } - - public String fhirType() { - return "OperationDefinition.parameter.binding"; - - } - - } - - /** - * An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Logical URL to reference this operation definition", formalDefinition="An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published." ) - protected UriType url; - - /** - * The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Logical id for this version of the operation definition", formalDefinition="The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name identifying the operation. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Informal name for this operation", formalDefinition="A free text natural language name identifying the operation." ) - protected StringType name; - - /** - * The status of the profile. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the profile." ) - protected Enumeration status; - - /** - * Whether this is an operation or a named query. - */ - @Child(name = "kind", type = {CodeType.class}, order=4, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="operation | query", formalDefinition="Whether this is an operation or a named query." ) - protected Enumeration kind; - - /** - * This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Date for this version of the operation definition", formalDefinition="The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes." ) - protected DateTimeType date; - - /** - * The name of the individual or organization that published the operation definition. - */ - @Child(name = "publisher", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the operation definition." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * A free text natural language description of the profile and its use. - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Natural language description of the operation", formalDefinition="A free text natural language description of the profile and its use." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions." ) - protected List useContext; - - /** - * Explains why this operation definition is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why this resource has been created", formalDefinition="Explains why this operation definition is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. - */ - @Child(name = "idempotent", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether content is unchanged by the operation", formalDefinition="Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST." ) - protected BooleanType idempotent; - - /** - * The name used to invoke the operation. - */ - @Child(name = "code", type = {CodeType.class}, order=13, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name used to invoke the operation", formalDefinition="The name used to invoke the operation." ) - protected CodeType code; - - /** - * Additional information about how to use this operation or named query. - */ - @Child(name = "comment", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additional information about use", formalDefinition="Additional information about how to use this operation or named query." ) - protected StringType comment; - - /** - * Indicates that this operation definition is a constraining profile on the base. - */ - @Child(name = "base", type = {OperationDefinition.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Marks this as a profile of the base", formalDefinition="Indicates that this operation definition is a constraining profile on the base." ) - protected Reference base; - - /** - * The actual object that is the target of the reference (Indicates that this operation definition is a constraining profile on the base.) - */ - protected OperationDefinition baseTarget; - - /** - * Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). - */ - @Child(name = "system", type = {BooleanType.class}, order=16, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Invoke at the system level?", formalDefinition="Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context)." ) - protected BooleanType system; - - /** - * Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context). - */ - @Child(name = "type", type = {CodeType.class}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Invoke at resource level for these type", formalDefinition="Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context)." ) - protected List type; - - /** - * Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - @Child(name = "instance", type = {BooleanType.class}, order=18, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Invoke on an instance?", formalDefinition="Indicates whether this operation can be invoked on a particular instance of one of the given types." ) - protected BooleanType instance; - - /** - * The parameters for the operation/query. - */ - @Child(name = "parameter", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Parameters for the operation/query", formalDefinition="The parameters for the operation/query." ) - protected List parameter; - - private static final long serialVersionUID = 1780846105L; - - /** - * Constructor - */ - public OperationDefinition() { - super(); - } - - /** - * Constructor - */ - public OperationDefinition(StringType name, Enumeration status, Enumeration kind, CodeType code, BooleanType system, BooleanType instance) { - super(); - this.name = name; - this.status = status; - this.kind = kind; - this.code = code; - this.system = system; - this.instance = instance; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public OperationDefinition setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published. - */ - public OperationDefinition setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public OperationDefinition setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public OperationDefinition setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the operation.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public OperationDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the operation. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the operation. - */ - public OperationDefinition setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the profile.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public OperationDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the profile. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the profile. - */ - public OperationDefinition setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #kind} (Whether this is an operation or a named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new OperationKindEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Whether this is an operation or a named query.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public OperationDefinition setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Whether this is an operation or a named query. - */ - public OperationKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Whether this is an operation or a named query. - */ - public OperationDefinition setKind(OperationKind value) { - if (this.kind == null) - this.kind = new Enumeration(new OperationKindEnumFactory()); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public OperationDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public OperationDefinition setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public OperationDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes. - */ - public OperationDefinition setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the operation definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public OperationDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the operation definition. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the operation definition. - */ - public OperationDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (OperationDefinitionContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public OperationDefinitionContactComponent addContact() { //3 - OperationDefinitionContactComponent t = new OperationDefinitionContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public OperationDefinition addContact(OperationDefinitionContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the profile and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public OperationDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the profile and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the profile and its use. - */ - public OperationDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public OperationDefinition addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this operation definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public OperationDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this operation definition is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this operation definition is needed and why it's been constrained as it has. - */ - public OperationDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value - */ - public BooleanType getIdempotentElement() { - if (this.idempotent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.idempotent"); - else if (Configuration.doAutoCreate()) - this.idempotent = new BooleanType(); // bb - return this.idempotent; - } - - public boolean hasIdempotentElement() { - return this.idempotent != null && !this.idempotent.isEmpty(); - } - - public boolean hasIdempotent() { - return this.idempotent != null && !this.idempotent.isEmpty(); - } - - /** - * @param value {@link #idempotent} (Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.). This is the underlying object with id, value and extensions. The accessor "getIdempotent" gives direct access to the value - */ - public OperationDefinition setIdempotentElement(BooleanType value) { - this.idempotent = value; - return this; - } - - /** - * @return Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. - */ - public boolean getIdempotent() { - return this.idempotent == null || this.idempotent.isEmpty() ? false : this.idempotent.getValue(); - } - - /** - * @param value Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST. - */ - public OperationDefinition setIdempotent(boolean value) { - if (this.idempotent == null) - this.idempotent = new BooleanType(); - this.idempotent.setValue(value); - return this; - } - - /** - * @return {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The name used to invoke the operation.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OperationDefinition setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return The name used to invoke the operation. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The name used to invoke the operation. - */ - public OperationDefinition setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #comment} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Additional information about how to use this operation or named query.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public OperationDefinition setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Additional information about how to use this operation or named query. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Additional information about how to use this operation or named query. - */ - public OperationDefinition setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #base} (Indicates that this operation definition is a constraining profile on the base.) - */ - public Reference getBase() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.base"); - else if (Configuration.doAutoCreate()) - this.base = new Reference(); // cc - return this.base; - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition setBase(Reference value) { - this.base = value; - return this; - } - - /** - * @return {@link #base} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition getBaseTarget() { - if (this.baseTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.base"); - else if (Configuration.doAutoCreate()) - this.baseTarget = new OperationDefinition(); // aa - return this.baseTarget; - } - - /** - * @param value {@link #base} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates that this operation definition is a constraining profile on the base.) - */ - public OperationDefinition setBaseTarget(OperationDefinition value) { - this.baseTarget = value; - return this; - } - - /** - * @return {@link #system} (Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public BooleanType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.system"); - else if (Configuration.doAutoCreate()) - this.system = new BooleanType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public OperationDefinition setSystemElement(BooleanType value) { - this.system = value; - return this; - } - - /** - * @return Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). - */ - public boolean getSystem() { - return this.system == null || this.system.isEmpty() ? false : this.system.getValue(); - } - - /** - * @param value Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context). - */ - public OperationDefinition setSystem(boolean value) { - if (this.system == null) - this.system = new BooleanType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (CodeType item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - // syntactic sugar - public CodeType addTypeElement() {//2 - CodeType t = new CodeType(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - /** - * @param value {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - public OperationDefinition addType(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @param value {@link #type} (Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).) - */ - public boolean hasType(String value) { - if (this.type == null) - return false; - for (CodeType v : this.type) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value - */ - public BooleanType getInstanceElement() { - if (this.instance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationDefinition.instance"); - else if (Configuration.doAutoCreate()) - this.instance = new BooleanType(); // bb - return this.instance; - } - - public boolean hasInstanceElement() { - return this.instance != null && !this.instance.isEmpty(); - } - - public boolean hasInstance() { - return this.instance != null && !this.instance.isEmpty(); - } - - /** - * @param value {@link #instance} (Indicates whether this operation can be invoked on a particular instance of one of the given types.). This is the underlying object with id, value and extensions. The accessor "getInstance" gives direct access to the value - */ - public OperationDefinition setInstanceElement(BooleanType value) { - this.instance = value; - return this; - } - - /** - * @return Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - public boolean getInstance() { - return this.instance == null || this.instance.isEmpty() ? false : this.instance.getValue(); - } - - /** - * @param value Indicates whether this operation can be invoked on a particular instance of one of the given types. - */ - public OperationDefinition setInstance(boolean value) { - if (this.instance == null) - this.instance = new BooleanType(); - this.instance.setValue(value); - return this; - } - - /** - * @return {@link #parameter} (The parameters for the operation/query.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (OperationDefinitionParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (The parameters for the operation/query.) - */ - // syntactic sugar - public OperationDefinitionParameterComponent addParameter() { //3 - OperationDefinitionParameterComponent t = new OperationDefinitionParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public OperationDefinition addParameter(OperationDefinitionParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this operation definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this operation definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the profile when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the operation.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the profile.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("kind", "code", "Whether this is an operation or a named query.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("experimental", "boolean", "This profile was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date this version of the operation definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the Operation Definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the operation definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("description", "string", "A free text natural language description of the profile and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of operation definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this operation definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("idempotent", "boolean", "Operations that are idempotent (see [HTTP specification definition of idempotent](http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html)) may be invoked by performing an HTTP GET operation instead of a POST.", 0, java.lang.Integer.MAX_VALUE, idempotent)); - childrenList.add(new Property("code", "code", "The name used to invoke the operation.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("comment", "string", "Additional information about how to use this operation or named query.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("base", "Reference(OperationDefinition)", "Indicates that this operation definition is a constraining profile on the base.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("system", "boolean", "Indicates whether this operation or named query can be invoked at the system level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("type", "code", "Indicates whether this operation or named query can be invoked at the resource type level for any given resource type level (e.g. without needing to choose a resource type for the context).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("instance", "boolean", "Indicates whether this operation can be invoked on a particular instance of one of the given types.", 0, java.lang.Integer.MAX_VALUE, instance)); - childrenList.add(new Property("parameter", "", "The parameters for the operation/query.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // OperationDefinitionContactComponent - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1680468793: /*idempotent*/ return this.idempotent == null ? new Base[0] : new Base[] {this.idempotent}; // BooleanType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Reference - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // BooleanType - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // CodeType - case 555127957: /*instance*/ return this.instance == null ? new Base[0] : new Base[] {this.instance}; // BooleanType - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // OperationDefinitionParameterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case 3292052: // kind - this.kind = new OperationKindEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((OperationDefinitionContactComponent) value); // OperationDefinitionContactComponent - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1680468793: // idempotent - this.idempotent = castToBoolean(value); // BooleanType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - case 3016401: // base - this.base = castToReference(value); // Reference - break; - case -887328209: // system - this.system = castToBoolean(value); // BooleanType - break; - case 3575610: // type - this.getType().add(castToCode(value)); // CodeType - break; - case 555127957: // instance - this.instance = castToBoolean(value); // BooleanType - break; - case 1954460585: // parameter - this.getParameter().add((OperationDefinitionParameterComponent) value); // OperationDefinitionParameterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("kind")) - this.kind = new OperationKindEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((OperationDefinitionContactComponent) value); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("idempotent")) - this.idempotent = castToBoolean(value); // BooleanType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else if (name.equals("base")) - this.base = castToReference(value); // Reference - else if (name.equals("system")) - this.system = castToBoolean(value); // BooleanType - else if (name.equals("type")) - this.getType().add(castToCode(value)); - else if (name.equals("instance")) - this.instance = castToBoolean(value); // BooleanType - else if (name.equals("parameter")) - this.getParameter().add((OperationDefinitionParameterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // OperationDefinitionContactComponent - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1680468793: throw new FHIRException("Cannot make property idempotent as it is not a complex type"); // BooleanType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - case 3016401: return getBase(); // Reference - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // BooleanType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case 555127957: throw new FHIRException("Cannot make property instance as it is not a complex type"); // BooleanType - case 1954460585: return addParameter(); // OperationDefinitionParameterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.url"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.status"); - } - else if (name.equals("kind")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.kind"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.experimental"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.date"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.requirements"); - } - else if (name.equals("idempotent")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.idempotent"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.code"); - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.comment"); - } - else if (name.equals("base")) { - this.base = new Reference(); - return this.base; - } - else if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.system"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.type"); - } - else if (name.equals("instance")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationDefinition.instance"); - } - else if (name.equals("parameter")) { - return addParameter(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "OperationDefinition"; - - } - - public OperationDefinition copy() { - OperationDefinition dst = new OperationDefinition(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (OperationDefinitionContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.idempotent = idempotent == null ? null : idempotent.copy(); - dst.code = code == null ? null : code.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.base = base == null ? null : base.copy(); - dst.system = system == null ? null : system.copy(); - if (type != null) { - dst.type = new ArrayList(); - for (CodeType i : type) - dst.type.add(i.copy()); - }; - dst.instance = instance == null ? null : instance.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (OperationDefinitionParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - protected OperationDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationDefinition)) - return false; - OperationDefinition o = (OperationDefinition) other; - return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) - && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) - && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(idempotent, o.idempotent, true) - && compareDeep(code, o.code, true) && compareDeep(comment, o.comment, true) && compareDeep(base, o.base, true) - && compareDeep(system, o.system, true) && compareDeep(type, o.type, true) && compareDeep(instance, o.instance, true) - && compareDeep(parameter, o.parameter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationDefinition)) - return false; - OperationDefinition o = (OperationDefinition) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(kind, o.kind, true) && compareValues(experimental, o.experimental, true) - && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(description, o.description, true) - && compareValues(requirements, o.requirements, true) && compareValues(idempotent, o.idempotent, true) - && compareValues(code, o.code, true) && compareValues(comment, o.comment, true) && compareValues(system, o.system, true) - && compareValues(type, o.type, true) && compareValues(instance, o.instance, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (kind == null || kind.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (description == null || description.isEmpty()) - && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (idempotent == null || idempotent.isEmpty()) && (code == null || code.isEmpty()) && (comment == null || comment.isEmpty()) - && (base == null || base.isEmpty()) && (system == null || system.isEmpty()) && (type == null || type.isEmpty()) - && (instance == null || instance.isEmpty()) && (parameter == null || parameter.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OperationDefinition; - } - - /** - * Search parameter: status - *

- * Description: draft | active | retired
- * Type: token
- * Path: OperationDefinition.status
- *

- */ - @SearchParamDefinition(name="status", path="OperationDefinition.status", description="draft | active | retired", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: draft | active | retired
- * Type: token
- * Path: OperationDefinition.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: paramprofile - *

- * Description: Profile on the type
- * Type: reference
- * Path: OperationDefinition.parameter.profile
- *

- */ - @SearchParamDefinition(name="paramprofile", path="OperationDefinition.parameter.profile", description="Profile on the type", type="reference" ) - public static final String SP_PARAMPROFILE = "paramprofile"; - /** - * Fluent Client search parameter constant for paramprofile - *

- * Description: Profile on the type
- * Type: reference
- * Path: OperationDefinition.parameter.profile
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARAMPROFILE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARAMPROFILE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OperationDefinition:paramprofile". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARAMPROFILE = new ca.uhn.fhir.model.api.Include("OperationDefinition:paramprofile").toLocked(); - - /** - * Search parameter: code - *

- * Description: Name used to invoke the operation
- * Type: token
- * Path: OperationDefinition.code
- *

- */ - @SearchParamDefinition(name="code", path="OperationDefinition.code", description="Name used to invoke the operation", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Name used to invoke the operation
- * Type: token
- * Path: OperationDefinition.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: Date for this version of the operation definition
- * Type: date
- * Path: OperationDefinition.date
- *

- */ - @SearchParamDefinition(name="date", path="OperationDefinition.date", description="Date for this version of the operation definition", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: Date for this version of the operation definition
- * Type: date
- * Path: OperationDefinition.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: type - *

- * Description: Invoke at resource level for these type
- * Type: token
- * Path: OperationDefinition.type
- *

- */ - @SearchParamDefinition(name="type", path="OperationDefinition.type", description="Invoke at resource level for these type", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Invoke at resource level for these type
- * Type: token
- * Path: OperationDefinition.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: url - *

- * Description: Logical URL to reference this operation definition
- * Type: uri
- * Path: OperationDefinition.url
- *

- */ - @SearchParamDefinition(name="url", path="OperationDefinition.url", description="Logical URL to reference this operation definition", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Logical URL to reference this operation definition
- * Type: uri
- * Path: OperationDefinition.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: kind - *

- * Description: operation | query
- * Type: token
- * Path: OperationDefinition.kind
- *

- */ - @SearchParamDefinition(name="kind", path="OperationDefinition.kind", description="operation | query", type="token" ) - public static final String SP_KIND = "kind"; - /** - * Fluent Client search parameter constant for kind - *

- * Description: operation | query
- * Type: token
- * Path: OperationDefinition.kind
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); - - /** - * Search parameter: version - *

- * Description: Logical id for this version of the operation definition
- * Type: token
- * Path: OperationDefinition.version
- *

- */ - @SearchParamDefinition(name="version", path="OperationDefinition.version", description="Logical id for this version of the operation definition", type="token" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: Logical id for this version of the operation definition
- * Type: token
- * Path: OperationDefinition.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher (Organization or individual)
- * Type: string
- * Path: OperationDefinition.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="OperationDefinition.publisher", description="Name of the publisher (Organization or individual)", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: Name of the publisher (Organization or individual)
- * Type: string
- * Path: OperationDefinition.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: system - *

- * Description: Invoke at the system level?
- * Type: token
- * Path: OperationDefinition.system
- *

- */ - @SearchParamDefinition(name="system", path="OperationDefinition.system", description="Invoke at the system level?", type="token" ) - public static final String SP_SYSTEM = "system"; - /** - * Fluent Client search parameter constant for system - *

- * Description: Invoke at the system level?
- * Type: token
- * Path: OperationDefinition.system
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SYSTEM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SYSTEM); - - /** - * Search parameter: name - *

- * Description: Informal name for this operation
- * Type: string
- * Path: OperationDefinition.name
- *

- */ - @SearchParamDefinition(name="name", path="OperationDefinition.name", description="Informal name for this operation", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Informal name for this operation
- * Type: string
- * Path: OperationDefinition.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the operation definition
- * Type: token
- * Path: OperationDefinition.useContext
- *

- */ - @SearchParamDefinition(name="context", path="OperationDefinition.useContext", description="A use context assigned to the operation definition", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the operation definition
- * Type: token
- * Path: OperationDefinition.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: base - *

- * Description: Marks this as a profile of the base
- * Type: reference
- * Path: OperationDefinition.base
- *

- */ - @SearchParamDefinition(name="base", path="OperationDefinition.base", description="Marks this as a profile of the base", type="reference" ) - public static final String SP_BASE = "base"; - /** - * Fluent Client search parameter constant for base - *

- * Description: Marks this as a profile of the base
- * Type: reference
- * Path: OperationDefinition.base
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OperationDefinition:base". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_BASE = new ca.uhn.fhir.model.api.Include("OperationDefinition:base").toLocked(); - - /** - * Search parameter: instance - *

- * Description: Invoke on an instance?
- * Type: token
- * Path: OperationDefinition.instance
- *

- */ - @SearchParamDefinition(name="instance", path="OperationDefinition.instance", description="Invoke on an instance?", type="token" ) - public static final String SP_INSTANCE = "instance"; - /** - * Fluent Client search parameter constant for instance - *

- * Description: Invoke on an instance?
- * Type: token
- * Path: OperationDefinition.instance
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam INSTANCE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_INSTANCE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OperationOutcome.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OperationOutcome.java deleted file mode 100644 index f301fabee3c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OperationOutcome.java +++ /dev/null @@ -1,1344 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.instance.model.api.IBaseOperationOutcome; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A collection of error, warning or information messages that result from a system action. - */ -@ResourceDef(name="OperationOutcome", profile="http://hl7.org/fhir/Profile/OperationOutcome") -public class OperationOutcome extends DomainResource implements IBaseOperationOutcome { - - public enum IssueSeverity { - /** - * The issue caused the action to fail, and no further checking could be performed. - */ - FATAL, - /** - * The issue is sufficiently important to cause the action to fail. - */ - ERROR, - /** - * The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired. - */ - WARNING, - /** - * The issue has no relation to the degree of success of the action. - */ - INFORMATION, - /** - * added to help the parsers - */ - NULL; - public static IssueSeverity fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("fatal".equals(codeString)) - return FATAL; - if ("error".equals(codeString)) - return ERROR; - if ("warning".equals(codeString)) - return WARNING; - if ("information".equals(codeString)) - return INFORMATION; - throw new FHIRException("Unknown IssueSeverity code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case FATAL: return "fatal"; - case ERROR: return "error"; - case WARNING: return "warning"; - case INFORMATION: return "information"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FATAL: return "http://hl7.org/fhir/issue-severity"; - case ERROR: return "http://hl7.org/fhir/issue-severity"; - case WARNING: return "http://hl7.org/fhir/issue-severity"; - case INFORMATION: return "http://hl7.org/fhir/issue-severity"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FATAL: return "The issue caused the action to fail, and no further checking could be performed."; - case ERROR: return "The issue is sufficiently important to cause the action to fail."; - case WARNING: return "The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or in a way that is not as desired."; - case INFORMATION: return "The issue has no relation to the degree of success of the action."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FATAL: return "Fatal"; - case ERROR: return "Error"; - case WARNING: return "Warning"; - case INFORMATION: return "Information"; - default: return "?"; - } - } - } - - public static class IssueSeverityEnumFactory implements EnumFactory { - public IssueSeverity fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("fatal".equals(codeString)) - return IssueSeverity.FATAL; - if ("error".equals(codeString)) - return IssueSeverity.ERROR; - if ("warning".equals(codeString)) - return IssueSeverity.WARNING; - if ("information".equals(codeString)) - return IssueSeverity.INFORMATION; - throw new IllegalArgumentException("Unknown IssueSeverity code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("fatal".equals(codeString)) - return new Enumeration(this, IssueSeverity.FATAL); - if ("error".equals(codeString)) - return new Enumeration(this, IssueSeverity.ERROR); - if ("warning".equals(codeString)) - return new Enumeration(this, IssueSeverity.WARNING); - if ("information".equals(codeString)) - return new Enumeration(this, IssueSeverity.INFORMATION); - throw new FHIRException("Unknown IssueSeverity code '"+codeString+"'"); - } - public String toCode(IssueSeverity code) { - if (code == IssueSeverity.FATAL) - return "fatal"; - if (code == IssueSeverity.ERROR) - return "error"; - if (code == IssueSeverity.WARNING) - return "warning"; - if (code == IssueSeverity.INFORMATION) - return "information"; - return "?"; - } - public String toSystem(IssueSeverity code) { - return code.getSystem(); - } - } - - public enum IssueType { - /** - * Content invalid against the specification or a profile. - */ - INVALID, - /** - * A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax. - */ - STRUCTURE, - /** - * A required element is missing. - */ - REQUIRED, - /** - * An element value is invalid. - */ - VALUE, - /** - * A content validation rule failed - e.g. a schematron rule. - */ - INVARIANT, - /** - * An authentication/authorization/permissions issue of some kind. - */ - SECURITY, - /** - * The client needs to initiate an authentication process. - */ - LOGIN, - /** - * The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable). - */ - UNKNOWN, - /** - * User session expired; a login may be required. - */ - EXPIRED, - /** - * The user does not have the rights to perform this action. - */ - FORBIDDEN, - /** - * Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes. - */ - SUPPRESSED, - /** - * Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged. - */ - PROCESSING, - /** - * The resource or profile is not supported. - */ - NOTSUPPORTED, - /** - * An attempt was made to create a duplicate record. - */ - DUPLICATE, - /** - * The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture. - */ - NOTFOUND, - /** - * Provided content is too long (typically, this is a denial of service protection type of error). - */ - TOOLONG, - /** - * The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code. - */ - CODEINVALID, - /** - * An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized. - */ - EXTENSION, - /** - * The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT. - */ - TOOCOSTLY, - /** - * The content/operation failed to pass some business rule, and so could not proceed. - */ - BUSINESSRULE, - /** - * Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture.) - */ - CONFLICT, - /** - * Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete. - */ - INCOMPLETE, - /** - * Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved. - */ - TRANSIENT, - /** - * A resource/record locking failure (usually in an underlying database). - */ - LOCKERROR, - /** - * The persistent store is unavailable; e.g. the database is down for maintenance or similar action. - */ - NOSTORE, - /** - * An unexpected internal error has occurred. - */ - EXCEPTION, - /** - * An internal timeout has occurred. - */ - TIMEOUT, - /** - * The system is not prepared to handle this request due to load management. - */ - THROTTLED, - /** - * A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.). - */ - INFORMATIONAL, - /** - * added to help the parsers - */ - NULL; - public static IssueType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("invalid".equals(codeString)) - return INVALID; - if ("structure".equals(codeString)) - return STRUCTURE; - if ("required".equals(codeString)) - return REQUIRED; - if ("value".equals(codeString)) - return VALUE; - if ("invariant".equals(codeString)) - return INVARIANT; - if ("security".equals(codeString)) - return SECURITY; - if ("login".equals(codeString)) - return LOGIN; - if ("unknown".equals(codeString)) - return UNKNOWN; - if ("expired".equals(codeString)) - return EXPIRED; - if ("forbidden".equals(codeString)) - return FORBIDDEN; - if ("suppressed".equals(codeString)) - return SUPPRESSED; - if ("processing".equals(codeString)) - return PROCESSING; - if ("not-supported".equals(codeString)) - return NOTSUPPORTED; - if ("duplicate".equals(codeString)) - return DUPLICATE; - if ("not-found".equals(codeString)) - return NOTFOUND; - if ("too-long".equals(codeString)) - return TOOLONG; - if ("code-invalid".equals(codeString)) - return CODEINVALID; - if ("extension".equals(codeString)) - return EXTENSION; - if ("too-costly".equals(codeString)) - return TOOCOSTLY; - if ("business-rule".equals(codeString)) - return BUSINESSRULE; - if ("conflict".equals(codeString)) - return CONFLICT; - if ("incomplete".equals(codeString)) - return INCOMPLETE; - if ("transient".equals(codeString)) - return TRANSIENT; - if ("lock-error".equals(codeString)) - return LOCKERROR; - if ("no-store".equals(codeString)) - return NOSTORE; - if ("exception".equals(codeString)) - return EXCEPTION; - if ("timeout".equals(codeString)) - return TIMEOUT; - if ("throttled".equals(codeString)) - return THROTTLED; - if ("informational".equals(codeString)) - return INFORMATIONAL; - throw new FHIRException("Unknown IssueType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INVALID: return "invalid"; - case STRUCTURE: return "structure"; - case REQUIRED: return "required"; - case VALUE: return "value"; - case INVARIANT: return "invariant"; - case SECURITY: return "security"; - case LOGIN: return "login"; - case UNKNOWN: return "unknown"; - case EXPIRED: return "expired"; - case FORBIDDEN: return "forbidden"; - case SUPPRESSED: return "suppressed"; - case PROCESSING: return "processing"; - case NOTSUPPORTED: return "not-supported"; - case DUPLICATE: return "duplicate"; - case NOTFOUND: return "not-found"; - case TOOLONG: return "too-long"; - case CODEINVALID: return "code-invalid"; - case EXTENSION: return "extension"; - case TOOCOSTLY: return "too-costly"; - case BUSINESSRULE: return "business-rule"; - case CONFLICT: return "conflict"; - case INCOMPLETE: return "incomplete"; - case TRANSIENT: return "transient"; - case LOCKERROR: return "lock-error"; - case NOSTORE: return "no-store"; - case EXCEPTION: return "exception"; - case TIMEOUT: return "timeout"; - case THROTTLED: return "throttled"; - case INFORMATIONAL: return "informational"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INVALID: return "http://hl7.org/fhir/issue-type"; - case STRUCTURE: return "http://hl7.org/fhir/issue-type"; - case REQUIRED: return "http://hl7.org/fhir/issue-type"; - case VALUE: return "http://hl7.org/fhir/issue-type"; - case INVARIANT: return "http://hl7.org/fhir/issue-type"; - case SECURITY: return "http://hl7.org/fhir/issue-type"; - case LOGIN: return "http://hl7.org/fhir/issue-type"; - case UNKNOWN: return "http://hl7.org/fhir/issue-type"; - case EXPIRED: return "http://hl7.org/fhir/issue-type"; - case FORBIDDEN: return "http://hl7.org/fhir/issue-type"; - case SUPPRESSED: return "http://hl7.org/fhir/issue-type"; - case PROCESSING: return "http://hl7.org/fhir/issue-type"; - case NOTSUPPORTED: return "http://hl7.org/fhir/issue-type"; - case DUPLICATE: return "http://hl7.org/fhir/issue-type"; - case NOTFOUND: return "http://hl7.org/fhir/issue-type"; - case TOOLONG: return "http://hl7.org/fhir/issue-type"; - case CODEINVALID: return "http://hl7.org/fhir/issue-type"; - case EXTENSION: return "http://hl7.org/fhir/issue-type"; - case TOOCOSTLY: return "http://hl7.org/fhir/issue-type"; - case BUSINESSRULE: return "http://hl7.org/fhir/issue-type"; - case CONFLICT: return "http://hl7.org/fhir/issue-type"; - case INCOMPLETE: return "http://hl7.org/fhir/issue-type"; - case TRANSIENT: return "http://hl7.org/fhir/issue-type"; - case LOCKERROR: return "http://hl7.org/fhir/issue-type"; - case NOSTORE: return "http://hl7.org/fhir/issue-type"; - case EXCEPTION: return "http://hl7.org/fhir/issue-type"; - case TIMEOUT: return "http://hl7.org/fhir/issue-type"; - case THROTTLED: return "http://hl7.org/fhir/issue-type"; - case INFORMATIONAL: return "http://hl7.org/fhir/issue-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INVALID: return "Content invalid against the specification or a profile."; - case STRUCTURE: return "A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid json syntax."; - case REQUIRED: return "A required element is missing."; - case VALUE: return "An element value is invalid."; - case INVARIANT: return "A content validation rule failed - e.g. a schematron rule."; - case SECURITY: return "An authentication/authorization/permissions issue of some kind."; - case LOGIN: return "The client needs to initiate an authentication process."; - case UNKNOWN: return "The user or system was not able to be authenticated (either there is no process, or the proferred token is unacceptable)."; - case EXPIRED: return "User session expired; a login may be required."; - case FORBIDDEN: return "The user does not have the rights to perform this action."; - case SUPPRESSED: return "Some information was not or may not have been returned due to business rules, consent or privacy rules, or access permission constraints. This information may be accessible through alternate processes."; - case PROCESSING: return "Processing issues. These are expected to be final e.g. there is no point resubmitting the same content unchanged."; - case NOTSUPPORTED: return "The resource or profile is not supported."; - case DUPLICATE: return "An attempt was made to create a duplicate record."; - case NOTFOUND: return "The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the content is not found further into the application architecture."; - case TOOLONG: return "Provided content is too long (typically, this is a denial of service protection type of error)."; - case CODEINVALID: return "The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code."; - case EXTENSION: return "An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not recognized."; - case TOOCOSTLY: return "The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED CT."; - case BUSINESSRULE: return "The content/operation failed to pass some business rule, and so could not proceed."; - case CONFLICT: return "Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further into the application architecture.)"; - case INCOMPLETE: return "Not all data sources typically accessed could be reached, or responded in time, so the returned information may not be complete."; - case TRANSIENT: return "Transient processing issues. The system receiving the error may be able to resubmit the same content once an underlying issue is resolved."; - case LOCKERROR: return "A resource/record locking failure (usually in an underlying database)."; - case NOSTORE: return "The persistent store is unavailable; e.g. the database is down for maintenance or similar action."; - case EXCEPTION: return "An unexpected internal error has occurred."; - case TIMEOUT: return "An internal timeout has occurred."; - case THROTTLED: return "The system is not prepared to handle this request due to load management."; - case INFORMATIONAL: return "A message unrelated to the processing success of the completed operation (examples of the latter include things like reminders of password expiry, system maintenance times, etc.)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INVALID: return "Invalid Content"; - case STRUCTURE: return "Structural Issue"; - case REQUIRED: return "Required element missing"; - case VALUE: return "Element value invalid"; - case INVARIANT: return "Validation rule failed"; - case SECURITY: return "Security Problem"; - case LOGIN: return "Login Required"; - case UNKNOWN: return "Unknown User"; - case EXPIRED: return "Session Expired"; - case FORBIDDEN: return "Forbidden"; - case SUPPRESSED: return "Information Suppressed"; - case PROCESSING: return "Processing Failure"; - case NOTSUPPORTED: return "Content not supported"; - case DUPLICATE: return "Duplicate"; - case NOTFOUND: return "Not Found"; - case TOOLONG: return "Content Too Long"; - case CODEINVALID: return "Invalid Code"; - case EXTENSION: return "Unacceptable Extension"; - case TOOCOSTLY: return "Operation Too Costly"; - case BUSINESSRULE: return "Business Rule Violation"; - case CONFLICT: return "Edit Version Conflict"; - case INCOMPLETE: return "Incomplete Results"; - case TRANSIENT: return "Transient Issue"; - case LOCKERROR: return "Lock Error"; - case NOSTORE: return "No Store Available"; - case EXCEPTION: return "Exception"; - case TIMEOUT: return "Timeout"; - case THROTTLED: return "Throttled"; - case INFORMATIONAL: return "Informational Note"; - default: return "?"; - } - } - } - - public static class IssueTypeEnumFactory implements EnumFactory { - public IssueType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("invalid".equals(codeString)) - return IssueType.INVALID; - if ("structure".equals(codeString)) - return IssueType.STRUCTURE; - if ("required".equals(codeString)) - return IssueType.REQUIRED; - if ("value".equals(codeString)) - return IssueType.VALUE; - if ("invariant".equals(codeString)) - return IssueType.INVARIANT; - if ("security".equals(codeString)) - return IssueType.SECURITY; - if ("login".equals(codeString)) - return IssueType.LOGIN; - if ("unknown".equals(codeString)) - return IssueType.UNKNOWN; - if ("expired".equals(codeString)) - return IssueType.EXPIRED; - if ("forbidden".equals(codeString)) - return IssueType.FORBIDDEN; - if ("suppressed".equals(codeString)) - return IssueType.SUPPRESSED; - if ("processing".equals(codeString)) - return IssueType.PROCESSING; - if ("not-supported".equals(codeString)) - return IssueType.NOTSUPPORTED; - if ("duplicate".equals(codeString)) - return IssueType.DUPLICATE; - if ("not-found".equals(codeString)) - return IssueType.NOTFOUND; - if ("too-long".equals(codeString)) - return IssueType.TOOLONG; - if ("code-invalid".equals(codeString)) - return IssueType.CODEINVALID; - if ("extension".equals(codeString)) - return IssueType.EXTENSION; - if ("too-costly".equals(codeString)) - return IssueType.TOOCOSTLY; - if ("business-rule".equals(codeString)) - return IssueType.BUSINESSRULE; - if ("conflict".equals(codeString)) - return IssueType.CONFLICT; - if ("incomplete".equals(codeString)) - return IssueType.INCOMPLETE; - if ("transient".equals(codeString)) - return IssueType.TRANSIENT; - if ("lock-error".equals(codeString)) - return IssueType.LOCKERROR; - if ("no-store".equals(codeString)) - return IssueType.NOSTORE; - if ("exception".equals(codeString)) - return IssueType.EXCEPTION; - if ("timeout".equals(codeString)) - return IssueType.TIMEOUT; - if ("throttled".equals(codeString)) - return IssueType.THROTTLED; - if ("informational".equals(codeString)) - return IssueType.INFORMATIONAL; - throw new IllegalArgumentException("Unknown IssueType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("invalid".equals(codeString)) - return new Enumeration(this, IssueType.INVALID); - if ("structure".equals(codeString)) - return new Enumeration(this, IssueType.STRUCTURE); - if ("required".equals(codeString)) - return new Enumeration(this, IssueType.REQUIRED); - if ("value".equals(codeString)) - return new Enumeration(this, IssueType.VALUE); - if ("invariant".equals(codeString)) - return new Enumeration(this, IssueType.INVARIANT); - if ("security".equals(codeString)) - return new Enumeration(this, IssueType.SECURITY); - if ("login".equals(codeString)) - return new Enumeration(this, IssueType.LOGIN); - if ("unknown".equals(codeString)) - return new Enumeration(this, IssueType.UNKNOWN); - if ("expired".equals(codeString)) - return new Enumeration(this, IssueType.EXPIRED); - if ("forbidden".equals(codeString)) - return new Enumeration(this, IssueType.FORBIDDEN); - if ("suppressed".equals(codeString)) - return new Enumeration(this, IssueType.SUPPRESSED); - if ("processing".equals(codeString)) - return new Enumeration(this, IssueType.PROCESSING); - if ("not-supported".equals(codeString)) - return new Enumeration(this, IssueType.NOTSUPPORTED); - if ("duplicate".equals(codeString)) - return new Enumeration(this, IssueType.DUPLICATE); - if ("not-found".equals(codeString)) - return new Enumeration(this, IssueType.NOTFOUND); - if ("too-long".equals(codeString)) - return new Enumeration(this, IssueType.TOOLONG); - if ("code-invalid".equals(codeString)) - return new Enumeration(this, IssueType.CODEINVALID); - if ("extension".equals(codeString)) - return new Enumeration(this, IssueType.EXTENSION); - if ("too-costly".equals(codeString)) - return new Enumeration(this, IssueType.TOOCOSTLY); - if ("business-rule".equals(codeString)) - return new Enumeration(this, IssueType.BUSINESSRULE); - if ("conflict".equals(codeString)) - return new Enumeration(this, IssueType.CONFLICT); - if ("incomplete".equals(codeString)) - return new Enumeration(this, IssueType.INCOMPLETE); - if ("transient".equals(codeString)) - return new Enumeration(this, IssueType.TRANSIENT); - if ("lock-error".equals(codeString)) - return new Enumeration(this, IssueType.LOCKERROR); - if ("no-store".equals(codeString)) - return new Enumeration(this, IssueType.NOSTORE); - if ("exception".equals(codeString)) - return new Enumeration(this, IssueType.EXCEPTION); - if ("timeout".equals(codeString)) - return new Enumeration(this, IssueType.TIMEOUT); - if ("throttled".equals(codeString)) - return new Enumeration(this, IssueType.THROTTLED); - if ("informational".equals(codeString)) - return new Enumeration(this, IssueType.INFORMATIONAL); - throw new FHIRException("Unknown IssueType code '"+codeString+"'"); - } - public String toCode(IssueType code) { - if (code == IssueType.INVALID) - return "invalid"; - if (code == IssueType.STRUCTURE) - return "structure"; - if (code == IssueType.REQUIRED) - return "required"; - if (code == IssueType.VALUE) - return "value"; - if (code == IssueType.INVARIANT) - return "invariant"; - if (code == IssueType.SECURITY) - return "security"; - if (code == IssueType.LOGIN) - return "login"; - if (code == IssueType.UNKNOWN) - return "unknown"; - if (code == IssueType.EXPIRED) - return "expired"; - if (code == IssueType.FORBIDDEN) - return "forbidden"; - if (code == IssueType.SUPPRESSED) - return "suppressed"; - if (code == IssueType.PROCESSING) - return "processing"; - if (code == IssueType.NOTSUPPORTED) - return "not-supported"; - if (code == IssueType.DUPLICATE) - return "duplicate"; - if (code == IssueType.NOTFOUND) - return "not-found"; - if (code == IssueType.TOOLONG) - return "too-long"; - if (code == IssueType.CODEINVALID) - return "code-invalid"; - if (code == IssueType.EXTENSION) - return "extension"; - if (code == IssueType.TOOCOSTLY) - return "too-costly"; - if (code == IssueType.BUSINESSRULE) - return "business-rule"; - if (code == IssueType.CONFLICT) - return "conflict"; - if (code == IssueType.INCOMPLETE) - return "incomplete"; - if (code == IssueType.TRANSIENT) - return "transient"; - if (code == IssueType.LOCKERROR) - return "lock-error"; - if (code == IssueType.NOSTORE) - return "no-store"; - if (code == IssueType.EXCEPTION) - return "exception"; - if (code == IssueType.TIMEOUT) - return "timeout"; - if (code == IssueType.THROTTLED) - return "throttled"; - if (code == IssueType.INFORMATIONAL) - return "informational"; - return "?"; - } - public String toSystem(IssueType code) { - return code.getSystem(); - } - } - - @Block() - public static class OperationOutcomeIssueComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates whether the issue indicates a variation from successful processing. - */ - @Child(name = "severity", type = {CodeType.class}, order=1, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="fatal | error | warning | information", formalDefinition="Indicates whether the issue indicates a variation from successful processing." ) - protected Enumeration severity; - - /** - * Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. - */ - @Child(name = "code", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Error or warning code", formalDefinition="Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element." ) - protected Enumeration code; - - /** - * Additional details about the error. This may be a text description of the error, or a system code that identifies the error. - */ - @Child(name = "details", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional details about the error", formalDefinition="Additional details about the error. This may be a text description of the error, or a system code that identifies the error." ) - protected CodeableConcept details; - - /** - * Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. - */ - @Child(name = "diagnostics", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional diagnostic information about the issue", formalDefinition="Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue." ) - protected StringType diagnostics; - - /** - * 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. - */ - @Child(name = "location", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List location; - - /** - * A simple FluentPath 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. - */ - @Child(name = "expression", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="FluentPath of element(s) related to issue", formalDefinition="A simple FluentPath 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." ) - protected List expression; - - private static final long serialVersionUID = -1681095438L; - - /** - * Constructor - */ - public OperationOutcomeIssueComponent() { - super(); - } - - /** - * Constructor - */ - public OperationOutcomeIssueComponent(Enumeration severity, Enumeration code) { - super(); - this.severity = severity; - this.code = code; - } - - /** - * @return {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public Enumeration getSeverityElement() { - if (this.severity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.severity"); - else if (Configuration.doAutoCreate()) - this.severity = new Enumeration(new IssueSeverityEnumFactory()); // bb - return this.severity; - } - - public boolean hasSeverityElement() { - return this.severity != null && !this.severity.isEmpty(); - } - - public boolean hasSeverity() { - return this.severity != null && !this.severity.isEmpty(); - } - - /** - * @param value {@link #severity} (Indicates whether the issue indicates a variation from successful processing.). This is the underlying object with id, value and extensions. The accessor "getSeverity" gives direct access to the value - */ - public OperationOutcomeIssueComponent setSeverityElement(Enumeration value) { - this.severity = value; - return this; - } - - /** - * @return Indicates whether the issue indicates a variation from successful processing. - */ - public IssueSeverity getSeverity() { - return this.severity == null ? null : this.severity.getValue(); - } - - /** - * @param value Indicates whether the issue indicates a variation from successful processing. - */ - public OperationOutcomeIssueComponent setSeverity(IssueSeverity value) { - if (this.severity == null) - this.severity = new Enumeration(new IssueSeverityEnumFactory()); - this.severity.setValue(value); - return this; - } - - /** - * @return {@link #code} (Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Enumeration getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new Enumeration(new IssueTypeEnumFactory()); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public OperationOutcomeIssueComponent setCodeElement(Enumeration value) { - this.code = value; - return this; - } - - /** - * @return Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. - */ - public IssueType getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element. - */ - public OperationOutcomeIssueComponent setCode(IssueType value) { - if (this.code == null) - this.code = new Enumeration(new IssueTypeEnumFactory()); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #details} (Additional details about the error. This may be a text description of the error, or a system code that identifies the error.) - */ - public CodeableConcept getDetails() { - if (this.details == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.details"); - else if (Configuration.doAutoCreate()) - this.details = new CodeableConcept(); // cc - return this.details; - } - - public boolean hasDetails() { - return this.details != null && !this.details.isEmpty(); - } - - /** - * @param value {@link #details} (Additional details about the error. This may be a text description of the error, or a system code that identifies the error.) - */ - public OperationOutcomeIssueComponent setDetails(CodeableConcept value) { - this.details = value; - return this; - } - - /** - * @return {@link #diagnostics} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDiagnostics" gives direct access to the value - */ - public StringType getDiagnosticsElement() { - if (this.diagnostics == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OperationOutcomeIssueComponent.diagnostics"); - else if (Configuration.doAutoCreate()) - this.diagnostics = new StringType(); // bb - return this.diagnostics; - } - - public boolean hasDiagnosticsElement() { - return this.diagnostics != null && !this.diagnostics.isEmpty(); - } - - public boolean hasDiagnostics() { - return this.diagnostics != null && !this.diagnostics.isEmpty(); - } - - /** - * @param value {@link #diagnostics} (Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.). This is the underlying object with id, value and extensions. The accessor "getDiagnostics" gives direct access to the value - */ - public OperationOutcomeIssueComponent setDiagnosticsElement(StringType value) { - this.diagnostics = value; - return this; - } - - /** - * @return Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. - */ - public String getDiagnostics() { - return this.diagnostics == null ? null : this.diagnostics.getValue(); - } - - /** - * @param value Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue. - */ - public OperationOutcomeIssueComponent setDiagnostics(String value) { - if (Utilities.noString(value)) - this.diagnostics = null; - else { - if (this.diagnostics == null) - this.diagnostics = new StringType(); - this.diagnostics.setValue(value); - } - return this; - } - - /** - * @return {@link #location} (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 List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (StringType item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (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.) - */ - // syntactic sugar - public StringType addLocationElement() {//2 - StringType t = new StringType(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - /** - * @param value {@link #location} (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 OperationOutcomeIssueComponent addLocation(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @param value {@link #location} (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 boolean hasLocation(String value) { - if (this.location == null) - return false; - for (StringType v : this.location) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #expression} (A simple FluentPath 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 List getExpression() { - if (this.expression == null) - this.expression = new ArrayList(); - return this.expression; - } - - public boolean hasExpression() { - if (this.expression == null) - return false; - for (StringType item : this.expression) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #expression} (A simple FluentPath 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.) - */ - // syntactic sugar - public StringType addExpressionElement() {//2 - StringType t = new StringType(); - if (this.expression == null) - this.expression = new ArrayList(); - this.expression.add(t); - return t; - } - - /** - * @param value {@link #expression} (A simple FluentPath 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 OperationOutcomeIssueComponent addExpression(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.expression == null) - this.expression = new ArrayList(); - this.expression.add(t); - return this; - } - - /** - * @param value {@link #expression} (A simple FluentPath 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 boolean hasExpression(String value) { - if (this.expression == null) - return false; - for (StringType v : this.expression) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("severity", "code", "Indicates whether the issue indicates a variation from successful processing.", 0, java.lang.Integer.MAX_VALUE, severity)); - childrenList.add(new Property("code", "code", "Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable code from the IssueType value set, and may additional provide its own code for the error in the details element.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("details", "CodeableConcept", "Additional details about the error. This may be a text description of the error, or a system code that identifies the error.", 0, java.lang.Integer.MAX_VALUE, details)); - childrenList.add(new Property("diagnostics", "string", "Additional diagnostic information about the issue. Typically, this may be a description of how a value is erroneous, or a stack dump to help trace the issue.", 0, java.lang.Integer.MAX_VALUE, diagnostics)); - childrenList.add(new Property("location", "string", "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.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("expression", "string", "A simple FluentPath 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.", 0, java.lang.Integer.MAX_VALUE, expression)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1478300413: /*severity*/ return this.severity == null ? new Base[0] : new Base[] {this.severity}; // Enumeration - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // Enumeration - case 1557721666: /*details*/ return this.details == null ? new Base[0] : new Base[] {this.details}; // CodeableConcept - case -740386388: /*diagnostics*/ return this.diagnostics == null ? new Base[0] : new Base[] {this.diagnostics}; // StringType - case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // StringType - case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : this.expression.toArray(new Base[this.expression.size()]); // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1478300413: // severity - this.severity = new IssueSeverityEnumFactory().fromType(value); // Enumeration - break; - case 3059181: // code - this.code = new IssueTypeEnumFactory().fromType(value); // Enumeration - break; - case 1557721666: // details - this.details = castToCodeableConcept(value); // CodeableConcept - break; - case -740386388: // diagnostics - this.diagnostics = castToString(value); // StringType - break; - case 1901043637: // location - this.getLocation().add(castToString(value)); // StringType - break; - case -1795452264: // expression - this.getExpression().add(castToString(value)); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("severity")) - this.severity = new IssueSeverityEnumFactory().fromType(value); // Enumeration - else if (name.equals("code")) - this.code = new IssueTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("details")) - this.details = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("diagnostics")) - this.diagnostics = castToString(value); // StringType - else if (name.equals("location")) - this.getLocation().add(castToString(value)); - else if (name.equals("expression")) - this.getExpression().add(castToString(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1478300413: throw new FHIRException("Cannot make property severity as it is not a complex type"); // Enumeration - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // Enumeration - case 1557721666: return getDetails(); // CodeableConcept - case -740386388: throw new FHIRException("Cannot make property diagnostics as it is not a complex type"); // StringType - case 1901043637: throw new FHIRException("Cannot make property location as it is not a complex type"); // StringType - case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("severity")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.severity"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.code"); - } - else if (name.equals("details")) { - this.details = new CodeableConcept(); - return this.details; - } - else if (name.equals("diagnostics")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.diagnostics"); - } - else if (name.equals("location")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.location"); - } - else if (name.equals("expression")) { - throw new FHIRException("Cannot call addChild on a primitive type OperationOutcome.expression"); - } - else - return super.addChild(name); - } - - public OperationOutcomeIssueComponent copy() { - OperationOutcomeIssueComponent dst = new OperationOutcomeIssueComponent(); - copyValues(dst); - dst.severity = severity == null ? null : severity.copy(); - dst.code = code == null ? null : code.copy(); - dst.details = details == null ? null : details.copy(); - dst.diagnostics = diagnostics == null ? null : diagnostics.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (StringType i : location) - dst.location.add(i.copy()); - }; - if (expression != null) { - dst.expression = new ArrayList(); - for (StringType i : expression) - dst.expression.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationOutcomeIssueComponent)) - return false; - OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; - return compareDeep(severity, o.severity, true) && compareDeep(code, o.code, true) && compareDeep(details, o.details, true) - && compareDeep(diagnostics, o.diagnostics, true) && compareDeep(location, o.location, true) && compareDeep(expression, o.expression, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationOutcomeIssueComponent)) - return false; - OperationOutcomeIssueComponent o = (OperationOutcomeIssueComponent) other; - return compareValues(severity, o.severity, true) && compareValues(code, o.code, true) && compareValues(diagnostics, o.diagnostics, true) - && compareValues(location, o.location, true) && compareValues(expression, o.expression, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (severity == null || severity.isEmpty()) && (code == null || code.isEmpty()) - && (details == null || details.isEmpty()) && (diagnostics == null || diagnostics.isEmpty()) - && (location == null || location.isEmpty()) && (expression == null || expression.isEmpty()) - ; - } - - public String fhirType() { - return "OperationOutcome.issue"; - - } - - } - - /** - * An error, warning or information message that results from a system action. - */ - @Child(name = "issue", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A single issue associated with the action", formalDefinition="An error, warning or information message that results from a system action." ) - protected List issue; - - private static final long serialVersionUID = -152150052L; - - /** - * Constructor - */ - public OperationOutcome() { - super(); - } - - /** - * @return {@link #issue} (An error, warning or information message that results from a system action.) - */ - public List getIssue() { - if (this.issue == null) - this.issue = new ArrayList(); - return this.issue; - } - - public boolean hasIssue() { - if (this.issue == null) - return false; - for (OperationOutcomeIssueComponent item : this.issue) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #issue} (An error, warning or information message that results from a system action.) - */ - // syntactic sugar - public OperationOutcomeIssueComponent addIssue() { //3 - OperationOutcomeIssueComponent t = new OperationOutcomeIssueComponent(); - if (this.issue == null) - this.issue = new ArrayList(); - this.issue.add(t); - return t; - } - - // syntactic sugar - public OperationOutcome addIssue(OperationOutcomeIssueComponent t) { //3 - if (t == null) - return this; - if (this.issue == null) - this.issue = new ArrayList(); - this.issue.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("issue", "", "An error, warning or information message that results from a system action.", 0, java.lang.Integer.MAX_VALUE, issue)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 100509913: /*issue*/ return this.issue == null ? new Base[0] : this.issue.toArray(new Base[this.issue.size()]); // OperationOutcomeIssueComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 100509913: // issue - this.getIssue().add((OperationOutcomeIssueComponent) value); // OperationOutcomeIssueComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("issue")) - this.getIssue().add((OperationOutcomeIssueComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 100509913: return addIssue(); // OperationOutcomeIssueComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("issue")) { - return addIssue(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "OperationOutcome"; - - } - - public OperationOutcome copy() { - OperationOutcome dst = new OperationOutcome(); - copyValues(dst); - if (issue != null) { - dst.issue = new ArrayList(); - for (OperationOutcomeIssueComponent i : issue) - dst.issue.add(i.copy()); - }; - return dst; - } - - protected OperationOutcome typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OperationOutcome)) - return false; - OperationOutcome o = (OperationOutcome) other; - return compareDeep(issue, o.issue, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OperationOutcome)) - return false; - OperationOutcome o = (OperationOutcome) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (issue == null || issue.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OperationOutcome; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Order.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Order.java deleted file mode 100644 index ab1a9ef99af..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Order.java +++ /dev/null @@ -1,1051 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * A request to perform an action. - */ -@ResourceDef(name="Order", profile="http://hl7.org/fhir/Profile/Order") -public class Order extends DomainResource { - - @Block() - public static class OrderWhenComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code specifies when request should be done. The code may simply be a priority code. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Code specifies when request should be done. The code may simply be a priority code", formalDefinition="Code specifies when request should be done. The code may simply be a priority code." ) - protected CodeableConcept code; - - /** - * A formal schedule. - */ - @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A formal schedule", formalDefinition="A formal schedule." ) - protected Timing schedule; - - private static final long serialVersionUID = 307115287L; - - /** - * Constructor - */ - public OrderWhenComponent() { - super(); - } - - /** - * @return {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderWhenComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code specifies when request should be done. The code may simply be a priority code.) - */ - public OrderWhenComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #schedule} (A formal schedule.) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderWhenComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (A formal schedule.) - */ - public OrderWhenComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code specifies when request should be done. The code may simply be a priority code.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("schedule", "Timing", "A formal schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -697920873: // schedule - this.schedule = castToTiming(value); // Timing - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("schedule")) - this.schedule = castToTiming(value); // Timing - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -697920873: return getSchedule(); // Timing - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("schedule")) { - this.schedule = new Timing(); - return this.schedule; - } - else - return super.addChild(name); - } - - public OrderWhenComponent copy() { - OrderWhenComponent dst = new OrderWhenComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrderWhenComponent)) - return false; - OrderWhenComponent o = (OrderWhenComponent) other; - return compareDeep(code, o.code, true) && compareDeep(schedule, o.schedule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrderWhenComponent)) - return false; - OrderWhenComponent o = (OrderWhenComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) - ; - } - - public String fhirType() { - return "Order.when"; - - } - - } - - /** - * Identifiers assigned to this order by the orderer or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Identifiers assigned to this order by the orderer or by the receiver", formalDefinition="Identifiers assigned to this order by the orderer or by the receiver." ) - protected List identifier; - - /** - * When the order was made. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the order was made", formalDefinition="When the order was made." ) - protected DateTimeType date; - - /** - * Patient this order is about. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient this order is about", formalDefinition="Patient this order is about." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Patient this order is about.) - */ - protected Resource subjectTarget; - - /** - * Who initiated the order. - */ - @Child(name = "source", type = {Practitioner.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who initiated the order", formalDefinition="Who initiated the order." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (Who initiated the order.) - */ - protected Resource sourceTarget; - - /** - * Who is intended to fulfill the order. - */ - @Child(name = "target", type = {Organization.class, Device.class, Practitioner.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who is intended to fulfill the order", formalDefinition="Who is intended to fulfill the order." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (Who is intended to fulfill the order.) - */ - protected Resource targetTarget; - - /** - * Text - why the order was made. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Text - why the order was made", formalDefinition="Text - why the order was made." ) - protected Type reason; - - /** - * When order should be fulfilled. - */ - @Child(name = "when", type = {}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When order should be fulfilled", formalDefinition="When order should be fulfilled." ) - protected OrderWhenComponent when; - - /** - * What action is being ordered. - */ - @Child(name = "detail", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="What action is being ordered", formalDefinition="What action is being ordered." ) - protected List detail; - /** - * The actual objects that are the target of the reference (What action is being ordered.) - */ - protected List detailTarget; - - - private static final long serialVersionUID = -1392311096L; - - /** - * Constructor - */ - public Order() { - super(); - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the orderer or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Order addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When the order was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Order setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When the order was made. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When the order was made. - */ - public Order setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (Patient this order is about.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Patient this order is about.) - */ - public Order setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Patient this order is about.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Patient this order is about.) - */ - public Order setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #source} (Who initiated the order.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (Who initiated the order.) - */ - public Order setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who initiated the order.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who initiated the order.) - */ - public Order setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #target} (Who is intended to fulfill the order.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (Who is intended to fulfill the order.) - */ - public Order setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who is intended to fulfill the order.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who is intended to fulfill the order.) - */ - public Order setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public CodeableConcept getReasonCodeableConcept() throws FHIRException { - if (!(this.reason instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - public boolean hasReasonCodeableConcept() { - return this.reason instanceof CodeableConcept; - } - - /** - * @return {@link #reason} (Text - why the order was made.) - */ - public Reference getReasonReference() throws FHIRException { - if (!(this.reason instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReasonReference() { - return this.reason instanceof Reference; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Text - why the order was made.) - */ - public Order setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #when} (When order should be fulfilled.) - */ - public OrderWhenComponent getWhen() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Order.when"); - else if (Configuration.doAutoCreate()) - this.when = new OrderWhenComponent(); // cc - return this.when; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (When order should be fulfilled.) - */ - public Order setWhen(OrderWhenComponent value) { - this.when = value; - return this; - } - - /** - * @return {@link #detail} (What action is being ordered.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (Reference item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (What action is being ordered.) - */ - // syntactic sugar - public Reference addDetail() { //3 - Reference t = new Reference(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public Order addDetail(Reference t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #detail} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. What action is being ordered.) - */ - public List getDetailTarget() { - if (this.detailTarget == null) - this.detailTarget = new ArrayList(); - return this.detailTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the orderer or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("date", "dateTime", "When the order was made.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Patient this order is about.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("source", "Reference(Practitioner|Organization)", "Who initiated the order.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target", "Reference(Organization|Device|Practitioner)", "Who is intended to fulfill the order.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Text - why the order was made.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("when", "", "When order should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("detail", "Reference(Any)", "What action is being ordered.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type - case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // OrderWhenComponent - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -896505829: // source - this.source = castToReference(value); // Reference - break; - case -880905839: // target - this.target = castToReference(value); // Reference - break; - case -934964668: // reason - this.reason = (Type) value; // Type - break; - case 3648314: // when - this.when = (OrderWhenComponent) value; // OrderWhenComponent - break; - case -1335224239: // detail - this.getDetail().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("source")) - this.source = castToReference(value); // Reference - else if (name.equals("target")) - this.target = castToReference(value); // Reference - else if (name.equals("reason[x]")) - this.reason = (Type) value; // Type - else if (name.equals("when")) - this.when = (OrderWhenComponent) value; // OrderWhenComponent - else if (name.equals("detail")) - this.getDetail().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1867885268: return getSubject(); // Reference - case -896505829: return getSource(); // Reference - case -880905839: return getTarget(); // Reference - case -669418564: return getReason(); // Type - case 3648314: return getWhen(); // OrderWhenComponent - case -1335224239: return addDetail(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Order.date"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("source")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("target")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("reasonCodeableConcept")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("reasonReference")) { - this.reason = new Reference(); - return this.reason; - } - else if (name.equals("when")) { - this.when = new OrderWhenComponent(); - return this.when; - } - else if (name.equals("detail")) { - return addDetail(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Order"; - - } - - public Order copy() { - Order dst = new Order(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.source = source == null ? null : source.copy(); - dst.target = target == null ? null : target.copy(); - dst.reason = reason == null ? null : reason.copy(); - dst.when = when == null ? null : when.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (Reference i : detail) - dst.detail.add(i.copy()); - }; - return dst; - } - - protected Order typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Order)) - return false; - Order o = (Order) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(date, o.date, true) && compareDeep(subject, o.subject, true) - && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) && compareDeep(reason, o.reason, true) - && compareDeep(when, o.when, true) && compareDeep(detail, o.detail, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Order)) - return false; - Order o = (Order) other; - return compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (date == null || date.isEmpty()) - && (subject == null || subject.isEmpty()) && (source == null || source.isEmpty()) && (target == null || target.isEmpty()) - && (reason == null || reason.isEmpty()) && (when == null || when.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Order; - } - - /** - * Search parameter: detail - *

- * Description: What action is being ordered
- * Type: reference
- * Path: Order.detail
- *

- */ - @SearchParamDefinition(name="detail", path="Order.detail", description="What action is being ordered", type="reference" ) - public static final String SP_DETAIL = "detail"; - /** - * Fluent Client search parameter constant for detail - *

- * Description: What action is being ordered
- * Type: reference
- * Path: Order.detail
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam DETAIL = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_DETAIL); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order:detail". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_DETAIL = new ca.uhn.fhir.model.api.Include("Order:detail").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Patient this order is about
- * Type: reference
- * Path: Order.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Order.subject", description="Patient this order is about", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient this order is about
- * Type: reference
- * Path: Order.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Order:patient").toLocked(); - - /** - * Search parameter: source - *

- * Description: Who initiated the order
- * Type: reference
- * Path: Order.source
- *

- */ - @SearchParamDefinition(name="source", path="Order.source", description="Who initiated the order", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Who initiated the order
- * Type: reference
- * Path: Order.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("Order:source").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Patient this order is about
- * Type: reference
- * Path: Order.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Order.subject", description="Patient this order is about", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Patient this order is about
- * Type: reference
- * Path: Order.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Order:subject").toLocked(); - - /** - * Search parameter: when - *

- * Description: A formal schedule
- * Type: date
- * Path: Order.when.schedule
- *

- */ - @SearchParamDefinition(name="when", path="Order.when.schedule", description="A formal schedule", type="date" ) - public static final String SP_WHEN = "when"; - /** - * Fluent Client search parameter constant for when - *

- * Description: A formal schedule
- * Type: date
- * Path: Order.when.schedule
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam WHEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_WHEN); - - /** - * Search parameter: target - *

- * Description: Who is intended to fulfill the order
- * Type: reference
- * Path: Order.target
- *

- */ - @SearchParamDefinition(name="target", path="Order.target", description="Who is intended to fulfill the order", type="reference" ) - public static final String SP_TARGET = "target"; - /** - * Fluent Client search parameter constant for target - *

- * Description: Who is intended to fulfill the order
- * Type: reference
- * Path: Order.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Order:target". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("Order:target").toLocked(); - - /** - * Search parameter: when_code - *

- * Description: Code specifies when request should be done. The code may simply be a priority code
- * Type: token
- * Path: Order.when.code
- *

- */ - @SearchParamDefinition(name="when_code", path="Order.when.code", description="Code specifies when request should be done. The code may simply be a priority code", type="token" ) - public static final String SP_WHENCODE = "when_code"; - /** - * Fluent Client search parameter constant for when_code - *

- * Description: Code specifies when request should be done. The code may simply be a priority code
- * Type: token
- * Path: Order.when.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam WHENCODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_WHENCODE); - - /** - * Search parameter: date - *

- * Description: When the order was made
- * Type: date
- * Path: Order.date
- *

- */ - @SearchParamDefinition(name="date", path="Order.date", description="When the order was made", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When the order was made
- * Type: date
- * Path: Order.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: Instance id from source, target, and/or others
- * Type: token
- * Path: Order.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Order.identifier", description="Instance id from source, target, and/or others", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Instance id from source, target, and/or others
- * Type: token
- * Path: Order.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OrderResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OrderResponse.java deleted file mode 100644 index babbea39369..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OrderResponse.java +++ /dev/null @@ -1,970 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A response to an order. - */ -@ResourceDef(name="OrderResponse", profile="http://hl7.org/fhir/Profile/OrderResponse") -public class OrderResponse extends DomainResource { - - public enum OrderStatus { - /** - * The order is known, but no processing has occurred at this time - */ - PENDING, - /** - * The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review) - */ - REVIEW, - /** - * The order was rejected because of a workflow/business logic reason - */ - REJECTED, - /** - * The order was unable to be processed because of a technical error (i.e. unexpected error) - */ - ERROR, - /** - * The order has been accepted, and work is in progress. - */ - ACCEPTED, - /** - * Processing the order was halted at the initiators request. - */ - CANCELLED, - /** - * The order has been cancelled and replaced by another. - */ - REPLACED, - /** - * Processing the order was stopped because of some workflow/business logic reason. - */ - ABORTED, - /** - * The order has been completed. - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - public static OrderStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return PENDING; - if ("review".equals(codeString)) - return REVIEW; - if ("rejected".equals(codeString)) - return REJECTED; - if ("error".equals(codeString)) - return ERROR; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("replaced".equals(codeString)) - return REPLACED; - if ("aborted".equals(codeString)) - return ABORTED; - if ("completed".equals(codeString)) - return COMPLETED; - throw new FHIRException("Unknown OrderStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PENDING: return "pending"; - case REVIEW: return "review"; - case REJECTED: return "rejected"; - case ERROR: return "error"; - case ACCEPTED: return "accepted"; - case CANCELLED: return "cancelled"; - case REPLACED: return "replaced"; - case ABORTED: return "aborted"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PENDING: return "http://hl7.org/fhir/order-status"; - case REVIEW: return "http://hl7.org/fhir/order-status"; - case REJECTED: return "http://hl7.org/fhir/order-status"; - case ERROR: return "http://hl7.org/fhir/order-status"; - case ACCEPTED: return "http://hl7.org/fhir/order-status"; - case CANCELLED: return "http://hl7.org/fhir/order-status"; - case REPLACED: return "http://hl7.org/fhir/order-status"; - case ABORTED: return "http://hl7.org/fhir/order-status"; - case COMPLETED: return "http://hl7.org/fhir/order-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PENDING: return "The order is known, but no processing has occurred at this time"; - case REVIEW: return "The order is undergoing initial processing to determine whether it will be accepted (usually this involves human review)"; - case REJECTED: return "The order was rejected because of a workflow/business logic reason"; - case ERROR: return "The order was unable to be processed because of a technical error (i.e. unexpected error)"; - case ACCEPTED: return "The order has been accepted, and work is in progress."; - case CANCELLED: return "Processing the order was halted at the initiators request."; - case REPLACED: return "The order has been cancelled and replaced by another."; - case ABORTED: return "Processing the order was stopped because of some workflow/business logic reason."; - case COMPLETED: return "The order has been completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PENDING: return "Pending"; - case REVIEW: return "Review"; - case REJECTED: return "Rejected"; - case ERROR: return "Error"; - case ACCEPTED: return "Accepted"; - case CANCELLED: return "Cancelled"; - case REPLACED: return "Replaced"; - case ABORTED: return "Aborted"; - case COMPLETED: return "Completed"; - default: return "?"; - } - } - } - - public static class OrderStatusEnumFactory implements EnumFactory { - public OrderStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return OrderStatus.PENDING; - if ("review".equals(codeString)) - return OrderStatus.REVIEW; - if ("rejected".equals(codeString)) - return OrderStatus.REJECTED; - if ("error".equals(codeString)) - return OrderStatus.ERROR; - if ("accepted".equals(codeString)) - return OrderStatus.ACCEPTED; - if ("cancelled".equals(codeString)) - return OrderStatus.CANCELLED; - if ("replaced".equals(codeString)) - return OrderStatus.REPLACED; - if ("aborted".equals(codeString)) - return OrderStatus.ABORTED; - if ("completed".equals(codeString)) - return OrderStatus.COMPLETED; - throw new IllegalArgumentException("Unknown OrderStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("pending".equals(codeString)) - return new Enumeration(this, OrderStatus.PENDING); - if ("review".equals(codeString)) - return new Enumeration(this, OrderStatus.REVIEW); - if ("rejected".equals(codeString)) - return new Enumeration(this, OrderStatus.REJECTED); - if ("error".equals(codeString)) - return new Enumeration(this, OrderStatus.ERROR); - if ("accepted".equals(codeString)) - return new Enumeration(this, OrderStatus.ACCEPTED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, OrderStatus.CANCELLED); - if ("replaced".equals(codeString)) - return new Enumeration(this, OrderStatus.REPLACED); - if ("aborted".equals(codeString)) - return new Enumeration(this, OrderStatus.ABORTED); - if ("completed".equals(codeString)) - return new Enumeration(this, OrderStatus.COMPLETED); - throw new FHIRException("Unknown OrderStatus code '"+codeString+"'"); - } - public String toCode(OrderStatus code) { - if (code == OrderStatus.PENDING) - return "pending"; - if (code == OrderStatus.REVIEW) - return "review"; - if (code == OrderStatus.REJECTED) - return "rejected"; - if (code == OrderStatus.ERROR) - return "error"; - if (code == OrderStatus.ACCEPTED) - return "accepted"; - if (code == OrderStatus.CANCELLED) - return "cancelled"; - if (code == OrderStatus.REPLACED) - return "replaced"; - if (code == OrderStatus.ABORTED) - return "aborted"; - if (code == OrderStatus.COMPLETED) - return "completed"; - return "?"; - } - public String toSystem(OrderStatus code) { - return code.getSystem(); - } - } - - /** - * 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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List identifier; - - /** - * A reference to the order that this is in response to. - */ - @Child(name = "request", type = {Order.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The order that this is a response to", formalDefinition="A reference to the order that this is in response to." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (A reference to the order that this is in response to.) - */ - protected Order requestTarget; - - /** - * The date and time at which this order response was made (created/posted). - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the response was made", formalDefinition="The date and time at which this order response was made (created/posted)." ) - protected DateTimeType date; - - /** - * The person, organization, or device credited with making the response. - */ - @Child(name = "who", type = {Practitioner.class, Organization.class, Device.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who made the response", formalDefinition="The person, organization, or device credited with making the response." ) - protected Reference who; - - /** - * The actual object that is the target of the reference (The person, organization, or device credited with making the response.) - */ - protected Resource whoTarget; - - /** - * What this response says about the status of the original order. - */ - @Child(name = "orderStatus", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", formalDefinition="What this response says about the status of the original order." ) - protected Enumeration orderStatus; - - /** - * Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - @Child(name = "description", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType description; - - /** - * 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. - */ - @Child(name = "fulfillment", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List fulfillment; - /** - * The actual objects that are the target of the reference (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.) - */ - protected List fulfillmentTarget; - - - private static final long serialVersionUID = -856633109L; - - /** - * Constructor - */ - public OrderResponse() { - super(); - } - - /** - * Constructor - */ - public OrderResponse(Reference request, Enumeration orderStatus) { - super(); - this.request = request; - this.orderStatus = orderStatus; - } - - /** - * @return {@link #identifier} (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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public OrderResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (A reference to the order that this is in response to.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (A reference to the order that this is in response to.) - */ - public OrderResponse setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to the order that this is in response to.) - */ - public Order getRequestTarget() { - if (this.requestTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.request"); - else if (Configuration.doAutoCreate()) - this.requestTarget = new Order(); // aa - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to the order that this is in response to.) - */ - public OrderResponse setRequestTarget(Order value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date and time at which this order response was made (created/posted).). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public OrderResponse setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date and time at which this order response was made (created/posted). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date and time at which this order response was made (created/posted). - */ - public OrderResponse setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #who} (The person, organization, or device credited with making the response.) - */ - public Reference getWho() { - if (this.who == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.who"); - else if (Configuration.doAutoCreate()) - this.who = new Reference(); // cc - return this.who; - } - - public boolean hasWho() { - return this.who != null && !this.who.isEmpty(); - } - - /** - * @param value {@link #who} (The person, organization, or device credited with making the response.) - */ - public OrderResponse setWho(Reference value) { - this.who = value; - return this; - } - - /** - * @return {@link #who} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) - */ - public Resource getWhoTarget() { - return this.whoTarget; - } - - /** - * @param value {@link #who} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, organization, or device credited with making the response.) - */ - public OrderResponse setWhoTarget(Resource value) { - this.whoTarget = value; - return this; - } - - /** - * @return {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value - */ - public Enumeration getOrderStatusElement() { - if (this.orderStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.orderStatus"); - else if (Configuration.doAutoCreate()) - this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); // bb - return this.orderStatus; - } - - public boolean hasOrderStatusElement() { - return this.orderStatus != null && !this.orderStatus.isEmpty(); - } - - public boolean hasOrderStatus() { - return this.orderStatus != null && !this.orderStatus.isEmpty(); - } - - /** - * @param value {@link #orderStatus} (What this response says about the status of the original order.). This is the underlying object with id, value and extensions. The accessor "getOrderStatus" gives direct access to the value - */ - public OrderResponse setOrderStatusElement(Enumeration value) { - this.orderStatus = value; - return this; - } - - /** - * @return What this response says about the status of the original order. - */ - public OrderStatus getOrderStatus() { - return this.orderStatus == null ? null : this.orderStatus.getValue(); - } - - /** - * @param value What this response says about the status of the original order. - */ - public OrderResponse setOrderStatus(OrderStatus value) { - if (this.orderStatus == null) - this.orderStatus = new Enumeration(new OrderStatusEnumFactory()); - this.orderStatus.setValue(value); - return this; - } - - /** - * @return {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderResponse.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public OrderResponse setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Additional description about the response - e.g. a text description provided by a human user when making decisions about the order. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value 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 value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #fulfillment} (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 List getFulfillment() { - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - return this.fulfillment; - } - - public boolean hasFulfillment() { - if (this.fulfillment == null) - return false; - for (Reference item : this.fulfillment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fulfillment} (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.) - */ - // syntactic sugar - public Reference addFulfillment() { //3 - Reference t = new Reference(); - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - this.fulfillment.add(t); - return t; - } - - // syntactic sugar - public OrderResponse addFulfillment(Reference t) { //3 - if (t == null) - return this; - if (this.fulfillment == null) - this.fulfillment = new ArrayList(); - this.fulfillment.add(t); - return this; - } - - /** - * @return {@link #fulfillment} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. 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 List getFulfillmentTarget() { - if (this.fulfillmentTarget == null) - this.fulfillmentTarget = new ArrayList(); - return this.fulfillmentTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request", "Reference(Order)", "A reference to the order that this is in response to.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("date", "dateTime", "The date and time at which this order response was made (created/posted).", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("who", "Reference(Practitioner|Organization|Device)", "The person, organization, or device credited with making the response.", 0, java.lang.Integer.MAX_VALUE, who)); - childrenList.add(new Property("orderStatus", "code", "What this response says about the status of the original order.", 0, java.lang.Integer.MAX_VALUE, orderStatus)); - childrenList.add(new Property("description", "string", "Additional description about the response - e.g. a text description provided by a human user when making decisions about the order.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("fulfillment", "Reference(Any)", "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.", 0, java.lang.Integer.MAX_VALUE, fulfillment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Reference - case 1630081248: /*orderStatus*/ return this.orderStatus == null ? new Base[0] : new Base[] {this.orderStatus}; // Enumeration - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 1512395230: /*fulfillment*/ return this.fulfillment == null ? new Base[0] : this.fulfillment.toArray(new Base[this.fulfillment.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 117694: // who - this.who = castToReference(value); // Reference - break; - case 1630081248: // orderStatus - this.orderStatus = new OrderStatusEnumFactory().fromType(value); // Enumeration - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 1512395230: // fulfillment - this.getFulfillment().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("who")) - this.who = castToReference(value); // Reference - else if (name.equals("orderStatus")) - this.orderStatus = new OrderStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("fulfillment")) - this.getFulfillment().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1095692943: return getRequest(); // Reference - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 117694: return getWho(); // Reference - case 1630081248: throw new FHIRException("Cannot make property orderStatus as it is not a complex type"); // Enumeration - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 1512395230: return addFulfillment(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type OrderResponse.date"); - } - else if (name.equals("who")) { - this.who = new Reference(); - return this.who; - } - else if (name.equals("orderStatus")) { - throw new FHIRException("Cannot call addChild on a primitive type OrderResponse.orderStatus"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type OrderResponse.description"); - } - else if (name.equals("fulfillment")) { - return addFulfillment(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "OrderResponse"; - - } - - public OrderResponse copy() { - OrderResponse dst = new OrderResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.date = date == null ? null : date.copy(); - dst.who = who == null ? null : who.copy(); - dst.orderStatus = orderStatus == null ? null : orderStatus.copy(); - dst.description = description == null ? null : description.copy(); - if (fulfillment != null) { - dst.fulfillment = new ArrayList(); - for (Reference i : fulfillment) - dst.fulfillment.add(i.copy()); - }; - return dst; - } - - protected OrderResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrderResponse)) - return false; - OrderResponse o = (OrderResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(date, o.date, true) - && compareDeep(who, o.who, true) && compareDeep(orderStatus, o.orderStatus, true) && compareDeep(description, o.description, true) - && compareDeep(fulfillment, o.fulfillment, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrderResponse)) - return false; - OrderResponse o = (OrderResponse) other; - return compareValues(date, o.date, true) && compareValues(orderStatus, o.orderStatus, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (date == null || date.isEmpty()) && (who == null || who.isEmpty()) && (orderStatus == null || orderStatus.isEmpty()) - && (description == null || description.isEmpty()) && (fulfillment == null || fulfillment.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OrderResponse; - } - - /** - * Search parameter: fulfillment - *

- * Description: Details of the outcome of performing the order
- * Type: reference
- * Path: OrderResponse.fulfillment
- *

- */ - @SearchParamDefinition(name="fulfillment", path="OrderResponse.fulfillment", description="Details of the outcome of performing the order", type="reference" ) - public static final String SP_FULFILLMENT = "fulfillment"; - /** - * Fluent Client search parameter constant for fulfillment - *

- * Description: Details of the outcome of performing the order
- * Type: reference
- * Path: OrderResponse.fulfillment
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam FULFILLMENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_FULFILLMENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OrderResponse:fulfillment". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_FULFILLMENT = new ca.uhn.fhir.model.api.Include("OrderResponse:fulfillment").toLocked(); - - /** - * Search parameter: request - *

- * Description: The order that this is a response to
- * Type: reference
- * Path: OrderResponse.request
- *

- */ - @SearchParamDefinition(name="request", path="OrderResponse.request", description="The order that this is a response to", type="reference" ) - public static final String SP_REQUEST = "request"; - /** - * Fluent Client search parameter constant for request - *

- * Description: The order that this is a response to
- * Type: reference
- * Path: OrderResponse.request
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUEST = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUEST); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OrderResponse:request". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUEST = new ca.uhn.fhir.model.api.Include("OrderResponse:request").toLocked(); - - /** - * Search parameter: code - *

- * Description: pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed
- * Type: token
- * Path: OrderResponse.orderStatus
- *

- */ - @SearchParamDefinition(name="code", path="OrderResponse.orderStatus", description="pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: pending | review | rejected | error | accepted | cancelled | replaced | aborted | completed
- * Type: token
- * Path: OrderResponse.orderStatus
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: When the response was made
- * Type: date
- * Path: OrderResponse.date
- *

- */ - @SearchParamDefinition(name="date", path="OrderResponse.date", description="When the response was made", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When the response was made
- * Type: date
- * Path: OrderResponse.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: Identifiers assigned to this order by the orderer or by the receiver
- * Type: token
- * Path: OrderResponse.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="OrderResponse.identifier", description="Identifiers assigned to this order by the orderer or by the receiver", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Identifiers assigned to this order by the orderer or by the receiver
- * Type: token
- * Path: OrderResponse.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: who - *

- * Description: Who made the response
- * Type: reference
- * Path: OrderResponse.who
- *

- */ - @SearchParamDefinition(name="who", path="OrderResponse.who", description="Who made the response", type="reference" ) - public static final String SP_WHO = "who"; - /** - * Fluent Client search parameter constant for who - *

- * Description: Who made the response
- * Type: reference
- * Path: OrderResponse.who
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam WHO = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_WHO); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "OrderResponse:who". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_WHO = new ca.uhn.fhir.model.api.Include("OrderResponse:who").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OrderSet.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OrderSet.java deleted file mode 100644 index cfb83a7f4c4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/OrderSet.java +++ /dev/null @@ -1,461 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * This resource allows for the definition of an order set as a sharable, consumable, and executable artifact in support of clinical decision support. - */ -@ResourceDef(name="OrderSet", profile="http://hl7.org/fhir/Profile/OrderSet") -public class OrderSet extends DomainResource { - - /** - * A reference to a ModuleMetadata resource containing metadata for the orderset. - */ - @Child(name = "moduleMetadata", type = {ModuleMetadata.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The metadata for the orderset", formalDefinition="A reference to a ModuleMetadata resource containing metadata for the orderset." ) - protected ModuleMetadata moduleMetadata; - - /** - * A reference to a Library resource containing any formal logic used by the orderset. - */ - @Child(name = "library", type = {Library.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Logic used by the orderset", formalDefinition="A reference to a Library resource containing any formal logic used by the orderset." ) - protected List library; - /** - * The actual objects that are the target of the reference (A reference to a Library resource containing any formal logic used by the orderset.) - */ - protected List libraryTarget; - - - /** - * The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions. - */ - @Child(name = "action", type = {ActionDefinition.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Groups, sections, and line items of the order set", formalDefinition="The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions." ) - protected List action; - - private static final long serialVersionUID = -728217200L; - - /** - * Constructor - */ - public OrderSet() { - super(); - } - - /** - * @return {@link #moduleMetadata} (A reference to a ModuleMetadata resource containing metadata for the orderset.) - */ - public ModuleMetadata getModuleMetadata() { - if (this.moduleMetadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrderSet.moduleMetadata"); - else if (Configuration.doAutoCreate()) - this.moduleMetadata = new ModuleMetadata(); // cc - return this.moduleMetadata; - } - - public boolean hasModuleMetadata() { - return this.moduleMetadata != null && !this.moduleMetadata.isEmpty(); - } - - /** - * @param value {@link #moduleMetadata} (A reference to a ModuleMetadata resource containing metadata for the orderset.) - */ - public OrderSet setModuleMetadata(ModuleMetadata value) { - this.moduleMetadata = value; - return this; - } - - /** - * @return {@link #library} (A reference to a Library resource containing any formal logic used by the orderset.) - */ - public List getLibrary() { - if (this.library == null) - this.library = new ArrayList(); - return this.library; - } - - public boolean hasLibrary() { - if (this.library == null) - return false; - for (Reference item : this.library) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #library} (A reference to a Library resource containing any formal logic used by the orderset.) - */ - // syntactic sugar - public Reference addLibrary() { //3 - Reference t = new Reference(); - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return t; - } - - // syntactic sugar - public OrderSet addLibrary(Reference t) { //3 - if (t == null) - return this; - if (this.library == null) - this.library = new ArrayList(); - this.library.add(t); - return this; - } - - /** - * @return {@link #library} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. A reference to a Library resource containing any formal logic used by the orderset.) - */ - public List getLibraryTarget() { - if (this.libraryTarget == null) - this.libraryTarget = new ArrayList(); - return this.libraryTarget; - } - - // syntactic sugar - /** - * @return {@link #library} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. A reference to a Library resource containing any formal logic used by the orderset.) - */ - public Library addLibraryTarget() { - Library r = new Library(); - if (this.libraryTarget == null) - this.libraryTarget = new ArrayList(); - this.libraryTarget.add(r); - return r; - } - - /** - * @return {@link #action} (The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (ActionDefinition item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions.) - */ - // syntactic sugar - public ActionDefinition addAction() { //3 - ActionDefinition t = new ActionDefinition(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public OrderSet addAction(ActionDefinition t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("moduleMetadata", "ModuleMetadata", "A reference to a ModuleMetadata resource containing metadata for the orderset.", 0, java.lang.Integer.MAX_VALUE, moduleMetadata)); - childrenList.add(new Property("library", "Reference(Library)", "A reference to a Library resource containing any formal logic used by the orderset.", 0, java.lang.Integer.MAX_VALUE, library)); - childrenList.add(new Property("action", "ActionDefinition", "The definition of the actions that make up the order set. Order set groups and sections are represented as actions which contain sub-actions.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 455891387: /*moduleMetadata*/ return this.moduleMetadata == null ? new Base[0] : new Base[] {this.moduleMetadata}; // ModuleMetadata - case 166208699: /*library*/ return this.library == null ? new Base[0] : this.library.toArray(new Base[this.library.size()]); // Reference - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // ActionDefinition - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 455891387: // moduleMetadata - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - break; - case 166208699: // library - this.getLibrary().add(castToReference(value)); // Reference - break; - case -1422950858: // action - this.getAction().add(castToActionDefinition(value)); // ActionDefinition - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("moduleMetadata")) - this.moduleMetadata = castToModuleMetadata(value); // ModuleMetadata - else if (name.equals("library")) - this.getLibrary().add(castToReference(value)); - else if (name.equals("action")) - this.getAction().add(castToActionDefinition(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 455891387: return getModuleMetadata(); // ModuleMetadata - case 166208699: return addLibrary(); // Reference - case -1422950858: return addAction(); // ActionDefinition - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("moduleMetadata")) { - this.moduleMetadata = new ModuleMetadata(); - return this.moduleMetadata; - } - else if (name.equals("library")) { - return addLibrary(); - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "OrderSet"; - - } - - public OrderSet copy() { - OrderSet dst = new OrderSet(); - copyValues(dst); - dst.moduleMetadata = moduleMetadata == null ? null : moduleMetadata.copy(); - if (library != null) { - dst.library = new ArrayList(); - for (Reference i : library) - dst.library.add(i.copy()); - }; - if (action != null) { - dst.action = new ArrayList(); - for (ActionDefinition i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - protected OrderSet typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrderSet)) - return false; - OrderSet o = (OrderSet) other; - return compareDeep(moduleMetadata, o.moduleMetadata, true) && compareDeep(library, o.library, true) - && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrderSet)) - return false; - OrderSet o = (OrderSet) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (moduleMetadata == null || moduleMetadata.isEmpty()) && (library == null || library.isEmpty()) - && (action == null || action.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.OrderSet; - } - - /** - * Search parameter: topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: OrderSet.moduleMetadata.topic
- *

- */ - @SearchParamDefinition(name="topic", path="OrderSet.moduleMetadata.topic", description="Topics associated with the module", type="token" ) - public static final String SP_TOPIC = "topic"; - /** - * Fluent Client search parameter constant for topic - *

- * Description: Topics associated with the module
- * Type: token
- * Path: OrderSet.moduleMetadata.topic
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TOPIC = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TOPIC); - - /** - * Search parameter: title - *

- * Description: Text search against the title
- * Type: string
- * Path: OrderSet.moduleMetadata.title
- *

- */ - @SearchParamDefinition(name="title", path="OrderSet.moduleMetadata.title", description="Text search against the title", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: Text search against the title
- * Type: string
- * Path: OrderSet.moduleMetadata.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: status - *

- * Description: Status of the module
- * Type: token
- * Path: OrderSet.moduleMetadata.status
- *

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

- * Description: Status of the module
- * Type: token
- * Path: OrderSet.moduleMetadata.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search against the description
- * Type: string
- * Path: OrderSet.moduleMetadata.description
- *

- */ - @SearchParamDefinition(name="description", path="OrderSet.moduleMetadata.description", description="Text search against the description", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Text search against the description
- * Type: string
- * Path: OrderSet.moduleMetadata.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: OrderSet.moduleMetadata.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="OrderSet.moduleMetadata.identifier", description="Logical identifier for the module (e.g. CMS-143)", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Logical identifier for the module (e.g. CMS-143)
- * Type: token
- * Path: OrderSet.moduleMetadata.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: OrderSet.moduleMetadata.version
- *

- */ - @SearchParamDefinition(name="version", path="OrderSet.moduleMetadata.version", description="Version of the module (e.g. 1.0.0)", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: Version of the module (e.g. 1.0.0)
- * Type: string
- * Path: OrderSet.moduleMetadata.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Organization.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Organization.java deleted file mode 100644 index fe8d3c0228f..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Organization.java +++ /dev/null @@ -1,1179 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * 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. - */ -@ResourceDef(name="Organization", profile="http://hl7.org/fhir/Profile/Organization") -public class Organization extends DomainResource { - - @Block() - public static class OrganizationContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates a purpose for which the contact can be reached. - */ - @Child(name = "purpose", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The type of contact", formalDefinition="Indicates a purpose for which the contact can be reached." ) - protected CodeableConcept purpose; - - /** - * A name associated with the contact. - */ - @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="A name associated with the contact", formalDefinition="A name associated with the contact." ) - protected HumanName name; - - /** - * A contact detail (e.g. a telephone number or an email address) by which the party may be contacted. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List telecom; - - /** - * Visiting or postal addresses for the contact. - */ - @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Visiting or postal addresses for the contact", formalDefinition="Visiting or postal addresses for the contact." ) - protected Address address; - - private static final long serialVersionUID = 1831121305L; - - /** - * Constructor - */ - public OrganizationContactComponent() { - super(); - } - - /** - * @return {@link #purpose} (Indicates a purpose for which the contact can be reached.) - */ - public CodeableConcept getPurpose() { - if (this.purpose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.purpose"); - else if (Configuration.doAutoCreate()) - this.purpose = new CodeableConcept(); // cc - return this.purpose; - } - - public boolean hasPurpose() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - /** - * @param value {@link #purpose} (Indicates a purpose for which the contact can be reached.) - */ - public OrganizationContactComponent setPurpose(CodeableConcept value) { - this.purpose = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the contact.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the contact.) - */ - public OrganizationContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public OrganizationContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Visiting or postal addresses for the contact.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create OrganizationContactComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Visiting or postal addresses for the contact.) - */ - public OrganizationContactComponent setAddress(Address value) { - this.address = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("purpose", "CodeableConcept", "Indicates a purpose for which the contact can be reached.", 0, java.lang.Integer.MAX_VALUE, purpose)); - childrenList.add(new Property("name", "HumanName", "A name associated with the contact.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Visiting or postal addresses for the contact.", 0, java.lang.Integer.MAX_VALUE, address)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // CodeableConcept - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -220463842: // purpose - this.purpose = castToCodeableConcept(value); // CodeableConcept - break; - case 3373707: // name - this.name = castToHumanName(value); // HumanName - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1147692044: // address - this.address = castToAddress(value); // Address - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("purpose")) - this.purpose = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("name")) - this.name = castToHumanName(value); // HumanName - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("address")) - this.address = castToAddress(value); // Address - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -220463842: return getPurpose(); // CodeableConcept - case 3373707: return getName(); // HumanName - case -1429363305: return addTelecom(); // ContactPoint - case -1147692044: return getAddress(); // Address - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("purpose")) { - this.purpose = new CodeableConcept(); - return this.purpose; - } - else if (name.equals("name")) { - this.name = new HumanName(); - return this.name; - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("address")) { - this.address = new Address(); - return this.address; - } - else - return super.addChild(name); - } - - public OrganizationContactComponent copy() { - OrganizationContactComponent dst = new OrganizationContactComponent(); - copyValues(dst); - dst.purpose = purpose == null ? null : purpose.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof OrganizationContactComponent)) - return false; - OrganizationContactComponent o = (OrganizationContactComponent) other; - return compareDeep(purpose, o.purpose, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(address, o.address, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof OrganizationContactComponent)) - return false; - OrganizationContactComponent o = (OrganizationContactComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (purpose == null || purpose.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()); - } - - public String fhirType() { - return "Organization.contact"; - - } - - } - - /** - * Identifier for the organization that is used to identify the organization across multiple disparate systems. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Identifies this organization across multiple systems", formalDefinition="Identifier for the organization that is used to identify the organization across multiple disparate systems." ) - protected List identifier; - - /** - * Whether the organization's record is still in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Whether the organization's record is still in active use", formalDefinition="Whether the organization's record is still in active use." ) - protected BooleanType active; - - /** - * The kind of organization that this is. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Kind of organization", formalDefinition="The kind of organization that this is." ) - protected CodeableConcept type; - - /** - * A name associated with the organization. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name used for the organization", formalDefinition="A name associated with the organization." ) - protected StringType name; - - /** - * A contact detail for the organization. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A contact detail for the organization", formalDefinition="A contact detail for the organization." ) - protected List telecom; - - /** - * An address for the organization. - */ - @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="An address for the organization", formalDefinition="An address for the organization." ) - protected List
address; - - /** - * The organization of which this organization forms a part. - */ - @Child(name = "partOf", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The organization of which this organization forms a part", formalDefinition="The organization of which this organization forms a part." ) - protected Reference partOf; - - /** - * The actual object that is the target of the reference (The organization of which this organization forms a part.) - */ - protected Organization partOfTarget; - - /** - * Contact for the organization for a certain purpose. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Contact for the organization for a certain purpose", formalDefinition="Contact for the organization for a certain purpose." ) - protected List contact; - - private static final long serialVersionUID = -749567123L; - - /** - * Constructor - */ - public Organization() { - super(); - } - - /** - * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for the organization that is used to identify the organization across multiple disparate systems.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Organization addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether the organization's record is still in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Organization setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether the organization's record is still in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether the organization's record is still in active use. - */ - public Organization setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #type} (The kind of organization that this is.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of organization that this is.) - */ - public Organization setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the organization.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public Organization setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name associated with the organization. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name associated with the organization. - */ - public Organization setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the organization.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the organization.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Organization addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (An address for the organization.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (An address for the organization.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Organization addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #partOf} (The organization of which this organization forms a part.) - */ - public Reference getPartOf() { - if (this.partOf == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.partOf"); - else if (Configuration.doAutoCreate()) - this.partOf = new Reference(); // cc - return this.partOf; - } - - public boolean hasPartOf() { - return this.partOf != null && !this.partOf.isEmpty(); - } - - /** - * @param value {@link #partOf} (The organization of which this organization forms a part.) - */ - public Organization setPartOf(Reference value) { - this.partOf = value; - return this; - } - - /** - * @return {@link #partOf} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization of which this organization forms a part.) - */ - public Organization getPartOfTarget() { - if (this.partOfTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Organization.partOf"); - else if (Configuration.doAutoCreate()) - this.partOfTarget = new Organization(); // aa - return this.partOfTarget; - } - - /** - * @param value {@link #partOf} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization of which this organization forms a part.) - */ - public Organization setPartOfTarget(Organization value) { - this.partOfTarget = value; - return this; - } - - /** - * @return {@link #contact} (Contact for the organization for a certain purpose.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (OrganizationContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact for the organization for a certain purpose.) - */ - // syntactic sugar - public OrganizationContactComponent addContact() { //3 - OrganizationContactComponent t = new OrganizationContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Organization addContact(OrganizationContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the organization that is used to identify the organization across multiple disparate systems.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("active", "boolean", "Whether the organization's record is still in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("type", "CodeableConcept", "The kind of organization that this is.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("name", "string", "A name associated with the organization.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the organization.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "An address for the organization.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("partOf", "Reference(Organization)", "The organization of which this organization forms a part.", 0, java.lang.Integer.MAX_VALUE, partOf)); - childrenList.add(new Property("contact", "", "Contact for the organization for a certain purpose.", 0, java.lang.Integer.MAX_VALUE, contact)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address - case -995410646: /*partOf*/ return this.partOf == null ? new Base[0] : new Base[] {this.partOf}; // Reference - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // OrganizationContactComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1422950650: // active - this.active = castToBoolean(value); // BooleanType - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1147692044: // address - this.getAddress().add(castToAddress(value)); // Address - break; - case -995410646: // partOf - this.partOf = castToReference(value); // Reference - break; - case 951526432: // contact - this.getContact().add((OrganizationContactComponent) value); // OrganizationContactComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("active")) - this.active = castToBoolean(value); // BooleanType - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("address")) - this.getAddress().add(castToAddress(value)); - else if (name.equals("partOf")) - this.partOf = castToReference(value); // Reference - else if (name.equals("contact")) - this.getContact().add((OrganizationContactComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType - case 3575610: return getType(); // CodeableConcept - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - case -1147692044: return addAddress(); // Address - case -995410646: return getPartOf(); // Reference - case 951526432: return addContact(); // OrganizationContactComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("active")) { - throw new FHIRException("Cannot call addChild on a primitive type Organization.active"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Organization.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("address")) { - return addAddress(); - } - else if (name.equals("partOf")) { - this.partOf = new Reference(); - return this.partOf; - } - else if (name.equals("contact")) { - return addContact(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Organization"; - - } - - public Organization copy() { - Organization dst = new Organization(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - dst.type = type == null ? null : type.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.partOf = partOf == null ? null : partOf.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (OrganizationContactComponent i : contact) - dst.contact.add(i.copy()); - }; - return dst; - } - - protected Organization typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Organization)) - return false; - Organization o = (Organization) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(type, o.type, true) - && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) - && compareDeep(partOf, o.partOf, true) && compareDeep(contact, o.contact, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Organization)) - return false; - Organization o = (Organization) other; - return compareValues(active, o.active, true) && compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) - && (type == null || type.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (address == null || address.isEmpty()) && (partOf == null || partOf.isEmpty()) && (contact == null || contact.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Organization; - } - - /** - * Search parameter: address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Organization.address.state
- *

- */ - @SearchParamDefinition(name="address-state", path="Organization.address.state", description="A state specified in an address", type="string" ) - public static final String SP_ADDRESS_STATE = "address-state"; - /** - * Fluent Client search parameter constant for address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Organization.address.state
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Organization.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="Organization.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Organization.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - - /** - * Search parameter: phonetic - *

- * Description: A portion of the organization's name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Organization.name
- *

- */ - @SearchParamDefinition(name="phonetic", path="Organization.name", 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: Organization.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PARTOF = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARTOF); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Organization:partof". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARTOF = new ca.uhn.fhir.model.api.Include("Organization:partof").toLocked(); - - /** - * Search parameter: address - *

- * Description: A (part of the) address of the Organization
- * Type: string
- * Path: Organization.address
- *

- */ - @SearchParamDefinition(name="address", path="Organization.address", description="A (part of the) address of the Organization", type="string" ) - public static final String SP_ADDRESS = "address"; - /** - * Fluent Client search parameter constant for address - *

- * Description: A (part of the) address of the Organization
- * Type: string
- * Path: Organization.address
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Organization.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="Organization.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Organization.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Organization.address.country
- *

- */ - @SearchParamDefinition(name="address-country", path="Organization.address.country", description="A country specified in an address", type="string" ) - public static final String SP_ADDRESS_COUNTRY = "address-country"; - /** - * Fluent Client search parameter constant for address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Organization.address.country
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: Organization.address.postalCode
- *

- */ - @SearchParamDefinition(name="address-postalcode", path="Organization.address.postalCode", description="A postal code specified in an address", type="string" ) - public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; - /** - * Fluent Client search parameter constant for address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: Organization.address.postalCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java deleted file mode 100644 index bfc9858c4de..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ParameterDefinition.java +++ /dev/null @@ -1,618 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. - */ -@DatatypeDef(name="ParameterDefinition") -public class ParameterDefinition extends Type implements ICompositeType { - - /** - * The name of the parameter. - */ - @Child(name = "name", type = {CodeType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Parameter name", formalDefinition="The name of the parameter." ) - protected CodeType name; - - /** - * Whether the parameter is input or output for the module. - */ - @Child(name = "use", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="Whether the parameter is input or output for the module." ) - protected CodeType use; - - /** - * The minimum number of times this parameter SHALL appear in the request or response. - */ - @Child(name = "min", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Minimum cardinality", formalDefinition="The minimum number of times this parameter SHALL appear in the request or response." ) - protected IntegerType min; - - /** - * The maximum number of times this element is permitted to appear in the request or response. - */ - @Child(name = "max", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Maximum cardinality (a number of *)", formalDefinition="The maximum number of times this element is permitted to appear in the request or response." ) - protected StringType max; - - /** - * A brief discussion of what the parameter is for and how it is used by the module. - */ - @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A brief description of the parameter", formalDefinition="A brief discussion of what the parameter is for and how it is used by the module." ) - protected StringType documentation; - - /** - * The type of the parameter. - */ - @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="The type of the parameter." ) - protected CodeType type; - - /** - * If specified, this indicates a profile that the input data must conform to, or that the output data will conform to. - */ - @Child(name = "profile", type = {StructureDefinition.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The profile of the parameter, any", formalDefinition="If specified, this indicates a profile that the input data must conform to, or that the output data will conform to." ) - protected Reference profile; - - /** - * The actual object that is the target of the reference (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) - */ - protected StructureDefinition profileTarget; - - private static final long serialVersionUID = -1284894445L; - - /** - * Constructor - */ - public ParameterDefinition() { - super(); - } - - /** - * Constructor - */ - public ParameterDefinition(CodeType use, CodeType type) { - super(); - this.use = use; - this.type = type; - } - - /** - * @return {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public CodeType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new CodeType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParameterDefinition setNameElement(CodeType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter. - */ - public ParameterDefinition setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new CodeType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public CodeType getUseElement() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.use"); - else if (Configuration.doAutoCreate()) - this.use = new CodeType(); // bb - return this.use; - } - - public boolean hasUseElement() { - return this.use != null && !this.use.isEmpty(); - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (Whether the parameter is input or output for the module.). This is the underlying object with id, value and extensions. The accessor "getUse" gives direct access to the value - */ - public ParameterDefinition setUseElement(CodeType value) { - this.use = value; - return this; - } - - /** - * @return Whether the parameter is input or output for the module. - */ - public String getUse() { - return this.use == null ? null : this.use.getValue(); - } - - /** - * @param value Whether the parameter is input or output for the module. - */ - public ParameterDefinition setUse(String value) { - if (this.use == null) - this.use = new CodeType(); - this.use.setValue(value); - return this; - } - - /** - * @return {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public IntegerType getMinElement() { - if (this.min == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.min"); - else if (Configuration.doAutoCreate()) - this.min = new IntegerType(); // bb - return this.min; - } - - public boolean hasMinElement() { - return this.min != null && !this.min.isEmpty(); - } - - public boolean hasMin() { - return this.min != null && !this.min.isEmpty(); - } - - /** - * @param value {@link #min} (The minimum number of times this parameter SHALL appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMin" gives direct access to the value - */ - public ParameterDefinition setMinElement(IntegerType value) { - this.min = value; - return this; - } - - /** - * @return The minimum number of times this parameter SHALL appear in the request or response. - */ - public int getMin() { - return this.min == null || this.min.isEmpty() ? 0 : this.min.getValue(); - } - - /** - * @param value The minimum number of times this parameter SHALL appear in the request or response. - */ - public ParameterDefinition setMin(int value) { - if (this.min == null) - this.min = new IntegerType(); - this.min.setValue(value); - return this; - } - - /** - * @return {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public StringType getMaxElement() { - if (this.max == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.max"); - else if (Configuration.doAutoCreate()) - this.max = new StringType(); // bb - return this.max; - } - - public boolean hasMaxElement() { - return this.max != null && !this.max.isEmpty(); - } - - public boolean hasMax() { - return this.max != null && !this.max.isEmpty(); - } - - /** - * @param value {@link #max} (The maximum number of times this element is permitted to appear in the request or response.). This is the underlying object with id, value and extensions. The accessor "getMax" gives direct access to the value - */ - public ParameterDefinition setMaxElement(StringType value) { - this.max = value; - return this; - } - - /** - * @return The maximum number of times this element is permitted to appear in the request or response. - */ - public String getMax() { - return this.max == null ? null : this.max.getValue(); - } - - /** - * @param value The maximum number of times this element is permitted to appear in the request or response. - */ - public ParameterDefinition setMax(String value) { - if (Utilities.noString(value)) - this.max = null; - else { - if (this.max == null) - this.max = new StringType(); - this.max.setValue(value); - } - return this; - } - - /** - * @return {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (A brief discussion of what the parameter is for and how it is used by the module.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public ParameterDefinition setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return A brief discussion of what the parameter is for and how it is used by the module. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value A brief discussion of what the parameter is for and how it is used by the module. - */ - public ParameterDefinition setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public CodeType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the parameter.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public ParameterDefinition setTypeElement(CodeType value) { - this.type = value; - return this; - } - - /** - * @return The type of the parameter. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of the parameter. - */ - public ParameterDefinition setType(String value) { - if (this.type == null) - this.type = new CodeType(); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) - */ - public Reference getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Reference(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) - */ - public ParameterDefinition setProfile(Reference value) { - this.profile = value; - return this; - } - - /** - * @return {@link #profile} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) - */ - public StructureDefinition getProfileTarget() { - if (this.profileTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterDefinition.profile"); - else if (Configuration.doAutoCreate()) - this.profileTarget = new StructureDefinition(); // aa - return this.profileTarget; - } - - /** - * @param value {@link #profile} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.) - */ - public ParameterDefinition setProfileTarget(StructureDefinition value) { - this.profileTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "code", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("use", "code", "Whether the parameter is input or output for the module.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("min", "integer", "The minimum number of times this parameter SHALL appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, min)); - childrenList.add(new Property("max", "string", "The maximum number of times this element is permitted to appear in the request or response.", 0, java.lang.Integer.MAX_VALUE, max)); - childrenList.add(new Property("documentation", "string", "A brief discussion of what the parameter is for and how it is used by the module.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("type", "code", "The type of the parameter.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("profile", "Reference(StructureDefinition)", "If specified, this indicates a profile that the input data must conform to, or that the output data will conform to.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // CodeType - case 108114: /*min*/ return this.min == null ? new Base[0] : new Base[] {this.min}; // IntegerType - case 107876: /*max*/ return this.max == null ? new Base[0] : new Base[] {this.max}; // StringType - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToCode(value); // CodeType - break; - case 116103: // use - this.use = castToCode(value); // CodeType - break; - case 108114: // min - this.min = castToInteger(value); // IntegerType - break; - case 107876: // max - this.max = castToString(value); // StringType - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case 3575610: // type - this.type = castToCode(value); // CodeType - break; - case -309425751: // profile - this.profile = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = castToCode(value); // CodeType - else if (name.equals("min")) - this.min = castToInteger(value); // IntegerType - else if (name.equals("max")) - this.max = castToString(value); // StringType - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("type")) - this.type = castToCode(value); // CodeType - else if (name.equals("profile")) - this.profile = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // CodeType - case 116103: throw new FHIRException("Cannot make property use as it is not a complex type"); // CodeType - case 108114: throw new FHIRException("Cannot make property min as it is not a complex type"); // IntegerType - case 107876: throw new FHIRException("Cannot make property max as it is not a complex type"); // StringType - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // CodeType - case -309425751: return getProfile(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.name"); - } - else if (name.equals("use")) { - throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.use"); - } - else if (name.equals("min")) { - throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.min"); - } - else if (name.equals("max")) { - throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.max"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.documentation"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type ParameterDefinition.type"); - } - else if (name.equals("profile")) { - this.profile = new Reference(); - return this.profile; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ParameterDefinition"; - - } - - public ParameterDefinition copy() { - ParameterDefinition dst = new ParameterDefinition(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.use = use == null ? null : use.copy(); - dst.min = min == null ? null : min.copy(); - dst.max = max == null ? null : max.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - dst.type = type == null ? null : type.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - protected ParameterDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ParameterDefinition)) - return false; - ParameterDefinition o = (ParameterDefinition) other; - return compareDeep(name, o.name, true) && compareDeep(use, o.use, true) && compareDeep(min, o.min, true) - && compareDeep(max, o.max, true) && compareDeep(documentation, o.documentation, true) && compareDeep(type, o.type, true) - && compareDeep(profile, o.profile, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ParameterDefinition)) - return false; - ParameterDefinition o = (ParameterDefinition) other; - return compareValues(name, o.name, true) && compareValues(use, o.use, true) && compareValues(min, o.min, true) - && compareValues(max, o.max, true) && compareValues(documentation, o.documentation, true) && compareValues(type, o.type, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (use == null || use.isEmpty()) - && (min == null || min.isEmpty()) && (max == null || max.isEmpty()) && (documentation == null || documentation.isEmpty()) - && (type == null || type.isEmpty()) && (profile == null || profile.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Parameters.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Parameters.java deleted file mode 100644 index b53662d0f7e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Parameters.java +++ /dev/null @@ -1,638 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.instance.model.api.IBaseParameters; - -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; -/** - * This special resource type is used to represent an operation request and response (operations.html). It has no other use, and there is no RESTful endpoint associated with it. - */ -@ResourceDef(name="Parameters", profile="http://hl7.org/fhir/Profile/Parameters") -public class Parameters extends Resource implements IBaseParameters { - - @Block() - public static class ParametersParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the parameter (reference to the operation definition). - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name from the definition", formalDefinition="The name of the parameter (reference to the operation definition)." ) - protected StringType name; - - /** - * If the parameter is a data type. - */ - @Child(name = "value", type = {}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If parameter is a data type", formalDefinition="If the parameter is a data type." ) - protected org.hl7.fhir.dstu2016may.model.Type value; - - /** - * If the parameter is a whole resource. - */ - @Child(name = "resource", type = {Resource.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If parameter is a whole resource", formalDefinition="If the parameter is a whole resource." ) - protected Resource resource; - - /** - * A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple". - */ - @Child(name = "part", type = {ParametersParameterComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Named part of a parameter (e.g. Tuple)", formalDefinition="A named part of a parameter. In many implementation context, a set of named parts is known as a \"Tuple\"." ) - protected List part; - - private static final long serialVersionUID = -839605058L; - - /** - * Constructor - */ - public ParametersParameterComponent() { - super(); - } - - /** - * Constructor - */ - public ParametersParameterComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParametersParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter (reference to the operation definition).). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParametersParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter (reference to the operation definition). - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter (reference to the operation definition). - */ - public ParametersParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (If the parameter is a data type.) - */ - public org.hl7.fhir.dstu2016may.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (If the parameter is a data type.) - */ - public ParametersParameterComponent setValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #resource} (If the parameter is a whole resource.) - */ - public Resource getResource() { - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (If the parameter is a whole resource.) - */ - public ParametersParameterComponent setResource(Resource value) { - this.resource = value; - return this; - } - - /** - * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) - */ - public List getPart() { - if (this.part == null) - this.part = new ArrayList(); - return this.part; - } - - public boolean hasPart() { - if (this.part == null) - return false; - for (ParametersParameterComponent item : this.part) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #part} (A named part of a parameter. In many implementation context, a set of named parts is known as a "Tuple".) - */ - // syntactic sugar - public ParametersParameterComponent addPart() { //3 - ParametersParameterComponent t = new ParametersParameterComponent(); - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return t; - } - - // syntactic sugar - public ParametersParameterComponent addPart(ParametersParameterComponent t) { //3 - if (t == null) - return this; - if (this.part == null) - this.part = new ArrayList(); - this.part.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter (reference to the operation definition).", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "If the parameter is a data type.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("resource", "Resource", "If the parameter is a whole resource.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("part", "@Parameters.parameter", "A named part of a parameter. In many implementation context, a set of named parts is known as a \"Tuple\".", 0, java.lang.Integer.MAX_VALUE, part)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Resource - case 3433459: /*part*/ return this.part == null ? new Base[0] : this.part.toArray(new Base[this.part.size()]); // ParametersParameterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - case -341064690: // resource - this.resource = castToResource(value); // Resource - break; - case 3433459: // part - this.getPart().add((ParametersParameterComponent) value); // ParametersParameterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value[x]")) - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else if (name.equals("resource")) - this.resource = castToResource(value); // Resource - else if (name.equals("part")) - this.getPart().add((ParametersParameterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type - case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // Resource - case 3433459: return addPart(); // ParametersParameterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Parameters.name"); - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else if (name.equals("valueBase64Binary")) { - this.value = new Base64BinaryType(); - return this.value; - } - else if (name.equals("valueInstant")) { - this.value = new InstantType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueUri")) { - this.value = new UriType(); - return this.value; - } - else if (name.equals("valueDate")) { - this.value = new DateType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueCode")) { - this.value = new CodeType(); - return this.value; - } - else if (name.equals("valueOid")) { - this.value = new OidType(); - return this.value; - } - else if (name.equals("valueId")) { - this.value = new IdType(); - return this.value; - } - else if (name.equals("valueUnsignedInt")) { - this.value = new UnsignedIntType(); - return this.value; - } - else if (name.equals("valuePositiveInt")) { - this.value = new PositiveIntType(); - return this.value; - } - else if (name.equals("valueMarkdown")) { - this.value = new MarkdownType(); - return this.value; - } - else if (name.equals("valueAnnotation")) { - this.value = new Annotation(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueIdentifier")) { - this.value = new Identifier(); - return this.value; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else if (name.equals("valueRatio")) { - this.value = new Ratio(); - return this.value; - } - else if (name.equals("valueSampledData")) { - this.value = new SampledData(); - return this.value; - } - else if (name.equals("valueSignature")) { - this.value = new Signature(); - return this.value; - } - else if (name.equals("valueHumanName")) { - this.value = new HumanName(); - return this.value; - } - else if (name.equals("valueAddress")) { - this.value = new Address(); - return this.value; - } - else if (name.equals("valueContactPoint")) { - this.value = new ContactPoint(); - return this.value; - } - else if (name.equals("valueTiming")) { - this.value = new Timing(); - return this.value; - } - else if (name.equals("valueReference")) { - this.value = new Reference(); - return this.value; - } - else if (name.equals("valueMeta")) { - this.value = new Meta(); - return this.value; - } - else if (name.equals("resource")) { - throw new FHIRException("Cannot call addChild on an abstract type Parameters.resource"); - } - else if (name.equals("part")) { - return addPart(); - } - else - return super.addChild(name); - } - - public ParametersParameterComponent copy() { - ParametersParameterComponent dst = new ParametersParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - dst.resource = resource == null ? null : resource.copy(); - if (part != null) { - dst.part = new ArrayList(); - for (ParametersParameterComponent i : part) - dst.part.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ParametersParameterComponent)) - return false; - ParametersParameterComponent o = (ParametersParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true) && compareDeep(resource, o.resource, true) - && compareDeep(part, o.part, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ParametersParameterComponent)) - return false; - ParametersParameterComponent o = (ParametersParameterComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - && (resource == null || resource.isEmpty()) && (part == null || part.isEmpty()); - } - - public String fhirType() { - return "null"; - - } - - } - - /** - * A parameter passed to or received from the operation. - */ - @Child(name = "parameter", type = {}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Operation Parameter", formalDefinition="A parameter passed to or received from the operation." ) - protected List parameter; - - private static final long serialVersionUID = -1495940293L; - - /** - * Constructor - */ - public Parameters() { - super(); - } - - /** - * @return {@link #parameter} (A parameter passed to or received from the operation.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ParametersParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (A parameter passed to or received from the operation.) - */ - // syntactic sugar - public ParametersParameterComponent addParameter() { //3 - ParametersParameterComponent t = new ParametersParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public Parameters addParameter(ParametersParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("parameter", "", "A parameter passed to or received from the operation.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ParametersParameterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1954460585: // parameter - this.getParameter().add((ParametersParameterComponent) value); // ParametersParameterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("parameter")) - this.getParameter().add((ParametersParameterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1954460585: return addParameter(); // ParametersParameterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("parameter")) { - return addParameter(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Parameters"; - - } - - public Parameters copy() { - Parameters dst = new Parameters(); - copyValues(dst); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ParametersParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - protected Parameters typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Parameters)) - return false; - Parameters o = (Parameters) other; - return compareDeep(parameter, o.parameter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Parameters)) - return false; - Parameters o = (Parameters) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (parameter == null || parameter.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Parameters; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Patient.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Patient.java deleted file mode 100644 index 39a5c5081f6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Patient.java +++ /dev/null @@ -1,3013 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * Demographics and other administrative information about an individual or animal receiving care or other health-related services. - */ -@ResourceDef(name="Patient", profile="http://hl7.org/fhir/Profile/Patient") -public class Patient extends DomainResource { - - public enum LinkType { - /** - * The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link. - */ - REPLACE, - /** - * The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information. - */ - REFER, - /** - * The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid. - */ - SEEALSO, - /** - * added to help the parsers - */ - NULL; - public static LinkType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return REPLACE; - if ("refer".equals(codeString)) - return REFER; - if ("seealso".equals(codeString)) - return SEEALSO; - throw new FHIRException("Unknown LinkType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REPLACE: return "replace"; - case REFER: return "refer"; - case SEEALSO: return "seealso"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REPLACE: return "http://hl7.org/fhir/link-type"; - case REFER: return "http://hl7.org/fhir/link-type"; - case SEEALSO: return "http://hl7.org/fhir/link-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REPLACE: return "The patient resource containing this link must no longer be used. The link points forward to another patient resource that must be used in lieu of the patient resource that contains this link."; - case REFER: return "The patient resource containing this link is in use and valid but not considered the main source of information about a patient. The link points forward to another patient resource that should be consulted to retrieve additional patient information."; - case SEEALSO: return "The patient resource containing this link is in use and valid, but points to another patient resource that is known to contain data about the same person. Data in this resource might overlap or contradict information found in the other patient resource. This link does not indicate any relative importance of the resources concerned, and both should be regarded as equally valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REPLACE: return "Replace"; - case REFER: return "Refer"; - case SEEALSO: return "See also"; - default: return "?"; - } - } - } - - public static class LinkTypeEnumFactory implements EnumFactory { - public LinkType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return LinkType.REPLACE; - if ("refer".equals(codeString)) - return LinkType.REFER; - if ("seealso".equals(codeString)) - return LinkType.SEEALSO; - throw new IllegalArgumentException("Unknown LinkType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("replace".equals(codeString)) - return new Enumeration(this, LinkType.REPLACE); - if ("refer".equals(codeString)) - return new Enumeration(this, LinkType.REFER); - if ("seealso".equals(codeString)) - return new Enumeration(this, LinkType.SEEALSO); - throw new FHIRException("Unknown LinkType code '"+codeString+"'"); - } - public String toCode(LinkType code) { - if (code == LinkType.REPLACE) - return "replace"; - if (code == LinkType.REFER) - return "refer"; - if (code == LinkType.SEEALSO) - return "seealso"; - return "?"; - } - public String toSystem(LinkType code) { - return code.getSystem(); - } - } - - @Block() - public static class ContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The nature of the relationship between the patient and the contact person. - */ - @Child(name = "relationship", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The kind of relationship", formalDefinition="The nature of the relationship between the patient and the contact person." ) - protected List relationship; - - /** - * A name associated with the contact person. - */ - @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="A name associated with the contact person", formalDefinition="A name associated with the contact person." ) - protected HumanName name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Address for the contact person. - */ - @Child(name = "address", type = {Address.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Address for the contact person", formalDefinition="Address for the contact person." ) - protected Address address; - - /** - * Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * Organization on behalf of which the contact is acting or for which the contact is working. - */ - @Child(name = "organization", type = {Organization.class}, order=6, min=0, max=1, modifier=false, summary=false) - @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." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - protected Organization organizationTarget; - - /** - * The period during which this contact person or organization is valid to be contacted relating to this patient. - */ - @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient", formalDefinition="The period during which this contact person or organization is valid to be contacted relating to this patient." ) - protected Period period; - - private static final long serialVersionUID = 364269017L; - - /** - * Constructor - */ - public ContactComponent() { - super(); - } - - /** - * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) - */ - public List getRelationship() { - if (this.relationship == null) - this.relationship = new ArrayList(); - return this.relationship; - } - - public boolean hasRelationship() { - if (this.relationship == null) - return false; - for (CodeableConcept item : this.relationship) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relationship} (The nature of the relationship between the patient and the contact person.) - */ - // syntactic sugar - public CodeableConcept addRelationship() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.relationship == null) - this.relationship = new ArrayList(); - this.relationship.add(t); - return t; - } - - // syntactic sugar - public ContactComponent addRelationship(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.relationship == null) - this.relationship = new ArrayList(); - this.relationship.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the contact person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the contact person.) - */ - public ContactComponent setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Address for the contact person.) - */ - public Address getAddress() { - if (this.address == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.address"); - else if (Configuration.doAutoCreate()) - this.address = new Address(); // cc - return this.address; - } - - public boolean hasAddress() { - return this.address != null && !this.address.isEmpty(); - } - - /** - * @param value {@link #address} (Address for the contact person.) - */ - public ContactComponent setAddress(Address value) { - this.address = value; - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public ContactComponent setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes. - */ - public ContactComponent setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public ContactComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization on behalf of which the contact is acting or for which the contact is working.) - */ - public ContactComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ContactComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which this contact person or organization is valid to be contacted relating to this patient.) - */ - public ContactComponent setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between the patient and the contact person.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("name", "HumanName", "A name associated with the contact person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Address for the contact person.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("organization", "Reference(Organization)", "Organization on behalf of which the contact is acting or for which the contact is working.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("period", "Period", "The period during which this contact person or organization is valid to be contacted relating to this patient.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : this.relationship.toArray(new Base[this.relationship.size()]); // CodeableConcept - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1147692044: /*address*/ return this.address == null ? new Base[0] : new Base[] {this.address}; // Address - case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -261851592: // relationship - this.getRelationship().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 3373707: // name - this.name = castToHumanName(value); // HumanName - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1147692044: // address - this.address = castToAddress(value); // Address - break; - case -1249512767: // gender - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - break; - case 1178922291: // organization - this.organization = castToReference(value); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("relationship")) - this.getRelationship().add(castToCodeableConcept(value)); - else if (name.equals("name")) - this.name = castToHumanName(value); // HumanName - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("address")) - this.address = castToAddress(value); // Address - else if (name.equals("gender")) - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -261851592: return addRelationship(); // CodeableConcept - case 3373707: return getName(); // HumanName - case -1429363305: return addTelecom(); // ContactPoint - case -1147692044: return getAddress(); // Address - case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration - case 1178922291: return getOrganization(); // Reference - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("relationship")) { - return addRelationship(); - } - else if (name.equals("name")) { - this.name = new HumanName(); - return this.name; - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("address")) { - this.address = new Address(); - return this.address; - } - else if (name.equals("gender")) { - throw new FHIRException("Cannot call addChild on a primitive type Patient.gender"); - } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public ContactComponent copy() { - ContactComponent dst = new ContactComponent(); - copyValues(dst); - if (relationship != null) { - dst.relationship = new ArrayList(); - for (CodeableConcept i : relationship) - dst.relationship.add(i.copy()); - }; - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.address = address == null ? null : address.copy(); - dst.gender = gender == null ? null : gender.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.period = period == null ? null : period.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ContactComponent)) - return false; - ContactComponent o = (ContactComponent) other; - return compareDeep(relationship, o.relationship, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) && compareDeep(organization, o.organization, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ContactComponent)) - return false; - ContactComponent o = (ContactComponent) other; - return compareValues(gender, o.gender, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) && (gender == null || gender.isEmpty()) - && (organization == null || organization.isEmpty()) && (period == null || period.isEmpty()) - ; - } - - public String fhirType() { - return "Patient.contact"; - - } - - } - - @Block() - public static class AnimalComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the high level taxonomic categorization of the kind of animal. - */ - @Child(name = "species", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="E.g. Dog, Cow", formalDefinition="Identifies the high level taxonomic categorization of the kind of animal." ) - protected CodeableConcept species; - - /** - * Identifies the detailed categorization of the kind of animal. - */ - @Child(name = "breed", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="E.g. Poodle, Angus", formalDefinition="Identifies the detailed categorization of the kind of animal." ) - protected CodeableConcept breed; - - /** - * Indicates the current state of the animal's reproductive organs. - */ - @Child(name = "genderStatus", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="E.g. Neutered, Intact", formalDefinition="Indicates the current state of the animal's reproductive organs." ) - protected CodeableConcept genderStatus; - - private static final long serialVersionUID = -549738382L; - - /** - * Constructor - */ - public AnimalComponent() { - super(); - } - - /** - * Constructor - */ - public AnimalComponent(CodeableConcept species) { - super(); - this.species = species; - } - - /** - * @return {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) - */ - public CodeableConcept getSpecies() { - if (this.species == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.species"); - else if (Configuration.doAutoCreate()) - this.species = new CodeableConcept(); // cc - return this.species; - } - - public boolean hasSpecies() { - return this.species != null && !this.species.isEmpty(); - } - - /** - * @param value {@link #species} (Identifies the high level taxonomic categorization of the kind of animal.) - */ - public AnimalComponent setSpecies(CodeableConcept value) { - this.species = value; - return this; - } - - /** - * @return {@link #breed} (Identifies the detailed categorization of the kind of animal.) - */ - public CodeableConcept getBreed() { - if (this.breed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.breed"); - else if (Configuration.doAutoCreate()) - this.breed = new CodeableConcept(); // cc - return this.breed; - } - - public boolean hasBreed() { - return this.breed != null && !this.breed.isEmpty(); - } - - /** - * @param value {@link #breed} (Identifies the detailed categorization of the kind of animal.) - */ - public AnimalComponent setBreed(CodeableConcept value) { - this.breed = value; - return this; - } - - /** - * @return {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) - */ - public CodeableConcept getGenderStatus() { - if (this.genderStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create AnimalComponent.genderStatus"); - else if (Configuration.doAutoCreate()) - this.genderStatus = new CodeableConcept(); // cc - return this.genderStatus; - } - - public boolean hasGenderStatus() { - return this.genderStatus != null && !this.genderStatus.isEmpty(); - } - - /** - * @param value {@link #genderStatus} (Indicates the current state of the animal's reproductive organs.) - */ - public AnimalComponent setGenderStatus(CodeableConcept value) { - this.genderStatus = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("species", "CodeableConcept", "Identifies the high level taxonomic categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, species)); - childrenList.add(new Property("breed", "CodeableConcept", "Identifies the detailed categorization of the kind of animal.", 0, java.lang.Integer.MAX_VALUE, breed)); - childrenList.add(new Property("genderStatus", "CodeableConcept", "Indicates the current state of the animal's reproductive organs.", 0, java.lang.Integer.MAX_VALUE, genderStatus)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept - case 94001524: /*breed*/ return this.breed == null ? new Base[0] : new Base[] {this.breed}; // CodeableConcept - case -678569453: /*genderStatus*/ return this.genderStatus == null ? new Base[0] : new Base[] {this.genderStatus}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -2008465092: // species - this.species = castToCodeableConcept(value); // CodeableConcept - break; - case 94001524: // breed - this.breed = castToCodeableConcept(value); // CodeableConcept - break; - case -678569453: // genderStatus - this.genderStatus = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("species")) - this.species = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("breed")) - this.breed = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("genderStatus")) - this.genderStatus = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -2008465092: return getSpecies(); // CodeableConcept - case 94001524: return getBreed(); // CodeableConcept - case -678569453: return getGenderStatus(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("species")) { - this.species = new CodeableConcept(); - return this.species; - } - else if (name.equals("breed")) { - this.breed = new CodeableConcept(); - return this.breed; - } - else if (name.equals("genderStatus")) { - this.genderStatus = new CodeableConcept(); - return this.genderStatus; - } - else - return super.addChild(name); - } - - public AnimalComponent copy() { - AnimalComponent dst = new AnimalComponent(); - copyValues(dst); - dst.species = species == null ? null : species.copy(); - dst.breed = breed == null ? null : breed.copy(); - dst.genderStatus = genderStatus == null ? null : genderStatus.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof AnimalComponent)) - return false; - AnimalComponent o = (AnimalComponent) other; - return compareDeep(species, o.species, true) && compareDeep(breed, o.breed, true) && compareDeep(genderStatus, o.genderStatus, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof AnimalComponent)) - return false; - AnimalComponent o = (AnimalComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (species == null || species.isEmpty()) && (breed == null || breed.isEmpty()) - && (genderStatus == null || genderStatus.isEmpty()); - } - - public String fhirType() { - return "Patient.animal"; - - } - - } - - @Block() - public static class PatientCommunicationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English. - */ - @Child(name = "language", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The language which can be used to communicate with the patient about his or her health", formalDefinition="The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English." ) - protected CodeableConcept language; - - /** - * Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). - */ - @Child(name = "preferred", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Language preference indicator", formalDefinition="Indicates whether or not the patient prefers this language (over other languages he masters up a certain level)." ) - protected BooleanType preferred; - - private static final long serialVersionUID = 633792918L; - - /** - * Constructor - */ - public PatientCommunicationComponent() { - super(); - } - - /** - * Constructor - */ - public PatientCommunicationComponent(CodeableConcept language) { - super(); - this.language = language; - } - - /** - * @return {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) - */ - public CodeableConcept getLanguage() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientCommunicationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeableConcept(); // cc - return this.language; - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. "en" for English, or "en-US" for American English versus "en-EN" for England English.) - */ - public PatientCommunicationComponent setLanguage(CodeableConcept value) { - this.language = value; - return this; - } - - /** - * @return {@link #preferred} (Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public BooleanType getPreferredElement() { - if (this.preferred == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientCommunicationComponent.preferred"); - else if (Configuration.doAutoCreate()) - this.preferred = new BooleanType(); // bb - return this.preferred; - } - - public boolean hasPreferredElement() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - public boolean hasPreferred() { - return this.preferred != null && !this.preferred.isEmpty(); - } - - /** - * @param value {@link #preferred} (Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).). This is the underlying object with id, value and extensions. The accessor "getPreferred" gives direct access to the value - */ - public PatientCommunicationComponent setPreferredElement(BooleanType value) { - this.preferred = value; - return this; - } - - /** - * @return Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). - */ - public boolean getPreferred() { - return this.preferred == null || this.preferred.isEmpty() ? false : this.preferred.getValue(); - } - - /** - * @param value Indicates whether or not the patient prefers this language (over other languages he masters up a certain level). - */ - public PatientCommunicationComponent setPreferred(boolean value) { - if (this.preferred == null) - this.preferred = new BooleanType(); - this.preferred.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("preferred", "boolean", "Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).", 0, java.lang.Integer.MAX_VALUE, preferred)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept - case -1294005119: /*preferred*/ return this.preferred == null ? new Base[0] : new Base[] {this.preferred}; // BooleanType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1613589672: // language - this.language = castToCodeableConcept(value); // CodeableConcept - break; - case -1294005119: // preferred - this.preferred = castToBoolean(value); // BooleanType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("language")) - this.language = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("preferred")) - this.preferred = castToBoolean(value); // BooleanType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1613589672: return getLanguage(); // CodeableConcept - case -1294005119: throw new FHIRException("Cannot make property preferred as it is not a complex type"); // BooleanType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("language")) { - this.language = new CodeableConcept(); - return this.language; - } - else if (name.equals("preferred")) { - throw new FHIRException("Cannot call addChild on a primitive type Patient.preferred"); - } - else - return super.addChild(name); - } - - public PatientCommunicationComponent copy() { - PatientCommunicationComponent dst = new PatientCommunicationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.preferred = preferred == null ? null : preferred.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PatientCommunicationComponent)) - return false; - PatientCommunicationComponent o = (PatientCommunicationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(preferred, o.preferred, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PatientCommunicationComponent)) - return false; - PatientCommunicationComponent o = (PatientCommunicationComponent) other; - return compareValues(preferred, o.preferred, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (preferred == null || preferred.isEmpty()) - ; - } - - public String fhirType() { - return "Patient.communication"; - - } - - } - - @Block() - public static class PatientLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The other patient resource that the link refers to. - */ - @Child(name = "other", type = {Patient.class}, order=1, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="The other patient resource that the link refers to", formalDefinition="The other patient resource that the link refers to." ) - protected Reference other; - - /** - * The actual object that is the target of the reference (The other patient resource that the link refers to.) - */ - protected Patient otherTarget; - - /** - * The type of link between this patient resource and another patient resource. - */ - @Child(name = "type", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=false) - @Description(shortDefinition="replace | refer | seealso - type of link", formalDefinition="The type of link between this patient resource and another patient resource." ) - protected Enumeration type; - - private static final long serialVersionUID = -1942104050L; - - /** - * Constructor - */ - public PatientLinkComponent() { - super(); - } - - /** - * Constructor - */ - public PatientLinkComponent(Reference other, Enumeration type) { - super(); - this.other = other; - this.type = type; - } - - /** - * @return {@link #other} (The other patient resource that the link refers to.) - */ - public Reference getOther() { - if (this.other == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.other = new Reference(); // cc - return this.other; - } - - public boolean hasOther() { - return this.other != null && !this.other.isEmpty(); - } - - /** - * @param value {@link #other} (The other patient resource that the link refers to.) - */ - public PatientLinkComponent setOther(Reference value) { - this.other = value; - return this; - } - - /** - * @return {@link #other} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.) - */ - public Patient getOtherTarget() { - if (this.otherTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.other"); - else if (Configuration.doAutoCreate()) - this.otherTarget = new Patient(); // aa - return this.otherTarget; - } - - /** - * @param value {@link #other} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The other patient resource that the link refers to.) - */ - public PatientLinkComponent setOtherTarget(Patient value) { - this.otherTarget = value; - return this; - } - - /** - * @return {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PatientLinkComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new LinkTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of link between this patient resource and another patient resource.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public PatientLinkComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of link between this patient resource and another patient resource. - */ - public LinkType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of link between this patient resource and another patient resource. - */ - public PatientLinkComponent setType(LinkType value) { - if (this.type == null) - this.type = new Enumeration(new LinkTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("other", "Reference(Patient)", "The other patient resource that the link refers to.", 0, java.lang.Integer.MAX_VALUE, other)); - childrenList.add(new Property("type", "code", "The type of link between this patient resource and another patient resource.", 0, java.lang.Integer.MAX_VALUE, type)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 106069776: /*other*/ return this.other == null ? new Base[0] : new Base[] {this.other}; // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 106069776: // other - this.other = castToReference(value); // Reference - break; - case 3575610: // type - this.type = new LinkTypeEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("other")) - this.other = castToReference(value); // Reference - else if (name.equals("type")) - this.type = new LinkTypeEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 106069776: return getOther(); // Reference - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("other")) { - this.other = new Reference(); - return this.other; - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Patient.type"); - } - else - return super.addChild(name); - } - - public PatientLinkComponent copy() { - PatientLinkComponent dst = new PatientLinkComponent(); - copyValues(dst); - dst.other = other == null ? null : other.copy(); - dst.type = type == null ? null : type.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PatientLinkComponent)) - return false; - PatientLinkComponent o = (PatientLinkComponent) other; - return compareDeep(other, o.other, true) && compareDeep(type, o.type, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PatientLinkComponent)) - return false; - PatientLinkComponent o = (PatientLinkComponent) other; - return compareValues(type, o.type, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (other == null || other.isEmpty()) && (type == null || type.isEmpty()) - ; - } - - public String fhirType() { - return "Patient.link"; - - } - - } - - /** - * An identifier for this patient. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="An identifier for this patient", formalDefinition="An identifier for this patient." ) - protected List identifier; - - /** - * Whether this patient record is in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Whether this patient's record is in active use", formalDefinition="Whether this patient record is in active use." ) - protected BooleanType active; - - /** - * A name associated with the individual. - */ - @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A name associated with the patient", formalDefinition="A name associated with the individual." ) - protected List name; - - /** - * A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List telecom; - - /** - * Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date of birth for the individual. - */ - @Child(name = "birthDate", type = {DateType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The date of birth for the individual", formalDefinition="The date of birth for the individual." ) - protected DateType birthDate; - - /** - * Indicates if the individual is deceased or not. - */ - @Child(name = "deceased", type = {BooleanType.class, DateTimeType.class}, order=6, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Indicates if the individual is deceased or not", formalDefinition="Indicates if the individual is deceased or not." ) - protected Type deceased; - - /** - * Addresses for the individual. - */ - @Child(name = "address", type = {Address.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Addresses for the individual", formalDefinition="Addresses for the individual." ) - protected List
address; - - /** - * This field contains a patient's most recent marital (civil) status. - */ - @Child(name = "maritalStatus", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Marital (civil) status of a patient", formalDefinition="This field contains a patient's most recent marital (civil) status." ) - protected CodeableConcept maritalStatus; - - /** - * Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer). - */ - @Child(name = "multipleBirth", type = {BooleanType.class, IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether patient is part of a multiple birth", formalDefinition="Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer)." ) - protected Type multipleBirth; - - /** - * Image of the patient. - */ - @Child(name = "photo", type = {Attachment.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Image of the patient", formalDefinition="Image of the patient." ) - protected List photo; - - /** - * A contact party (e.g. guardian, partner, friend) for the patient. - */ - @Child(name = "contact", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List contact; - - /** - * This patient is known to be an animal. - */ - @Child(name = "animal", type = {}, order=12, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="This patient is known to be an animal (non-human)", formalDefinition="This patient is known to be an animal." ) - protected AnimalComponent animal; - - /** - * Languages which may be used to communicate with the patient about his or her health. - */ - @Child(name = "communication", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A list of 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." ) - protected List communication; - - /** - * Patient's nominated care provider. - */ - @Child(name = "careProvider", type = {Organization.class, Practitioner.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Patient's nominated primary care provider", formalDefinition="Patient's nominated care provider." ) - protected List careProvider; - /** - * The actual objects that are the target of the reference (Patient's nominated care provider.) - */ - protected List careProviderTarget; - - - /** - * Organization that is the custodian of the patient record. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization that is the custodian of the patient record", formalDefinition="Organization that is the custodian of the patient record." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (Organization that is the custodian of the patient record.) - */ - protected Organization managingOrganizationTarget; - - /** - * Link to another patient resource that concerns the same actual patient. - */ - @Child(name = "link", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) - @Description(shortDefinition="Link to another patient resource that concerns the same actual person", formalDefinition="Link to another patient resource that concerns the same actual patient." ) - protected List link; - - private static final long serialVersionUID = 2019992554L; - - /** - * Constructor - */ - public Patient() { - super(); - } - - /** - * @return {@link #identifier} (An identifier for this patient.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An identifier for this patient.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Patient addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this patient record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Patient setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this patient record is in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether this patient record is in active use. - */ - public Patient setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #name} (A name associated with the individual.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (A name associated with the individual.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - // syntactic sugar - public Patient addName(HumanName t) { //3 - if (t == null) - return this; - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return this; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Patient addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Patient setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes. - */ - public Patient setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date of birth for the individual.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Patient setBirthDateElement(DateType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date of birth for the individual. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date of birth for the individual. - */ - public Patient setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public Type getDeceased() { - return this.deceased; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public BooleanType getDeceasedBooleanType() throws FHIRException { - if (!(this.deceased instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (BooleanType) this.deceased; - } - - public boolean hasDeceasedBooleanType() { - return this.deceased instanceof BooleanType; - } - - /** - * @return {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public DateTimeType getDeceasedDateTimeType() throws FHIRException { - if (!(this.deceased instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.deceased.getClass().getName()+" was encountered"); - return (DateTimeType) this.deceased; - } - - public boolean hasDeceasedDateTimeType() { - return this.deceased instanceof DateTimeType; - } - - public boolean hasDeceased() { - return this.deceased != null && !this.deceased.isEmpty(); - } - - /** - * @param value {@link #deceased} (Indicates if the individual is deceased or not.) - */ - public Patient setDeceased(Type value) { - this.deceased = value; - return this; - } - - /** - * @return {@link #address} (Addresses for the individual.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (Addresses for the individual.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Patient addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) - */ - public CodeableConcept getMaritalStatus() { - if (this.maritalStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.maritalStatus"); - else if (Configuration.doAutoCreate()) - this.maritalStatus = new CodeableConcept(); // cc - return this.maritalStatus; - } - - public boolean hasMaritalStatus() { - return this.maritalStatus != null && !this.maritalStatus.isEmpty(); - } - - /** - * @param value {@link #maritalStatus} (This field contains a patient's most recent marital (civil) status.) - */ - public Patient setMaritalStatus(CodeableConcept value) { - this.maritalStatus = value; - return this; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) - */ - public Type getMultipleBirth() { - return this.multipleBirth; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) - */ - public BooleanType getMultipleBirthBooleanType() throws FHIRException { - if (!(this.multipleBirth instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); - return (BooleanType) this.multipleBirth; - } - - public boolean hasMultipleBirthBooleanType() { - return this.multipleBirth instanceof BooleanType; - } - - /** - * @return {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) - */ - public IntegerType getMultipleBirthIntegerType() throws FHIRException { - if (!(this.multipleBirth instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.multipleBirth.getClass().getName()+" was encountered"); - return (IntegerType) this.multipleBirth; - } - - public boolean hasMultipleBirthIntegerType() { - return this.multipleBirth instanceof IntegerType; - } - - public boolean hasMultipleBirth() { - return this.multipleBirth != null && !this.multipleBirth.isEmpty(); - } - - /** - * @param value {@link #multipleBirth} (Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).) - */ - public Patient setMultipleBirth(Type value) { - this.multipleBirth = value; - return this; - } - - /** - * @return {@link #photo} (Image of the patient.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the patient.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - // syntactic sugar - public Patient addPhoto(Attachment t) { //3 - if (t == null) - return this; - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return this; - } - - /** - * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (A contact party (e.g. guardian, partner, friend) for the patient.) - */ - // syntactic sugar - public ContactComponent addContact() { //3 - ContactComponent t = new ContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Patient addContact(ContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #animal} (This patient is known to be an animal.) - */ - public AnimalComponent getAnimal() { - if (this.animal == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.animal"); - else if (Configuration.doAutoCreate()) - this.animal = new AnimalComponent(); // cc - return this.animal; - } - - public boolean hasAnimal() { - return this.animal != null && !this.animal.isEmpty(); - } - - /** - * @param value {@link #animal} (This patient is known to be an animal.) - */ - public Patient setAnimal(AnimalComponent value) { - this.animal = value; - return this; - } - - /** - * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) - */ - public List getCommunication() { - if (this.communication == null) - this.communication = new ArrayList(); - return this.communication; - } - - public boolean hasCommunication() { - if (this.communication == null) - return false; - for (PatientCommunicationComponent item : this.communication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #communication} (Languages which may be used to communicate with the patient about his or her health.) - */ - // syntactic sugar - public PatientCommunicationComponent addCommunication() { //3 - PatientCommunicationComponent t = new PatientCommunicationComponent(); - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return t; - } - - // syntactic sugar - public Patient addCommunication(PatientCommunicationComponent t) { //3 - if (t == null) - return this; - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return this; - } - - /** - * @return {@link #careProvider} (Patient's nominated care provider.) - */ - public List getCareProvider() { - if (this.careProvider == null) - this.careProvider = new ArrayList(); - return this.careProvider; - } - - public boolean hasCareProvider() { - if (this.careProvider == null) - return false; - for (Reference item : this.careProvider) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #careProvider} (Patient's nominated care provider.) - */ - // syntactic sugar - public Reference addCareProvider() { //3 - Reference t = new Reference(); - if (this.careProvider == null) - this.careProvider = new ArrayList(); - this.careProvider.add(t); - return t; - } - - // syntactic sugar - public Patient addCareProvider(Reference t) { //3 - if (t == null) - return this; - if (this.careProvider == null) - this.careProvider = new ArrayList(); - this.careProvider.add(t); - return this; - } - - /** - * @return {@link #careProvider} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Patient's nominated care provider.) - */ - public List getCareProviderTarget() { - if (this.careProviderTarget == null) - this.careProviderTarget = new ArrayList(); - return this.careProviderTarget; - } - - /** - * @return {@link #managingOrganization} (Organization that is the custodian of the patient record.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (Organization that is the custodian of the patient record.) - */ - public Patient setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Patient.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that is the custodian of the patient record.) - */ - public Patient setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (PatientLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Link to another patient resource that concerns the same actual patient.) - */ - // syntactic sugar - public PatientLinkComponent addLink() { //3 - PatientLinkComponent t = new PatientLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public Patient addLink(PatientLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier for this patient.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("active", "boolean", "Whether this patient record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("name", "HumanName", "A name associated with the individual.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "date", "The date of birth for the individual.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("deceased[x]", "boolean|dateTime", "Indicates if the individual is deceased or not.", 0, java.lang.Integer.MAX_VALUE, deceased)); - childrenList.add(new Property("address", "Address", "Addresses for the individual.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("maritalStatus", "CodeableConcept", "This field contains a patient's most recent marital (civil) status.", 0, java.lang.Integer.MAX_VALUE, maritalStatus)); - childrenList.add(new Property("multipleBirth[x]", "boolean|integer", "Indicates whether the patient is part of a multiple (bool) or indicates the actual birth order (integer).", 0, java.lang.Integer.MAX_VALUE, multipleBirth)); - childrenList.add(new Property("photo", "Attachment", "Image of the patient.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("contact", "", "A contact party (e.g. guardian, partner, friend) for the patient.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("animal", "", "This patient is known to be an animal.", 0, java.lang.Integer.MAX_VALUE, animal)); - childrenList.add(new Property("communication", "", "Languages which may be used to communicate with the patient about his or her health.", 0, java.lang.Integer.MAX_VALUE, communication)); - childrenList.add(new Property("careProvider", "Reference(Organization|Practitioner)", "Patient's nominated care provider.", 0, java.lang.Integer.MAX_VALUE, careProvider)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "Organization that is the custodian of the patient record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("link", "", "Link to another patient resource that concerns the same actual patient.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType - case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration - case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType - case 561497972: /*deceased*/ return this.deceased == null ? new Base[0] : new Base[] {this.deceased}; // Type - case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address - case 1756919302: /*maritalStatus*/ return this.maritalStatus == null ? new Base[0] : new Base[] {this.maritalStatus}; // CodeableConcept - case -677369713: /*multipleBirth*/ return this.multipleBirth == null ? new Base[0] : new Base[] {this.multipleBirth}; // Type - case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactComponent - case -1413116420: /*animal*/ return this.animal == null ? new Base[0] : new Base[] {this.animal}; // AnimalComponent - case -1035284522: /*communication*/ return this.communication == null ? new Base[0] : this.communication.toArray(new Base[this.communication.size()]); // PatientCommunicationComponent - case 1963803682: /*careProvider*/ return this.careProvider == null ? new Base[0] : this.careProvider.toArray(new Base[this.careProvider.size()]); // Reference - case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference - case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PatientLinkComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1422950650: // active - this.active = castToBoolean(value); // BooleanType - break; - case 3373707: // name - this.getName().add(castToHumanName(value)); // HumanName - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1249512767: // gender - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - break; - case -1210031859: // birthDate - this.birthDate = castToDate(value); // DateType - break; - case 561497972: // deceased - this.deceased = (Type) value; // Type - break; - case -1147692044: // address - this.getAddress().add(castToAddress(value)); // Address - break; - case 1756919302: // maritalStatus - this.maritalStatus = castToCodeableConcept(value); // CodeableConcept - break; - case -677369713: // multipleBirth - this.multipleBirth = (Type) value; // Type - break; - case 106642994: // photo - this.getPhoto().add(castToAttachment(value)); // Attachment - break; - case 951526432: // contact - this.getContact().add((ContactComponent) value); // ContactComponent - break; - case -1413116420: // animal - this.animal = (AnimalComponent) value; // AnimalComponent - break; - case -1035284522: // communication - this.getCommunication().add((PatientCommunicationComponent) value); // PatientCommunicationComponent - break; - case 1963803682: // careProvider - this.getCareProvider().add(castToReference(value)); // Reference - break; - case -2058947787: // managingOrganization - this.managingOrganization = castToReference(value); // Reference - break; - case 3321850: // link - this.getLink().add((PatientLinkComponent) value); // PatientLinkComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("active")) - this.active = castToBoolean(value); // BooleanType - else if (name.equals("name")) - this.getName().add(castToHumanName(value)); - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("gender")) - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - else if (name.equals("birthDate")) - this.birthDate = castToDate(value); // DateType - else if (name.equals("deceased[x]")) - this.deceased = (Type) value; // Type - else if (name.equals("address")) - this.getAddress().add(castToAddress(value)); - else if (name.equals("maritalStatus")) - this.maritalStatus = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("multipleBirth[x]")) - this.multipleBirth = (Type) value; // Type - else if (name.equals("photo")) - this.getPhoto().add(castToAttachment(value)); - else if (name.equals("contact")) - this.getContact().add((ContactComponent) value); - else if (name.equals("animal")) - this.animal = (AnimalComponent) value; // AnimalComponent - else if (name.equals("communication")) - this.getCommunication().add((PatientCommunicationComponent) value); - else if (name.equals("careProvider")) - this.getCareProvider().add(castToReference(value)); - else if (name.equals("managingOrganization")) - this.managingOrganization = castToReference(value); // Reference - else if (name.equals("link")) - this.getLink().add((PatientLinkComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType - case 3373707: return addName(); // HumanName - case -1429363305: return addTelecom(); // ContactPoint - case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration - case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType - case -1311442804: return getDeceased(); // Type - case -1147692044: return addAddress(); // Address - case 1756919302: return getMaritalStatus(); // CodeableConcept - case -1764672111: return getMultipleBirth(); // Type - case 106642994: return addPhoto(); // Attachment - case 951526432: return addContact(); // ContactComponent - case -1413116420: return getAnimal(); // AnimalComponent - case -1035284522: return addCommunication(); // PatientCommunicationComponent - case 1963803682: return addCareProvider(); // Reference - case -2058947787: return getManagingOrganization(); // Reference - case 3321850: return addLink(); // PatientLinkComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("active")) { - throw new FHIRException("Cannot call addChild on a primitive type Patient.active"); - } - else if (name.equals("name")) { - return addName(); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("gender")) { - throw new FHIRException("Cannot call addChild on a primitive type Patient.gender"); - } - else if (name.equals("birthDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Patient.birthDate"); - } - else if (name.equals("deceasedBoolean")) { - this.deceased = new BooleanType(); - return this.deceased; - } - else if (name.equals("deceasedDateTime")) { - this.deceased = new DateTimeType(); - return this.deceased; - } - else if (name.equals("address")) { - return addAddress(); - } - else if (name.equals("maritalStatus")) { - this.maritalStatus = new CodeableConcept(); - return this.maritalStatus; - } - else if (name.equals("multipleBirthBoolean")) { - this.multipleBirth = new BooleanType(); - return this.multipleBirth; - } - else if (name.equals("multipleBirthInteger")) { - this.multipleBirth = new IntegerType(); - return this.multipleBirth; - } - else if (name.equals("photo")) { - return addPhoto(); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("animal")) { - this.animal = new AnimalComponent(); - return this.animal; - } - else if (name.equals("communication")) { - return addCommunication(); - } - else if (name.equals("careProvider")) { - return addCareProvider(); - } - else if (name.equals("managingOrganization")) { - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - else if (name.equals("link")) { - return addLink(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Patient"; - - } - - public Patient copy() { - Patient dst = new Patient(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - dst.deceased = deceased == null ? null : deceased.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.maritalStatus = maritalStatus == null ? null : maritalStatus.copy(); - dst.multipleBirth = multipleBirth == null ? null : multipleBirth.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.animal = animal == null ? null : animal.copy(); - if (communication != null) { - dst.communication = new ArrayList(); - for (PatientCommunicationComponent i : communication) - dst.communication.add(i.copy()); - }; - if (careProvider != null) { - dst.careProvider = new ArrayList(); - for (Reference i : careProvider) - dst.careProvider.add(i.copy()); - }; - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (PatientLinkComponent i : link) - dst.link.add(i.copy()); - }; - return dst; - } - - protected Patient typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Patient)) - return false; - Patient o = (Patient) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(name, o.name, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) - && compareDeep(deceased, o.deceased, true) && compareDeep(address, o.address, true) && compareDeep(maritalStatus, o.maritalStatus, true) - && compareDeep(multipleBirth, o.multipleBirth, true) && compareDeep(photo, o.photo, true) && compareDeep(contact, o.contact, true) - && compareDeep(animal, o.animal, true) && compareDeep(communication, o.communication, true) && compareDeep(careProvider, o.careProvider, true) - && compareDeep(managingOrganization, o.managingOrganization, true) && compareDeep(link, o.link, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Patient)) - return false; - Patient o = (Patient) other; - return compareValues(active, o.active, true) && compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) - && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) - && (birthDate == null || birthDate.isEmpty()) && (deceased == null || deceased.isEmpty()) - && (address == null || address.isEmpty()) && (maritalStatus == null || maritalStatus.isEmpty()) - && (multipleBirth == null || multipleBirth.isEmpty()) && (photo == null || photo.isEmpty()) - && (contact == null || contact.isEmpty()) && (animal == null || animal.isEmpty()) && (communication == null || communication.isEmpty()) - && (careProvider == null || careProvider.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (link == null || link.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Patient; - } - - /** - * Search parameter: phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: Patient.telecom(system=phone)
- *

- */ - @SearchParamDefinition(name="phone", path="Patient.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) - public static final String SP_PHONE = "phone"; - /** - * Fluent Client search parameter constant for phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: Patient.telecom(system=phone)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); - - /** - * Search parameter: phonetic - *

- * Description: A portion of either family or given name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Patient.name
- *

- */ - @SearchParamDefinition(name="phonetic", path="Patient.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: Patient.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Patient:link". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Patient:link").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam ANIMAL_SPECIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ANIMAL_SPECIES); - - /** - * Search parameter: organization - *

- * Description: The organization at which this person is a patient
- * Type: reference
- * Path: Patient.managingOrganization
- *

- */ - @SearchParamDefinition(name="organization", path="Patient.managingOrganization", description="The organization at which this person is a patient", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - /** - * Fluent Client search parameter constant for organization - *

- * Description: The organization at which this person is a patient
- * Type: reference
- * Path: Patient.managingOrganization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Patient:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Patient:organization").toLocked(); - - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Patient.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="Patient.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Patient.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam GIVEN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_GIVEN); - - /** - * Search parameter: careprovider - *

- * Description: Patient's nominated care provider, could be a care manager, not the organization that manages the record
- * Type: reference
- * Path: Patient.careProvider
- *

- */ - @SearchParamDefinition(name="careprovider", path="Patient.careProvider", description="Patient's nominated care provider, could be a care manager, not the organization that manages the record", type="reference" ) - public static final String SP_CAREPROVIDER = "careprovider"; - /** - * Fluent Client search parameter constant for careprovider - *

- * Description: Patient's nominated care provider, could be a care manager, not the organization that manages the record
- * Type: reference
- * Path: Patient.careProvider
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CAREPROVIDER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CAREPROVIDER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Patient:careprovider". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CAREPROVIDER = new ca.uhn.fhir.model.api.Include("Patient:careprovider").toLocked(); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam FAMILY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_FAMILY); - - /** - * Search parameter: death-date - *

- * Description: The date of death has been provided and satisfies this search value
- * Type: date
- * Path: Patient.deceasedDateTime
- *

- */ - @SearchParamDefinition(name="death-date", path="Patient.deceased.as(DateTime)", description="The date of death has been provided and satisfies this search value", type="date" ) - public static final String SP_DEATH_DATE = "death-date"; - /** - * Fluent Client search parameter constant for death-date - *

- * Description: The date of death has been provided and satisfies this search value
- * Type: date
- * Path: Patient.deceasedDateTime
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DEATH_DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DEATH_DATE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: telecom - *

- * Description: The value in any kind of telecom details of the patient
- * Type: token
- * Path: Patient.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="Patient.telecom", description="The value in any kind of telecom details of the patient", type="token" ) - 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: token
- * Path: Patient.telecom
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); - - /** - * Search parameter: deceased - *

- * Description: This patient has been marked as deceased, or as a death date entered
- * Type: token
- * Path: Patient.deceased[x]
- *

- */ - @SearchParamDefinition(name="deceased", path="Patient.deceased.exists()", description="This patient has been marked as deceased, or as a death date entered", type="token" ) - public static final String SP_DECEASED = "deceased"; - /** - * Fluent Client search parameter constant for deceased - *

- * Description: This patient has been marked as deceased, or as a death date entered
- * Type: token
- * Path: Patient.deceased[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam DECEASED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DECEASED); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam ANIMAL_BREED = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ANIMAL_BREED); - - /** - * Search parameter: address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Patient.address.country
- *

- */ - @SearchParamDefinition(name="address-country", path="Patient.address.country", description="A country specified in an address", type="string" ) - public static final String SP_ADDRESS_COUNTRY = "address-country"; - /** - * Fluent Client search parameter constant for address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Patient.address.country
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); - - /** - * Search parameter: address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Patient.address.state
- *

- */ - @SearchParamDefinition(name="address-state", path="Patient.address.state", description="A state specified in an address", type="string" ) - public static final String SP_ADDRESS_STATE = "address-state"; - /** - * Fluent Client search parameter constant for address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Patient.address.state
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); - - /** - * Search parameter: email - *

- * Description: A value in an email contact
- * Type: token
- * Path: Patient.telecom(system=email)
- *

- */ - @SearchParamDefinition(name="email", path="Patient.telecom.where(system='email')", description="A value in an email contact", type="token" ) - public static final String SP_EMAIL = "email"; - /** - * Fluent Client search parameter constant for email - *

- * Description: A value in an email contact
- * Type: token
- * Path: Patient.telecom(system=email)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Patient.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="Patient.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Patient.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam ACTIVE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTIVE); - - /** - * Search parameter: language - *

- * Description: Language code (irrespective of use value)
- * Type: token
- * Path: Patient.communication.language
- *

- */ - @SearchParamDefinition(name="language", path="Patient.communication.language", 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.language
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam LANGUAGE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_LANGUAGE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: address-postalcode - *

- * Description: A postalCode specified in an address
- * Type: string
- * Path: Patient.address.postalCode
- *

- */ - @SearchParamDefinition(name="address-postalcode", path="Patient.address.postalCode", description="A postalCode specified in an address", type="string" ) - public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; - /** - * Fluent Client search parameter constant for address-postalcode - *

- * Description: A postalCode specified in an address
- * Type: string
- * Path: Patient.address.postalCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PaymentNotice.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PaymentNotice.java deleted file mode 100644 index b455e4b628a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PaymentNotice.java +++ /dev/null @@ -1,1100 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * This resource provides the status of the payment for goods and services rendered, and the request and response resource references. - */ -@ResourceDef(name="PaymentNotice", profile="http://hl7.org/fhir/Profile/PaymentNotice") -public class PaymentNotice extends DomainResource { - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The Insurer who is target of the request. - */ - @Child(name = "target", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer or Regulatory body", formalDefinition="The Insurer who is target of the request." ) - protected Type target; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type provider; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type organization; - - /** - * Reference of resource to reverse. - */ - @Child(name = "request", type = {Identifier.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource to reverse." ) - protected Type request; - - /** - * Reference of response to resource to reverse. - */ - @Child(name = "response", type = {Identifier.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Response reference", formalDefinition="Reference of response to resource to reverse." ) - protected Type response; - - /** - * The payment status, typically paid: payment sent, cleared: payment received. - */ - @Child(name = "paymentStatus", type = {Coding.class}, order=9, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Status of the payment", formalDefinition="The payment status, typically paid: payment sent, cleared: payment received." ) - protected Coding paymentStatus; - - /** - * The date when the above payment action occurrred. - */ - @Child(name = "statusDate", type = {DateType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payment or clearing date", formalDefinition="The date when the above payment action occurrred." ) - protected DateType statusDate; - - private static final long serialVersionUID = -771143315L; - - /** - * Constructor - */ - public PaymentNotice() { - super(); - } - - /** - * Constructor - */ - public PaymentNotice(Coding paymentStatus) { - super(); - this.paymentStatus = paymentStatus; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PaymentNotice addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public PaymentNotice setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PaymentNotice setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public PaymentNotice setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public PaymentNotice setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Identifier getTargetIdentifier() throws FHIRException { - if (!(this.target instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Identifier) this.target; - } - - public boolean hasTargetIdentifier() { - return this.target instanceof Identifier; - } - - /** - * @return {@link #target} (The Insurer who is target of the request.) - */ - public Reference getTargetReference() throws FHIRException { - if (!(this.target instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTargetReference() { - return this.target instanceof Reference; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The Insurer who is target of the request.) - */ - public PaymentNotice setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentNotice setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentNotice setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Reference of resource to reverse.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource to reverse.) - */ - public PaymentNotice setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Type getResponse() { - return this.response; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Identifier getResponseIdentifier() throws FHIRException { - if (!(this.response instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.response.getClass().getName()+" was encountered"); - return (Identifier) this.response; - } - - public boolean hasResponseIdentifier() { - return this.response instanceof Identifier; - } - - /** - * @return {@link #response} (Reference of response to resource to reverse.) - */ - public Reference getResponseReference() throws FHIRException { - if (!(this.response instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.response.getClass().getName()+" was encountered"); - return (Reference) this.response; - } - - public boolean hasResponseReference() { - return this.response instanceof Reference; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of response to resource to reverse.) - */ - public PaymentNotice setResponse(Type value) { - this.response = value; - return this; - } - - /** - * @return {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) - */ - public Coding getPaymentStatus() { - if (this.paymentStatus == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.paymentStatus"); - else if (Configuration.doAutoCreate()) - this.paymentStatus = new Coding(); // cc - return this.paymentStatus; - } - - public boolean hasPaymentStatus() { - return this.paymentStatus != null && !this.paymentStatus.isEmpty(); - } - - /** - * @param value {@link #paymentStatus} (The payment status, typically paid: payment sent, cleared: payment received.) - */ - public PaymentNotice setPaymentStatus(Coding value) { - this.paymentStatus = value; - return this; - } - - /** - * @return {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public DateType getStatusDateElement() { - if (this.statusDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentNotice.statusDate"); - else if (Configuration.doAutoCreate()) - this.statusDate = new DateType(); // bb - return this.statusDate; - } - - public boolean hasStatusDateElement() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - public boolean hasStatusDate() { - return this.statusDate != null && !this.statusDate.isEmpty(); - } - - /** - * @param value {@link #statusDate} (The date when the above payment action occurrred.). This is the underlying object with id, value and extensions. The accessor "getStatusDate" gives direct access to the value - */ - public PaymentNotice setStatusDateElement(DateType value) { - this.statusDate = value; - return this; - } - - /** - * @return The date when the above payment action occurrred. - */ - public Date getStatusDate() { - return this.statusDate == null ? null : this.statusDate.getValue(); - } - - /** - * @param value The date when the above payment action occurrred. - */ - public PaymentNotice setStatusDate(Date value) { - if (value == null) - this.statusDate = null; - else { - if (this.statusDate == null) - this.statusDate = new DateType(); - this.statusDate.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The Insurer who is target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "Reference of resource to reverse.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response[x]", "Identifier|Reference(Any)", "Reference of response to resource to reverse.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("paymentStatus", "Coding", "The payment status, typically paid: payment sent, cleared: payment received.", 0, java.lang.Integer.MAX_VALUE, paymentStatus)); - childrenList.add(new Property("statusDate", "date", "The date when the above payment action occurrred.", 0, java.lang.Integer.MAX_VALUE, statusDate)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Type - case 1430704536: /*paymentStatus*/ return this.paymentStatus == null ? new Base[0] : new Base[] {this.paymentStatus}; // Coding - case 247524032: /*statusDate*/ return this.statusDate == null ? new Base[0] : new Base[] {this.statusDate}; // DateType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -880905839: // target - this.target = (Type) value; // Type - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case -340323263: // response - this.response = (Type) value; // Type - break; - case 1430704536: // paymentStatus - this.paymentStatus = castToCoding(value); // Coding - break; - case 247524032: // statusDate - this.statusDate = castToDate(value); // DateType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("target[x]")) - this.target = (Type) value; // Type - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("response[x]")) - this.response = (Type) value; // Type - else if (name.equals("paymentStatus")) - this.paymentStatus = castToCoding(value); // Coding - else if (name.equals("statusDate")) - this.statusDate = castToDate(value); // DateType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -815579825: return getTarget(); // Type - case 2064698607: return getProvider(); // Type - case 1326483053: return getOrganization(); // Type - case 37106577: return getRequest(); // Type - case 1847549087: return getResponse(); // Type - case 1430704536: return getPaymentStatus(); // Coding - case 247524032: throw new FHIRException("Cannot make property statusDate as it is not a complex type"); // DateType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.created"); - } - else if (name.equals("targetIdentifier")) { - this.target = new Identifier(); - return this.target; - } - else if (name.equals("targetReference")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("responseIdentifier")) { - this.response = new Identifier(); - return this.response; - } - else if (name.equals("responseReference")) { - this.response = new Reference(); - return this.response; - } - else if (name.equals("paymentStatus")) { - this.paymentStatus = new Coding(); - return this.paymentStatus; - } - else if (name.equals("statusDate")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentNotice.statusDate"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "PaymentNotice"; - - } - - public PaymentNotice copy() { - PaymentNotice dst = new PaymentNotice(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.paymentStatus = paymentStatus == null ? null : paymentStatus.copy(); - dst.statusDate = statusDate == null ? null : statusDate.copy(); - return dst; - } - - protected PaymentNotice typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PaymentNotice)) - return false; - PaymentNotice o = (PaymentNotice) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) - && compareDeep(organization, o.organization, true) && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) - && compareDeep(paymentStatus, o.paymentStatus, true) && compareDeep(statusDate, o.statusDate, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PaymentNotice)) - return false; - PaymentNotice o = (PaymentNotice) other; - return compareValues(created, o.created, true) && compareValues(statusDate, o.statusDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (originalRuleset == null || originalRuleset.isEmpty()) && (created == null || created.isEmpty()) - && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) && (organization == null || organization.isEmpty()) - && (request == null || request.isEmpty()) && (response == null || response.isEmpty()) && (paymentStatus == null || paymentStatus.isEmpty()) - && (statusDate == null || statusDate.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PaymentNotice; - } - - /** - * Search parameter: paymentstatus - *

- * Description: The type of payment notice
- * Type: token
- * Path: PaymentNotice.paymentStatus
- *

- */ - @SearchParamDefinition(name="paymentstatus", path="PaymentNotice.paymentStatus", description="The type of payment notice", type="token" ) - public static final String SP_PAYMENTSTATUS = "paymentstatus"; - /** - * Fluent Client search parameter constant for paymentstatus - *

- * Description: The type of payment notice
- * Type: token
- * Path: PaymentNotice.paymentStatus
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PAYMENTSTATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PAYMENTSTATUS); - - /** - * Search parameter: statusdate - *

- * Description: The date of the payment action
- * Type: date
- * Path: PaymentNotice.statusDate
- *

- */ - @SearchParamDefinition(name="statusdate", path="PaymentNotice.statusDate", description="The date of the payment action", type="date" ) - public static final String SP_STATUSDATE = "statusdate"; - /** - * Fluent Client search parameter constant for statusdate - *

- * Description: The date of the payment action
- * Type: date
- * Path: PaymentNotice.statusDate
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam STATUSDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_STATUSDATE); - - /** - * Search parameter: created - *

- * Description: Creation date fro the notice
- * Type: date
- * Path: PaymentNotice.created
- *

- */ - @SearchParamDefinition(name="created", path="PaymentNotice.created", description="Creation date fro the notice", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: Creation date fro the notice
- * Type: date
- * Path: PaymentNotice.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: requestidentifier - *

- * Description: The Claim
- * Type: token
- * Path: PaymentNotice.requestIdentifier
- *

- */ - @SearchParamDefinition(name="requestidentifier", path="PaymentNotice.request.as(Identifier)", description="The Claim", type="token" ) - public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; - /** - * Fluent Client search parameter constant for requestidentifier - *

- * Description: The Claim
- * Type: token
- * Path: PaymentNotice.requestIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); - - /** - * Search parameter: providerreference - *

- * Description: The reference to the provider
- * Type: reference
- * Path: PaymentNotice.providerReference
- *

- */ - @SearchParamDefinition(name="providerreference", path="PaymentNotice.provider.as(Reference)", description="The reference to the provider", type="reference" ) - public static final String SP_PROVIDERREFERENCE = "providerreference"; - /** - * Fluent Client search parameter constant for providerreference - *

- * Description: The reference to the provider
- * Type: reference
- * Path: PaymentNotice.providerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentNotice:providerreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:providerreference").toLocked(); - - /** - * Search parameter: requestreference - *

- * Description: The Claim
- * Type: reference
- * Path: PaymentNotice.requestReference
- *

- */ - @SearchParamDefinition(name="requestreference", path="PaymentNotice.request.as(Reference)", description="The Claim", type="reference" ) - public static final String SP_REQUESTREFERENCE = "requestreference"; - /** - * Fluent Client search parameter constant for requestreference - *

- * Description: The Claim
- * Type: reference
- * Path: PaymentNotice.requestReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentNotice:requestreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:requestreference").toLocked(); - - /** - * Search parameter: responsereference - *

- * Description: The ClaimResponse
- * Type: reference
- * Path: PaymentNotice.responseReference
- *

- */ - @SearchParamDefinition(name="responsereference", path="PaymentNotice.response.as(Reference)", description="The ClaimResponse", type="reference" ) - public static final String SP_RESPONSEREFERENCE = "responsereference"; - /** - * Fluent Client search parameter constant for responsereference - *

- * Description: The ClaimResponse
- * Type: reference
- * Path: PaymentNotice.responseReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RESPONSEREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RESPONSEREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentNotice:responsereference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RESPONSEREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:responsereference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: PaymentNotice.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="PaymentNotice.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: PaymentNotice.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: PaymentNotice.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="PaymentNotice.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: PaymentNotice.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentNotice:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentNotice:organizationreference").toLocked(); - - /** - * Search parameter: responseidentifier - *

- * Description: The ClaimResponse
- * Type: token
- * Path: PaymentNotice.responseIdentifier
- *

- */ - @SearchParamDefinition(name="responseidentifier", path="PaymentNotice.response.as(Identifier)", description="The ClaimResponse", type="token" ) - public static final String SP_RESPONSEIDENTIFIER = "responseidentifier"; - /** - * Fluent Client search parameter constant for responseidentifier - *

- * Description: The ClaimResponse
- * Type: token
- * Path: PaymentNotice.responseIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam RESPONSEIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_RESPONSEIDENTIFIER); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the notice
- * Type: token
- * Path: PaymentNotice.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="PaymentNotice.identifier", description="The business identifier of the notice", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the notice
- * Type: token
- * Path: PaymentNotice.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: provideridentifier - *

- * Description: The reference to the provider
- * Type: token
- * Path: PaymentNotice.providerIdentifier
- *

- */ - @SearchParamDefinition(name="provideridentifier", path="PaymentNotice.provider.as(Identifier)", description="The reference to the provider", type="token" ) - public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; - /** - * Fluent Client search parameter constant for provideridentifier - *

- * Description: The reference to the provider
- * Type: token
- * Path: PaymentNotice.providerIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java deleted file mode 100644 index c821a890932..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PaymentReconciliation.java +++ /dev/null @@ -1,2056 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcome; -import org.hl7.fhir.dstu2016may.model.Enumerations.RemittanceOutcomeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides payment details and claim references supporting a bulk payment. - */ -@ResourceDef(name="PaymentReconciliation", profile="http://hl7.org/fhir/Profile/PaymentReconciliation") -public class PaymentReconciliation extends DomainResource { - - @Block() - public static class DetailsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code to indicate the nature of the payment, adjustment, funds advance, etc. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type code", formalDefinition="Code to indicate the nature of the payment, adjustment, funds advance, etc." ) - protected Coding type; - - /** - * The claim or financial resource. - */ - @Child(name = "request", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim", formalDefinition="The claim or financial resource." ) - protected Type request; - - /** - * The claim response resource. - */ - @Child(name = "responce", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim Response", formalDefinition="The claim response resource." ) - protected Type responce; - - /** - * The Organization which submitted the invoice or financial transaction. - */ - @Child(name = "submitter", type = {Identifier.class, Organization.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Submitter", formalDefinition="The Organization which submitted the invoice or financial transaction." ) - protected Type submitter; - - /** - * The organization which is receiving the payment. - */ - @Child(name = "payee", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Payee", formalDefinition="The organization which is receiving the payment." ) - protected Type payee; - - /** - * The date of the invoice or financial resource. - */ - @Child(name = "date", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Invoice date", formalDefinition="The date of the invoice or financial resource." ) - protected DateType date; - - /** - * Amount paid for this detail. - */ - @Child(name = "amount", type = {Money.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Detail amount", formalDefinition="Amount paid for this detail." ) - protected Money amount; - - private static final long serialVersionUID = 1706468339L; - - /** - * Constructor - */ - public DetailsComponent() { - super(); - } - - /** - * Constructor - */ - public DetailsComponent(Coding type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Code to indicate the nature of the payment, adjustment, funds advance, etc.) - */ - public DetailsComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #request} (The claim or financial resource.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (The claim or financial resource.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (The claim or financial resource.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (The claim or financial resource.) - */ - public DetailsComponent setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #responce} (The claim response resource.) - */ - public Type getResponce() { - return this.responce; - } - - /** - * @return {@link #responce} (The claim response resource.) - */ - public Identifier getResponceIdentifier() throws FHIRException { - if (!(this.responce instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.responce.getClass().getName()+" was encountered"); - return (Identifier) this.responce; - } - - public boolean hasResponceIdentifier() { - return this.responce instanceof Identifier; - } - - /** - * @return {@link #responce} (The claim response resource.) - */ - public Reference getResponceReference() throws FHIRException { - if (!(this.responce instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.responce.getClass().getName()+" was encountered"); - return (Reference) this.responce; - } - - public boolean hasResponceReference() { - return this.responce instanceof Reference; - } - - public boolean hasResponce() { - return this.responce != null && !this.responce.isEmpty(); - } - - /** - * @param value {@link #responce} (The claim response resource.) - */ - public DetailsComponent setResponce(Type value) { - this.responce = value; - return this; - } - - /** - * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public Type getSubmitter() { - return this.submitter; - } - - /** - * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public Identifier getSubmitterIdentifier() throws FHIRException { - if (!(this.submitter instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.submitter.getClass().getName()+" was encountered"); - return (Identifier) this.submitter; - } - - public boolean hasSubmitterIdentifier() { - return this.submitter instanceof Identifier; - } - - /** - * @return {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public Reference getSubmitterReference() throws FHIRException { - if (!(this.submitter instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.submitter.getClass().getName()+" was encountered"); - return (Reference) this.submitter; - } - - public boolean hasSubmitterReference() { - return this.submitter instanceof Reference; - } - - public boolean hasSubmitter() { - return this.submitter != null && !this.submitter.isEmpty(); - } - - /** - * @param value {@link #submitter} (The Organization which submitted the invoice or financial transaction.) - */ - public DetailsComponent setSubmitter(Type value) { - this.submitter = value; - return this; - } - - /** - * @return {@link #payee} (The organization which is receiving the payment.) - */ - public Type getPayee() { - return this.payee; - } - - /** - * @return {@link #payee} (The organization which is receiving the payment.) - */ - public Identifier getPayeeIdentifier() throws FHIRException { - if (!(this.payee instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.payee.getClass().getName()+" was encountered"); - return (Identifier) this.payee; - } - - public boolean hasPayeeIdentifier() { - return this.payee instanceof Identifier; - } - - /** - * @return {@link #payee} (The organization which is receiving the payment.) - */ - public Reference getPayeeReference() throws FHIRException { - if (!(this.payee instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.payee.getClass().getName()+" was encountered"); - return (Reference) this.payee; - } - - public boolean hasPayeeReference() { - return this.payee instanceof Reference; - } - - public boolean hasPayee() { - return this.payee != null && !this.payee.isEmpty(); - } - - /** - * @param value {@link #payee} (The organization which is receiving the payment.) - */ - public DetailsComponent setPayee(Type value) { - this.payee = value; - return this; - } - - /** - * @return {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date of the invoice or financial resource.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DetailsComponent setDateElement(DateType value) { - this.date = value; - return this; - } - - /** - * @return The date of the invoice or financial resource. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date of the invoice or financial resource. - */ - public DetailsComponent setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #amount} (Amount paid for this detail.) - */ - public Money getAmount() { - if (this.amount == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create DetailsComponent.amount"); - else if (Configuration.doAutoCreate()) - this.amount = new Money(); // cc - return this.amount; - } - - public boolean hasAmount() { - return this.amount != null && !this.amount.isEmpty(); - } - - /** - * @param value {@link #amount} (Amount paid for this detail.) - */ - public DetailsComponent setAmount(Money value) { - this.amount = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Code to indicate the nature of the payment, adjustment, funds advance, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "The claim or financial resource.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("responce[x]", "Identifier|Reference(Any)", "The claim response resource.", 0, java.lang.Integer.MAX_VALUE, responce)); - childrenList.add(new Property("submitter[x]", "Identifier|Reference(Organization)", "The Organization which submitted the invoice or financial transaction.", 0, java.lang.Integer.MAX_VALUE, submitter)); - childrenList.add(new Property("payee[x]", "Identifier|Reference(Organization)", "The organization which is receiving the payment.", 0, java.lang.Integer.MAX_VALUE, payee)); - childrenList.add(new Property("date", "date", "The date of the invoice or financial resource.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("amount", "Money", "Amount paid for this detail.", 0, java.lang.Integer.MAX_VALUE, amount)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -340323759: /*responce*/ return this.responce == null ? new Base[0] : new Base[] {this.responce}; // Type - case 348678409: /*submitter*/ return this.submitter == null ? new Base[0] : new Base[] {this.submitter}; // Type - case 106443592: /*payee*/ return this.payee == null ? new Base[0] : new Base[] {this.payee}; // Type - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateType - case -1413853096: /*amount*/ return this.amount == null ? new Base[0] : new Base[] {this.amount}; // Money - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case -340323759: // responce - this.responce = (Type) value; // Type - break; - case 348678409: // submitter - this.submitter = (Type) value; // Type - break; - case 106443592: // payee - this.payee = (Type) value; // Type - break; - case 3076014: // date - this.date = castToDate(value); // DateType - break; - case -1413853096: // amount - this.amount = castToMoney(value); // Money - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("responce[x]")) - this.responce = (Type) value; // Type - else if (name.equals("submitter[x]")) - this.submitter = (Type) value; // Type - else if (name.equals("payee[x]")) - this.payee = (Type) value; // Type - else if (name.equals("date")) - this.date = castToDate(value); // DateType - else if (name.equals("amount")) - this.amount = castToMoney(value); // Money - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 37106577: return getRequest(); // Type - case 1832772751: return getResponce(); // Type - case -2047315241: return getSubmitter(); // Type - case 1375276088: return getPayee(); // Type - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateType - case -1413853096: return getAmount(); // Money - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("responceIdentifier")) { - this.responce = new Identifier(); - return this.responce; - } - else if (name.equals("responceReference")) { - this.responce = new Reference(); - return this.responce; - } - else if (name.equals("submitterIdentifier")) { - this.submitter = new Identifier(); - return this.submitter; - } - else if (name.equals("submitterReference")) { - this.submitter = new Reference(); - return this.submitter; - } - else if (name.equals("payeeIdentifier")) { - this.payee = new Identifier(); - return this.payee; - } - else if (name.equals("payeeReference")) { - this.payee = new Reference(); - return this.payee; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.date"); - } - else if (name.equals("amount")) { - this.amount = new Money(); - return this.amount; - } - else - return super.addChild(name); - } - - public DetailsComponent copy() { - DetailsComponent dst = new DetailsComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.request = request == null ? null : request.copy(); - dst.responce = responce == null ? null : responce.copy(); - dst.submitter = submitter == null ? null : submitter.copy(); - dst.payee = payee == null ? null : payee.copy(); - dst.date = date == null ? null : date.copy(); - dst.amount = amount == null ? null : amount.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof DetailsComponent)) - return false; - DetailsComponent o = (DetailsComponent) other; - return compareDeep(type, o.type, true) && compareDeep(request, o.request, true) && compareDeep(responce, o.responce, true) - && compareDeep(submitter, o.submitter, true) && compareDeep(payee, o.payee, true) && compareDeep(date, o.date, true) - && compareDeep(amount, o.amount, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof DetailsComponent)) - return false; - DetailsComponent o = (DetailsComponent) other; - return compareValues(date, o.date, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (request == null || request.isEmpty()) - && (responce == null || responce.isEmpty()) && (submitter == null || submitter.isEmpty()) - && (payee == null || payee.isEmpty()) && (date == null || date.isEmpty()) && (amount == null || amount.isEmpty()) - ; - } - - public String fhirType() { - return "PaymentReconciliation.detail"; - - } - - } - - @Block() - public static class NotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Notes text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 129959202L; - - /** - * Constructor - */ - public NotesComponent() { - super(); - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public NotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create NotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public NotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public NotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.text"); - } - else - return super.addChild(name); - } - - public NotesComponent copy() { - NotesComponent dst = new NotesComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof NotesComponent)) - return false; - NotesComponent o = (NotesComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - public String fhirType() { - return "PaymentReconciliation.note"; - - } - - } - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {Identifier.class, ProcessRequest.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Claim reference", formalDefinition="Original request resource reference." ) - protected Type request; - - /** - * Transaction status: error, complete. - */ - @Child(name = "outcome", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="complete | error", formalDefinition="Transaction status: error, complete." ) - protected Enumeration outcome; - - /** - * A description of the status of the adjudication. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The period of time for which payments have been gathered into this bulk payment for settlement. - */ - @Child(name = "period", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period covered", formalDefinition="The period of time for which payments have been gathered into this bulk payment for settlement." ) - protected Period period; - - /** - * The Insurer who produced this adjudicated response. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Insurer", formalDefinition="The Insurer who produced this adjudicated response." ) - protected Type organization; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type requestProvider; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type requestOrganization; - - /** - * List of individual settlement amounts and the corresponding transaction. - */ - @Child(name = "detail", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Details", formalDefinition="List of individual settlement amounts and the corresponding transaction." ) - protected List detail; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Total payment amount. - */ - @Child(name = "total", type = {Money.class}, order=13, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Total amount of Payment", formalDefinition="Total payment amount." ) - protected Money total; - - /** - * Suite of notes. - */ - @Child(name = "note", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Note text", formalDefinition="Suite of notes." ) - protected List note; - - private static final long serialVersionUID = -293306995L; - - /** - * Constructor - */ - public PaymentReconciliation() { - super(); - } - - /** - * Constructor - */ - public PaymentReconciliation(Money total) { - super(); - this.total = total; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PaymentReconciliation addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public PaymentReconciliation setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public Enumeration getOutcomeElement() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); // bb - return this.outcome; - } - - public boolean hasOutcomeElement() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value - */ - public PaymentReconciliation setOutcomeElement(Enumeration value) { - this.outcome = value; - return this; - } - - /** - * @return Transaction status: error, complete. - */ - public RemittanceOutcome getOutcome() { - return this.outcome == null ? null : this.outcome.getValue(); - } - - /** - * @param value Transaction status: error, complete. - */ - public PaymentReconciliation setOutcome(RemittanceOutcome value) { - if (value == null) - this.outcome = null; - else { - if (this.outcome == null) - this.outcome = new Enumeration(new RemittanceOutcomeEnumFactory()); - this.outcome.setValue(value); - } - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public PaymentReconciliation setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication. - */ - public PaymentReconciliation setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public PaymentReconciliation setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public PaymentReconciliation setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public PaymentReconciliation setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public PaymentReconciliation setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time for which payments have been gathered into this bulk payment for settlement.) - */ - public PaymentReconciliation setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The Insurer who produced this adjudicated response.) - */ - public PaymentReconciliation setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getRequestProvider() { - return this.requestProvider; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getRequestProviderIdentifier() throws FHIRException { - if (!(this.requestProvider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Identifier) this.requestProvider; - } - - public boolean hasRequestProviderIdentifier() { - return this.requestProvider instanceof Identifier; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProviderReference() throws FHIRException { - if (!(this.requestProvider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Reference) this.requestProvider; - } - - public boolean hasRequestProviderReference() { - return this.requestProvider instanceof Reference; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestProvider(Type value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Type getRequestOrganization() { - return this.requestOrganization; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getRequestOrganizationIdentifier() throws FHIRException { - if (!(this.requestOrganization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Identifier) this.requestOrganization; - } - - public boolean hasRequestOrganizationIdentifier() { - return this.requestOrganization instanceof Identifier; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganizationReference() throws FHIRException { - if (!(this.requestOrganization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Reference) this.requestOrganization; - } - - public boolean hasRequestOrganizationReference() { - return this.requestOrganization instanceof Reference; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public PaymentReconciliation setRequestOrganization(Type value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) - */ - public List getDetail() { - if (this.detail == null) - this.detail = new ArrayList(); - return this.detail; - } - - public boolean hasDetail() { - if (this.detail == null) - return false; - for (DetailsComponent item : this.detail) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #detail} (List of individual settlement amounts and the corresponding transaction.) - */ - // syntactic sugar - public DetailsComponent addDetail() { //3 - DetailsComponent t = new DetailsComponent(); - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return t; - } - - // syntactic sugar - public PaymentReconciliation addDetail(DetailsComponent t) { //3 - if (t == null) - return this; - if (this.detail == null) - this.detail = new ArrayList(); - this.detail.add(t); - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public PaymentReconciliation setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #total} (Total payment amount.) - */ - public Money getTotal() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PaymentReconciliation.total"); - else if (Configuration.doAutoCreate()) - this.total = new Money(); // cc - return this.total; - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (Total payment amount.) - */ - public PaymentReconciliation setTotal(Money value) { - this.total = value; - return this; - } - - /** - * @return {@link #note} (Suite of notes.) - */ - public List getNote() { - if (this.note == null) - this.note = new ArrayList(); - return this.note; - } - - public boolean hasNote() { - if (this.note == null) - return false; - for (NotesComponent item : this.note) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #note} (Suite of notes.) - */ - // syntactic sugar - public NotesComponent addNote() { //3 - NotesComponent t = new NotesComponent(); - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return t; - } - - // syntactic sugar - public PaymentReconciliation addNote(NotesComponent t) { //3 - if (t == null) - return this; - if (this.note == null) - this.note = new ArrayList(); - this.note.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request[x]", "Identifier|Reference(ProcessRequest)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "code", "Transaction status: error, complete.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("period", "Period", "The period of time for which payments have been gathered into this bulk payment for settlement.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The Insurer who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("detail", "", "List of individual settlement amounts and the corresponding transaction.", 0, java.lang.Integer.MAX_VALUE, detail)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("total", "Money", "Total payment amount.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("note", "", "Suite of notes.", 0, java.lang.Integer.MAX_VALUE, note)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type - case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : this.detail.toArray(new Base[this.detail.size()]); // DetailsComponent - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // Money - case 3387378: /*note*/ return this.note == null ? new Base[0] : this.note.toArray(new Base[this.note.size()]); // NotesComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case -1106507950: // outcome - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 1601527200: // requestProvider - this.requestProvider = (Type) value; // Type - break; - case 599053666: // requestOrganization - this.requestOrganization = (Type) value; // Type - break; - case -1335224239: // detail - this.getDetail().add((DetailsComponent) value); // DetailsComponent - break; - case 3148996: // form - this.form = castToCoding(value); // Coding - break; - case 110549828: // total - this.total = castToMoney(value); // Money - break; - case 3387378: // note - this.getNote().add((NotesComponent) value); // NotesComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("outcome")) - this.outcome = new RemittanceOutcomeEnumFactory().fromType(value); // Enumeration - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("requestProvider[x]")) - this.requestProvider = (Type) value; // Type - else if (name.equals("requestOrganization[x]")) - this.requestOrganization = (Type) value; // Type - else if (name.equals("detail")) - this.getDetail().add((DetailsComponent) value); - else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("total")) - this.total = castToMoney(value); // Money - else if (name.equals("note")) - this.getNote().add((NotesComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 37106577: return getRequest(); // Type - case -1106507950: throw new FHIRException("Cannot make property outcome as it is not a complex type"); // Enumeration - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -991726143: return getPeriod(); // Period - case 1326483053: return getOrganization(); // Type - case -1694784800: return getRequestProvider(); // Type - case 818740190: return getRequestOrganization(); // Type - case -1335224239: return addDetail(); // DetailsComponent - case 3148996: return getForm(); // Coding - case 110549828: return getTotal(); // Money - case 3387378: return addNote(); // NotesComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("outcome")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.outcome"); - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.disposition"); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type PaymentReconciliation.created"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestProviderIdentifier")) { - this.requestProvider = new Identifier(); - return this.requestProvider; - } - else if (name.equals("requestProviderReference")) { - this.requestProvider = new Reference(); - return this.requestProvider; - } - else if (name.equals("requestOrganizationIdentifier")) { - this.requestOrganization = new Identifier(); - return this.requestOrganization; - } - else if (name.equals("requestOrganizationReference")) { - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - else if (name.equals("detail")) { - return addDetail(); - } - else if (name.equals("form")) { - this.form = new Coding(); - return this.form; - } - else if (name.equals("total")) { - this.total = new Money(); - return this.total; - } - else if (name.equals("note")) { - return addNote(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "PaymentReconciliation"; - - } - - public PaymentReconciliation copy() { - PaymentReconciliation dst = new PaymentReconciliation(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.period = period == null ? null : period.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - if (detail != null) { - dst.detail = new ArrayList(); - for (DetailsComponent i : detail) - dst.detail.add(i.copy()); - }; - dst.form = form == null ? null : form.copy(); - dst.total = total == null ? null : total.copy(); - if (note != null) { - dst.note = new ArrayList(); - for (NotesComponent i : note) - dst.note.add(i.copy()); - }; - return dst; - } - - protected PaymentReconciliation typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PaymentReconciliation)) - return false; - PaymentReconciliation o = (PaymentReconciliation) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(period, o.period, true) && compareDeep(organization, o.organization, true) - && compareDeep(requestProvider, o.requestProvider, true) && compareDeep(requestOrganization, o.requestOrganization, true) - && compareDeep(detail, o.detail, true) && compareDeep(form, o.form, true) && compareDeep(total, o.total, true) - && compareDeep(note, o.note, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PaymentReconciliation)) - return false; - PaymentReconciliation o = (PaymentReconciliation) other; - return compareValues(outcome, o.outcome, true) && compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (period == null || period.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (detail == null || detail.isEmpty()) && (form == null || form.isEmpty()) && (total == null || total.isEmpty()) - && (note == null || note.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PaymentReconciliation; - } - - /** - * Search parameter: requestorganizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: PaymentReconciliation.requestOrganizationReference
- *

- */ - @SearchParamDefinition(name="requestorganizationreference", path="PaymentReconciliation.requestOrganization.as(Reference)", description="The organization who generated this resource", type="reference" ) - public static final String SP_REQUESTORGANIZATIONREFERENCE = "requestorganizationreference"; - /** - * Fluent Client search parameter constant for requestorganizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: PaymentReconciliation.requestOrganizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentReconciliation:requestorganizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestorganizationreference").toLocked(); - - /** - * Search parameter: created - *

- * Description: The creation date
- * Type: date
- * Path: PaymentReconciliation.created
- *

- */ - @SearchParamDefinition(name="created", path="PaymentReconciliation.created", description="The creation date", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: The creation date
- * Type: date
- * Path: PaymentReconciliation.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: requestorganizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: PaymentReconciliation.requestOrganizationIdentifier
- *

- */ - @SearchParamDefinition(name="requestorganizationidentifier", path="PaymentReconciliation.requestOrganization.as(Identifier)", description="The organization who generated this resource", type="token" ) - public static final String SP_REQUESTORGANIZATIONIDENTIFIER = "requestorganizationidentifier"; - /** - * Fluent Client search parameter constant for requestorganizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: PaymentReconciliation.requestOrganizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTORGANIZATIONIDENTIFIER); - - /** - * Search parameter: requestprovideridentifier - *

- * Description: The reference to the provider who sumbitted the claim
- * Type: token
- * Path: PaymentReconciliation.requestProviderIdentifier
- *

- */ - @SearchParamDefinition(name="requestprovideridentifier", path="PaymentReconciliation.requestProvider.as(Identifier)", description="The reference to the provider who sumbitted the claim", type="token" ) - public static final String SP_REQUESTPROVIDERIDENTIFIER = "requestprovideridentifier"; - /** - * Fluent Client search parameter constant for requestprovideridentifier - *

- * Description: The reference to the provider who sumbitted the claim
- * Type: token
- * Path: PaymentReconciliation.requestProviderIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTPROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTPROVIDERIDENTIFIER); - - /** - * Search parameter: requestidentifier - *

- * Description: The reference to the claim
- * Type: token
- * Path: PaymentReconciliation.requestIdentifier
- *

- */ - @SearchParamDefinition(name="requestidentifier", path="PaymentReconciliation.request.as(Identifier)", description="The reference to the claim", type="token" ) - public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; - /** - * Fluent Client search parameter constant for requestidentifier - *

- * Description: The reference to the claim
- * Type: token
- * Path: PaymentReconciliation.requestIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); - - /** - * Search parameter: requestreference - *

- * Description: The reference to the claim
- * Type: reference
- * Path: PaymentReconciliation.requestReference
- *

- */ - @SearchParamDefinition(name="requestreference", path="PaymentReconciliation.request.as(Reference)", description="The reference to the claim", type="reference" ) - public static final String SP_REQUESTREFERENCE = "requestreference"; - /** - * Fluent Client search parameter constant for requestreference - *

- * Description: The reference to the claim
- * Type: reference
- * Path: PaymentReconciliation.requestReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentReconciliation:requestreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestreference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: PaymentReconciliation.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="PaymentReconciliation.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: PaymentReconciliation.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: requestproviderreference - *

- * Description: The reference to the provider who sumbitted the claim
- * Type: reference
- * Path: PaymentReconciliation.requestProviderReference
- *

- */ - @SearchParamDefinition(name="requestproviderreference", path="PaymentReconciliation.requestProvider.as(Reference)", description="The reference to the provider who sumbitted the claim", type="reference" ) - public static final String SP_REQUESTPROVIDERREFERENCE = "requestproviderreference"; - /** - * Fluent Client search parameter constant for requestproviderreference - *

- * Description: The reference to the provider who sumbitted the claim
- * Type: reference
- * Path: PaymentReconciliation.requestProviderReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTPROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentReconciliation:requestproviderreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:requestproviderreference").toLocked(); - - /** - * Search parameter: organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: PaymentReconciliation.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="PaymentReconciliation.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: PaymentReconciliation.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PaymentReconciliation:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("PaymentReconciliation:organizationreference").toLocked(); - - /** - * Search parameter: outcome - *

- * Description: The processing outcome
- * Type: token
- * Path: PaymentReconciliation.outcome
- *

- */ - @SearchParamDefinition(name="outcome", path="PaymentReconciliation.outcome", description="The processing outcome", type="token" ) - public static final String SP_OUTCOME = "outcome"; - /** - * Fluent Client search parameter constant for outcome - *

- * Description: The processing outcome
- * Type: token
- * Path: PaymentReconciliation.outcome
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam OUTCOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_OUTCOME); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: PaymentReconciliation.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="PaymentReconciliation.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: PaymentReconciliation.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: PaymentReconciliation.disposition
- *

- */ - @SearchParamDefinition(name="disposition", path="PaymentReconciliation.disposition", description="The contents of the disposition message", type="string" ) - public static final String SP_DISPOSITION = "disposition"; - /** - * Fluent Client search parameter constant for disposition - *

- * Description: The contents of the disposition message
- * Type: string
- * Path: PaymentReconciliation.disposition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPOSITION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPOSITION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Period.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Period.java deleted file mode 100644 index 6ad43e01050..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Period.java +++ /dev/null @@ -1,301 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A time period defined by a start and end date and optionally time. - */ -@DatatypeDef(name="Period") -public class Period extends Type implements ICompositeType { - - /** - * The start of the period. The boundary is inclusive. - */ - @Child(name = "start", type = {DateTimeType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Starting time with inclusive boundary", formalDefinition="The start of the period. The boundary is inclusive." ) - protected DateTimeType start; - - /** - * The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. - */ - @Child(name = "end", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="End time with inclusive boundary, if not ongoing", formalDefinition="The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time." ) - protected DateTimeType end; - - private static final long serialVersionUID = 649791751L; - - /** - * Constructor - */ - public Period() { - super(); - } - - /** - * @return {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public DateTimeType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Period.start"); - else if (Configuration.doAutoCreate()) - this.start = new DateTimeType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (The start of the period. The boundary is inclusive.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Period setStartElement(DateTimeType value) { - this.start = value; - return this; - } - - /** - * @return The start of the period. The boundary is inclusive. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value The start of the period. The boundary is inclusive. - */ - public Period setStart(Date value) { - if (value == null) - this.start = null; - else { - if (this.start == null) - this.start = new DateTimeType(); - this.start.setValue(value); - } - return this; - } - - /** - * @return {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public DateTimeType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Period.end"); - else if (Configuration.doAutoCreate()) - this.end = new DateTimeType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Period setEndElement(DateTimeType value) { - this.end = value; - return this; - } - - /** - * @return The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time. - */ - public Period setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new DateTimeType(); - this.end.setValue(value); - } - return this; - } - - /** - * Sets the value for start () - * - *

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

- */ - public Period setStart( Date theDate, TemporalPrecisionEnum thePrecision) { - start = new DateTimeType(theDate, thePrecision); - return this; - } - - /** - * Sets the value for end () - * - *

- * Definition: - * The end of the period. The boundary is inclusive. - *

- */ - public Period setEnd( Date theDate, TemporalPrecisionEnum thePrecision) { - end = new DateTimeType(theDate, thePrecision); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "dateTime", "The start of the period. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "dateTime", "The end of the period. If the end of the period is missing, it means that the period is ongoing. The start may be in the past, and the end date in the future, which means that period is expected/planned to end at that time.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // DateTimeType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // DateTimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 109757538: // start - this.start = castToDateTime(value); // DateTimeType - break; - case 100571: // end - this.end = castToDateTime(value); // DateTimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("start")) - this.start = castToDateTime(value); // DateTimeType - else if (name.equals("end")) - this.end = castToDateTime(value); // DateTimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // DateTimeType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // DateTimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Period.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Period.end"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Period"; - - } - - public Period copy() { - Period dst = new Period(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - protected Period typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Period)) - return false; - Period o = (Period) other; - return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Period)) - return false; - Period o = (Period) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Person.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Person.java deleted file mode 100644 index 4f099c688d2..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Person.java +++ /dev/null @@ -1,1541 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * Demographics and administrative information about a person independent of a specific health-related context. - */ -@ResourceDef(name="Person", profile="http://hl7.org/fhir/Profile/Person") -public class Person extends DomainResource { - - public enum IdentityAssuranceLevel { - /** - * Little or no confidence in the asserted identity's accuracy. - */ - LEVEL1, - /** - * Some confidence in the asserted identity's accuracy. - */ - LEVEL2, - /** - * High confidence in the asserted identity's accuracy. - */ - LEVEL3, - /** - * Very high confidence in the asserted identity's accuracy. - */ - LEVEL4, - /** - * added to help the parsers - */ - NULL; - public static IdentityAssuranceLevel fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return LEVEL1; - if ("level2".equals(codeString)) - return LEVEL2; - if ("level3".equals(codeString)) - return LEVEL3; - if ("level4".equals(codeString)) - return LEVEL4; - throw new FHIRException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LEVEL1: return "level1"; - case LEVEL2: return "level2"; - case LEVEL3: return "level3"; - case LEVEL4: return "level4"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LEVEL1: return "http://hl7.org/fhir/identity-assuranceLevel"; - case LEVEL2: return "http://hl7.org/fhir/identity-assuranceLevel"; - case LEVEL3: return "http://hl7.org/fhir/identity-assuranceLevel"; - case LEVEL4: return "http://hl7.org/fhir/identity-assuranceLevel"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LEVEL1: return "Little or no confidence in the asserted identity's accuracy."; - case LEVEL2: return "Some confidence in the asserted identity's accuracy."; - case LEVEL3: return "High confidence in the asserted identity's accuracy."; - case LEVEL4: return "Very high confidence in the asserted identity's accuracy."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LEVEL1: return "Level 1"; - case LEVEL2: return "Level 2"; - case LEVEL3: return "Level 3"; - case LEVEL4: return "Level 4"; - default: return "?"; - } - } - } - - public static class IdentityAssuranceLevelEnumFactory implements EnumFactory { - public IdentityAssuranceLevel fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return IdentityAssuranceLevel.LEVEL1; - if ("level2".equals(codeString)) - return IdentityAssuranceLevel.LEVEL2; - if ("level3".equals(codeString)) - return IdentityAssuranceLevel.LEVEL3; - if ("level4".equals(codeString)) - return IdentityAssuranceLevel.LEVEL4; - throw new IllegalArgumentException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("level1".equals(codeString)) - return new Enumeration(this, IdentityAssuranceLevel.LEVEL1); - if ("level2".equals(codeString)) - return new Enumeration(this, IdentityAssuranceLevel.LEVEL2); - if ("level3".equals(codeString)) - return new Enumeration(this, IdentityAssuranceLevel.LEVEL3); - if ("level4".equals(codeString)) - return new Enumeration(this, IdentityAssuranceLevel.LEVEL4); - throw new FHIRException("Unknown IdentityAssuranceLevel code '"+codeString+"'"); - } - public String toCode(IdentityAssuranceLevel code) { - if (code == IdentityAssuranceLevel.LEVEL1) - return "level1"; - if (code == IdentityAssuranceLevel.LEVEL2) - return "level2"; - if (code == IdentityAssuranceLevel.LEVEL3) - return "level3"; - if (code == IdentityAssuranceLevel.LEVEL4) - return "level4"; - return "?"; - } - public String toSystem(IdentityAssuranceLevel code) { - return code.getSystem(); - } - } - - @Block() - public static class PersonLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The resource to which this actual person is associated. - */ - @Child(name = "target", type = {Patient.class, Practitioner.class, RelatedPerson.class, Person.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The resource to which this actual person is associated", formalDefinition="The resource to which this actual person is associated." ) - protected Reference target; - - /** - * The actual object that is the target of the reference (The resource to which this actual person is associated.) - */ - protected Resource targetTarget; - - /** - * Level of assurance that this link is actually associated with the target resource. - */ - @Child(name = "assurance", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="level1 | level2 | level3 | level4", formalDefinition="Level of assurance that this link is actually associated with the target resource." ) - protected Enumeration assurance; - - private static final long serialVersionUID = 508763647L; - - /** - * Constructor - */ - public PersonLinkComponent() { - super(); - } - - /** - * Constructor - */ - public PersonLinkComponent(Reference target) { - super(); - this.target = target; - } - - /** - * @return {@link #target} (The resource to which this actual person is associated.) - */ - public Reference getTarget() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PersonLinkComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new Reference(); // cc - return this.target; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The resource to which this actual person is associated.) - */ - public PersonLinkComponent setTarget(Reference value) { - this.target = value; - return this; - } - - /** - * @return {@link #target} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) - */ - public Resource getTargetTarget() { - return this.targetTarget; - } - - /** - * @param value {@link #target} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource to which this actual person is associated.) - */ - public PersonLinkComponent setTargetTarget(Resource value) { - this.targetTarget = value; - return this; - } - - /** - * @return {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value - */ - public Enumeration getAssuranceElement() { - if (this.assurance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PersonLinkComponent.assurance"); - else if (Configuration.doAutoCreate()) - this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); // bb - return this.assurance; - } - - public boolean hasAssuranceElement() { - return this.assurance != null && !this.assurance.isEmpty(); - } - - public boolean hasAssurance() { - return this.assurance != null && !this.assurance.isEmpty(); - } - - /** - * @param value {@link #assurance} (Level of assurance that this link is actually associated with the target resource.). This is the underlying object with id, value and extensions. The accessor "getAssurance" gives direct access to the value - */ - public PersonLinkComponent setAssuranceElement(Enumeration value) { - this.assurance = value; - return this; - } - - /** - * @return Level of assurance that this link is actually associated with the target resource. - */ - public IdentityAssuranceLevel getAssurance() { - return this.assurance == null ? null : this.assurance.getValue(); - } - - /** - * @param value Level of assurance that this link is actually associated with the target resource. - */ - public PersonLinkComponent setAssurance(IdentityAssuranceLevel value) { - if (value == null) - this.assurance = null; - else { - if (this.assurance == null) - this.assurance = new Enumeration(new IdentityAssuranceLevelEnumFactory()); - this.assurance.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("target", "Reference(Patient|Practitioner|RelatedPerson|Person)", "The resource to which this actual person is associated.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("assurance", "code", "Level of assurance that this link is actually associated with the target resource.", 0, java.lang.Integer.MAX_VALUE, assurance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Reference - case 1771900717: /*assurance*/ return this.assurance == null ? new Base[0] : new Base[] {this.assurance}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -880905839: // target - this.target = castToReference(value); // Reference - break; - case 1771900717: // assurance - this.assurance = new IdentityAssuranceLevelEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("target")) - this.target = castToReference(value); // Reference - else if (name.equals("assurance")) - this.assurance = new IdentityAssuranceLevelEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -880905839: return getTarget(); // Reference - case 1771900717: throw new FHIRException("Cannot make property assurance as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("target")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("assurance")) { - throw new FHIRException("Cannot call addChild on a primitive type Person.assurance"); - } - else - return super.addChild(name); - } - - public PersonLinkComponent copy() { - PersonLinkComponent dst = new PersonLinkComponent(); - copyValues(dst); - dst.target = target == null ? null : target.copy(); - dst.assurance = assurance == null ? null : assurance.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PersonLinkComponent)) - return false; - PersonLinkComponent o = (PersonLinkComponent) other; - return compareDeep(target, o.target, true) && compareDeep(assurance, o.assurance, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PersonLinkComponent)) - return false; - PersonLinkComponent o = (PersonLinkComponent) other; - return compareValues(assurance, o.assurance, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (target == null || target.isEmpty()) && (assurance == null || assurance.isEmpty()) - ; - } - - public String fhirType() { - return "Person.link"; - - } - - } - - /** - * Identifier for a person within a particular scope. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) - protected List identifier; - - /** - * A name associated with the person. - */ - @Child(name = "name", type = {HumanName.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected List name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Administrative Gender. - */ - @Child(name = "gender", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender." ) - protected Enumeration gender; - - /** - * The birth date for the person. - */ - @Child(name = "birthDate", type = {DateType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The date on which the person was born", formalDefinition="The birth date for the person." ) - protected DateType birthDate; - - /** - * One or more addresses for the person. - */ - @Child(name = "address", type = {Address.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="One or more addresses for the person", formalDefinition="One or more addresses for the person." ) - protected List
address; - - /** - * An image that can be displayed as a thumbnail of the person to enhance the identification of the individual. - */ - @Child(name = "photo", type = {Attachment.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Image of the person", formalDefinition="An image that can be displayed as a thumbnail of the person to enhance the identification of the individual." ) - protected Attachment photo; - - /** - * The organization that is the custodian of the person record. - */ - @Child(name = "managingOrganization", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The organization that is the custodian of the person record", formalDefinition="The organization that is the custodian of the person record." ) - protected Reference managingOrganization; - - /** - * The actual object that is the target of the reference (The organization that is the custodian of the person record.) - */ - protected Organization managingOrganizationTarget; - - /** - * Whether this person's record is in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=8, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="This person's record is in active use", formalDefinition="Whether this person's record is in active use." ) - protected BooleanType active; - - /** - * Link to a resource that concerns the same actual person. - */ - @Child(name = "link", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Link to a resource that concerns the same actual person", formalDefinition="Link to a resource that concerns the same actual person." ) - protected List link; - - private static final long serialVersionUID = -117464654L; - - /** - * Constructor - */ - public Person() { - super(); - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Person addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - // syntactic sugar - public Person addName(HumanName t) { //3 - if (t == null) - return this; - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Person addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Person setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender. - */ - public Person setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The birth date for the person.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Person setBirthDateElement(DateType value) { - this.birthDate = value; - return this; - } - - /** - * @return The birth date for the person. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The birth date for the person. - */ - public Person setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #address} (One or more addresses for the person.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (One or more addresses for the person.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Person addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) - */ - public Attachment getPhoto() { - if (this.photo == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.photo"); - else if (Configuration.doAutoCreate()) - this.photo = new Attachment(); // cc - return this.photo; - } - - public boolean hasPhoto() { - return this.photo != null && !this.photo.isEmpty(); - } - - /** - * @param value {@link #photo} (An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.) - */ - public Person setPhoto(Attachment value) { - this.photo = value; - return this; - } - - /** - * @return {@link #managingOrganization} (The organization that is the custodian of the person record.) - */ - public Reference getManagingOrganization() { - if (this.managingOrganization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganization = new Reference(); // cc - return this.managingOrganization; - } - - public boolean hasManagingOrganization() { - return this.managingOrganization != null && !this.managingOrganization.isEmpty(); - } - - /** - * @param value {@link #managingOrganization} (The organization that is the custodian of the person record.) - */ - public Person setManagingOrganization(Reference value) { - this.managingOrganization = value; - return this; - } - - /** - * @return {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization that is the custodian of the person record.) - */ - public Organization getManagingOrganizationTarget() { - if (this.managingOrganizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.managingOrganization"); - else if (Configuration.doAutoCreate()) - this.managingOrganizationTarget = new Organization(); // aa - return this.managingOrganizationTarget; - } - - /** - * @param value {@link #managingOrganization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization that is the custodian of the person record.) - */ - public Person setManagingOrganizationTarget(Organization value) { - this.managingOrganizationTarget = value; - return this; - } - - /** - * @return {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Person.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this person's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Person setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this person's record is in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether this person's record is in active use. - */ - public Person setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #link} (Link to a resource that concerns the same actual person.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (PersonLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Link to a resource that concerns the same actual person.) - */ - // syntactic sugar - public PersonLinkComponent addLink() { //3 - PersonLinkComponent t = new PersonLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public Person addLink(PersonLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "date", "The birth date for the person.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("address", "Address", "One or more addresses for the person.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("photo", "Attachment", "An image that can be displayed as a thumbnail of the person to enhance the identification of the individual.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("managingOrganization", "Reference(Organization)", "The organization that is the custodian of the person record.", 0, java.lang.Integer.MAX_VALUE, managingOrganization)); - childrenList.add(new Property("active", "boolean", "Whether this person's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("link", "", "Link to a resource that concerns the same actual person.", 0, java.lang.Integer.MAX_VALUE, link)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration - case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType - case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address - case 106642994: /*photo*/ return this.photo == null ? new Base[0] : new Base[] {this.photo}; // Attachment - case -2058947787: /*managingOrganization*/ return this.managingOrganization == null ? new Base[0] : new Base[] {this.managingOrganization}; // Reference - case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType - case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // PersonLinkComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3373707: // name - this.getName().add(castToHumanName(value)); // HumanName - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1249512767: // gender - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - break; - case -1210031859: // birthDate - this.birthDate = castToDate(value); // DateType - break; - case -1147692044: // address - this.getAddress().add(castToAddress(value)); // Address - break; - case 106642994: // photo - this.photo = castToAttachment(value); // Attachment - break; - case -2058947787: // managingOrganization - this.managingOrganization = castToReference(value); // Reference - break; - case -1422950650: // active - this.active = castToBoolean(value); // BooleanType - break; - case 3321850: // link - this.getLink().add((PersonLinkComponent) value); // PersonLinkComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("name")) - this.getName().add(castToHumanName(value)); - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("gender")) - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - else if (name.equals("birthDate")) - this.birthDate = castToDate(value); // DateType - else if (name.equals("address")) - this.getAddress().add(castToAddress(value)); - else if (name.equals("photo")) - this.photo = castToAttachment(value); // Attachment - else if (name.equals("managingOrganization")) - this.managingOrganization = castToReference(value); // Reference - else if (name.equals("active")) - this.active = castToBoolean(value); // BooleanType - else if (name.equals("link")) - this.getLink().add((PersonLinkComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3373707: return addName(); // HumanName - case -1429363305: return addTelecom(); // ContactPoint - case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration - case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType - case -1147692044: return addAddress(); // Address - case 106642994: return getPhoto(); // Attachment - case -2058947787: return getManagingOrganization(); // Reference - case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType - case 3321850: return addLink(); // PersonLinkComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("name")) { - return addName(); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("gender")) { - throw new FHIRException("Cannot call addChild on a primitive type Person.gender"); - } - else if (name.equals("birthDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Person.birthDate"); - } - else if (name.equals("address")) { - return addAddress(); - } - else if (name.equals("photo")) { - this.photo = new Attachment(); - return this.photo; - } - else if (name.equals("managingOrganization")) { - this.managingOrganization = new Reference(); - return this.managingOrganization; - } - else if (name.equals("active")) { - throw new FHIRException("Cannot call addChild on a primitive type Person.active"); - } - else if (name.equals("link")) { - return addLink(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Person"; - - } - - public Person copy() { - Person dst = new Person(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.photo = photo == null ? null : photo.copy(); - dst.managingOrganization = managingOrganization == null ? null : managingOrganization.copy(); - dst.active = active == null ? null : active.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (PersonLinkComponent i : link) - dst.link.add(i.copy()); - }; - return dst; - } - - protected Person typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Person)) - return false; - Person o = (Person) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) - && compareDeep(gender, o.gender, true) && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) - && compareDeep(photo, o.photo, true) && compareDeep(managingOrganization, o.managingOrganization, true) - && compareDeep(active, o.active, true) && compareDeep(link, o.link, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Person)) - return false; - Person o = (Person) other; - return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) && compareValues(active, o.active, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (name == null || name.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) - && (address == null || address.isEmpty()) && (photo == null || photo.isEmpty()) && (managingOrganization == null || managingOrganization.isEmpty()) - && (active == null || active.isEmpty()) && (link == null || link.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Person; - } - - /** - * Search parameter: phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: Person.telecom(system=phone)
- *

- */ - @SearchParamDefinition(name="phone", path="Person.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) - public static final String SP_PHONE = "phone"; - /** - * Fluent Client search parameter constant for phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: Person.telecom(system=phone)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); - - /** - * Search parameter: phonetic - *

- * Description: A portion of name using some kind of phonetic matching algorithm
- * Type: string
- * Path: Person.name
- *

- */ - @SearchParamDefinition(name="phonetic", path="Person.name", 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: Person.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); - - /** - * Search parameter: link - *

- * Description: Any link has this Patient, Person, RelatedPerson or Practitioner reference
- * Type: reference
- * Path: Person.link.target
- *

- */ - @SearchParamDefinition(name="link", path="Person.link.target", description="Any link has this Patient, Person, RelatedPerson or Practitioner reference", type="reference" ) - public static final String SP_LINK = "link"; - /** - * Fluent Client search parameter constant for link - *

- * Description: Any link has this Patient, Person, RelatedPerson or Practitioner reference
- * Type: reference
- * Path: Person.link.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LINK = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LINK); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Person:link". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LINK = new ca.uhn.fhir.model.api.Include("Person:link").toLocked(); - - /** - * Search parameter: address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Person.address.country
- *

- */ - @SearchParamDefinition(name="address-country", path="Person.address.country", description="A country specified in an address", type="string" ) - public static final String SP_ADDRESS_COUNTRY = "address-country"; - /** - * Fluent Client search parameter constant for address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Person.address.country
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); - - /** - * Search parameter: relatedperson - *

- * Description: The Person links to this RelatedPerson
- * Type: reference
- * Path: Person.link.target
- *

- */ - @SearchParamDefinition(name="relatedperson", path="Person.link.target", description="The Person links to this RelatedPerson", type="reference" ) - public static final String SP_RELATEDPERSON = "relatedperson"; - /** - * Fluent Client search parameter constant for relatedperson - *

- * Description: The Person links to this RelatedPerson
- * Type: reference
- * Path: Person.link.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RELATEDPERSON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RELATEDPERSON); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Person:relatedperson". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RELATEDPERSON = new ca.uhn.fhir.model.api.Include("Person:relatedperson").toLocked(); - - /** - * Search parameter: organization - *

- * Description: The organization at which this person record is being managed
- * Type: reference
- * Path: Person.managingOrganization
- *

- */ - @SearchParamDefinition(name="organization", path="Person.managingOrganization", description="The organization at which this person record is being managed", type="reference" ) - public static final String SP_ORGANIZATION = "organization"; - /** - * Fluent Client search parameter constant for organization - *

- * Description: The organization at which this person record is being managed
- * Type: reference
- * Path: Person.managingOrganization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Person:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Person:organization").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The Person links to this Patient
- * Type: reference
- * Path: Person.link.target
- *

- */ - @SearchParamDefinition(name="patient", path="Person.link.target", description="The Person links to this Patient", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The Person links to this Patient
- * Type: reference
- * Path: Person.link.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Person:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Person:patient").toLocked(); - - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Person.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="Person.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Person.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - - /** - * Search parameter: address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Person.address.state
- *

- */ - @SearchParamDefinition(name="address-state", path="Person.address.state", description="A state specified in an address", type="string" ) - public static final String SP_ADDRESS_STATE = "address-state"; - /** - * Fluent Client search parameter constant for address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Person.address.state
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - - /** - * Search parameter: practitioner - *

- * Description: The Person links to this Practitioner
- * Type: reference
- * Path: Person.link.target
- *

- */ - @SearchParamDefinition(name="practitioner", path="Person.link.target", description="The Person links to this Practitioner", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - /** - * Fluent Client search parameter constant for practitioner - *

- * Description: The Person links to this Practitioner
- * Type: reference
- * Path: Person.link.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Person:practitioner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("Person:practitioner").toLocked(); - - /** - * Search parameter: email - *

- * Description: A value in an email contact
- * Type: token
- * Path: Person.telecom(system=email)
- *

- */ - @SearchParamDefinition(name="email", path="Person.telecom.where(system='email')", description="A value in an email contact", type="token" ) - public static final String SP_EMAIL = "email"; - /** - * Fluent Client search parameter constant for email - *

- * Description: A value in an email contact
- * Type: token
- * Path: Person.telecom(system=email)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); - - /** - * Search parameter: address - *

- * Description: An address in any kind of address/part
- * Type: string
- * Path: Person.address
- *

- */ - @SearchParamDefinition(name="address", path="Person.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: Person.address
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Person.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="Person.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Person.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - - /** - * Search parameter: name - *

- * Description: A portion of name in any name part
- * Type: string
- * Path: Person.name
- *

- */ - @SearchParamDefinition(name="name", path="Person.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: Person.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: birthdate - *

- * Description: The person's date of birth
- * Type: date
- * Path: Person.birthDate
- *

- */ - @SearchParamDefinition(name="birthdate", path="Person.birthDate", description="The person's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - /** - * Fluent Client search parameter constant for birthdate - *

- * Description: The person's date of birth
- * Type: date
- * Path: Person.birthDate
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE); - - /** - * Search parameter: telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: Person.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="Person.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: Person.telecom
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); - - /** - * Search parameter: gender - *

- * Description: The gender of the person
- * Type: token
- * Path: Person.gender
- *

- */ - @SearchParamDefinition(name="gender", path="Person.gender", description="The gender of the person", type="token" ) - public static final String SP_GENDER = "gender"; - /** - * Fluent Client search parameter constant for gender - *

- * Description: The gender of the person
- * Type: token
- * Path: Person.gender
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); - - /** - * Search parameter: identifier - *

- * Description: A person Identifier
- * Type: token
- * Path: Person.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Person.identifier", description="A person Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A person Identifier
- * Type: token
- * Path: Person.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: Person.address.postalCode
- *

- */ - @SearchParamDefinition(name="address-postalcode", path="Person.address.postalCode", description="A postal code specified in an address", type="string" ) - public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; - /** - * Fluent Client search parameter constant for address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: Person.address.postalCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PositiveIntType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PositiveIntType.java deleted file mode 100644 index 86beadeed14..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PositiveIntType.java +++ /dev/null @@ -1,97 +0,0 @@ -/* -(c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -/** - * - */ -package org.hl7.fhir.dstu2016may.model; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "positiveInt", profileOf=IntegerType.class) -public class PositiveIntType extends IntegerType { - - /** - * - */ - private static final long serialVersionUID = 1686497884249402429L; - - /** - * Constructor - */ - public PositiveIntType() { - // nothing - } - - /** - * Constructor - */ - public PositiveIntType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public PositiveIntType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * Constructor - * - * @param theValue The value - * @throws IllegalArgumentException If the value is too large to fit in a signed integer - */ - public PositiveIntType(Long theValue) { - if (theValue < 1 || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } - if(theValue!=null) { - setValue((int)theValue.longValue()); - } - } - - @Override - public PositiveIntType copy() { - return new PositiveIntType(getValue()); - } - - public String fhirType() { - return "positiveInt"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Practitioner.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Practitioner.java deleted file mode 100644 index 7d7b596bb6a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Practitioner.java +++ /dev/null @@ -1,2212 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ -@ResourceDef(name="Practitioner", profile="http://hl7.org/fhir/Profile/Practitioner") -public class Practitioner extends DomainResource { - - @Block() - public static class PractitionerPractitionerRoleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The organization where the Practitioner performs the roles associated. - */ - @Child(name = "organization", type = {Organization.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Organization where the roles are performed", formalDefinition="The organization where the Practitioner performs the roles associated." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization where the Practitioner performs the roles associated.) - */ - protected Organization organizationTarget; - - /** - * Roles which this practitioner is authorized to perform for the organization. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) - protected CodeableConcept role; - - /** - * Specific specialty of the practitioner. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) - protected List specialty; - - /** - * Business Identifiers that are specific to a role/location. - */ - @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifiers that are specific to a role/location", formalDefinition="Business Identifiers that are specific to a role/location." ) - protected List identifier; - - /** - * Contact details that are specific to the role/location/service. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details that are specific to the role/location/service", formalDefinition="Contact details that are specific to the role/location/service." ) - protected List telecom; - - /** - * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. - */ - @Child(name = "period", type = {Period.class}, order=6, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Period period; - - /** - * The location(s) at which this practitioner provides care. - */ - @Child(name = "location", type = {Location.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) - protected List location; - /** - * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) - */ - protected List locationTarget; - - - /** - * The list of healthcare services that this worker provides for this role's Organization/Location(s). - */ - @Child(name = "healthcareService", type = {HealthcareService.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." ) - protected List healthcareService; - /** - * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - protected List healthcareServiceTarget; - - - private static final long serialVersionUID = -2082448551L; - - /** - * Constructor - */ - public PractitionerPractitionerRoleComponent() { - super(); - } - - /** - * @return {@link #organization} (The organization where the Practitioner performs the roles associated.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization where the Practitioner performs the roles associated.) - */ - public PractitionerPractitionerRoleComponent setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization where the Practitioner performs the roles associated.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization where the Practitioner performs the roles associated.) - */ - public PractitionerPractitionerRoleComponent setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - public PractitionerPractitionerRoleComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #identifier} (Business Identifiers that are specific to a role/location.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Business Identifiers that are specific to a role/location.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #telecom} (Contact details that are specific to the role/location/service.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details that are specific to the role/location/service.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerPractitionerRoleComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public PractitionerPractitionerRoleComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (Reference item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - // syntactic sugar - public Reference addLocation() { //3 - Reference t = new Reference(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addLocation(Reference t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) - */ - public List getLocationTarget() { - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - return this.locationTarget; - } - - // syntactic sugar - /** - * @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) - */ - public Location addLocationTarget() { - Location r = new Location(); - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - this.locationTarget.add(r); - return r; - } - - /** - * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public List getHealthcareService() { - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - return this.healthcareService; - } - - public boolean hasHealthcareService() { - if (this.healthcareService == null) - return false; - for (Reference item : this.healthcareService) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - // syntactic sugar - public Reference addHealthcareService() { //3 - Reference t = new Reference(); - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - this.healthcareService.add(t); - return t; - } - - // syntactic sugar - public PractitionerPractitionerRoleComponent addHealthcareService(Reference t) { //3 - if (t == null) - return this; - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - this.healthcareService.add(t); - return this; - } - - /** - * @return {@link #healthcareService} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public List getHealthcareServiceTarget() { - if (this.healthcareServiceTarget == null) - this.healthcareServiceTarget = new ArrayList(); - return this.healthcareServiceTarget; - } - - // syntactic sugar - /** - * @return {@link #healthcareService} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public HealthcareService addHealthcareServiceTarget() { - HealthcareService r = new HealthcareService(); - if (this.healthcareServiceTarget == null) - this.healthcareServiceTarget = new ArrayList(); - this.healthcareServiceTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("identifier", "Identifier", "Business Identifiers that are specific to a role/location.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details that are specific to the role/location/service.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference - case 1289661064: /*healthcareService*/ return this.healthcareService == null ? new Base[0] : this.healthcareService.toArray(new Base[this.healthcareService.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1178922291: // organization - this.organization = castToReference(value); // Reference - break; - case 3506294: // role - this.role = castToCodeableConcept(value); // CodeableConcept - break; - case -1694759682: // specialty - this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 1901043637: // location - this.getLocation().add(castToReference(value)); // Reference - break; - case 1289661064: // healthcareService - this.getHealthcareService().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("organization")) - this.organization = castToReference(value); // Reference - else if (name.equals("role")) - this.role = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("specialty")) - this.getSpecialty().add(castToCodeableConcept(value)); - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("location")) - this.getLocation().add(castToReference(value)); - else if (name.equals("healthcareService")) - this.getHealthcareService().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1178922291: return getOrganization(); // Reference - case 3506294: return getRole(); // CodeableConcept - case -1694759682: return addSpecialty(); // CodeableConcept - case -1618432855: return addIdentifier(); // Identifier - case -1429363305: return addTelecom(); // ContactPoint - case -991726143: return getPeriod(); // Period - case 1901043637: return addLocation(); // Reference - case 1289661064: return addHealthcareService(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("role")) { - this.role = new CodeableConcept(); - return this.role; - } - else if (name.equals("specialty")) { - return addSpecialty(); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("location")) { - return addLocation(); - } - else if (name.equals("healthcareService")) { - return addHealthcareService(); - } - else - return super.addChild(name); - } - - public PractitionerPractitionerRoleComponent copy() { - PractitionerPractitionerRoleComponent dst = new PractitionerPractitionerRoleComponent(); - copyValues(dst); - dst.organization = organization == null ? null : organization.copy(); - dst.role = role == null ? null : role.copy(); - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (location != null) { - dst.location = new ArrayList(); - for (Reference i : location) - dst.location.add(i.copy()); - }; - if (healthcareService != null) { - dst.healthcareService = new ArrayList(); - for (Reference i : healthcareService) - dst.healthcareService.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerPractitionerRoleComponent)) - return false; - PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; - return compareDeep(organization, o.organization, true) && compareDeep(role, o.role, true) && compareDeep(specialty, o.specialty, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(telecom, o.telecom, true) && compareDeep(period, o.period, true) - && compareDeep(location, o.location, true) && compareDeep(healthcareService, o.healthcareService, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerPractitionerRoleComponent)) - return false; - PractitionerPractitionerRoleComponent o = (PractitionerPractitionerRoleComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (organization == null || organization.isEmpty()) && (role == null || role.isEmpty()) - && (specialty == null || specialty.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (telecom == null || telecom.isEmpty()) && (period == null || period.isEmpty()) && (location == null || location.isEmpty()) - && (healthcareService == null || healthcareService.isEmpty()); - } - - public String fhirType() { - return "Practitioner.practitionerRole"; - - } - - } - - @Block() - public static class PractitionerQualificationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that applies to this person's qualification in this role. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="An identifier for this qualification for the practitioner", formalDefinition="An identifier that applies to this person's qualification in this role." ) - protected List identifier; - - /** - * Coded representation of the qualification. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Coded representation of the qualification", formalDefinition="Coded representation of the qualification." ) - protected CodeableConcept code; - - /** - * Period during which the qualification is valid. - */ - @Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Period during which the qualification is valid", formalDefinition="Period during which the qualification is valid." ) - protected Period period; - - /** - * Organization that regulates and issues the qualification. - */ - @Child(name = "issuer", type = {Organization.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Organization that regulates and issues the qualification", formalDefinition="Organization that regulates and issues the qualification." ) - protected Reference issuer; - - /** - * The actual object that is the target of the reference (Organization that regulates and issues the qualification.) - */ - protected Organization issuerTarget; - - private static final long serialVersionUID = 1095219071L; - - /** - * Constructor - */ - public PractitionerQualificationComponent() { - super(); - } - - /** - * Constructor - */ - public PractitionerQualificationComponent(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person's qualification in this role.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PractitionerQualificationComponent addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #code} (Coded representation of the qualification.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Coded representation of the qualification.) - */ - public PractitionerQualificationComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #period} (Period during which the qualification is valid.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Period during which the qualification is valid.) - */ - public PractitionerQualificationComponent setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #issuer} (Organization that regulates and issues the qualification.) - */ - public Reference getIssuer() { - if (this.issuer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); - else if (Configuration.doAutoCreate()) - this.issuer = new Reference(); // cc - return this.issuer; - } - - public boolean hasIssuer() { - return this.issuer != null && !this.issuer.isEmpty(); - } - - /** - * @param value {@link #issuer} (Organization that regulates and issues the qualification.) - */ - public PractitionerQualificationComponent setIssuer(Reference value) { - this.issuer = value; - return this; - } - - /** - * @return {@link #issuer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.) - */ - public Organization getIssuerTarget() { - if (this.issuerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerQualificationComponent.issuer"); - else if (Configuration.doAutoCreate()) - this.issuerTarget = new Organization(); // aa - return this.issuerTarget; - } - - /** - * @param value {@link #issuer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Organization that regulates and issues the qualification.) - */ - public PractitionerQualificationComponent setIssuerTarget(Organization value) { - this.issuerTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person's qualification in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("code", "CodeableConcept", "Coded representation of the qualification.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("period", "Period", "Period during which the qualification is valid.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("issuer", "Reference(Organization)", "Organization that regulates and issues the qualification.", 0, java.lang.Integer.MAX_VALUE, issuer)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -1179159879: /*issuer*/ return this.issuer == null ? new Base[0] : new Base[] {this.issuer}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -1179159879: // issuer - this.issuer = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("issuer")) - this.issuer = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 3059181: return getCode(); // CodeableConcept - case -991726143: return getPeriod(); // Period - case -1179159879: return getIssuer(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("issuer")) { - this.issuer = new Reference(); - return this.issuer; - } - else - return super.addChild(name); - } - - public PractitionerQualificationComponent copy() { - PractitionerQualificationComponent dst = new PractitionerQualificationComponent(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.period = period == null ? null : period.copy(); - dst.issuer = issuer == null ? null : issuer.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerQualificationComponent)) - return false; - PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(code, o.code, true) && compareDeep(period, o.period, true) - && compareDeep(issuer, o.issuer, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerQualificationComponent)) - return false; - PractitionerQualificationComponent o = (PractitionerQualificationComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (code == null || code.isEmpty()) - && (period == null || period.isEmpty()) && (issuer == null || issuer.isEmpty()); - } - - public String fhirType() { - return "Practitioner.qualification"; - - } - - } - - /** - * An identifier that applies to this person in this role. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A identifier for the person as this agent", formalDefinition="An identifier that applies to this person in this role." ) - protected List identifier; - - /** - * Whether this practitioner's record is in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether this practitioner's record is in active use", formalDefinition="Whether this practitioner's record is in active use." ) - protected BooleanType active; - - /** - * The name(s) associated with the practitioner. - */ - @Child(name = "name", type = {HumanName.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The name(s) associated with the practitioner", formalDefinition="The name(s) associated with the practitioner." ) - protected List name; - - /** - * A contact detail for the practitioner, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A contact detail for the practitioner (that apply to all roles)", formalDefinition="A contact detail for the practitioner, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Address(es) of the practitioner that are not role specific (typically home address). -Work addresses are not typically entered in this property as they are usually role dependent. - */ - @Child(name = "address", type = {Address.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Address(es) of the practitioner that are not role specific (typically home address)", formalDefinition="Address(es) of the practitioner that are not role specific (typically home address). \nWork addresses are not typically entered in this property as they are usually role dependent." ) - protected List
address; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date of birth for the practitioner. - */ - @Child(name = "birthDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The date on which the practitioner was born", formalDefinition="The date of birth for the practitioner." ) - protected DateType birthDate; - - /** - * Image of the person. - */ - @Child(name = "photo", type = {Attachment.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - /** - * The list of roles/organizations that the practitioner is associated with. - */ - @Child(name = "practitionerRole", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Roles/organizations the practitioner is associated with", formalDefinition="The list of roles/organizations that the practitioner is associated with." ) - protected List practitionerRole; - - /** - * Qualifications obtained by training and certification. - */ - @Child(name = "qualification", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Qualifications obtained by training and certification", formalDefinition="Qualifications obtained by training and certification." ) - protected List qualification; - - /** - * A language the practitioner is able to use in patient communication. - */ - @Child(name = "communication", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List communication; - - private static final long serialVersionUID = 2137859974L; - - /** - * Constructor - */ - public Practitioner() { - super(); - } - - /** - * @return {@link #identifier} (An identifier that applies to this person in this role.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (An identifier that applies to this person in this role.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Practitioner addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #active} (Whether this practitioner's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this practitioner's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public Practitioner setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this practitioner's record is in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether this practitioner's record is in active use. - */ - public Practitioner setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #name} (The name(s) associated with the practitioner.) - */ - public List getName() { - if (this.name == null) - this.name = new ArrayList(); - return this.name; - } - - public boolean hasName() { - if (this.name == null) - return false; - for (HumanName item : this.name) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #name} (The name(s) associated with the practitioner.) - */ - // syntactic sugar - public HumanName addName() { //3 - HumanName t = new HumanName(); - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return t; - } - - // syntactic sugar - public Practitioner addName(HumanName t) { //3 - if (t == null) - return this; - if (this.name == null) - this.name = new ArrayList(); - this.name.add(t); - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the practitioner, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Practitioner addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #address} (Address(es) of the practitioner that are not role specific (typically home address). -Work addresses are not typically entered in this property as they are usually role dependent.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (Address(es) of the practitioner that are not role specific (typically home address). -Work addresses are not typically entered in this property as they are usually role dependent.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public Practitioner addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Practitioner setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public Practitioner setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Practitioner.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date of birth for the practitioner.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public Practitioner setBirthDateElement(DateType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date of birth for the practitioner. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date of birth for the practitioner. - */ - public Practitioner setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - // syntactic sugar - public Practitioner addPhoto(Attachment t) { //3 - if (t == null) - return this; - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return this; - } - - /** - * @return {@link #practitionerRole} (The list of roles/organizations that the practitioner is associated with.) - */ - public List getPractitionerRole() { - if (this.practitionerRole == null) - this.practitionerRole = new ArrayList(); - return this.practitionerRole; - } - - public boolean hasPractitionerRole() { - if (this.practitionerRole == null) - return false; - for (PractitionerPractitionerRoleComponent item : this.practitionerRole) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #practitionerRole} (The list of roles/organizations that the practitioner is associated with.) - */ - // syntactic sugar - public PractitionerPractitionerRoleComponent addPractitionerRole() { //3 - PractitionerPractitionerRoleComponent t = new PractitionerPractitionerRoleComponent(); - if (this.practitionerRole == null) - this.practitionerRole = new ArrayList(); - this.practitionerRole.add(t); - return t; - } - - // syntactic sugar - public Practitioner addPractitionerRole(PractitionerPractitionerRoleComponent t) { //3 - if (t == null) - return this; - if (this.practitionerRole == null) - this.practitionerRole = new ArrayList(); - this.practitionerRole.add(t); - return this; - } - - /** - * @return {@link #qualification} (Qualifications obtained by training and certification.) - */ - public List getQualification() { - if (this.qualification == null) - this.qualification = new ArrayList(); - return this.qualification; - } - - public boolean hasQualification() { - if (this.qualification == null) - return false; - for (PractitionerQualificationComponent item : this.qualification) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #qualification} (Qualifications obtained by training and certification.) - */ - // syntactic sugar - public PractitionerQualificationComponent addQualification() { //3 - PractitionerQualificationComponent t = new PractitionerQualificationComponent(); - if (this.qualification == null) - this.qualification = new ArrayList(); - this.qualification.add(t); - return t; - } - - // syntactic sugar - public Practitioner addQualification(PractitionerQualificationComponent t) { //3 - if (t == null) - return this; - if (this.qualification == null) - this.qualification = new ArrayList(); - this.qualification.add(t); - return this; - } - - /** - * @return {@link #communication} (A language the practitioner is able to use in patient communication.) - */ - public List getCommunication() { - if (this.communication == null) - this.communication = new ArrayList(); - return this.communication; - } - - public boolean hasCommunication() { - if (this.communication == null) - return false; - for (CodeableConcept item : this.communication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #communication} (A language the practitioner is able to use in patient communication.) - */ - // syntactic sugar - public CodeableConcept addCommunication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return t; - } - - // syntactic sugar - public Practitioner addCommunication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.communication == null) - this.communication = new ArrayList(); - this.communication.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "An identifier that applies to this person in this role.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("active", "boolean", "Whether this practitioner's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("name", "HumanName", "The name(s) associated with the practitioner.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the practitioner, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("address", "Address", "Address(es) of the practitioner that are not role specific (typically home address). \nWork addresses are not typically entered in this property as they are usually role dependent.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "date", "The date of birth for the practitioner.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("practitionerRole", "", "The list of roles/organizations that the practitioner is associated with.", 0, java.lang.Integer.MAX_VALUE, practitionerRole)); - childrenList.add(new Property("qualification", "", "Qualifications obtained by training and certification.", 0, java.lang.Integer.MAX_VALUE, qualification)); - childrenList.add(new Property("communication", "CodeableConcept", "A language the practitioner is able to use in patient communication.", 0, java.lang.Integer.MAX_VALUE, communication)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType - case 3373707: /*name*/ return this.name == null ? new Base[0] : this.name.toArray(new Base[this.name.size()]); // HumanName - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address - case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration - case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType - case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment - case 221717168: /*practitionerRole*/ return this.practitionerRole == null ? new Base[0] : this.practitionerRole.toArray(new Base[this.practitionerRole.size()]); // PractitionerPractitionerRoleComponent - case -631333393: /*qualification*/ return this.qualification == null ? new Base[0] : this.qualification.toArray(new Base[this.qualification.size()]); // PractitionerQualificationComponent - case -1035284522: /*communication*/ return this.communication == null ? new Base[0] : this.communication.toArray(new Base[this.communication.size()]); // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1422950650: // active - this.active = castToBoolean(value); // BooleanType - break; - case 3373707: // name - this.getName().add(castToHumanName(value)); // HumanName - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1147692044: // address - this.getAddress().add(castToAddress(value)); // Address - break; - case -1249512767: // gender - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - break; - case -1210031859: // birthDate - this.birthDate = castToDate(value); // DateType - break; - case 106642994: // photo - this.getPhoto().add(castToAttachment(value)); // Attachment - break; - case 221717168: // practitionerRole - this.getPractitionerRole().add((PractitionerPractitionerRoleComponent) value); // PractitionerPractitionerRoleComponent - break; - case -631333393: // qualification - this.getQualification().add((PractitionerQualificationComponent) value); // PractitionerQualificationComponent - break; - case -1035284522: // communication - this.getCommunication().add(castToCodeableConcept(value)); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("active")) - this.active = castToBoolean(value); // BooleanType - else if (name.equals("name")) - this.getName().add(castToHumanName(value)); - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("address")) - this.getAddress().add(castToAddress(value)); - else if (name.equals("gender")) - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - else if (name.equals("birthDate")) - this.birthDate = castToDate(value); // DateType - else if (name.equals("photo")) - this.getPhoto().add(castToAttachment(value)); - else if (name.equals("practitionerRole")) - this.getPractitionerRole().add((PractitionerPractitionerRoleComponent) value); - else if (name.equals("qualification")) - this.getQualification().add((PractitionerQualificationComponent) value); - else if (name.equals("communication")) - this.getCommunication().add(castToCodeableConcept(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType - case 3373707: return addName(); // HumanName - case -1429363305: return addTelecom(); // ContactPoint - case -1147692044: return addAddress(); // Address - case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration - case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType - case 106642994: return addPhoto(); // Attachment - case 221717168: return addPractitionerRole(); // PractitionerPractitionerRoleComponent - case -631333393: return addQualification(); // PractitionerQualificationComponent - case -1035284522: return addCommunication(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("active")) { - throw new FHIRException("Cannot call addChild on a primitive type Practitioner.active"); - } - else if (name.equals("name")) { - return addName(); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("address")) { - return addAddress(); - } - else if (name.equals("gender")) { - throw new FHIRException("Cannot call addChild on a primitive type Practitioner.gender"); - } - else if (name.equals("birthDate")) { - throw new FHIRException("Cannot call addChild on a primitive type Practitioner.birthDate"); - } - else if (name.equals("photo")) { - return addPhoto(); - } - else if (name.equals("practitionerRole")) { - return addPractitionerRole(); - } - else if (name.equals("qualification")) { - return addQualification(); - } - else if (name.equals("communication")) { - return addCommunication(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Practitioner"; - - } - - public Practitioner copy() { - Practitioner dst = new Practitioner(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - if (name != null) { - dst.name = new ArrayList(); - for (HumanName i : name) - dst.name.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - if (practitionerRole != null) { - dst.practitionerRole = new ArrayList(); - for (PractitionerPractitionerRoleComponent i : practitionerRole) - dst.practitionerRole.add(i.copy()); - }; - if (qualification != null) { - dst.qualification = new ArrayList(); - for (PractitionerQualificationComponent i : qualification) - dst.qualification.add(i.copy()); - }; - if (communication != null) { - dst.communication = new ArrayList(); - for (CodeableConcept i : communication) - dst.communication.add(i.copy()); - }; - return dst; - } - - protected Practitioner typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Practitioner)) - return false; - Practitioner o = (Practitioner) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(name, o.name, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(address, o.address, true) && compareDeep(gender, o.gender, true) - && compareDeep(birthDate, o.birthDate, true) && compareDeep(photo, o.photo, true) && compareDeep(practitionerRole, o.practitionerRole, true) - && compareDeep(qualification, o.qualification, true) && compareDeep(communication, o.communication, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Practitioner)) - return false; - Practitioner o = (Practitioner) other; - return compareValues(active, o.active, true) && compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) - && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) && (address == null || address.isEmpty()) - && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) && (photo == null || photo.isEmpty()) - && (practitionerRole == null || practitionerRole.isEmpty()) && (qualification == null || qualification.isEmpty()) - && (communication == null || communication.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Practitioner; - } - - /** - * Search parameter: phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: Practitioner.telecom(system=phone), Practitioner.practitionerRole.telecom(system=phone)
- *

- */ - @SearchParamDefinition(name="phone", path="Practitioner.telecom.where(system='phone') or Practitioner.practitionerRole.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) - public static final String SP_PHONE = "phone"; - /** - * Fluent Client search parameter constant for phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: Practitioner.telecom(system=phone), Practitioner.practitionerRole.telecom(system=phone)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); - - /** - * Search parameter: location - *

- * Description: One of the locations at which this practitioner provides care
- * Type: reference
- * Path: Practitioner.practitionerRole.location
- *

- */ - @SearchParamDefinition(name="location", path="Practitioner.practitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: One of the locations at which this practitioner provides care
- * Type: reference
- * Path: Practitioner.practitionerRole.location
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Practitioner:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Practitioner:location").toLocked(); - - /** - * Search parameter: communication - *

- * Description: One of the languages that the practitioner can communicate with
- * Type: token
- * Path: Practitioner.communication
- *

- */ - @SearchParamDefinition(name="communication", path="Practitioner.communication", description="One of the languages that the practitioner can communicate with", type="token" ) - public static final String SP_COMMUNICATION = "communication"; - /** - * Fluent Client search parameter constant for communication - *

- * Description: One of the languages that the practitioner can communicate with
- * Type: token
- * Path: Practitioner.communication
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam COMMUNICATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_COMMUNICATION); - - /** - * Search parameter: address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Practitioner.address.country
- *

- */ - @SearchParamDefinition(name="address-country", path="Practitioner.address.country", description="A country specified in an address", type="string" ) - public static final String SP_ADDRESS_COUNTRY = "address-country"; - /** - * Fluent Client search parameter constant for address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: Practitioner.address.country
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); - - /** - * Search parameter: organization - *

- * Description: The identity of the organization the practitioner represents / acts on behalf of
- * Type: reference
- * Path: Practitioner.practitionerRole.organization
- *

- */ - @SearchParamDefinition(name="organization", path="Practitioner.practitionerRole.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.practitionerRole.organization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Practitioner:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("Practitioner:organization").toLocked(); - - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Practitioner.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="Practitioner.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: Practitioner.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - - /** - * Search parameter: address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Practitioner.address.state
- *

- */ - @SearchParamDefinition(name="address-state", path="Practitioner.address.state", description="A state specified in an address", type="string" ) - public static final String SP_ADDRESS_STATE = "address-state"; - /** - * Fluent Client search parameter constant for address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: Practitioner.address.state
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - - /** - * Search parameter: given - *

- * Description: A portion of the given name
- * Type: string
- * Path: Practitioner.name.given
- *

- */ - @SearchParamDefinition(name="given", path="Practitioner.name.given", 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.given
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam GIVEN = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_GIVEN); - - /** - * Search parameter: email - *

- * Description: A value in an email contact
- * Type: token
- * Path: Practitioner.telecom(system=email), Practitioner.practitionerRole.telecom(system=email)
- *

- */ - @SearchParamDefinition(name="email", path="Practitioner.telecom.where(system='email') or Practitioner.practitionerRole.telecom.where(system='email')", description="A value in an email contact", type="token" ) - public static final String SP_EMAIL = "email"; - /** - * Fluent Client search parameter constant for email - *

- * Description: A value in an email contact
- * Type: token
- * Path: Practitioner.telecom(system=email), Practitioner.practitionerRole.telecom(system=email)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Practitioner.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="Practitioner.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: Practitioner.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - - /** - * Search parameter: family - *

- * Description: A portion of the family name
- * Type: string
- * Path: Practitioner.name.family
- *

- */ - @SearchParamDefinition(name="family", path="Practitioner.name.family", 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.family
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam FAMILY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_FAMILY); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: Practitioner.telecom, Practitioner.practitionerRole.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="Practitioner.telecom | Practitioner.practitionerRole.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: Practitioner.telecom, Practitioner.practitionerRole.telecom
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); - - /** - * Search parameter: role - *

- * Description: The practitioner can perform this role at for the organization
- * Type: token
- * Path: Practitioner.practitionerRole.role
- *

- */ - @SearchParamDefinition(name="role", path="Practitioner.practitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" ) - public static final String SP_ROLE = "role"; - /** - * Fluent Client search parameter constant for role - *

- * Description: The practitioner can perform this role at for the organization
- * Type: token
- * Path: Practitioner.practitionerRole.role
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROLE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); - - /** - * Search parameter: specialty - *

- * Description: The practitioner has this specialty at an organization
- * Type: token
- * Path: Practitioner.practitionerRole.specialty
- *

- */ - @SearchParamDefinition(name="specialty", path="Practitioner.practitionerRole.specialty", description="The practitioner has this specialty at an organization", type="token" ) - public static final String SP_SPECIALTY = "specialty"; - /** - * Fluent Client search parameter constant for specialty - *

- * Description: The practitioner has this specialty at an organization
- * Type: token
- * Path: Practitioner.practitionerRole.specialty
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); - - /** - * Search parameter: identifier - *

- * Description: A practitioner's Identifier
- * Type: token
- * Path: Practitioner.identifier, Practitioner.practitionerRole.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Practitioner.identifier | Practitioner.practitionerRole.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, Practitioner.practitionerRole.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: address-postalcode - *

- * Description: A postalCode specified in an address
- * Type: string
- * Path: Practitioner.address.postalCode
- *

- */ - @SearchParamDefinition(name="address-postalcode", path="Practitioner.address.postalCode", description="A postalCode specified in an address", type="string" ) - public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; - /** - * Fluent Client search parameter constant for address-postalcode - *

- * Description: A postalCode specified in an address
- * Type: string
- * Path: Practitioner.address.postalCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PractitionerRole.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PractitionerRole.java deleted file mode 100644 index aba86f8e7fc..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PractitionerRole.java +++ /dev/null @@ -1,1800 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period of time. - */ -@ResourceDef(name="PractitionerRole", profile="http://hl7.org/fhir/Profile/PractitionerRole") -public class PractitionerRole extends DomainResource { - - @Block() - public static class PractitionerRoleAvailableTimeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Indicates which days of the week are available between the start and end Times. - */ - @Child(name = "daysOfWeek", type = {CodeType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="mon | tue | wed | thu | fri | sat | sun", formalDefinition="Indicates which days of the week are available between the start and end Times." ) - protected List daysOfWeek; - - /** - * Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - @Child(name = "allDay", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Always available? e.g. 24 hour service", formalDefinition="Is this always available? (hence times are irrelevant) e.g. 24 hour service." ) - protected BooleanType allDay; - - /** - * The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name = "availableStartTime", type = {TimeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Opening time of day (ignored if allDay = true)", formalDefinition="The opening time of day. Note: If the AllDay flag is set, then this time is ignored." ) - protected TimeType availableStartTime; - - /** - * The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - @Child(name = "availableEndTime", type = {TimeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Closing time of day (ignored if allDay = true)", formalDefinition="The closing time of day. Note: If the AllDay flag is set, then this time is ignored." ) - protected TimeType availableEndTime; - - private static final long serialVersionUID = 2079379177L; - - /** - * Constructor - */ - public PractitionerRoleAvailableTimeComponent() { - super(); - } - - /** - * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - public List getDaysOfWeek() { - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList(); - return this.daysOfWeek; - } - - public boolean hasDaysOfWeek() { - if (this.daysOfWeek == null) - return false; - for (CodeType item : this.daysOfWeek) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - // syntactic sugar - public CodeType addDaysOfWeekElement() {//2 - CodeType t = new CodeType(); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList(); - this.daysOfWeek.add(t); - return t; - } - - /** - * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - public PractitionerRoleAvailableTimeComponent addDaysOfWeek(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.daysOfWeek == null) - this.daysOfWeek = new ArrayList(); - this.daysOfWeek.add(t); - return this; - } - - /** - * @param value {@link #daysOfWeek} (Indicates which days of the week are available between the start and end Times.) - */ - public boolean hasDaysOfWeek(String value) { - if (this.daysOfWeek == null) - return false; - for (CodeType v : this.daysOfWeek) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public BooleanType getAllDayElement() { - if (this.allDay == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.allDay"); - else if (Configuration.doAutoCreate()) - this.allDay = new BooleanType(); // bb - return this.allDay; - } - - public boolean hasAllDayElement() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - public boolean hasAllDay() { - return this.allDay != null && !this.allDay.isEmpty(); - } - - /** - * @param value {@link #allDay} (Is this always available? (hence times are irrelevant) e.g. 24 hour service.). This is the underlying object with id, value and extensions. The accessor "getAllDay" gives direct access to the value - */ - public PractitionerRoleAvailableTimeComponent setAllDayElement(BooleanType value) { - this.allDay = value; - return this; - } - - /** - * @return Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public boolean getAllDay() { - return this.allDay == null || this.allDay.isEmpty() ? false : this.allDay.getValue(); - } - - /** - * @param value Is this always available? (hence times are irrelevant) e.g. 24 hour service. - */ - public PractitionerRoleAvailableTimeComponent setAllDay(boolean value) { - if (this.allDay == null) - this.allDay = new BooleanType(); - this.allDay.setValue(value); - return this; - } - - /** - * @return {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public TimeType getAvailableStartTimeElement() { - if (this.availableStartTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.availableStartTime"); - else if (Configuration.doAutoCreate()) - this.availableStartTime = new TimeType(); // bb - return this.availableStartTime; - } - - public boolean hasAvailableStartTimeElement() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - public boolean hasAvailableStartTime() { - return this.availableStartTime != null && !this.availableStartTime.isEmpty(); - } - - /** - * @param value {@link #availableStartTime} (The opening time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableStartTime" gives direct access to the value - */ - public PractitionerRoleAvailableTimeComponent setAvailableStartTimeElement(TimeType value) { - this.availableStartTime = value; - return this; - } - - /** - * @return The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public String getAvailableStartTime() { - return this.availableStartTime == null ? null : this.availableStartTime.getValue(); - } - - /** - * @param value The opening time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public PractitionerRoleAvailableTimeComponent setAvailableStartTime(String value) { - if (value == null) - this.availableStartTime = null; - else { - if (this.availableStartTime == null) - this.availableStartTime = new TimeType(); - this.availableStartTime.setValue(value); - } - return this; - } - - /** - * @return {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public TimeType getAvailableEndTimeElement() { - if (this.availableEndTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRoleAvailableTimeComponent.availableEndTime"); - else if (Configuration.doAutoCreate()) - this.availableEndTime = new TimeType(); // bb - return this.availableEndTime; - } - - public boolean hasAvailableEndTimeElement() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - public boolean hasAvailableEndTime() { - return this.availableEndTime != null && !this.availableEndTime.isEmpty(); - } - - /** - * @param value {@link #availableEndTime} (The closing time of day. Note: If the AllDay flag is set, then this time is ignored.). This is the underlying object with id, value and extensions. The accessor "getAvailableEndTime" gives direct access to the value - */ - public PractitionerRoleAvailableTimeComponent setAvailableEndTimeElement(TimeType value) { - this.availableEndTime = value; - return this; - } - - /** - * @return The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public String getAvailableEndTime() { - return this.availableEndTime == null ? null : this.availableEndTime.getValue(); - } - - /** - * @param value The closing time of day. Note: If the AllDay flag is set, then this time is ignored. - */ - public PractitionerRoleAvailableTimeComponent setAvailableEndTime(String value) { - if (value == null) - this.availableEndTime = null; - else { - if (this.availableEndTime == null) - this.availableEndTime = new TimeType(); - this.availableEndTime.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("daysOfWeek", "code", "Indicates which days of the week are available between the start and end Times.", 0, java.lang.Integer.MAX_VALUE, daysOfWeek)); - childrenList.add(new Property("allDay", "boolean", "Is this always available? (hence times are irrelevant) e.g. 24 hour service.", 0, java.lang.Integer.MAX_VALUE, allDay)); - childrenList.add(new Property("availableStartTime", "time", "The opening time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableStartTime)); - childrenList.add(new Property("availableEndTime", "time", "The closing time of day. Note: If the AllDay flag is set, then this time is ignored.", 0, java.lang.Integer.MAX_VALUE, availableEndTime)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 68050338: /*daysOfWeek*/ return this.daysOfWeek == null ? new Base[0] : this.daysOfWeek.toArray(new Base[this.daysOfWeek.size()]); // CodeType - case -1414913477: /*allDay*/ return this.allDay == null ? new Base[0] : new Base[] {this.allDay}; // BooleanType - case -1039453818: /*availableStartTime*/ return this.availableStartTime == null ? new Base[0] : new Base[] {this.availableStartTime}; // TimeType - case 101151551: /*availableEndTime*/ return this.availableEndTime == null ? new Base[0] : new Base[] {this.availableEndTime}; // TimeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 68050338: // daysOfWeek - this.getDaysOfWeek().add(castToCode(value)); // CodeType - break; - case -1414913477: // allDay - this.allDay = castToBoolean(value); // BooleanType - break; - case -1039453818: // availableStartTime - this.availableStartTime = castToTime(value); // TimeType - break; - case 101151551: // availableEndTime - this.availableEndTime = castToTime(value); // TimeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("daysOfWeek")) - this.getDaysOfWeek().add(castToCode(value)); - else if (name.equals("allDay")) - this.allDay = castToBoolean(value); // BooleanType - else if (name.equals("availableStartTime")) - this.availableStartTime = castToTime(value); // TimeType - else if (name.equals("availableEndTime")) - this.availableEndTime = castToTime(value); // TimeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 68050338: throw new FHIRException("Cannot make property daysOfWeek as it is not a complex type"); // CodeType - case -1414913477: throw new FHIRException("Cannot make property allDay as it is not a complex type"); // BooleanType - case -1039453818: throw new FHIRException("Cannot make property availableStartTime as it is not a complex type"); // TimeType - case 101151551: throw new FHIRException("Cannot make property availableEndTime as it is not a complex type"); // TimeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("daysOfWeek")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.daysOfWeek"); - } - else if (name.equals("allDay")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.allDay"); - } - else if (name.equals("availableStartTime")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availableStartTime"); - } - else if (name.equals("availableEndTime")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availableEndTime"); - } - else - return super.addChild(name); - } - - public PractitionerRoleAvailableTimeComponent copy() { - PractitionerRoleAvailableTimeComponent dst = new PractitionerRoleAvailableTimeComponent(); - copyValues(dst); - if (daysOfWeek != null) { - dst.daysOfWeek = new ArrayList(); - for (CodeType i : daysOfWeek) - dst.daysOfWeek.add(i.copy()); - }; - dst.allDay = allDay == null ? null : allDay.copy(); - dst.availableStartTime = availableStartTime == null ? null : availableStartTime.copy(); - dst.availableEndTime = availableEndTime == null ? null : availableEndTime.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerRoleAvailableTimeComponent)) - return false; - PractitionerRoleAvailableTimeComponent o = (PractitionerRoleAvailableTimeComponent) other; - return compareDeep(daysOfWeek, o.daysOfWeek, true) && compareDeep(allDay, o.allDay, true) && compareDeep(availableStartTime, o.availableStartTime, true) - && compareDeep(availableEndTime, o.availableEndTime, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerRoleAvailableTimeComponent)) - return false; - PractitionerRoleAvailableTimeComponent o = (PractitionerRoleAvailableTimeComponent) other; - return compareValues(daysOfWeek, o.daysOfWeek, true) && compareValues(allDay, o.allDay, true) && compareValues(availableStartTime, o.availableStartTime, true) - && compareValues(availableEndTime, o.availableEndTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (daysOfWeek == null || daysOfWeek.isEmpty()) && (allDay == null || allDay.isEmpty()) - && (availableStartTime == null || availableStartTime.isEmpty()) && (availableEndTime == null || availableEndTime.isEmpty()) - ; - } - - public String fhirType() { - return "PractitionerRole.availableTime"; - - } - - } - - @Block() - public static class PractitionerRoleNotAvailableComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The reason that can be presented to the user as to why this time is not available. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reason presented to the user explaining why time not available", formalDefinition="The reason that can be presented to the user as to why this time is not available." ) - protected StringType description; - - /** - * Service is not available (seasonally or for a public holiday) from this date. - */ - @Child(name = "during", type = {Period.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Service not availablefrom this date", formalDefinition="Service is not available (seasonally or for a public holiday) from this date." ) - protected Period during; - - private static final long serialVersionUID = 310849929L; - - /** - * Constructor - */ - public PractitionerRoleNotAvailableComponent() { - super(); - } - - /** - * Constructor - */ - public PractitionerRoleNotAvailableComponent(StringType description) { - super(); - this.description = description; - } - - /** - * @return {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRoleNotAvailableComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The reason that can be presented to the user as to why this time is not available.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public PractitionerRoleNotAvailableComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason that can be presented to the user as to why this time is not available. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason that can be presented to the user as to why this time is not available. - */ - public PractitionerRoleNotAvailableComponent setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) - */ - public Period getDuring() { - if (this.during == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRoleNotAvailableComponent.during"); - else if (Configuration.doAutoCreate()) - this.during = new Period(); // cc - return this.during; - } - - public boolean hasDuring() { - return this.during != null && !this.during.isEmpty(); - } - - /** - * @param value {@link #during} (Service is not available (seasonally or for a public holiday) from this date.) - */ - public PractitionerRoleNotAvailableComponent setDuring(Period value) { - this.during = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "The reason that can be presented to the user as to why this time is not available.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("during", "Period", "Service is not available (seasonally or for a public holiday) from this date.", 0, java.lang.Integer.MAX_VALUE, during)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1320499647: /*during*/ return this.during == null ? new Base[0] : new Base[] {this.during}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1320499647: // during - this.during = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("during")) - this.during = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1320499647: return getDuring(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.description"); - } - else if (name.equals("during")) { - this.during = new Period(); - return this.during; - } - else - return super.addChild(name); - } - - public PractitionerRoleNotAvailableComponent copy() { - PractitionerRoleNotAvailableComponent dst = new PractitionerRoleNotAvailableComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.during = during == null ? null : during.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerRoleNotAvailableComponent)) - return false; - PractitionerRoleNotAvailableComponent o = (PractitionerRoleNotAvailableComponent) other; - return compareDeep(description, o.description, true) && compareDeep(during, o.during, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerRoleNotAvailableComponent)) - return false; - PractitionerRoleNotAvailableComponent o = (PractitionerRoleNotAvailableComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (during == null || during.isEmpty()) - ; - } - - public String fhirType() { - return "PractitionerRole.notAvailable"; - - } - - } - - /** - * Business Identifiers that are specific to a role/location. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifiers that are specific to a role/location", formalDefinition="Business Identifiers that are specific to a role/location." ) - protected List identifier; - - /** - * Whether this practitioner's record is in active use. - */ - @Child(name = "active", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether this practitioner's record is in active use", formalDefinition="Whether this practitioner's record is in active use." ) - protected BooleanType active; - - /** - * Practitioner that is able to provide the defined services for the organation. - */ - @Child(name = "practitioner", type = {Practitioner.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Practitioner that is able to provide the defined services for the organation", formalDefinition="Practitioner that is able to provide the defined services for the organation." ) - protected Reference practitioner; - - /** - * The actual object that is the target of the reference (Practitioner that is able to provide the defined services for the organation.) - */ - protected Practitioner practitionerTarget; - - /** - * The organization where the Practitioner performs the roles associated. - */ - @Child(name = "organization", type = {Organization.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization where the roles are available", formalDefinition="The organization where the Practitioner performs the roles associated." ) - protected Reference organization; - - /** - * The actual object that is the target of the reference (The organization where the Practitioner performs the roles associated.) - */ - protected Organization organizationTarget; - - /** - * Roles which this practitioner is authorized to perform for the organization. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Roles which this practitioner may perform", formalDefinition="Roles which this practitioner is authorized to perform for the organization." ) - protected List role; - - /** - * Specific specialty of the practitioner. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Specific specialty of the practitioner", formalDefinition="Specific specialty of the practitioner." ) - protected List specialty; - - /** - * The location(s) at which this practitioner provides care. - */ - @Child(name = "location", type = {Location.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The location(s) at which this practitioner provides care", formalDefinition="The location(s) at which this practitioner provides care." ) - protected List location; - /** - * The actual objects that are the target of the reference (The location(s) at which this practitioner provides care.) - */ - protected List locationTarget; - - - /** - * The list of healthcare services that this worker provides for this role's Organization/Location(s). - */ - @Child(name = "healthcareService", type = {HealthcareService.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)", formalDefinition="The list of healthcare services that this worker provides for this role's Organization/Location(s)." ) - protected List healthcareService; - /** - * The actual objects that are the target of the reference (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - protected List healthcareServiceTarget; - - - /** - * Contact details that are specific to the role/location/service. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details that are specific to the role/location/service", formalDefinition="Contact details that are specific to the role/location/service." ) - protected List telecom; - - /** - * The period during which the person is authorized to act as a practitioner in these role(s) for the organization. - */ - @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Period period; - - /** - * A collection of times that the Service Site is available. - */ - @Child(name = "availableTime", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Times the Service Site is available", formalDefinition="A collection of times that the Service Site is available." ) - protected List availableTime; - - /** - * The HealthcareService is not available during this period of time due to the provided reason. - */ - @Child(name = "notAvailable", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Not available during this time due to provided reason", formalDefinition="The HealthcareService is not available during this period of time due to the provided reason." ) - protected List notAvailable; - - /** - * A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. - */ - @Child(name = "availabilityExceptions", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Description of availability exceptions", formalDefinition="A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times." ) - protected StringType availabilityExceptions; - - private static final long serialVersionUID = -408504135L; - - /** - * Constructor - */ - public PractitionerRole() { - super(); - } - - /** - * @return {@link #identifier} (Business Identifiers that are specific to a role/location.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Business Identifiers that are specific to a role/location.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #active} (Whether this practitioner's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public BooleanType getActiveElement() { - if (this.active == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.active"); - else if (Configuration.doAutoCreate()) - this.active = new BooleanType(); // bb - return this.active; - } - - public boolean hasActiveElement() { - return this.active != null && !this.active.isEmpty(); - } - - public boolean hasActive() { - return this.active != null && !this.active.isEmpty(); - } - - /** - * @param value {@link #active} (Whether this practitioner's record is in active use.). This is the underlying object with id, value and extensions. The accessor "getActive" gives direct access to the value - */ - public PractitionerRole setActiveElement(BooleanType value) { - this.active = value; - return this; - } - - /** - * @return Whether this practitioner's record is in active use. - */ - public boolean getActive() { - return this.active == null || this.active.isEmpty() ? false : this.active.getValue(); - } - - /** - * @param value Whether this practitioner's record is in active use. - */ - public PractitionerRole setActive(boolean value) { - if (this.active == null) - this.active = new BooleanType(); - this.active.setValue(value); - return this; - } - - /** - * @return {@link #practitioner} (Practitioner that is able to provide the defined services for the organation.) - */ - public Reference getPractitioner() { - if (this.practitioner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitioner = new Reference(); // cc - return this.practitioner; - } - - public boolean hasPractitioner() { - return this.practitioner != null && !this.practitioner.isEmpty(); - } - - /** - * @param value {@link #practitioner} (Practitioner that is able to provide the defined services for the organation.) - */ - public PractitionerRole setPractitioner(Reference value) { - this.practitioner = value; - return this; - } - - /** - * @return {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Practitioner that is able to provide the defined services for the organation.) - */ - public Practitioner getPractitionerTarget() { - if (this.practitionerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.practitioner"); - else if (Configuration.doAutoCreate()) - this.practitionerTarget = new Practitioner(); // aa - return this.practitionerTarget; - } - - /** - * @param value {@link #practitioner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Practitioner that is able to provide the defined services for the organation.) - */ - public PractitionerRole setPractitionerTarget(Practitioner value) { - this.practitionerTarget = value; - return this; - } - - /** - * @return {@link #organization} (The organization where the Practitioner performs the roles associated.) - */ - public Reference getOrganization() { - if (this.organization == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.organization"); - else if (Configuration.doAutoCreate()) - this.organization = new Reference(); // cc - return this.organization; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization where the Practitioner performs the roles associated.) - */ - public PractitionerRole setOrganization(Reference value) { - this.organization = value; - return this; - } - - /** - * @return {@link #organization} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The organization where the Practitioner performs the roles associated.) - */ - public Organization getOrganizationTarget() { - if (this.organizationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.organization"); - else if (Configuration.doAutoCreate()) - this.organizationTarget = new Organization(); // aa - return this.organizationTarget; - } - - /** - * @param value {@link #organization} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The organization where the Practitioner performs the roles associated.) - */ - public PractitionerRole setOrganizationTarget(Organization value) { - this.organizationTarget = value; - return this; - } - - /** - * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - public List getRole() { - if (this.role == null) - this.role = new ArrayList(); - return this.role; - } - - public boolean hasRole() { - if (this.role == null) - return false; - for (CodeableConcept item : this.role) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #role} (Roles which this practitioner is authorized to perform for the organization.) - */ - // syntactic sugar - public CodeableConcept addRole() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addRole(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.role == null) - this.role = new ArrayList(); - this.role.add(t); - return this; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (Specific specialty of the practitioner.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - public List getLocation() { - if (this.location == null) - this.location = new ArrayList(); - return this.location; - } - - public boolean hasLocation() { - if (this.location == null) - return false; - for (Reference item : this.location) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #location} (The location(s) at which this practitioner provides care.) - */ - // syntactic sugar - public Reference addLocation() { //3 - Reference t = new Reference(); - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addLocation(Reference t) { //3 - if (t == null) - return this; - if (this.location == null) - this.location = new ArrayList(); - this.location.add(t); - return this; - } - - /** - * @return {@link #location} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) - */ - public List getLocationTarget() { - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - return this.locationTarget; - } - - // syntactic sugar - /** - * @return {@link #location} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The location(s) at which this practitioner provides care.) - */ - public Location addLocationTarget() { - Location r = new Location(); - if (this.locationTarget == null) - this.locationTarget = new ArrayList(); - this.locationTarget.add(r); - return r; - } - - /** - * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public List getHealthcareService() { - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - return this.healthcareService; - } - - public boolean hasHealthcareService() { - if (this.healthcareService == null) - return false; - for (Reference item : this.healthcareService) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #healthcareService} (The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - // syntactic sugar - public Reference addHealthcareService() { //3 - Reference t = new Reference(); - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - this.healthcareService.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addHealthcareService(Reference t) { //3 - if (t == null) - return this; - if (this.healthcareService == null) - this.healthcareService = new ArrayList(); - this.healthcareService.add(t); - return this; - } - - /** - * @return {@link #healthcareService} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public List getHealthcareServiceTarget() { - if (this.healthcareServiceTarget == null) - this.healthcareServiceTarget = new ArrayList(); - return this.healthcareServiceTarget; - } - - // syntactic sugar - /** - * @return {@link #healthcareService} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. The list of healthcare services that this worker provides for this role's Organization/Location(s).) - */ - public HealthcareService addHealthcareServiceTarget() { - HealthcareService r = new HealthcareService(); - if (this.healthcareServiceTarget == null) - this.healthcareServiceTarget = new ArrayList(); - this.healthcareServiceTarget.add(r); - return r; - } - - /** - * @return {@link #telecom} (Contact details that are specific to the role/location/service.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details that are specific to the role/location/service.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which the person is authorized to act as a practitioner in these role(s) for the organization.) - */ - public PractitionerRole setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #availableTime} (A collection of times that the Service Site is available.) - */ - public List getAvailableTime() { - if (this.availableTime == null) - this.availableTime = new ArrayList(); - return this.availableTime; - } - - public boolean hasAvailableTime() { - if (this.availableTime == null) - return false; - for (PractitionerRoleAvailableTimeComponent item : this.availableTime) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #availableTime} (A collection of times that the Service Site is available.) - */ - // syntactic sugar - public PractitionerRoleAvailableTimeComponent addAvailableTime() { //3 - PractitionerRoleAvailableTimeComponent t = new PractitionerRoleAvailableTimeComponent(); - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addAvailableTime(PractitionerRoleAvailableTimeComponent t) { //3 - if (t == null) - return this; - if (this.availableTime == null) - this.availableTime = new ArrayList(); - this.availableTime.add(t); - return this; - } - - /** - * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) - */ - public List getNotAvailable() { - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - return this.notAvailable; - } - - public boolean hasNotAvailable() { - if (this.notAvailable == null) - return false; - for (PractitionerRoleNotAvailableComponent item : this.notAvailable) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notAvailable} (The HealthcareService is not available during this period of time due to the provided reason.) - */ - // syntactic sugar - public PractitionerRoleNotAvailableComponent addNotAvailable() { //3 - PractitionerRoleNotAvailableComponent t = new PractitionerRoleNotAvailableComponent(); - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - this.notAvailable.add(t); - return t; - } - - // syntactic sugar - public PractitionerRole addNotAvailable(PractitionerRoleNotAvailableComponent t) { //3 - if (t == null) - return this; - if (this.notAvailable == null) - this.notAvailable = new ArrayList(); - this.notAvailable.add(t); - return this; - } - - /** - * @return {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public StringType getAvailabilityExceptionsElement() { - if (this.availabilityExceptions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create PractitionerRole.availabilityExceptions"); - else if (Configuration.doAutoCreate()) - this.availabilityExceptions = new StringType(); // bb - return this.availabilityExceptions; - } - - public boolean hasAvailabilityExceptionsElement() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - public boolean hasAvailabilityExceptions() { - return this.availabilityExceptions != null && !this.availabilityExceptions.isEmpty(); - } - - /** - * @param value {@link #availabilityExceptions} (A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.). This is the underlying object with id, value and extensions. The accessor "getAvailabilityExceptions" gives direct access to the value - */ - public PractitionerRole setAvailabilityExceptionsElement(StringType value) { - this.availabilityExceptions = value; - return this; - } - - /** - * @return A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. - */ - public String getAvailabilityExceptions() { - return this.availabilityExceptions == null ? null : this.availabilityExceptions.getValue(); - } - - /** - * @param value A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times. - */ - public PractitionerRole setAvailabilityExceptions(String value) { - if (Utilities.noString(value)) - this.availabilityExceptions = null; - else { - if (this.availabilityExceptions == null) - this.availabilityExceptions = new StringType(); - this.availabilityExceptions.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Business Identifiers that are specific to a role/location.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("active", "boolean", "Whether this practitioner's record is in active use.", 0, java.lang.Integer.MAX_VALUE, active)); - childrenList.add(new Property("practitioner", "Reference(Practitioner)", "Practitioner that is able to provide the defined services for the organation.", 0, java.lang.Integer.MAX_VALUE, practitioner)); - childrenList.add(new Property("organization", "Reference(Organization)", "The organization where the Practitioner performs the roles associated.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("role", "CodeableConcept", "Roles which this practitioner is authorized to perform for the organization.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("specialty", "CodeableConcept", "Specific specialty of the practitioner.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("location", "Reference(Location)", "The location(s) at which this practitioner provides care.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("healthcareService", "Reference(HealthcareService)", "The list of healthcare services that this worker provides for this role's Organization/Location(s).", 0, java.lang.Integer.MAX_VALUE, healthcareService)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details that are specific to the role/location/service.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("period", "Period", "The period during which the person is authorized to act as a practitioner in these role(s) for the organization.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("availableTime", "", "A collection of times that the Service Site is available.", 0, java.lang.Integer.MAX_VALUE, availableTime)); - childrenList.add(new Property("notAvailable", "", "The HealthcareService is not available during this period of time due to the provided reason.", 0, java.lang.Integer.MAX_VALUE, notAvailable)); - childrenList.add(new Property("availabilityExceptions", "string", "A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.", 0, java.lang.Integer.MAX_VALUE, availabilityExceptions)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1422950650: /*active*/ return this.active == null ? new Base[0] : new Base[] {this.active}; // BooleanType - case 574573338: /*practitioner*/ return this.practitioner == null ? new Base[0] : new Base[] {this.practitioner}; // Reference - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Reference - case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept - case 1901043637: /*location*/ return this.location == null ? new Base[0] : this.location.toArray(new Base[this.location.size()]); // Reference - case 1289661064: /*healthcareService*/ return this.healthcareService == null ? new Base[0] : this.healthcareService.toArray(new Base[this.healthcareService.size()]); // Reference - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case 1873069366: /*availableTime*/ return this.availableTime == null ? new Base[0] : this.availableTime.toArray(new Base[this.availableTime.size()]); // PractitionerRoleAvailableTimeComponent - case -629572298: /*notAvailable*/ return this.notAvailable == null ? new Base[0] : this.notAvailable.toArray(new Base[this.notAvailable.size()]); // PractitionerRoleNotAvailableComponent - case -1149143617: /*availabilityExceptions*/ return this.availabilityExceptions == null ? new Base[0] : new Base[] {this.availabilityExceptions}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1422950650: // active - this.active = castToBoolean(value); // BooleanType - break; - case 574573338: // practitioner - this.practitioner = castToReference(value); // Reference - break; - case 1178922291: // organization - this.organization = castToReference(value); // Reference - break; - case 3506294: // role - this.getRole().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1694759682: // specialty - this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1901043637: // location - this.getLocation().add(castToReference(value)); // Reference - break; - case 1289661064: // healthcareService - this.getHealthcareService().add(castToReference(value)); // Reference - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case 1873069366: // availableTime - this.getAvailableTime().add((PractitionerRoleAvailableTimeComponent) value); // PractitionerRoleAvailableTimeComponent - break; - case -629572298: // notAvailable - this.getNotAvailable().add((PractitionerRoleNotAvailableComponent) value); // PractitionerRoleNotAvailableComponent - break; - case -1149143617: // availabilityExceptions - this.availabilityExceptions = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("active")) - this.active = castToBoolean(value); // BooleanType - else if (name.equals("practitioner")) - this.practitioner = castToReference(value); // Reference - else if (name.equals("organization")) - this.organization = castToReference(value); // Reference - else if (name.equals("role")) - this.getRole().add(castToCodeableConcept(value)); - else if (name.equals("specialty")) - this.getSpecialty().add(castToCodeableConcept(value)); - else if (name.equals("location")) - this.getLocation().add(castToReference(value)); - else if (name.equals("healthcareService")) - this.getHealthcareService().add(castToReference(value)); - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("availableTime")) - this.getAvailableTime().add((PractitionerRoleAvailableTimeComponent) value); - else if (name.equals("notAvailable")) - this.getNotAvailable().add((PractitionerRoleNotAvailableComponent) value); - else if (name.equals("availabilityExceptions")) - this.availabilityExceptions = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1422950650: throw new FHIRException("Cannot make property active as it is not a complex type"); // BooleanType - case 574573338: return getPractitioner(); // Reference - case 1178922291: return getOrganization(); // Reference - case 3506294: return addRole(); // CodeableConcept - case -1694759682: return addSpecialty(); // CodeableConcept - case 1901043637: return addLocation(); // Reference - case 1289661064: return addHealthcareService(); // Reference - case -1429363305: return addTelecom(); // ContactPoint - case -991726143: return getPeriod(); // Period - case 1873069366: return addAvailableTime(); // PractitionerRoleAvailableTimeComponent - case -629572298: return addNotAvailable(); // PractitionerRoleNotAvailableComponent - case -1149143617: throw new FHIRException("Cannot make property availabilityExceptions as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("active")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.active"); - } - else if (name.equals("practitioner")) { - this.practitioner = new Reference(); - return this.practitioner; - } - else if (name.equals("organization")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("role")) { - return addRole(); - } - else if (name.equals("specialty")) { - return addSpecialty(); - } - else if (name.equals("location")) { - return addLocation(); - } - else if (name.equals("healthcareService")) { - return addHealthcareService(); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("availableTime")) { - return addAvailableTime(); - } - else if (name.equals("notAvailable")) { - return addNotAvailable(); - } - else if (name.equals("availabilityExceptions")) { - throw new FHIRException("Cannot call addChild on a primitive type PractitionerRole.availabilityExceptions"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "PractitionerRole"; - - } - - public PractitionerRole copy() { - PractitionerRole dst = new PractitionerRole(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.active = active == null ? null : active.copy(); - dst.practitioner = practitioner == null ? null : practitioner.copy(); - dst.organization = organization == null ? null : organization.copy(); - if (role != null) { - dst.role = new ArrayList(); - for (CodeableConcept i : role) - dst.role.add(i.copy()); - }; - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - if (location != null) { - dst.location = new ArrayList(); - for (Reference i : location) - dst.location.add(i.copy()); - }; - if (healthcareService != null) { - dst.healthcareService = new ArrayList(); - for (Reference i : healthcareService) - dst.healthcareService.add(i.copy()); - }; - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - if (availableTime != null) { - dst.availableTime = new ArrayList(); - for (PractitionerRoleAvailableTimeComponent i : availableTime) - dst.availableTime.add(i.copy()); - }; - if (notAvailable != null) { - dst.notAvailable = new ArrayList(); - for (PractitionerRoleNotAvailableComponent i : notAvailable) - dst.notAvailable.add(i.copy()); - }; - dst.availabilityExceptions = availabilityExceptions == null ? null : availabilityExceptions.copy(); - return dst; - } - - protected PractitionerRole typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof PractitionerRole)) - return false; - PractitionerRole o = (PractitionerRole) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(active, o.active, true) && compareDeep(practitioner, o.practitioner, true) - && compareDeep(organization, o.organization, true) && compareDeep(role, o.role, true) && compareDeep(specialty, o.specialty, true) - && compareDeep(location, o.location, true) && compareDeep(healthcareService, o.healthcareService, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(period, o.period, true) && compareDeep(availableTime, o.availableTime, true) - && compareDeep(notAvailable, o.notAvailable, true) && compareDeep(availabilityExceptions, o.availabilityExceptions, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof PractitionerRole)) - return false; - PractitionerRole o = (PractitionerRole) other; - return compareValues(active, o.active, true) && compareValues(availabilityExceptions, o.availabilityExceptions, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (active == null || active.isEmpty()) - && (practitioner == null || practitioner.isEmpty()) && (organization == null || organization.isEmpty()) - && (role == null || role.isEmpty()) && (specialty == null || specialty.isEmpty()) && (location == null || location.isEmpty()) - && (healthcareService == null || healthcareService.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (period == null || period.isEmpty()) && (availableTime == null || availableTime.isEmpty()) - && (notAvailable == null || notAvailable.isEmpty()) && (availabilityExceptions == null || availabilityExceptions.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.PractitionerRole; - } - - /** - * Search parameter: organization - *

- * Description: The identity of the organization the practitioner represents / acts on behalf of
- * Type: reference
- * Path: PractitionerRole.organization
- *

- */ - @SearchParamDefinition(name="organization", path="PractitionerRole.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: PractitionerRole.organization
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PractitionerRole:organization". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATION = new ca.uhn.fhir.model.api.Include("PractitionerRole:organization").toLocked(); - - /** - * Search parameter: phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: PractitionerRole.telecom(system=phone)
- *

- */ - @SearchParamDefinition(name="phone", path="PractitionerRole.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) - public static final String SP_PHONE = "phone"; - /** - * Fluent Client search parameter constant for phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: PractitionerRole.telecom(system=phone)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); - - /** - * Search parameter: practitioner - *

- * Description: Practitioner that is able to provide the defined services for the organation
- * Type: reference
- * Path: PractitionerRole.practitioner
- *

- */ - @SearchParamDefinition(name="practitioner", path="PractitionerRole.practitioner", description="Practitioner that is able to provide the defined services for the organation", type="reference" ) - public static final String SP_PRACTITIONER = "practitioner"; - /** - * Fluent Client search parameter constant for practitioner - *

- * Description: Practitioner that is able to provide the defined services for the organation
- * Type: reference
- * Path: PractitionerRole.practitioner
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRACTITIONER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRACTITIONER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PractitionerRole:practitioner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRACTITIONER = new ca.uhn.fhir.model.api.Include("PractitionerRole:practitioner").toLocked(); - - /** - * Search parameter: location - *

- * Description: One of the locations at which this practitioner provides care
- * Type: reference
- * Path: PractitionerRole.location
- *

- */ - @SearchParamDefinition(name="location", path="PractitionerRole.location", description="One of the locations at which this practitioner provides care", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: One of the locations at which this practitioner provides care
- * Type: reference
- * Path: PractitionerRole.location
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "PractitionerRole:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("PractitionerRole:location").toLocked(); - - /** - * Search parameter: email - *

- * Description: A value in an email contact
- * Type: token
- * Path: PractitionerRole.telecom(system=email)
- *

- */ - @SearchParamDefinition(name="email", path="PractitionerRole.telecom.where(system='email')", description="A value in an email contact", type="token" ) - public static final String SP_EMAIL = "email"; - /** - * Fluent Client search parameter constant for email - *

- * Description: A value in an email contact
- * Type: token
- * Path: PractitionerRole.telecom(system=email)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); - - /** - * Search parameter: telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: PractitionerRole.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="PractitionerRole.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: PractitionerRole.telecom
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); - - /** - * Search parameter: role - *

- * Description: The practitioner can perform this role at for the organization
- * Type: token
- * Path: PractitionerRole.role
- *

- */ - @SearchParamDefinition(name="role", path="PractitionerRole.role", description="The practitioner can perform this role at for the organization", type="token" ) - public static final String SP_ROLE = "role"; - /** - * Fluent Client search parameter constant for role - *

- * Description: The practitioner can perform this role at for the organization
- * Type: token
- * Path: PractitionerRole.role
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ROLE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ROLE); - - /** - * Search parameter: specialty - *

- * Description: The practitioner has this specialty at an organization
- * Type: token
- * Path: PractitionerRole.specialty
- *

- */ - @SearchParamDefinition(name="specialty", path="PractitionerRole.specialty", description="The practitioner has this specialty at an organization", type="token" ) - public static final String SP_SPECIALTY = "specialty"; - /** - * Fluent Client search parameter constant for specialty - *

- * Description: The practitioner has this specialty at an organization
- * Type: token
- * Path: PractitionerRole.specialty
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); - - /** - * Search parameter: identifier - *

- * Description: A practitioner's Identifier
- * Type: token
- * Path: PractitionerRole.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="PractitionerRole.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: PractitionerRole.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PrimitiveType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PrimitiveType.java deleted file mode 100644 index 56494ba0b21..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/PrimitiveType.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.io.Externalizable; -import java.io.IOException; -import java.io.ObjectInput; -import java.io.ObjectOutput; - -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.hl7.fhir.instance.model.api.IBaseHasExtensions; -import org.hl7.fhir.instance.model.api.IPrimitiveType; - -import ca.uhn.fhir.model.api.IElement; - -public abstract class PrimitiveType extends Type implements IPrimitiveType, IBaseHasExtensions, IElement, Externalizable { - - private static final long serialVersionUID = 3L; - - private T myCoercedValue; - private String myStringValue; - - public String asStringValue() { - return myStringValue; - } - - public abstract Type copy(); - - /** - * Subclasses must override to convert a "coerced" value into an encoded one. - * - * @param theValue - * Will not be null - * @return May return null if the value does not correspond to anything - */ - protected abstract String encode(T theValue); - - @Override - public boolean equalsDeep(Base obj) { - if (!super.equalsDeep(obj)) - return false; - if (obj == null) { - return false; - } - if (!(obj.getClass() == getClass())) { - return false; - } - - PrimitiveType o = (PrimitiveType) obj; - - EqualsBuilder b = new EqualsBuilder(); - b.append(getValue(), o.getValue()); - return b.isEquals(); - } - - @Override - public boolean equalsShallow(Base obj) { - if (obj == null) { - return false; - } - if (!(obj.getClass() == getClass())) { - return false; - } - - PrimitiveType o = (PrimitiveType) obj; - - EqualsBuilder b = new EqualsBuilder(); - b.append(getValue(), o.getValue()); - return b.isEquals(); - } - - public void fromStringValue(String theValue) { - myStringValue = theValue; - if (theValue == null) { - myCoercedValue = null; - } else { - // NB this might be null - myCoercedValue = parse(theValue); - } - } - - public T getValue() { - return myCoercedValue; - } - - public String getValueAsString() { - return asStringValue(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getValue()).toHashCode(); - } - - public boolean hasValue() { - return !StringUtils.isBlank(getValueAsString()); - } - - @Override - public boolean isEmpty() { - return super.isEmpty() && StringUtils.isBlank(getValueAsString()); - } - - public boolean isPrimitive() { - return true; - } - - /** - * Subclasses must override to convert an encoded representation of this datatype into a "coerced" one - * - * @param theValue - * Will not be null - * @return May return null if the value does not correspond to anything - */ - protected abstract T parse(String theValue); - - public String primitiveValue() { - return asStringValue(); - } - - @Override - public void readExternal(ObjectInput theIn) throws IOException, ClassNotFoundException { - String object = (String) theIn.readObject(); - setValueAsString(object); - } - - public PrimitiveType setValue(T theValue) { - myCoercedValue = theValue; - updateStringValue(); - return this; - } - - public void setValueAsString(String theValue) { - fromStringValue(theValue); - } - - @Override - public String toString() { - return getClass().getSimpleName() + "[" + asStringValue() + "]"; - } - - protected Type typedCopy() { - return copy(); - } - - protected void updateStringValue() { - if (myCoercedValue == null) { - myStringValue = null; - } else { - // NB this might be null - myStringValue = encode(myCoercedValue); - } - } - - @Override - public void writeExternal(ObjectOutput theOut) throws IOException { - theOut.writeObject(getValueAsString()); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Procedure.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Procedure.java deleted file mode 100644 index d8979e18b36..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Procedure.java +++ /dev/null @@ -1,2220 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive like counseling or hypnotherapy. - */ -@ResourceDef(name="Procedure", profile="http://hl7.org/fhir/Profile/Procedure") -public class Procedure extends DomainResource { - - public enum ProcedureStatus { - /** - * The procedure is still occurring. - */ - INPROGRESS, - /** - * The procedure was terminated without completing successfully. - */ - ABORTED, - /** - * All actions involved in the procedure have taken place. - */ - COMPLETED, - /** - * The statement was entered in error and Is not valid. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ProcedureStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("aborted".equals(codeString)) - return ABORTED; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown ProcedureStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case ABORTED: return "aborted"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/procedure-status"; - case ABORTED: return "http://hl7.org/fhir/procedure-status"; - case COMPLETED: return "http://hl7.org/fhir/procedure-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/procedure-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "The procedure is still occurring."; - case ABORTED: return "The procedure was terminated without completing successfully."; - case COMPLETED: return "All actions involved in the procedure have taken place."; - case ENTEREDINERROR: return "The statement was entered in error and Is not valid."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case ABORTED: return "Aboted"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class ProcedureStatusEnumFactory implements EnumFactory { - public ProcedureStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return ProcedureStatus.INPROGRESS; - if ("aborted".equals(codeString)) - return ProcedureStatus.ABORTED; - if ("completed".equals(codeString)) - return ProcedureStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return ProcedureStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ProcedureStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, ProcedureStatus.INPROGRESS); - if ("aborted".equals(codeString)) - return new Enumeration(this, ProcedureStatus.ABORTED); - if ("completed".equals(codeString)) - return new Enumeration(this, ProcedureStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, ProcedureStatus.ENTEREDINERROR); - throw new FHIRException("Unknown ProcedureStatus code '"+codeString+"'"); - } - public String toCode(ProcedureStatus code) { - if (code == ProcedureStatus.INPROGRESS) - return "in-progress"; - if (code == ProcedureStatus.ABORTED) - return "aborted"; - if (code == ProcedureStatus.COMPLETED) - return "completed"; - if (code == ProcedureStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(ProcedureStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class ProcedurePerformerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The practitioner who was involved in the procedure. - */ - @Child(name = "actor", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The reference to the practitioner", formalDefinition="The practitioner who was involved in the procedure." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The practitioner who was involved in the procedure.) - */ - protected Resource actorTarget; - - /** - * For example: surgeon, anaethetist, endoscopist. - */ - @Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The role the actor was in", formalDefinition="For example: surgeon, anaethetist, endoscopist." ) - protected CodeableConcept role; - - private static final long serialVersionUID = -843698327L; - - /** - * Constructor - */ - public ProcedurePerformerComponent() { - super(); - } - - /** - * @return {@link #actor} (The practitioner who was involved in the procedure.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The practitioner who was involved in the procedure.) - */ - public ProcedurePerformerComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The practitioner who was involved in the procedure.) - */ - public ProcedurePerformerComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #role} (For example: surgeon, anaethetist, endoscopist.) - */ - public CodeableConcept getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedurePerformerComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new CodeableConcept(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (For example: surgeon, anaethetist, endoscopist.) - */ - public ProcedurePerformerComponent setRole(CodeableConcept value) { - this.role = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("actor", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "The practitioner who was involved in the procedure.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("role", "CodeableConcept", "For example: surgeon, anaethetist, endoscopist.", 0, java.lang.Integer.MAX_VALUE, role)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case 3506294: // role - this.role = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("role")) - this.role = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 92645877: return getActor(); // Reference - case 3506294: return getRole(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("role")) { - this.role = new CodeableConcept(); - return this.role; - } - else - return super.addChild(name); - } - - public ProcedurePerformerComponent copy() { - ProcedurePerformerComponent dst = new ProcedurePerformerComponent(); - copyValues(dst); - dst.actor = actor == null ? null : actor.copy(); - dst.role = role == null ? null : role.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedurePerformerComponent)) - return false; - ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; - return compareDeep(actor, o.actor, true) && compareDeep(role, o.role, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedurePerformerComponent)) - return false; - ProcedurePerformerComponent o = (ProcedurePerformerComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (actor == null || actor.isEmpty()) && (role == null || role.isEmpty()) - ; - } - - public String fhirType() { - return "Procedure.performer"; - - } - - } - - @Block() - public static class ProcedureFocalDeviceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The kind of change that happened to the device during the procedure. - */ - @Child(name = "action", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Kind of change to device", formalDefinition="The kind of change that happened to the device during the procedure." ) - protected CodeableConcept action; - - /** - * The device that was manipulated (changed) during the procedure. - */ - @Child(name = "manipulated", type = {Device.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Device that was changed", formalDefinition="The device that was manipulated (changed) during the procedure." ) - protected Reference manipulated; - - /** - * The actual object that is the target of the reference (The device that was manipulated (changed) during the procedure.) - */ - protected Device manipulatedTarget; - - private static final long serialVersionUID = 1779937807L; - - /** - * Constructor - */ - public ProcedureFocalDeviceComponent() { - super(); - } - - /** - * Constructor - */ - public ProcedureFocalDeviceComponent(Reference manipulated) { - super(); - this.manipulated = manipulated; - } - - /** - * @return {@link #action} (The kind of change that happened to the device during the procedure.) - */ - public CodeableConcept getAction() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.action"); - else if (Configuration.doAutoCreate()) - this.action = new CodeableConcept(); // cc - return this.action; - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (The kind of change that happened to the device during the procedure.) - */ - public ProcedureFocalDeviceComponent setAction(CodeableConcept value) { - this.action = value; - return this; - } - - /** - * @return {@link #manipulated} (The device that was manipulated (changed) during the procedure.) - */ - public Reference getManipulated() { - if (this.manipulated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.manipulated"); - else if (Configuration.doAutoCreate()) - this.manipulated = new Reference(); // cc - return this.manipulated; - } - - public boolean hasManipulated() { - return this.manipulated != null && !this.manipulated.isEmpty(); - } - - /** - * @param value {@link #manipulated} (The device that was manipulated (changed) during the procedure.) - */ - public ProcedureFocalDeviceComponent setManipulated(Reference value) { - this.manipulated = value; - return this; - } - - /** - * @return {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.) - */ - public Device getManipulatedTarget() { - if (this.manipulatedTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureFocalDeviceComponent.manipulated"); - else if (Configuration.doAutoCreate()) - this.manipulatedTarget = new Device(); // aa - return this.manipulatedTarget; - } - - /** - * @param value {@link #manipulated} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The device that was manipulated (changed) during the procedure.) - */ - public ProcedureFocalDeviceComponent setManipulatedTarget(Device value) { - this.manipulatedTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "CodeableConcept", "The kind of change that happened to the device during the procedure.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("manipulated", "Reference(Device)", "The device that was manipulated (changed) during the procedure.", 0, java.lang.Integer.MAX_VALUE, manipulated)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // CodeableConcept - case 947372650: /*manipulated*/ return this.manipulated == null ? new Base[0] : new Base[] {this.manipulated}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422950858: // action - this.action = castToCodeableConcept(value); // CodeableConcept - break; - case 947372650: // manipulated - this.manipulated = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("action")) - this.action = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("manipulated")) - this.manipulated = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422950858: return getAction(); // CodeableConcept - case 947372650: return getManipulated(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("action")) { - this.action = new CodeableConcept(); - return this.action; - } - else if (name.equals("manipulated")) { - this.manipulated = new Reference(); - return this.manipulated; - } - else - return super.addChild(name); - } - - public ProcedureFocalDeviceComponent copy() { - ProcedureFocalDeviceComponent dst = new ProcedureFocalDeviceComponent(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - dst.manipulated = manipulated == null ? null : manipulated.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureFocalDeviceComponent)) - return false; - ProcedureFocalDeviceComponent o = (ProcedureFocalDeviceComponent) other; - return compareDeep(action, o.action, true) && compareDeep(manipulated, o.manipulated, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureFocalDeviceComponent)) - return false; - ProcedureFocalDeviceComponent o = (ProcedureFocalDeviceComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (manipulated == null || manipulated.isEmpty()) - ; - } - - public String fhirType() { - return "Procedure.focalDevice"; - - } - - } - - /** - * This records identifiers associated with this procedure 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Identifiers for this procedure", formalDefinition="This records identifiers associated with this procedure 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)." ) - protected List identifier; - - /** - * The person, animal or group on which the procedure was performed. - */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who the procedure was performed on", formalDefinition="The person, animal or group on which the procedure was performed." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The person, animal or group on which the procedure was performed.) - */ - protected Resource subjectTarget; - - /** - * A code specifying the state of the procedure. Generally this will be in-progress or completed state. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | aborted | completed | entered-in-error", formalDefinition="A code specifying the state of the procedure. Generally this will be in-progress or completed state." ) - protected Enumeration status; - - /** - * A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure"). - */ - @Child(name = "category", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Classification of the procedure", formalDefinition="A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\")." ) - protected CodeableConcept category; - - /** - * The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy"). - */ - @Child(name = "code", type = {CodeableConcept.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identification of the procedure", formalDefinition="The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\")." ) - protected CodeableConcept code; - - /** - * Set this to true if the record is saying that the procedure was NOT performed. - */ - @Child(name = "notPerformed", type = {BooleanType.class}, order=5, min=0, max=1, modifier=true, summary=false) - @Description(shortDefinition="True if procedure was not performed as scheduled", formalDefinition="Set this to true if the record is saying that the procedure was NOT performed." ) - protected BooleanType notPerformed; - - /** - * A code indicating why the procedure was not performed. - */ - @Child(name = "reasonNotPerformed", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Reason procedure was not performed", formalDefinition="A code indicating why the procedure was not performed." ) - protected List reasonNotPerformed; - - /** - * Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion. - */ - @Child(name = "bodySite", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Target body sites", formalDefinition="Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion." ) - protected List bodySite; - - /** - * 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. - */ - @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=8, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Type reason; - - /** - * Limited to 'real' people rather than equipment. - */ - @Child(name = "performer", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The people who performed the procedure", formalDefinition="Limited to 'real' people rather than equipment." ) - protected List performer; - - /** - * The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured. - */ - @Child(name = "performed", type = {DateTimeType.class, Period.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date/Period the procedure was performed", formalDefinition="The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured." ) - protected Type performed; - - /** - * The encounter during which the procedure was performed. - */ - @Child(name = "encounter", type = {Encounter.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The encounter associated with the procedure", formalDefinition="The encounter during which the procedure was performed." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter during which the procedure was performed.) - */ - protected Encounter encounterTarget; - - /** - * The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant. - */ - @Child(name = "location", type = {Location.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where the procedure happened", formalDefinition="The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) - */ - protected Location locationTarget; - - /** - * The outcome of the procedure - did it resolve reasons for the procedure being performed? - */ - @Child(name = "outcome", type = {CodeableConcept.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The result of procedure", formalDefinition="The outcome of the procedure - did it resolve reasons for the procedure being performed?" ) - protected CodeableConcept outcome; - - /** - * This could be a histology result, pathology report, surgical report, etc.. - */ - @Child(name = "report", type = {DiagnosticReport.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Any report resulting from the procedure", formalDefinition="This could be a histology result, pathology report, surgical report, etc.." ) - protected List report; - /** - * The actual objects that are the target of the reference (This could be a histology result, pathology report, surgical report, etc..) - */ - protected List reportTarget; - - - /** - * Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues. - */ - @Child(name = "complication", type = {CodeableConcept.class}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Complication following the procedure", formalDefinition="Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues." ) - protected List complication; - - /** - * If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used. - */ - @Child(name = "followUp", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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 could potentially be more complex in which case the CarePlan resource can be used." ) - protected List followUp; - - /** - * A reference to a resource that contains details of the request for this procedure. - */ - @Child(name = "request", type = {CarePlan.class, DiagnosticOrder.class, ProcedureRequest.class, ReferralRequest.class}, order=17, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="A request for this procedure", formalDefinition="A reference to a resource that contains details of the request for this procedure." ) - protected Reference request; - - /** - * The actual object that is the target of the reference (A reference to a resource that contains details of the request for this procedure.) - */ - protected Resource requestTarget; - - /** - * Any other notes about the procedure. E.g. the operative notes. - */ - @Child(name = "notes", type = {Annotation.class}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional information about the procedure", formalDefinition="Any other notes about the procedure. E.g. the operative notes." ) - protected List notes; - - /** - * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. - */ - @Child(name = "focalDevice", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Device changed in procedure", formalDefinition="A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure." ) - protected List focalDevice; - - /** - * Identifies medications, devices and any other substance used as part of the procedure. - */ - @Child(name = "used", type = {Device.class, Medication.class, Substance.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Items used during procedure", formalDefinition="Identifies medications, devices and any other substance used as part of the procedure." ) - protected List used; - /** - * The actual objects that are the target of the reference (Identifies medications, devices and any other substance used as part of the procedure.) - */ - protected List usedTarget; - - - private static final long serialVersionUID = -489125036L; - - /** - * Constructor - */ - public Procedure() { - super(); - } - - /** - * Constructor - */ - public Procedure(Reference subject, Enumeration status, CodeableConcept code) { - super(); - this.subject = subject; - this.status = status; - this.code = code; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this procedure 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this procedure 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Procedure addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (The person, animal or group on which the procedure was performed.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The person, animal or group on which the procedure was performed.) - */ - public Procedure setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, animal or group on which the procedure was performed.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, animal or group on which the procedure was performed.) - */ - public Procedure setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the procedure. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ProcedureStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the procedure. Generally this will be in-progress or completed state.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Procedure setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the procedure. Generally this will be in-progress or completed state. - */ - public ProcedureStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the procedure. Generally this will be in-progress or completed state. - */ - public Procedure setStatus(ProcedureStatus value) { - if (this.status == null) - this.status = new Enumeration(new ProcedureStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #category} (A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").) - */ - public CodeableConcept getCategory() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.category"); - else if (Configuration.doAutoCreate()) - this.category = new CodeableConcept(); // cc - return this.category; - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (A code that classifies the procedure for searching, sorting and display purposes (e.g. "Surgical Procedure").) - */ - public Procedure setCategory(CodeableConcept value) { - this.category = value; - return this; - } - - /** - * @return {@link #code} (The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. "Laparoscopic Appendectomy").) - */ - public Procedure setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #notPerformed} (Set this to true if the record is saying that the procedure was NOT performed.). This is the underlying object with id, value and extensions. The accessor "getNotPerformed" gives direct access to the value - */ - public BooleanType getNotPerformedElement() { - if (this.notPerformed == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.notPerformed"); - else if (Configuration.doAutoCreate()) - this.notPerformed = new BooleanType(); // bb - return this.notPerformed; - } - - public boolean hasNotPerformedElement() { - return this.notPerformed != null && !this.notPerformed.isEmpty(); - } - - public boolean hasNotPerformed() { - return this.notPerformed != null && !this.notPerformed.isEmpty(); - } - - /** - * @param value {@link #notPerformed} (Set this to true if the record is saying that the procedure was NOT performed.). This is the underlying object with id, value and extensions. The accessor "getNotPerformed" gives direct access to the value - */ - public Procedure setNotPerformedElement(BooleanType value) { - this.notPerformed = value; - return this; - } - - /** - * @return Set this to true if the record is saying that the procedure was NOT performed. - */ - public boolean getNotPerformed() { - return this.notPerformed == null || this.notPerformed.isEmpty() ? false : this.notPerformed.getValue(); - } - - /** - * @param value Set this to true if the record is saying that the procedure was NOT performed. - */ - public Procedure setNotPerformed(boolean value) { - if (this.notPerformed == null) - this.notPerformed = new BooleanType(); - this.notPerformed.setValue(value); - return this; - } - - /** - * @return {@link #reasonNotPerformed} (A code indicating why the procedure was not performed.) - */ - public List getReasonNotPerformed() { - if (this.reasonNotPerformed == null) - this.reasonNotPerformed = new ArrayList(); - return this.reasonNotPerformed; - } - - public boolean hasReasonNotPerformed() { - if (this.reasonNotPerformed == null) - return false; - for (CodeableConcept item : this.reasonNotPerformed) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reasonNotPerformed} (A code indicating why the procedure was not performed.) - */ - // syntactic sugar - public CodeableConcept addReasonNotPerformed() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.reasonNotPerformed == null) - this.reasonNotPerformed = new ArrayList(); - this.reasonNotPerformed.add(t); - return t; - } - - // syntactic sugar - public Procedure addReasonNotPerformed(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.reasonNotPerformed == null) - this.reasonNotPerformed = new ArrayList(); - this.reasonNotPerformed.add(t); - return this; - } - - /** - * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - // syntactic sugar - public Procedure addBodySite(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return this; - } - - /** - * @return {@link #reason} (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 Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (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 CodeableConcept getReasonCodeableConcept() throws FHIRException { - if (!(this.reason instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - public boolean hasReasonCodeableConcept() { - return this.reason instanceof CodeableConcept; - } - - /** - * @return {@link #reason} (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 Reference getReasonReference() throws FHIRException { - if (!(this.reason instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReasonReference() { - return this.reason instanceof Reference; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (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 setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #performer} (Limited to 'real' people rather than equipment.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (ProcedurePerformerComponent item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Limited to 'real' people rather than equipment.) - */ - // syntactic sugar - public ProcedurePerformerComponent addPerformer() { //3 - ProcedurePerformerComponent t = new ProcedurePerformerComponent(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public Procedure addPerformer(ProcedurePerformerComponent t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Type getPerformed() { - return this.performed; - } - - /** - * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public DateTimeType getPerformedDateTimeType() throws FHIRException { - if (!(this.performed instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.performed.getClass().getName()+" was encountered"); - return (DateTimeType) this.performed; - } - - public boolean hasPerformedDateTimeType() { - return this.performed instanceof DateTimeType; - } - - /** - * @return {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Period getPerformedPeriod() throws FHIRException { - if (!(this.performed instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.performed.getClass().getName()+" was encountered"); - return (Period) this.performed; - } - - public boolean hasPerformedPeriod() { - return this.performed instanceof Period; - } - - public boolean hasPerformed() { - return this.performed != null && !this.performed.isEmpty(); - } - - /** - * @param value {@link #performed} (The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.) - */ - public Procedure setPerformed(Type value) { - this.performed = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter during which the procedure was performed.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter during which the procedure was performed.) - */ - public Procedure setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter during which the procedure was performed.) - */ - public Procedure setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #location} (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Procedure setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.) - */ - public Procedure setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #outcome} (The outcome of the procedure - did it resolve reasons for the procedure being performed?) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (The outcome of the procedure - did it resolve reasons for the procedure being performed?) - */ - public Procedure setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #report} (This could be a histology result, pathology report, surgical report, etc..) - */ - public List getReport() { - if (this.report == null) - this.report = new ArrayList(); - return this.report; - } - - public boolean hasReport() { - if (this.report == null) - return false; - for (Reference item : this.report) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #report} (This could be a histology result, pathology report, surgical report, etc..) - */ - // syntactic sugar - public Reference addReport() { //3 - Reference t = new Reference(); - if (this.report == null) - this.report = new ArrayList(); - this.report.add(t); - return t; - } - - // syntactic sugar - public Procedure addReport(Reference t) { //3 - if (t == null) - return this; - if (this.report == null) - this.report = new ArrayList(); - this.report.add(t); - return this; - } - - /** - * @return {@link #report} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. This could be a histology result, pathology report, surgical report, etc..) - */ - public List getReportTarget() { - if (this.reportTarget == null) - this.reportTarget = new ArrayList(); - return this.reportTarget; - } - - // syntactic sugar - /** - * @return {@link #report} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. This could be a histology result, pathology report, surgical report, etc..) - */ - public DiagnosticReport addReportTarget() { - DiagnosticReport r = new DiagnosticReport(); - if (this.reportTarget == null) - this.reportTarget = new ArrayList(); - this.reportTarget.add(r); - return r; - } - - /** - * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.) - */ - public List getComplication() { - if (this.complication == null) - this.complication = new ArrayList(); - return this.complication; - } - - public boolean hasComplication() { - if (this.complication == null) - return false; - for (CodeableConcept item : this.complication) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #complication} (Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.) - */ - // syntactic sugar - public CodeableConcept addComplication() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.complication == null) - this.complication = new ArrayList(); - this.complication.add(t); - return t; - } - - // syntactic sugar - public Procedure addComplication(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.complication == null) - this.complication = new ArrayList(); - this.complication.add(t); - return this; - } - - /** - * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.) - */ - public List getFollowUp() { - if (this.followUp == null) - this.followUp = new ArrayList(); - return this.followUp; - } - - public boolean hasFollowUp() { - if (this.followUp == null) - return false; - for (CodeableConcept item : this.followUp) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #followUp} (If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.) - */ - // syntactic sugar - public CodeableConcept addFollowUp() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.followUp == null) - this.followUp = new ArrayList(); - this.followUp.add(t); - return t; - } - - // syntactic sugar - public Procedure addFollowUp(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.followUp == null) - this.followUp = new ArrayList(); - this.followUp.add(t); - return this; - } - - /** - * @return {@link #request} (A reference to a resource that contains details of the request for this procedure.) - */ - public Reference getRequest() { - if (this.request == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Procedure.request"); - else if (Configuration.doAutoCreate()) - this.request = new Reference(); // cc - return this.request; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (A reference to a resource that contains details of the request for this procedure.) - */ - public Procedure setRequest(Reference value) { - this.request = value; - return this; - } - - /** - * @return {@link #request} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A reference to a resource that contains details of the request for this procedure.) - */ - public Resource getRequestTarget() { - return this.requestTarget; - } - - /** - * @param value {@link #request} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A reference to a resource that contains details of the request for this procedure.) - */ - public Procedure setRequestTarget(Resource value) { - this.requestTarget = value; - return this; - } - - /** - * @return {@link #notes} (Any other notes about the procedure. E.g. the operative notes.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (Annotation item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Any other notes about the procedure. E.g. the operative notes.) - */ - // syntactic sugar - public Annotation addNotes() { //3 - Annotation t = new Annotation(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - // syntactic sugar - public Procedure addNotes(Annotation t) { //3 - if (t == null) - return this; - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @return {@link #focalDevice} (A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.) - */ - public List getFocalDevice() { - if (this.focalDevice == null) - this.focalDevice = new ArrayList(); - return this.focalDevice; - } - - public boolean hasFocalDevice() { - if (this.focalDevice == null) - return false; - for (ProcedureFocalDeviceComponent item : this.focalDevice) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #focalDevice} (A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.) - */ - // syntactic sugar - public ProcedureFocalDeviceComponent addFocalDevice() { //3 - ProcedureFocalDeviceComponent t = new ProcedureFocalDeviceComponent(); - if (this.focalDevice == null) - this.focalDevice = new ArrayList(); - this.focalDevice.add(t); - return t; - } - - // syntactic sugar - public Procedure addFocalDevice(ProcedureFocalDeviceComponent t) { //3 - if (t == null) - return this; - if (this.focalDevice == null) - this.focalDevice = new ArrayList(); - this.focalDevice.add(t); - return this; - } - - /** - * @return {@link #used} (Identifies medications, devices and any other substance used as part of the procedure.) - */ - public List getUsed() { - if (this.used == null) - this.used = new ArrayList(); - return this.used; - } - - public boolean hasUsed() { - if (this.used == null) - return false; - for (Reference item : this.used) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #used} (Identifies medications, devices and any other substance used as part of the procedure.) - */ - // syntactic sugar - public Reference addUsed() { //3 - Reference t = new Reference(); - if (this.used == null) - this.used = new ArrayList(); - this.used.add(t); - return t; - } - - // syntactic sugar - public Procedure addUsed(Reference t) { //3 - if (t == null) - return this; - if (this.used == null) - this.used = new ArrayList(); - this.used.add(t); - return this; - } - - /** - * @return {@link #used} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies medications, devices and any other substance used as part of the procedure.) - */ - public List getUsedTarget() { - if (this.usedTarget == null) - this.usedTarget = new ArrayList(); - return this.usedTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this procedure 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "The person, animal or group on which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("status", "code", "A code specifying the state of the procedure. Generally this will be in-progress or completed state.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\").", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("notPerformed", "boolean", "Set this to true if the record is saying that the procedure was NOT performed.", 0, java.lang.Integer.MAX_VALUE, notPerformed)); - childrenList.add(new Property("reasonNotPerformed", "CodeableConcept", "A code indicating why the procedure was not performed.", 0, java.lang.Integer.MAX_VALUE, reasonNotPerformed)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "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.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("performer", "", "Limited to 'real' people rather than equipment.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("performed[x]", "dateTime|Period", "The date(time)/period over which the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.", 0, java.lang.Integer.MAX_VALUE, performed)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter during which the procedure was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("location", "Reference(Location)", "The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("outcome", "CodeableConcept", "The outcome of the procedure - did it resolve reasons for the procedure being performed?", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("report", "Reference(DiagnosticReport)", "This could be a histology result, pathology report, surgical report, etc..", 0, java.lang.Integer.MAX_VALUE, report)); - childrenList.add(new Property("complication", "CodeableConcept", "Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.", 0, java.lang.Integer.MAX_VALUE, complication)); - childrenList.add(new Property("followUp", "CodeableConcept", "If the procedure required specific follow up - e.g. removal of sutures. The followup may be represented as a simple note, or could potentially be more complex in which case the CarePlan resource can be used.", 0, java.lang.Integer.MAX_VALUE, followUp)); - childrenList.add(new Property("request", "Reference(CarePlan|DiagnosticOrder|ProcedureRequest|ReferralRequest)", "A reference to a resource that contains details of the request for this procedure.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("notes", "Annotation", "Any other notes about the procedure. E.g. the operative notes.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("focalDevice", "", "A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.", 0, java.lang.Integer.MAX_VALUE, focalDevice)); - childrenList.add(new Property("used", "Reference(Device|Medication|Substance)", "Identifies medications, devices and any other substance used as part of the procedure.", 0, java.lang.Integer.MAX_VALUE, used)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 585470509: /*notPerformed*/ return this.notPerformed == null ? new Base[0] : new Base[] {this.notPerformed}; // BooleanType - case -906415471: /*reasonNotPerformed*/ return this.reasonNotPerformed == null ? new Base[0] : this.reasonNotPerformed.toArray(new Base[this.reasonNotPerformed.size()]); // CodeableConcept - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // ProcedurePerformerComponent - case 481140672: /*performed*/ return this.performed == null ? new Base[0] : new Base[] {this.performed}; // Type - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept - case -934521548: /*report*/ return this.report == null ? new Base[0] : this.report.toArray(new Base[this.report.size()]); // Reference - case -1644401602: /*complication*/ return this.complication == null ? new Base[0] : this.complication.toArray(new Base[this.complication.size()]); // CodeableConcept - case 301801004: /*followUp*/ return this.followUp == null ? new Base[0] : this.followUp.toArray(new Base[this.followUp.size()]); // CodeableConcept - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // Annotation - case -1129235173: /*focalDevice*/ return this.focalDevice == null ? new Base[0] : this.focalDevice.toArray(new Base[this.focalDevice.size()]); // ProcedureFocalDeviceComponent - case 3599293: /*used*/ return this.used == null ? new Base[0] : this.used.toArray(new Base[this.used.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new ProcedureStatusEnumFactory().fromType(value); // Enumeration - break; - case 50511102: // category - this.category = castToCodeableConcept(value); // CodeableConcept - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 585470509: // notPerformed - this.notPerformed = castToBoolean(value); // BooleanType - break; - case -906415471: // reasonNotPerformed - this.getReasonNotPerformed().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1702620169: // bodySite - this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -934964668: // reason - this.reason = (Type) value; // Type - break; - case 481140686: // performer - this.getPerformer().add((ProcedurePerformerComponent) value); // ProcedurePerformerComponent - break; - case 481140672: // performed - this.performed = (Type) value; // Type - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case -1106507950: // outcome - this.outcome = castToCodeableConcept(value); // CodeableConcept - break; - case -934521548: // report - this.getReport().add(castToReference(value)); // Reference - break; - case -1644401602: // complication - this.getComplication().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 301801004: // followUp - this.getFollowUp().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1095692943: // request - this.request = castToReference(value); // Reference - break; - case 105008833: // notes - this.getNotes().add(castToAnnotation(value)); // Annotation - break; - case -1129235173: // focalDevice - this.getFocalDevice().add((ProcedureFocalDeviceComponent) value); // ProcedureFocalDeviceComponent - break; - case 3599293: // used - this.getUsed().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new ProcedureStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("category")) - this.category = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("notPerformed")) - this.notPerformed = castToBoolean(value); // BooleanType - else if (name.equals("reasonNotPerformed")) - this.getReasonNotPerformed().add(castToCodeableConcept(value)); - else if (name.equals("bodySite")) - this.getBodySite().add(castToCodeableConcept(value)); - else if (name.equals("reason[x]")) - this.reason = (Type) value; // Type - else if (name.equals("performer")) - this.getPerformer().add((ProcedurePerformerComponent) value); - else if (name.equals("performed[x]")) - this.performed = (Type) value; // Type - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("outcome")) - this.outcome = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("report")) - this.getReport().add(castToReference(value)); - else if (name.equals("complication")) - this.getComplication().add(castToCodeableConcept(value)); - else if (name.equals("followUp")) - this.getFollowUp().add(castToCodeableConcept(value)); - else if (name.equals("request")) - this.request = castToReference(value); // Reference - else if (name.equals("notes")) - this.getNotes().add(castToAnnotation(value)); - else if (name.equals("focalDevice")) - this.getFocalDevice().add((ProcedureFocalDeviceComponent) value); - else if (name.equals("used")) - this.getUsed().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1867885268: return getSubject(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 50511102: return getCategory(); // CodeableConcept - case 3059181: return getCode(); // CodeableConcept - case 585470509: throw new FHIRException("Cannot make property notPerformed as it is not a complex type"); // BooleanType - case -906415471: return addReasonNotPerformed(); // CodeableConcept - case 1702620169: return addBodySite(); // CodeableConcept - case -669418564: return getReason(); // Type - case 481140686: return addPerformer(); // ProcedurePerformerComponent - case 1355984064: return getPerformed(); // Type - case 1524132147: return getEncounter(); // Reference - case 1901043637: return getLocation(); // Reference - case -1106507950: return getOutcome(); // CodeableConcept - case -934521548: return addReport(); // Reference - case -1644401602: return addComplication(); // CodeableConcept - case 301801004: return addFollowUp(); // CodeableConcept - case 1095692943: return getRequest(); // Reference - case 105008833: return addNotes(); // Annotation - case -1129235173: return addFocalDevice(); // ProcedureFocalDeviceComponent - case 3599293: return addUsed(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Procedure.status"); - } - else if (name.equals("category")) { - this.category = new CodeableConcept(); - return this.category; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("notPerformed")) { - throw new FHIRException("Cannot call addChild on a primitive type Procedure.notPerformed"); - } - else if (name.equals("reasonNotPerformed")) { - return addReasonNotPerformed(); - } - else if (name.equals("bodySite")) { - return addBodySite(); - } - else if (name.equals("reasonCodeableConcept")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("reasonReference")) { - this.reason = new Reference(); - return this.reason; - } - else if (name.equals("performer")) { - return addPerformer(); - } - else if (name.equals("performedDateTime")) { - this.performed = new DateTimeType(); - return this.performed; - } - else if (name.equals("performedPeriod")) { - this.performed = new Period(); - return this.performed; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("outcome")) { - this.outcome = new CodeableConcept(); - return this.outcome; - } - else if (name.equals("report")) { - return addReport(); - } - else if (name.equals("complication")) { - return addComplication(); - } - else if (name.equals("followUp")) { - return addFollowUp(); - } - else if (name.equals("request")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("notes")) { - return addNotes(); - } - else if (name.equals("focalDevice")) { - return addFocalDevice(); - } - else if (name.equals("used")) { - return addUsed(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Procedure"; - - } - - public Procedure copy() { - Procedure dst = new Procedure(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.status = status == null ? null : status.copy(); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.notPerformed = notPerformed == null ? null : notPerformed.copy(); - if (reasonNotPerformed != null) { - dst.reasonNotPerformed = new ArrayList(); - for (CodeableConcept i : reasonNotPerformed) - dst.reasonNotPerformed.add(i.copy()); - }; - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (ProcedurePerformerComponent i : performer) - dst.performer.add(i.copy()); - }; - dst.performed = performed == null ? null : performed.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.location = location == null ? null : location.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - if (report != null) { - dst.report = new ArrayList(); - for (Reference i : report) - dst.report.add(i.copy()); - }; - if (complication != null) { - dst.complication = new ArrayList(); - for (CodeableConcept i : complication) - dst.complication.add(i.copy()); - }; - if (followUp != null) { - dst.followUp = new ArrayList(); - for (CodeableConcept i : followUp) - dst.followUp.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (Annotation i : notes) - dst.notes.add(i.copy()); - }; - if (focalDevice != null) { - dst.focalDevice = new ArrayList(); - for (ProcedureFocalDeviceComponent i : focalDevice) - dst.focalDevice.add(i.copy()); - }; - if (used != null) { - dst.used = new ArrayList(); - for (Reference i : used) - dst.used.add(i.copy()); - }; - return dst; - } - - protected Procedure typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Procedure)) - return false; - Procedure o = (Procedure) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(status, o.status, true) - && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(notPerformed, o.notPerformed, true) - && compareDeep(reasonNotPerformed, o.reasonNotPerformed, true) && compareDeep(bodySite, o.bodySite, true) - && compareDeep(reason, o.reason, true) && compareDeep(performer, o.performer, true) && compareDeep(performed, o.performed, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(location, o.location, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(report, o.report, true) && compareDeep(complication, o.complication, true) && compareDeep(followUp, o.followUp, true) - && compareDeep(request, o.request, true) && compareDeep(notes, o.notes, true) && compareDeep(focalDevice, o.focalDevice, true) - && compareDeep(used, o.used, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Procedure)) - return false; - Procedure o = (Procedure) other; - return compareValues(status, o.status, true) && compareValues(notPerformed, o.notPerformed, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (status == null || status.isEmpty()) && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) - && (notPerformed == null || notPerformed.isEmpty()) && (reasonNotPerformed == null || reasonNotPerformed.isEmpty()) - && (bodySite == null || bodySite.isEmpty()) && (reason == null || reason.isEmpty()) && (performer == null || performer.isEmpty()) - && (performed == null || performed.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (location == null || location.isEmpty()) && (outcome == null || outcome.isEmpty()) && (report == null || report.isEmpty()) - && (complication == null || complication.isEmpty()) && (followUp == null || followUp.isEmpty()) - && (request == null || request.isEmpty()) && (notes == null || notes.isEmpty()) && (focalDevice == null || focalDevice.isEmpty()) - && (used == null || used.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Procedure; - } - - /** - * Search parameter: patient - *

- * Description: Search by subject - a patient
- * Type: reference
- * Path: Procedure.subject
- *

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

- * Description: Search by subject - a patient
- * Type: reference
- * Path: Procedure.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Procedure:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Procedure:patient").toLocked(); - - /** - * Search parameter: location - *

- * Description: Where the procedure happened
- * Type: reference
- * Path: Procedure.location
- *

- */ - @SearchParamDefinition(name="location", path="Procedure.location", description="Where the procedure happened", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: Where the procedure happened
- * Type: reference
- * Path: Procedure.location
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Procedure:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Procedure:location").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Search by subject
- * Type: reference
- * Path: Procedure.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Procedure.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Search by subject
- * Type: reference
- * Path: Procedure.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Procedure:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Procedure:subject").toLocked(); - - /** - * Search parameter: performer - *

- * Description: The reference to the practitioner
- * Type: reference
- * Path: Procedure.performer.actor
- *

- */ - @SearchParamDefinition(name="performer", path="Procedure.performer.actor", description="The reference to the practitioner", type="reference" ) - public static final String SP_PERFORMER = "performer"; - /** - * Fluent Client search parameter constant for performer - *

- * Description: The reference to the practitioner
- * Type: reference
- * Path: Procedure.performer.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Procedure:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("Procedure:performer").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: The encounter associated with the procedure
- * Type: reference
- * Path: Procedure.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="Procedure.encounter", description="The encounter associated with the procedure", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: The encounter associated with the procedure
- * Type: reference
- * Path: Procedure.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Procedure:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("Procedure:encounter").toLocked(); - - /** - * Search parameter: code - *

- * Description: A code to identify a procedure
- * Type: token
- * Path: Procedure.code
- *

- */ - @SearchParamDefinition(name="code", path="Procedure.code", description="A code to identify a procedure", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: A code to identify a procedure
- * Type: token
- * Path: Procedure.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: Date/Period the procedure was performed
- * Type: date
- * Path: Procedure.performed[x]
- *

- */ - @SearchParamDefinition(name="date", path="Procedure.performed", description="Date/Period the procedure was performed", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: Date/Period the procedure was performed
- * Type: date
- * Path: Procedure.performed[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: A unique identifier for a procedure
- * Type: token
- * Path: Procedure.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Procedure.identifier", description="A unique identifier for a procedure", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A unique identifier for a procedure
- * Type: token
- * Path: Procedure.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java deleted file mode 100644 index 5d690e8c192..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcedureRequest.java +++ /dev/null @@ -1,1569 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * A request for a procedure to be performed. May be a proposal or an order. - */ -@ResourceDef(name="ProcedureRequest", profile="http://hl7.org/fhir/Profile/ProcedureRequest") -public class ProcedureRequest extends DomainResource { - - public enum ProcedureRequestStatus { - /** - * The request has been proposed. - */ - PROPOSED, - /** - * The request is in preliminary form, prior to being requested. - */ - DRAFT, - /** - * The request has been placed. - */ - REQUESTED, - /** - * The receiving system has received the request but not yet decided whether it will be performed. - */ - RECEIVED, - /** - * The receiving system has accepted the request, but work has not yet commenced. - */ - ACCEPTED, - /** - * The work to fulfill the request is happening. - */ - INPROGRESS, - /** - * The work has been completed, the report(s) released, and no further work is planned. - */ - COMPLETED, - /** - * The request has been held by originating system/user request. - */ - SUSPENDED, - /** - * The receiving system has declined to fulfill the request. - */ - REJECTED, - /** - * The request was attempted, but due to some procedural error, it could not be completed. - */ - ABORTED, - /** - * added to help the parsers - */ - NULL; - public static ProcedureRequestStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return PROPOSED; - if ("draft".equals(codeString)) - return DRAFT; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("suspended".equals(codeString)) - return SUSPENDED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("aborted".equals(codeString)) - return ABORTED; - throw new FHIRException("Unknown ProcedureRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSED: return "proposed"; - case DRAFT: return "draft"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case SUSPENDED: return "suspended"; - case REJECTED: return "rejected"; - case ABORTED: return "aborted"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSED: return "http://hl7.org/fhir/procedure-request-status"; - case DRAFT: return "http://hl7.org/fhir/procedure-request-status"; - case REQUESTED: return "http://hl7.org/fhir/procedure-request-status"; - case RECEIVED: return "http://hl7.org/fhir/procedure-request-status"; - case ACCEPTED: return "http://hl7.org/fhir/procedure-request-status"; - case INPROGRESS: return "http://hl7.org/fhir/procedure-request-status"; - case COMPLETED: return "http://hl7.org/fhir/procedure-request-status"; - case SUSPENDED: return "http://hl7.org/fhir/procedure-request-status"; - case REJECTED: return "http://hl7.org/fhir/procedure-request-status"; - case ABORTED: return "http://hl7.org/fhir/procedure-request-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSED: return "The request has been proposed."; - case DRAFT: return "The request is in preliminary form, prior to being requested."; - case REQUESTED: return "The request has been placed."; - case RECEIVED: return "The receiving system has received the request but not yet decided whether it will be performed."; - case ACCEPTED: return "The receiving system has accepted the request, but work has not yet commenced."; - case INPROGRESS: return "The work to fulfill the request is happening."; - case COMPLETED: return "The work has been completed, the report(s) released, and no further work is planned."; - case SUSPENDED: return "The request has been held by originating system/user request."; - case REJECTED: return "The receiving system has declined to fulfill the request."; - case ABORTED: return "The request was attempted, but due to some procedural error, it could not be completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSED: return "Proposed"; - case DRAFT: return "Draft"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case SUSPENDED: return "Suspended"; - case REJECTED: return "Rejected"; - case ABORTED: return "Aborted"; - default: return "?"; - } - } - } - - public static class ProcedureRequestStatusEnumFactory implements EnumFactory { - public ProcedureRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return ProcedureRequestStatus.PROPOSED; - if ("draft".equals(codeString)) - return ProcedureRequestStatus.DRAFT; - if ("requested".equals(codeString)) - return ProcedureRequestStatus.REQUESTED; - if ("received".equals(codeString)) - return ProcedureRequestStatus.RECEIVED; - if ("accepted".equals(codeString)) - return ProcedureRequestStatus.ACCEPTED; - if ("in-progress".equals(codeString)) - return ProcedureRequestStatus.INPROGRESS; - if ("completed".equals(codeString)) - return ProcedureRequestStatus.COMPLETED; - if ("suspended".equals(codeString)) - return ProcedureRequestStatus.SUSPENDED; - if ("rejected".equals(codeString)) - return ProcedureRequestStatus.REJECTED; - if ("aborted".equals(codeString)) - return ProcedureRequestStatus.ABORTED; - throw new IllegalArgumentException("Unknown ProcedureRequestStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposed".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.PROPOSED); - if ("draft".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.DRAFT); - if ("requested".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.REQUESTED); - if ("received".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.RECEIVED); - if ("accepted".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.ACCEPTED); - if ("in-progress".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.COMPLETED); - if ("suspended".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.SUSPENDED); - if ("rejected".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.REJECTED); - if ("aborted".equals(codeString)) - return new Enumeration(this, ProcedureRequestStatus.ABORTED); - throw new FHIRException("Unknown ProcedureRequestStatus code '"+codeString+"'"); - } - public String toCode(ProcedureRequestStatus code) { - if (code == ProcedureRequestStatus.PROPOSED) - return "proposed"; - if (code == ProcedureRequestStatus.DRAFT) - return "draft"; - if (code == ProcedureRequestStatus.REQUESTED) - return "requested"; - if (code == ProcedureRequestStatus.RECEIVED) - return "received"; - if (code == ProcedureRequestStatus.ACCEPTED) - return "accepted"; - if (code == ProcedureRequestStatus.INPROGRESS) - return "in-progress"; - if (code == ProcedureRequestStatus.COMPLETED) - return "completed"; - if (code == ProcedureRequestStatus.SUSPENDED) - return "suspended"; - if (code == ProcedureRequestStatus.REJECTED) - return "rejected"; - if (code == ProcedureRequestStatus.ABORTED) - return "aborted"; - return "?"; - } - public String toSystem(ProcedureRequestStatus code) { - return code.getSystem(); - } - } - - public enum ProcedureRequestPriority { - /** - * The request has a normal priority. - */ - ROUTINE, - /** - * The request should be done urgently. - */ - URGENT, - /** - * The request is time-critical. - */ - STAT, - /** - * The request should be acted on as soon as possible. - */ - ASAP, - /** - * added to help the parsers - */ - NULL; - public static ProcedureRequestPriority fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ROUTINE; - if ("urgent".equals(codeString)) - return URGENT; - if ("stat".equals(codeString)) - return STAT; - if ("asap".equals(codeString)) - return ASAP; - throw new FHIRException("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case ROUTINE: return "routine"; - case URGENT: return "urgent"; - case STAT: return "stat"; - case ASAP: return "asap"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case ROUTINE: return "http://hl7.org/fhir/procedure-request-priority"; - case URGENT: return "http://hl7.org/fhir/procedure-request-priority"; - case STAT: return "http://hl7.org/fhir/procedure-request-priority"; - case ASAP: return "http://hl7.org/fhir/procedure-request-priority"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case ROUTINE: return "The request has a normal priority."; - case URGENT: return "The request should be done urgently."; - case STAT: return "The request is time-critical."; - case ASAP: return "The request should be acted on as soon as possible."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case ROUTINE: return "Routine"; - case URGENT: return "Urgent"; - case STAT: return "Stat"; - case ASAP: return "ASAP"; - default: return "?"; - } - } - } - - public static class ProcedureRequestPriorityEnumFactory implements EnumFactory { - public ProcedureRequestPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return ProcedureRequestPriority.ROUTINE; - if ("urgent".equals(codeString)) - return ProcedureRequestPriority.URGENT; - if ("stat".equals(codeString)) - return ProcedureRequestPriority.STAT; - if ("asap".equals(codeString)) - return ProcedureRequestPriority.ASAP; - throw new IllegalArgumentException("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("routine".equals(codeString)) - return new Enumeration(this, ProcedureRequestPriority.ROUTINE); - if ("urgent".equals(codeString)) - return new Enumeration(this, ProcedureRequestPriority.URGENT); - if ("stat".equals(codeString)) - return new Enumeration(this, ProcedureRequestPriority.STAT); - if ("asap".equals(codeString)) - return new Enumeration(this, ProcedureRequestPriority.ASAP); - throw new FHIRException("Unknown ProcedureRequestPriority code '"+codeString+"'"); - } - public String toCode(ProcedureRequestPriority code) { - if (code == ProcedureRequestPriority.ROUTINE) - return "routine"; - if (code == ProcedureRequestPriority.URGENT) - return "urgent"; - if (code == ProcedureRequestPriority.STAT) - return "stat"; - if (code == ProcedureRequestPriority.ASAP) - return "asap"; - return "?"; - } - public String toSystem(ProcedureRequestPriority code) { - return code.getSystem(); - } - } - - /** - * Identifiers assigned to this order by the order or by the receiver. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier for the request", formalDefinition="Identifiers assigned to this order by the order or by the receiver." ) - protected List identifier; - - /** - * The person, animal or group that should receive the procedure. - */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who the procedure should be done to", formalDefinition="The person, animal or group that should receive the procedure." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The person, animal or group that should receive the procedure.) - */ - protected Resource subjectTarget; - - /** - * The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="What procedure to perform", formalDefinition="The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded." ) - protected CodeableConcept code; - - /** - * Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites). - */ - @Child(name = "bodySite", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="What part of body to perform on", formalDefinition="Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites)." ) - protected List bodySite; - - /** - * The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance. - */ - @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why procedure should occur", formalDefinition="The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance." ) - protected Type reason; - - /** - * The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "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". - */ - @Child(name = "scheduled", type = {DateTimeType.class, Period.class, Timing.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When procedure should occur", formalDefinition="The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. \"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\"." ) - protected Type scheduled; - - /** - * The encounter within which the procedure proposal or request was created. - */ - @Child(name = "encounter", type = {Encounter.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Encounter request created during", formalDefinition="The encounter within which the procedure proposal or request was created." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter within which the procedure proposal or request was created.) - */ - protected Encounter encounterTarget; - - /** - * For example, the surgeon, anaethetist, endoscopist, etc. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, Patient.class, RelatedPerson.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who should perform the procedure", formalDefinition="For example, the surgeon, anaethetist, endoscopist, etc." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (For example, the surgeon, anaethetist, endoscopist, etc.) - */ - protected Resource performerTarget; - - /** - * The status of the order. - */ - @Child(name = "status", type = {CodeType.class}, order=8, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposed | draft | requested | received | accepted | in-progress | completed | suspended | rejected | aborted", formalDefinition="The status of the order." ) - protected Enumeration status; - - /** - * Any other notes associated with this proposal or order - e.g. provider instructions. - */ - @Child(name = "notes", type = {Annotation.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additional information about desired procedure", formalDefinition="Any other notes associated with this proposal or order - e.g. provider instructions." ) - protected List notes; - - /** - * If a CodeableConcept is present, it indicates the pre-condition for performing the procedure. - */ - @Child(name = "asNeeded", type = {BooleanType.class, CodeableConcept.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Preconditions for procedure", formalDefinition="If a CodeableConcept is present, it indicates the pre-condition for performing the procedure." ) - protected Type asNeeded; - - /** - * The time when the request was made. - */ - @Child(name = "orderedOn", type = {DateTimeType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When request was created", formalDefinition="The time when the request was made." ) - protected DateTimeType orderedOn; - - /** - * The healthcare professional responsible for proposing or ordering the procedure. - */ - @Child(name = "orderer", type = {Practitioner.class, Patient.class, RelatedPerson.class, Device.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who made request", formalDefinition="The healthcare professional responsible for proposing or ordering the procedure." ) - protected Reference orderer; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for proposing or ordering the procedure.) - */ - protected Resource ordererTarget; - - /** - * The clinical priority associated with this order. - */ - @Child(name = "priority", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="routine | urgent | stat | asap", formalDefinition="The clinical priority associated with this order." ) - protected Enumeration priority; - - private static final long serialVersionUID = -916650578L; - - /** - * Constructor - */ - public ProcedureRequest() { - super(); - } - - /** - * Constructor - */ - public ProcedureRequest(Reference subject, CodeableConcept code) { - super(); - this.subject = subject; - this.code = code; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifiers assigned to this order by the order or by the receiver.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ProcedureRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #subject} (The person, animal or group that should receive the procedure.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The person, animal or group that should receive the procedure.) - */ - public ProcedureRequest setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person, animal or group that should receive the procedure.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person, animal or group that should receive the procedure.) - */ - public ProcedureRequest setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #code} (The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded.) - */ - public ProcedureRequest setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).) - */ - public List getBodySite() { - if (this.bodySite == null) - this.bodySite = new ArrayList(); - return this.bodySite; - } - - public boolean hasBodySite() { - if (this.bodySite == null) - return false; - for (CodeableConcept item : this.bodySite) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #bodySite} (Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).) - */ - // syntactic sugar - public CodeableConcept addBodySite() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return t; - } - - // syntactic sugar - public ProcedureRequest addBodySite(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.bodySite == null) - this.bodySite = new ArrayList(); - this.bodySite.add(t); - return this; - } - - /** - * @return {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - public CodeableConcept getReasonCodeableConcept() throws FHIRException { - if (!(this.reason instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - public boolean hasReasonCodeableConcept() { - return this.reason instanceof CodeableConcept; - } - - /** - * @return {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - public Reference getReasonReference() throws FHIRException { - if (!(this.reason instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReasonReference() { - return this.reason instanceof Reference; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.) - */ - public ProcedureRequest setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "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 Type getScheduled() { - return this.scheduled; - } - - /** - * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "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 DateTimeType getScheduledDateTimeType() throws FHIRException { - if (!(this.scheduled instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (DateTimeType) this.scheduled; - } - - public boolean hasScheduledDateTimeType() { - return this.scheduled instanceof DateTimeType; - } - - /** - * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "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 Period getScheduledPeriod() throws FHIRException { - if (!(this.scheduled instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Period) this.scheduled; - } - - public boolean hasScheduledPeriod() { - return this.scheduled instanceof Period; - } - - /** - * @return {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "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 Timing getScheduledTiming() throws FHIRException { - if (!(this.scheduled instanceof Timing)) - throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.scheduled.getClass().getName()+" was encountered"); - return (Timing) this.scheduled; - } - - public boolean hasScheduledTiming() { - return this.scheduled instanceof Timing; - } - - public boolean hasScheduled() { - return this.scheduled != null && !this.scheduled.isEmpty(); - } - - /** - * @param value {@link #scheduled} (The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. "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 ProcedureRequest setScheduled(Type value) { - this.scheduled = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter within which the procedure proposal or request was created.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter within which the procedure proposal or request was created.) - */ - public ProcedureRequest setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter within which the procedure proposal or request was created.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter within which the procedure proposal or request was created.) - */ - public ProcedureRequest setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #performer} (For example, the surgeon, anaethetist, endoscopist, etc.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (For example, the surgeon, anaethetist, endoscopist, etc.) - */ - public ProcedureRequest setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For example, the surgeon, anaethetist, endoscopist, etc.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For example, the surgeon, anaethetist, endoscopist, etc.) - */ - public ProcedureRequest setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the order.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ProcedureRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the order. - */ - public ProcedureRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the order. - */ - public ProcedureRequest setStatus(ProcedureRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ProcedureRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #notes} (Any other notes associated with this proposal or order - e.g. provider instructions.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (Annotation item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Any other notes associated with this proposal or order - e.g. provider instructions.) - */ - // syntactic sugar - public Annotation addNotes() { //3 - Annotation t = new Annotation(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - // syntactic sugar - public ProcedureRequest addNotes(Annotation t) { //3 - if (t == null) - return this; - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public Type getAsNeeded() { - return this.asNeeded; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public BooleanType getAsNeededBooleanType() throws FHIRException { - if (!(this.asNeeded instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (BooleanType) this.asNeeded; - } - - public boolean hasAsNeededBooleanType() { - return this.asNeeded instanceof BooleanType; - } - - /** - * @return {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public CodeableConcept getAsNeededCodeableConcept() throws FHIRException { - if (!(this.asNeeded instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.asNeeded.getClass().getName()+" was encountered"); - return (CodeableConcept) this.asNeeded; - } - - public boolean hasAsNeededCodeableConcept() { - return this.asNeeded instanceof CodeableConcept; - } - - public boolean hasAsNeeded() { - return this.asNeeded != null && !this.asNeeded.isEmpty(); - } - - /** - * @param value {@link #asNeeded} (If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.) - */ - public ProcedureRequest setAsNeeded(Type value) { - this.asNeeded = value; - return this; - } - - /** - * @return {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public DateTimeType getOrderedOnElement() { - if (this.orderedOn == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.orderedOn"); - else if (Configuration.doAutoCreate()) - this.orderedOn = new DateTimeType(); // bb - return this.orderedOn; - } - - public boolean hasOrderedOnElement() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - public boolean hasOrderedOn() { - return this.orderedOn != null && !this.orderedOn.isEmpty(); - } - - /** - * @param value {@link #orderedOn} (The time when the request was made.). This is the underlying object with id, value and extensions. The accessor "getOrderedOn" gives direct access to the value - */ - public ProcedureRequest setOrderedOnElement(DateTimeType value) { - this.orderedOn = value; - return this; - } - - /** - * @return The time when the request was made. - */ - public Date getOrderedOn() { - return this.orderedOn == null ? null : this.orderedOn.getValue(); - } - - /** - * @param value The time when the request was made. - */ - public ProcedureRequest setOrderedOn(Date value) { - if (value == null) - this.orderedOn = null; - else { - if (this.orderedOn == null) - this.orderedOn = new DateTimeType(); - this.orderedOn.setValue(value); - } - return this; - } - - /** - * @return {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public Reference getOrderer() { - if (this.orderer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.orderer"); - else if (Configuration.doAutoCreate()) - this.orderer = new Reference(); // cc - return this.orderer; - } - - public boolean hasOrderer() { - return this.orderer != null && !this.orderer.isEmpty(); - } - - /** - * @param value {@link #orderer} (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public ProcedureRequest setOrderer(Reference value) { - this.orderer = value; - return this; - } - - /** - * @return {@link #orderer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public Resource getOrdererTarget() { - return this.ordererTarget; - } - - /** - * @param value {@link #orderer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for proposing or ordering the procedure.) - */ - public ProcedureRequest setOrdererTarget(Resource value) { - this.ordererTarget = value; - return this; - } - - /** - * @return {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcedureRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The clinical priority associated with this order.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public ProcedureRequest setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The clinical priority associated with this order. - */ - public ProcedureRequestPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The clinical priority associated with this order. - */ - public ProcedureRequest setPriority(ProcedureRequestPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new ProcedureRequestPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifiers assigned to this order by the order or by the receiver.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "The person, animal or group that should receive the procedure.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("code", "CodeableConcept", "The specific procedure that is ordered. Use text if the exact nature of the procedure cannot be coded.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Indicates the sites on the subject's body where the procedure should be performed (I.e. the target sites).", 0, java.lang.Integer.MAX_VALUE, bodySite)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "The reason why the procedure is being proposed or ordered. This procedure request may be motivated by a Condition for instance.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("scheduled[x]", "dateTime|Period|Timing", "The timing schedule for the proposed or ordered procedure. The Schedule data type allows many different expressions. E.g. \"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\".", 0, java.lang.Integer.MAX_VALUE, scheduled)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter within which the procedure proposal or request was created.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|Patient|RelatedPerson)", "For example, the surgeon, anaethetist, endoscopist, etc.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("status", "code", "The status of the order.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("notes", "Annotation", "Any other notes associated with this proposal or order - e.g. provider instructions.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("asNeeded[x]", "boolean|CodeableConcept", "If a CodeableConcept is present, it indicates the pre-condition for performing the procedure.", 0, java.lang.Integer.MAX_VALUE, asNeeded)); - childrenList.add(new Property("orderedOn", "dateTime", "The time when the request was made.", 0, java.lang.Integer.MAX_VALUE, orderedOn)); - childrenList.add(new Property("orderer", "Reference(Practitioner|Patient|RelatedPerson|Device)", "The healthcare professional responsible for proposing or ordering the procedure.", 0, java.lang.Integer.MAX_VALUE, orderer)); - childrenList.add(new Property("priority", "code", "The clinical priority associated with this order.", 0, java.lang.Integer.MAX_VALUE, priority)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : this.bodySite.toArray(new Base[this.bodySite.size()]); // CodeableConcept - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type - case -160710483: /*scheduled*/ return this.scheduled == null ? new Base[0] : new Base[] {this.scheduled}; // Type - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // Annotation - case -1432923513: /*asNeeded*/ return this.asNeeded == null ? new Base[0] : new Base[] {this.asNeeded}; // Type - case -391079124: /*orderedOn*/ return this.orderedOn == null ? new Base[0] : new Base[] {this.orderedOn}; // DateTimeType - case -1207109509: /*orderer*/ return this.orderer == null ? new Base[0] : new Base[] {this.orderer}; // Reference - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case 1702620169: // bodySite - this.getBodySite().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -934964668: // reason - this.reason = (Type) value; // Type - break; - case -160710483: // scheduled - this.scheduled = (Type) value; // Type - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 481140686: // performer - this.performer = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new ProcedureRequestStatusEnumFactory().fromType(value); // Enumeration - break; - case 105008833: // notes - this.getNotes().add(castToAnnotation(value)); // Annotation - break; - case -1432923513: // asNeeded - this.asNeeded = (Type) value; // Type - break; - case -391079124: // orderedOn - this.orderedOn = castToDateTime(value); // DateTimeType - break; - case -1207109509: // orderer - this.orderer = castToReference(value); // Reference - break; - case -1165461084: // priority - this.priority = new ProcedureRequestPriorityEnumFactory().fromType(value); // Enumeration - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("bodySite")) - this.getBodySite().add(castToCodeableConcept(value)); - else if (name.equals("reason[x]")) - this.reason = (Type) value; // Type - else if (name.equals("scheduled[x]")) - this.scheduled = (Type) value; // Type - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("performer")) - this.performer = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new ProcedureRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("notes")) - this.getNotes().add(castToAnnotation(value)); - else if (name.equals("asNeeded[x]")) - this.asNeeded = (Type) value; // Type - else if (name.equals("orderedOn")) - this.orderedOn = castToDateTime(value); // DateTimeType - else if (name.equals("orderer")) - this.orderer = castToReference(value); // Reference - else if (name.equals("priority")) - this.priority = new ProcedureRequestPriorityEnumFactory().fromType(value); // Enumeration - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1867885268: return getSubject(); // Reference - case 3059181: return getCode(); // CodeableConcept - case 1702620169: return addBodySite(); // CodeableConcept - case -669418564: return getReason(); // Type - case 1162627251: return getScheduled(); // Type - case 1524132147: return getEncounter(); // Reference - case 481140686: return getPerformer(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 105008833: return addNotes(); // Annotation - case -544329575: return getAsNeeded(); // Type - case -391079124: throw new FHIRException("Cannot make property orderedOn as it is not a complex type"); // DateTimeType - case -1207109509: return getOrderer(); // Reference - case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("bodySite")) { - return addBodySite(); - } - else if (name.equals("reasonCodeableConcept")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("reasonReference")) { - this.reason = new Reference(); - return this.reason; - } - else if (name.equals("scheduledDateTime")) { - this.scheduled = new DateTimeType(); - return this.scheduled; - } - else if (name.equals("scheduledPeriod")) { - this.scheduled = new Period(); - return this.scheduled; - } - else if (name.equals("scheduledTiming")) { - this.scheduled = new Timing(); - return this.scheduled; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("performer")) { - this.performer = new Reference(); - return this.performer; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcedureRequest.status"); - } - else if (name.equals("notes")) { - return addNotes(); - } - else if (name.equals("asNeededBoolean")) { - this.asNeeded = new BooleanType(); - return this.asNeeded; - } - else if (name.equals("asNeededCodeableConcept")) { - this.asNeeded = new CodeableConcept(); - return this.asNeeded; - } - else if (name.equals("orderedOn")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcedureRequest.orderedOn"); - } - else if (name.equals("orderer")) { - this.orderer = new Reference(); - return this.orderer; - } - else if (name.equals("priority")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcedureRequest.priority"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ProcedureRequest"; - - } - - public ProcedureRequest copy() { - ProcedureRequest dst = new ProcedureRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.subject = subject == null ? null : subject.copy(); - dst.code = code == null ? null : code.copy(); - if (bodySite != null) { - dst.bodySite = new ArrayList(); - for (CodeableConcept i : bodySite) - dst.bodySite.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - dst.scheduled = scheduled == null ? null : scheduled.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.status = status == null ? null : status.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (Annotation i : notes) - dst.notes.add(i.copy()); - }; - dst.asNeeded = asNeeded == null ? null : asNeeded.copy(); - dst.orderedOn = orderedOn == null ? null : orderedOn.copy(); - dst.orderer = orderer == null ? null : orderer.copy(); - dst.priority = priority == null ? null : priority.copy(); - return dst; - } - - protected ProcedureRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcedureRequest)) - return false; - ProcedureRequest o = (ProcedureRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(subject, o.subject, true) && compareDeep(code, o.code, true) - && compareDeep(bodySite, o.bodySite, true) && compareDeep(reason, o.reason, true) && compareDeep(scheduled, o.scheduled, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(performer, o.performer, true) && compareDeep(status, o.status, true) - && compareDeep(notes, o.notes, true) && compareDeep(asNeeded, o.asNeeded, true) && compareDeep(orderedOn, o.orderedOn, true) - && compareDeep(orderer, o.orderer, true) && compareDeep(priority, o.priority, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcedureRequest)) - return false; - ProcedureRequest o = (ProcedureRequest) other; - return compareValues(status, o.status, true) && compareValues(orderedOn, o.orderedOn, true) && compareValues(priority, o.priority, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (subject == null || subject.isEmpty()) - && (code == null || code.isEmpty()) && (bodySite == null || bodySite.isEmpty()) && (reason == null || reason.isEmpty()) - && (scheduled == null || scheduled.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (performer == null || performer.isEmpty()) && (status == null || status.isEmpty()) && (notes == null || notes.isEmpty()) - && (asNeeded == null || asNeeded.isEmpty()) && (orderedOn == null || orderedOn.isEmpty()) - && (orderer == null || orderer.isEmpty()) && (priority == null || priority.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcedureRequest; - } - - /** - * Search parameter: orderer - *

- * Description: Who made request
- * Type: reference
- * Path: ProcedureRequest.orderer
- *

- */ - @SearchParamDefinition(name="orderer", path="ProcedureRequest.orderer", description="Who made request", type="reference" ) - public static final String SP_ORDERER = "orderer"; - /** - * Fluent Client search parameter constant for orderer - *

- * Description: Who made request
- * Type: reference
- * Path: ProcedureRequest.orderer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORDERER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORDERER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcedureRequest:orderer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORDERER = new ca.uhn.fhir.model.api.Include("ProcedureRequest:orderer").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Search by subject - a patient
- * Type: reference
- * Path: ProcedureRequest.subject
- *

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

- * Description: Search by subject - a patient
- * Type: reference
- * Path: ProcedureRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcedureRequest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ProcedureRequest:patient").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Search by subject
- * Type: reference
- * Path: ProcedureRequest.subject
- *

- */ - @SearchParamDefinition(name="subject", path="ProcedureRequest.subject", description="Search by subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Search by subject
- * Type: reference
- * Path: ProcedureRequest.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcedureRequest:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("ProcedureRequest:subject").toLocked(); - - /** - * Search parameter: performer - *

- * Description: Who should perform the procedure
- * Type: reference
- * Path: ProcedureRequest.performer
- *

- */ - @SearchParamDefinition(name="performer", path="ProcedureRequest.performer", description="Who should perform the procedure", type="reference" ) - public static final String SP_PERFORMER = "performer"; - /** - * Fluent Client search parameter constant for performer - *

- * Description: Who should perform the procedure
- * Type: reference
- * Path: ProcedureRequest.performer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcedureRequest:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("ProcedureRequest:performer").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Encounter request created during
- * Type: reference
- * Path: ProcedureRequest.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="ProcedureRequest.encounter", description="Encounter request created during", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Encounter request created during
- * Type: reference
- * Path: ProcedureRequest.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcedureRequest:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("ProcedureRequest:encounter").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: A unique identifier of the Procedure Request
- * Type: token
- * Path: ProcedureRequest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ProcedureRequest.identifier", description="A unique identifier of the Procedure Request", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A unique identifier of the Procedure Request
- * Type: token
- * Path: ProcedureRequest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcessRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcessRequest.java deleted file mode 100644 index 2a8b6434fc2..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcessRequest.java +++ /dev/null @@ -1,1600 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides the target, request and response, and action details for an action to be performed by the target on or about existing resources. - */ -@ResourceDef(name="ProcessRequest", profile="http://hl7.org/fhir/Profile/ProcessRequest") -public class ProcessRequest extends DomainResource { - - public enum ActionList { - /** - * Cancel, reverse or nullify the target resource. - */ - CANCEL, - /** - * Check for previously un-read/ not-retrieved resources. - */ - POLL, - /** - * Re-process the target resource. - */ - REPROCESS, - /** - * Retrieve the processing status of the target resource. - */ - STATUS, - /** - * added to help the parsers - */ - NULL; - public static ActionList fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("cancel".equals(codeString)) - return CANCEL; - if ("poll".equals(codeString)) - return POLL; - if ("reprocess".equals(codeString)) - return REPROCESS; - if ("status".equals(codeString)) - return STATUS; - throw new FHIRException("Unknown ActionList code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CANCEL: return "cancel"; - case POLL: return "poll"; - case REPROCESS: return "reprocess"; - case STATUS: return "status"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CANCEL: return "http://hl7.org/fhir/actionlist"; - case POLL: return "http://hl7.org/fhir/actionlist"; - case REPROCESS: return "http://hl7.org/fhir/actionlist"; - case STATUS: return "http://hl7.org/fhir/actionlist"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CANCEL: return "Cancel, reverse or nullify the target resource."; - case POLL: return "Check for previously un-read/ not-retrieved resources."; - case REPROCESS: return "Re-process the target resource."; - case STATUS: return "Retrieve the processing status of the target resource."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CANCEL: return "Cancel, Reverse or Nullify"; - case POLL: return "Poll"; - case REPROCESS: return "Re-Process"; - case STATUS: return "Status Check"; - default: return "?"; - } - } - } - - public static class ActionListEnumFactory implements EnumFactory { - public ActionList fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("cancel".equals(codeString)) - return ActionList.CANCEL; - if ("poll".equals(codeString)) - return ActionList.POLL; - if ("reprocess".equals(codeString)) - return ActionList.REPROCESS; - if ("status".equals(codeString)) - return ActionList.STATUS; - throw new IllegalArgumentException("Unknown ActionList code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("cancel".equals(codeString)) - return new Enumeration(this, ActionList.CANCEL); - if ("poll".equals(codeString)) - return new Enumeration(this, ActionList.POLL); - if ("reprocess".equals(codeString)) - return new Enumeration(this, ActionList.REPROCESS); - if ("status".equals(codeString)) - return new Enumeration(this, ActionList.STATUS); - throw new FHIRException("Unknown ActionList code '"+codeString+"'"); - } - public String toCode(ActionList code) { - if (code == ActionList.CANCEL) - return "cancel"; - if (code == ActionList.POLL) - return "poll"; - if (code == ActionList.REPROCESS) - return "reprocess"; - if (code == ActionList.STATUS) - return "status"; - return "?"; - } - public String toSystem(ActionList code) { - return code.getSystem(); - } - } - - @Block() - public static class ItemsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A service line number. - */ - @Child(name = "sequenceLinkId", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Service instance", formalDefinition="A service line number." ) - protected IntegerType sequenceLinkId; - - private static final long serialVersionUID = -1598360600L; - - /** - * Constructor - */ - public ItemsComponent() { - super(); - } - - /** - * Constructor - */ - public ItemsComponent(IntegerType sequenceLinkId) { - super(); - this.sequenceLinkId = sequenceLinkId; - } - - /** - * @return {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public IntegerType getSequenceLinkIdElement() { - if (this.sequenceLinkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ItemsComponent.sequenceLinkId"); - else if (Configuration.doAutoCreate()) - this.sequenceLinkId = new IntegerType(); // bb - return this.sequenceLinkId; - } - - public boolean hasSequenceLinkIdElement() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - public boolean hasSequenceLinkId() { - return this.sequenceLinkId != null && !this.sequenceLinkId.isEmpty(); - } - - /** - * @param value {@link #sequenceLinkId} (A service line number.). This is the underlying object with id, value and extensions. The accessor "getSequenceLinkId" gives direct access to the value - */ - public ItemsComponent setSequenceLinkIdElement(IntegerType value) { - this.sequenceLinkId = value; - return this; - } - - /** - * @return A service line number. - */ - public int getSequenceLinkId() { - return this.sequenceLinkId == null || this.sequenceLinkId.isEmpty() ? 0 : this.sequenceLinkId.getValue(); - } - - /** - * @param value A service line number. - */ - public ItemsComponent setSequenceLinkId(int value) { - if (this.sequenceLinkId == null) - this.sequenceLinkId = new IntegerType(); - this.sequenceLinkId.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequenceLinkId", "integer", "A service line number.", 0, java.lang.Integer.MAX_VALUE, sequenceLinkId)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422298666: /*sequenceLinkId*/ return this.sequenceLinkId == null ? new Base[0] : new Base[] {this.sequenceLinkId}; // IntegerType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422298666: // sequenceLinkId - this.sequenceLinkId = castToInteger(value); // IntegerType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequenceLinkId")) - this.sequenceLinkId = castToInteger(value); // IntegerType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422298666: throw new FHIRException("Cannot make property sequenceLinkId as it is not a complex type"); // IntegerType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequenceLinkId")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.sequenceLinkId"); - } - else - return super.addChild(name); - } - - public ItemsComponent copy() { - ItemsComponent dst = new ItemsComponent(); - copyValues(dst); - dst.sequenceLinkId = sequenceLinkId == null ? null : sequenceLinkId.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareDeep(sequenceLinkId, o.sequenceLinkId, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ItemsComponent)) - return false; - ItemsComponent o = (ItemsComponent) other; - return compareValues(sequenceLinkId, o.sequenceLinkId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequenceLinkId == null || sequenceLinkId.isEmpty()); - } - - public String fhirType() { - return "ProcessRequest.item"; - - } - - } - - /** - * The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - */ - @Child(name = "action", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="cancel | poll | reprocess | status", formalDefinition="The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest." ) - protected Enumeration action; - - /** - * The ProcessRequest business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The ProcessRequest business identifier." ) - protected List identifier; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when this resource was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when this resource was created." ) - protected DateTimeType created; - - /** - * The organization which is the target of the request. - */ - @Child(name = "target", type = {Identifier.class, Organization.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Target of the request", formalDefinition="The organization which is the target of the request." ) - protected Type target; - - /** - * The practitioner who is responsible for the action specified in thise request. - */ - @Child(name = "provider", type = {Identifier.class, Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible practitioner", formalDefinition="The practitioner who is responsible for the action specified in thise request." ) - protected Type provider; - - /** - * The organization which is responsible for the action speccified in thise request. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the action speccified in thise request." ) - protected Type organization; - - /** - * Reference of resource which is the target or subject of this action. - */ - @Child(name = "request", type = {Identifier.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Request reference", formalDefinition="Reference of resource which is the target or subject of this action." ) - protected Type request; - - /** - * Reference of a prior response to resource which is the target or subject of this action. - */ - @Child(name = "response", type = {Identifier.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Response reference", formalDefinition="Reference of a prior response to resource which is the target or subject of this action." ) - protected Type response; - - /** - * If true remove all history excluding audit. - */ - @Child(name = "nullify", type = {BooleanType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Nullify", formalDefinition="If true remove all history excluding audit." ) - protected BooleanType nullify; - - /** - * A reference to supply which authenticates the process. - */ - @Child(name = "reference", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference number/string", formalDefinition="A reference to supply which authenticates the process." ) - protected StringType reference; - - /** - * List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. - */ - @Child(name = "item", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Items to re-adjudicate", formalDefinition="List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated." ) - protected List item; - - /** - * Names of resource types to include. - */ - @Child(name = "include", type = {StringType.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Resource type(s) to include", formalDefinition="Names of resource types to include." ) - protected List include; - - /** - * Names of resource types to exclude. - */ - @Child(name = "exclude", type = {StringType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Resource type(s) to exclude", formalDefinition="Names of resource types to exclude." ) - protected List exclude; - - /** - * A period of time during which the fulfilling resources would have been created. - */ - @Child(name = "period", type = {Period.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Period", formalDefinition="A period of time during which the fulfilling resources would have been created." ) - protected Period period; - - private static final long serialVersionUID = -1557088159L; - - /** - * Constructor - */ - public ProcessRequest() { - super(); - } - - /** - * Constructor - */ - public ProcessRequest(Enumeration action) { - super(); - this.action = action; - } - - /** - * @return {@link #action} (The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public Enumeration getActionElement() { - if (this.action == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.action"); - else if (Configuration.doAutoCreate()) - this.action = new Enumeration(new ActionListEnumFactory()); // bb - return this.action; - } - - public boolean hasActionElement() { - return this.action != null && !this.action.isEmpty(); - } - - public boolean hasAction() { - return this.action != null && !this.action.isEmpty(); - } - - /** - * @param value {@link #action} (The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.). This is the underlying object with id, value and extensions. The accessor "getAction" gives direct access to the value - */ - public ProcessRequest setActionElement(Enumeration value) { - this.action = value; - return this; - } - - /** - * @return The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - */ - public ActionList getAction() { - return this.action == null ? null : this.action.getValue(); - } - - /** - * @param value The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest. - */ - public ProcessRequest setAction(ActionList value) { - if (this.action == null) - this.action = new Enumeration(new ActionListEnumFactory()); - this.action.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (The ProcessRequest business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The ProcessRequest business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ProcessRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ProcessRequest setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ProcessRequest setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when this resource was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ProcessRequest setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when this resource was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when this resource was created. - */ - public ProcessRequest setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (The organization which is the target of the request.) - */ - public Type getTarget() { - return this.target; - } - - /** - * @return {@link #target} (The organization which is the target of the request.) - */ - public Identifier getTargetIdentifier() throws FHIRException { - if (!(this.target instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Identifier) this.target; - } - - public boolean hasTargetIdentifier() { - return this.target instanceof Identifier; - } - - /** - * @return {@link #target} (The organization which is the target of the request.) - */ - public Reference getTargetReference() throws FHIRException { - if (!(this.target instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.target.getClass().getName()+" was encountered"); - return (Reference) this.target; - } - - public boolean hasTargetReference() { - return this.target instanceof Reference; - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (The organization which is the target of the request.) - */ - public ProcessRequest setTarget(Type value) { - this.target = value; - return this; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) - */ - public Type getProvider() { - return this.provider; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) - */ - public Identifier getProviderIdentifier() throws FHIRException { - if (!(this.provider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Identifier) this.provider; - } - - public boolean hasProviderIdentifier() { - return this.provider instanceof Identifier; - } - - /** - * @return {@link #provider} (The practitioner who is responsible for the action specified in thise request.) - */ - public Reference getProviderReference() throws FHIRException { - if (!(this.provider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.provider.getClass().getName()+" was encountered"); - return (Reference) this.provider; - } - - public boolean hasProviderReference() { - return this.provider instanceof Reference; - } - - public boolean hasProvider() { - return this.provider != null && !this.provider.isEmpty(); - } - - /** - * @param value {@link #provider} (The practitioner who is responsible for the action specified in thise request.) - */ - public ProcessRequest setProvider(Type value) { - this.provider = value; - return this; - } - - /** - * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The organization which is responsible for the action speccified in thise request.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization which is responsible for the action speccified in thise request.) - */ - public ProcessRequest setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #request} (Reference of resource which is the target or subject of this action.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (Reference of resource which is the target or subject of this action.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Reference of resource which is the target or subject of this action.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Reference of resource which is the target or subject of this action.) - */ - public ProcessRequest setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) - */ - public Type getResponse() { - return this.response; - } - - /** - * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) - */ - public Identifier getResponseIdentifier() throws FHIRException { - if (!(this.response instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.response.getClass().getName()+" was encountered"); - return (Identifier) this.response; - } - - public boolean hasResponseIdentifier() { - return this.response instanceof Identifier; - } - - /** - * @return {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) - */ - public Reference getResponseReference() throws FHIRException { - if (!(this.response instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.response.getClass().getName()+" was encountered"); - return (Reference) this.response; - } - - public boolean hasResponseReference() { - return this.response instanceof Reference; - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (Reference of a prior response to resource which is the target or subject of this action.) - */ - public ProcessRequest setResponse(Type value) { - this.response = value; - return this; - } - - /** - * @return {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value - */ - public BooleanType getNullifyElement() { - if (this.nullify == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.nullify"); - else if (Configuration.doAutoCreate()) - this.nullify = new BooleanType(); // bb - return this.nullify; - } - - public boolean hasNullifyElement() { - return this.nullify != null && !this.nullify.isEmpty(); - } - - public boolean hasNullify() { - return this.nullify != null && !this.nullify.isEmpty(); - } - - /** - * @param value {@link #nullify} (If true remove all history excluding audit.). This is the underlying object with id, value and extensions. The accessor "getNullify" gives direct access to the value - */ - public ProcessRequest setNullifyElement(BooleanType value) { - this.nullify = value; - return this; - } - - /** - * @return If true remove all history excluding audit. - */ - public boolean getNullify() { - return this.nullify == null || this.nullify.isEmpty() ? false : this.nullify.getValue(); - } - - /** - * @param value If true remove all history excluding audit. - */ - public ProcessRequest setNullify(boolean value) { - if (this.nullify == null) - this.nullify = new BooleanType(); - this.nullify.setValue(value); - return this; - } - - /** - * @return {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public StringType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new StringType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (A reference to supply which authenticates the process.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProcessRequest setReferenceElement(StringType value) { - this.reference = value; - return this; - } - - /** - * @return A reference to supply which authenticates the process. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value A reference to supply which authenticates the process. - */ - public ProcessRequest setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new StringType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (ItemsComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.) - */ - // syntactic sugar - public ItemsComponent addItem() { //3 - ItemsComponent t = new ItemsComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public ProcessRequest addItem(ItemsComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - /** - * @return {@link #include} (Names of resource types to include.) - */ - public List getInclude() { - if (this.include == null) - this.include = new ArrayList(); - return this.include; - } - - public boolean hasInclude() { - if (this.include == null) - return false; - for (StringType item : this.include) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #include} (Names of resource types to include.) - */ - // syntactic sugar - public StringType addIncludeElement() {//2 - StringType t = new StringType(); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return t; - } - - /** - * @param value {@link #include} (Names of resource types to include.) - */ - public ProcessRequest addInclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return this; - } - - /** - * @param value {@link #include} (Names of resource types to include.) - */ - public boolean hasInclude(String value) { - if (this.include == null) - return false; - for (StringType v : this.include) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #exclude} (Names of resource types to exclude.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (StringType item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Names of resource types to exclude.) - */ - // syntactic sugar - public StringType addExcludeElement() {//2 - StringType t = new StringType(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - /** - * @param value {@link #exclude} (Names of resource types to exclude.) - */ - public ProcessRequest addExclude(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return this; - } - - /** - * @param value {@link #exclude} (Names of resource types to exclude.) - */ - public boolean hasExclude(String value) { - if (this.exclude == null) - return false; - for (StringType v : this.exclude) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #period} (A period of time during which the fulfilling resources would have been created.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessRequest.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (A period of time during which the fulfilling resources would have been created.) - */ - public ProcessRequest setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "code", "The type of processing action being requested, for example Reversal, Readjudication, StatusRequest,PendedRequest.", 0, java.lang.Integer.MAX_VALUE, action)); - childrenList.add(new Property("identifier", "Identifier", "The ProcessRequest business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when this resource was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("target[x]", "Identifier|Reference(Organization)", "The organization which is the target of the request.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("provider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the action specified in thise request.", 0, java.lang.Integer.MAX_VALUE, provider)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the action speccified in thise request.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "Reference of resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("response[x]", "Identifier|Reference(Any)", "Reference of a prior response to resource which is the target or subject of this action.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("nullify", "boolean", "If true remove all history excluding audit.", 0, java.lang.Integer.MAX_VALUE, nullify)); - childrenList.add(new Property("reference", "string", "A reference to supply which authenticates the process.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("item", "", "List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated.", 0, java.lang.Integer.MAX_VALUE, item)); - childrenList.add(new Property("include", "string", "Names of resource types to include.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "string", "Names of resource types to exclude.", 0, java.lang.Integer.MAX_VALUE, exclude)); - childrenList.add(new Property("period", "Period", "A period of time during which the fulfilling resources would have been created.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // Type - case -987494927: /*provider*/ return this.provider == null ? new Base[0] : new Base[] {this.provider}; // Type - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Type - case -2001137643: /*nullify*/ return this.nullify == null ? new Base[0] : new Base[] {this.nullify}; // BooleanType - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // StringType - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemsComponent - case 1942574248: /*include*/ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // StringType - case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // StringType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422950858: // action - this.action = new ActionListEnumFactory().fromType(value); // Enumeration - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case -880905839: // target - this.target = (Type) value; // Type - break; - case -987494927: // provider - this.provider = (Type) value; // Type - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case -340323263: // response - this.response = (Type) value; // Type - break; - case -2001137643: // nullify - this.nullify = castToBoolean(value); // BooleanType - break; - case -925155509: // reference - this.reference = castToString(value); // StringType - break; - case 3242771: // item - this.getItem().add((ItemsComponent) value); // ItemsComponent - break; - case 1942574248: // include - this.getInclude().add(castToString(value)); // StringType - break; - case -1321148966: // exclude - this.getExclude().add(castToString(value)); // StringType - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("action")) - this.action = new ActionListEnumFactory().fromType(value); // Enumeration - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("target[x]")) - this.target = (Type) value; // Type - else if (name.equals("provider[x]")) - this.provider = (Type) value; // Type - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("response[x]")) - this.response = (Type) value; // Type - else if (name.equals("nullify")) - this.nullify = castToBoolean(value); // BooleanType - else if (name.equals("reference")) - this.reference = castToString(value); // StringType - else if (name.equals("item")) - this.getItem().add((ItemsComponent) value); - else if (name.equals("include")) - this.getInclude().add(castToString(value)); - else if (name.equals("exclude")) - this.getExclude().add(castToString(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422950858: throw new FHIRException("Cannot make property action as it is not a complex type"); // Enumeration - case -1618432855: return addIdentifier(); // Identifier - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case -815579825: return getTarget(); // Type - case 2064698607: return getProvider(); // Type - case 1326483053: return getOrganization(); // Type - case 37106577: return getRequest(); // Type - case 1847549087: return getResponse(); // Type - case -2001137643: throw new FHIRException("Cannot make property nullify as it is not a complex type"); // BooleanType - case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // StringType - case 3242771: return addItem(); // ItemsComponent - case 1942574248: throw new FHIRException("Cannot make property include as it is not a complex type"); // StringType - case -1321148966: throw new FHIRException("Cannot make property exclude as it is not a complex type"); // StringType - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("action")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.action"); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.created"); - } - else if (name.equals("targetIdentifier")) { - this.target = new Identifier(); - return this.target; - } - else if (name.equals("targetReference")) { - this.target = new Reference(); - return this.target; - } - else if (name.equals("providerIdentifier")) { - this.provider = new Identifier(); - return this.provider; - } - else if (name.equals("providerReference")) { - this.provider = new Reference(); - return this.provider; - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("responseIdentifier")) { - this.response = new Identifier(); - return this.response; - } - else if (name.equals("responseReference")) { - this.response = new Reference(); - return this.response; - } - else if (name.equals("nullify")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.nullify"); - } - else if (name.equals("reference")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.reference"); - } - else if (name.equals("item")) { - return addItem(); - } - else if (name.equals("include")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.include"); - } - else if (name.equals("exclude")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessRequest.exclude"); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ProcessRequest"; - - } - - public ProcessRequest copy() { - ProcessRequest dst = new ProcessRequest(); - copyValues(dst); - dst.action = action == null ? null : action.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.target = target == null ? null : target.copy(); - dst.provider = provider == null ? null : provider.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.request = request == null ? null : request.copy(); - dst.response = response == null ? null : response.copy(); - dst.nullify = nullify == null ? null : nullify.copy(); - dst.reference = reference == null ? null : reference.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (ItemsComponent i : item) - dst.item.add(i.copy()); - }; - if (include != null) { - dst.include = new ArrayList(); - for (StringType i : include) - dst.include.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (StringType i : exclude) - dst.exclude.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected ProcessRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcessRequest)) - return false; - ProcessRequest o = (ProcessRequest) other; - return compareDeep(action, o.action, true) && compareDeep(identifier, o.identifier, true) && compareDeep(ruleset, o.ruleset, true) - && compareDeep(originalRuleset, o.originalRuleset, true) && compareDeep(created, o.created, true) - && compareDeep(target, o.target, true) && compareDeep(provider, o.provider, true) && compareDeep(organization, o.organization, true) - && compareDeep(request, o.request, true) && compareDeep(response, o.response, true) && compareDeep(nullify, o.nullify, true) - && compareDeep(reference, o.reference, true) && compareDeep(item, o.item, true) && compareDeep(include, o.include, true) - && compareDeep(exclude, o.exclude, true) && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcessRequest)) - return false; - ProcessRequest o = (ProcessRequest) other; - return compareValues(action, o.action, true) && compareValues(created, o.created, true) && compareValues(nullify, o.nullify, true) - && compareValues(reference, o.reference, true) && compareValues(include, o.include, true) && compareValues(exclude, o.exclude, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (target == null || target.isEmpty()) && (provider == null || provider.isEmpty()) - && (organization == null || organization.isEmpty()) && (request == null || request.isEmpty()) - && (response == null || response.isEmpty()) && (nullify == null || nullify.isEmpty()) && (reference == null || reference.isEmpty()) - && (item == null || item.isEmpty()) && (include == null || include.isEmpty()) && (exclude == null || exclude.isEmpty()) - && (period == null || period.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcessRequest; - } - - /** - * Search parameter: action - *

- * Description: The action requested by this resource
- * Type: token
- * Path: ProcessRequest.action
- *

- */ - @SearchParamDefinition(name="action", path="ProcessRequest.action", description="The action requested by this resource", type="token" ) - public static final String SP_ACTION = "action"; - /** - * Fluent Client search parameter constant for action - *

- * Description: The action requested by this resource
- * Type: token
- * Path: ProcessRequest.action
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACTION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACTION); - - /** - * Search parameter: providerreference - *

- * Description: The provider who regenerated this request
- * Type: reference
- * Path: ProcessRequest.providerReference
- *

- */ - @SearchParamDefinition(name="providerreference", path="ProcessRequest.provider.as(Reference)", description="The provider who regenerated this request", type="reference" ) - public static final String SP_PROVIDERREFERENCE = "providerreference"; - /** - * Fluent Client search parameter constant for providerreference - *

- * Description: The provider who regenerated this request
- * Type: reference
- * Path: ProcessRequest.providerReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcessRequest:providerreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessRequest:providerreference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The organization who generated this request
- * Type: token
- * Path: ProcessRequest.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="ProcessRequest.organization.as(Identifier)", description="The organization who generated this request", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The organization who generated this request
- * Type: token
- * Path: ProcessRequest.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: organizationreference - *

- * Description: The organization who generated this request
- * Type: reference
- * Path: ProcessRequest.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="ProcessRequest.organization.as(Reference)", description="The organization who generated this request", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The organization who generated this request
- * Type: reference
- * Path: ProcessRequest.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcessRequest:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessRequest:organizationreference").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the ProcessRequest
- * Type: token
- * Path: ProcessRequest.identifier
- *

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

- * Description: The business identifier of the ProcessRequest
- * Type: token
- * Path: ProcessRequest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: provideridentifier - *

- * Description: The provider who regenerated this request
- * Type: token
- * Path: ProcessRequest.providerIdentifier
- *

- */ - @SearchParamDefinition(name="provideridentifier", path="ProcessRequest.provider.as(Identifier)", description="The provider who regenerated this request", type="token" ) - public static final String SP_PROVIDERIDENTIFIER = "provideridentifier"; - /** - * Fluent Client search parameter constant for provideridentifier - *

- * Description: The provider who regenerated this request
- * Type: token
- * Path: ProcessRequest.providerIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PROVIDERIDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcessResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcessResponse.java deleted file mode 100644 index 402828130d1..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ProcessResponse.java +++ /dev/null @@ -1,1339 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * This resource provides processing status, errors and notes from the processing of a resource. - */ -@ResourceDef(name="ProcessResponse", profile="http://hl7.org/fhir/Profile/ProcessResponse") -public class ProcessResponse extends DomainResource { - - @Block() - public static class ProcessResponseNotesComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The note purpose: Print/Display. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." ) - protected Coding type; - - /** - * The note text. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Notes text", formalDefinition="The note text." ) - protected StringType text; - - private static final long serialVersionUID = 129959202L; - - /** - * Constructor - */ - public ProcessResponseNotesComponent() { - super(); - } - - /** - * @return {@link #type} (The note purpose: Print/Display.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponseNotesComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The note purpose: Print/Display.) - */ - public ProcessResponseNotesComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponseNotesComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The note text.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public ProcessResponseNotesComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The note text. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The note text. - */ - public ProcessResponseNotesComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "The note purpose: Print/Display.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("text", "string", "The note text.", 0, java.lang.Integer.MAX_VALUE, text)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("text")) - this.text = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.text"); - } - else - return super.addChild(name); - } - - public ProcessResponseNotesComponent copy() { - ProcessResponseNotesComponent dst = new ProcessResponseNotesComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.text = text == null ? null : text.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcessResponseNotesComponent)) - return false; - ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; - return compareDeep(type, o.type, true) && compareDeep(text, o.text, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcessResponseNotesComponent)) - return false; - ProcessResponseNotesComponent o = (ProcessResponseNotesComponent) other; - return compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (text == null || text.isEmpty()) - ; - } - - public String fhirType() { - return "ProcessResponse.notes"; - - } - - } - - /** - * The Response business identifier. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business Identifier", formalDefinition="The Response business identifier." ) - protected List identifier; - - /** - * Original request resource reference. - */ - @Child(name = "request", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Request reference", formalDefinition="Original request resource reference." ) - protected Type request; - - /** - * Transaction status: error, complete, held. - */ - @Child(name = "outcome", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Processing outcome", formalDefinition="Transaction status: error, complete, held." ) - protected Coding outcome; - - /** - * A description of the status of the adjudication or processing. - */ - @Child(name = "disposition", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Disposition Message", formalDefinition="A description of the status of the adjudication or processing." ) - protected StringType disposition; - - /** - * The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources. - */ - @Child(name = "ruleset", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Resource version", formalDefinition="The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources." ) - protected Coding ruleset; - - /** - * The style (standard) and version of the original material which was converted into this resource. - */ - @Child(name = "originalRuleset", type = {Coding.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Original version", formalDefinition="The style (standard) and version of the original material which was converted into this resource." ) - protected Coding originalRuleset; - - /** - * The date when the enclosed suite of services were performed or completed. - */ - @Child(name = "created", type = {DateTimeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Creation date", formalDefinition="The date when the enclosed suite of services were performed or completed." ) - protected DateTimeType created; - - /** - * The organization who produced this adjudicated response. - */ - @Child(name = "organization", type = {Identifier.class, Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Authoring Organization", formalDefinition="The organization who produced this adjudicated response." ) - protected Type organization; - - /** - * The practitioner who is responsible for the services rendered to the patient. - */ - @Child(name = "requestProvider", type = {Identifier.class, Practitioner.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible Practitioner", formalDefinition="The practitioner who is responsible for the services rendered to the patient." ) - protected Type requestProvider; - - /** - * The organization which is responsible for the services rendered to the patient. - */ - @Child(name = "requestOrganization", type = {Identifier.class, Organization.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Responsible organization", formalDefinition="The organization which is responsible for the services rendered to the patient." ) - protected Type requestOrganization; - - /** - * The form to be used for printing the content. - */ - @Child(name = "form", type = {Coding.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Printed Form Identifier", formalDefinition="The form to be used for printing the content." ) - protected Coding form; - - /** - * Suite of processing note or additional requirements is the processing has been held. - */ - @Child(name = "notes", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Notes", formalDefinition="Suite of processing note or additional requirements is the processing has been held." ) - protected List notes; - - /** - * Processing errors. - */ - @Child(name = "error", type = {Coding.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Error code", formalDefinition="Processing errors." ) - protected List error; - - private static final long serialVersionUID = -501204073L; - - /** - * Constructor - */ - public ProcessResponse() { - super(); - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (The Response business identifier.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ProcessResponse addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Type getRequest() { - return this.request; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Identifier getRequestIdentifier() throws FHIRException { - if (!(this.request instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Identifier) this.request; - } - - public boolean hasRequestIdentifier() { - return this.request instanceof Identifier; - } - - /** - * @return {@link #request} (Original request resource reference.) - */ - public Reference getRequestReference() throws FHIRException { - if (!(this.request instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.request.getClass().getName()+" was encountered"); - return (Reference) this.request; - } - - public boolean hasRequestReference() { - return this.request instanceof Reference; - } - - public boolean hasRequest() { - return this.request != null && !this.request.isEmpty(); - } - - /** - * @param value {@link #request} (Original request resource reference.) - */ - public ProcessResponse setRequest(Type value) { - this.request = value; - return this; - } - - /** - * @return {@link #outcome} (Transaction status: error, complete, held.) - */ - public Coding getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new Coding(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (Transaction status: error, complete, held.) - */ - public ProcessResponse setOutcome(Coding value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public StringType getDispositionElement() { - if (this.disposition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.disposition"); - else if (Configuration.doAutoCreate()) - this.disposition = new StringType(); // bb - return this.disposition; - } - - public boolean hasDispositionElement() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - public boolean hasDisposition() { - return this.disposition != null && !this.disposition.isEmpty(); - } - - /** - * @param value {@link #disposition} (A description of the status of the adjudication or processing.). This is the underlying object with id, value and extensions. The accessor "getDisposition" gives direct access to the value - */ - public ProcessResponse setDispositionElement(StringType value) { - this.disposition = value; - return this; - } - - /** - * @return A description of the status of the adjudication or processing. - */ - public String getDisposition() { - return this.disposition == null ? null : this.disposition.getValue(); - } - - /** - * @param value A description of the status of the adjudication or processing. - */ - public ProcessResponse setDisposition(String value) { - if (Utilities.noString(value)) - this.disposition = null; - else { - if (this.disposition == null) - this.disposition = new StringType(); - this.disposition.setValue(value); - } - return this; - } - - /** - * @return {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public Coding getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new Coding(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.) - */ - public ProcessResponse setRuleset(Coding value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public Coding getOriginalRuleset() { - if (this.originalRuleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.originalRuleset"); - else if (Configuration.doAutoCreate()) - this.originalRuleset = new Coding(); // cc - return this.originalRuleset; - } - - public boolean hasOriginalRuleset() { - return this.originalRuleset != null && !this.originalRuleset.isEmpty(); - } - - /** - * @param value {@link #originalRuleset} (The style (standard) and version of the original material which was converted into this resource.) - */ - public ProcessResponse setOriginalRuleset(Coding value) { - this.originalRuleset = value; - return this; - } - - /** - * @return {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date when the enclosed suite of services were performed or completed.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public ProcessResponse setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date when the enclosed suite of services were performed or completed. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date when the enclosed suite of services were performed or completed. - */ - public ProcessResponse setCreated(Date value) { - if (value == null) - this.created = null; - else { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - } - return this; - } - - /** - * @return {@link #organization} (The organization who produced this adjudicated response.) - */ - public Type getOrganization() { - return this.organization; - } - - /** - * @return {@link #organization} (The organization who produced this adjudicated response.) - */ - public Identifier getOrganizationIdentifier() throws FHIRException { - if (!(this.organization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Identifier) this.organization; - } - - public boolean hasOrganizationIdentifier() { - return this.organization instanceof Identifier; - } - - /** - * @return {@link #organization} (The organization who produced this adjudicated response.) - */ - public Reference getOrganizationReference() throws FHIRException { - if (!(this.organization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.organization.getClass().getName()+" was encountered"); - return (Reference) this.organization; - } - - public boolean hasOrganizationReference() { - return this.organization instanceof Reference; - } - - public boolean hasOrganization() { - return this.organization != null && !this.organization.isEmpty(); - } - - /** - * @param value {@link #organization} (The organization who produced this adjudicated response.) - */ - public ProcessResponse setOrganization(Type value) { - this.organization = value; - return this; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Type getRequestProvider() { - return this.requestProvider; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Identifier getRequestProviderIdentifier() throws FHIRException { - if (!(this.requestProvider instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Identifier) this.requestProvider; - } - - public boolean hasRequestProviderIdentifier() { - return this.requestProvider instanceof Identifier; - } - - /** - * @return {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public Reference getRequestProviderReference() throws FHIRException { - if (!(this.requestProvider instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestProvider.getClass().getName()+" was encountered"); - return (Reference) this.requestProvider; - } - - public boolean hasRequestProviderReference() { - return this.requestProvider instanceof Reference; - } - - public boolean hasRequestProvider() { - return this.requestProvider != null && !this.requestProvider.isEmpty(); - } - - /** - * @param value {@link #requestProvider} (The practitioner who is responsible for the services rendered to the patient.) - */ - public ProcessResponse setRequestProvider(Type value) { - this.requestProvider = value; - return this; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Type getRequestOrganization() { - return this.requestOrganization; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Identifier getRequestOrganizationIdentifier() throws FHIRException { - if (!(this.requestOrganization instanceof Identifier)) - throw new FHIRException("Type mismatch: the type Identifier was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Identifier) this.requestOrganization; - } - - public boolean hasRequestOrganizationIdentifier() { - return this.requestOrganization instanceof Identifier; - } - - /** - * @return {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public Reference getRequestOrganizationReference() throws FHIRException { - if (!(this.requestOrganization instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.requestOrganization.getClass().getName()+" was encountered"); - return (Reference) this.requestOrganization; - } - - public boolean hasRequestOrganizationReference() { - return this.requestOrganization instanceof Reference; - } - - public boolean hasRequestOrganization() { - return this.requestOrganization != null && !this.requestOrganization.isEmpty(); - } - - /** - * @param value {@link #requestOrganization} (The organization which is responsible for the services rendered to the patient.) - */ - public ProcessResponse setRequestOrganization(Type value) { - this.requestOrganization = value; - return this; - } - - /** - * @return {@link #form} (The form to be used for printing the content.) - */ - public Coding getForm() { - if (this.form == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProcessResponse.form"); - else if (Configuration.doAutoCreate()) - this.form = new Coding(); // cc - return this.form; - } - - public boolean hasForm() { - return this.form != null && !this.form.isEmpty(); - } - - /** - * @param value {@link #form} (The form to be used for printing the content.) - */ - public ProcessResponse setForm(Coding value) { - this.form = value; - return this; - } - - /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) - */ - public List getNotes() { - if (this.notes == null) - this.notes = new ArrayList(); - return this.notes; - } - - public boolean hasNotes() { - if (this.notes == null) - return false; - for (ProcessResponseNotesComponent item : this.notes) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #notes} (Suite of processing note or additional requirements is the processing has been held.) - */ - // syntactic sugar - public ProcessResponseNotesComponent addNotes() { //3 - ProcessResponseNotesComponent t = new ProcessResponseNotesComponent(); - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return t; - } - - // syntactic sugar - public ProcessResponse addNotes(ProcessResponseNotesComponent t) { //3 - if (t == null) - return this; - if (this.notes == null) - this.notes = new ArrayList(); - this.notes.add(t); - return this; - } - - /** - * @return {@link #error} (Processing errors.) - */ - public List getError() { - if (this.error == null) - this.error = new ArrayList(); - return this.error; - } - - public boolean hasError() { - if (this.error == null) - return false; - for (Coding item : this.error) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #error} (Processing errors.) - */ - // syntactic sugar - public Coding addError() { //3 - Coding t = new Coding(); - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return t; - } - - // syntactic sugar - public ProcessResponse addError(Coding t) { //3 - if (t == null) - return this; - if (this.error == null) - this.error = new ArrayList(); - this.error.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The Response business identifier.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("request[x]", "Identifier|Reference(Any)", "Original request resource reference.", 0, java.lang.Integer.MAX_VALUE, request)); - childrenList.add(new Property("outcome", "Coding", "Transaction status: error, complete, held.", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("disposition", "string", "A description of the status of the adjudication or processing.", 0, java.lang.Integer.MAX_VALUE, disposition)); - childrenList.add(new Property("ruleset", "Coding", "The version of the style of resource contents. This should be mapped to the allowable profiles for this and supporting resources.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("originalRuleset", "Coding", "The style (standard) and version of the original material which was converted into this resource.", 0, java.lang.Integer.MAX_VALUE, originalRuleset)); - childrenList.add(new Property("created", "dateTime", "The date when the enclosed suite of services were performed or completed.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("organization[x]", "Identifier|Reference(Organization)", "The organization who produced this adjudicated response.", 0, java.lang.Integer.MAX_VALUE, organization)); - childrenList.add(new Property("requestProvider[x]", "Identifier|Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestProvider)); - childrenList.add(new Property("requestOrganization[x]", "Identifier|Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, java.lang.Integer.MAX_VALUE, requestOrganization)); - childrenList.add(new Property("form", "Coding", "The form to be used for printing the content.", 0, java.lang.Integer.MAX_VALUE, form)); - childrenList.add(new Property("notes", "", "Suite of processing note or additional requirements is the processing has been held.", 0, java.lang.Integer.MAX_VALUE, notes)); - childrenList.add(new Property("error", "Coding", "Processing errors.", 0, java.lang.Integer.MAX_VALUE, error)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Type - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Coding - case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // Coding - case 1089373397: /*originalRuleset*/ return this.originalRuleset == null ? new Base[0] : new Base[] {this.originalRuleset}; // Coding - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : new Base[] {this.organization}; // Type - case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Type - case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Type - case 3148996: /*form*/ return this.form == null ? new Base[0] : new Base[] {this.form}; // Coding - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : this.notes.toArray(new Base[this.notes.size()]); // ProcessResponseNotesComponent - case 96784904: /*error*/ return this.error == null ? new Base[0] : this.error.toArray(new Base[this.error.size()]); // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1095692943: // request - this.request = (Type) value; // Type - break; - case -1106507950: // outcome - this.outcome = castToCoding(value); // Coding - break; - case 583380919: // disposition - this.disposition = castToString(value); // StringType - break; - case 1548678118: // ruleset - this.ruleset = castToCoding(value); // Coding - break; - case 1089373397: // originalRuleset - this.originalRuleset = castToCoding(value); // Coding - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 1178922291: // organization - this.organization = (Type) value; // Type - break; - case 1601527200: // requestProvider - this.requestProvider = (Type) value; // Type - break; - case 599053666: // requestOrganization - this.requestOrganization = (Type) value; // Type - break; - case 3148996: // form - this.form = castToCoding(value); // Coding - break; - case 105008833: // notes - this.getNotes().add((ProcessResponseNotesComponent) value); // ProcessResponseNotesComponent - break; - case 96784904: // error - this.getError().add(castToCoding(value)); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("request[x]")) - this.request = (Type) value; // Type - else if (name.equals("outcome")) - this.outcome = castToCoding(value); // Coding - else if (name.equals("disposition")) - this.disposition = castToString(value); // StringType - else if (name.equals("ruleset")) - this.ruleset = castToCoding(value); // Coding - else if (name.equals("originalRuleset")) - this.originalRuleset = castToCoding(value); // Coding - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("organization[x]")) - this.organization = (Type) value; // Type - else if (name.equals("requestProvider[x]")) - this.requestProvider = (Type) value; // Type - else if (name.equals("requestOrganization[x]")) - this.requestOrganization = (Type) value; // Type - else if (name.equals("form")) - this.form = castToCoding(value); // Coding - else if (name.equals("notes")) - this.getNotes().add((ProcessResponseNotesComponent) value); - else if (name.equals("error")) - this.getError().add(castToCoding(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 37106577: return getRequest(); // Type - case -1106507950: return getOutcome(); // Coding - case 583380919: throw new FHIRException("Cannot make property disposition as it is not a complex type"); // StringType - case 1548678118: return getRuleset(); // Coding - case 1089373397: return getOriginalRuleset(); // Coding - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1326483053: return getOrganization(); // Type - case -1694784800: return getRequestProvider(); // Type - case 818740190: return getRequestOrganization(); // Type - case 3148996: return getForm(); // Coding - case 105008833: return addNotes(); // ProcessResponseNotesComponent - case 96784904: return addError(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("requestIdentifier")) { - this.request = new Identifier(); - return this.request; - } - else if (name.equals("requestReference")) { - this.request = new Reference(); - return this.request; - } - else if (name.equals("outcome")) { - this.outcome = new Coding(); - return this.outcome; - } - else if (name.equals("disposition")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.disposition"); - } - else if (name.equals("ruleset")) { - this.ruleset = new Coding(); - return this.ruleset; - } - else if (name.equals("originalRuleset")) { - this.originalRuleset = new Coding(); - return this.originalRuleset; - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type ProcessResponse.created"); - } - else if (name.equals("organizationIdentifier")) { - this.organization = new Identifier(); - return this.organization; - } - else if (name.equals("organizationReference")) { - this.organization = new Reference(); - return this.organization; - } - else if (name.equals("requestProviderIdentifier")) { - this.requestProvider = new Identifier(); - return this.requestProvider; - } - else if (name.equals("requestProviderReference")) { - this.requestProvider = new Reference(); - return this.requestProvider; - } - else if (name.equals("requestOrganizationIdentifier")) { - this.requestOrganization = new Identifier(); - return this.requestOrganization; - } - else if (name.equals("requestOrganizationReference")) { - this.requestOrganization = new Reference(); - return this.requestOrganization; - } - else if (name.equals("form")) { - this.form = new Coding(); - return this.form; - } - else if (name.equals("notes")) { - return addNotes(); - } - else if (name.equals("error")) { - return addError(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ProcessResponse"; - - } - - public ProcessResponse copy() { - ProcessResponse dst = new ProcessResponse(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.request = request == null ? null : request.copy(); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.disposition = disposition == null ? null : disposition.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.originalRuleset = originalRuleset == null ? null : originalRuleset.copy(); - dst.created = created == null ? null : created.copy(); - dst.organization = organization == null ? null : organization.copy(); - dst.requestProvider = requestProvider == null ? null : requestProvider.copy(); - dst.requestOrganization = requestOrganization == null ? null : requestOrganization.copy(); - dst.form = form == null ? null : form.copy(); - if (notes != null) { - dst.notes = new ArrayList(); - for (ProcessResponseNotesComponent i : notes) - dst.notes.add(i.copy()); - }; - if (error != null) { - dst.error = new ArrayList(); - for (Coding i : error) - dst.error.add(i.copy()); - }; - return dst; - } - - protected ProcessResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProcessResponse)) - return false; - ProcessResponse o = (ProcessResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(request, o.request, true) && compareDeep(outcome, o.outcome, true) - && compareDeep(disposition, o.disposition, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(originalRuleset, o.originalRuleset, true) - && compareDeep(created, o.created, true) && compareDeep(organization, o.organization, true) && compareDeep(requestProvider, o.requestProvider, true) - && compareDeep(requestOrganization, o.requestOrganization, true) && compareDeep(form, o.form, true) - && compareDeep(notes, o.notes, true) && compareDeep(error, o.error, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProcessResponse)) - return false; - ProcessResponse o = (ProcessResponse) other; - return compareValues(disposition, o.disposition, true) && compareValues(created, o.created, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (request == null || request.isEmpty()) - && (outcome == null || outcome.isEmpty()) && (disposition == null || disposition.isEmpty()) - && (ruleset == null || ruleset.isEmpty()) && (originalRuleset == null || originalRuleset.isEmpty()) - && (created == null || created.isEmpty()) && (organization == null || organization.isEmpty()) - && (requestProvider == null || requestProvider.isEmpty()) && (requestOrganization == null || requestOrganization.isEmpty()) - && (form == null || form.isEmpty()) && (notes == null || notes.isEmpty()) && (error == null || error.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ProcessResponse; - } - - /** - * Search parameter: requestorganizationreference - *

- * Description: The Organization who is responsible the request transaction
- * Type: reference
- * Path: ProcessResponse.requestOrganizationReference
- *

- */ - @SearchParamDefinition(name="requestorganizationreference", path="ProcessResponse.requestOrganization.as(Reference)", description="The Organization who is responsible the request transaction", type="reference" ) - public static final String SP_REQUESTORGANIZATIONREFERENCE = "requestorganizationreference"; - /** - * Fluent Client search parameter constant for requestorganizationreference - *

- * Description: The Organization who is responsible the request transaction
- * Type: reference
- * Path: ProcessResponse.requestOrganizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcessResponse:requestorganizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:requestorganizationreference").toLocked(); - - /** - * Search parameter: requestorganizationidentifier - *

- * Description: The Organization who is responsible the request transaction
- * Type: token
- * Path: ProcessResponse.requestOrganizationIdentifier
- *

- */ - @SearchParamDefinition(name="requestorganizationidentifier", path="ProcessResponse.requestOrganization.as(Identifier)", description="The Organization who is responsible the request transaction", type="token" ) - public static final String SP_REQUESTORGANIZATIONIDENTIFIER = "requestorganizationidentifier"; - /** - * Fluent Client search parameter constant for requestorganizationidentifier - *

- * Description: The Organization who is responsible the request transaction
- * Type: token
- * Path: ProcessResponse.requestOrganizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTORGANIZATIONIDENTIFIER); - - /** - * Search parameter: requestprovideridentifier - *

- * Description: The Provider who is responsible the request transaction
- * Type: token
- * Path: ProcessResponse.requestProviderIdentifier
- *

- */ - @SearchParamDefinition(name="requestprovideridentifier", path="ProcessResponse.requestProvider.as(Identifier)", description="The Provider who is responsible the request transaction", type="token" ) - public static final String SP_REQUESTPROVIDERIDENTIFIER = "requestprovideridentifier"; - /** - * Fluent Client search parameter constant for requestprovideridentifier - *

- * Description: The Provider who is responsible the request transaction
- * Type: token
- * Path: ProcessResponse.requestProviderIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTPROVIDERIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTPROVIDERIDENTIFIER); - - /** - * Search parameter: requestidentifier - *

- * Description: The reference to the claim
- * Type: token
- * Path: ProcessResponse.requestIdentifier
- *

- */ - @SearchParamDefinition(name="requestidentifier", path="ProcessResponse.request.as(Identifier)", description="The reference to the claim", type="token" ) - public static final String SP_REQUESTIDENTIFIER = "requestidentifier"; - /** - * Fluent Client search parameter constant for requestidentifier - *

- * Description: The reference to the claim
- * Type: token
- * Path: ProcessResponse.requestIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam REQUESTIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_REQUESTIDENTIFIER); - - /** - * Search parameter: requestreference - *

- * Description: The reference to the claim
- * Type: reference
- * Path: ProcessResponse.requestReference
- *

- */ - @SearchParamDefinition(name="requestreference", path="ProcessResponse.request.as(Reference)", description="The reference to the claim", type="reference" ) - public static final String SP_REQUESTREFERENCE = "requestreference"; - /** - * Fluent Client search parameter constant for requestreference - *

- * Description: The reference to the claim
- * Type: reference
- * Path: ProcessResponse.requestReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcessResponse:requestreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:requestreference").toLocked(); - - /** - * Search parameter: organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: ProcessResponse.organizationIdentifier
- *

- */ - @SearchParamDefinition(name="organizationidentifier", path="ProcessResponse.organization.as(Identifier)", description="The organization who generated this resource", type="token" ) - public static final String SP_ORGANIZATIONIDENTIFIER = "organizationidentifier"; - /** - * Fluent Client search parameter constant for organizationidentifier - *

- * Description: The organization who generated this resource
- * Type: token
- * Path: ProcessResponse.organizationIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ORGANIZATIONIDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ORGANIZATIONIDENTIFIER); - - /** - * Search parameter: requestproviderreference - *

- * Description: The Provider who is responsible the request transaction
- * Type: reference
- * Path: ProcessResponse.requestProviderReference
- *

- */ - @SearchParamDefinition(name="requestproviderreference", path="ProcessResponse.requestProvider.as(Reference)", description="The Provider who is responsible the request transaction", type="reference" ) - public static final String SP_REQUESTPROVIDERREFERENCE = "requestproviderreference"; - /** - * Fluent Client search parameter constant for requestproviderreference - *

- * Description: The Provider who is responsible the request transaction
- * Type: reference
- * Path: ProcessResponse.requestProviderReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTPROVIDERREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcessResponse:requestproviderreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTPROVIDERREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:requestproviderreference").toLocked(); - - /** - * Search parameter: organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: ProcessResponse.organizationReference
- *

- */ - @SearchParamDefinition(name="organizationreference", path="ProcessResponse.organization.as(Reference)", description="The organization who generated this resource", type="reference" ) - public static final String SP_ORGANIZATIONREFERENCE = "organizationreference"; - /** - * Fluent Client search parameter constant for organizationreference - *

- * Description: The organization who generated this resource
- * Type: reference
- * Path: ProcessResponse.organizationReference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ORGANIZATIONREFERENCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ORGANIZATIONREFERENCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ProcessResponse:organizationreference". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ORGANIZATIONREFERENCE = new ca.uhn.fhir.model.api.Include("ProcessResponse:organizationreference").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: ProcessResponse.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ProcessResponse.identifier", description="The business identifier of the Explanation of Benefit", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The business identifier of the Explanation of Benefit
- * Type: token
- * Path: ProcessResponse.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Property.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Property.java deleted file mode 100644 index f1c7d597de5..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Property.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.util.ArrayList; -import java.util.List; - -/** - * A child element or property defined by the FHIR specification - * This class is defined as a helper class when iterating the - * children of an element in a generic fashion - * - * At present, iteration is only based on the specification, but - * this may be changed to allow profile based expression at a - * later date - * - * note: there's no point in creating one of these classes outside this package - */ -public class Property { - - /** - * The name of the property as found in the FHIR specification - */ - private String name; - - /** - * The type of the property as specified in the FHIR specification (e.g. type|type|Reference(Name|Name) - */ - private String typeCode; - - /** - * The formal definition of the element given in the FHIR specification - */ - private String definition; - - /** - * The minimum allowed cardinality - 0 or 1 when based on the specification - */ - private int minCardinality; - - /** - * The maximum allowed cardinality - 1 or MAX_INT when based on the specification - */ - private int maxCardinality; - - /** - * The actual elements that exist on this instance - */ - private List values = new ArrayList(); - - /** - * For run time, if/once a property is hooked up to it's definition - */ - private StructureDefinition structure; - - /** - * Internal constructor - */ - public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, Base value) { - super(); - this.name = name; - this.typeCode = typeCode; - this.definition = definition; - this.minCardinality = minCardinality; - this.maxCardinality = maxCardinality; - this.values.add(value); - } - - /** - * Internal constructor - */ - public Property(String name, String typeCode, String definition, int minCardinality, int maxCardinality, List values) { - super(); - this.name = name; - this.typeCode = typeCode; - this.definition = definition; - this.minCardinality = minCardinality; - this.maxCardinality = maxCardinality; - if (values != null) - this.values.addAll(values); - } - - /** - * @return The name of this property in the FHIR Specification - */ - public String getName() { - return name; - } - - /** - * @return The stated type in the FHIR specification - */ - public String getTypeCode() { - return typeCode; - } - - /** - * @return The definition of this element in the FHIR spec - */ - public String getDefinition() { - return definition; - } - - /** - * @return the minimum cardinality for this element - */ - public int getMinCardinality() { - return minCardinality; - } - - /** - * @return the maximum cardinality for this element - */ - public int getMaxCardinality() { - return maxCardinality; - } - - /** - * @return the actual values - will only be 1 unless maximum cardinality == MAX_INT - */ - public List getValues() { - return values; - } - - public boolean hasValues() { - for (Base e : getValues()) - if (e != null) - return true; - return false; - } - - public StructureDefinition getStructure() { - return structure; - } - - public void setStructure(StructureDefinition structure) { - this.structure = structure; - } - - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Protocol.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Protocol.java deleted file mode 100644 index f029670471c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Protocol.java +++ /dev/null @@ -1,3927 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A definition of behaviors to be taken in particular circumstances, often including conditions, options and other decision points. - */ -@ResourceDef(name="Protocol", profile="http://hl7.org/fhir/Profile/Protocol") -public class Protocol extends DomainResource { - - public enum ProtocolStatus { - /** - * This protocol is still under development - */ - DRAFT, - /** - * This protocol was authored for testing purposes (or education/evaluation/marketing) - */ - TESTING, - /** - * This protocol is undergoing review to check that it is ready for production use - */ - REVIEW, - /** - * This protocol is ready for use in production systems - */ - ACTIVE, - /** - * This protocol has been withdrawn and should no longer be used - */ - WITHDRAWN, - /** - * This protocol has been replaced and a different protocol should be used in its place - */ - SUPERSEDED, - /** - * added to help the parsers - */ - NULL; - public static ProtocolStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("testing".equals(codeString)) - return TESTING; - if ("review".equals(codeString)) - return REVIEW; - if ("active".equals(codeString)) - return ACTIVE; - if ("withdrawn".equals(codeString)) - return WITHDRAWN; - if ("superseded".equals(codeString)) - return SUPERSEDED; - throw new FHIRException("Unknown ProtocolStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case TESTING: return "testing"; - case REVIEW: return "review"; - case ACTIVE: return "active"; - case WITHDRAWN: return "withdrawn"; - case SUPERSEDED: return "superseded"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return "http://hl7.org/fhir/protocol-status"; - case TESTING: return "http://hl7.org/fhir/protocol-status"; - case REVIEW: return "http://hl7.org/fhir/protocol-status"; - case ACTIVE: return "http://hl7.org/fhir/protocol-status"; - case WITHDRAWN: return "http://hl7.org/fhir/protocol-status"; - case SUPERSEDED: return "http://hl7.org/fhir/protocol-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This protocol is still under development"; - case TESTING: return "This protocol was authored for testing purposes (or education/evaluation/marketing)"; - case REVIEW: return "This protocol is undergoing review to check that it is ready for production use"; - case ACTIVE: return "This protocol is ready for use in production systems"; - case WITHDRAWN: return "This protocol has been withdrawn and should no longer be used"; - case SUPERSEDED: return "This protocol has been replaced and a different protocol should be used in its place"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case TESTING: return "Testing"; - case REVIEW: return "Review"; - case ACTIVE: return "Active"; - case WITHDRAWN: return "Withdrawn"; - case SUPERSEDED: return "Superseded"; - default: return "?"; - } - } - } - - public static class ProtocolStatusEnumFactory implements EnumFactory { - public ProtocolStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ProtocolStatus.DRAFT; - if ("testing".equals(codeString)) - return ProtocolStatus.TESTING; - if ("review".equals(codeString)) - return ProtocolStatus.REVIEW; - if ("active".equals(codeString)) - return ProtocolStatus.ACTIVE; - if ("withdrawn".equals(codeString)) - return ProtocolStatus.WITHDRAWN; - if ("superseded".equals(codeString)) - return ProtocolStatus.SUPERSEDED; - throw new IllegalArgumentException("Unknown ProtocolStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return new Enumeration(this, ProtocolStatus.DRAFT); - if ("testing".equals(codeString)) - return new Enumeration(this, ProtocolStatus.TESTING); - if ("review".equals(codeString)) - return new Enumeration(this, ProtocolStatus.REVIEW); - if ("active".equals(codeString)) - return new Enumeration(this, ProtocolStatus.ACTIVE); - if ("withdrawn".equals(codeString)) - return new Enumeration(this, ProtocolStatus.WITHDRAWN); - if ("superseded".equals(codeString)) - return new Enumeration(this, ProtocolStatus.SUPERSEDED); - throw new FHIRException("Unknown ProtocolStatus code '"+codeString+"'"); - } - public String toCode(ProtocolStatus code) { - if (code == ProtocolStatus.DRAFT) - return "draft"; - if (code == ProtocolStatus.TESTING) - return "testing"; - if (code == ProtocolStatus.REVIEW) - return "review"; - if (code == ProtocolStatus.ACTIVE) - return "active"; - if (code == ProtocolStatus.WITHDRAWN) - return "withdrawn"; - if (code == ProtocolStatus.SUPERSEDED) - return "superseded"; - return "?"; - } - public String toSystem(ProtocolStatus code) { - return code.getSystem(); - } - } - - public enum ProtocolType { - /** - * The protocol describes the steps to manage a particular health condition including monitoring, treatment, mitigation and/or follow-up - */ - CONDITION, - /** - * The protocol describes the appropriate use of a particular device (medical device, software, etc.) - */ - DEVICE, - /** - * The protocol describes the appropriate use of a particular medication including indications for use, dosages, treatment cycles, etc. - */ - DRUG, - /** - * The protocol describes the set of steps to occur for study subjects enrolled in an interventional study - */ - STUDY, - /** - * added to help the parsers - */ - NULL; - public static ProtocolType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("condition".equals(codeString)) - return CONDITION; - if ("device".equals(codeString)) - return DEVICE; - if ("drug".equals(codeString)) - return DRUG; - if ("study".equals(codeString)) - return STUDY; - throw new FHIRException("Unknown ProtocolType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CONDITION: return "condition"; - case DEVICE: return "device"; - case DRUG: return "drug"; - case STUDY: return "study"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CONDITION: return "http://hl7.org/fhir/protocol-type"; - case DEVICE: return "http://hl7.org/fhir/protocol-type"; - case DRUG: return "http://hl7.org/fhir/protocol-type"; - case STUDY: return "http://hl7.org/fhir/protocol-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CONDITION: return "The protocol describes the steps to manage a particular health condition including monitoring, treatment, mitigation and/or follow-up"; - case DEVICE: return "The protocol describes the appropriate use of a particular device (medical device, software, etc.)"; - case DRUG: return "The protocol describes the appropriate use of a particular medication including indications for use, dosages, treatment cycles, etc."; - case STUDY: return "The protocol describes the set of steps to occur for study subjects enrolled in an interventional study"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CONDITION: return "Condition"; - case DEVICE: return "Device"; - case DRUG: return "Drug"; - case STUDY: return "Study"; - default: return "?"; - } - } - } - - public static class ProtocolTypeEnumFactory implements EnumFactory { - public ProtocolType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("condition".equals(codeString)) - return ProtocolType.CONDITION; - if ("device".equals(codeString)) - return ProtocolType.DEVICE; - if ("drug".equals(codeString)) - return ProtocolType.DRUG; - if ("study".equals(codeString)) - return ProtocolType.STUDY; - throw new IllegalArgumentException("Unknown ProtocolType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("condition".equals(codeString)) - return new Enumeration(this, ProtocolType.CONDITION); - if ("device".equals(codeString)) - return new Enumeration(this, ProtocolType.DEVICE); - if ("drug".equals(codeString)) - return new Enumeration(this, ProtocolType.DRUG); - if ("study".equals(codeString)) - return new Enumeration(this, ProtocolType.STUDY); - throw new FHIRException("Unknown ProtocolType code '"+codeString+"'"); - } - public String toCode(ProtocolType code) { - if (code == ProtocolType.CONDITION) - return "condition"; - if (code == ProtocolType.DEVICE) - return "device"; - if (code == ProtocolType.DRUG) - return "drug"; - if (code == ProtocolType.STUDY) - return "study"; - return "?"; - } - public String toSystem(ProtocolType code) { - return code.getSystem(); - } - } - - public enum ActivityDefinitionCategory { - /** - * To consume food of a specified nature - */ - DIET, - /** - * To consume/receive a drug, vaccine or other product - */ - DRUG, - /** - * To meet or communicate with the patient (in-patient, out-patient, phone call, etc.) - */ - ENCOUNTER, - /** - * To capture information about a patient (vitals, labs, diagnostic images, etc.) - */ - OBSERVATION, - /** - * To modify the patient in some way (surgery, physiotherapy, education, counseling, etc.) - */ - PROCEDURE, - /** - * To provide something to the patient (medication, medical supply, etc.) - */ - SUPPLY, - /** - * Some other form of action - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static ActivityDefinitionCategory fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return DIET; - if ("drug".equals(codeString)) - return DRUG; - if ("encounter".equals(codeString)) - return ENCOUNTER; - if ("observation".equals(codeString)) - return OBSERVATION; - if ("procedure".equals(codeString)) - return PROCEDURE; - if ("supply".equals(codeString)) - return SUPPLY; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown ActivityDefinitionCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DIET: return "diet"; - case DRUG: return "drug"; - case ENCOUNTER: return "encounter"; - case OBSERVATION: return "observation"; - case PROCEDURE: return "procedure"; - case SUPPLY: return "supply"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DIET: return "http://hl7.org/fhir/activity-definition-category"; - case DRUG: return "http://hl7.org/fhir/activity-definition-category"; - case ENCOUNTER: return "http://hl7.org/fhir/activity-definition-category"; - case OBSERVATION: return "http://hl7.org/fhir/activity-definition-category"; - case PROCEDURE: return "http://hl7.org/fhir/activity-definition-category"; - case SUPPLY: return "http://hl7.org/fhir/activity-definition-category"; - case OTHER: return "http://hl7.org/fhir/activity-definition-category"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DIET: return "To consume food of a specified nature"; - case DRUG: return "To consume/receive a drug, vaccine or other product"; - case ENCOUNTER: return "To meet or communicate with the patient (in-patient, out-patient, phone call, etc.)"; - case OBSERVATION: return "To capture information about a patient (vitals, labs, diagnostic images, etc.)"; - case PROCEDURE: return "To modify the patient in some way (surgery, physiotherapy, education, counseling, etc.)"; - case SUPPLY: return "To provide something to the patient (medication, medical supply, etc.)"; - case OTHER: return "Some other form of action"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DIET: return "Diet"; - case DRUG: return "Drug"; - case ENCOUNTER: return "Encounter"; - case OBSERVATION: return "Observation"; - case PROCEDURE: return "Procedure"; - case SUPPLY: return "Supply"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class ActivityDefinitionCategoryEnumFactory implements EnumFactory { - public ActivityDefinitionCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return ActivityDefinitionCategory.DIET; - if ("drug".equals(codeString)) - return ActivityDefinitionCategory.DRUG; - if ("encounter".equals(codeString)) - return ActivityDefinitionCategory.ENCOUNTER; - if ("observation".equals(codeString)) - return ActivityDefinitionCategory.OBSERVATION; - if ("procedure".equals(codeString)) - return ActivityDefinitionCategory.PROCEDURE; - if ("supply".equals(codeString)) - return ActivityDefinitionCategory.SUPPLY; - if ("other".equals(codeString)) - return ActivityDefinitionCategory.OTHER; - throw new IllegalArgumentException("Unknown ActivityDefinitionCategory code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("diet".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.DIET); - if ("drug".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.DRUG); - if ("encounter".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.ENCOUNTER); - if ("observation".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.OBSERVATION); - if ("procedure".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.PROCEDURE); - if ("supply".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.SUPPLY); - if ("other".equals(codeString)) - return new Enumeration(this, ActivityDefinitionCategory.OTHER); - throw new FHIRException("Unknown ActivityDefinitionCategory code '"+codeString+"'"); - } - public String toCode(ActivityDefinitionCategory code) { - if (code == ActivityDefinitionCategory.DIET) - return "diet"; - if (code == ActivityDefinitionCategory.DRUG) - return "drug"; - if (code == ActivityDefinitionCategory.ENCOUNTER) - return "encounter"; - if (code == ActivityDefinitionCategory.OBSERVATION) - return "observation"; - if (code == ActivityDefinitionCategory.PROCEDURE) - return "procedure"; - if (code == ActivityDefinitionCategory.SUPPLY) - return "supply"; - if (code == ActivityDefinitionCategory.OTHER) - return "other"; - return "?"; - } - public String toSystem(ActivityDefinitionCategory code) { - return code.getSystem(); - } - } - - @Block() - public static class ProtocolStepComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Label for step. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Label for step", formalDefinition="Label for step." ) - protected StringType name; - - /** - * Human description of activity. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human description of activity", formalDefinition="Human description of activity." ) - protected StringType description; - - /** - * How long does step last? - */ - @Child(name = "duration", type = {Duration.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How long does step last?", formalDefinition="How long does step last?" ) - protected Duration duration; - - /** - * Rules prior to execution. - */ - @Child(name = "precondition", type = {}, order=4, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Rules prior to execution", formalDefinition="Rules prior to execution." ) - protected ProtocolStepPreconditionComponent precondition; - - /** - * Indicates the conditions that must be met for activities that are part of this time point to terminate. - */ - @Child(name = "exit", type = {ProtocolStepPreconditionComponent.class}, order=5, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Rules prior to completion", formalDefinition="Indicates the conditions that must be met for activities that are part of this time point to terminate." ) - protected ProtocolStepPreconditionComponent exit; - - /** - * First activity within timepoint. - */ - @Child(name = "firstActivity", type = {UriType.class}, order=6, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="First activity within timepoint", formalDefinition="First activity within timepoint." ) - protected UriType firstActivity; - - /** - * Activities that occur within timepoint. - */ - @Child(name = "activity", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) - @Description(shortDefinition="Activities that occur within timepoint", formalDefinition="Activities that occur within timepoint." ) - protected List activity; - - /** - * What happens next? - */ - @Child(name = "next", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="What happens next?", formalDefinition="What happens next?" ) - protected List next; - - private static final long serialVersionUID = 626452062L; - - /** - * Constructor - */ - public ProtocolStepComponent() { - super(); - } - - /** - * @return {@link #name} (Label for step.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Label for step.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ProtocolStepComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Label for step. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Label for step. - */ - public ProtocolStepComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (Human description of activity.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human description of activity.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ProtocolStepComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human description of activity. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human description of activity. - */ - public ProtocolStepComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #duration} (How long does step last?) - */ - public Duration getDuration() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new Duration(); // cc - return this.duration; - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (How long does step last?) - */ - public ProtocolStepComponent setDuration(Duration value) { - this.duration = value; - return this; - } - - /** - * @return {@link #precondition} (Rules prior to execution.) - */ - public ProtocolStepPreconditionComponent getPrecondition() { - if (this.precondition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepComponent.precondition"); - else if (Configuration.doAutoCreate()) - this.precondition = new ProtocolStepPreconditionComponent(); // cc - return this.precondition; - } - - public boolean hasPrecondition() { - return this.precondition != null && !this.precondition.isEmpty(); - } - - /** - * @param value {@link #precondition} (Rules prior to execution.) - */ - public ProtocolStepComponent setPrecondition(ProtocolStepPreconditionComponent value) { - this.precondition = value; - return this; - } - - /** - * @return {@link #exit} (Indicates the conditions that must be met for activities that are part of this time point to terminate.) - */ - public ProtocolStepPreconditionComponent getExit() { - if (this.exit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepComponent.exit"); - else if (Configuration.doAutoCreate()) - this.exit = new ProtocolStepPreconditionComponent(); // cc - return this.exit; - } - - public boolean hasExit() { - return this.exit != null && !this.exit.isEmpty(); - } - - /** - * @param value {@link #exit} (Indicates the conditions that must be met for activities that are part of this time point to terminate.) - */ - public ProtocolStepComponent setExit(ProtocolStepPreconditionComponent value) { - this.exit = value; - return this; - } - - /** - * @return {@link #firstActivity} (First activity within timepoint.). This is the underlying object with id, value and extensions. The accessor "getFirstActivity" gives direct access to the value - */ - public UriType getFirstActivityElement() { - if (this.firstActivity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepComponent.firstActivity"); - else if (Configuration.doAutoCreate()) - this.firstActivity = new UriType(); // bb - return this.firstActivity; - } - - public boolean hasFirstActivityElement() { - return this.firstActivity != null && !this.firstActivity.isEmpty(); - } - - public boolean hasFirstActivity() { - return this.firstActivity != null && !this.firstActivity.isEmpty(); - } - - /** - * @param value {@link #firstActivity} (First activity within timepoint.). This is the underlying object with id, value and extensions. The accessor "getFirstActivity" gives direct access to the value - */ - public ProtocolStepComponent setFirstActivityElement(UriType value) { - this.firstActivity = value; - return this; - } - - /** - * @return First activity within timepoint. - */ - public String getFirstActivity() { - return this.firstActivity == null ? null : this.firstActivity.getValue(); - } - - /** - * @param value First activity within timepoint. - */ - public ProtocolStepComponent setFirstActivity(String value) { - if (Utilities.noString(value)) - this.firstActivity = null; - else { - if (this.firstActivity == null) - this.firstActivity = new UriType(); - this.firstActivity.setValue(value); - } - return this; - } - - /** - * @return {@link #activity} (Activities that occur within timepoint.) - */ - public List getActivity() { - if (this.activity == null) - this.activity = new ArrayList(); - return this.activity; - } - - public boolean hasActivity() { - if (this.activity == null) - return false; - for (ProtocolStepActivityComponent item : this.activity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #activity} (Activities that occur within timepoint.) - */ - // syntactic sugar - public ProtocolStepActivityComponent addActivity() { //3 - ProtocolStepActivityComponent t = new ProtocolStepActivityComponent(); - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepComponent addActivity(ProtocolStepActivityComponent t) { //3 - if (t == null) - return this; - if (this.activity == null) - this.activity = new ArrayList(); - this.activity.add(t); - return this; - } - - /** - * @return {@link #next} (What happens next?) - */ - public List getNext() { - if (this.next == null) - this.next = new ArrayList(); - return this.next; - } - - public boolean hasNext() { - if (this.next == null) - return false; - for (ProtocolStepNextComponent item : this.next) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #next} (What happens next?) - */ - // syntactic sugar - public ProtocolStepNextComponent addNext() { //3 - ProtocolStepNextComponent t = new ProtocolStepNextComponent(); - if (this.next == null) - this.next = new ArrayList(); - this.next.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepComponent addNext(ProtocolStepNextComponent t) { //3 - if (t == null) - return this; - if (this.next == null) - this.next = new ArrayList(); - this.next.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Label for step.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "Human description of activity.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("duration", "Duration", "How long does step last?", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("precondition", "", "Rules prior to execution.", 0, java.lang.Integer.MAX_VALUE, precondition)); - childrenList.add(new Property("exit", "@Protocol.step.precondition", "Indicates the conditions that must be met for activities that are part of this time point to terminate.", 0, java.lang.Integer.MAX_VALUE, exit)); - childrenList.add(new Property("firstActivity", "uri", "First activity within timepoint.", 0, java.lang.Integer.MAX_VALUE, firstActivity)); - childrenList.add(new Property("activity", "", "Activities that occur within timepoint.", 0, java.lang.Integer.MAX_VALUE, activity)); - childrenList.add(new Property("next", "", "What happens next?", 0, java.lang.Integer.MAX_VALUE, next)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // Duration - case -650968616: /*precondition*/ return this.precondition == null ? new Base[0] : new Base[] {this.precondition}; // ProtocolStepPreconditionComponent - case 3127582: /*exit*/ return this.exit == null ? new Base[0] : new Base[] {this.exit}; // ProtocolStepPreconditionComponent - case 185563615: /*firstActivity*/ return this.firstActivity == null ? new Base[0] : new Base[] {this.firstActivity}; // UriType - case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : this.activity.toArray(new Base[this.activity.size()]); // ProtocolStepActivityComponent - case 3377907: /*next*/ return this.next == null ? new Base[0] : this.next.toArray(new Base[this.next.size()]); // ProtocolStepNextComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1992012396: // duration - this.duration = castToDuration(value); // Duration - break; - case -650968616: // precondition - this.precondition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent - break; - case 3127582: // exit - this.exit = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent - break; - case 185563615: // firstActivity - this.firstActivity = castToUri(value); // UriType - break; - case -1655966961: // activity - this.getActivity().add((ProtocolStepActivityComponent) value); // ProtocolStepActivityComponent - break; - case 3377907: // next - this.getNext().add((ProtocolStepNextComponent) value); // ProtocolStepNextComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("duration")) - this.duration = castToDuration(value); // Duration - else if (name.equals("precondition")) - this.precondition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent - else if (name.equals("exit")) - this.exit = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent - else if (name.equals("firstActivity")) - this.firstActivity = castToUri(value); // UriType - else if (name.equals("activity")) - this.getActivity().add((ProtocolStepActivityComponent) value); - else if (name.equals("next")) - this.getNext().add((ProtocolStepNextComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1992012396: return getDuration(); // Duration - case -650968616: return getPrecondition(); // ProtocolStepPreconditionComponent - case 3127582: return getExit(); // ProtocolStepPreconditionComponent - case 185563615: throw new FHIRException("Cannot make property firstActivity as it is not a complex type"); // UriType - case -1655966961: return addActivity(); // ProtocolStepActivityComponent - case 3377907: return addNext(); // ProtocolStepNextComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); - } - else if (name.equals("duration")) { - this.duration = new Duration(); - return this.duration; - } - else if (name.equals("precondition")) { - this.precondition = new ProtocolStepPreconditionComponent(); - return this.precondition; - } - else if (name.equals("exit")) { - this.exit = new ProtocolStepPreconditionComponent(); - return this.exit; - } - else if (name.equals("firstActivity")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.firstActivity"); - } - else if (name.equals("activity")) { - return addActivity(); - } - else if (name.equals("next")) { - return addNext(); - } - else - return super.addChild(name); - } - - public ProtocolStepComponent copy() { - ProtocolStepComponent dst = new ProtocolStepComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.precondition = precondition == null ? null : precondition.copy(); - dst.exit = exit == null ? null : exit.copy(); - dst.firstActivity = firstActivity == null ? null : firstActivity.copy(); - if (activity != null) { - dst.activity = new ArrayList(); - for (ProtocolStepActivityComponent i : activity) - dst.activity.add(i.copy()); - }; - if (next != null) { - dst.next = new ArrayList(); - for (ProtocolStepNextComponent i : next) - dst.next.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepComponent)) - return false; - ProtocolStepComponent o = (ProtocolStepComponent) other; - return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(duration, o.duration, true) - && compareDeep(precondition, o.precondition, true) && compareDeep(exit, o.exit, true) && compareDeep(firstActivity, o.firstActivity, true) - && compareDeep(activity, o.activity, true) && compareDeep(next, o.next, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepComponent)) - return false; - ProtocolStepComponent o = (ProtocolStepComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true) && compareValues(firstActivity, o.firstActivity, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) - && (duration == null || duration.isEmpty()) && (precondition == null || precondition.isEmpty()) - && (exit == null || exit.isEmpty()) && (firstActivity == null || firstActivity.isEmpty()) - && (activity == null || activity.isEmpty()) && (next == null || next.isEmpty()); - } - - public String fhirType() { - return "Protocol.step"; - - } - - } - - @Block() - public static class ProtocolStepPreconditionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Human-readable description of the condition. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of condition", formalDefinition="Human-readable description of the condition." ) - protected StringType description; - - /** - * Defines the name/value pair that must hold for the condition to be met. - */ - @Child(name = "condition", type = {}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Condition evaluated", formalDefinition="Defines the name/value pair that must hold for the condition to be met." ) - protected ProtocolStepPreconditionConditionComponent condition; - - /** - * Lists a set of conditions that must all be met. - */ - @Child(name = "intersection", type = {ProtocolStepPreconditionComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="And conditions", formalDefinition="Lists a set of conditions that must all be met." ) - protected List intersection; - - /** - * Lists alternative conditions, at least one of must be met. - */ - @Child(name = "union", type = {ProtocolStepPreconditionComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Or conditions", formalDefinition="Lists alternative conditions, at least one of must be met." ) - protected List union; - - /** - * Lists conditions of which none must be met. - */ - @Child(name = "exclude", type = {ProtocolStepPreconditionComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Not conditions", formalDefinition="Lists conditions of which none must be met." ) - protected List exclude; - - private static final long serialVersionUID = -1469954145L; - - /** - * Constructor - */ - public ProtocolStepPreconditionComponent() { - super(); - } - - /** - * @return {@link #description} (Human-readable description of the condition.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepPreconditionComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Human-readable description of the condition.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ProtocolStepPreconditionComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Human-readable description of the condition. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Human-readable description of the condition. - */ - public ProtocolStepPreconditionComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (Defines the name/value pair that must hold for the condition to be met.) - */ - public ProtocolStepPreconditionConditionComponent getCondition() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepPreconditionComponent.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new ProtocolStepPreconditionConditionComponent(); // cc - return this.condition; - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (Defines the name/value pair that must hold for the condition to be met.) - */ - public ProtocolStepPreconditionComponent setCondition(ProtocolStepPreconditionConditionComponent value) { - this.condition = value; - return this; - } - - /** - * @return {@link #intersection} (Lists a set of conditions that must all be met.) - */ - public List getIntersection() { - if (this.intersection == null) - this.intersection = new ArrayList(); - return this.intersection; - } - - public boolean hasIntersection() { - if (this.intersection == null) - return false; - for (ProtocolStepPreconditionComponent item : this.intersection) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #intersection} (Lists a set of conditions that must all be met.) - */ - // syntactic sugar - public ProtocolStepPreconditionComponent addIntersection() { //3 - ProtocolStepPreconditionComponent t = new ProtocolStepPreconditionComponent(); - if (this.intersection == null) - this.intersection = new ArrayList(); - this.intersection.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepPreconditionComponent addIntersection(ProtocolStepPreconditionComponent t) { //3 - if (t == null) - return this; - if (this.intersection == null) - this.intersection = new ArrayList(); - this.intersection.add(t); - return this; - } - - /** - * @return {@link #union} (Lists alternative conditions, at least one of must be met.) - */ - public List getUnion() { - if (this.union == null) - this.union = new ArrayList(); - return this.union; - } - - public boolean hasUnion() { - if (this.union == null) - return false; - for (ProtocolStepPreconditionComponent item : this.union) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #union} (Lists alternative conditions, at least one of must be met.) - */ - // syntactic sugar - public ProtocolStepPreconditionComponent addUnion() { //3 - ProtocolStepPreconditionComponent t = new ProtocolStepPreconditionComponent(); - if (this.union == null) - this.union = new ArrayList(); - this.union.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepPreconditionComponent addUnion(ProtocolStepPreconditionComponent t) { //3 - if (t == null) - return this; - if (this.union == null) - this.union = new ArrayList(); - this.union.add(t); - return this; - } - - /** - * @return {@link #exclude} (Lists conditions of which none must be met.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (ProtocolStepPreconditionComponent item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Lists conditions of which none must be met.) - */ - // syntactic sugar - public ProtocolStepPreconditionComponent addExclude() { //3 - ProtocolStepPreconditionComponent t = new ProtocolStepPreconditionComponent(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepPreconditionComponent addExclude(ProtocolStepPreconditionComponent t) { //3 - if (t == null) - return this; - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Human-readable description of the condition.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("condition", "", "Defines the name/value pair that must hold for the condition to be met.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("intersection", "@Protocol.step.precondition", "Lists a set of conditions that must all be met.", 0, java.lang.Integer.MAX_VALUE, intersection)); - childrenList.add(new Property("union", "@Protocol.step.precondition", "Lists alternative conditions, at least one of must be met.", 0, java.lang.Integer.MAX_VALUE, union)); - childrenList.add(new Property("exclude", "@Protocol.step.precondition", "Lists conditions of which none must be met.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // ProtocolStepPreconditionConditionComponent - case 169749129: /*intersection*/ return this.intersection == null ? new Base[0] : this.intersection.toArray(new Base[this.intersection.size()]); // ProtocolStepPreconditionComponent - case 111433423: /*union*/ return this.union == null ? new Base[0] : this.union.toArray(new Base[this.union.size()]); // ProtocolStepPreconditionComponent - case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // ProtocolStepPreconditionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -861311717: // condition - this.condition = (ProtocolStepPreconditionConditionComponent) value; // ProtocolStepPreconditionConditionComponent - break; - case 169749129: // intersection - this.getIntersection().add((ProtocolStepPreconditionComponent) value); // ProtocolStepPreconditionComponent - break; - case 111433423: // union - this.getUnion().add((ProtocolStepPreconditionComponent) value); // ProtocolStepPreconditionComponent - break; - case -1321148966: // exclude - this.getExclude().add((ProtocolStepPreconditionComponent) value); // ProtocolStepPreconditionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("condition")) - this.condition = (ProtocolStepPreconditionConditionComponent) value; // ProtocolStepPreconditionConditionComponent - else if (name.equals("intersection")) - this.getIntersection().add((ProtocolStepPreconditionComponent) value); - else if (name.equals("union")) - this.getUnion().add((ProtocolStepPreconditionComponent) value); - else if (name.equals("exclude")) - this.getExclude().add((ProtocolStepPreconditionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -861311717: return getCondition(); // ProtocolStepPreconditionConditionComponent - case 169749129: return addIntersection(); // ProtocolStepPreconditionComponent - case 111433423: return addUnion(); // ProtocolStepPreconditionComponent - case -1321148966: return addExclude(); // ProtocolStepPreconditionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); - } - else if (name.equals("condition")) { - this.condition = new ProtocolStepPreconditionConditionComponent(); - return this.condition; - } - else if (name.equals("intersection")) { - return addIntersection(); - } - else if (name.equals("union")) { - return addUnion(); - } - else if (name.equals("exclude")) { - return addExclude(); - } - else - return super.addChild(name); - } - - public ProtocolStepPreconditionComponent copy() { - ProtocolStepPreconditionComponent dst = new ProtocolStepPreconditionComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.condition = condition == null ? null : condition.copy(); - if (intersection != null) { - dst.intersection = new ArrayList(); - for (ProtocolStepPreconditionComponent i : intersection) - dst.intersection.add(i.copy()); - }; - if (union != null) { - dst.union = new ArrayList(); - for (ProtocolStepPreconditionComponent i : union) - dst.union.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (ProtocolStepPreconditionComponent i : exclude) - dst.exclude.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepPreconditionComponent)) - return false; - ProtocolStepPreconditionComponent o = (ProtocolStepPreconditionComponent) other; - return compareDeep(description, o.description, true) && compareDeep(condition, o.condition, true) - && compareDeep(intersection, o.intersection, true) && compareDeep(union, o.union, true) && compareDeep(exclude, o.exclude, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepPreconditionComponent)) - return false; - ProtocolStepPreconditionComponent o = (ProtocolStepPreconditionComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (condition == null || condition.isEmpty()) - && (intersection == null || intersection.isEmpty()) && (union == null || union.isEmpty()) - && (exclude == null || exclude.isEmpty()); - } - - public String fhirType() { - return "Protocol.step.precondition"; - - } - - } - - @Block() - public static class ProtocolStepPreconditionConditionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of observation, test or other assertion being evaluated by the condition. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Observation / test / assertion", formalDefinition="The type of observation, test or other assertion being evaluated by the condition." ) - protected CodeableConcept type; - - /** - * Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied. - */ - @Child(name = "value", type = {CodeableConcept.class, BooleanType.class, SimpleQuantity.class, Range.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Value needed to satisfy condition", formalDefinition="Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied." ) - protected Type value; - - private static final long serialVersionUID = -491121170L; - - /** - * Constructor - */ - public ProtocolStepPreconditionConditionComponent() { - super(); - } - - /** - * Constructor - */ - public ProtocolStepPreconditionConditionComponent(CodeableConcept type, Type value) { - super(); - this.type = type; - this.value = value; - } - - /** - * @return {@link #type} (The type of observation, test or other assertion being evaluated by the condition.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepPreconditionConditionComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of observation, test or other assertion being evaluated by the condition.) - */ - public ProtocolStepPreconditionConditionComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) - */ - public CodeableConcept getValueCodeableConcept() throws FHIRException { - if (!(this.value instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeableConcept) this.value; - } - - public boolean hasValueCodeableConcept() { - return this.value instanceof CodeableConcept; - } - - /** - * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) - */ - public BooleanType getValueBooleanType() throws FHIRException { - if (!(this.value instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - public boolean hasValueBooleanType() { - return this.value instanceof BooleanType; - } - - /** - * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) - */ - public SimpleQuantity getValueSimpleQuantity() throws FHIRException { - if (!(this.value instanceof SimpleQuantity)) - throw new FHIRException("Type mismatch: the type SimpleQuantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (SimpleQuantity) this.value; - } - - public boolean hasValueSimpleQuantity() { - return this.value instanceof SimpleQuantity; - } - - /** - * @return {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) - */ - public Range getValueRange() throws FHIRException { - if (!(this.value instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Range) this.value; - } - - public boolean hasValueRange() { - return this.value instanceof Range; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.) - */ - public ProtocolStepPreconditionConditionComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The type of observation, test or other assertion being evaluated by the condition.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("value[x]", "CodeableConcept|boolean|SimpleQuantity|Range", "Indicates what value the observation/test/assertion must have in order for the condition to be considered to be satisfied.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueSimpleQuantity")) { - this.value = new SimpleQuantity(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else - return super.addChild(name); - } - - public ProtocolStepPreconditionConditionComponent copy() { - ProtocolStepPreconditionConditionComponent dst = new ProtocolStepPreconditionConditionComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepPreconditionConditionComponent)) - return false; - ProtocolStepPreconditionConditionComponent o = (ProtocolStepPreconditionConditionComponent) other; - return compareDeep(type, o.type, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepPreconditionConditionComponent)) - return false; - ProtocolStepPreconditionConditionComponent o = (ProtocolStepPreconditionConditionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "Protocol.step.precondition.condition"; - - } - - } - - @Block() - public static class ProtocolStepActivityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * What can be done instead? - */ - @Child(name = "alternative", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) - @Description(shortDefinition="What can be done instead?", formalDefinition="What can be done instead?" ) - protected List alternative; - - /** - * Activities that are part of this activity. - */ - @Child(name = "component", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Activities that are part of this activity", formalDefinition="Activities that are part of this activity." ) - protected List component; - - /** - * What happens next. - */ - @Child(name = "following", type = {UriType.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=true) - @Description(shortDefinition="What happens next", formalDefinition="What happens next." ) - protected List following; - - /** - * Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity. - */ - @Child(name = "wait", type = {Duration.class}, order=4, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Pause before start", formalDefinition="Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity." ) - protected Duration wait; - - /** - * Information about the nature of the activity, including type, timing and other qualifiers. - */ - @Child(name = "detail", type = {}, order=5, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="Details of activity", formalDefinition="Information about the nature of the activity, including type, timing and other qualifiers." ) - protected ProtocolStepActivityDetailComponent detail; - - private static final long serialVersionUID = 1430131373L; - - /** - * Constructor - */ - public ProtocolStepActivityComponent() { - super(); - } - - /** - * Constructor - */ - public ProtocolStepActivityComponent(ProtocolStepActivityDetailComponent detail) { - super(); - this.detail = detail; - } - - /** - * @return {@link #alternative} (What can be done instead?) - */ - public List getAlternative() { - if (this.alternative == null) - this.alternative = new ArrayList(); - return this.alternative; - } - - public boolean hasAlternative() { - if (this.alternative == null) - return false; - for (UriType item : this.alternative) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #alternative} (What can be done instead?) - */ - // syntactic sugar - public UriType addAlternativeElement() {//2 - UriType t = new UriType(); - if (this.alternative == null) - this.alternative = new ArrayList(); - this.alternative.add(t); - return t; - } - - /** - * @param value {@link #alternative} (What can be done instead?) - */ - public ProtocolStepActivityComponent addAlternative(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.alternative == null) - this.alternative = new ArrayList(); - this.alternative.add(t); - return this; - } - - /** - * @param value {@link #alternative} (What can be done instead?) - */ - public boolean hasAlternative(String value) { - if (this.alternative == null) - return false; - for (UriType v : this.alternative) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #component} (Activities that are part of this activity.) - */ - public List getComponent() { - if (this.component == null) - this.component = new ArrayList(); - return this.component; - } - - public boolean hasComponent() { - if (this.component == null) - return false; - for (ProtocolStepActivityComponentComponent item : this.component) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #component} (Activities that are part of this activity.) - */ - // syntactic sugar - public ProtocolStepActivityComponentComponent addComponent() { //3 - ProtocolStepActivityComponentComponent t = new ProtocolStepActivityComponentComponent(); - if (this.component == null) - this.component = new ArrayList(); - this.component.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepActivityComponent addComponent(ProtocolStepActivityComponentComponent t) { //3 - if (t == null) - return this; - if (this.component == null) - this.component = new ArrayList(); - this.component.add(t); - return this; - } - - /** - * @return {@link #following} (What happens next.) - */ - public List getFollowing() { - if (this.following == null) - this.following = new ArrayList(); - return this.following; - } - - public boolean hasFollowing() { - if (this.following == null) - return false; - for (UriType item : this.following) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #following} (What happens next.) - */ - // syntactic sugar - public UriType addFollowingElement() {//2 - UriType t = new UriType(); - if (this.following == null) - this.following = new ArrayList(); - this.following.add(t); - return t; - } - - /** - * @param value {@link #following} (What happens next.) - */ - public ProtocolStepActivityComponent addFollowing(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.following == null) - this.following = new ArrayList(); - this.following.add(t); - return this; - } - - /** - * @param value {@link #following} (What happens next.) - */ - public boolean hasFollowing(String value) { - if (this.following == null) - return false; - for (UriType v : this.following) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #wait} (Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity.) - */ - public Duration getWait() { - if (this.wait == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityComponent.wait"); - else if (Configuration.doAutoCreate()) - this.wait = new Duration(); // cc - return this.wait; - } - - public boolean hasWait() { - return this.wait != null && !this.wait.isEmpty(); - } - - /** - * @param value {@link #wait} (Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity.) - */ - public ProtocolStepActivityComponent setWait(Duration value) { - this.wait = value; - return this; - } - - /** - * @return {@link #detail} (Information about the nature of the activity, including type, timing and other qualifiers.) - */ - public ProtocolStepActivityDetailComponent getDetail() { - if (this.detail == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityComponent.detail"); - else if (Configuration.doAutoCreate()) - this.detail = new ProtocolStepActivityDetailComponent(); // cc - return this.detail; - } - - public boolean hasDetail() { - return this.detail != null && !this.detail.isEmpty(); - } - - /** - * @param value {@link #detail} (Information about the nature of the activity, including type, timing and other qualifiers.) - */ - public ProtocolStepActivityComponent setDetail(ProtocolStepActivityDetailComponent value) { - this.detail = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("alternative", "uri", "What can be done instead?", 0, java.lang.Integer.MAX_VALUE, alternative)); - childrenList.add(new Property("component", "", "Activities that are part of this activity.", 0, java.lang.Integer.MAX_VALUE, component)); - childrenList.add(new Property("following", "uri", "What happens next.", 0, java.lang.Integer.MAX_VALUE, following)); - childrenList.add(new Property("wait", "Duration", "Indicates the length of time to wait between the conditions being satisfied for the activity to start and the actual start of the activity.", 0, java.lang.Integer.MAX_VALUE, wait)); - childrenList.add(new Property("detail", "", "Information about the nature of the activity, including type, timing and other qualifiers.", 0, java.lang.Integer.MAX_VALUE, detail)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -196794451: /*alternative*/ return this.alternative == null ? new Base[0] : this.alternative.toArray(new Base[this.alternative.size()]); // UriType - case -1399907075: /*component*/ return this.component == null ? new Base[0] : this.component.toArray(new Base[this.component.size()]); // ProtocolStepActivityComponentComponent - case 765915793: /*following*/ return this.following == null ? new Base[0] : this.following.toArray(new Base[this.following.size()]); // UriType - case 3641717: /*wait*/ return this.wait == null ? new Base[0] : new Base[] {this.wait}; // Duration - case -1335224239: /*detail*/ return this.detail == null ? new Base[0] : new Base[] {this.detail}; // ProtocolStepActivityDetailComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -196794451: // alternative - this.getAlternative().add(castToUri(value)); // UriType - break; - case -1399907075: // component - this.getComponent().add((ProtocolStepActivityComponentComponent) value); // ProtocolStepActivityComponentComponent - break; - case 765915793: // following - this.getFollowing().add(castToUri(value)); // UriType - break; - case 3641717: // wait - this.wait = castToDuration(value); // Duration - break; - case -1335224239: // detail - this.detail = (ProtocolStepActivityDetailComponent) value; // ProtocolStepActivityDetailComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("alternative")) - this.getAlternative().add(castToUri(value)); - else if (name.equals("component")) - this.getComponent().add((ProtocolStepActivityComponentComponent) value); - else if (name.equals("following")) - this.getFollowing().add(castToUri(value)); - else if (name.equals("wait")) - this.wait = castToDuration(value); // Duration - else if (name.equals("detail")) - this.detail = (ProtocolStepActivityDetailComponent) value; // ProtocolStepActivityDetailComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -196794451: throw new FHIRException("Cannot make property alternative as it is not a complex type"); // UriType - case -1399907075: return addComponent(); // ProtocolStepActivityComponentComponent - case 765915793: throw new FHIRException("Cannot make property following as it is not a complex type"); // UriType - case 3641717: return getWait(); // Duration - case -1335224239: return getDetail(); // ProtocolStepActivityDetailComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("alternative")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.alternative"); - } - else if (name.equals("component")) { - return addComponent(); - } - else if (name.equals("following")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.following"); - } - else if (name.equals("wait")) { - this.wait = new Duration(); - return this.wait; - } - else if (name.equals("detail")) { - this.detail = new ProtocolStepActivityDetailComponent(); - return this.detail; - } - else - return super.addChild(name); - } - - public ProtocolStepActivityComponent copy() { - ProtocolStepActivityComponent dst = new ProtocolStepActivityComponent(); - copyValues(dst); - if (alternative != null) { - dst.alternative = new ArrayList(); - for (UriType i : alternative) - dst.alternative.add(i.copy()); - }; - if (component != null) { - dst.component = new ArrayList(); - for (ProtocolStepActivityComponentComponent i : component) - dst.component.add(i.copy()); - }; - if (following != null) { - dst.following = new ArrayList(); - for (UriType i : following) - dst.following.add(i.copy()); - }; - dst.wait = wait == null ? null : wait.copy(); - dst.detail = detail == null ? null : detail.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepActivityComponent)) - return false; - ProtocolStepActivityComponent o = (ProtocolStepActivityComponent) other; - return compareDeep(alternative, o.alternative, true) && compareDeep(component, o.component, true) - && compareDeep(following, o.following, true) && compareDeep(wait, o.wait, true) && compareDeep(detail, o.detail, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepActivityComponent)) - return false; - ProtocolStepActivityComponent o = (ProtocolStepActivityComponent) other; - return compareValues(alternative, o.alternative, true) && compareValues(following, o.following, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (alternative == null || alternative.isEmpty()) && (component == null || component.isEmpty()) - && (following == null || following.isEmpty()) && (wait == null || wait.isEmpty()) && (detail == null || detail.isEmpty()) - ; - } - - public String fhirType() { - return "Protocol.step.activity"; - - } - - } - - @Block() - public static class ProtocolStepActivityComponentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Order of occurrence. - */ - @Child(name = "sequence", type = {IntegerType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="Order of occurrence", formalDefinition="Order of occurrence." ) - protected IntegerType sequence; - - /** - * Component activity. - */ - @Child(name = "activity", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Component activity", formalDefinition="Component activity." ) - protected UriType activity; - - private static final long serialVersionUID = -856295616L; - - /** - * Constructor - */ - public ProtocolStepActivityComponentComponent() { - super(); - } - - /** - * Constructor - */ - public ProtocolStepActivityComponentComponent(UriType activity) { - super(); - this.activity = activity; - } - - /** - * @return {@link #sequence} (Order of occurrence.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public IntegerType getSequenceElement() { - if (this.sequence == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityComponentComponent.sequence"); - else if (Configuration.doAutoCreate()) - this.sequence = new IntegerType(); // bb - return this.sequence; - } - - public boolean hasSequenceElement() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - public boolean hasSequence() { - return this.sequence != null && !this.sequence.isEmpty(); - } - - /** - * @param value {@link #sequence} (Order of occurrence.). This is the underlying object with id, value and extensions. The accessor "getSequence" gives direct access to the value - */ - public ProtocolStepActivityComponentComponent setSequenceElement(IntegerType value) { - this.sequence = value; - return this; - } - - /** - * @return Order of occurrence. - */ - public int getSequence() { - return this.sequence == null || this.sequence.isEmpty() ? 0 : this.sequence.getValue(); - } - - /** - * @param value Order of occurrence. - */ - public ProtocolStepActivityComponentComponent setSequence(int value) { - if (this.sequence == null) - this.sequence = new IntegerType(); - this.sequence.setValue(value); - return this; - } - - /** - * @return {@link #activity} (Component activity.). This is the underlying object with id, value and extensions. The accessor "getActivity" gives direct access to the value - */ - public UriType getActivityElement() { - if (this.activity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityComponentComponent.activity"); - else if (Configuration.doAutoCreate()) - this.activity = new UriType(); // bb - return this.activity; - } - - public boolean hasActivityElement() { - return this.activity != null && !this.activity.isEmpty(); - } - - public boolean hasActivity() { - return this.activity != null && !this.activity.isEmpty(); - } - - /** - * @param value {@link #activity} (Component activity.). This is the underlying object with id, value and extensions. The accessor "getActivity" gives direct access to the value - */ - public ProtocolStepActivityComponentComponent setActivityElement(UriType value) { - this.activity = value; - return this; - } - - /** - * @return Component activity. - */ - public String getActivity() { - return this.activity == null ? null : this.activity.getValue(); - } - - /** - * @param value Component activity. - */ - public ProtocolStepActivityComponentComponent setActivity(String value) { - if (this.activity == null) - this.activity = new UriType(); - this.activity.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("sequence", "integer", "Order of occurrence.", 0, java.lang.Integer.MAX_VALUE, sequence)); - childrenList.add(new Property("activity", "uri", "Component activity.", 0, java.lang.Integer.MAX_VALUE, activity)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // IntegerType - case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1349547969: // sequence - this.sequence = castToInteger(value); // IntegerType - break; - case -1655966961: // activity - this.activity = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("sequence")) - this.sequence = castToInteger(value); // IntegerType - else if (name.equals("activity")) - this.activity = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1349547969: throw new FHIRException("Cannot make property sequence as it is not a complex type"); // IntegerType - case -1655966961: throw new FHIRException("Cannot make property activity as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("sequence")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.sequence"); - } - else if (name.equals("activity")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.activity"); - } - else - return super.addChild(name); - } - - public ProtocolStepActivityComponentComponent copy() { - ProtocolStepActivityComponentComponent dst = new ProtocolStepActivityComponentComponent(); - copyValues(dst); - dst.sequence = sequence == null ? null : sequence.copy(); - dst.activity = activity == null ? null : activity.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepActivityComponentComponent)) - return false; - ProtocolStepActivityComponentComponent o = (ProtocolStepActivityComponentComponent) other; - return compareDeep(sequence, o.sequence, true) && compareDeep(activity, o.activity, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepActivityComponentComponent)) - return false; - ProtocolStepActivityComponentComponent o = (ProtocolStepActivityComponentComponent) other; - return compareValues(sequence, o.sequence, true) && compareValues(activity, o.activity, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (sequence == null || sequence.isEmpty()) && (activity == null || activity.isEmpty()) - ; - } - - public String fhirType() { - return "Protocol.step.activity.component"; - - } - - } - - @Block() - public static class ProtocolStepActivityDetailComponent extends BackboneElement implements IBaseBackboneElement { - /** - * High-level categorization of the type of activity. - */ - @Child(name = "category", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="diet | drug | encounter | observation +", formalDefinition="High-level categorization of the type of activity." ) - protected Enumeration category; - - /** - * Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept code; - - /** - * The period, timing or frequency upon which the described activity is to occur. - */ - @Child(name = "timing", type = {CodeableConcept.class, Timing.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When activity is to occur", formalDefinition="The period, timing or frequency upon which the described activity is to occur." ) - protected Type timing; - - /** - * Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc. - */ - @Child(name = "location", type = {Location.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where it should happen", formalDefinition="Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - protected Location locationTarget; - - /** - * Identifies who's expected to be involved in the activity. - */ - @Child(name = "performer", type = {Practitioner.class, Organization.class, RelatedPerson.class, Patient.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who's responsible?", formalDefinition="Identifies who's expected to be involved in the activity." ) - protected List performer; - /** - * The actual objects that are the target of the reference (Identifies who's expected to be involved in the activity.) - */ - protected List performerTarget; - - - /** - * Identifies the food, drug or other product being consumed or supplied in the activity. - */ - @Child(name = "product", type = {Medication.class, Substance.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="What's administered/supplied", formalDefinition="Identifies the food, drug or other product being consumed or supplied in the activity." ) - protected Reference product; - - /** - * The actual object that is the target of the reference (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - protected Resource productTarget; - - /** - * Identifies the quantity expected to be consumed at once (per dose, per meal, etc.). - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How much is administered/consumed/supplied", formalDefinition="Identifies the quantity expected to be consumed at once (per dose, per meal, etc.)." ) - protected SimpleQuantity quantity; - - /** - * 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. - */ - @Child(name = "description", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @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." ) - protected StringType description; - - private static final long serialVersionUID = 8207475L; - - /** - * Constructor - */ - public ProtocolStepActivityDetailComponent() { - super(); - } - - /** - * @return {@link #category} (High-level categorization of the type of activity.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new ActivityDefinitionCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (High-level categorization of the type of activity.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public ProtocolStepActivityDetailComponent setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return High-level categorization of the type of activity. - */ - public ActivityDefinitionCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value High-level categorization of the type of activity. - */ - public ProtocolStepActivityDetailComponent setCategory(ActivityDefinitionCategory value) { - if (value == null) - this.category = null; - else { - if (this.category == null) - this.category = new Enumeration(new ActivityDefinitionCategoryEnumFactory()); - this.category.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.) - */ - public ProtocolStepActivityDetailComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Type getTiming() { - return this.timing; - } - - /** - * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) - */ - public CodeableConcept getTimingCodeableConcept() throws FHIRException { - if (!(this.timing instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (CodeableConcept) this.timing; - } - - public boolean hasTimingCodeableConcept() { - return this.timing instanceof CodeableConcept; - } - - /** - * @return {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) - */ - public Timing getTimingTiming() throws FHIRException { - if (!(this.timing instanceof Timing)) - throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.timing.getClass().getName()+" was encountered"); - return (Timing) this.timing; - } - - public boolean hasTimingTiming() { - return this.timing instanceof Timing; - } - - public boolean hasTiming() { - return this.timing != null && !this.timing.isEmpty(); - } - - /** - * @param value {@link #timing} (The period, timing or frequency upon which the described activity is to occur.) - */ - public ProtocolStepActivityDetailComponent setTiming(Type value) { - this.timing = value; - return this; - } - - /** - * @return {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public ProtocolStepActivityDetailComponent setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.) - */ - public ProtocolStepActivityDetailComponent setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - public List getPerformer() { - if (this.performer == null) - this.performer = new ArrayList(); - return this.performer; - } - - public boolean hasPerformer() { - if (this.performer == null) - return false; - for (Reference item : this.performer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performer} (Identifies who's expected to be involved in the activity.) - */ - // syntactic sugar - public Reference addPerformer() { //3 - Reference t = new Reference(); - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return t; - } - - // syntactic sugar - public ProtocolStepActivityDetailComponent addPerformer(Reference t) { //3 - if (t == null) - return this; - if (this.performer == null) - this.performer = new ArrayList(); - this.performer.add(t); - return this; - } - - /** - * @return {@link #performer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies who's expected to be involved in the activity.) - */ - public List getPerformerTarget() { - if (this.performerTarget == null) - this.performerTarget = new ArrayList(); - return this.performerTarget; - } - - /** - * @return {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public Reference getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.product"); - else if (Configuration.doAutoCreate()) - this.product = new Reference(); // cc - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public ProtocolStepActivityDetailComponent setProduct(Reference value) { - this.product = value; - return this; - } - - /** - * @return {@link #product} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public Resource getProductTarget() { - return this.productTarget; - } - - /** - * @param value {@link #product} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the food, drug or other product being consumed or supplied in the activity.) - */ - public ProtocolStepActivityDetailComponent setProductTarget(Resource value) { - this.productTarget = value; - return this; - } - - /** - * @return {@link #quantity} (Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).) - */ - public ProtocolStepActivityDetailComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #description} (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.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepActivityDetailComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (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.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ProtocolStepActivityDetailComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return 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 String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value 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 ProtocolStepActivityDetailComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("category", "code", "High-level categorization of the type of activity.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("timing[x]", "CodeableConcept|Timing", "The period, timing or frequency upon which the described activity is to occur.", 0, java.lang.Integer.MAX_VALUE, timing)); - childrenList.add(new Property("location", "Reference(Location)", "Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("performer", "Reference(Practitioner|Organization|RelatedPerson|Patient)", "Identifies who's expected to be involved in the activity.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("product", "Reference(Medication|Substance)", "Identifies the food, drug or other product being consumed or supplied in the activity.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("quantity", "SimpleQuantity", "Identifies the quantity expected to be consumed at once (per dose, per meal, etc.).", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("description", "string", "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.", 0, java.lang.Integer.MAX_VALUE, description)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -873664438: /*timing*/ return this.timing == null ? new Base[0] : new Base[] {this.timing}; // Type - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : this.performer.toArray(new Base[this.performer.size()]); // Reference - case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Reference - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 50511102: // category - this.category = new ActivityDefinitionCategoryEnumFactory().fromType(value); // Enumeration - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -873664438: // timing - this.timing = (Type) value; // Type - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case 481140686: // performer - this.getPerformer().add(castToReference(value)); // Reference - break; - case -309474065: // product - this.product = castToReference(value); // Reference - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("category")) - this.category = new ActivityDefinitionCategoryEnumFactory().fromType(value); // Enumeration - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("timing[x]")) - this.timing = (Type) value; // Type - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("performer")) - this.getPerformer().add(castToReference(value)); - else if (name.equals("product")) - this.product = castToReference(value); // Reference - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("description")) - this.description = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration - case 3059181: return getCode(); // CodeableConcept - case 164632566: return getTiming(); // Type - case 1901043637: return getLocation(); // Reference - case 481140686: return addPerformer(); // Reference - case -309474065: return getProduct(); // Reference - case -1285004149: return getQuantity(); // SimpleQuantity - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("category")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.category"); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("timingCodeableConcept")) { - this.timing = new CodeableConcept(); - return this.timing; - } - else if (name.equals("timingTiming")) { - this.timing = new Timing(); - return this.timing; - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("performer")) { - return addPerformer(); - } - else if (name.equals("product")) { - this.product = new Reference(); - return this.product; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); - } - else - return super.addChild(name); - } - - public ProtocolStepActivityDetailComponent copy() { - ProtocolStepActivityDetailComponent dst = new ProtocolStepActivityDetailComponent(); - copyValues(dst); - dst.category = category == null ? null : category.copy(); - dst.code = code == null ? null : code.copy(); - dst.timing = timing == null ? null : timing.copy(); - dst.location = location == null ? null : location.copy(); - if (performer != null) { - dst.performer = new ArrayList(); - for (Reference i : performer) - dst.performer.add(i.copy()); - }; - dst.product = product == null ? null : product.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.description = description == null ? null : description.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepActivityDetailComponent)) - return false; - ProtocolStepActivityDetailComponent o = (ProtocolStepActivityDetailComponent) other; - return compareDeep(category, o.category, true) && compareDeep(code, o.code, true) && compareDeep(timing, o.timing, true) - && compareDeep(location, o.location, true) && compareDeep(performer, o.performer, true) && compareDeep(product, o.product, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(description, o.description, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepActivityDetailComponent)) - return false; - ProtocolStepActivityDetailComponent o = (ProtocolStepActivityDetailComponent) other; - return compareValues(category, o.category, true) && compareValues(description, o.description, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (category == null || category.isEmpty()) && (code == null || code.isEmpty()) - && (timing == null || timing.isEmpty()) && (location == null || location.isEmpty()) && (performer == null || performer.isEmpty()) - && (product == null || product.isEmpty()) && (quantity == null || quantity.isEmpty()) && (description == null || description.isEmpty()) - ; - } - - public String fhirType() { - return "Protocol.step.activity.detail"; - - } - - } - - @Block() - public static class ProtocolStepNextComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Description of what happens next. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of what happens next", formalDefinition="Description of what happens next." ) - protected StringType description; - - /** - * Id of following step. - */ - @Child(name = "reference", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Id of following step", formalDefinition="Id of following step." ) - protected UriType reference; - - /** - * Condition in which next step is executed. - */ - @Child(name = "condition", type = {ProtocolStepPreconditionComponent.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Condition in which next step is executed", formalDefinition="Condition in which next step is executed." ) - protected ProtocolStepPreconditionComponent condition; - - private static final long serialVersionUID = -1343883194L; - - /** - * Constructor - */ - public ProtocolStepNextComponent() { - super(); - } - - /** - * @return {@link #description} (Description of what happens next.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepNextComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Description of what happens next.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ProtocolStepNextComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of what happens next. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of what happens next. - */ - public ProtocolStepNextComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #reference} (Id of following step.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepNextComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Id of following step.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProtocolStepNextComponent setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return Id of following step. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value Id of following step. - */ - public ProtocolStepNextComponent setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (Condition in which next step is executed.) - */ - public ProtocolStepPreconditionComponent getCondition() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProtocolStepNextComponent.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new ProtocolStepPreconditionComponent(); // cc - return this.condition; - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (Condition in which next step is executed.) - */ - public ProtocolStepNextComponent setCondition(ProtocolStepPreconditionComponent value) { - this.condition = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Description of what happens next.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("reference", "uri", "Id of following step.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("condition", "@Protocol.step.precondition", "Condition in which next step is executed.", 0, java.lang.Integer.MAX_VALUE, condition)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // ProtocolStepPreconditionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -925155509: // reference - this.reference = castToUri(value); // UriType - break; - case -861311717: // condition - this.condition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("reference")) - this.reference = castToUri(value); // UriType - else if (name.equals("condition")) - this.condition = (ProtocolStepPreconditionComponent) value; // ProtocolStepPreconditionComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType - case -861311717: return getCondition(); // ProtocolStepPreconditionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.description"); - } - else if (name.equals("reference")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.reference"); - } - else if (name.equals("condition")) { - this.condition = new ProtocolStepPreconditionComponent(); - return this.condition; - } - else - return super.addChild(name); - } - - public ProtocolStepNextComponent copy() { - ProtocolStepNextComponent dst = new ProtocolStepNextComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.condition = condition == null ? null : condition.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProtocolStepNextComponent)) - return false; - ProtocolStepNextComponent o = (ProtocolStepNextComponent) other; - return compareDeep(description, o.description, true) && compareDeep(reference, o.reference, true) - && compareDeep(condition, o.condition, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProtocolStepNextComponent)) - return false; - ProtocolStepNextComponent o = (ProtocolStepNextComponent) other; - return compareValues(description, o.description, true) && compareValues(reference, o.reference, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (reference == null || reference.isEmpty()) - && (condition == null || condition.isEmpty()); - } - - public String fhirType() { - return "Protocol.step.next"; - - } - - } - - /** - * A unique identifier for the protocol instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique Id for this particular protocol", formalDefinition="A unique identifier for the protocol instance." ) - protected List identifier; - - /** - * Name of protocol. - */ - @Child(name = "title", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of protocol", formalDefinition="Name of protocol." ) - protected StringType title; - - /** - * The status of the protocol. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | testing | review | active | withdrawn | superseded", formalDefinition="The status of the protocol." ) - protected Enumeration status; - - /** - * A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes. - */ - @Child(name = "type", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="condition | device | drug | study", formalDefinition="A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes." ) - protected Enumeration type; - - /** - * What does protocol deal with? - */ - @Child(name = "subject", type = {Condition.class, Device.class, Medication.class}, order=4, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="What does protocol deal with?", formalDefinition="What does protocol deal with?" ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (What does protocol deal with?) - */ - protected Resource subjectTarget; - - /** - * To whom does Protocol apply? - */ - @Child(name = "group", type = {Group.class}, order=5, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="To whom does Protocol apply?", formalDefinition="To whom does Protocol apply?" ) - protected Reference group; - - /** - * The actual object that is the target of the reference (To whom does Protocol apply?) - */ - protected Group groupTarget; - - /** - * When is protocol to be used? - */ - @Child(name = "purpose", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="When is protocol to be used?", formalDefinition="When is protocol to be used?" ) - protected StringType purpose; - - /** - * Who wrote protocol? - */ - @Child(name = "author", type = {Organization.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who wrote protocol?", formalDefinition="Who wrote protocol?" ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Who wrote protocol?) - */ - protected Organization authorTarget; - - /** - * What's done as part of protocol. - */ - @Child(name = "step", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="What's done as part of protocol", formalDefinition="What's done as part of protocol." ) - protected List step; - - private static final long serialVersionUID = -1458830869L; - - /** - * Constructor - */ - public Protocol() { - super(); - } - - /** - * Constructor - */ - public Protocol(Enumeration status, Enumeration type, StringType purpose) { - super(); - this.status = status; - this.type = type; - this.purpose = purpose; - } - - /** - * @return {@link #identifier} (A unique identifier for the protocol instance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (A unique identifier for the protocol instance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Protocol addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #title} (Name of protocol.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (Name of protocol.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Protocol setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return Name of protocol. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value Name of protocol. - */ - public Protocol setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the protocol.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ProtocolStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the protocol.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Protocol setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the protocol. - */ - public ProtocolStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the protocol. - */ - public Protocol setStatus(ProtocolStatus value) { - if (this.status == null) - this.status = new Enumeration(new ProtocolStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #type} (A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new ProtocolTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Protocol setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes. - */ - public ProtocolType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes. - */ - public Protocol setType(ProtocolType value) { - if (this.type == null) - this.type = new Enumeration(new ProtocolTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #subject} (What does protocol deal with?) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (What does protocol deal with?) - */ - public Protocol setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (What does protocol deal with?) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (What does protocol deal with?) - */ - public Protocol setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #group} (To whom does Protocol apply?) - */ - public Reference getGroup() { - if (this.group == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.group"); - else if (Configuration.doAutoCreate()) - this.group = new Reference(); // cc - return this.group; - } - - public boolean hasGroup() { - return this.group != null && !this.group.isEmpty(); - } - - /** - * @param value {@link #group} (To whom does Protocol apply?) - */ - public Protocol setGroup(Reference value) { - this.group = value; - return this; - } - - /** - * @return {@link #group} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (To whom does Protocol apply?) - */ - public Group getGroupTarget() { - if (this.groupTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.group"); - else if (Configuration.doAutoCreate()) - this.groupTarget = new Group(); // aa - return this.groupTarget; - } - - /** - * @param value {@link #group} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (To whom does Protocol apply?) - */ - public Protocol setGroupTarget(Group value) { - this.groupTarget = value; - return this; - } - - /** - * @return {@link #purpose} (When is protocol to be used?). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value - */ - public StringType getPurposeElement() { - if (this.purpose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.purpose"); - else if (Configuration.doAutoCreate()) - this.purpose = new StringType(); // bb - return this.purpose; - } - - public boolean hasPurposeElement() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - public boolean hasPurpose() { - return this.purpose != null && !this.purpose.isEmpty(); - } - - /** - * @param value {@link #purpose} (When is protocol to be used?). This is the underlying object with id, value and extensions. The accessor "getPurpose" gives direct access to the value - */ - public Protocol setPurposeElement(StringType value) { - this.purpose = value; - return this; - } - - /** - * @return When is protocol to be used? - */ - public String getPurpose() { - return this.purpose == null ? null : this.purpose.getValue(); - } - - /** - * @param value When is protocol to be used? - */ - public Protocol setPurpose(String value) { - if (this.purpose == null) - this.purpose = new StringType(); - this.purpose.setValue(value); - return this; - } - - /** - * @return {@link #author} (Who wrote protocol?) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Who wrote protocol?) - */ - public Protocol setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Who wrote protocol?) - */ - public Organization getAuthorTarget() { - if (this.authorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Protocol.author"); - else if (Configuration.doAutoCreate()) - this.authorTarget = new Organization(); // aa - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Who wrote protocol?) - */ - public Protocol setAuthorTarget(Organization value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #step} (What's done as part of protocol.) - */ - public List getStep() { - if (this.step == null) - this.step = new ArrayList(); - return this.step; - } - - public boolean hasStep() { - if (this.step == null) - return false; - for (ProtocolStepComponent item : this.step) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #step} (What's done as part of protocol.) - */ - // syntactic sugar - public ProtocolStepComponent addStep() { //3 - ProtocolStepComponent t = new ProtocolStepComponent(); - if (this.step == null) - this.step = new ArrayList(); - this.step.add(t); - return t; - } - - // syntactic sugar - public Protocol addStep(ProtocolStepComponent t) { //3 - if (t == null) - return this; - if (this.step == null) - this.step = new ArrayList(); - this.step.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A unique identifier for the protocol instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("title", "string", "Name of protocol.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("status", "code", "The status of the protocol.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "code", "A code that classifies the general type of context to which these behavior definitions apply. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subject", "Reference(Condition|Device|Medication)", "What does protocol deal with?", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("group", "Reference(Group)", "To whom does Protocol apply?", 0, java.lang.Integer.MAX_VALUE, group)); - childrenList.add(new Property("purpose", "string", "When is protocol to be used?", 0, java.lang.Integer.MAX_VALUE, purpose)); - childrenList.add(new Property("author", "Reference(Organization)", "Who wrote protocol?", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("step", "", "What's done as part of protocol.", 0, java.lang.Integer.MAX_VALUE, step)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 98629247: /*group*/ return this.group == null ? new Base[0] : new Base[] {this.group}; // Reference - case -220463842: /*purpose*/ return this.purpose == null ? new Base[0] : new Base[] {this.purpose}; // StringType - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 3540684: /*step*/ return this.step == null ? new Base[0] : this.step.toArray(new Base[this.step.size()]); // ProtocolStepComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ProtocolStatusEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = new ProtocolTypeEnumFactory().fromType(value); // Enumeration - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 98629247: // group - this.group = castToReference(value); // Reference - break; - case -220463842: // purpose - this.purpose = castToString(value); // StringType - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 3540684: // step - this.getStep().add((ProtocolStepComponent) value); // ProtocolStepComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ProtocolStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = new ProtocolTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("group")) - this.group = castToReference(value); // Reference - else if (name.equals("purpose")) - this.purpose = castToString(value); // StringType - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("step")) - this.getStep().add((ProtocolStepComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -1867885268: return getSubject(); // Reference - case 98629247: return getGroup(); // Reference - case -220463842: throw new FHIRException("Cannot make property purpose as it is not a complex type"); // StringType - case -1406328437: return getAuthor(); // Reference - case 3540684: return addStep(); // ProtocolStepComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.title"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.status"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.type"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("group")) { - this.group = new Reference(); - return this.group; - } - else if (name.equals("purpose")) { - throw new FHIRException("Cannot call addChild on a primitive type Protocol.purpose"); - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("step")) { - return addStep(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Protocol"; - - } - - public Protocol copy() { - Protocol dst = new Protocol(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.title = title == null ? null : title.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.group = group == null ? null : group.copy(); - dst.purpose = purpose == null ? null : purpose.copy(); - dst.author = author == null ? null : author.copy(); - if (step != null) { - dst.step = new ArrayList(); - for (ProtocolStepComponent i : step) - dst.step.add(i.copy()); - }; - return dst; - } - - protected Protocol typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Protocol)) - return false; - Protocol o = (Protocol) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(title, o.title, true) && compareDeep(status, o.status, true) - && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true) && compareDeep(group, o.group, true) - && compareDeep(purpose, o.purpose, true) && compareDeep(author, o.author, true) && compareDeep(step, o.step, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Protocol)) - return false; - Protocol o = (Protocol) other; - return compareValues(title, o.title, true) && compareValues(status, o.status, true) && compareValues(type, o.type, true) - && compareValues(purpose, o.purpose, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (title == null || title.isEmpty()) - && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (subject == null || subject.isEmpty()) - && (group == null || group.isEmpty()) && (purpose == null || purpose.isEmpty()) && (author == null || author.isEmpty()) - && (step == null || step.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Protocol; - } - - /** - * Search parameter: subject - *

- * Description: Protocols with specified subject
- * Type: reference
- * Path: Protocol.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Protocol.subject", description="Protocols with specified subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Protocols with specified subject
- * Type: reference
- * Path: Protocol.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Protocol:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Protocol:subject").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: The unique id for a particular protocol
- * Type: token
- * Path: Protocol.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Protocol.identifier", description="The unique id for a particular protocol", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The unique id for a particular protocol
- * Type: token
- * Path: Protocol.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Provenance.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Provenance.java deleted file mode 100644 index 871ed941b09..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Provenance.java +++ /dev/null @@ -1,2053 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust policies. - */ -@ResourceDef(name="Provenance", profile="http://hl7.org/fhir/Profile/Provenance") -public class Provenance extends DomainResource { - - public enum ProvenanceEntityRole { - /** - * A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity. - */ - DERIVATION, - /** - * A derivation for which the resulting entity is a revised version of some original. - */ - REVISION, - /** - * The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author. - */ - QUOTATION, - /** - * A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight. - */ - SOURCE, - /** - * A derivation for which the entity is removed from accessibility usually through the use of the Delete operation. - */ - REMOVAL, - /** - * added to help the parsers - */ - NULL; - public static ProvenanceEntityRole fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return DERIVATION; - if ("revision".equals(codeString)) - return REVISION; - if ("quotation".equals(codeString)) - return QUOTATION; - if ("source".equals(codeString)) - return SOURCE; - if ("removal".equals(codeString)) - return REMOVAL; - throw new FHIRException("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DERIVATION: return "derivation"; - case REVISION: return "revision"; - case QUOTATION: return "quotation"; - case SOURCE: return "source"; - case REMOVAL: return "removal"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DERIVATION: return "http://hl7.org/fhir/provenance-entity-role"; - case REVISION: return "http://hl7.org/fhir/provenance-entity-role"; - case QUOTATION: return "http://hl7.org/fhir/provenance-entity-role"; - case SOURCE: return "http://hl7.org/fhir/provenance-entity-role"; - case REMOVAL: return "http://hl7.org/fhir/provenance-entity-role"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DERIVATION: return "A transformation of an entity into another, an update of an entity resulting in a new one, or the construction of a new entity based on a preexisting entity."; - case REVISION: return "A derivation for which the resulting entity is a revised version of some original."; - case QUOTATION: return "The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original author."; - case SOURCE: return "A primary source for a topic refers to something produced by some agent with direct experience and knowledge about the topic, at the time of the topic's study, without benefit from hindsight."; - case REMOVAL: return "A derivation for which the entity is removed from accessibility usually through the use of the Delete operation."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DERIVATION: return "Derivation"; - case REVISION: return "Revision"; - case QUOTATION: return "Quotation"; - case SOURCE: return "Source"; - case REMOVAL: return "Removal"; - default: return "?"; - } - } - } - - public static class ProvenanceEntityRoleEnumFactory implements EnumFactory { - public ProvenanceEntityRole fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return ProvenanceEntityRole.DERIVATION; - if ("revision".equals(codeString)) - return ProvenanceEntityRole.REVISION; - if ("quotation".equals(codeString)) - return ProvenanceEntityRole.QUOTATION; - if ("source".equals(codeString)) - return ProvenanceEntityRole.SOURCE; - if ("removal".equals(codeString)) - return ProvenanceEntityRole.REMOVAL; - throw new IllegalArgumentException("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("derivation".equals(codeString)) - return new Enumeration(this, ProvenanceEntityRole.DERIVATION); - if ("revision".equals(codeString)) - return new Enumeration(this, ProvenanceEntityRole.REVISION); - if ("quotation".equals(codeString)) - return new Enumeration(this, ProvenanceEntityRole.QUOTATION); - if ("source".equals(codeString)) - return new Enumeration(this, ProvenanceEntityRole.SOURCE); - if ("removal".equals(codeString)) - return new Enumeration(this, ProvenanceEntityRole.REMOVAL); - throw new FHIRException("Unknown ProvenanceEntityRole code '"+codeString+"'"); - } - public String toCode(ProvenanceEntityRole code) { - if (code == ProvenanceEntityRole.DERIVATION) - return "derivation"; - if (code == ProvenanceEntityRole.REVISION) - return "revision"; - if (code == ProvenanceEntityRole.QUOTATION) - return "quotation"; - if (code == ProvenanceEntityRole.SOURCE) - return "source"; - if (code == ProvenanceEntityRole.REMOVAL) - return "removal"; - return "?"; - } - public String toSystem(ProvenanceEntityRole code) { - return code.getSystem(); - } - } - - @Block() - public static class ProvenanceAgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The function of the agent with respect to the activity. - */ - @Child(name = "role", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="What the agents involvement was", formalDefinition="The function of the agent with respect to the activity." ) - protected Coding role; - - /** - * The individual, device or organization that participated in the event. - */ - @Child(name = "actor", type = {Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Individual, device or organization playing role", formalDefinition="The individual, device or organization that participated in the event." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The individual, device or organization that participated in the event.) - */ - protected Resource actorTarget; - - /** - * The identity of the agent as known by the authorization system. - */ - @Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Authorization-system identifier for the agent", formalDefinition="The identity of the agent as known by the authorization system." ) - protected Identifier userId; - - /** - * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest. - */ - @Child(name = "relatedAgent", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Track delegation between agents", formalDefinition="A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest." ) - protected List relatedAgent; - - private static final long serialVersionUID = 1792758952L; - - /** - * Constructor - */ - public ProvenanceAgentComponent() { - super(); - } - - /** - * Constructor - */ - public ProvenanceAgentComponent(Coding role) { - super(); - this.role = role; - } - - /** - * @return {@link #role} (The function of the agent with respect to the activity.) - */ - public Coding getRole() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Coding(); // cc - return this.role; - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (The function of the agent with respect to the activity.) - */ - public ProvenanceAgentComponent setRole(Coding value) { - this.role = value; - return this; - } - - /** - * @return {@link #actor} (The individual, device or organization that participated in the event.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The individual, device or organization that participated in the event.) - */ - public ProvenanceAgentComponent setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual, device or organization that participated in the event.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual, device or organization that participated in the event.) - */ - public ProvenanceAgentComponent setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #userId} (The identity of the agent as known by the authorization system.) - */ - public Identifier getUserId() { - if (this.userId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentComponent.userId"); - else if (Configuration.doAutoCreate()) - this.userId = new Identifier(); // cc - return this.userId; - } - - public boolean hasUserId() { - return this.userId != null && !this.userId.isEmpty(); - } - - /** - * @param value {@link #userId} (The identity of the agent as known by the authorization system.) - */ - public ProvenanceAgentComponent setUserId(Identifier value) { - this.userId = value; - return this; - } - - /** - * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.) - */ - public List getRelatedAgent() { - if (this.relatedAgent == null) - this.relatedAgent = new ArrayList(); - return this.relatedAgent; - } - - public boolean hasRelatedAgent() { - if (this.relatedAgent == null) - return false; - for (ProvenanceAgentRelatedAgentComponent item : this.relatedAgent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #relatedAgent} (A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.) - */ - // syntactic sugar - public ProvenanceAgentRelatedAgentComponent addRelatedAgent() { //3 - ProvenanceAgentRelatedAgentComponent t = new ProvenanceAgentRelatedAgentComponent(); - if (this.relatedAgent == null) - this.relatedAgent = new ArrayList(); - this.relatedAgent.add(t); - return t; - } - - // syntactic sugar - public ProvenanceAgentComponent addRelatedAgent(ProvenanceAgentRelatedAgentComponent t) { //3 - if (t == null) - return this; - if (this.relatedAgent == null) - this.relatedAgent = new ArrayList(); - this.relatedAgent.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "Coding", "The function of the agent with respect to the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("actor", "Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "The individual, device or organization that participated in the event.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("userId", "Identifier", "The identity of the agent as known by the authorization system.", 0, java.lang.Integer.MAX_VALUE, userId)); - childrenList.add(new Property("relatedAgent", "", "A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of the delegation between agents. For example, this human author used this device, or one person acted on another's behest.", 0, java.lang.Integer.MAX_VALUE, relatedAgent)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Coding - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier - case 126261658: /*relatedAgent*/ return this.relatedAgent == null ? new Base[0] : this.relatedAgent.toArray(new Base[this.relatedAgent.size()]); // ProvenanceAgentRelatedAgentComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3506294: // role - this.role = castToCoding(value); // Coding - break; - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case -836030906: // userId - this.userId = castToIdentifier(value); // Identifier - break; - case 126261658: // relatedAgent - this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); // ProvenanceAgentRelatedAgentComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("role")) - this.role = castToCoding(value); // Coding - else if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("userId")) - this.userId = castToIdentifier(value); // Identifier - else if (name.equals("relatedAgent")) - this.getRelatedAgent().add((ProvenanceAgentRelatedAgentComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3506294: return getRole(); // Coding - case 92645877: return getActor(); // Reference - case -836030906: return getUserId(); // Identifier - case 126261658: return addRelatedAgent(); // ProvenanceAgentRelatedAgentComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("role")) { - this.role = new Coding(); - return this.role; - } - else if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("userId")) { - this.userId = new Identifier(); - return this.userId; - } - else if (name.equals("relatedAgent")) { - return addRelatedAgent(); - } - else - return super.addChild(name); - } - - public ProvenanceAgentComponent copy() { - ProvenanceAgentComponent dst = new ProvenanceAgentComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.actor = actor == null ? null : actor.copy(); - dst.userId = userId == null ? null : userId.copy(); - if (relatedAgent != null) { - dst.relatedAgent = new ArrayList(); - for (ProvenanceAgentRelatedAgentComponent i : relatedAgent) - dst.relatedAgent.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProvenanceAgentComponent)) - return false; - ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; - return compareDeep(role, o.role, true) && compareDeep(actor, o.actor, true) && compareDeep(userId, o.userId, true) - && compareDeep(relatedAgent, o.relatedAgent, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProvenanceAgentComponent)) - return false; - ProvenanceAgentComponent o = (ProvenanceAgentComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (actor == null || actor.isEmpty()) - && (userId == null || userId.isEmpty()) && (relatedAgent == null || relatedAgent.isEmpty()) - ; - } - - public String fhirType() { - return "Provenance.agent"; - - } - - } - - @Block() - public static class ProvenanceAgentRelatedAgentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of relationship between agents. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type of relationship between agents", formalDefinition="The type of relationship between agents." ) - protected CodeableConcept type; - - /** - * An internal reference to another agent listed in this provenance by its identifier. - */ - @Child(name = "target", type = {UriType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference to other agent in this resource by identifier", formalDefinition="An internal reference to another agent listed in this provenance by its identifier." ) - protected UriType target; - - private static final long serialVersionUID = 794181198L; - - /** - * Constructor - */ - public ProvenanceAgentRelatedAgentComponent() { - super(); - } - - /** - * Constructor - */ - public ProvenanceAgentRelatedAgentComponent(CodeableConcept type, UriType target) { - super(); - this.type = type; - this.target = target; - } - - /** - * @return {@link #type} (The type of relationship between agents.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of relationship between agents.) - */ - public ProvenanceAgentRelatedAgentComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value - */ - public UriType getTargetElement() { - if (this.target == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceAgentRelatedAgentComponent.target"); - else if (Configuration.doAutoCreate()) - this.target = new UriType(); // bb - return this.target; - } - - public boolean hasTargetElement() { - return this.target != null && !this.target.isEmpty(); - } - - public boolean hasTarget() { - return this.target != null && !this.target.isEmpty(); - } - - /** - * @param value {@link #target} (An internal reference to another agent listed in this provenance by its identifier.). This is the underlying object with id, value and extensions. The accessor "getTarget" gives direct access to the value - */ - public ProvenanceAgentRelatedAgentComponent setTargetElement(UriType value) { - this.target = value; - return this; - } - - /** - * @return An internal reference to another agent listed in this provenance by its identifier. - */ - public String getTarget() { - return this.target == null ? null : this.target.getValue(); - } - - /** - * @param value An internal reference to another agent listed in this provenance by its identifier. - */ - public ProvenanceAgentRelatedAgentComponent setTarget(String value) { - if (this.target == null) - this.target = new UriType(); - this.target.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "CodeableConcept", "The type of relationship between agents.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("target", "uri", "An internal reference to another agent listed in this provenance by its identifier.", 0, java.lang.Integer.MAX_VALUE, target)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -880905839: /*target*/ return this.target == null ? new Base[0] : new Base[] {this.target}; // UriType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -880905839: // target - this.target = castToUri(value); // UriType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("target")) - this.target = castToUri(value); // UriType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // CodeableConcept - case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // UriType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("target")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.target"); - } - else - return super.addChild(name); - } - - public ProvenanceAgentRelatedAgentComponent copy() { - ProvenanceAgentRelatedAgentComponent dst = new ProvenanceAgentRelatedAgentComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.target = target == null ? null : target.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProvenanceAgentRelatedAgentComponent)) - return false; - ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other; - return compareDeep(type, o.type, true) && compareDeep(target, o.target, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProvenanceAgentRelatedAgentComponent)) - return false; - ProvenanceAgentRelatedAgentComponent o = (ProvenanceAgentRelatedAgentComponent) other; - return compareValues(target, o.target, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - public String fhirType() { - return "Provenance.agent.relatedAgent"; - - } - - } - - @Block() - public static class ProvenanceEntityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * How the entity was used during the activity. - */ - @Child(name = "role", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="derivation | revision | quotation | source | removal", formalDefinition="How the entity was used during the activity." ) - protected Enumeration role; - - /** - * The type of the entity. If the entity is a resource, then this is a resource type. - */ - @Child(name = "type", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The type of resource in this entity", formalDefinition="The type of the entity. If the entity is a resource, then this is a resource type." ) - protected Coding type; - - /** - * Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - */ - @Child(name = "reference", type = {UriType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identity of entity", formalDefinition="Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative." ) - protected UriType reference; - - /** - * Human-readable description of the entity. - */ - @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human description of entity", formalDefinition="Human-readable description of the entity." ) - protected StringType display; - - /** - * 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. - */ - @Child(name = "agent", type = {ProvenanceAgentComponent.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected ProvenanceAgentComponent agent; - - private static final long serialVersionUID = 1533729633L; - - /** - * Constructor - */ - public ProvenanceEntityComponent() { - super(); - } - - /** - * Constructor - */ - public ProvenanceEntityComponent(Enumeration role, Coding type, UriType reference) { - super(); - this.role = role; - this.type = type; - this.reference = reference; - } - - /** - * @return {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public Enumeration getRoleElement() { - if (this.role == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.role"); - else if (Configuration.doAutoCreate()) - this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); // bb - return this.role; - } - - public boolean hasRoleElement() { - return this.role != null && !this.role.isEmpty(); - } - - public boolean hasRole() { - return this.role != null && !this.role.isEmpty(); - } - - /** - * @param value {@link #role} (How the entity was used during the activity.). This is the underlying object with id, value and extensions. The accessor "getRole" gives direct access to the value - */ - public ProvenanceEntityComponent setRoleElement(Enumeration value) { - this.role = value; - return this; - } - - /** - * @return How the entity was used during the activity. - */ - public ProvenanceEntityRole getRole() { - return this.role == null ? null : this.role.getValue(); - } - - /** - * @param value How the entity was used during the activity. - */ - public ProvenanceEntityComponent setRole(ProvenanceEntityRole value) { - if (this.role == null) - this.role = new Enumeration(new ProvenanceEntityRoleEnumFactory()); - this.role.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of the entity. If the entity is a resource, then this is a resource type.) - */ - public ProvenanceEntityComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public UriType getReferenceElement() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new UriType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public ProvenanceEntityComponent setReferenceElement(UriType value) { - this.reference = value; - return this; - } - - /** - * @return Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - */ - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative. - */ - public ProvenanceEntityComponent setReference(String value) { - if (this.reference == null) - this.reference = new UriType(); - this.reference.setValue(value); - return this; - } - - /** - * @return {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Human-readable description of the entity.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ProvenanceEntityComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Human-readable description of the entity. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Human-readable description of the entity. - */ - public ProvenanceEntityComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #agent} (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 ProvenanceAgentComponent getAgent() { - if (this.agent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ProvenanceEntityComponent.agent"); - else if (Configuration.doAutoCreate()) - this.agent = new ProvenanceAgentComponent(); // cc - return this.agent; - } - - public boolean hasAgent() { - return this.agent != null && !this.agent.isEmpty(); - } - - /** - * @param value {@link #agent} (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 ProvenanceEntityComponent setAgent(ProvenanceAgentComponent value) { - this.agent = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("role", "code", "How the entity was used during the activity.", 0, java.lang.Integer.MAX_VALUE, role)); - childrenList.add(new Property("type", "Coding", "The type of the entity. If the entity is a resource, then this is a resource type.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("reference", "uri", "Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Human-readable description of the entity.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("agent", "@Provenance.agent", "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.", 0, java.lang.Integer.MAX_VALUE, agent)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3506294: /*role*/ return this.role == null ? new Base[0] : new Base[] {this.role}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // UriType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - case 92750597: /*agent*/ return this.agent == null ? new Base[0] : new Base[] {this.agent}; // ProvenanceAgentComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3506294: // role - this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -925155509: // reference - this.reference = castToUri(value); // UriType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - case 92750597: // agent - this.agent = (ProvenanceAgentComponent) value; // ProvenanceAgentComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("role")) - this.role = new ProvenanceEntityRoleEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("reference")) - this.reference = castToUri(value); // UriType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else if (name.equals("agent")) - this.agent = (ProvenanceAgentComponent) value; // ProvenanceAgentComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3506294: throw new FHIRException("Cannot make property role as it is not a complex type"); // Enumeration - case 3575610: return getType(); // Coding - case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // UriType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - case 92750597: return getAgent(); // ProvenanceAgentComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("role")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.role"); - } - else if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("reference")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.reference"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.display"); - } - else if (name.equals("agent")) { - this.agent = new ProvenanceAgentComponent(); - return this.agent; - } - else - return super.addChild(name); - } - - public ProvenanceEntityComponent copy() { - ProvenanceEntityComponent dst = new ProvenanceEntityComponent(); - copyValues(dst); - dst.role = role == null ? null : role.copy(); - dst.type = type == null ? null : type.copy(); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - dst.agent = agent == null ? null : agent.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ProvenanceEntityComponent)) - return false; - ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; - return compareDeep(role, o.role, true) && compareDeep(type, o.type, true) && compareDeep(reference, o.reference, true) - && compareDeep(display, o.display, true) && compareDeep(agent, o.agent, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ProvenanceEntityComponent)) - return false; - ProvenanceEntityComponent o = (ProvenanceEntityComponent) other; - return compareValues(role, o.role, true) && compareValues(reference, o.reference, true) && compareValues(display, o.display, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (role == null || role.isEmpty()) && (type == null || type.isEmpty()) - && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) && (agent == null || agent.isEmpty()) - ; - } - - public String fhirType() { - return "Provenance.entity"; - - } - - } - - /** - * The Reference(s) that were generated or updated 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. - */ - @Child(name = "target", type = {}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Target Reference(s) (usually version specific)", formalDefinition="The Reference(s) that were generated or updated 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." ) - protected List target; - /** - * The actual objects that are the target of the reference (The Reference(s) that were generated or updated 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.) - */ - protected List targetTarget; - - - /** - * The period during which the activity occurred. - */ - @Child(name = "period", type = {Period.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." ) - protected Period period; - - /** - * The instant of time at which the activity was recorded. - */ - @Child(name = "recorded", type = {InstantType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the activity was recorded / updated", formalDefinition="The instant of time at which the activity was recorded." ) - protected InstantType recorded; - - /** - * The reason that the activity was taking place. - */ - @Child(name = "reason", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reason the activity is occurring", formalDefinition="The reason that the activity was taking place." ) - protected List reason; - - /** - * An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities. - */ - @Child(name = "activity", type = {Coding.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Activity that occurred", formalDefinition="An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities." ) - protected Coding activity; - - /** - * Where the activity occurred, if relevant. - */ - @Child(name = "location", type = {Location.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where the activity occurred, if relevant", formalDefinition="Where the activity occurred, if relevant." ) - protected Reference location; - - /** - * The actual object that is the target of the reference (Where the activity occurred, if relevant.) - */ - protected Location locationTarget; - - /** - * 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. - */ - @Child(name = "policy", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List policy; - - /** - * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place. - */ - @Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Actor involved", formalDefinition="An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place." ) - protected List agent; - - /** - * An entity used in this activity. - */ - @Child(name = "entity", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="An entity used in this activity", formalDefinition="An entity used in this activity." ) - protected List entity; - - /** - * A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated. - */ - @Child(name = "signature", type = {Signature.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Signature on target", formalDefinition="A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated." ) - protected List signature; - - private static final long serialVersionUID = -436783145L; - - /** - * Constructor - */ - public Provenance() { - super(); - } - - /** - * Constructor - */ - public Provenance(InstantType recorded) { - super(); - this.recorded = recorded; - } - - /** - * @return {@link #target} (The Reference(s) that were generated or updated 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 List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (Reference item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (The Reference(s) that were generated or updated 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.) - */ - // syntactic sugar - public Reference addTarget() { //3 - Reference t = new Reference(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - // syntactic sugar - public Provenance addTarget(Reference t) { //3 - if (t == null) - return this; - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @return {@link #target} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The Reference(s) that were generated or updated 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 List getTargetTarget() { - if (this.targetTarget == null) - this.targetTarget = new ArrayList(); - return this.targetTarget; - } - - /** - * @return {@link #period} (The period during which the activity occurred.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period during which the activity occurred.) - */ - public Provenance setPeriod(Period value) { - this.period = value; - return this; - } - - /** - * @return {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public InstantType getRecordedElement() { - if (this.recorded == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.recorded"); - else if (Configuration.doAutoCreate()) - this.recorded = new InstantType(); // bb - return this.recorded; - } - - public boolean hasRecordedElement() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - public boolean hasRecorded() { - return this.recorded != null && !this.recorded.isEmpty(); - } - - /** - * @param value {@link #recorded} (The instant of time at which the activity was recorded.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value - */ - public Provenance setRecordedElement(InstantType value) { - this.recorded = value; - return this; - } - - /** - * @return The instant of time at which the activity was recorded. - */ - public Date getRecorded() { - return this.recorded == null ? null : this.recorded.getValue(); - } - - /** - * @param value The instant of time at which the activity was recorded. - */ - public Provenance setRecorded(Date value) { - if (this.recorded == null) - this.recorded = new InstantType(); - this.recorded.setValue(value); - return this; - } - - /** - * @return {@link #reason} (The reason that the activity was taking place.) - */ - public List getReason() { - if (this.reason == null) - this.reason = new ArrayList(); - return this.reason; - } - - public boolean hasReason() { - if (this.reason == null) - return false; - for (Coding item : this.reason) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #reason} (The reason that the activity was taking place.) - */ - // syntactic sugar - public Coding addReason() { //3 - Coding t = new Coding(); - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return t; - } - - // syntactic sugar - public Provenance addReason(Coding t) { //3 - if (t == null) - return this; - if (this.reason == null) - this.reason = new ArrayList(); - this.reason.add(t); - return this; - } - - /** - * @return {@link #activity} (An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.) - */ - public Coding getActivity() { - if (this.activity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.activity"); - else if (Configuration.doAutoCreate()) - this.activity = new Coding(); // cc - return this.activity; - } - - public boolean hasActivity() { - return this.activity != null && !this.activity.isEmpty(); - } - - /** - * @param value {@link #activity} (An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.) - */ - public Provenance setActivity(Coding value) { - this.activity = value; - return this; - } - - /** - * @return {@link #location} (Where the activity occurred, if relevant.) - */ - public Reference getLocation() { - if (this.location == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.location"); - else if (Configuration.doAutoCreate()) - this.location = new Reference(); // cc - return this.location; - } - - public boolean hasLocation() { - return this.location != null && !this.location.isEmpty(); - } - - /** - * @param value {@link #location} (Where the activity occurred, if relevant.) - */ - public Provenance setLocation(Reference value) { - this.location = value; - return this; - } - - /** - * @return {@link #location} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.) - */ - public Location getLocationTarget() { - if (this.locationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Provenance.location"); - else if (Configuration.doAutoCreate()) - this.locationTarget = new Location(); // aa - return this.locationTarget; - } - - /** - * @param value {@link #location} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the activity occurred, if relevant.) - */ - public Provenance setLocationTarget(Location value) { - this.locationTarget = value; - return this; - } - - /** - * @return {@link #policy} (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 List getPolicy() { - if (this.policy == null) - this.policy = new ArrayList(); - return this.policy; - } - - public boolean hasPolicy() { - if (this.policy == null) - return false; - for (UriType item : this.policy) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #policy} (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.) - */ - // syntactic sugar - public UriType addPolicyElement() {//2 - UriType t = new UriType(); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return t; - } - - /** - * @param value {@link #policy} (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 addPolicy(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.policy == null) - this.policy = new ArrayList(); - this.policy.add(t); - return this; - } - - /** - * @param value {@link #policy} (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 boolean hasPolicy(String value) { - if (this.policy == null) - return false; - for (UriType v : this.policy) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) - */ - public List getAgent() { - if (this.agent == null) - this.agent = new ArrayList(); - return this.agent; - } - - public boolean hasAgent() { - if (this.agent == null) - return false; - for (ProvenanceAgentComponent item : this.agent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #agent} (An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.) - */ - // syntactic sugar - public ProvenanceAgentComponent addAgent() { //3 - ProvenanceAgentComponent t = new ProvenanceAgentComponent(); - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return t; - } - - // syntactic sugar - public Provenance addAgent(ProvenanceAgentComponent t) { //3 - if (t == null) - return this; - if (this.agent == null) - this.agent = new ArrayList(); - this.agent.add(t); - return this; - } - - /** - * @return {@link #entity} (An entity used in this activity.) - */ - public List getEntity() { - if (this.entity == null) - this.entity = new ArrayList(); - return this.entity; - } - - public boolean hasEntity() { - if (this.entity == null) - return false; - for (ProvenanceEntityComponent item : this.entity) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #entity} (An entity used in this activity.) - */ - // syntactic sugar - public ProvenanceEntityComponent addEntity() { //3 - ProvenanceEntityComponent t = new ProvenanceEntityComponent(); - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return t; - } - - // syntactic sugar - public Provenance addEntity(ProvenanceEntityComponent t) { //3 - if (t == null) - return this; - if (this.entity == null) - this.entity = new ArrayList(); - this.entity.add(t); - return this; - } - - /** - * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) - */ - public List getSignature() { - if (this.signature == null) - this.signature = new ArrayList(); - return this.signature; - } - - public boolean hasSignature() { - if (this.signature == null) - return false; - for (Signature item : this.signature) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #signature} (A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.) - */ - // syntactic sugar - public Signature addSignature() { //3 - Signature t = new Signature(); - if (this.signature == null) - this.signature = new ArrayList(); - this.signature.add(t); - return t; - } - - // syntactic sugar - public Provenance addSignature(Signature t) { //3 - if (t == null) - return this; - if (this.signature == null) - this.signature = new ArrayList(); - this.signature.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("target", "Reference(Any)", "The Reference(s) that were generated or updated 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.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("period", "Period", "The period during which the activity occurred.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("recorded", "instant", "The instant of time at which the activity was recorded.", 0, java.lang.Integer.MAX_VALUE, recorded)); - childrenList.add(new Property("reason", "Coding", "The reason that the activity was taking place.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("activity", "Coding", "An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.", 0, java.lang.Integer.MAX_VALUE, activity)); - childrenList.add(new Property("location", "Reference(Location)", "Where the activity occurred, if relevant.", 0, java.lang.Integer.MAX_VALUE, location)); - childrenList.add(new Property("policy", "uri", "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.", 0, java.lang.Integer.MAX_VALUE, policy)); - childrenList.add(new Property("agent", "", "An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.", 0, java.lang.Integer.MAX_VALUE, agent)); - childrenList.add(new Property("entity", "", "An entity used in this activity.", 0, java.lang.Integer.MAX_VALUE, entity)); - childrenList.add(new Property("signature", "Signature", "A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.", 0, java.lang.Integer.MAX_VALUE, signature)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // Reference - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : this.reason.toArray(new Base[this.reason.size()]); // Coding - case -1655966961: /*activity*/ return this.activity == null ? new Base[0] : new Base[] {this.activity}; // Coding - case 1901043637: /*location*/ return this.location == null ? new Base[0] : new Base[] {this.location}; // Reference - case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // UriType - case 92750597: /*agent*/ return this.agent == null ? new Base[0] : this.agent.toArray(new Base[this.agent.size()]); // ProvenanceAgentComponent - case -1298275357: /*entity*/ return this.entity == null ? new Base[0] : this.entity.toArray(new Base[this.entity.size()]); // ProvenanceEntityComponent - case 1073584312: /*signature*/ return this.signature == null ? new Base[0] : this.signature.toArray(new Base[this.signature.size()]); // Signature - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -880905839: // target - this.getTarget().add(castToReference(value)); // Reference - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - case -799233872: // recorded - this.recorded = castToInstant(value); // InstantType - break; - case -934964668: // reason - this.getReason().add(castToCoding(value)); // Coding - break; - case -1655966961: // activity - this.activity = castToCoding(value); // Coding - break; - case 1901043637: // location - this.location = castToReference(value); // Reference - break; - case -982670030: // policy - this.getPolicy().add(castToUri(value)); // UriType - break; - case 92750597: // agent - this.getAgent().add((ProvenanceAgentComponent) value); // ProvenanceAgentComponent - break; - case -1298275357: // entity - this.getEntity().add((ProvenanceEntityComponent) value); // ProvenanceEntityComponent - break; - case 1073584312: // signature - this.getSignature().add(castToSignature(value)); // Signature - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("target")) - this.getTarget().add(castToReference(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else if (name.equals("recorded")) - this.recorded = castToInstant(value); // InstantType - else if (name.equals("reason")) - this.getReason().add(castToCoding(value)); - else if (name.equals("activity")) - this.activity = castToCoding(value); // Coding - else if (name.equals("location")) - this.location = castToReference(value); // Reference - else if (name.equals("policy")) - this.getPolicy().add(castToUri(value)); - else if (name.equals("agent")) - this.getAgent().add((ProvenanceAgentComponent) value); - else if (name.equals("entity")) - this.getEntity().add((ProvenanceEntityComponent) value); - else if (name.equals("signature")) - this.getSignature().add(castToSignature(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -880905839: return addTarget(); // Reference - case -991726143: return getPeriod(); // Period - case -799233872: throw new FHIRException("Cannot make property recorded as it is not a complex type"); // InstantType - case -934964668: return addReason(); // Coding - case -1655966961: return getActivity(); // Coding - case 1901043637: return getLocation(); // Reference - case -982670030: throw new FHIRException("Cannot make property policy as it is not a complex type"); // UriType - case 92750597: return addAgent(); // ProvenanceAgentComponent - case -1298275357: return addEntity(); // ProvenanceEntityComponent - case 1073584312: return addSignature(); // Signature - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("target")) { - return addTarget(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else if (name.equals("recorded")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.recorded"); - } - else if (name.equals("reason")) { - return addReason(); - } - else if (name.equals("activity")) { - this.activity = new Coding(); - return this.activity; - } - else if (name.equals("location")) { - this.location = new Reference(); - return this.location; - } - else if (name.equals("policy")) { - throw new FHIRException("Cannot call addChild on a primitive type Provenance.policy"); - } - else if (name.equals("agent")) { - return addAgent(); - } - else if (name.equals("entity")) { - return addEntity(); - } - else if (name.equals("signature")) { - return addSignature(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Provenance"; - - } - - public Provenance copy() { - Provenance dst = new Provenance(); - copyValues(dst); - if (target != null) { - dst.target = new ArrayList(); - for (Reference i : target) - dst.target.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - dst.recorded = recorded == null ? null : recorded.copy(); - if (reason != null) { - dst.reason = new ArrayList(); - for (Coding i : reason) - dst.reason.add(i.copy()); - }; - dst.activity = activity == null ? null : activity.copy(); - dst.location = location == null ? null : location.copy(); - if (policy != null) { - dst.policy = new ArrayList(); - for (UriType i : policy) - dst.policy.add(i.copy()); - }; - if (agent != null) { - dst.agent = new ArrayList(); - for (ProvenanceAgentComponent i : agent) - dst.agent.add(i.copy()); - }; - if (entity != null) { - dst.entity = new ArrayList(); - for (ProvenanceEntityComponent i : entity) - dst.entity.add(i.copy()); - }; - if (signature != null) { - dst.signature = new ArrayList(); - for (Signature i : signature) - dst.signature.add(i.copy()); - }; - return dst; - } - - protected Provenance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Provenance)) - return false; - Provenance o = (Provenance) other; - return compareDeep(target, o.target, true) && compareDeep(period, o.period, true) && compareDeep(recorded, o.recorded, true) - && compareDeep(reason, o.reason, true) && compareDeep(activity, o.activity, true) && compareDeep(location, o.location, true) - && compareDeep(policy, o.policy, true) && compareDeep(agent, o.agent, true) && compareDeep(entity, o.entity, true) - && compareDeep(signature, o.signature, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Provenance)) - return false; - Provenance o = (Provenance) other; - return compareValues(recorded, o.recorded, true) && compareValues(policy, o.policy, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (target == null || target.isEmpty()) && (period == null || period.isEmpty()) - && (recorded == null || recorded.isEmpty()) && (reason == null || reason.isEmpty()) && (activity == null || activity.isEmpty()) - && (location == null || location.isEmpty()) && (policy == null || policy.isEmpty()) && (agent == null || agent.isEmpty()) - && (entity == null || entity.isEmpty()) && (signature == null || signature.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Provenance; - } - - /** - * Search parameter: patient - *

- * Description: Target Reference(s) (usually version specific)
- * Type: reference
- * Path: Provenance.target
- *

- */ - @SearchParamDefinition(name="patient", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Target Reference(s) (usually version specific)
- * Type: reference
- * Path: Provenance.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Provenance:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Provenance:patient").toLocked(); - - /** - * Search parameter: location - *

- * Description: Where the activity occurred, if relevant
- * Type: reference
- * Path: Provenance.location
- *

- */ - @SearchParamDefinition(name="location", path="Provenance.location", description="Where the activity occurred, if relevant", type="reference" ) - public static final String SP_LOCATION = "location"; - /** - * Fluent Client search parameter constant for location - *

- * Description: Where the activity occurred, if relevant
- * Type: reference
- * Path: Provenance.location
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam LOCATION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_LOCATION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Provenance:location". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_LOCATION = new ca.uhn.fhir.model.api.Include("Provenance:location").toLocked(); - - /** - * Search parameter: start - *

- * Description: Starting time with inclusive boundary
- * Type: date
- * Path: Provenance.period.start
- *

- */ - @SearchParamDefinition(name="start", path="Provenance.period.start", description="Starting time with inclusive boundary", type="date" ) - public static final String SP_START = "start"; - /** - * Fluent Client search parameter constant for start - *

- * Description: Starting time with inclusive boundary
- * Type: date
- * Path: Provenance.period.start
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam START = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_START); - - /** - * Search parameter: entity - *

- * Description: Identity of entity
- * Type: uri
- * Path: Provenance.entity.reference
- *

- */ - @SearchParamDefinition(name="entity", path="Provenance.entity.reference", description="Identity of entity", type="uri" ) - public static final String SP_ENTITY = "entity"; - /** - * Fluent Client search parameter constant for entity - *

- * Description: Identity of entity
- * Type: uri
- * Path: Provenance.entity.reference
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam ENTITY = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_ENTITY); - - /** - * Search parameter: userid - *

- * Description: Authorization-system identifier for the agent
- * Type: token
- * Path: Provenance.agent.userId
- *

- */ - @SearchParamDefinition(name="userid", path="Provenance.agent.userId", description="Authorization-system identifier for the agent", type="token" ) - public static final String SP_USERID = "userid"; - /** - * Fluent Client search parameter constant for userid - *

- * Description: Authorization-system identifier for the agent
- * Type: token
- * Path: Provenance.agent.userId
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam USERID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_USERID); - - /** - * Search parameter: target - *

- * Description: Target Reference(s) (usually version specific)
- * Type: reference
- * Path: Provenance.target
- *

- */ - @SearchParamDefinition(name="target", path="Provenance.target", description="Target Reference(s) (usually version specific)", type="reference" ) - public static final String SP_TARGET = "target"; - /** - * Fluent Client search parameter constant for target - *

- * Description: Target Reference(s) (usually version specific)
- * Type: reference
- * Path: Provenance.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam TARGET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_TARGET); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Provenance:target". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_TARGET = new ca.uhn.fhir.model.api.Include("Provenance:target").toLocked(); - - /** - * Search parameter: entity-type - *

- * Description: The type of resource in this entity
- * Type: token
- * Path: Provenance.entity.type
- *

- */ - @SearchParamDefinition(name="entity-type", path="Provenance.entity.type", description="The type of resource in this entity", type="token" ) - public static final String SP_ENTITY_TYPE = "entity-type"; - /** - * Fluent Client search parameter constant for entity-type - *

- * Description: The type of resource in this entity
- * Type: token
- * Path: Provenance.entity.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ENTITY_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ENTITY_TYPE); - - /** - * Search parameter: agent - *

- * Description: Individual, device or organization playing role
- * Type: reference
- * Path: Provenance.agent.actor
- *

- */ - @SearchParamDefinition(name="agent", path="Provenance.agent.actor", description="Individual, device or organization playing role", type="reference" ) - public static final String SP_AGENT = "agent"; - /** - * Fluent Client search parameter constant for agent - *

- * Description: Individual, device or organization playing role
- * Type: reference
- * Path: Provenance.agent.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AGENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AGENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Provenance:agent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AGENT = new ca.uhn.fhir.model.api.Include("Provenance:agent").toLocked(); - - /** - * Search parameter: end - *

- * Description: End time with inclusive boundary, if not ongoing
- * Type: date
- * Path: Provenance.period.end
- *

- */ - @SearchParamDefinition(name="end", path="Provenance.period.end", description="End time with inclusive boundary, if not ongoing", type="date" ) - public static final String SP_END = "end"; - /** - * Fluent Client search parameter constant for end - *

- * Description: End time with inclusive boundary, if not ongoing
- * Type: date
- * Path: Provenance.period.end
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam END = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_END); - - /** - * Search parameter: sig - *

- * Description: Indication of the reason the entity signed the object(s)
- * Type: token
- * Path: Provenance.signature.type
- *

- */ - @SearchParamDefinition(name="sig", path="Provenance.signature.type", description="Indication of the reason the entity signed the object(s)", type="token" ) - public static final String SP_SIG = "sig"; - /** - * Fluent Client search parameter constant for sig - *

- * Description: Indication of the reason the entity signed the object(s)
- * Type: token
- * Path: Provenance.signature.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SIG = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SIG); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Quantity.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Quantity.java deleted file mode 100644 index d55a8c3e2b8..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Quantity.java +++ /dev/null @@ -1,672 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="Quantity") -public class Quantity extends Type implements ICompositeType { - - public enum QuantityComparator { - /** - * The actual value is less than the given value. - */ - LESS_THAN, - /** - * The actual value is less than or equal to the given value. - */ - LESS_OR_EQUAL, - /** - * The actual value is greater than or equal to the given value. - */ - GREATER_OR_EQUAL, - /** - * The actual value is greater than the given value. - */ - GREATER_THAN, - /** - * added to help the parsers - */ - NULL; - public static QuantityComparator fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return LESS_THAN; - if ("<=".equals(codeString)) - return LESS_OR_EQUAL; - if (">=".equals(codeString)) - return GREATER_OR_EQUAL; - if (">".equals(codeString)) - return GREATER_THAN; - throw new FHIRException("Unknown QuantityComparator code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LESS_THAN: return "<"; - case LESS_OR_EQUAL: return "<="; - case GREATER_OR_EQUAL: return ">="; - case GREATER_THAN: return ">"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LESS_THAN: return "http://hl7.org/fhir/quantity-comparator"; - case LESS_OR_EQUAL: return "http://hl7.org/fhir/quantity-comparator"; - case GREATER_OR_EQUAL: return "http://hl7.org/fhir/quantity-comparator"; - case GREATER_THAN: return "http://hl7.org/fhir/quantity-comparator"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LESS_THAN: return "The actual value is less than the given value."; - case LESS_OR_EQUAL: return "The actual value is less than or equal to the given value."; - case GREATER_OR_EQUAL: return "The actual value is greater than or equal to the given value."; - case GREATER_THAN: return "The actual value is greater than the given value."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LESS_THAN: return "Less than"; - case LESS_OR_EQUAL: return "Less or Equal to"; - case GREATER_OR_EQUAL: return "Greater or Equal to"; - case GREATER_THAN: return "Greater than"; - default: return "?"; - } - } - } - - public static class QuantityComparatorEnumFactory implements EnumFactory { - public QuantityComparator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return QuantityComparator.LESS_THAN; - if ("<=".equals(codeString)) - return QuantityComparator.LESS_OR_EQUAL; - if (">=".equals(codeString)) - return QuantityComparator.GREATER_OR_EQUAL; - if (">".equals(codeString)) - return QuantityComparator.GREATER_THAN; - throw new IllegalArgumentException("Unknown QuantityComparator code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("<".equals(codeString)) - return new Enumeration(this, QuantityComparator.LESS_THAN); - if ("<=".equals(codeString)) - return new Enumeration(this, QuantityComparator.LESS_OR_EQUAL); - if (">=".equals(codeString)) - return new Enumeration(this, QuantityComparator.GREATER_OR_EQUAL); - if (">".equals(codeString)) - return new Enumeration(this, QuantityComparator.GREATER_THAN); - throw new FHIRException("Unknown QuantityComparator code '"+codeString+"'"); - } - public String toCode(QuantityComparator code) { - if (code == QuantityComparator.LESS_THAN) - return "<"; - if (code == QuantityComparator.LESS_OR_EQUAL) - return "<="; - if (code == QuantityComparator.GREATER_OR_EQUAL) - return ">="; - if (code == QuantityComparator.GREATER_THAN) - return ">"; - return "?"; - } - public String toSystem(QuantityComparator code) { - return code.getSystem(); - } - } - - /** - * The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - @Child(name = "value", type = {DecimalType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @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." ) - protected DecimalType value; - - /** - * 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. - */ - @Child(name = "comparator", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @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." ) - protected Enumeration comparator; - - /** - * A human-readable form of the unit. - */ - @Child(name = "unit", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unit representation", formalDefinition="A human-readable form of the unit." ) - protected StringType unit; - - /** - * The identification of the system that provides the coded form of the unit. - */ - @Child(name = "system", type = {UriType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="System that defines coded unit form", formalDefinition="The identification of the system that provides the coded form of the unit." ) - protected UriType system; - - /** - * A computer processable form of the unit in some unit representation system. - */ - @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Coded form of the unit", formalDefinition="A computer processable form of the unit in some unit representation system." ) - protected CodeType code; - - private static final long serialVersionUID = 1069574054L; - - /** - * Constructor - */ - public Quantity() { - super(); - } - - /** - * Convenience constructor - * - * @param theValue The {@link #setValue(double) value} - */ - public Quantity(double theValue) { - setValue(theValue); - } - - /** - * Convenience constructor - * - * @param theValue The {@link #setValue(long) value} - */ - public Quantity(long theValue) { - setValue(theValue); - } - - /** - * Convenience constructor - * - * @param theComparator The {@link #setComparator(QuantityComparator) comparator} - * @param theValue The {@link #setValue(BigDecimal) value} - * @param theSystem The {@link #setSystem(String)} (the code system for the units} - * @param theCode The {@link #setCode(String)} (the code for the units} - * @param theUnit The {@link #setUnit(String)} (the human readable display name for the units} - */ - public Quantity(QuantityComparator theComparator, double theValue, String theSystem, String theCode, String theUnit) { - setValue(theValue); - setComparator(theComparator); - setSystem(theSystem); - setCode(theCode); - setUnit(theUnit); - } - - /** - * Convenience constructor - * - * @param theComparator The {@link #setComparator(QuantityComparator) comparator} - * @param theValue The {@link #setValue(BigDecimal) value} - * @param theSystem The {@link #setSystem(String)} (the code system for the units} - * @param theCode The {@link #setCode(String)} (the code for the units} - * @param theUnit The {@link #setUnit(String)} (the human readable display name for the units} - */ - public Quantity(QuantityComparator theComparator, long theValue, String theSystem, String theCode, String theUnit) { - setValue(theValue); - setComparator(theComparator); - setSystem(theSystem); - setCode(theCode); - setUnit(theUnit); - } - /** - * @return {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public DecimalType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.value"); - else if (Configuration.doAutoCreate()) - this.value = new DecimalType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public Quantity setValueElement(DecimalType value) { - this.value = value; - return this; - } - - /** - * @return The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public BigDecimal getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public Quantity setValue(BigDecimal value) { - if (value == null) - this.value = null; - else { - if (this.value == null) - this.value = new DecimalType(); - this.value.setValue(value); - } - return this; - } - - /** - * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public Quantity setValue(long value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @param value The value of the measured amount. The value includes an implicit precision in the presentation of the value. - */ - public Quantity setValue(double value) { - this.value = new DecimalType(); - this.value.setValue(value); - return this; - } - - /** - * @return {@link #comparator} (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.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value - */ - public Enumeration getComparatorElement() { - if (this.comparator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.comparator"); - else if (Configuration.doAutoCreate()) - this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); // bb - return this.comparator; - } - - public boolean hasComparatorElement() { - return this.comparator != null && !this.comparator.isEmpty(); - } - - public boolean hasComparator() { - return this.comparator != null && !this.comparator.isEmpty(); - } - - /** - * @param value {@link #comparator} (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.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value - */ - public Quantity setComparatorElement(Enumeration value) { - this.comparator = value; - return this; - } - - /** - * @return 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 QuantityComparator getComparator() { - return this.comparator == null ? null : this.comparator.getValue(); - } - - /** - * @param value 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 Quantity setComparator(QuantityComparator value) { - if (value == null) - this.comparator = null; - else { - if (this.comparator == null) - this.comparator = new Enumeration(new QuantityComparatorEnumFactory()); - this.comparator.setValue(value); - } - return this; - } - - /** - * @return {@link #unit} (A human-readable form of the unit.). This is the underlying object with id, value and extensions. The accessor "getUnit" gives direct access to the value - */ - public StringType getUnitElement() { - if (this.unit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.unit"); - else if (Configuration.doAutoCreate()) - this.unit = new StringType(); // bb - return this.unit; - } - - public boolean hasUnitElement() { - return this.unit != null && !this.unit.isEmpty(); - } - - public boolean hasUnit() { - return this.unit != null && !this.unit.isEmpty(); - } - - /** - * @param value {@link #unit} (A human-readable form of the unit.). This is the underlying object with id, value and extensions. The accessor "getUnit" gives direct access to the value - */ - public Quantity setUnitElement(StringType value) { - this.unit = value; - return this; - } - - /** - * @return A human-readable form of the unit. - */ - public String getUnit() { - return this.unit == null ? null : this.unit.getValue(); - } - - /** - * @param value A human-readable form of the unit. - */ - public Quantity setUnit(String value) { - if (Utilities.noString(value)) - this.unit = null; - else { - if (this.unit == null) - this.unit = new StringType(); - this.unit.setValue(value); - } - return this; - } - - /** - * @return {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public Quantity setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return The identification of the system that provides the coded form of the unit. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value The identification of the system that provides the coded form of the unit. - */ - public Quantity setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A computer processable form of the unit in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Quantity.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A computer processable form of the unit in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public Quantity setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return A computer processable form of the unit in some unit representation system. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value A computer processable form of the unit in some unit representation system. - */ - public Quantity setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value", "decimal", "The value of the measured amount. The value includes an implicit precision in the presentation of the value.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("comparator", "code", "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.", 0, java.lang.Integer.MAX_VALUE, comparator)); - childrenList.add(new Property("unit", "string", "A human-readable form of the unit.", 0, java.lang.Integer.MAX_VALUE, unit)); - childrenList.add(new Property("system", "uri", "The identification of the system that provides the coded form of the unit.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("code", "code", "A computer processable form of the unit in some unit representation system.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // DecimalType - case -844673834: /*comparator*/ return this.comparator == null ? new Base[0] : new Base[] {this.comparator}; // Enumeration - case 3594628: /*unit*/ return this.unit == null ? new Base[0] : new Base[] {this.unit}; // StringType - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 111972721: // value - this.value = castToDecimal(value); // DecimalType - break; - case -844673834: // comparator - this.comparator = new QuantityComparatorEnumFactory().fromType(value); // Enumeration - break; - case 3594628: // unit - this.unit = castToString(value); // StringType - break; - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("value")) - this.value = castToDecimal(value); // DecimalType - else if (name.equals("comparator")) - this.comparator = new QuantityComparatorEnumFactory().fromType(value); // Enumeration - else if (name.equals("unit")) - this.unit = castToString(value); // StringType - else if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // DecimalType - case -844673834: throw new FHIRException("Cannot make property comparator as it is not a complex type"); // Enumeration - case 3594628: throw new FHIRException("Cannot make property unit as it is not a complex type"); // StringType - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type Quantity.value"); - } - else if (name.equals("comparator")) { - throw new FHIRException("Cannot call addChild on a primitive type Quantity.comparator"); - } - else if (name.equals("unit")) { - throw new FHIRException("Cannot call addChild on a primitive type Quantity.unit"); - } - else if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type Quantity.system"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type Quantity.code"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Quantity"; - - } - - public Quantity copy() { - Quantity dst = new Quantity(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Quantity typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Quantity)) - return false; - Quantity o = (Quantity) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Quantity)) - return false; - Quantity o = (Quantity) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Questionnaire.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Questionnaire.java deleted file mode 100644 index e8e3e81ea6a..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Questionnaire.java +++ /dev/null @@ -1,3473 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ -@ResourceDef(name="Questionnaire", profile="http://hl7.org/fhir/Profile/Questionnaire") -public class Questionnaire extends DomainResource { - - public enum QuestionnaireStatus { - /** - * This Questionnaire is not ready for official use. - */ - DRAFT, - /** - * This Questionnaire is ready for use. - */ - PUBLISHED, - /** - * This Questionnaire should no longer be used to gather data. - */ - RETIRED, - /** - * added to help the parsers - */ - NULL; - public static QuestionnaireStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("published".equals(codeString)) - return PUBLISHED; - if ("retired".equals(codeString)) - return RETIRED; - throw new FHIRException("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case PUBLISHED: return "published"; - case RETIRED: return "retired"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return "http://hl7.org/fhir/questionnaire-status"; - case PUBLISHED: return "http://hl7.org/fhir/questionnaire-status"; - case RETIRED: return "http://hl7.org/fhir/questionnaire-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "This Questionnaire is not ready for official use."; - case PUBLISHED: return "This Questionnaire is ready for use."; - case RETIRED: return "This Questionnaire should no longer be used to gather data."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case PUBLISHED: return "Published"; - case RETIRED: return "Retired"; - default: return "?"; - } - } - } - - public static class QuestionnaireStatusEnumFactory implements EnumFactory { - public QuestionnaireStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return QuestionnaireStatus.DRAFT; - if ("published".equals(codeString)) - return QuestionnaireStatus.PUBLISHED; - if ("retired".equals(codeString)) - return QuestionnaireStatus.RETIRED; - throw new IllegalArgumentException("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return new Enumeration(this, QuestionnaireStatus.DRAFT); - if ("published".equals(codeString)) - return new Enumeration(this, QuestionnaireStatus.PUBLISHED); - if ("retired".equals(codeString)) - return new Enumeration(this, QuestionnaireStatus.RETIRED); - throw new FHIRException("Unknown QuestionnaireStatus code '"+codeString+"'"); - } - public String toCode(QuestionnaireStatus code) { - if (code == QuestionnaireStatus.DRAFT) - return "draft"; - if (code == QuestionnaireStatus.PUBLISHED) - return "published"; - if (code == QuestionnaireStatus.RETIRED) - return "retired"; - return "?"; - } - public String toSystem(QuestionnaireStatus code) { - return code.getSystem(); - } - } - - public enum QuestionnaireItemType { - /** - * An item with no direct answer but which has descendant items that are questions - */ - GROUP, - /** - * Text for display that will not capture an answer or have descendants - */ - DISPLAY, - /** - * An item that defines a specific answer to be captured (and may have descendant items) - */ - QUESTION, - /** - * Question with a yes/no answer - */ - BOOLEAN, - /** - * Question with is a real number answer - */ - DECIMAL, - /** - * Question with an integer answer - */ - INTEGER, - /** - * Question with adate answer - */ - DATE, - /** - * Question with a date and time answer - */ - DATETIME, - /** - * Question with a system timestamp answer - */ - INSTANT, - /** - * Question with a time (hour/minute/second) answer independent of date. - */ - TIME, - /** - * Question with a short (few words to short sentence) free-text entry answer - */ - STRING, - /** - * Question with a long (potentially multi-paragraph) free-text entry (still captured as a string) answer - */ - TEXT, - /** - * Question with a url (website, FTP site, etc.) answer - */ - URL, - /** - * Question with a Coding drawn from a list of options as an answer - */ - CHOICE, - /** - * Answer is a Coding drawn from a list of options or a free-text entry captured as Coding.display - */ - OPENCHOICE, - /** - * Question with binary content such as a image, PDF, etc. as an answer - */ - ATTACHMENT, - /** - * Question with a reference to another resource (practitioner, organization, etc.) as an answer - */ - REFERENCE, - /** - * Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer. - */ - QUANTITY, - /** - * added to help the parsers - */ - NULL; - public static QuestionnaireItemType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("group".equals(codeString)) - return GROUP; - if ("display".equals(codeString)) - return DISPLAY; - if ("question".equals(codeString)) - return QUESTION; - if ("boolean".equals(codeString)) - return BOOLEAN; - if ("decimal".equals(codeString)) - return DECIMAL; - if ("integer".equals(codeString)) - return INTEGER; - if ("date".equals(codeString)) - return DATE; - if ("dateTime".equals(codeString)) - return DATETIME; - if ("instant".equals(codeString)) - return INSTANT; - if ("time".equals(codeString)) - return TIME; - if ("string".equals(codeString)) - return STRING; - if ("text".equals(codeString)) - return TEXT; - if ("url".equals(codeString)) - return URL; - if ("choice".equals(codeString)) - return CHOICE; - if ("open-choice".equals(codeString)) - return OPENCHOICE; - if ("attachment".equals(codeString)) - return ATTACHMENT; - if ("reference".equals(codeString)) - return REFERENCE; - if ("quantity".equals(codeString)) - return QUANTITY; - throw new FHIRException("Unknown QuestionnaireItemType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case GROUP: return "group"; - case DISPLAY: return "display"; - case QUESTION: return "question"; - case BOOLEAN: return "boolean"; - case DECIMAL: return "decimal"; - case INTEGER: return "integer"; - case DATE: return "date"; - case DATETIME: return "dateTime"; - case INSTANT: return "instant"; - case TIME: return "time"; - case STRING: return "string"; - case TEXT: return "text"; - case URL: return "url"; - case CHOICE: return "choice"; - case OPENCHOICE: return "open-choice"; - case ATTACHMENT: return "attachment"; - case REFERENCE: return "reference"; - case QUANTITY: return "quantity"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case GROUP: return "http://hl7.org/fhir/item-type"; - case DISPLAY: return "http://hl7.org/fhir/item-type"; - case QUESTION: return "http://hl7.org/fhir/item-type"; - case BOOLEAN: return "http://hl7.org/fhir/item-type"; - case DECIMAL: return "http://hl7.org/fhir/item-type"; - case INTEGER: return "http://hl7.org/fhir/item-type"; - case DATE: return "http://hl7.org/fhir/item-type"; - case DATETIME: return "http://hl7.org/fhir/item-type"; - case INSTANT: return "http://hl7.org/fhir/item-type"; - case TIME: return "http://hl7.org/fhir/item-type"; - case STRING: return "http://hl7.org/fhir/item-type"; - case TEXT: return "http://hl7.org/fhir/item-type"; - case URL: return "http://hl7.org/fhir/item-type"; - case CHOICE: return "http://hl7.org/fhir/item-type"; - case OPENCHOICE: return "http://hl7.org/fhir/item-type"; - case ATTACHMENT: return "http://hl7.org/fhir/item-type"; - case REFERENCE: return "http://hl7.org/fhir/item-type"; - case QUANTITY: return "http://hl7.org/fhir/item-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case GROUP: return "An item with no direct answer but which has descendant items that are questions"; - case DISPLAY: return "Text for display that will not capture an answer or have descendants"; - case QUESTION: return "An item that defines a specific answer to be captured (and may have descendant items)"; - case BOOLEAN: return "Question with a yes/no answer"; - case DECIMAL: return "Question with is a real number answer"; - case INTEGER: return "Question with an integer answer"; - case DATE: return "Question with adate answer"; - case DATETIME: return "Question with a date and time answer"; - case INSTANT: return "Question with a system timestamp answer"; - case TIME: return "Question with a time (hour/minute/second) answer independent of date."; - case STRING: return "Question with a short (few words to short sentence) free-text entry answer"; - case TEXT: return "Question with a long (potentially multi-paragraph) free-text entry (still captured as a string) answer"; - case URL: return "Question with a url (website, FTP site, etc.) answer"; - case CHOICE: return "Question with a Coding drawn from a list of options as an answer"; - case OPENCHOICE: return "Answer is a Coding drawn from a list of options or a free-text entry captured as Coding.display"; - case ATTACHMENT: return "Question with binary content such as a image, PDF, etc. as an answer"; - case REFERENCE: return "Question with a reference to another resource (practitioner, organization, etc.) as an answer"; - case QUANTITY: return "Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an answer."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case GROUP: return "Group"; - case DISPLAY: return "Display"; - case QUESTION: return "Question"; - case BOOLEAN: return "Boolean"; - case DECIMAL: return "Decimal"; - case INTEGER: return "Integer"; - case DATE: return "Date"; - case DATETIME: return "Date Time"; - case INSTANT: return "Instant"; - case TIME: return "Time"; - case STRING: return "String"; - case TEXT: return "Text"; - case URL: return "Url"; - case CHOICE: return "Choice"; - case OPENCHOICE: return "Open Choice"; - case ATTACHMENT: return "Attachment"; - case REFERENCE: return "Reference"; - case QUANTITY: return "Quantity"; - default: return "?"; - } - } - } - - public static class QuestionnaireItemTypeEnumFactory implements EnumFactory { - public QuestionnaireItemType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("group".equals(codeString)) - return QuestionnaireItemType.GROUP; - if ("display".equals(codeString)) - return QuestionnaireItemType.DISPLAY; - if ("question".equals(codeString)) - return QuestionnaireItemType.QUESTION; - if ("boolean".equals(codeString)) - return QuestionnaireItemType.BOOLEAN; - if ("decimal".equals(codeString)) - return QuestionnaireItemType.DECIMAL; - if ("integer".equals(codeString)) - return QuestionnaireItemType.INTEGER; - if ("date".equals(codeString)) - return QuestionnaireItemType.DATE; - if ("dateTime".equals(codeString)) - return QuestionnaireItemType.DATETIME; - if ("instant".equals(codeString)) - return QuestionnaireItemType.INSTANT; - if ("time".equals(codeString)) - return QuestionnaireItemType.TIME; - if ("string".equals(codeString)) - return QuestionnaireItemType.STRING; - if ("text".equals(codeString)) - return QuestionnaireItemType.TEXT; - if ("url".equals(codeString)) - return QuestionnaireItemType.URL; - if ("choice".equals(codeString)) - return QuestionnaireItemType.CHOICE; - if ("open-choice".equals(codeString)) - return QuestionnaireItemType.OPENCHOICE; - if ("attachment".equals(codeString)) - return QuestionnaireItemType.ATTACHMENT; - if ("reference".equals(codeString)) - return QuestionnaireItemType.REFERENCE; - if ("quantity".equals(codeString)) - return QuestionnaireItemType.QUANTITY; - throw new IllegalArgumentException("Unknown QuestionnaireItemType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("group".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.GROUP); - if ("display".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.DISPLAY); - if ("question".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.QUESTION); - if ("boolean".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.BOOLEAN); - if ("decimal".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.DECIMAL); - if ("integer".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.INTEGER); - if ("date".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.DATE); - if ("dateTime".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.DATETIME); - if ("instant".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.INSTANT); - if ("time".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.TIME); - if ("string".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.STRING); - if ("text".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.TEXT); - if ("url".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.URL); - if ("choice".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.CHOICE); - if ("open-choice".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.OPENCHOICE); - if ("attachment".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.ATTACHMENT); - if ("reference".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.REFERENCE); - if ("quantity".equals(codeString)) - return new Enumeration(this, QuestionnaireItemType.QUANTITY); - throw new FHIRException("Unknown QuestionnaireItemType code '"+codeString+"'"); - } - public String toCode(QuestionnaireItemType code) { - if (code == QuestionnaireItemType.GROUP) - return "group"; - if (code == QuestionnaireItemType.DISPLAY) - return "display"; - if (code == QuestionnaireItemType.QUESTION) - return "question"; - if (code == QuestionnaireItemType.BOOLEAN) - return "boolean"; - if (code == QuestionnaireItemType.DECIMAL) - return "decimal"; - if (code == QuestionnaireItemType.INTEGER) - return "integer"; - if (code == QuestionnaireItemType.DATE) - return "date"; - if (code == QuestionnaireItemType.DATETIME) - return "dateTime"; - if (code == QuestionnaireItemType.INSTANT) - return "instant"; - if (code == QuestionnaireItemType.TIME) - return "time"; - if (code == QuestionnaireItemType.STRING) - return "string"; - if (code == QuestionnaireItemType.TEXT) - return "text"; - if (code == QuestionnaireItemType.URL) - return "url"; - if (code == QuestionnaireItemType.CHOICE) - return "choice"; - if (code == QuestionnaireItemType.OPENCHOICE) - return "open-choice"; - if (code == QuestionnaireItemType.ATTACHMENT) - return "attachment"; - if (code == QuestionnaireItemType.REFERENCE) - return "reference"; - if (code == QuestionnaireItemType.QUANTITY) - return "quantity"; - return "?"; - } - public String toSystem(QuestionnaireItemType code) { - return code.getSystem(); - } - } - - @Block() - public static class QuestionnaireItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. - */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="To link questionnaire with questionnaire response", formalDefinition="An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource." ) - protected StringType linkId; - - /** - * Identifies a how this group of questions is known in a particular terminology such as LOINC. - */ - @Child(name = "concept", type = {Coding.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Concept that represents this item within in a questionnaire", formalDefinition="Identifies a how this group of questions is known in a particular terminology such as LOINC." ) - protected List concept; - - /** - * A short label for a particular group, question or set of display text within the questionnaire. - */ - @Child(name = "prefix", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="E.g. \"1(a)\", \"2.5.3\"", formalDefinition="A short label for a particular group, question or set of display text within the questionnaire." ) - protected StringType prefix; - - /** - * The name of a section, the text of a question or text content for a text item. - */ - @Child(name = "text", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Primary text for the item", formalDefinition="The name of a section, the text of a question or text content for a text item." ) - protected StringType text; - - /** - * Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). - */ - @Child(name = "type", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="group | display | boolean | decimal | integer | date | dateTime +", formalDefinition="Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.)." ) - protected Enumeration type; - - /** - * If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true. - */ - @Child(name = "enableWhen", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=true, summary=false) - @Description(shortDefinition="Only allow data when:", formalDefinition="If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true." ) - protected List enableWhen; - - /** - * If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. - */ - @Child(name = "required", type = {BooleanType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether the item must be included in data results", formalDefinition="If true, indicates that the item must be present in a \"completed\" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire." ) - protected BooleanType required; - - /** - * Whether the item may occur multiple times in the instance, containing multiple sets of answers. - */ - @Child(name = "repeats", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether the item may repeat", formalDefinition="Whether the item may occur multiple times in the instance, containing multiple sets of answers." ) - protected BooleanType repeats; - - /** - * If true, the value cannot be changed by a human respondent to the Questionnaire. - */ - @Child(name = "readOnly", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Don't allow human editing", formalDefinition="If true, the value cannot be changed by a human respondent to the Questionnaire." ) - protected BooleanType readOnly; - - /** - * The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. - */ - @Child(name = "maxLength", type = {IntegerType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="No more than this many characters", formalDefinition="The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse." ) - protected IntegerType maxLength; - - /** - * Reference to a value set containing a list of codes representing permitted answers for the question. - */ - @Child(name = "options", type = {ValueSet.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Valueset containing permitted answers", formalDefinition="Reference to a value set containing a list of codes representing permitted answers for the question." ) - protected Reference options; - - /** - * The actual object that is the target of the reference (Reference to a value set containing a list of codes representing permitted answers for the question.) - */ - protected ValueSet optionsTarget; - - /** - * For a "choice" question, identifies one of the permitted answers for the question. - */ - @Child(name = "option", type = {}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Permitted answer", formalDefinition="For a \"choice\" question, identifies one of the permitted answers for the question." ) - protected List option; - - /** - * The value that should be pre-populated when rendering the questionnaire for user input. - */ - @Child(name = "initial", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Initial presumed answer for question", formalDefinition="The value that should be pre-populated when rendering the questionnaire for user input." ) - protected Type initial; - - /** - * Allows text, questions and other groups to be nested beneath a question or group. - */ - @Child(name = "item", type = {QuestionnaireItemComponent.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Nested questionnaire items", formalDefinition="Allows text, questions and other groups to be nested beneath a question or group." ) - protected List item; - - private static final long serialVersionUID = -1787693458L; - - /** - * Constructor - */ - public QuestionnaireItemComponent() { - super(); - } - - /** - * Constructor - */ - public QuestionnaireItemComponent(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #linkId} (An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); // bb - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public QuestionnaireItemComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource. - */ - public QuestionnaireItemComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (Coding item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Identifies a how this group of questions is known in a particular terminology such as LOINC.) - */ - // syntactic sugar - public Coding addConcept() { //3 - Coding t = new Coding(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireItemComponent addConcept(Coding t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #prefix} (A short label for a particular group, question or set of display text within the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value - */ - public StringType getPrefixElement() { - if (this.prefix == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.prefix"); - else if (Configuration.doAutoCreate()) - this.prefix = new StringType(); // bb - return this.prefix; - } - - public boolean hasPrefixElement() { - return this.prefix != null && !this.prefix.isEmpty(); - } - - public boolean hasPrefix() { - return this.prefix != null && !this.prefix.isEmpty(); - } - - /** - * @param value {@link #prefix} (A short label for a particular group, question or set of display text within the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPrefix" gives direct access to the value - */ - public QuestionnaireItemComponent setPrefixElement(StringType value) { - this.prefix = value; - return this; - } - - /** - * @return A short label for a particular group, question or set of display text within the questionnaire. - */ - public String getPrefix() { - return this.prefix == null ? null : this.prefix.getValue(); - } - - /** - * @param value A short label for a particular group, question or set of display text within the questionnaire. - */ - public QuestionnaireItemComponent setPrefix(String value) { - if (Utilities.noString(value)) - this.prefix = null; - else { - if (this.prefix == null) - this.prefix = new StringType(); - this.prefix.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (The name of a section, the text of a question or text content for a text item.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (The name of a section, the text of a question or text content for a text item.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public QuestionnaireItemComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return The name of a section, the text of a question or text content for a text item. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value The name of a section, the text of a question or text content for a text item. - */ - public QuestionnaireItemComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new QuestionnaireItemTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public QuestionnaireItemComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). - */ - public QuestionnaireItemType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.). - */ - public QuestionnaireItemComponent setType(QuestionnaireItemType value) { - if (this.type == null) - this.type = new Enumeration(new QuestionnaireItemTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #enableWhen} (If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.) - */ - public List getEnableWhen() { - if (this.enableWhen == null) - this.enableWhen = new ArrayList(); - return this.enableWhen; - } - - public boolean hasEnableWhen() { - if (this.enableWhen == null) - return false; - for (QuestionnaireItemEnableWhenComponent item : this.enableWhen) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #enableWhen} (If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.) - */ - // syntactic sugar - public QuestionnaireItemEnableWhenComponent addEnableWhen() { //3 - QuestionnaireItemEnableWhenComponent t = new QuestionnaireItemEnableWhenComponent(); - if (this.enableWhen == null) - this.enableWhen = new ArrayList(); - this.enableWhen.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireItemComponent addEnableWhen(QuestionnaireItemEnableWhenComponent t) { //3 - if (t == null) - return this; - if (this.enableWhen == null) - this.enableWhen = new ArrayList(); - this.enableWhen.add(t); - return this; - } - - /** - * @return {@link #required} (If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public QuestionnaireItemComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. - */ - public boolean getRequired() { - return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); - } - - /** - * @param value If true, indicates that the item must be present in a "completed" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire. - */ - public QuestionnaireItemComponent setRequired(boolean value) { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - return this; - } - - /** - * @return {@link #repeats} (Whether the item may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public BooleanType getRepeatsElement() { - if (this.repeats == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.repeats"); - else if (Configuration.doAutoCreate()) - this.repeats = new BooleanType(); // bb - return this.repeats; - } - - public boolean hasRepeatsElement() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - public boolean hasRepeats() { - return this.repeats != null && !this.repeats.isEmpty(); - } - - /** - * @param value {@link #repeats} (Whether the item may occur multiple times in the instance, containing multiple sets of answers.). This is the underlying object with id, value and extensions. The accessor "getRepeats" gives direct access to the value - */ - public QuestionnaireItemComponent setRepeatsElement(BooleanType value) { - this.repeats = value; - return this; - } - - /** - * @return Whether the item may occur multiple times in the instance, containing multiple sets of answers. - */ - public boolean getRepeats() { - return this.repeats == null || this.repeats.isEmpty() ? false : this.repeats.getValue(); - } - - /** - * @param value Whether the item may occur multiple times in the instance, containing multiple sets of answers. - */ - public QuestionnaireItemComponent setRepeats(boolean value) { - if (this.repeats == null) - this.repeats = new BooleanType(); - this.repeats.setValue(value); - return this; - } - - /** - * @return {@link #readOnly} (If true, the value cannot be changed by a human respondent to the Questionnaire.). This is the underlying object with id, value and extensions. The accessor "getReadOnly" gives direct access to the value - */ - public BooleanType getReadOnlyElement() { - if (this.readOnly == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.readOnly"); - else if (Configuration.doAutoCreate()) - this.readOnly = new BooleanType(); // bb - return this.readOnly; - } - - public boolean hasReadOnlyElement() { - return this.readOnly != null && !this.readOnly.isEmpty(); - } - - public boolean hasReadOnly() { - return this.readOnly != null && !this.readOnly.isEmpty(); - } - - /** - * @param value {@link #readOnly} (If true, the value cannot be changed by a human respondent to the Questionnaire.). This is the underlying object with id, value and extensions. The accessor "getReadOnly" gives direct access to the value - */ - public QuestionnaireItemComponent setReadOnlyElement(BooleanType value) { - this.readOnly = value; - return this; - } - - /** - * @return If true, the value cannot be changed by a human respondent to the Questionnaire. - */ - public boolean getReadOnly() { - return this.readOnly == null || this.readOnly.isEmpty() ? false : this.readOnly.getValue(); - } - - /** - * @param value If true, the value cannot be changed by a human respondent to the Questionnaire. - */ - public QuestionnaireItemComponent setReadOnly(boolean value) { - if (this.readOnly == null) - this.readOnly = new BooleanType(); - this.readOnly.setValue(value); - return this; - } - - /** - * @return {@link #maxLength} (The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public IntegerType getMaxLengthElement() { - if (this.maxLength == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.maxLength"); - else if (Configuration.doAutoCreate()) - this.maxLength = new IntegerType(); // bb - return this.maxLength; - } - - public boolean hasMaxLengthElement() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - public boolean hasMaxLength() { - return this.maxLength != null && !this.maxLength.isEmpty(); - } - - /** - * @param value {@link #maxLength} (The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse.). This is the underlying object with id, value and extensions. The accessor "getMaxLength" gives direct access to the value - */ - public QuestionnaireItemComponent setMaxLengthElement(IntegerType value) { - this.maxLength = value; - return this; - } - - /** - * @return The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. - */ - public int getMaxLength() { - return this.maxLength == null || this.maxLength.isEmpty() ? 0 : this.maxLength.getValue(); - } - - /** - * @param value The maximum number of characters that are permitted in the answer to be considered a "valid" QuestionnaireResponse. - */ - public QuestionnaireItemComponent setMaxLength(int value) { - if (this.maxLength == null) - this.maxLength = new IntegerType(); - this.maxLength.setValue(value); - return this; - } - - /** - * @return {@link #options} (Reference to a value set containing a list of codes representing permitted answers for the question.) - */ - public Reference getOptions() { - if (this.options == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.options"); - else if (Configuration.doAutoCreate()) - this.options = new Reference(); // cc - return this.options; - } - - public boolean hasOptions() { - return this.options != null && !this.options.isEmpty(); - } - - /** - * @param value {@link #options} (Reference to a value set containing a list of codes representing permitted answers for the question.) - */ - public QuestionnaireItemComponent setOptions(Reference value) { - this.options = value; - return this; - } - - /** - * @return {@link #options} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to a value set containing a list of codes representing permitted answers for the question.) - */ - public ValueSet getOptionsTarget() { - if (this.optionsTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemComponent.options"); - else if (Configuration.doAutoCreate()) - this.optionsTarget = new ValueSet(); // aa - return this.optionsTarget; - } - - /** - * @param value {@link #options} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to a value set containing a list of codes representing permitted answers for the question.) - */ - public QuestionnaireItemComponent setOptionsTarget(ValueSet value) { - this.optionsTarget = value; - return this; - } - - /** - * @return {@link #option} (For a "choice" question, identifies one of the permitted answers for the question.) - */ - public List getOption() { - if (this.option == null) - this.option = new ArrayList(); - return this.option; - } - - public boolean hasOption() { - if (this.option == null) - return false; - for (QuestionnaireItemOptionComponent item : this.option) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #option} (For a "choice" question, identifies one of the permitted answers for the question.) - */ - // syntactic sugar - public QuestionnaireItemOptionComponent addOption() { //3 - QuestionnaireItemOptionComponent t = new QuestionnaireItemOptionComponent(); - if (this.option == null) - this.option = new ArrayList(); - this.option.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireItemComponent addOption(QuestionnaireItemOptionComponent t) { //3 - if (t == null) - return this; - if (this.option == null) - this.option = new ArrayList(); - this.option.add(t); - return this; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public Type getInitial() { - return this.initial; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public BooleanType getInitialBooleanType() throws FHIRException { - if (!(this.initial instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (BooleanType) this.initial; - } - - public boolean hasInitialBooleanType() { - return this.initial instanceof BooleanType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public DecimalType getInitialDecimalType() throws FHIRException { - if (!(this.initial instanceof DecimalType)) - throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (DecimalType) this.initial; - } - - public boolean hasInitialDecimalType() { - return this.initial instanceof DecimalType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public IntegerType getInitialIntegerType() throws FHIRException { - if (!(this.initial instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (IntegerType) this.initial; - } - - public boolean hasInitialIntegerType() { - return this.initial instanceof IntegerType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public DateType getInitialDateType() throws FHIRException { - if (!(this.initial instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (DateType) this.initial; - } - - public boolean hasInitialDateType() { - return this.initial instanceof DateType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public DateTimeType getInitialDateTimeType() throws FHIRException { - if (!(this.initial instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (DateTimeType) this.initial; - } - - public boolean hasInitialDateTimeType() { - return this.initial instanceof DateTimeType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public InstantType getInitialInstantType() throws FHIRException { - if (!(this.initial instanceof InstantType)) - throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (InstantType) this.initial; - } - - public boolean hasInitialInstantType() { - return this.initial instanceof InstantType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public TimeType getInitialTimeType() throws FHIRException { - if (!(this.initial instanceof TimeType)) - throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (TimeType) this.initial; - } - - public boolean hasInitialTimeType() { - return this.initial instanceof TimeType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public StringType getInitialStringType() throws FHIRException { - if (!(this.initial instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (StringType) this.initial; - } - - public boolean hasInitialStringType() { - return this.initial instanceof StringType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public UriType getInitialUriType() throws FHIRException { - if (!(this.initial instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (UriType) this.initial; - } - - public boolean hasInitialUriType() { - return this.initial instanceof UriType; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public Attachment getInitialAttachment() throws FHIRException { - if (!(this.initial instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (Attachment) this.initial; - } - - public boolean hasInitialAttachment() { - return this.initial instanceof Attachment; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public Coding getInitialCoding() throws FHIRException { - if (!(this.initial instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (Coding) this.initial; - } - - public boolean hasInitialCoding() { - return this.initial instanceof Coding; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public Quantity getInitialQuantity() throws FHIRException { - if (!(this.initial instanceof Quantity)) - throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (Quantity) this.initial; - } - - public boolean hasInitialQuantity() { - return this.initial instanceof Quantity; - } - - /** - * @return {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public Reference getInitialReference() throws FHIRException { - if (!(this.initial instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.initial.getClass().getName()+" was encountered"); - return (Reference) this.initial; - } - - public boolean hasInitialReference() { - return this.initial instanceof Reference; - } - - public boolean hasInitial() { - return this.initial != null && !this.initial.isEmpty(); - } - - /** - * @param value {@link #initial} (The value that should be pre-populated when rendering the questionnaire for user input.) - */ - public QuestionnaireItemComponent setInitial(Type value) { - this.initial = value; - return this; - } - - /** - * @return {@link #item} (Allows text, questions and other groups to be nested beneath a question or group.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (QuestionnaireItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (Allows text, questions and other groups to be nested beneath a question or group.) - */ - // syntactic sugar - public QuestionnaireItemComponent addItem() { //3 - QuestionnaireItemComponent t = new QuestionnaireItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireItemComponent addItem(QuestionnaireItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "An identifier that is unique within the Questionnaire allowing linkage to the equivalent item in a QuestionnaireResponse resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("prefix", "string", "A short label for a particular group, question or set of display text within the questionnaire.", 0, java.lang.Integer.MAX_VALUE, prefix)); - childrenList.add(new Property("text", "string", "The name of a section, the text of a question or text content for a text item.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("type", "code", "Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a particular type of data to be captured (string, integer, coded choice, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("enableWhen", "", "If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified condition is true.", 0, java.lang.Integer.MAX_VALUE, enableWhen)); - childrenList.add(new Property("required", "boolean", "If true, indicates that the item must be present in a \"completed\" QuestionnaireResponse. If false, the item may be skipped when answering the questionnaire.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("repeats", "boolean", "Whether the item may occur multiple times in the instance, containing multiple sets of answers.", 0, java.lang.Integer.MAX_VALUE, repeats)); - childrenList.add(new Property("readOnly", "boolean", "If true, the value cannot be changed by a human respondent to the Questionnaire.", 0, java.lang.Integer.MAX_VALUE, readOnly)); - childrenList.add(new Property("maxLength", "integer", "The maximum number of characters that are permitted in the answer to be considered a \"valid\" QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, maxLength)); - childrenList.add(new Property("options", "Reference(ValueSet)", "Reference to a value set containing a list of codes representing permitted answers for the question.", 0, java.lang.Integer.MAX_VALUE, options)); - childrenList.add(new Property("option", "", "For a \"choice\" question, identifies one of the permitted answers for the question.", 0, java.lang.Integer.MAX_VALUE, option)); - childrenList.add(new Property("initial[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The value that should be pre-populated when rendering the questionnaire for user input.", 0, java.lang.Integer.MAX_VALUE, initial)); - childrenList.add(new Property("item", "@Questionnaire.item", "Allows text, questions and other groups to be nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // Coding - case -980110702: /*prefix*/ return this.prefix == null ? new Base[0] : new Base[] {this.prefix}; // StringType - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 1893321565: /*enableWhen*/ return this.enableWhen == null ? new Base[0] : this.enableWhen.toArray(new Base[this.enableWhen.size()]); // QuestionnaireItemEnableWhenComponent - case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType - case 1094288952: /*repeats*/ return this.repeats == null ? new Base[0] : new Base[] {this.repeats}; // BooleanType - case -867683742: /*readOnly*/ return this.readOnly == null ? new Base[0] : new Base[] {this.readOnly}; // BooleanType - case -791400086: /*maxLength*/ return this.maxLength == null ? new Base[0] : new Base[] {this.maxLength}; // IntegerType - case -1249474914: /*options*/ return this.options == null ? new Base[0] : new Base[] {this.options}; // Reference - case -1010136971: /*option*/ return this.option == null ? new Base[0] : this.option.toArray(new Base[this.option.size()]); // QuestionnaireItemOptionComponent - case 1948342084: /*initial*/ return this.initial == null ? new Base[0] : new Base[] {this.initial}; // Type - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireItemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1102667083: // linkId - this.linkId = castToString(value); // StringType - break; - case 951024232: // concept - this.getConcept().add(castToCoding(value)); // Coding - break; - case -980110702: // prefix - this.prefix = castToString(value); // StringType - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - case 3575610: // type - this.type = new QuestionnaireItemTypeEnumFactory().fromType(value); // Enumeration - break; - case 1893321565: // enableWhen - this.getEnableWhen().add((QuestionnaireItemEnableWhenComponent) value); // QuestionnaireItemEnableWhenComponent - break; - case -393139297: // required - this.required = castToBoolean(value); // BooleanType - break; - case 1094288952: // repeats - this.repeats = castToBoolean(value); // BooleanType - break; - case -867683742: // readOnly - this.readOnly = castToBoolean(value); // BooleanType - break; - case -791400086: // maxLength - this.maxLength = castToInteger(value); // IntegerType - break; - case -1249474914: // options - this.options = castToReference(value); // Reference - break; - case -1010136971: // option - this.getOption().add((QuestionnaireItemOptionComponent) value); // QuestionnaireItemOptionComponent - break; - case 1948342084: // initial - this.initial = (Type) value; // Type - break; - case 3242771: // item - this.getItem().add((QuestionnaireItemComponent) value); // QuestionnaireItemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("linkId")) - this.linkId = castToString(value); // StringType - else if (name.equals("concept")) - this.getConcept().add(castToCoding(value)); - else if (name.equals("prefix")) - this.prefix = castToString(value); // StringType - else if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("type")) - this.type = new QuestionnaireItemTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("enableWhen")) - this.getEnableWhen().add((QuestionnaireItemEnableWhenComponent) value); - else if (name.equals("required")) - this.required = castToBoolean(value); // BooleanType - else if (name.equals("repeats")) - this.repeats = castToBoolean(value); // BooleanType - else if (name.equals("readOnly")) - this.readOnly = castToBoolean(value); // BooleanType - else if (name.equals("maxLength")) - this.maxLength = castToInteger(value); // IntegerType - else if (name.equals("options")) - this.options = castToReference(value); // Reference - else if (name.equals("option")) - this.getOption().add((QuestionnaireItemOptionComponent) value); - else if (name.equals("initial[x]")) - this.initial = (Type) value; // Type - else if (name.equals("item")) - this.getItem().add((QuestionnaireItemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType - case 951024232: return addConcept(); // Coding - case -980110702: throw new FHIRException("Cannot make property prefix as it is not a complex type"); // StringType - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 1893321565: return addEnableWhen(); // QuestionnaireItemEnableWhenComponent - case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType - case 1094288952: throw new FHIRException("Cannot make property repeats as it is not a complex type"); // BooleanType - case -867683742: throw new FHIRException("Cannot make property readOnly as it is not a complex type"); // BooleanType - case -791400086: throw new FHIRException("Cannot make property maxLength as it is not a complex type"); // IntegerType - case -1249474914: return getOptions(); // Reference - case -1010136971: return addOption(); // QuestionnaireItemOptionComponent - case 871077564: return getInitial(); // Type - case 3242771: return addItem(); // QuestionnaireItemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("linkId")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.linkId"); - } - else if (name.equals("concept")) { - return addConcept(); - } - else if (name.equals("prefix")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.prefix"); - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.text"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.type"); - } - else if (name.equals("enableWhen")) { - return addEnableWhen(); - } - else if (name.equals("required")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.required"); - } - else if (name.equals("repeats")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.repeats"); - } - else if (name.equals("readOnly")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.readOnly"); - } - else if (name.equals("maxLength")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.maxLength"); - } - else if (name.equals("options")) { - this.options = new Reference(); - return this.options; - } - else if (name.equals("option")) { - return addOption(); - } - else if (name.equals("initialBoolean")) { - this.initial = new BooleanType(); - return this.initial; - } - else if (name.equals("initialDecimal")) { - this.initial = new DecimalType(); - return this.initial; - } - else if (name.equals("initialInteger")) { - this.initial = new IntegerType(); - return this.initial; - } - else if (name.equals("initialDate")) { - this.initial = new DateType(); - return this.initial; - } - else if (name.equals("initialDateTime")) { - this.initial = new DateTimeType(); - return this.initial; - } - else if (name.equals("initialInstant")) { - this.initial = new InstantType(); - return this.initial; - } - else if (name.equals("initialTime")) { - this.initial = new TimeType(); - return this.initial; - } - else if (name.equals("initialString")) { - this.initial = new StringType(); - return this.initial; - } - else if (name.equals("initialUri")) { - this.initial = new UriType(); - return this.initial; - } - else if (name.equals("initialAttachment")) { - this.initial = new Attachment(); - return this.initial; - } - else if (name.equals("initialCoding")) { - this.initial = new Coding(); - return this.initial; - } - else if (name.equals("initialQuantity")) { - this.initial = new Quantity(); - return this.initial; - } - else if (name.equals("initialReference")) { - this.initial = new Reference(); - return this.initial; - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public QuestionnaireItemComponent copy() { - QuestionnaireItemComponent dst = new QuestionnaireItemComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (Coding i : concept) - dst.concept.add(i.copy()); - }; - dst.prefix = prefix == null ? null : prefix.copy(); - dst.text = text == null ? null : text.copy(); - dst.type = type == null ? null : type.copy(); - if (enableWhen != null) { - dst.enableWhen = new ArrayList(); - for (QuestionnaireItemEnableWhenComponent i : enableWhen) - dst.enableWhen.add(i.copy()); - }; - dst.required = required == null ? null : required.copy(); - dst.repeats = repeats == null ? null : repeats.copy(); - dst.readOnly = readOnly == null ? null : readOnly.copy(); - dst.maxLength = maxLength == null ? null : maxLength.copy(); - dst.options = options == null ? null : options.copy(); - if (option != null) { - dst.option = new ArrayList(); - for (QuestionnaireItemOptionComponent i : option) - dst.option.add(i.copy()); - }; - dst.initial = initial == null ? null : initial.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (QuestionnaireItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireItemComponent)) - return false; - QuestionnaireItemComponent o = (QuestionnaireItemComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(concept, o.concept, true) && compareDeep(prefix, o.prefix, true) - && compareDeep(text, o.text, true) && compareDeep(type, o.type, true) && compareDeep(enableWhen, o.enableWhen, true) - && compareDeep(required, o.required, true) && compareDeep(repeats, o.repeats, true) && compareDeep(readOnly, o.readOnly, true) - && compareDeep(maxLength, o.maxLength, true) && compareDeep(options, o.options, true) && compareDeep(option, o.option, true) - && compareDeep(initial, o.initial, true) && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireItemComponent)) - return false; - QuestionnaireItemComponent o = (QuestionnaireItemComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(prefix, o.prefix, true) && compareValues(text, o.text, true) - && compareValues(type, o.type, true) && compareValues(required, o.required, true) && compareValues(repeats, o.repeats, true) - && compareValues(readOnly, o.readOnly, true) && compareValues(maxLength, o.maxLength, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (concept == null || concept.isEmpty()) - && (prefix == null || prefix.isEmpty()) && (text == null || text.isEmpty()) && (type == null || type.isEmpty()) - && (enableWhen == null || enableWhen.isEmpty()) && (required == null || required.isEmpty()) - && (repeats == null || repeats.isEmpty()) && (readOnly == null || readOnly.isEmpty()) && (maxLength == null || maxLength.isEmpty()) - && (options == null || options.isEmpty()) && (option == null || option.isEmpty()) && (initial == null || initial.isEmpty()) - && (item == null || item.isEmpty()); - } - - public String fhirType() { - return "Questionnaire.item"; - - } - - } - - @Block() - public static class QuestionnaireItemEnableWhenComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. - */ - @Child(name = "question", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Question that determines whether item is enabled", formalDefinition="The linkId for the question whose answer (or lack of answer) governs whether this item is enabled." ) - protected StringType question; - - /** - * If present, indicates that this item should be enabled only if the specified question is answered or not answered. - */ - @Child(name = "answered", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Enable when answered or not", formalDefinition="If present, indicates that this item should be enabled only if the specified question is answered or not answered." ) - protected BooleanType answered; - - /** - * If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer. - */ - @Child(name = "answer", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Value question must have", formalDefinition="If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer." ) - protected Type answer; - - private static final long serialVersionUID = 903205698L; - - /** - * Constructor - */ - public QuestionnaireItemEnableWhenComponent() { - super(); - } - - /** - * Constructor - */ - public QuestionnaireItemEnableWhenComponent(StringType question) { - super(); - this.question = question; - } - - /** - * @return {@link #question} (The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value - */ - public StringType getQuestionElement() { - if (this.question == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemEnableWhenComponent.question"); - else if (Configuration.doAutoCreate()) - this.question = new StringType(); // bb - return this.question; - } - - public boolean hasQuestionElement() { - return this.question != null && !this.question.isEmpty(); - } - - public boolean hasQuestion() { - return this.question != null && !this.question.isEmpty(); - } - - /** - * @param value {@link #question} (The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.). This is the underlying object with id, value and extensions. The accessor "getQuestion" gives direct access to the value - */ - public QuestionnaireItemEnableWhenComponent setQuestionElement(StringType value) { - this.question = value; - return this; - } - - /** - * @return The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. - */ - public String getQuestion() { - return this.question == null ? null : this.question.getValue(); - } - - /** - * @param value The linkId for the question whose answer (or lack of answer) governs whether this item is enabled. - */ - public QuestionnaireItemEnableWhenComponent setQuestion(String value) { - if (this.question == null) - this.question = new StringType(); - this.question.setValue(value); - return this; - } - - /** - * @return {@link #answered} (If present, indicates that this item should be enabled only if the specified question is answered or not answered.). This is the underlying object with id, value and extensions. The accessor "getAnswered" gives direct access to the value - */ - public BooleanType getAnsweredElement() { - if (this.answered == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireItemEnableWhenComponent.answered"); - else if (Configuration.doAutoCreate()) - this.answered = new BooleanType(); // bb - return this.answered; - } - - public boolean hasAnsweredElement() { - return this.answered != null && !this.answered.isEmpty(); - } - - public boolean hasAnswered() { - return this.answered != null && !this.answered.isEmpty(); - } - - /** - * @param value {@link #answered} (If present, indicates that this item should be enabled only if the specified question is answered or not answered.). This is the underlying object with id, value and extensions. The accessor "getAnswered" gives direct access to the value - */ - public QuestionnaireItemEnableWhenComponent setAnsweredElement(BooleanType value) { - this.answered = value; - return this; - } - - /** - * @return If present, indicates that this item should be enabled only if the specified question is answered or not answered. - */ - public boolean getAnswered() { - return this.answered == null || this.answered.isEmpty() ? false : this.answered.getValue(); - } - - /** - * @param value If present, indicates that this item should be enabled only if the specified question is answered or not answered. - */ - public QuestionnaireItemEnableWhenComponent setAnswered(boolean value) { - if (this.answered == null) - this.answered = new BooleanType(); - this.answered.setValue(value); - return this; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public Type getAnswer() { - return this.answer; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public BooleanType getAnswerBooleanType() throws FHIRException { - if (!(this.answer instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (BooleanType) this.answer; - } - - public boolean hasAnswerBooleanType() { - return this.answer instanceof BooleanType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public DecimalType getAnswerDecimalType() throws FHIRException { - if (!(this.answer instanceof DecimalType)) - throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (DecimalType) this.answer; - } - - public boolean hasAnswerDecimalType() { - return this.answer instanceof DecimalType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public IntegerType getAnswerIntegerType() throws FHIRException { - if (!(this.answer instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (IntegerType) this.answer; - } - - public boolean hasAnswerIntegerType() { - return this.answer instanceof IntegerType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public DateType getAnswerDateType() throws FHIRException { - if (!(this.answer instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (DateType) this.answer; - } - - public boolean hasAnswerDateType() { - return this.answer instanceof DateType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public DateTimeType getAnswerDateTimeType() throws FHIRException { - if (!(this.answer instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (DateTimeType) this.answer; - } - - public boolean hasAnswerDateTimeType() { - return this.answer instanceof DateTimeType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public InstantType getAnswerInstantType() throws FHIRException { - if (!(this.answer instanceof InstantType)) - throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (InstantType) this.answer; - } - - public boolean hasAnswerInstantType() { - return this.answer instanceof InstantType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public TimeType getAnswerTimeType() throws FHIRException { - if (!(this.answer instanceof TimeType)) - throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (TimeType) this.answer; - } - - public boolean hasAnswerTimeType() { - return this.answer instanceof TimeType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public StringType getAnswerStringType() throws FHIRException { - if (!(this.answer instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (StringType) this.answer; - } - - public boolean hasAnswerStringType() { - return this.answer instanceof StringType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public UriType getAnswerUriType() throws FHIRException { - if (!(this.answer instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (UriType) this.answer; - } - - public boolean hasAnswerUriType() { - return this.answer instanceof UriType; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public Attachment getAnswerAttachment() throws FHIRException { - if (!(this.answer instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (Attachment) this.answer; - } - - public boolean hasAnswerAttachment() { - return this.answer instanceof Attachment; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public Coding getAnswerCoding() throws FHIRException { - if (!(this.answer instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (Coding) this.answer; - } - - public boolean hasAnswerCoding() { - return this.answer instanceof Coding; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public Quantity getAnswerQuantity() throws FHIRException { - if (!(this.answer instanceof Quantity)) - throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (Quantity) this.answer; - } - - public boolean hasAnswerQuantity() { - return this.answer instanceof Quantity; - } - - /** - * @return {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public Reference getAnswerReference() throws FHIRException { - if (!(this.answer instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.answer.getClass().getName()+" was encountered"); - return (Reference) this.answer; - } - - public boolean hasAnswerReference() { - return this.answer instanceof Reference; - } - - public boolean hasAnswer() { - return this.answer != null && !this.answer.isEmpty(); - } - - /** - * @param value {@link #answer} (If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.) - */ - public QuestionnaireItemEnableWhenComponent setAnswer(Type value) { - this.answer = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("question", "string", "The linkId for the question whose answer (or lack of answer) governs whether this item is enabled.", 0, java.lang.Integer.MAX_VALUE, question)); - childrenList.add(new Property("answered", "boolean", "If present, indicates that this item should be enabled only if the specified question is answered or not answered.", 0, java.lang.Integer.MAX_VALUE, answered)); - childrenList.add(new Property("answer[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "If present, then the answer for the referenced question must match this answer for all components present in the enableWhen.answer.", 0, java.lang.Integer.MAX_VALUE, answer)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1165870106: /*question*/ return this.question == null ? new Base[0] : new Base[] {this.question}; // StringType - case -499559203: /*answered*/ return this.answered == null ? new Base[0] : new Base[] {this.answered}; // BooleanType - case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : new Base[] {this.answer}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1165870106: // question - this.question = castToString(value); // StringType - break; - case -499559203: // answered - this.answered = castToBoolean(value); // BooleanType - break; - case -1412808770: // answer - this.answer = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("question")) - this.question = castToString(value); // StringType - else if (name.equals("answered")) - this.answered = castToBoolean(value); // BooleanType - else if (name.equals("answer[x]")) - this.answer = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1165870106: throw new FHIRException("Cannot make property question as it is not a complex type"); // StringType - case -499559203: throw new FHIRException("Cannot make property answered as it is not a complex type"); // BooleanType - case 1693524994: return getAnswer(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("question")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.question"); - } - else if (name.equals("answered")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.answered"); - } - else if (name.equals("answerBoolean")) { - this.answer = new BooleanType(); - return this.answer; - } - else if (name.equals("answerDecimal")) { - this.answer = new DecimalType(); - return this.answer; - } - else if (name.equals("answerInteger")) { - this.answer = new IntegerType(); - return this.answer; - } - else if (name.equals("answerDate")) { - this.answer = new DateType(); - return this.answer; - } - else if (name.equals("answerDateTime")) { - this.answer = new DateTimeType(); - return this.answer; - } - else if (name.equals("answerInstant")) { - this.answer = new InstantType(); - return this.answer; - } - else if (name.equals("answerTime")) { - this.answer = new TimeType(); - return this.answer; - } - else if (name.equals("answerString")) { - this.answer = new StringType(); - return this.answer; - } - else if (name.equals("answerUri")) { - this.answer = new UriType(); - return this.answer; - } - else if (name.equals("answerAttachment")) { - this.answer = new Attachment(); - return this.answer; - } - else if (name.equals("answerCoding")) { - this.answer = new Coding(); - return this.answer; - } - else if (name.equals("answerQuantity")) { - this.answer = new Quantity(); - return this.answer; - } - else if (name.equals("answerReference")) { - this.answer = new Reference(); - return this.answer; - } - else - return super.addChild(name); - } - - public QuestionnaireItemEnableWhenComponent copy() { - QuestionnaireItemEnableWhenComponent dst = new QuestionnaireItemEnableWhenComponent(); - copyValues(dst); - dst.question = question == null ? null : question.copy(); - dst.answered = answered == null ? null : answered.copy(); - dst.answer = answer == null ? null : answer.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireItemEnableWhenComponent)) - return false; - QuestionnaireItemEnableWhenComponent o = (QuestionnaireItemEnableWhenComponent) other; - return compareDeep(question, o.question, true) && compareDeep(answered, o.answered, true) && compareDeep(answer, o.answer, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireItemEnableWhenComponent)) - return false; - QuestionnaireItemEnableWhenComponent o = (QuestionnaireItemEnableWhenComponent) other; - return compareValues(question, o.question, true) && compareValues(answered, o.answered, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (question == null || question.isEmpty()) && (answered == null || answered.isEmpty()) - && (answer == null || answer.isEmpty()); - } - - public String fhirType() { - return "Questionnaire.item.enableWhen"; - - } - - } - - @Block() - public static class QuestionnaireItemOptionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies a specific answer that's allowed as the answer to a question. - */ - @Child(name = "value", type = {IntegerType.class, DateType.class, TimeType.class, StringType.class, Coding.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Answer value", formalDefinition="Identifies a specific answer that's allowed as the answer to a question." ) - protected Type value; - - private static final long serialVersionUID = -732981989L; - - /** - * Constructor - */ - public QuestionnaireItemOptionComponent() { - super(); - } - - /** - * Constructor - */ - public QuestionnaireItemOptionComponent(Type value) { - super(); - this.value = value; - } - - /** - * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public IntegerType getValueIntegerType() throws FHIRException { - if (!(this.value instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - public boolean hasValueIntegerType() { - return this.value instanceof IntegerType; - } - - /** - * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public DateType getValueDateType() throws FHIRException { - if (!(this.value instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateType) this.value; - } - - public boolean hasValueDateType() { - return this.value instanceof DateType; - } - - /** - * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public TimeType getValueTimeType() throws FHIRException { - if (!(this.value instanceof TimeType)) - throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - public boolean hasValueTimeType() { - return this.value instanceof TimeType; - } - - /** - * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public Coding getValueCoding() throws FHIRException { - if (!(this.value instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Coding) this.value; - } - - public boolean hasValueCoding() { - return this.value instanceof Coding; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Identifies a specific answer that's allowed as the answer to a question.) - */ - public QuestionnaireItemOptionComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value[x]", "integer|date|time|string|Coding", "Identifies a specific answer that's allowed as the answer to a question.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDate")) { - this.value = new DateType(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else - return super.addChild(name); - } - - public QuestionnaireItemOptionComponent copy() { - QuestionnaireItemOptionComponent dst = new QuestionnaireItemOptionComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireItemOptionComponent)) - return false; - QuestionnaireItemOptionComponent o = (QuestionnaireItemOptionComponent) other; - return compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireItemOptionComponent)) - return false; - QuestionnaireItemOptionComponent o = (QuestionnaireItemOptionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "Questionnaire.item.option"; - - } - - } - - /** - * An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Globally unique logical identifier for questionnaire", formalDefinition="An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published." ) - protected UriType url; - - /** - * This records identifiers associated with this question set 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). - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External identifiers for this questionnaire", formalDefinition="This records identifiers associated with this question set 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)." ) - protected List identifier; - - /** - * The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical identifier for this version of Questionnaire", formalDefinition="The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated." ) - protected StringType version; - - /** - * The lifecycle status of the questionnaire as a whole. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | published | retired", formalDefinition="The lifecycle status of the questionnaire as a whole." ) - protected Enumeration status; - - /** - * The date that this questionnaire was last changed. - */ - @Child(name = "date", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date that this questionnaire was last changed." ) - protected DateTimeType date; - - /** - * Organization or person responsible for developing and maintaining the questionnaire. - */ - @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Organization/individual who designed the questionnaire", formalDefinition="Organization or person responsible for developing and maintaining the questionnaire." ) - protected StringType publisher; - - /** - * Contact details to assist a user in finding and communicating with the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact information of the publisher", formalDefinition="Contact details to assist a user in finding and communicating with the publisher." ) - protected List telecom; - - /** - * A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. "Pediatric", "Admissions", "Research", "Demographic", "Opinion Survey", etc. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Questionnaire intends to support these contexts", formalDefinition="A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. \"Pediatric\", \"Admissions\", \"Research\", \"Demographic\", \"Opinion Survey\", etc." ) - protected List useContext; - - /** - * The name or label associated with this questionnaire. - */ - @Child(name = "title", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name for the questionnaire", formalDefinition="The name or label associated with this questionnaire." ) - protected StringType title; - - /** - * Identifies a how this question or group of questions is known in a particular terminology such as LOINC. - */ - @Child(name = "concept", type = {Coding.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Concept that represents the overall questionnaire", formalDefinition="Identifies a how this question or group of questions is known in a particular terminology such as LOINC." ) - protected List concept; - - /** - * Identifies the types of subjects that can be the subject of the questionnaire. - */ - @Child(name = "subjectType", type = {CodeType.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Resource that can be subject of QuestionnaireResponse", formalDefinition="Identifies the types of subjects that can be the subject of the questionnaire." ) - protected List subjectType; - - /** - * The questions and groupings of questions that make up the questionnaire. - */ - @Child(name = "item", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Questions and sections within the Questionnaire", formalDefinition="The questions and groupings of questions that make up the questionnaire." ) - protected List item; - - private static final long serialVersionUID = 1271324566L; - - /** - * Constructor - */ - public Questionnaire() { - super(); - } - - /** - * Constructor - */ - public Questionnaire(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public Questionnaire setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published. - */ - public Questionnaire setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this question set 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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (This records identifiers associated with this question set 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).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public Questionnaire setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated. - */ - public Questionnaire setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The lifecycle status of the questionnaire as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Questionnaire setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The lifecycle status of the questionnaire as a whole. - */ - public QuestionnaireStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The lifecycle status of the questionnaire as a whole. - */ - public Questionnaire setStatus(QuestionnaireStatus value) { - if (this.status == null) - this.status = new Enumeration(new QuestionnaireStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that this questionnaire was last changed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public Questionnaire setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that this questionnaire was last changed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that this questionnaire was last changed. - */ - public Questionnaire setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (Organization or person responsible for developing and maintaining the questionnaire.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public Questionnaire setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return Organization or person responsible for developing and maintaining the questionnaire. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value Organization or person responsible for developing and maintaining the questionnaire. - */ - public Questionnaire setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #useContext} (A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. "Pediatric", "Admissions", "Research", "Demographic", "Opinion Survey", etc.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. "Pediatric", "Admissions", "Research", "Demographic", "Opinion Survey", etc.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #title} (The name or label associated with this questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public StringType getTitleElement() { - if (this.title == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Questionnaire.title"); - else if (Configuration.doAutoCreate()) - this.title = new StringType(); // bb - return this.title; - } - - public boolean hasTitleElement() { - return this.title != null && !this.title.isEmpty(); - } - - public boolean hasTitle() { - return this.title != null && !this.title.isEmpty(); - } - - /** - * @param value {@link #title} (The name or label associated with this questionnaire.). This is the underlying object with id, value and extensions. The accessor "getTitle" gives direct access to the value - */ - public Questionnaire setTitleElement(StringType value) { - this.title = value; - return this; - } - - /** - * @return The name or label associated with this questionnaire. - */ - public String getTitle() { - return this.title == null ? null : this.title.getValue(); - } - - /** - * @param value The name or label associated with this questionnaire. - */ - public Questionnaire setTitle(String value) { - if (Utilities.noString(value)) - this.title = null; - else { - if (this.title == null) - this.title = new StringType(); - this.title.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Identifies a how this question or group of questions is known in a particular terminology such as LOINC.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (Coding item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Identifies a how this question or group of questions is known in a particular terminology such as LOINC.) - */ - // syntactic sugar - public Coding addConcept() { //3 - Coding t = new Coding(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addConcept(Coding t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) - */ - public List getSubjectType() { - if (this.subjectType == null) - this.subjectType = new ArrayList(); - return this.subjectType; - } - - public boolean hasSubjectType() { - if (this.subjectType == null) - return false; - for (CodeType item : this.subjectType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) - */ - // syntactic sugar - public CodeType addSubjectTypeElement() {//2 - CodeType t = new CodeType(); - if (this.subjectType == null) - this.subjectType = new ArrayList(); - this.subjectType.add(t); - return t; - } - - /** - * @param value {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) - */ - public Questionnaire addSubjectType(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.subjectType == null) - this.subjectType = new ArrayList(); - this.subjectType.add(t); - return this; - } - - /** - * @param value {@link #subjectType} (Identifies the types of subjects that can be the subject of the questionnaire.) - */ - public boolean hasSubjectType(String value) { - if (this.subjectType == null) - return false; - for (CodeType v : this.subjectType) - if (v.equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #item} (The questions and groupings of questions that make up the questionnaire.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (QuestionnaireItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (The questions and groupings of questions that make up the questionnaire.) - */ - // syntactic sugar - public QuestionnaireItemComponent addItem() { //3 - QuestionnaireItemComponent t = new QuestionnaireItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public Questionnaire addItem(QuestionnaireItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this questionnaire when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this questionnaire is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "This records identifiers associated with this question set 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).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The version number assigned by the publisher for business reasons. It may remain the same when the resource is updated.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("date", "dateTime", "The date that this questionnaire was last changed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "Organization or person responsible for developing and maintaining the questionnaire.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("useContext", "CodeableConcept", "A code that identifies the questionnaire as falling into a particular group of like questionnaires; e.g. \"Pediatric\", \"Admissions\", \"Research\", \"Demographic\", \"Opinion Survey\", etc.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("title", "string", "The name or label associated with this questionnaire.", 0, java.lang.Integer.MAX_VALUE, title)); - childrenList.add(new Property("concept", "Coding", "Identifies a how this question or group of questions is known in a particular terminology such as LOINC.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("subjectType", "code", "Identifies the types of subjects that can be the subject of the questionnaire.", 0, java.lang.Integer.MAX_VALUE, subjectType)); - childrenList.add(new Property("item", "", "The questions and groupings of questions that make up the questionnaire.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case 110371416: /*title*/ return this.title == null ? new Base[0] : new Base[] {this.title}; // StringType - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // Coding - case -603200890: /*subjectType*/ return this.subjectType == null ? new Base[0] : this.subjectType.toArray(new Base[this.subjectType.size()]); // CodeType - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireItemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case -892481550: // status - this.status = new QuestionnaireStatusEnumFactory().fromType(value); // Enumeration - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 110371416: // title - this.title = castToString(value); // StringType - break; - case 951024232: // concept - this.getConcept().add(castToCoding(value)); // Coding - break; - case -603200890: // subjectType - this.getSubjectType().add(castToCode(value)); // CodeType - break; - case 3242771: // item - this.getItem().add((QuestionnaireItemComponent) value); // QuestionnaireItemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("status")) - this.status = new QuestionnaireStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("title")) - this.title = castToString(value); // StringType - else if (name.equals("concept")) - this.getConcept().add(castToCoding(value)); - else if (name.equals("subjectType")) - this.getSubjectType().add(castToCode(value)); - else if (name.equals("item")) - this.getItem().add((QuestionnaireItemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return addIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - case -669707736: return addUseContext(); // CodeableConcept - case 110371416: throw new FHIRException("Cannot make property title as it is not a complex type"); // StringType - case 951024232: return addConcept(); // Coding - case -603200890: throw new FHIRException("Cannot make property subjectType as it is not a complex type"); // CodeType - case 3242771: return addItem(); // QuestionnaireItemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.url"); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.version"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.status"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.date"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.publisher"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("title")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.title"); - } - else if (name.equals("concept")) { - return addConcept(); - } - else if (name.equals("subjectType")) { - throw new FHIRException("Cannot call addChild on a primitive type Questionnaire.subjectType"); - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Questionnaire"; - - } - - public Questionnaire copy() { - Questionnaire dst = new Questionnaire(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.status = status == null ? null : status.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.title = title == null ? null : title.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (Coding i : concept) - dst.concept.add(i.copy()); - }; - if (subjectType != null) { - dst.subjectType = new ArrayList(); - for (CodeType i : subjectType) - dst.subjectType.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (QuestionnaireItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - protected Questionnaire typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Questionnaire)) - return false; - Questionnaire o = (Questionnaire) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(status, o.status, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(telecom, o.telecom, true) && compareDeep(useContext, o.useContext, true) && compareDeep(title, o.title, true) - && compareDeep(concept, o.concept, true) && compareDeep(subjectType, o.subjectType, true) && compareDeep(item, o.item, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Questionnaire)) - return false; - Questionnaire o = (Questionnaire) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(status, o.status, true) - && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) && compareValues(title, o.title, true) - && compareValues(subjectType, o.subjectType, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (status == null || status.isEmpty()) && (date == null || date.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (telecom == null || telecom.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (title == null || title.isEmpty()) && (concept == null || concept.isEmpty()) && (subjectType == null || subjectType.isEmpty()) - && (item == null || item.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Questionnaire; - } - - /** - * Search parameter: title - *

- * Description: All or part of the name of the questionnaire
- * Type: string
- * Path: Questionnaire.title
- *

- */ - @SearchParamDefinition(name="title", path="Questionnaire.title", description="All or part of the name of the questionnaire", type="string" ) - public static final String SP_TITLE = "title"; - /** - * Fluent Client search parameter constant for title - *

- * Description: All or part of the name of the questionnaire
- * Type: string
- * Path: Questionnaire.title
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TITLE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TITLE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the questionnaire
- * Type: token
- * Path: Questionnaire.useContext
- *

- */ - @SearchParamDefinition(name="context", path="Questionnaire.useContext", description="A use context assigned to the questionnaire", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the questionnaire
- * Type: token
- * Path: Questionnaire.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: code - *

- * Description: A code that corresponds to the questionnaire or one of its groups
- * Type: token
- * Path: Questionnaire.item.concept
- *

- */ - @SearchParamDefinition(name="code", path="Questionnaire.item.concept", description="A code that corresponds to the questionnaire or one of its groups", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: A code that corresponds to the questionnaire or one of its groups
- * Type: token
- * Path: Questionnaire.item.concept
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: When the questionnaire was last changed
- * Type: date
- * Path: Questionnaire.date
- *

- */ - @SearchParamDefinition(name="date", path="Questionnaire.date", description="When the questionnaire was last changed", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When the questionnaire was last changed
- * Type: date
- * Path: Questionnaire.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: version - *

- * Description: The business version of the questionnaire
- * Type: string
- * Path: Questionnaire.version
- *

- */ - @SearchParamDefinition(name="version", path="Questionnaire.version", description="The business version of the questionnaire", type="string" ) - public static final String SP_VERSION = "version"; - /** - * Fluent Client search parameter constant for version - *

- * Description: The business version of the questionnaire
- * Type: string
- * Path: Questionnaire.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam VERSION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_VERSION); - - /** - * Search parameter: publisher - *

- * Description: The author of the questionnaire
- * Type: string
- * Path: Questionnaire.publisher
- *

- */ - @SearchParamDefinition(name="publisher", path="Questionnaire.publisher", description="The author of the questionnaire", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

- * Description: The author of the questionnaire
- * Type: string
- * Path: Questionnaire.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java deleted file mode 100644 index a6ca47dfbd9..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/QuestionnaireResponse.java +++ /dev/null @@ -1,1854 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ -@ResourceDef(name="QuestionnaireResponse", profile="http://hl7.org/fhir/Profile/QuestionnaireResponse") -public class QuestionnaireResponse extends DomainResource { - - public enum QuestionnaireResponseStatus { - /** - * This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still expected to be made to it. - */ - INPROGRESS, - /** - * This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive. - */ - COMPLETED, - /** - * This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards. - */ - AMENDED, - /** - * added to help the parsers - */ - NULL; - public static QuestionnaireResponseStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("amended".equals(codeString)) - return AMENDED; - throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case AMENDED: return "amended"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/questionnaire-answers-status"; - case COMPLETED: return "http://hl7.org/fhir/questionnaire-answers-status"; - case AMENDED: return "http://hl7.org/fhir/questionnaire-answers-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still expected to be made to it."; - case COMPLETED: return "This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive."; - case AMENDED: return "This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions have been made to it afterwards."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Completed"; - case AMENDED: return "Amended"; - default: return "?"; - } - } - } - - public static class QuestionnaireResponseStatusEnumFactory implements EnumFactory { - public QuestionnaireResponseStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return QuestionnaireResponseStatus.INPROGRESS; - if ("completed".equals(codeString)) - return QuestionnaireResponseStatus.COMPLETED; - if ("amended".equals(codeString)) - return QuestionnaireResponseStatus.AMENDED; - throw new IllegalArgumentException("Unknown QuestionnaireResponseStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, QuestionnaireResponseStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, QuestionnaireResponseStatus.COMPLETED); - if ("amended".equals(codeString)) - return new Enumeration(this, QuestionnaireResponseStatus.AMENDED); - throw new FHIRException("Unknown QuestionnaireResponseStatus code '"+codeString+"'"); - } - public String toCode(QuestionnaireResponseStatus code) { - if (code == QuestionnaireResponseStatus.INPROGRESS) - return "in-progress"; - if (code == QuestionnaireResponseStatus.COMPLETED) - return "completed"; - if (code == QuestionnaireResponseStatus.AMENDED) - return "amended"; - return "?"; - } - public String toSystem(QuestionnaireResponseStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class QuestionnaireResponseItemComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. - */ - @Child(name = "linkId", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Corresponding item within Questionnaire", formalDefinition="Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource." ) - protected StringType linkId; - - /** - * Text that is displayed above the contents of the group or as the text of the question being answered. - */ - @Child(name = "text", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name for group or question text", formalDefinition="Text that is displayed above the contents of the group or as the text of the question being answered." ) - protected StringType text; - - /** - * More specific subject this section's answers are about, details the subject given in QuestionnaireResponse. - */ - @Child(name = "subject", type = {}, order=3, min=0, max=1, modifier=false, summary=false) - @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 QuestionnaireResponse." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) - */ - protected Resource subjectTarget; - - /** - * The respondent's answer(s) to the question. - */ - @Child(name = "answer", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The response(s) to the question", formalDefinition="The respondent's answer(s) to the question." ) - protected List answer; - - /** - * Questions or sub-groups nested beneath a question or group. - */ - @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Nested questionnaire response items", formalDefinition="Questions or sub-groups nested beneath a question or group." ) - protected List item; - - private static final long serialVersionUID = 1059526517L; - - /** - * Constructor - */ - public QuestionnaireResponseItemComponent() { - super(); - } - - /** - * @return {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public StringType getLinkIdElement() { - if (this.linkId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.linkId"); - else if (Configuration.doAutoCreate()) - this.linkId = new StringType(); // bb - return this.linkId; - } - - public boolean hasLinkIdElement() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - public boolean hasLinkId() { - return this.linkId != null && !this.linkId.isEmpty(); - } - - /** - * @param value {@link #linkId} (Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.). This is the underlying object with id, value and extensions. The accessor "getLinkId" gives direct access to the value - */ - public QuestionnaireResponseItemComponent setLinkIdElement(StringType value) { - this.linkId = value; - return this; - } - - /** - * @return Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. - */ - public String getLinkId() { - return this.linkId == null ? null : this.linkId.getValue(); - } - - /** - * @param value Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource. - */ - public QuestionnaireResponseItemComponent setLinkId(String value) { - if (Utilities.noString(value)) - this.linkId = null; - else { - if (this.linkId == null) - this.linkId = new StringType(); - this.linkId.setValue(value); - } - return this; - } - - /** - * @return {@link #text} (Text that is displayed above the contents of the group or as the text of the question being answered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public StringType getTextElement() { - if (this.text == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.text"); - else if (Configuration.doAutoCreate()) - this.text = new StringType(); // bb - return this.text; - } - - public boolean hasTextElement() { - return this.text != null && !this.text.isEmpty(); - } - - public boolean hasText() { - return this.text != null && !this.text.isEmpty(); - } - - /** - * @param value {@link #text} (Text that is displayed above the contents of the group or as the text of the question being answered.). This is the underlying object with id, value and extensions. The accessor "getText" gives direct access to the value - */ - public QuestionnaireResponseItemComponent setTextElement(StringType value) { - this.text = value; - return this; - } - - /** - * @return Text that is displayed above the contents of the group or as the text of the question being answered. - */ - public String getText() { - return this.text == null ? null : this.text.getValue(); - } - - /** - * @param value Text that is displayed above the contents of the group or as the text of the question being answered. - */ - public QuestionnaireResponseItemComponent setText(String value) { - if (Utilities.noString(value)) - this.text = null; - else { - if (this.text == null) - this.text = new StringType(); - this.text.setValue(value); - } - return this; - } - - /** - * @return {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponseItemComponent.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) - */ - public QuestionnaireResponseItemComponent setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.) - */ - public QuestionnaireResponseItemComponent setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #answer} (The respondent's answer(s) to the question.) - */ - public List getAnswer() { - if (this.answer == null) - this.answer = new ArrayList(); - return this.answer; - } - - public boolean hasAnswer() { - if (this.answer == null) - return false; - for (QuestionnaireResponseItemAnswerComponent item : this.answer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #answer} (The respondent's answer(s) to the question.) - */ - // syntactic sugar - public QuestionnaireResponseItemAnswerComponent addAnswer() { //3 - QuestionnaireResponseItemAnswerComponent t = new QuestionnaireResponseItemAnswerComponent(); - if (this.answer == null) - this.answer = new ArrayList(); - this.answer.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireResponseItemComponent addAnswer(QuestionnaireResponseItemAnswerComponent t) { //3 - if (t == null) - return this; - if (this.answer == null) - this.answer = new ArrayList(); - this.answer.add(t); - return this; - } - - /** - * @return {@link #item} (Questions or sub-groups nested beneath a question or group.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (QuestionnaireResponseItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (Questions or sub-groups nested beneath a question or group.) - */ - // syntactic sugar - public QuestionnaireResponseItemComponent addItem() { //3 - QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireResponseItemComponent addItem(QuestionnaireResponseItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("linkId", "string", "Identifies the item from the Questionnaire that corresponds to this item in the QuestionnaireResponse resource.", 0, java.lang.Integer.MAX_VALUE, linkId)); - childrenList.add(new Property("text", "string", "Text that is displayed above the contents of the group or as the text of the question being answered.", 0, java.lang.Integer.MAX_VALUE, text)); - childrenList.add(new Property("subject", "Reference(Any)", "More specific subject this section's answers are about, details the subject given in QuestionnaireResponse.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("answer", "", "The respondent's answer(s) to the question.", 0, java.lang.Integer.MAX_VALUE, answer)); - childrenList.add(new Property("item", "@QuestionnaireResponse.item", "Questions or sub-groups nested beneath a question or group.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1102667083: /*linkId*/ return this.linkId == null ? new Base[0] : new Base[] {this.linkId}; // StringType - case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -1412808770: /*answer*/ return this.answer == null ? new Base[0] : this.answer.toArray(new Base[this.answer.size()]); // QuestionnaireResponseItemAnswerComponent - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1102667083: // linkId - this.linkId = castToString(value); // StringType - break; - case 3556653: // text - this.text = castToString(value); // StringType - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -1412808770: // answer - this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value); // QuestionnaireResponseItemAnswerComponent - break; - case 3242771: // item - this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("linkId")) - this.linkId = castToString(value); // StringType - else if (name.equals("text")) - this.text = castToString(value); // StringType - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("answer")) - this.getAnswer().add((QuestionnaireResponseItemAnswerComponent) value); - else if (name.equals("item")) - this.getItem().add((QuestionnaireResponseItemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1102667083: throw new FHIRException("Cannot make property linkId as it is not a complex type"); // StringType - case 3556653: throw new FHIRException("Cannot make property text as it is not a complex type"); // StringType - case -1867885268: return getSubject(); // Reference - case -1412808770: return addAnswer(); // QuestionnaireResponseItemAnswerComponent - case 3242771: return addItem(); // QuestionnaireResponseItemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("linkId")) { - throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.linkId"); - } - else if (name.equals("text")) { - throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.text"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("answer")) { - return addAnswer(); - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public QuestionnaireResponseItemComponent copy() { - QuestionnaireResponseItemComponent dst = new QuestionnaireResponseItemComponent(); - copyValues(dst); - dst.linkId = linkId == null ? null : linkId.copy(); - dst.text = text == null ? null : text.copy(); - dst.subject = subject == null ? null : subject.copy(); - if (answer != null) { - dst.answer = new ArrayList(); - for (QuestionnaireResponseItemAnswerComponent i : answer) - dst.answer.add(i.copy()); - }; - if (item != null) { - dst.item = new ArrayList(); - for (QuestionnaireResponseItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireResponseItemComponent)) - return false; - QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other; - return compareDeep(linkId, o.linkId, true) && compareDeep(text, o.text, true) && compareDeep(subject, o.subject, true) - && compareDeep(answer, o.answer, true) && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireResponseItemComponent)) - return false; - QuestionnaireResponseItemComponent o = (QuestionnaireResponseItemComponent) other; - return compareValues(linkId, o.linkId, true) && compareValues(text, o.text, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (linkId == null || linkId.isEmpty()) && (text == null || text.isEmpty()) - && (subject == null || subject.isEmpty()) && (answer == null || answer.isEmpty()) && (item == null || item.isEmpty()) - ; - } - - public String fhirType() { - return "QuestionnaireResponse.item"; - - } - - } - - @Block() - public static class QuestionnaireResponseItemAnswerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The answer (or one of the answers) provided by the respondent to the question. - */ - @Child(name = "value", type = {BooleanType.class, DecimalType.class, IntegerType.class, DateType.class, DateTimeType.class, InstantType.class, TimeType.class, StringType.class, UriType.class, Attachment.class, Coding.class, Quantity.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Single-valued answer to the question", formalDefinition="The answer (or one of the answers) provided by the respondent to the question." ) - protected Type value; - - /** - * Nested groups and/or questions found within this particular answer. - */ - @Child(name = "item", type = {QuestionnaireResponseItemComponent.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Nested groups and questions", formalDefinition="Nested groups and/or questions found within this particular answer." ) - protected List item; - - private static final long serialVersionUID = 2052422636L; - - /** - * Constructor - */ - public QuestionnaireResponseItemAnswerComponent() { - super(); - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public BooleanType getValueBooleanType() throws FHIRException { - if (!(this.value instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - public boolean hasValueBooleanType() { - return this.value instanceof BooleanType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public DecimalType getValueDecimalType() throws FHIRException { - if (!(this.value instanceof DecimalType)) - throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DecimalType) this.value; - } - - public boolean hasValueDecimalType() { - return this.value instanceof DecimalType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public IntegerType getValueIntegerType() throws FHIRException { - if (!(this.value instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - public boolean hasValueIntegerType() { - return this.value instanceof IntegerType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public DateType getValueDateType() throws FHIRException { - if (!(this.value instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateType) this.value; - } - - public boolean hasValueDateType() { - return this.value instanceof DateType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public DateTimeType getValueDateTimeType() throws FHIRException { - if (!(this.value instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DateTimeType) this.value; - } - - public boolean hasValueDateTimeType() { - return this.value instanceof DateTimeType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public InstantType getValueInstantType() throws FHIRException { - if (!(this.value instanceof InstantType)) - throw new FHIRException("Type mismatch: the type InstantType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (InstantType) this.value; - } - - public boolean hasValueInstantType() { - return this.value instanceof InstantType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public TimeType getValueTimeType() throws FHIRException { - if (!(this.value instanceof TimeType)) - throw new FHIRException("Type mismatch: the type TimeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (TimeType) this.value; - } - - public boolean hasValueTimeType() { - return this.value instanceof TimeType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public UriType getValueUriType() throws FHIRException { - if (!(this.value instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (UriType) this.value; - } - - public boolean hasValueUriType() { - return this.value instanceof UriType; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public Attachment getValueAttachment() throws FHIRException { - if (!(this.value instanceof Attachment)) - throw new FHIRException("Type mismatch: the type Attachment was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Attachment) this.value; - } - - public boolean hasValueAttachment() { - return this.value instanceof Attachment; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public Coding getValueCoding() throws FHIRException { - if (!(this.value instanceof Coding)) - throw new FHIRException("Type mismatch: the type Coding was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Coding) this.value; - } - - public boolean hasValueCoding() { - return this.value instanceof Coding; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public Quantity getValueQuantity() throws FHIRException { - if (!(this.value instanceof Quantity)) - throw new FHIRException("Type mismatch: the type Quantity was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Quantity) this.value; - } - - public boolean hasValueQuantity() { - return this.value instanceof Quantity; - } - - /** - * @return {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public Reference getValueReference() throws FHIRException { - if (!(this.value instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.value.getClass().getName()+" was encountered"); - return (Reference) this.value; - } - - public boolean hasValueReference() { - return this.value instanceof Reference; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The answer (or one of the answers) provided by the respondent to the question.) - */ - public QuestionnaireResponseItemAnswerComponent setValue(Type value) { - this.value = value; - return this; - } - - /** - * @return {@link #item} (Nested groups and/or questions found within this particular answer.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (QuestionnaireResponseItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (Nested groups and/or questions found within this particular answer.) - */ - // syntactic sugar - public QuestionnaireResponseItemComponent addItem() { //3 - QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireResponseItemAnswerComponent addItem(QuestionnaireResponseItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value[x]", "boolean|decimal|integer|date|dateTime|instant|time|string|uri|Attachment|Coding|Quantity|Reference(Any)", "The answer (or one of the answers) provided by the respondent to the question.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("item", "@QuestionnaireResponse.item", "Nested groups and/or questions found within this particular answer.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 111972721: // value - this.value = (Type) value; // Type - break; - case 3242771: // item - this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("value[x]")) - this.value = (Type) value; // Type - else if (name.equals("item")) - this.getItem().add((QuestionnaireResponseItemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1410166417: return getValue(); // Type - case 3242771: return addItem(); // QuestionnaireResponseItemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDate")) { - this.value = new DateType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valueInstant")) { - this.value = new InstantType(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueUri")) { - this.value = new UriType(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueReference")) { - this.value = new Reference(); - return this.value; - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public QuestionnaireResponseItemAnswerComponent copy() { - QuestionnaireResponseItemAnswerComponent dst = new QuestionnaireResponseItemAnswerComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (QuestionnaireResponseItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireResponseItemAnswerComponent)) - return false; - QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other; - return compareDeep(value, o.value, true) && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireResponseItemAnswerComponent)) - return false; - QuestionnaireResponseItemAnswerComponent o = (QuestionnaireResponseItemAnswerComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (item == null || item.isEmpty()) - ; - } - - public String fhirType() { - return "QuestionnaireResponse.item.answer"; - - } - - } - - /** - * A business identifier assigned to a particular completed (or partially completed) questionnaire. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique id for this set of answers", formalDefinition="A business identifier assigned to a particular completed (or partially completed) questionnaire." ) - protected Identifier identifier; - - /** - * Indicates the Questionnaire resource that defines the form for which answers are being provided. - */ - @Child(name = "questionnaire", type = {Questionnaire.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Form being answered", formalDefinition="Indicates the Questionnaire resource that defines the form for which answers are being provided." ) - protected Reference questionnaire; - - /** - * The actual object that is the target of the reference (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - protected Questionnaire questionnaireTarget; - - /** - * The lifecycle status of the questionnaire response as a whole. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | completed | amended", formalDefinition="The lifecycle status of the questionnaire response as a whole." ) - protected Enumeration status; - - /** - * The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information. - */ - @Child(name = "subject", type = {}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The subject of the questions", formalDefinition="The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - protected Resource subjectTarget; - - /** - * Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system. - */ - @Child(name = "author", type = {Device.class, Practitioner.class, Patient.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Person who received and recorded the answers", formalDefinition="Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system." ) - protected Reference author; - - /** - * The actual object that is the target of the reference (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) - */ - protected Resource authorTarget; - - /** - * The date and/or time that this version of the questionnaire response was authored. - */ - @Child(name = "authored", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date this version was authored", formalDefinition="The date and/or time that this version of the questionnaire response was authored." ) - protected DateTimeType authored; - - /** - * The person who answered the questions about the subject. - */ - @Child(name = "source", type = {Patient.class, Practitioner.class, RelatedPerson.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The person who answered the questions", formalDefinition="The person who answered the questions about the subject." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The person who answered the questions about the subject.) - */ - protected Resource sourceTarget; - - /** - * Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers. - */ - @Child(name = "encounter", type = {Encounter.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Primary encounter during which the answers were collected", formalDefinition="Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - protected Encounter encounterTarget; - - /** - * Corresponds to a group or question item from the original questionnaire. - */ - @Child(name = "item", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Groups and questions", formalDefinition="Corresponds to a group or question item from the original questionnaire." ) - protected List item; - - private static final long serialVersionUID = 850624885L; - - /** - * Constructor - */ - public QuestionnaireResponse() { - super(); - } - - /** - * Constructor - */ - public QuestionnaireResponse(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (A business identifier assigned to a particular completed (or partially completed) questionnaire.) - */ - public QuestionnaireResponse setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public Reference getQuestionnaire() { - if (this.questionnaire == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire"); - else if (Configuration.doAutoCreate()) - this.questionnaire = new Reference(); // cc - return this.questionnaire; - } - - public boolean hasQuestionnaire() { - return this.questionnaire != null && !this.questionnaire.isEmpty(); - } - - /** - * @param value {@link #questionnaire} (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public QuestionnaireResponse setQuestionnaire(Reference value) { - this.questionnaire = value; - return this; - } - - /** - * @return {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public Questionnaire getQuestionnaireTarget() { - if (this.questionnaireTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.questionnaire"); - else if (Configuration.doAutoCreate()) - this.questionnaireTarget = new Questionnaire(); // aa - return this.questionnaireTarget; - } - - /** - * @param value {@link #questionnaire} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Indicates the Questionnaire resource that defines the form for which answers are being provided.) - */ - public QuestionnaireResponse setQuestionnaireTarget(Questionnaire value) { - this.questionnaireTarget = value; - return this; - } - - /** - * @return {@link #status} (The lifecycle status of the questionnaire response as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new QuestionnaireResponseStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The lifecycle status of the questionnaire response as a whole.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public QuestionnaireResponse setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The lifecycle status of the questionnaire response as a whole. - */ - public QuestionnaireResponseStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The lifecycle status of the questionnaire response as a whole. - */ - public QuestionnaireResponse setStatus(QuestionnaireResponseStatus value) { - if (this.status == null) - this.status = new Enumeration(new QuestionnaireResponseStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #subject} (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public QuestionnaireResponse setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.) - */ - public QuestionnaireResponse setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) - */ - public Reference getAuthor() { - if (this.author == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.author"); - else if (Configuration.doAutoCreate()) - this.author = new Reference(); // cc - return this.author; - } - - public boolean hasAuthor() { - return this.author != null && !this.author.isEmpty(); - } - - /** - * @param value {@link #author} (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) - */ - public QuestionnaireResponse setAuthor(Reference value) { - this.author = value; - return this; - } - - /** - * @return {@link #author} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) - */ - public Resource getAuthorTarget() { - return this.authorTarget; - } - - /** - * @param value {@link #author} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.) - */ - public QuestionnaireResponse setAuthorTarget(Resource value) { - this.authorTarget = value; - return this; - } - - /** - * @return {@link #authored} (The date and/or time that this version of the questionnaire response was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public DateTimeType getAuthoredElement() { - if (this.authored == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.authored"); - else if (Configuration.doAutoCreate()) - this.authored = new DateTimeType(); // bb - return this.authored; - } - - public boolean hasAuthoredElement() { - return this.authored != null && !this.authored.isEmpty(); - } - - public boolean hasAuthored() { - return this.authored != null && !this.authored.isEmpty(); - } - - /** - * @param value {@link #authored} (The date and/or time that this version of the questionnaire response was authored.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public QuestionnaireResponse setAuthoredElement(DateTimeType value) { - this.authored = value; - return this; - } - - /** - * @return The date and/or time that this version of the questionnaire response was authored. - */ - public Date getAuthored() { - return this.authored == null ? null : this.authored.getValue(); - } - - /** - * @param value The date and/or time that this version of the questionnaire response was authored. - */ - public QuestionnaireResponse setAuthored(Date value) { - if (value == null) - this.authored = null; - else { - if (this.authored == null) - this.authored = new DateTimeType(); - this.authored.setValue(value); - } - return this; - } - - /** - * @return {@link #source} (The person who answered the questions about the subject.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The person who answered the questions about the subject.) - */ - public QuestionnaireResponse setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The person who answered the questions about the subject.) - */ - public QuestionnaireResponse setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #encounter} (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public QuestionnaireResponse setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create QuestionnaireResponse.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.) - */ - public QuestionnaireResponse setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #item} (Corresponds to a group or question item from the original questionnaire.) - */ - public List getItem() { - if (this.item == null) - this.item = new ArrayList(); - return this.item; - } - - public boolean hasItem() { - if (this.item == null) - return false; - for (QuestionnaireResponseItemComponent item : this.item) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #item} (Corresponds to a group or question item from the original questionnaire.) - */ - // syntactic sugar - public QuestionnaireResponseItemComponent addItem() { //3 - QuestionnaireResponseItemComponent t = new QuestionnaireResponseItemComponent(); - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return t; - } - - // syntactic sugar - public QuestionnaireResponse addItem(QuestionnaireResponseItemComponent t) { //3 - if (t == null) - return this; - if (this.item == null) - this.item = new ArrayList(); - this.item.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "A business identifier assigned to a particular completed (or partially completed) questionnaire.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("questionnaire", "Reference(Questionnaire)", "Indicates the Questionnaire resource that defines the form for which answers are being provided.", 0, java.lang.Integer.MAX_VALUE, questionnaire)); - childrenList.add(new Property("status", "code", "The lifecycle status of the questionnaire response as a whole.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("subject", "Reference(Any)", "The subject of the questionnaire response. This could be a patient, organization, practitioner, device, etc. This is who/what the answers apply to, but is not necessarily the source of information.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("author", "Reference(Device|Practitioner|Patient|RelatedPerson)", "Person who received the answers to the questions in the QuestionnaireResponse and recorded them in the system.", 0, java.lang.Integer.MAX_VALUE, author)); - childrenList.add(new Property("authored", "dateTime", "The date and/or time that this version of the questionnaire response was authored.", 0, java.lang.Integer.MAX_VALUE, authored)); - childrenList.add(new Property("source", "Reference(Patient|Practitioner|RelatedPerson)", "The person who answered the questions about the subject.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "Encounter during which this set of questionnaire response were collected. When there were multiple encounters, this is the one considered most relevant to the context of the answers.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("item", "", "Corresponds to a group or question item from the original questionnaire.", 0, java.lang.Integer.MAX_VALUE, item)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -1017049693: /*questionnaire*/ return this.questionnaire == null ? new Base[0] : new Base[] {this.questionnaire}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -1406328437: /*author*/ return this.author == null ? new Base[0] : new Base[] {this.author}; // Reference - case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // QuestionnaireResponseItemComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -1017049693: // questionnaire - this.questionnaire = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new QuestionnaireResponseStatusEnumFactory().fromType(value); // Enumeration - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -1406328437: // author - this.author = castToReference(value); // Reference - break; - case 1433073514: // authored - this.authored = castToDateTime(value); // DateTimeType - break; - case -896505829: // source - this.source = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 3242771: // item - this.getItem().add((QuestionnaireResponseItemComponent) value); // QuestionnaireResponseItemComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("questionnaire")) - this.questionnaire = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new QuestionnaireResponseStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("author")) - this.author = castToReference(value); // Reference - else if (name.equals("authored")) - this.authored = castToDateTime(value); // DateTimeType - else if (name.equals("source")) - this.source = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("item")) - this.getItem().add((QuestionnaireResponseItemComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -1017049693: return getQuestionnaire(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1867885268: return getSubject(); // Reference - case -1406328437: return getAuthor(); // Reference - case 1433073514: throw new FHIRException("Cannot make property authored as it is not a complex type"); // DateTimeType - case -896505829: return getSource(); // Reference - case 1524132147: return getEncounter(); // Reference - case 3242771: return addItem(); // QuestionnaireResponseItemComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("questionnaire")) { - this.questionnaire = new Reference(); - return this.questionnaire; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.status"); - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("author")) { - this.author = new Reference(); - return this.author; - } - else if (name.equals("authored")) { - throw new FHIRException("Cannot call addChild on a primitive type QuestionnaireResponse.authored"); - } - else if (name.equals("source")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("item")) { - return addItem(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "QuestionnaireResponse"; - - } - - public QuestionnaireResponse copy() { - QuestionnaireResponse dst = new QuestionnaireResponse(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.questionnaire = questionnaire == null ? null : questionnaire.copy(); - dst.status = status == null ? null : status.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.author = author == null ? null : author.copy(); - dst.authored = authored == null ? null : authored.copy(); - dst.source = source == null ? null : source.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - if (item != null) { - dst.item = new ArrayList(); - for (QuestionnaireResponseItemComponent i : item) - dst.item.add(i.copy()); - }; - return dst; - } - - protected QuestionnaireResponse typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof QuestionnaireResponse)) - return false; - QuestionnaireResponse o = (QuestionnaireResponse) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(questionnaire, o.questionnaire, true) - && compareDeep(status, o.status, true) && compareDeep(subject, o.subject, true) && compareDeep(author, o.author, true) - && compareDeep(authored, o.authored, true) && compareDeep(source, o.source, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(item, o.item, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof QuestionnaireResponse)) - return false; - QuestionnaireResponse o = (QuestionnaireResponse) other; - return compareValues(status, o.status, true) && compareValues(authored, o.authored, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (questionnaire == null || questionnaire.isEmpty()) - && (status == null || status.isEmpty()) && (subject == null || subject.isEmpty()) && (author == null || author.isEmpty()) - && (authored == null || authored.isEmpty()) && (source == null || source.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (item == null || item.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.QuestionnaireResponse; - } - - /** - * Search parameter: author - *

- * Description: The author of the questionnaire
- * Type: reference
- * Path: QuestionnaireResponse.author
- *

- */ - @SearchParamDefinition(name="author", path="QuestionnaireResponse.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: QuestionnaireResponse.author
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam AUTHOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_AUTHOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "QuestionnaireResponse:author". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_AUTHOR = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:author").toLocked(); - - /** - * Search parameter: questionnaire - *

- * Description: The questionnaire the answers are provided for
- * Type: reference
- * Path: QuestionnaireResponse.questionnaire
- *

- */ - @SearchParamDefinition(name="questionnaire", path="QuestionnaireResponse.questionnaire", description="The questionnaire the answers are provided for", type="reference" ) - public static final String SP_QUESTIONNAIRE = "questionnaire"; - /** - * Fluent Client search parameter constant for questionnaire - *

- * Description: The questionnaire the answers are provided for
- * Type: reference
- * Path: QuestionnaireResponse.questionnaire
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam QUESTIONNAIRE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_QUESTIONNAIRE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "QuestionnaireResponse:questionnaire". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_QUESTIONNAIRE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:questionnaire").toLocked(); - - /** - * Search parameter: patient - *

- * Description: The patient that is the subject of the questionnaire
- * Type: reference
- * Path: QuestionnaireResponse.subject
- *

- */ - @SearchParamDefinition(name="patient", path="QuestionnaireResponse.subject", description="The patient that is the subject of the questionnaire", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The patient that is the subject of the questionnaire
- * Type: reference
- * Path: QuestionnaireResponse.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "QuestionnaireResponse:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:patient").toLocked(); - - /** - * Search parameter: authored - *

- * Description: When the questionnaire was authored
- * Type: date
- * Path: QuestionnaireResponse.authored
- *

- */ - @SearchParamDefinition(name="authored", path="QuestionnaireResponse.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: QuestionnaireResponse.authored
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam AUTHORED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_AUTHORED); - - /** - * Search parameter: source - *

- * Description: The person who answered the questions
- * Type: reference
- * Path: QuestionnaireResponse.source
- *

- */ - @SearchParamDefinition(name="source", path="QuestionnaireResponse.source", description="The person who answered the questions", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: The person who answered the questions
- * Type: reference
- * Path: QuestionnaireResponse.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "QuestionnaireResponse:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:source").toLocked(); - - /** - * Search parameter: status - *

- * Description: The status of the questionnaire response
- * Type: token
- * Path: QuestionnaireResponse.status
- *

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

- * Description: The status of the questionnaire response
- * Type: token
- * Path: QuestionnaireResponse.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: The subject of the questionnaire
- * Type: reference
- * Path: QuestionnaireResponse.subject
- *

- */ - @SearchParamDefinition(name="subject", path="QuestionnaireResponse.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: QuestionnaireResponse.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "QuestionnaireResponse:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:subject").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Encounter during which questionnaire was authored
- * Type: reference
- * Path: QuestionnaireResponse.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="QuestionnaireResponse.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: QuestionnaireResponse.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "QuestionnaireResponse:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("QuestionnaireResponse:encounter").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Range.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Range.java deleted file mode 100644 index 03335656917..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Range.java +++ /dev/null @@ -1,226 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A set of ordered Quantities defined by a low and high limit. - */ -@DatatypeDef(name="Range") -public class Range extends Type implements ICompositeType { - - /** - * The low limit. The boundary is inclusive. - */ - @Child(name = "low", type = {SimpleQuantity.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Low limit", formalDefinition="The low limit. The boundary is inclusive." ) - protected SimpleQuantity low; - - /** - * The high limit. The boundary is inclusive. - */ - @Child(name = "high", type = {SimpleQuantity.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="High limit", formalDefinition="The high limit. The boundary is inclusive." ) - protected SimpleQuantity high; - - private static final long serialVersionUID = 1699187994L; - - /** - * Constructor - */ - public Range() { - super(); - } - - /** - * @return {@link #low} (The low limit. The boundary is inclusive.) - */ - public SimpleQuantity getLow() { - if (this.low == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Range.low"); - else if (Configuration.doAutoCreate()) - this.low = new SimpleQuantity(); // cc - return this.low; - } - - public boolean hasLow() { - return this.low != null && !this.low.isEmpty(); - } - - /** - * @param value {@link #low} (The low limit. The boundary is inclusive.) - */ - public Range setLow(SimpleQuantity value) { - this.low = value; - return this; - } - - /** - * @return {@link #high} (The high limit. The boundary is inclusive.) - */ - public SimpleQuantity getHigh() { - if (this.high == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Range.high"); - else if (Configuration.doAutoCreate()) - this.high = new SimpleQuantity(); // cc - return this.high; - } - - public boolean hasHigh() { - return this.high != null && !this.high.isEmpty(); - } - - /** - * @param value {@link #high} (The high limit. The boundary is inclusive.) - */ - public Range setHigh(SimpleQuantity value) { - this.high = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("low", "SimpleQuantity", "The low limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, low)); - childrenList.add(new Property("high", "SimpleQuantity", "The high limit. The boundary is inclusive.", 0, java.lang.Integer.MAX_VALUE, high)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 107348: /*low*/ return this.low == null ? new Base[0] : new Base[] {this.low}; // SimpleQuantity - case 3202466: /*high*/ return this.high == null ? new Base[0] : new Base[] {this.high}; // SimpleQuantity - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 107348: // low - this.low = castToSimpleQuantity(value); // SimpleQuantity - break; - case 3202466: // high - this.high = castToSimpleQuantity(value); // SimpleQuantity - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("low")) - this.low = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("high")) - this.high = castToSimpleQuantity(value); // SimpleQuantity - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 107348: return getLow(); // SimpleQuantity - case 3202466: return getHigh(); // SimpleQuantity - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("low")) { - this.low = new SimpleQuantity(); - return this.low; - } - else if (name.equals("high")) { - this.high = new SimpleQuantity(); - return this.high; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Range"; - - } - - public Range copy() { - Range dst = new Range(); - copyValues(dst); - dst.low = low == null ? null : low.copy(); - dst.high = high == null ? null : high.copy(); - return dst; - } - - protected Range typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Range)) - return false; - Range o = (Range) other; - return compareDeep(low, o.low, true) && compareDeep(high, o.high, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Range)) - return false; - Range o = (Range) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (low == null || low.isEmpty()) && (high == null || high.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Ratio.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Ratio.java deleted file mode 100644 index 9e79e8a92a6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Ratio.java +++ /dev/null @@ -1,227 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ -@DatatypeDef(name="Ratio") -public class Ratio extends Type implements ICompositeType { - - /** - * The value of the numerator. - */ - @Child(name = "numerator", type = {Quantity.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Numerator value", formalDefinition="The value of the numerator." ) - protected Quantity numerator; - - /** - * The value of the denominator. - */ - @Child(name = "denominator", type = {Quantity.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Denominator value", formalDefinition="The value of the denominator." ) - protected Quantity denominator; - - private static final long serialVersionUID = 479922563L; - - /** - * Constructor - */ - public Ratio() { - super(); - } - - /** - * @return {@link #numerator} (The value of the numerator.) - */ - public Quantity getNumerator() { - if (this.numerator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Ratio.numerator"); - else if (Configuration.doAutoCreate()) - this.numerator = new Quantity(); // cc - return this.numerator; - } - - public boolean hasNumerator() { - return this.numerator != null && !this.numerator.isEmpty(); - } - - /** - * @param value {@link #numerator} (The value of the numerator.) - */ - public Ratio setNumerator(Quantity value) { - this.numerator = value; - return this; - } - - /** - * @return {@link #denominator} (The value of the denominator.) - */ - public Quantity getDenominator() { - if (this.denominator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Ratio.denominator"); - else if (Configuration.doAutoCreate()) - this.denominator = new Quantity(); // cc - return this.denominator; - } - - public boolean hasDenominator() { - return this.denominator != null && !this.denominator.isEmpty(); - } - - /** - * @param value {@link #denominator} (The value of the denominator.) - */ - public Ratio setDenominator(Quantity value) { - this.denominator = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("numerator", "Quantity", "The value of the numerator.", 0, java.lang.Integer.MAX_VALUE, numerator)); - childrenList.add(new Property("denominator", "Quantity", "The value of the denominator.", 0, java.lang.Integer.MAX_VALUE, denominator)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1747334793: /*numerator*/ return this.numerator == null ? new Base[0] : new Base[] {this.numerator}; // Quantity - case -1983274394: /*denominator*/ return this.denominator == null ? new Base[0] : new Base[] {this.denominator}; // Quantity - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1747334793: // numerator - this.numerator = castToQuantity(value); // Quantity - break; - case -1983274394: // denominator - this.denominator = castToQuantity(value); // Quantity - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("numerator")) - this.numerator = castToQuantity(value); // Quantity - else if (name.equals("denominator")) - this.denominator = castToQuantity(value); // Quantity - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1747334793: return getNumerator(); // Quantity - case -1983274394: return getDenominator(); // Quantity - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("numerator")) { - this.numerator = new Quantity(); - return this.numerator; - } - else if (name.equals("denominator")) { - this.denominator = new Quantity(); - return this.denominator; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Ratio"; - - } - - public Ratio copy() { - Ratio dst = new Ratio(); - copyValues(dst); - dst.numerator = numerator == null ? null : numerator.copy(); - dst.denominator = denominator == null ? null : denominator.copy(); - return dst; - } - - protected Ratio typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Ratio)) - return false; - Ratio o = (Ratio) other; - return compareDeep(numerator, o.numerator, true) && compareDeep(denominator, o.denominator, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Ratio)) - return false; - Ratio o = (Ratio) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (numerator == null || numerator.isEmpty()) && (denominator == null || denominator.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Reference.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Reference.java deleted file mode 100644 index b60e6ebefd6..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Reference.java +++ /dev/null @@ -1,322 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IAnyResource; -import org.hl7.fhir.instance.model.api.IBaseReference; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.instance.model.api.IIdType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A reference from one resource to another. - */ -@DatatypeDef(name="Reference") -public class Reference extends BaseReference implements IBaseReference, ICompositeType { - - /** - * A reference to a location at which the other resource is found. The reference may be 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. - */ - @Child(name = "reference", type = {StringType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Relative, internal or absolute URL reference", formalDefinition="A reference to a location at which the other resource is found. The reference may be 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." ) - protected StringType reference; - - /** - * Plain text narrative that identifies the resource in addition to the resource reference. - */ - @Child(name = "display", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Text alternative for the resource", formalDefinition="Plain text narrative that identifies the resource in addition to the resource reference." ) - protected StringType display; - - private static final long serialVersionUID = 22777321L; - - /** - * Constructor - */ - public Reference() { - super(); - } - - /** - * Constructor - * - * @param theReference The given reference string (e.g. "Patient/123" or "http://example.com/Patient/123") - */ - public Reference(String theReference) { - super(theReference); - } - - /** - * Constructor - * - * @param theReference The given reference as an IdType (e.g. "Patient/123" or "http://example.com/Patient/123") - */ - public Reference(IIdType theReference) { - super(theReference); - } - - /** - * Constructor - * - * @param theResource The resource represented by this reference - */ - public Reference(IAnyResource theResource) { - super(theResource); - } - - /** - * @return {@link #reference} (A reference to a location at which the other resource is found. The reference may be 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.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public StringType getReferenceElement_() { - if (this.reference == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reference.reference"); - else if (Configuration.doAutoCreate()) - this.reference = new StringType(); // bb - return this.reference; - } - - public boolean hasReferenceElement() { - return this.reference != null && !this.reference.isEmpty(); - } - - public boolean hasReference() { - return this.reference != null && !this.reference.isEmpty(); - } - - /** - * @param value {@link #reference} (A reference to a location at which the other resource is found. The reference may be 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.). This is the underlying object with id, value and extensions. The accessor "getReference" gives direct access to the value - */ - public Reference setReferenceElement(StringType value) { - this.reference = value; - return this; - } - - /** - * @return A reference to a location at which the other resource is found. The reference may be 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. - */ - @Override - public String getReference() { - return this.reference == null ? null : this.reference.getValue(); - } - - /** - * @param value A reference to a location at which the other resource is found. The reference may be 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 Reference setReference(String value) { - if (Utilities.noString(value)) - this.reference = null; - else { - if (this.reference == null) - this.reference = new StringType(); - this.reference.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Reference.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Plain text narrative that identifies the resource in addition to the resource reference.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public Reference setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Plain text narrative that identifies the resource in addition to the resource reference. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Plain text narrative that identifies the resource in addition to the resource reference. - */ - public Reference setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * Convenience setter which sets the reference to the complete {@link IIdType#getValue() value} of the given - * reference. - * - * @param theReference The reference, or null - * @return - * @return Returns a reference to this - */ - public Reference setReferenceElement(IIdType theReference) { - if (theReference != null) { - setReference(theReference.getValue()); - } else { - setReference(null); - } - return this; - } - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("reference", "string", "A reference to a location at which the other resource is found. The reference may be 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.", 0, java.lang.Integer.MAX_VALUE, reference)); - childrenList.add(new Property("display", "string", "Plain text narrative that identifies the resource in addition to the resource reference.", 0, java.lang.Integer.MAX_VALUE, display)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // StringType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -925155509: // reference - this.reference = castToString(value); // StringType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("reference")) - this.reference = castToString(value); // StringType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -925155509: throw new FHIRException("Cannot make property reference as it is not a complex type"); // StringType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("reference")) { - throw new FHIRException("Cannot call addChild on a primitive type Reference.reference"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type Reference.display"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Reference"; - - } - - public Reference copy() { - Reference dst = new Reference(); - copyValues(dst); - dst.reference = reference == null ? null : reference.copy(); - dst.display = display == null ? null : display.copy(); - return dst; - } - - protected Reference typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Reference)) - return false; - Reference o = (Reference) other; - return compareDeep(reference, o.reference, true) && compareDeep(display, o.display, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Reference)) - return false; - Reference o = (Reference) other; - return compareValues(reference, o.reference, true) && compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (reference == null || reference.isEmpty()) && (display == null || display.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ReferralRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ReferralRequest.java deleted file mode 100644 index 1c6d883bde2..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ReferralRequest.java +++ /dev/null @@ -1,1759 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization. - */ -@ResourceDef(name="ReferralRequest", profile="http://hl7.org/fhir/Profile/ReferralRequest") -public class ReferralRequest extends DomainResource { - - public enum ReferralStatus { - /** - * A draft referral that has yet to be send. - */ - DRAFT, - /** - * The referral is complete and is ready for fulfillment. - */ - ACTIVE, - /** - * The referral has been cancelled without being completed. For example it is no longer needed. - */ - CANCELLED, - /** - * The referral has been completely actioned. - */ - COMPLETED, - /** - * This referral record should never have existed, though it's possible some degree of real-world activity or decisions may have been taken due to its existence - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static ReferralStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("active".equals(codeString)) - return ACTIVE; - if ("cancelled".equals(codeString)) - return CANCELLED; - if ("completed".equals(codeString)) - return COMPLETED; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown ReferralStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case ACTIVE: return "active"; - case CANCELLED: return "cancelled"; - case COMPLETED: return "completed"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return "http://hl7.org/fhir/referralstatus"; - case ACTIVE: return "http://hl7.org/fhir/referralstatus"; - case CANCELLED: return "http://hl7.org/fhir/referralstatus"; - case COMPLETED: return "http://hl7.org/fhir/referralstatus"; - case ENTEREDINERROR: return "http://hl7.org/fhir/referralstatus"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "A draft referral that has yet to be send."; - case ACTIVE: return "The referral is complete and is ready for fulfillment."; - case CANCELLED: return "The referral has been cancelled without being completed. For example it is no longer needed."; - case COMPLETED: return "The referral has been completely actioned."; - case ENTEREDINERROR: return "This referral record should never have existed, though it's possible some degree of real-world activity or decisions may have been taken due to its existence"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case ACTIVE: return "Active"; - case CANCELLED: return "Cancelled"; - case COMPLETED: return "Completed"; - case ENTEREDINERROR: return "Entered in Error"; - default: return "?"; - } - } - } - - public static class ReferralStatusEnumFactory implements EnumFactory { - public ReferralStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return ReferralStatus.DRAFT; - if ("active".equals(codeString)) - return ReferralStatus.ACTIVE; - if ("cancelled".equals(codeString)) - return ReferralStatus.CANCELLED; - if ("completed".equals(codeString)) - return ReferralStatus.COMPLETED; - if ("entered-in-error".equals(codeString)) - return ReferralStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown ReferralStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return new Enumeration(this, ReferralStatus.DRAFT); - if ("active".equals(codeString)) - return new Enumeration(this, ReferralStatus.ACTIVE); - if ("cancelled".equals(codeString)) - return new Enumeration(this, ReferralStatus.CANCELLED); - if ("completed".equals(codeString)) - return new Enumeration(this, ReferralStatus.COMPLETED); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, ReferralStatus.ENTEREDINERROR); - throw new FHIRException("Unknown ReferralStatus code '"+codeString+"'"); - } - public String toCode(ReferralStatus code) { - if (code == ReferralStatus.DRAFT) - return "draft"; - if (code == ReferralStatus.ACTIVE) - return "active"; - if (code == ReferralStatus.CANCELLED) - return "cancelled"; - if (code == ReferralStatus.COMPLETED) - return "completed"; - if (code == ReferralStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(ReferralStatus code) { - return code.getSystem(); - } - } - - public enum ReferralCategory { - /** - * The referral request represents a suggestion or recommendation that a referral be made. - */ - PROPOSAL, - /** - * The referral request represents an intention by the author to make a referral, but no actual referral has yet been made/authorized. - */ - PLAN, - /** - * This is an actual referral request which, when active, will have the authorizations needed to allow it to be actioned. - */ - REQUEST, - /** - * added to help the parsers - */ - NULL; - public static ReferralCategory fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("proposal".equals(codeString)) - return PROPOSAL; - if ("plan".equals(codeString)) - return PLAN; - if ("request".equals(codeString)) - return REQUEST; - throw new FHIRException("Unknown ReferralCategory code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case PROPOSAL: return "proposal"; - case PLAN: return "plan"; - case REQUEST: return "request"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case PROPOSAL: return "http://hl7.org/fhir/referralcategory"; - case PLAN: return "http://hl7.org/fhir/referralcategory"; - case REQUEST: return "http://hl7.org/fhir/referralcategory"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case PROPOSAL: return "The referral request represents a suggestion or recommendation that a referral be made."; - case PLAN: return "The referral request represents an intention by the author to make a referral, but no actual referral has yet been made/authorized."; - case REQUEST: return "This is an actual referral request which, when active, will have the authorizations needed to allow it to be actioned."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case PROPOSAL: return "Proposal"; - case PLAN: return "Plan"; - case REQUEST: return "Request"; - default: return "?"; - } - } - } - - public static class ReferralCategoryEnumFactory implements EnumFactory { - public ReferralCategory fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("proposal".equals(codeString)) - return ReferralCategory.PROPOSAL; - if ("plan".equals(codeString)) - return ReferralCategory.PLAN; - if ("request".equals(codeString)) - return ReferralCategory.REQUEST; - throw new IllegalArgumentException("Unknown ReferralCategory code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("proposal".equals(codeString)) - return new Enumeration(this, ReferralCategory.PROPOSAL); - if ("plan".equals(codeString)) - return new Enumeration(this, ReferralCategory.PLAN); - if ("request".equals(codeString)) - return new Enumeration(this, ReferralCategory.REQUEST); - throw new FHIRException("Unknown ReferralCategory code '"+codeString+"'"); - } - public String toCode(ReferralCategory code) { - if (code == ReferralCategory.PROPOSAL) - return "proposal"; - if (code == ReferralCategory.PLAN) - return "plan"; - if (code == ReferralCategory.REQUEST) - return "request"; - return "?"; - } - public String toSystem(ReferralCategory code) { - return code.getSystem(); - } - } - - /** - * Business identifier that uniquely identifies the referral/care transfer request instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Business identifier", formalDefinition="Business identifier that uniquely identifies the referral/care transfer request instance." ) - protected List identifier; - - /** - * Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part. - */ - @Child(name = "basedOn", type = {ReferralRequest.class, CarePlan.class, DiagnosticOrder.class, ProcedureRequest.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Request fulfilled by this request", formalDefinition="Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part." ) - protected List basedOn; - /** - * The actual objects that are the target of the reference (Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) - */ - protected List basedOnTarget; - - - /** - * The business identifier of the logical "grouping" request/order that this referral is a part of. - */ - @Child(name = "parent", type = {Identifier.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Composite request this is part of", formalDefinition="The business identifier of the logical \"grouping\" request/order that this referral is a part of." ) - protected Identifier parent; - - /** - * The status of the authorization/intention reflected by the referral request record. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | cancelled | completed | entered-in-error", formalDefinition="The status of the authorization/intention reflected by the referral request record." ) - protected Enumeration status; - - /** - * Distinguishes the "level" of authorization/demand implicit in this request. - */ - @Child(name = "category", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="proposal | plan | request", formalDefinition="Distinguishes the \"level\" of authorization/demand implicit in this request." ) - protected Enumeration category; - - /** - * An indication of the type of referral (or where applicable the type of transfer of care) request. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Referral/Transition of care request type", formalDefinition="An indication of the type of referral (or where applicable the type of transfer of care) request." ) - protected CodeableConcept type; - - /** - * An indication of the urgency of referral (or where applicable the type of transfer of care) request. - */ - @Child(name = "priority", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Urgency of referral / transfer of care request", formalDefinition="An indication of the urgency of referral (or where applicable the type of transfer of care) request." ) - protected CodeableConcept priority; - - /** - * The patient who is the subject of a referral or transfer of care request. - */ - @Child(name = "patient", type = {Patient.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient referred to care or transfer", formalDefinition="The patient who is the subject of a referral or transfer of care request." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient who is the subject of a referral or transfer of care request.) - */ - protected Patient patientTarget; - - /** - * The encounter at which the request for referral or transfer of care is initiated. - */ - @Child(name = "context", type = {Encounter.class, EpisodeOfCare.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Originating encounter", formalDefinition="The encounter at which the request for referral or transfer of care is initiated." ) - protected Reference context; - - /** - * The actual object that is the target of the reference (The encounter at which the request for referral or transfer of care is initiated.) - */ - protected Resource contextTarget; - - /** - * The period of time within which the services identified in the referral/transfer of care is specified or required to occur. - */ - @Child(name = "fulfillmentTime", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Requested service(s) fulfillment time", formalDefinition="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." ) - protected Period fulfillmentTime; - - /** - * Date/DateTime of creation for draft requests and date of activation for active requests. - */ - @Child(name = "authored", type = {DateTimeType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date of creation/activation", formalDefinition="Date/DateTime of creation for draft requests and date of activation for active requests." ) - protected DateTimeType authored; - - /** - * The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral). - */ - @Child(name = "requester", type = {Practitioner.class, Organization.class, Patient.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Requester of referral / transfer of care", formalDefinition="The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral)." ) - protected Reference requester; - - /** - * The actual object that is the target of the reference (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) - */ - protected Resource requesterTarget; - - /** - * Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The clinical specialty (discipline) that the referral is requested for", formalDefinition="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology." ) - protected CodeableConcept specialty; - - /** - * The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request. - */ - @Child(name = "recipient", type = {Practitioner.class, Organization.class}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Receiver of referral / transfer of care request", formalDefinition="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." ) - protected List recipient; - /** - * The actual objects that are the target of the reference (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - protected List recipientTarget; - - - /** - * Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason for referral / transfer of care request", formalDefinition="Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management." ) - protected CodeableConcept reason; - - /** - * The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - @Child(name = "description", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="A textual description of the referral", formalDefinition="The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." ) - protected StringType description; - - /** - * The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion. - */ - @Child(name = "serviceRequested", type = {CodeableConcept.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Actions requested as part of the referral", formalDefinition="The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion." ) - protected List serviceRequested; - - /** - * Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan. - */ - @Child(name = "supportingInformation", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Additonal information to support referral or transfer of care request", formalDefinition="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan." ) - protected List supportingInformation; - /** - * The actual objects that are the target of the reference (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) - */ - protected List supportingInformationTarget; - - - private static final long serialVersionUID = -1030392098L; - - /** - * Constructor - */ - public ReferralRequest() { - super(); - } - - /** - * Constructor - */ - public ReferralRequest(Enumeration status, Enumeration category) { - super(); - this.status = status; - this.category = category; - } - - /** - * @return {@link #identifier} (Business identifier that uniquely identifies the referral/care transfer request instance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Business identifier that uniquely identifies the referral/care transfer request instance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #basedOn} (Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) - */ - public List getBasedOn() { - if (this.basedOn == null) - this.basedOn = new ArrayList(); - return this.basedOn; - } - - public boolean hasBasedOn() { - if (this.basedOn == null) - return false; - for (Reference item : this.basedOn) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #basedOn} (Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) - */ - // syntactic sugar - public Reference addBasedOn() { //3 - Reference t = new Reference(); - if (this.basedOn == null) - this.basedOn = new ArrayList(); - this.basedOn.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addBasedOn(Reference t) { //3 - if (t == null) - return this; - if (this.basedOn == null) - this.basedOn = new ArrayList(); - this.basedOn.add(t); - return this; - } - - /** - * @return {@link #basedOn} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.) - */ - public List getBasedOnTarget() { - if (this.basedOnTarget == null) - this.basedOnTarget = new ArrayList(); - return this.basedOnTarget; - } - - /** - * @return {@link #parent} (The business identifier of the logical "grouping" request/order that this referral is a part of.) - */ - public Identifier getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Identifier(); // cc - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** - * @param value {@link #parent} (The business identifier of the logical "grouping" request/order that this referral is a part of.) - */ - public ReferralRequest setParent(Identifier value) { - this.parent = value; - return this; - } - - /** - * @return {@link #status} (The status of the authorization/intention reflected by the referral request record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ReferralStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the authorization/intention reflected by the referral request record.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ReferralRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the authorization/intention reflected by the referral request record. - */ - public ReferralStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the authorization/intention reflected by the referral request record. - */ - public ReferralRequest setStatus(ReferralStatus value) { - if (this.status == null) - this.status = new Enumeration(new ReferralStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #category} (Distinguishes the "level" of authorization/demand implicit in this request.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public Enumeration getCategoryElement() { - if (this.category == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.category"); - else if (Configuration.doAutoCreate()) - this.category = new Enumeration(new ReferralCategoryEnumFactory()); // bb - return this.category; - } - - public boolean hasCategoryElement() { - return this.category != null && !this.category.isEmpty(); - } - - public boolean hasCategory() { - return this.category != null && !this.category.isEmpty(); - } - - /** - * @param value {@link #category} (Distinguishes the "level" of authorization/demand implicit in this request.). This is the underlying object with id, value and extensions. The accessor "getCategory" gives direct access to the value - */ - public ReferralRequest setCategoryElement(Enumeration value) { - this.category = value; - return this; - } - - /** - * @return Distinguishes the "level" of authorization/demand implicit in this request. - */ - public ReferralCategory getCategory() { - return this.category == null ? null : this.category.getValue(); - } - - /** - * @param value Distinguishes the "level" of authorization/demand implicit in this request. - */ - public ReferralRequest setCategory(ReferralCategory value) { - if (this.category == null) - this.category = new Enumeration(new ReferralCategoryEnumFactory()); - this.category.setValue(value); - return this; - } - - /** - * @return {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (An indication of the type of referral (or where applicable the type of transfer of care) request.) - */ - public ReferralRequest setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) - */ - public CodeableConcept getPriority() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new CodeableConcept(); // cc - return this.priority; - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (An indication of the urgency of referral (or where applicable the type of transfer of care) request.) - */ - public ReferralRequest setPriority(CodeableConcept value) { - this.priority = value; - return this; - } - - /** - * @return {@link #patient} (The patient who is the subject of a referral or transfer of care request.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient who is the subject of a referral or transfer of care request.) - */ - public ReferralRequest setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient who is the subject of a referral or transfer of care request.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient who is the subject of a referral or transfer of care request.) - */ - public ReferralRequest setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #context} (The encounter at which the request for referral or transfer of care is initiated.) - */ - public Reference getContext() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.context"); - else if (Configuration.doAutoCreate()) - this.context = new Reference(); // cc - return this.context; - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (The encounter at which the request for referral or transfer of care is initiated.) - */ - public ReferralRequest setContext(Reference value) { - this.context = value; - return this; - } - - /** - * @return {@link #context} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter at which the request for referral or transfer of care is initiated.) - */ - public Resource getContextTarget() { - return this.contextTarget; - } - - /** - * @param value {@link #context} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter at which the request for referral or transfer of care is initiated.) - */ - public ReferralRequest setContextTarget(Resource value) { - this.contextTarget = value; - return this; - } - - /** - * @return {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) - */ - public Period getFulfillmentTime() { - if (this.fulfillmentTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.fulfillmentTime"); - else if (Configuration.doAutoCreate()) - this.fulfillmentTime = new Period(); // cc - return this.fulfillmentTime; - } - - public boolean hasFulfillmentTime() { - return this.fulfillmentTime != null && !this.fulfillmentTime.isEmpty(); - } - - /** - * @param value {@link #fulfillmentTime} (The period of time within which the services identified in the referral/transfer of care is specified or required to occur.) - */ - public ReferralRequest setFulfillmentTime(Period value) { - this.fulfillmentTime = value; - return this; - } - - /** - * @return {@link #authored} (Date/DateTime of creation for draft requests and date of activation for active requests.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public DateTimeType getAuthoredElement() { - if (this.authored == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.authored"); - else if (Configuration.doAutoCreate()) - this.authored = new DateTimeType(); // bb - return this.authored; - } - - public boolean hasAuthoredElement() { - return this.authored != null && !this.authored.isEmpty(); - } - - public boolean hasAuthored() { - return this.authored != null && !this.authored.isEmpty(); - } - - /** - * @param value {@link #authored} (Date/DateTime of creation for draft requests and date of activation for active requests.). This is the underlying object with id, value and extensions. The accessor "getAuthored" gives direct access to the value - */ - public ReferralRequest setAuthoredElement(DateTimeType value) { - this.authored = value; - return this; - } - - /** - * @return Date/DateTime of creation for draft requests and date of activation for active requests. - */ - public Date getAuthored() { - return this.authored == null ? null : this.authored.getValue(); - } - - /** - * @param value Date/DateTime of creation for draft requests and date of activation for active requests. - */ - public ReferralRequest setAuthored(Date value) { - if (value == null) - this.authored = null; - else { - if (this.authored == null) - this.authored = new DateTimeType(); - this.authored.setValue(value); - } - return this; - } - - /** - * @return {@link #requester} (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public Reference getRequester() { - if (this.requester == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.requester"); - else if (Configuration.doAutoCreate()) - this.requester = new Reference(); // cc - return this.requester; - } - - public boolean hasRequester() { - return this.requester != null && !this.requester.isEmpty(); - } - - /** - * @param value {@link #requester} (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public ReferralRequest setRequester(Reference value) { - this.requester = value; - return this; - } - - /** - * @return {@link #requester} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public Resource getRequesterTarget() { - return this.requesterTarget; - } - - /** - * @param value {@link #requester} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).) - */ - public ReferralRequest setRequesterTarget(Resource value) { - this.requesterTarget = value; - return this; - } - - /** - * @return {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology.) - */ - public CodeableConcept getSpecialty() { - if (this.specialty == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.specialty"); - else if (Configuration.doAutoCreate()) - this.specialty = new CodeableConcept(); // cc - return this.specialty; - } - - public boolean hasSpecialty() { - return this.specialty != null && !this.specialty.isEmpty(); - } - - /** - * @param value {@link #specialty} (Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology.) - */ - public ReferralRequest setSpecialty(CodeableConcept value) { - this.specialty = value; - return this; - } - - /** - * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - public List getRecipient() { - if (this.recipient == null) - this.recipient = new ArrayList(); - return this.recipient; - } - - public boolean hasRecipient() { - if (this.recipient == null) - return false; - for (Reference item : this.recipient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #recipient} (The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - // syntactic sugar - public Reference addRecipient() { //3 - Reference t = new Reference(); - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addRecipient(Reference t) { //3 - if (t == null) - return this; - if (this.recipient == null) - this.recipient = new ArrayList(); - this.recipient.add(t); - return this; - } - - /** - * @return {@link #recipient} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.) - */ - public List getRecipientTarget() { - if (this.recipientTarget == null) - this.recipientTarget = new ArrayList(); - return this.recipientTarget; - } - - /** - * @return {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management.) - */ - public CodeableConcept getReason() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new CodeableConcept(); // cc - return this.reason; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management.) - */ - public ReferralRequest setReason(CodeableConcept value) { - this.reason = value; - return this; - } - - /** - * @return {@link #description} (The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ReferralRequest.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ReferralRequest setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary. - */ - public ReferralRequest setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion.) - */ - public List getServiceRequested() { - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - return this.serviceRequested; - } - - public boolean hasServiceRequested() { - if (this.serviceRequested == null) - return false; - for (CodeableConcept item : this.serviceRequested) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceRequested} (The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion.) - */ - // syntactic sugar - public CodeableConcept addServiceRequested() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - this.serviceRequested.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addServiceRequested(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceRequested == null) - this.serviceRequested = new ArrayList(); - this.serviceRequested.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) - */ - public List getSupportingInformation() { - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - return this.supportingInformation; - } - - public boolean hasSupportingInformation() { - if (this.supportingInformation == null) - return false; - for (Reference item : this.supportingInformation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supportingInformation} (Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) - */ - // syntactic sugar - public Reference addSupportingInformation() { //3 - Reference t = new Reference(); - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return t; - } - - // syntactic sugar - public ReferralRequest addSupportingInformation(Reference t) { //3 - if (t == null) - return this; - if (this.supportingInformation == null) - this.supportingInformation = new ArrayList(); - this.supportingInformation.add(t); - return this; - } - - /** - * @return {@link #supportingInformation} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.) - */ - public List getSupportingInformationTarget() { - if (this.supportingInformationTarget == null) - this.supportingInformationTarget = new ArrayList(); - return this.supportingInformationTarget; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Business identifier that uniquely identifies the referral/care transfer request instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("basedOn", "Reference(ReferralRequest|CarePlan|DiagnosticOrder|ProcedureRequest)", "Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part.", 0, java.lang.Integer.MAX_VALUE, basedOn)); - childrenList.add(new Property("parent", "Identifier", "The business identifier of the logical \"grouping\" request/order that this referral is a part of.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("status", "code", "The status of the authorization/intention reflected by the referral request record.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("category", "code", "Distinguishes the \"level\" of authorization/demand implicit in this request.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("type", "CodeableConcept", "An indication of the type of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("priority", "CodeableConcept", "An indication of the urgency of referral (or where applicable the type of transfer of care) request.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient who is the subject of a referral or transfer of care request.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("context", "Reference(Encounter|EpisodeOfCare)", "The encounter at which the request for referral or transfer of care is initiated.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("fulfillmentTime", "Period", "The period of time within which the services identified in the referral/transfer of care is specified or required to occur.", 0, java.lang.Integer.MAX_VALUE, fulfillmentTime)); - childrenList.add(new Property("authored", "dateTime", "Date/DateTime of creation for draft requests and date of activation for active requests.", 0, java.lang.Integer.MAX_VALUE, authored)); - childrenList.add(new Property("requester", "Reference(Practitioner|Organization|Patient)", "The healthcare provider or provider organization who/which initiated the referral/transfer of care request. Can also be Patient (a self referral).", 0, java.lang.Integer.MAX_VALUE, requester)); - childrenList.add(new Property("specialty", "CodeableConcept", "Indication of the clinical domain or discipline to which the referral or transfer of care request is sent. For example: Cardiology Gastroenterology Diabetology.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("recipient", "Reference(Practitioner|Organization)", "The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request.", 0, java.lang.Integer.MAX_VALUE, recipient)); - childrenList.add(new Property("reason", "CodeableConcept", "Description of clinical condition indicating why referral/transfer of care is requested. For example: Pathological Anomalies, Disabled (physical or mental), Behavioral Management.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("description", "string", "The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("serviceRequested", "CodeableConcept", "The service(s) that is/are requested to be provided to the patient. For example: cardiac pacemaker insertion.", 0, java.lang.Integer.MAX_VALUE, serviceRequested)); - childrenList.add(new Property("supportingInformation", "Reference(Any)", "Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care. For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan.", 0, java.lang.Integer.MAX_VALUE, supportingInformation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -332612366: /*basedOn*/ return this.basedOn == null ? new Base[0] : this.basedOn.toArray(new Base[this.basedOn.size()]); // Reference - case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // CodeableConcept - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // Reference - case 1098185163: /*fulfillmentTime*/ return this.fulfillmentTime == null ? new Base[0] : new Base[] {this.fulfillmentTime}; // Period - case 1433073514: /*authored*/ return this.authored == null ? new Base[0] : new Base[] {this.authored}; // DateTimeType - case 693933948: /*requester*/ return this.requester == null ? new Base[0] : new Base[] {this.requester}; // Reference - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : new Base[] {this.specialty}; // CodeableConcept - case 820081177: /*recipient*/ return this.recipient == null ? new Base[0] : this.recipient.toArray(new Base[this.recipient.size()]); // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 190229561: /*serviceRequested*/ return this.serviceRequested == null ? new Base[0] : this.serviceRequested.toArray(new Base[this.serviceRequested.size()]); // CodeableConcept - case -1248768647: /*supportingInformation*/ return this.supportingInformation == null ? new Base[0] : this.supportingInformation.toArray(new Base[this.supportingInformation.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -332612366: // basedOn - this.getBasedOn().add(castToReference(value)); // Reference - break; - case -995424086: // parent - this.parent = castToIdentifier(value); // Identifier - break; - case -892481550: // status - this.status = new ReferralStatusEnumFactory().fromType(value); // Enumeration - break; - case 50511102: // category - this.category = new ReferralCategoryEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1165461084: // priority - this.priority = castToCodeableConcept(value); // CodeableConcept - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 951530927: // context - this.context = castToReference(value); // Reference - break; - case 1098185163: // fulfillmentTime - this.fulfillmentTime = castToPeriod(value); // Period - break; - case 1433073514: // authored - this.authored = castToDateTime(value); // DateTimeType - break; - case 693933948: // requester - this.requester = castToReference(value); // Reference - break; - case -1694759682: // specialty - this.specialty = castToCodeableConcept(value); // CodeableConcept - break; - case 820081177: // recipient - this.getRecipient().add(castToReference(value)); // Reference - break; - case -934964668: // reason - this.reason = castToCodeableConcept(value); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 190229561: // serviceRequested - this.getServiceRequested().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1248768647: // supportingInformation - this.getSupportingInformation().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("basedOn")) - this.getBasedOn().add(castToReference(value)); - else if (name.equals("parent")) - this.parent = castToIdentifier(value); // Identifier - else if (name.equals("status")) - this.status = new ReferralStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("category")) - this.category = new ReferralCategoryEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("priority")) - this.priority = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("context")) - this.context = castToReference(value); // Reference - else if (name.equals("fulfillmentTime")) - this.fulfillmentTime = castToPeriod(value); // Period - else if (name.equals("authored")) - this.authored = castToDateTime(value); // DateTimeType - else if (name.equals("requester")) - this.requester = castToReference(value); // Reference - else if (name.equals("specialty")) - this.specialty = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("recipient")) - this.getRecipient().add(castToReference(value)); - else if (name.equals("reason")) - this.reason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("serviceRequested")) - this.getServiceRequested().add(castToCodeableConcept(value)); - else if (name.equals("supportingInformation")) - this.getSupportingInformation().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -332612366: return addBasedOn(); // Reference - case -995424086: return getParent(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 50511102: throw new FHIRException("Cannot make property category as it is not a complex type"); // Enumeration - case 3575610: return getType(); // CodeableConcept - case -1165461084: return getPriority(); // CodeableConcept - case -791418107: return getPatient(); // Reference - case 951530927: return getContext(); // Reference - case 1098185163: return getFulfillmentTime(); // Period - case 1433073514: throw new FHIRException("Cannot make property authored as it is not a complex type"); // DateTimeType - case 693933948: return getRequester(); // Reference - case -1694759682: return getSpecialty(); // CodeableConcept - case 820081177: return addRecipient(); // Reference - case -934964668: return getReason(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 190229561: return addServiceRequested(); // CodeableConcept - case -1248768647: return addSupportingInformation(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("basedOn")) { - return addBasedOn(); - } - else if (name.equals("parent")) { - this.parent = new Identifier(); - return this.parent; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.status"); - } - else if (name.equals("category")) { - throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.category"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("priority")) { - this.priority = new CodeableConcept(); - return this.priority; - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("context")) { - this.context = new Reference(); - return this.context; - } - else if (name.equals("fulfillmentTime")) { - this.fulfillmentTime = new Period(); - return this.fulfillmentTime; - } - else if (name.equals("authored")) { - throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.authored"); - } - else if (name.equals("requester")) { - this.requester = new Reference(); - return this.requester; - } - else if (name.equals("specialty")) { - this.specialty = new CodeableConcept(); - return this.specialty; - } - else if (name.equals("recipient")) { - return addRecipient(); - } - else if (name.equals("reason")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ReferralRequest.description"); - } - else if (name.equals("serviceRequested")) { - return addServiceRequested(); - } - else if (name.equals("supportingInformation")) { - return addSupportingInformation(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ReferralRequest"; - - } - - public ReferralRequest copy() { - ReferralRequest dst = new ReferralRequest(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (basedOn != null) { - dst.basedOn = new ArrayList(); - for (Reference i : basedOn) - dst.basedOn.add(i.copy()); - }; - dst.parent = parent == null ? null : parent.copy(); - dst.status = status == null ? null : status.copy(); - dst.category = category == null ? null : category.copy(); - dst.type = type == null ? null : type.copy(); - dst.priority = priority == null ? null : priority.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.context = context == null ? null : context.copy(); - dst.fulfillmentTime = fulfillmentTime == null ? null : fulfillmentTime.copy(); - dst.authored = authored == null ? null : authored.copy(); - dst.requester = requester == null ? null : requester.copy(); - dst.specialty = specialty == null ? null : specialty.copy(); - if (recipient != null) { - dst.recipient = new ArrayList(); - for (Reference i : recipient) - dst.recipient.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - dst.description = description == null ? null : description.copy(); - if (serviceRequested != null) { - dst.serviceRequested = new ArrayList(); - for (CodeableConcept i : serviceRequested) - dst.serviceRequested.add(i.copy()); - }; - if (supportingInformation != null) { - dst.supportingInformation = new ArrayList(); - for (Reference i : supportingInformation) - dst.supportingInformation.add(i.copy()); - }; - return dst; - } - - protected ReferralRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ReferralRequest)) - return false; - ReferralRequest o = (ReferralRequest) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(basedOn, o.basedOn, true) && compareDeep(parent, o.parent, true) - && compareDeep(status, o.status, true) && compareDeep(category, o.category, true) && compareDeep(type, o.type, true) - && compareDeep(priority, o.priority, true) && compareDeep(patient, o.patient, true) && compareDeep(context, o.context, true) - && compareDeep(fulfillmentTime, o.fulfillmentTime, true) && compareDeep(authored, o.authored, true) - && compareDeep(requester, o.requester, true) && compareDeep(specialty, o.specialty, true) && compareDeep(recipient, o.recipient, true) - && compareDeep(reason, o.reason, true) && compareDeep(description, o.description, true) && compareDeep(serviceRequested, o.serviceRequested, true) - && compareDeep(supportingInformation, o.supportingInformation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ReferralRequest)) - return false; - ReferralRequest o = (ReferralRequest) other; - return compareValues(status, o.status, true) && compareValues(category, o.category, true) && compareValues(authored, o.authored, true) - && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (basedOn == null || basedOn.isEmpty()) - && (parent == null || parent.isEmpty()) && (status == null || status.isEmpty()) && (category == null || category.isEmpty()) - && (type == null || type.isEmpty()) && (priority == null || priority.isEmpty()) && (patient == null || patient.isEmpty()) - && (context == null || context.isEmpty()) && (fulfillmentTime == null || fulfillmentTime.isEmpty()) - && (authored == null || authored.isEmpty()) && (requester == null || requester.isEmpty()) - && (specialty == null || specialty.isEmpty()) && (recipient == null || recipient.isEmpty()) - && (reason == null || reason.isEmpty()) && (description == null || description.isEmpty()) - && (serviceRequested == null || serviceRequested.isEmpty()) && (supportingInformation == null || supportingInformation.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ReferralRequest; - } - - /** - * Search parameter: category - *

- * Description: Proposal, plan or request
- * Type: token
- * Path: ReferralRequest.category
- *

- */ - @SearchParamDefinition(name="category", path="ReferralRequest.category", description="Proposal, plan or request", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: Proposal, plan or request
- * Type: token
- * Path: ReferralRequest.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: requester - *

- * Description: Requester of referral / transfer of care
- * Type: reference
- * Path: ReferralRequest.requester
- *

- */ - @SearchParamDefinition(name="requester", path="ReferralRequest.requester", description="Requester of referral / transfer of care", type="reference" ) - public static final String SP_REQUESTER = "requester"; - /** - * Fluent Client search parameter constant for requester - *

- * Description: Requester of referral / transfer of care
- * Type: reference
- * Path: ReferralRequest.requester
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam REQUESTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_REQUESTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ReferralRequest:requester". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_REQUESTER = new ca.uhn.fhir.model.api.Include("ReferralRequest:requester").toLocked(); - - /** - * Search parameter: patient - *

- * Description: Who the referral is about
- * Type: reference
- * Path: ReferralRequest.patient
- *

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

- * Description: Who the referral is about
- * Type: reference
- * Path: ReferralRequest.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ReferralRequest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("ReferralRequest:patient").toLocked(); - - /** - * Search parameter: status - *

- * Description: The status of the referral
- * Type: token
- * Path: ReferralRequest.status
- *

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

- * Description: The status of the referral
- * Type: token
- * Path: ReferralRequest.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: priority - *

- * Description: The priority assigned to the referral
- * Type: token
- * Path: ReferralRequest.priority
- *

- */ - @SearchParamDefinition(name="priority", path="ReferralRequest.priority", description="The priority assigned to the referral", type="token" ) - public static final String SP_PRIORITY = "priority"; - /** - * Fluent Client search parameter constant for priority - *

- * Description: The priority assigned to the referral
- * Type: token
- * Path: ReferralRequest.priority
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); - - /** - * Search parameter: basedon - *

- * Description: Request being fulfilled
- * Type: reference
- * Path: ReferralRequest.basedOn
- *

- */ - @SearchParamDefinition(name="basedon", path="ReferralRequest.basedOn", description="Request being fulfilled", type="reference" ) - public static final String SP_BASEDON = "basedon"; - /** - * Fluent Client search parameter constant for basedon - *

- * Description: Request being fulfilled
- * Type: reference
- * Path: ReferralRequest.basedOn
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam BASEDON = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_BASEDON); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ReferralRequest:basedon". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_BASEDON = new ca.uhn.fhir.model.api.Include("ReferralRequest:basedon").toLocked(); - - /** - * Search parameter: context - *

- * Description: Part of encounter or episode of care
- * Type: reference
- * Path: ReferralRequest.context
- *

- */ - @SearchParamDefinition(name="context", path="ReferralRequest.context", description="Part of encounter or episode of care", type="reference" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: Part of encounter or episode of care
- * Type: reference
- * Path: ReferralRequest.context
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONTEXT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ReferralRequest:context". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CONTEXT = new ca.uhn.fhir.model.api.Include("ReferralRequest:context").toLocked(); - - /** - * Search parameter: parent - *

- * Description: Part of common request
- * Type: token
- * Path: ReferralRequest.parent
- *

- */ - @SearchParamDefinition(name="parent", path="ReferralRequest.parent", description="Part of common request", type="token" ) - public static final String SP_PARENT = "parent"; - /** - * Fluent Client search parameter constant for parent - *

- * Description: Part of common request
- * Type: token
- * Path: ReferralRequest.parent
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PARENT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PARENT); - - /** - * Search parameter: type - *

- * Description: The type of the referral
- * Type: token
- * Path: ReferralRequest.type
- *

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

- * Description: The type of the referral
- * Type: token
- * Path: ReferralRequest.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: date - *

- * Description: Creation or activation date
- * Type: date
- * Path: ReferralRequest.authored
- *

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

- * Description: Creation or activation date
- * Type: date
- * Path: ReferralRequest.authored
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: specialty - *

- * Description: The specialty that the referral is for
- * Type: token
- * Path: ReferralRequest.specialty
- *

- */ - @SearchParamDefinition(name="specialty", path="ReferralRequest.specialty", description="The specialty that the referral is for", type="token" ) - public static final String SP_SPECIALTY = "specialty"; - /** - * Fluent Client search parameter constant for specialty - *

- * Description: The specialty that the referral is for
- * Type: token
- * Path: ReferralRequest.specialty
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIALTY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIALTY); - - /** - * Search parameter: recipient - *

- * Description: The person that the referral was sent to
- * Type: reference
- * Path: ReferralRequest.recipient
- *

- */ - @SearchParamDefinition(name="recipient", path="ReferralRequest.recipient", description="The person that the referral was sent to", type="reference" ) - public static final String SP_RECIPIENT = "recipient"; - /** - * Fluent Client search parameter constant for recipient - *

- * Description: The person that the referral was sent to
- * Type: reference
- * Path: ReferralRequest.recipient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECIPIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECIPIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "ReferralRequest:recipient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECIPIENT = new ca.uhn.fhir.model.api.Include("ReferralRequest:recipient").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/RelatedPerson.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/RelatedPerson.java deleted file mode 100644 index f451d012713..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/RelatedPerson.java +++ /dev/null @@ -1,1055 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGender; -import org.hl7.fhir.dstu2016may.model.Enumerations.AdministrativeGenderEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * 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. - */ -@ResourceDef(name="RelatedPerson", profile="http://hl7.org/fhir/Profile/RelatedPerson") -public class RelatedPerson extends DomainResource { - - /** - * Identifier for a person within a particular scope. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A human identifier for this person", formalDefinition="Identifier for a person within a particular scope." ) - protected List identifier; - - /** - * The patient this person is related to. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The patient this person is related to", formalDefinition="The patient this person is related to." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient this person is related to.) - */ - protected Patient patientTarget; - - /** - * The nature of the relationship between a patient and the related person. - */ - @Child(name = "relationship", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The nature of the relationship", formalDefinition="The nature of the relationship between a patient and the related person." ) - protected CodeableConcept relationship; - - /** - * A name associated with the person. - */ - @Child(name = "name", type = {HumanName.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A name associated with the person", formalDefinition="A name associated with the person." ) - protected HumanName name; - - /** - * A contact detail for the person, e.g. a telephone number or an email address. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A contact detail for the person", formalDefinition="A contact detail for the person, e.g. a telephone number or an email address." ) - protected List telecom; - - /** - * Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - @Child(name = "gender", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="male | female | other | unknown", formalDefinition="Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes." ) - protected Enumeration gender; - - /** - * The date on which the related person was born. - */ - @Child(name = "birthDate", type = {DateType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The date on which the related person was born", formalDefinition="The date on which the related person was born." ) - protected DateType birthDate; - - /** - * Address where the related person can be contacted or visited. - */ - @Child(name = "address", type = {Address.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Address where the related person can be contacted or visited", formalDefinition="Address where the related person can be contacted or visited." ) - protected List
address; - - /** - * Image of the person. - */ - @Child(name = "photo", type = {Attachment.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Image of the person", formalDefinition="Image of the person." ) - protected List photo; - - /** - * The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown. - */ - @Child(name = "period", type = {Period.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Period of time that this relationship is considered valid", formalDefinition="The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown." ) - protected Period period; - - private static final long serialVersionUID = 7777543L; - - /** - * Constructor - */ - public RelatedPerson() { - super(); - } - - /** - * Constructor - */ - public RelatedPerson(Reference patient) { - super(); - this.patient = patient; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Identifier for a person within a particular scope.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #patient} (The patient this person is related to.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient this person is related to.) - */ - public RelatedPerson setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient this person is related to.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient this person is related to.) - */ - public RelatedPerson setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #relationship} (The nature of the relationship between a patient and the related person.) - */ - public CodeableConcept getRelationship() { - if (this.relationship == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.relationship"); - else if (Configuration.doAutoCreate()) - this.relationship = new CodeableConcept(); // cc - return this.relationship; - } - - public boolean hasRelationship() { - return this.relationship != null && !this.relationship.isEmpty(); - } - - /** - * @param value {@link #relationship} (The nature of the relationship between a patient and the related person.) - */ - public RelatedPerson setRelationship(CodeableConcept value) { - this.relationship = value; - return this; - } - - /** - * @return {@link #name} (A name associated with the person.) - */ - public HumanName getName() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.name"); - else if (Configuration.doAutoCreate()) - this.name = new HumanName(); // cc - return this.name; - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name associated with the person.) - */ - public RelatedPerson setName(HumanName value) { - this.name = value; - return this; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (A contact detail for the person, e.g. a telephone number or an email address.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - /** - * @return {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public Enumeration getGenderElement() { - if (this.gender == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.gender"); - else if (Configuration.doAutoCreate()) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); // bb - return this.gender; - } - - public boolean hasGenderElement() { - return this.gender != null && !this.gender.isEmpty(); - } - - public boolean hasGender() { - return this.gender != null && !this.gender.isEmpty(); - } - - /** - * @param value {@link #gender} (Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.). This is the underlying object with id, value and extensions. The accessor "getGender" gives direct access to the value - */ - public RelatedPerson setGenderElement(Enumeration value) { - this.gender = value; - return this; - } - - /** - * @return Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public AdministrativeGender getGender() { - return this.gender == null ? null : this.gender.getValue(); - } - - /** - * @param value Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes. - */ - public RelatedPerson setGender(AdministrativeGender value) { - if (value == null) - this.gender = null; - else { - if (this.gender == null) - this.gender = new Enumeration(new AdministrativeGenderEnumFactory()); - this.gender.setValue(value); - } - return this; - } - - /** - * @return {@link #birthDate} (The date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public DateType getBirthDateElement() { - if (this.birthDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.birthDate"); - else if (Configuration.doAutoCreate()) - this.birthDate = new DateType(); // bb - return this.birthDate; - } - - public boolean hasBirthDateElement() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - public boolean hasBirthDate() { - return this.birthDate != null && !this.birthDate.isEmpty(); - } - - /** - * @param value {@link #birthDate} (The date on which the related person was born.). This is the underlying object with id, value and extensions. The accessor "getBirthDate" gives direct access to the value - */ - public RelatedPerson setBirthDateElement(DateType value) { - this.birthDate = value; - return this; - } - - /** - * @return The date on which the related person was born. - */ - public Date getBirthDate() { - return this.birthDate == null ? null : this.birthDate.getValue(); - } - - /** - * @param value The date on which the related person was born. - */ - public RelatedPerson setBirthDate(Date value) { - if (value == null) - this.birthDate = null; - else { - if (this.birthDate == null) - this.birthDate = new DateType(); - this.birthDate.setValue(value); - } - return this; - } - - /** - * @return {@link #address} (Address where the related person can be contacted or visited.) - */ - public List
getAddress() { - if (this.address == null) - this.address = new ArrayList
(); - return this.address; - } - - public boolean hasAddress() { - if (this.address == null) - return false; - for (Address item : this.address) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #address} (Address where the related person can be contacted or visited.) - */ - // syntactic sugar - public Address addAddress() { //3 - Address t = new Address(); - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addAddress(Address t) { //3 - if (t == null) - return this; - if (this.address == null) - this.address = new ArrayList
(); - this.address.add(t); - return this; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - public List getPhoto() { - if (this.photo == null) - this.photo = new ArrayList(); - return this.photo; - } - - public boolean hasPhoto() { - if (this.photo == null) - return false; - for (Attachment item : this.photo) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #photo} (Image of the person.) - */ - // syntactic sugar - public Attachment addPhoto() { //3 - Attachment t = new Attachment(); - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return t; - } - - // syntactic sugar - public RelatedPerson addPhoto(Attachment t) { //3 - if (t == null) - return this; - if (this.photo == null) - this.photo = new ArrayList(); - this.photo.add(t); - return this; - } - - /** - * @return {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) - */ - public Period getPeriod() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RelatedPerson.period"); - else if (Configuration.doAutoCreate()) - this.period = new Period(); // cc - return this.period; - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.) - */ - public RelatedPerson setPeriod(Period value) { - this.period = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier for a person within a particular scope.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient this person is related to.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("relationship", "CodeableConcept", "The nature of the relationship between a patient and the related person.", 0, java.lang.Integer.MAX_VALUE, relationship)); - childrenList.add(new Property("name", "HumanName", "A name associated with the person.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "A contact detail for the person, e.g. a telephone number or an email address.", 0, java.lang.Integer.MAX_VALUE, telecom)); - childrenList.add(new Property("gender", "code", "Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.", 0, java.lang.Integer.MAX_VALUE, gender)); - childrenList.add(new Property("birthDate", "date", "The date on which the related person was born.", 0, java.lang.Integer.MAX_VALUE, birthDate)); - childrenList.add(new Property("address", "Address", "Address where the related person can be contacted or visited.", 0, java.lang.Integer.MAX_VALUE, address)); - childrenList.add(new Property("photo", "Attachment", "Image of the person.", 0, java.lang.Integer.MAX_VALUE, photo)); - childrenList.add(new Property("period", "Period", "The period of time that this relationship is considered to be valid. If there are no dates defined, then the interval is unknown.", 0, java.lang.Integer.MAX_VALUE, period)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -261851592: /*relationship*/ return this.relationship == null ? new Base[0] : new Base[] {this.relationship}; // CodeableConcept - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // HumanName - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - case -1249512767: /*gender*/ return this.gender == null ? new Base[0] : new Base[] {this.gender}; // Enumeration - case -1210031859: /*birthDate*/ return this.birthDate == null ? new Base[0] : new Base[] {this.birthDate}; // DateType - case -1147692044: /*address*/ return this.address == null ? new Base[0] : this.address.toArray(new Base[this.address.size()]); // Address - case 106642994: /*photo*/ return this.photo == null ? new Base[0] : this.photo.toArray(new Base[this.photo.size()]); // Attachment - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -261851592: // relationship - this.relationship = castToCodeableConcept(value); // CodeableConcept - break; - case 3373707: // name - this.name = castToHumanName(value); // HumanName - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - case -1249512767: // gender - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - break; - case -1210031859: // birthDate - this.birthDate = castToDate(value); // DateType - break; - case -1147692044: // address - this.getAddress().add(castToAddress(value)); // Address - break; - case 106642994: // photo - this.getPhoto().add(castToAttachment(value)); // Attachment - break; - case -991726143: // period - this.period = castToPeriod(value); // Period - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("relationship")) - this.relationship = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("name")) - this.name = castToHumanName(value); // HumanName - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else if (name.equals("gender")) - this.gender = new AdministrativeGenderEnumFactory().fromType(value); // Enumeration - else if (name.equals("birthDate")) - this.birthDate = castToDate(value); // DateType - else if (name.equals("address")) - this.getAddress().add(castToAddress(value)); - else if (name.equals("photo")) - this.getPhoto().add(castToAttachment(value)); - else if (name.equals("period")) - this.period = castToPeriod(value); // Period - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -791418107: return getPatient(); // Reference - case -261851592: return getRelationship(); // CodeableConcept - case 3373707: return getName(); // HumanName - case -1429363305: return addTelecom(); // ContactPoint - case -1249512767: throw new FHIRException("Cannot make property gender as it is not a complex type"); // Enumeration - case -1210031859: throw new FHIRException("Cannot make property birthDate as it is not a complex type"); // DateType - case -1147692044: return addAddress(); // Address - case 106642994: return addPhoto(); // Attachment - case -991726143: return getPeriod(); // Period - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("relationship")) { - this.relationship = new CodeableConcept(); - return this.relationship; - } - else if (name.equals("name")) { - this.name = new HumanName(); - return this.name; - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else if (name.equals("gender")) { - throw new FHIRException("Cannot call addChild on a primitive type RelatedPerson.gender"); - } - else if (name.equals("birthDate")) { - throw new FHIRException("Cannot call addChild on a primitive type RelatedPerson.birthDate"); - } - else if (name.equals("address")) { - return addAddress(); - } - else if (name.equals("photo")) { - return addPhoto(); - } - else if (name.equals("period")) { - this.period = new Period(); - return this.period; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "RelatedPerson"; - - } - - public RelatedPerson copy() { - RelatedPerson dst = new RelatedPerson(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.patient = patient == null ? null : patient.copy(); - dst.relationship = relationship == null ? null : relationship.copy(); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - dst.gender = gender == null ? null : gender.copy(); - dst.birthDate = birthDate == null ? null : birthDate.copy(); - if (address != null) { - dst.address = new ArrayList
(); - for (Address i : address) - dst.address.add(i.copy()); - }; - if (photo != null) { - dst.photo = new ArrayList(); - for (Attachment i : photo) - dst.photo.add(i.copy()); - }; - dst.period = period == null ? null : period.copy(); - return dst; - } - - protected RelatedPerson typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RelatedPerson)) - return false; - RelatedPerson o = (RelatedPerson) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(patient, o.patient, true) && compareDeep(relationship, o.relationship, true) - && compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true) && compareDeep(gender, o.gender, true) - && compareDeep(birthDate, o.birthDate, true) && compareDeep(address, o.address, true) && compareDeep(photo, o.photo, true) - && compareDeep(period, o.period, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RelatedPerson)) - return false; - RelatedPerson o = (RelatedPerson) other; - return compareValues(gender, o.gender, true) && compareValues(birthDate, o.birthDate, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (patient == null || patient.isEmpty()) - && (relationship == null || relationship.isEmpty()) && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - && (gender == null || gender.isEmpty()) && (birthDate == null || birthDate.isEmpty()) && (address == null || address.isEmpty()) - && (photo == null || photo.isEmpty()) && (period == null || period.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.RelatedPerson; - } - - /** - * Search parameter: phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: RelatedPerson.telecom(system=phone)
- *

- */ - @SearchParamDefinition(name="phone", path="RelatedPerson.telecom.where(system='phone')", description="A value in a phone contact", type="token" ) - public static final String SP_PHONE = "phone"; - /** - * Fluent Client search parameter constant for phone - *

- * Description: A value in a phone contact
- * Type: token
- * Path: RelatedPerson.telecom(system=phone)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PHONE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PHONE); - - /** - * Search parameter: phonetic - *

- * Description: A portion of name using some kind of phonetic matching algorithm
- * Type: string
- * Path: RelatedPerson.name
- *

- */ - @SearchParamDefinition(name="phonetic", path="RelatedPerson.name", 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: RelatedPerson.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PHONETIC = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PHONETIC); - - /** - * Search parameter: address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: RelatedPerson.address.country
- *

- */ - @SearchParamDefinition(name="address-country", path="RelatedPerson.address.country", description="A country specified in an address", type="string" ) - public static final String SP_ADDRESS_COUNTRY = "address-country"; - /** - * Fluent Client search parameter constant for address-country - *

- * Description: A country specified in an address
- * Type: string
- * Path: RelatedPerson.address.country
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_COUNTRY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_COUNTRY); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RelatedPerson:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("RelatedPerson:patient").toLocked(); - - /** - * Search parameter: address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: RelatedPerson.address.city
- *

- */ - @SearchParamDefinition(name="address-city", path="RelatedPerson.address.city", description="A city specified in an address", type="string" ) - public static final String SP_ADDRESS_CITY = "address-city"; - /** - * Fluent Client search parameter constant for address-city - *

- * Description: A city specified in an address
- * Type: string
- * Path: RelatedPerson.address.city
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_CITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_CITY); - - /** - * Search parameter: address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: RelatedPerson.address.state
- *

- */ - @SearchParamDefinition(name="address-state", path="RelatedPerson.address.state", description="A state specified in an address", type="string" ) - public static final String SP_ADDRESS_STATE = "address-state"; - /** - * Fluent Client search parameter constant for address-state - *

- * Description: A state specified in an address
- * Type: string
- * Path: RelatedPerson.address.state
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_STATE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_STATE); - - /** - * Search parameter: email - *

- * Description: A value in an email contact
- * Type: token
- * Path: RelatedPerson.telecom(system=email)
- *

- */ - @SearchParamDefinition(name="email", path="RelatedPerson.telecom.where(system='email')", description="A value in an email contact", type="token" ) - public static final String SP_EMAIL = "email"; - /** - * Fluent Client search parameter constant for email - *

- * Description: A value in an email contact
- * Type: token
- * Path: RelatedPerson.telecom(system=email)
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EMAIL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EMAIL); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS); - - /** - * Search parameter: address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: RelatedPerson.address.use
- *

- */ - @SearchParamDefinition(name="address-use", path="RelatedPerson.address.use", description="A use code specified in an address", type="token" ) - public static final String SP_ADDRESS_USE = "address-use"; - /** - * Fluent Client search parameter constant for address-use - *

- * Description: A use code specified in an address
- * Type: token
- * Path: RelatedPerson.address.use
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ADDRESS_USE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ADDRESS_USE); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: birthdate - *

- * Description: The Related Person's date of birth
- * Type: date
- * Path: RelatedPerson.birthDate
- *

- */ - @SearchParamDefinition(name="birthdate", path="RelatedPerson.birthDate", description="The Related Person's date of birth", type="date" ) - public static final String SP_BIRTHDATE = "birthdate"; - /** - * Fluent Client search parameter constant for birthdate - *

- * Description: The Related Person's date of birth
- * Type: date
- * Path: RelatedPerson.birthDate
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam BIRTHDATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_BIRTHDATE); - - /** - * Search parameter: telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: RelatedPerson.telecom
- *

- */ - @SearchParamDefinition(name="telecom", path="RelatedPerson.telecom", description="The value in any kind of contact", type="token" ) - public static final String SP_TELECOM = "telecom"; - /** - * Fluent Client search parameter constant for telecom - *

- * Description: The value in any kind of contact
- * Type: token
- * Path: RelatedPerson.telecom
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TELECOM = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TELECOM); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam GENDER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_GENDER); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: RelatedPerson.address.postalCode
- *

- */ - @SearchParamDefinition(name="address-postalcode", path="RelatedPerson.address.postalCode", description="A postal code specified in an address", type="string" ) - public static final String SP_ADDRESS_POSTALCODE = "address-postalcode"; - /** - * Fluent Client search parameter constant for address-postalcode - *

- * Description: A postal code specified in an address
- * Type: string
- * Path: RelatedPerson.address.postalCode
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam ADDRESS_POSTALCODE = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_ADDRESS_POSTALCODE); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Resource.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Resource.java deleted file mode 100644 index c54fc87fb0b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Resource.java +++ /dev/null @@ -1,383 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IAnyResource; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * This is the base resource type for everything. - */ -public abstract class Resource extends BaseResource implements IAnyResource { - - /** - * The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - */ - @Child(name = "id", type = {IdType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id of this artifact", formalDefinition="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." ) - protected IdType id; - - /** - * The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource. - */ - @Child(name = "meta", type = {Meta.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Metadata about the resource", formalDefinition="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." ) - protected Meta meta; - - /** - * A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - @Child(name = "implicitRules", type = {UriType.class}, order=2, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="A set of rules under which this content was created", formalDefinition="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." ) - protected UriType implicitRules; - - /** - * The base language in which the resource is written. - */ - @Child(name = "language", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Language of the resource content", formalDefinition="The base language in which the resource is written." ) - protected CodeType language; - - private static final long serialVersionUID = -559462759L; - - /** - * Constructor - */ - public Resource() { - super(); - } - - /** - * @return {@link #id} (The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - public IdType getIdElement() { - if (this.id == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.id"); - else if (Configuration.doAutoCreate()) - this.id = new IdType(); // bb - return this.id; - } - - public boolean hasIdElement() { - return this.id != null && !this.id.isEmpty(); - } - - public boolean hasId() { - return this.id != null && !this.id.isEmpty(); - } - - /** - * @param value {@link #id} (The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.). This is the underlying object with id, value and extensions. The accessor "getId" gives direct access to the value - */ - @Override - public Resource setIdElement(IdType value) { - this.id = value; - return this; - } - - /** - * @return The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - */ - public String getId() { - return this.id == null ? null : this.id.getValue(); - } - - /** - * @param value The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes. - */ - public Resource setId(String value) { - if (Utilities.noString(value)) - this.id = null; - else { - if (this.id == null) - this.id = new IdType(); - this.id.setValue(value); - } - return this; - } - - /** - * @return {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) - */ - public Meta getMeta() { - if (this.meta == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.meta"); - else if (Configuration.doAutoCreate()) - this.meta = new Meta(); // cc - return this.meta; - } - - public boolean hasMeta() { - return this.meta != null && !this.meta.isEmpty(); - } - - /** - * @param value {@link #meta} (The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.) - */ - public Resource setMeta(Meta value) { - this.meta = value; - return this; - } - - /** - * @return {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value - */ - public UriType getImplicitRulesElement() { - if (this.implicitRules == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.implicitRules"); - else if (Configuration.doAutoCreate()) - this.implicitRules = new UriType(); // bb - return this.implicitRules; - } - - public boolean hasImplicitRulesElement() { - return this.implicitRules != null && !this.implicitRules.isEmpty(); - } - - public boolean hasImplicitRules() { - return this.implicitRules != null && !this.implicitRules.isEmpty(); - } - - /** - * @param value {@link #implicitRules} (A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.). This is the underlying object with id, value and extensions. The accessor "getImplicitRules" gives direct access to the value - */ - public Resource setImplicitRulesElement(UriType value) { - this.implicitRules = value; - return this; - } - - /** - * @return A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - public String getImplicitRules() { - return this.implicitRules == null ? null : this.implicitRules.getValue(); - } - - /** - * @param value A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. - */ - public Resource setImplicitRules(String value) { - if (Utilities.noString(value)) - this.implicitRules = null; - else { - if (this.implicitRules == null) - this.implicitRules = new UriType(); - this.implicitRules.setValue(value); - } - return this; - } - - /** - * @return {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Resource.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The base language in which the resource is written.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public Resource setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The base language in which the resource is written. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The base language in which the resource is written. - */ - public Resource setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - childrenList.add(new Property("id", "id", "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.", 0, java.lang.Integer.MAX_VALUE, id)); - childrenList.add(new Property("meta", "Meta", "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.", 0, java.lang.Integer.MAX_VALUE, meta)); - childrenList.add(new Property("implicitRules", "uri", "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.", 0, java.lang.Integer.MAX_VALUE, implicitRules)); - childrenList.add(new Property("language", "code", "The base language in which the resource is written.", 0, java.lang.Integer.MAX_VALUE, language)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3355: /*id*/ return this.id == null ? new Base[0] : new Base[] {this.id}; // IdType - case 3347973: /*meta*/ return this.meta == null ? new Base[0] : new Base[] {this.meta}; // Meta - case -961826286: /*implicitRules*/ return this.implicitRules == null ? new Base[0] : new Base[] {this.implicitRules}; // UriType - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3355: // id - this.id = castToId(value); // IdType - break; - case 3347973: // meta - this.meta = castToMeta(value); // Meta - break; - case -961826286: // implicitRules - this.implicitRules = castToUri(value); // UriType - break; - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("id")) - this.id = castToId(value); // IdType - else if (name.equals("meta")) - this.meta = castToMeta(value); // Meta - else if (name.equals("implicitRules")) - this.implicitRules = castToUri(value); // UriType - else if (name.equals("language")) - this.language = castToCode(value); // CodeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3355: throw new FHIRException("Cannot make property id as it is not a complex type"); // IdType - case 3347973: return getMeta(); // Meta - case -961826286: throw new FHIRException("Cannot make property implicitRules as it is not a complex type"); // UriType - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("id")) { - throw new FHIRException("Cannot call addChild on a primitive type Resource.id"); - } - else if (name.equals("meta")) { - this.meta = new Meta(); - return this.meta; - } - else if (name.equals("implicitRules")) { - throw new FHIRException("Cannot call addChild on a primitive type Resource.implicitRules"); - } - else if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type Resource.language"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Resource"; - - } - - public abstract Resource copy(); - - public void copyValues(Resource dst) { - dst.id = id == null ? null : id.copy(); - dst.meta = meta == null ? null : meta.copy(); - dst.implicitRules = implicitRules == null ? null : implicitRules.copy(); - dst.language = language == null ? null : language.copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Resource)) - return false; - Resource o = (Resource) other; - return compareDeep(id, o.id, true) && compareDeep(meta, o.meta, true) && compareDeep(implicitRules, o.implicitRules, true) - && compareDeep(language, o.language, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Resource)) - return false; - Resource o = (Resource) other; - return compareValues(id, o.id, true) && compareValues(implicitRules, o.implicitRules, true) && compareValues(language, o.language, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (id == null || id.isEmpty()) && (meta == null || meta.isEmpty()) && (implicitRules == null || implicitRules.isEmpty()) - && (language == null || language.isEmpty()); - } - - public abstract ResourceType getResourceType(); - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ResourceFactory.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ResourceFactory.java deleted file mode 100644 index 97c52cfab79..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ResourceFactory.java +++ /dev/null @@ -1,631 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import org.hl7.fhir.exceptions.FHIRException; - -public class ResourceFactory extends Factory { - - public static Resource createResource(String name) throws FHIRException { - if ("Condition".equals(name)) - return new Condition(); - if ("DeviceComponent".equals(name)) - return new DeviceComponent(); - if ("Communication".equals(name)) - return new Communication(); - if ("PractitionerRole".equals(name)) - return new PractitionerRole(); - if ("Group".equals(name)) - return new Group(); - if ("ValueSet".equals(name)) - return new ValueSet(); - if ("Coverage".equals(name)) - return new Coverage(); - if ("Appointment".equals(name)) - return new Appointment(); - if ("Library".equals(name)) - return new Library(); - if ("Slot".equals(name)) - return new Slot(); - if ("DecisionSupportRule".equals(name)) - return new DecisionSupportRule(); - if ("Composition".equals(name)) - return new Composition(); - if ("EpisodeOfCare".equals(name)) - return new EpisodeOfCare(); - if ("Conformance".equals(name)) - return new Conformance(); - if ("NamingSystem".equals(name)) - return new NamingSystem(); - if ("HealthcareService".equals(name)) - return new HealthcareService(); - if ("Linkage".equals(name)) - return new Linkage(); - if ("OrderResponse".equals(name)) - return new OrderResponse(); - if ("Task".equals(name)) - return new Task(); - if ("ConceptMap".equals(name)) - return new ConceptMap(); - if ("Practitioner".equals(name)) - return new Practitioner(); - if ("CarePlan".equals(name)) - return new CarePlan(); - if ("Substance".equals(name)) - return new Substance(); - if ("QuestionnaireResponse".equals(name)) - return new QuestionnaireResponse(); - if ("DeviceUseRequest".equals(name)) - return new DeviceUseRequest(); - if ("Schedule".equals(name)) - return new Schedule(); - if ("SupplyDelivery".equals(name)) - return new SupplyDelivery(); - if ("EligibilityRequest".equals(name)) - return new EligibilityRequest(); - if ("PaymentReconciliation".equals(name)) - return new PaymentReconciliation(); - if ("TestScript".equals(name)) - return new TestScript(); - if ("OperationDefinition".equals(name)) - return new OperationDefinition(); - if ("ImagingObjectSelection".equals(name)) - return new ImagingObjectSelection(); - if ("ClaimResponse".equals(name)) - return new ClaimResponse(); - if ("BodySite".equals(name)) - return new BodySite(); - if ("Flag".equals(name)) - return new Flag(); - if ("CommunicationRequest".equals(name)) - return new CommunicationRequest(); - if ("Claim".equals(name)) - return new Claim(); - if ("RiskAssessment".equals(name)) - return new RiskAssessment(); - if ("ExpansionProfile".equals(name)) - return new ExpansionProfile(); - if ("ExplanationOfBenefit".equals(name)) - return new ExplanationOfBenefit(); - if ("AllergyIntolerance".equals(name)) - return new AllergyIntolerance(); - if ("Observation".equals(name)) - return new Observation(); - if ("RelatedPerson".equals(name)) - return new RelatedPerson(); - if ("ProcessResponse".equals(name)) - return new ProcessResponse(); - if ("AuditEvent".equals(name)) - return new AuditEvent(); - if ("EligibilityResponse".equals(name)) - return new EligibilityResponse(); - if ("MedicationOrder".equals(name)) - return new MedicationOrder(); - if ("Person".equals(name)) - return new Person(); - if ("Parameters".equals(name)) - return new Parameters(); - if ("ModuleDefinition".equals(name)) - return new ModuleDefinition(); - if ("ProcedureRequest".equals(name)) - return new ProcedureRequest(); - if ("DeviceMetric".equals(name)) - return new DeviceMetric(); - if ("Organization".equals(name)) - return new Organization(); - if ("Measure".equals(name)) - return new Measure(); - if ("ProcessRequest".equals(name)) - return new ProcessRequest(); - if ("ImmunizationRecommendation".equals(name)) - return new ImmunizationRecommendation(); - if ("MedicationDispense".equals(name)) - return new MedicationDispense(); - if ("DetectedIssue".equals(name)) - return new DetectedIssue(); - if ("PaymentNotice".equals(name)) - return new PaymentNotice(); - if ("MedicationStatement".equals(name)) - return new MedicationStatement(); - if ("AppointmentResponse".equals(name)) - return new AppointmentResponse(); - if ("Sequence".equals(name)) - return new Sequence(); - if ("ImplementationGuide".equals(name)) - return new ImplementationGuide(); - if ("Protocol".equals(name)) - return new Protocol(); - if ("Questionnaire".equals(name)) - return new Questionnaire(); - if ("OperationOutcome".equals(name)) - return new OperationOutcome(); - if ("DecisionSupportServiceModule".equals(name)) - return new DecisionSupportServiceModule(); - if ("FamilyMemberHistory".equals(name)) - return new FamilyMemberHistory(); - if ("Media".equals(name)) - return new Media(); - if ("ImagingExcerpt".equals(name)) - return new ImagingExcerpt(); - if ("Binary".equals(name)) - return new Binary(); - if ("VisionPrescription".equals(name)) - return new VisionPrescription(); - if ("DocumentReference".equals(name)) - return new DocumentReference(); - if ("Immunization".equals(name)) - return new Immunization(); - if ("CareTeam".equals(name)) - return new CareTeam(); - if ("Bundle".equals(name)) - return new Bundle(); - if ("Subscription".equals(name)) - return new Subscription(); - if ("MeasureReport".equals(name)) - return new MeasureReport(); - if ("ImagingStudy".equals(name)) - return new ImagingStudy(); - if ("Provenance".equals(name)) - return new Provenance(); - if ("Device".equals(name)) - return new Device(); - if ("StructureDefinition".equals(name)) - return new StructureDefinition(); - if ("Account".equals(name)) - return new Account(); - if ("Order".equals(name)) - return new Order(); - if ("Procedure".equals(name)) - return new Procedure(); - if ("OrderSet".equals(name)) - return new OrderSet(); - if ("DiagnosticReport".equals(name)) - return new DiagnosticReport(); - if ("Medication".equals(name)) - return new Medication(); - if ("MessageHeader".equals(name)) - return new MessageHeader(); - if ("DocumentManifest".equals(name)) - return new DocumentManifest(); - if ("DataElement".equals(name)) - return new DataElement(); - if ("MedicationAdministration".equals(name)) - return new MedicationAdministration(); - if ("StructureMap".equals(name)) - return new StructureMap(); - if ("CompartmentDefinition".equals(name)) - return new CompartmentDefinition(); - if ("Encounter".equals(name)) - return new Encounter(); - if ("List".equals(name)) - return new ListResource(); - if ("CodeSystem".equals(name)) - return new CodeSystem(); - if ("DeviceUseStatement".equals(name)) - return new DeviceUseStatement(); - if ("Goal".equals(name)) - return new Goal(); - if ("GuidanceResponse".equals(name)) - return new GuidanceResponse(); - if ("SearchParameter".equals(name)) - return new SearchParameter(); - if ("NutritionOrder".equals(name)) - return new NutritionOrder(); - if ("ReferralRequest".equals(name)) - return new ReferralRequest(); - if ("ClinicalImpression".equals(name)) - return new ClinicalImpression(); - if ("EnrollmentRequest".equals(name)) - return new EnrollmentRequest(); - if ("Location".equals(name)) - return new Location(); - if ("Contract".equals(name)) - return new Contract(); - if ("Basic".equals(name)) - return new Basic(); - if ("Specimen".equals(name)) - return new Specimen(); - if ("EnrollmentResponse".equals(name)) - return new EnrollmentResponse(); - if ("SupplyRequest".equals(name)) - return new SupplyRequest(); - if ("Patient".equals(name)) - return new Patient(); - if ("DiagnosticOrder".equals(name)) - return new DiagnosticOrder(); - else - throw new FHIRException("Unknown Resource Name '"+name+"'"); - } - - public static Element createType(String name) throws FHIRException { - if ("Period".equals(name)) - return new Period(); - if ("Age".equals(name)) - return new Age(); - if ("Attachment".equals(name)) - return new Attachment(); - if ("Count".equals(name)) - return new Count(); - if ("SimpleQuantity".equals(name)) - return new SimpleQuantity(); - if ("Signature".equals(name)) - return new Signature(); - if ("Extension".equals(name)) - return new Extension(); - if ("ModuleMetadata".equals(name)) - return new ModuleMetadata(); - if ("ActionDefinition".equals(name)) - return new ActionDefinition(); - if ("HumanName".equals(name)) - return new HumanName(); - if ("Ratio".equals(name)) - return new Ratio(); - if ("Duration".equals(name)) - return new Duration(); - if ("CodeableConcept".equals(name)) - return new CodeableConcept(); - if ("Identifier".equals(name)) - return new Identifier(); - if ("Timing".equals(name)) - return new Timing(); - if ("Coding".equals(name)) - return new Coding(); - if ("Range".equals(name)) - return new Range(); - if ("Quantity".equals(name)) - return new Quantity(); - if ("Money".equals(name)) - return new Money(); - if ("Distance".equals(name)) - return new Distance(); - if ("DataRequirement".equals(name)) - return new DataRequirement(); - if ("ParameterDefinition".equals(name)) - return new ParameterDefinition(); - if ("ContactPoint".equals(name)) - return new ContactPoint(); - if ("TriggerDefinition".equals(name)) - return new TriggerDefinition(); - if ("ElementDefinition".equals(name)) - return new ElementDefinition(); - if ("Address".equals(name)) - return new Address(); - if ("Annotation".equals(name)) - return new Annotation(); - if ("Meta".equals(name)) - return new Meta(); - if ("SampledData".equals(name)) - return new SampledData(); - if ("Reference".equals(name)) - return new Reference(); - if ("Narrative".equals(name)) - return new Narrative(); - else - throw new FHIRException("Unknown Type Name '"+name+"'"); - } - - public static Base createResourceOrType(String name) throws FHIRException { - if ("Condition".equals(name)) - return new Condition(); - if ("DeviceComponent".equals(name)) - return new DeviceComponent(); - if ("Communication".equals(name)) - return new Communication(); - if ("PractitionerRole".equals(name)) - return new PractitionerRole(); - if ("Group".equals(name)) - return new Group(); - if ("ValueSet".equals(name)) - return new ValueSet(); - if ("Coverage".equals(name)) - return new Coverage(); - if ("Appointment".equals(name)) - return new Appointment(); - if ("Library".equals(name)) - return new Library(); - if ("Slot".equals(name)) - return new Slot(); - if ("DecisionSupportRule".equals(name)) - return new DecisionSupportRule(); - if ("Composition".equals(name)) - return new Composition(); - if ("EpisodeOfCare".equals(name)) - return new EpisodeOfCare(); - if ("Conformance".equals(name)) - return new Conformance(); - if ("NamingSystem".equals(name)) - return new NamingSystem(); - if ("HealthcareService".equals(name)) - return new HealthcareService(); - if ("Linkage".equals(name)) - return new Linkage(); - if ("OrderResponse".equals(name)) - return new OrderResponse(); - if ("Task".equals(name)) - return new Task(); - if ("ConceptMap".equals(name)) - return new ConceptMap(); - if ("Practitioner".equals(name)) - return new Practitioner(); - if ("CarePlan".equals(name)) - return new CarePlan(); - if ("Substance".equals(name)) - return new Substance(); - if ("QuestionnaireResponse".equals(name)) - return new QuestionnaireResponse(); - if ("DeviceUseRequest".equals(name)) - return new DeviceUseRequest(); - if ("Schedule".equals(name)) - return new Schedule(); - if ("SupplyDelivery".equals(name)) - return new SupplyDelivery(); - if ("EligibilityRequest".equals(name)) - return new EligibilityRequest(); - if ("PaymentReconciliation".equals(name)) - return new PaymentReconciliation(); - if ("TestScript".equals(name)) - return new TestScript(); - if ("OperationDefinition".equals(name)) - return new OperationDefinition(); - if ("ImagingObjectSelection".equals(name)) - return new ImagingObjectSelection(); - if ("ClaimResponse".equals(name)) - return new ClaimResponse(); - if ("BodySite".equals(name)) - return new BodySite(); - if ("Flag".equals(name)) - return new Flag(); - if ("CommunicationRequest".equals(name)) - return new CommunicationRequest(); - if ("Claim".equals(name)) - return new Claim(); - if ("RiskAssessment".equals(name)) - return new RiskAssessment(); - if ("ExpansionProfile".equals(name)) - return new ExpansionProfile(); - if ("ExplanationOfBenefit".equals(name)) - return new ExplanationOfBenefit(); - if ("AllergyIntolerance".equals(name)) - return new AllergyIntolerance(); - if ("Observation".equals(name)) - return new Observation(); - if ("RelatedPerson".equals(name)) - return new RelatedPerson(); - if ("ProcessResponse".equals(name)) - return new ProcessResponse(); - if ("AuditEvent".equals(name)) - return new AuditEvent(); - if ("EligibilityResponse".equals(name)) - return new EligibilityResponse(); - if ("MedicationOrder".equals(name)) - return new MedicationOrder(); - if ("Person".equals(name)) - return new Person(); - if ("Parameters".equals(name)) - return new Parameters(); - if ("ModuleDefinition".equals(name)) - return new ModuleDefinition(); - if ("ProcedureRequest".equals(name)) - return new ProcedureRequest(); - if ("DeviceMetric".equals(name)) - return new DeviceMetric(); - if ("Organization".equals(name)) - return new Organization(); - if ("Measure".equals(name)) - return new Measure(); - if ("ProcessRequest".equals(name)) - return new ProcessRequest(); - if ("ImmunizationRecommendation".equals(name)) - return new ImmunizationRecommendation(); - if ("MedicationDispense".equals(name)) - return new MedicationDispense(); - if ("DetectedIssue".equals(name)) - return new DetectedIssue(); - if ("PaymentNotice".equals(name)) - return new PaymentNotice(); - if ("MedicationStatement".equals(name)) - return new MedicationStatement(); - if ("AppointmentResponse".equals(name)) - return new AppointmentResponse(); - if ("Sequence".equals(name)) - return new Sequence(); - if ("ImplementationGuide".equals(name)) - return new ImplementationGuide(); - if ("Protocol".equals(name)) - return new Protocol(); - if ("Questionnaire".equals(name)) - return new Questionnaire(); - if ("OperationOutcome".equals(name)) - return new OperationOutcome(); - if ("DecisionSupportServiceModule".equals(name)) - return new DecisionSupportServiceModule(); - if ("FamilyMemberHistory".equals(name)) - return new FamilyMemberHistory(); - if ("Media".equals(name)) - return new Media(); - if ("ImagingExcerpt".equals(name)) - return new ImagingExcerpt(); - if ("Binary".equals(name)) - return new Binary(); - if ("VisionPrescription".equals(name)) - return new VisionPrescription(); - if ("DocumentReference".equals(name)) - return new DocumentReference(); - if ("Immunization".equals(name)) - return new Immunization(); - if ("CareTeam".equals(name)) - return new CareTeam(); - if ("Bundle".equals(name)) - return new Bundle(); - if ("Subscription".equals(name)) - return new Subscription(); - if ("MeasureReport".equals(name)) - return new MeasureReport(); - if ("ImagingStudy".equals(name)) - return new ImagingStudy(); - if ("Provenance".equals(name)) - return new Provenance(); - if ("Device".equals(name)) - return new Device(); - if ("StructureDefinition".equals(name)) - return new StructureDefinition(); - if ("Account".equals(name)) - return new Account(); - if ("Order".equals(name)) - return new Order(); - if ("Procedure".equals(name)) - return new Procedure(); - if ("OrderSet".equals(name)) - return new OrderSet(); - if ("DiagnosticReport".equals(name)) - return new DiagnosticReport(); - if ("Medication".equals(name)) - return new Medication(); - if ("MessageHeader".equals(name)) - return new MessageHeader(); - if ("DocumentManifest".equals(name)) - return new DocumentManifest(); - if ("DataElement".equals(name)) - return new DataElement(); - if ("MedicationAdministration".equals(name)) - return new MedicationAdministration(); - if ("StructureMap".equals(name)) - return new StructureMap(); - if ("CompartmentDefinition".equals(name)) - return new CompartmentDefinition(); - if ("Encounter".equals(name)) - return new Encounter(); - if ("List".equals(name)) - return new ListResource(); - if ("CodeSystem".equals(name)) - return new CodeSystem(); - if ("DeviceUseStatement".equals(name)) - return new DeviceUseStatement(); - if ("Goal".equals(name)) - return new Goal(); - if ("GuidanceResponse".equals(name)) - return new GuidanceResponse(); - if ("SearchParameter".equals(name)) - return new SearchParameter(); - if ("NutritionOrder".equals(name)) - return new NutritionOrder(); - if ("ReferralRequest".equals(name)) - return new ReferralRequest(); - if ("ClinicalImpression".equals(name)) - return new ClinicalImpression(); - if ("EnrollmentRequest".equals(name)) - return new EnrollmentRequest(); - if ("Location".equals(name)) - return new Location(); - if ("Contract".equals(name)) - return new Contract(); - if ("Basic".equals(name)) - return new Basic(); - if ("Specimen".equals(name)) - return new Specimen(); - if ("EnrollmentResponse".equals(name)) - return new EnrollmentResponse(); - if ("SupplyRequest".equals(name)) - return new SupplyRequest(); - if ("Patient".equals(name)) - return new Patient(); - if ("DiagnosticOrder".equals(name)) - return new DiagnosticOrder(); - if ("Period".equals(name)) - return new Period(); - if ("Age".equals(name)) - return new Age(); - if ("Attachment".equals(name)) - return new Attachment(); - if ("Count".equals(name)) - return new Count(); - if ("SimpleQuantity".equals(name)) - return new SimpleQuantity(); - if ("Signature".equals(name)) - return new Signature(); - if ("Extension".equals(name)) - return new Extension(); - if ("ModuleMetadata".equals(name)) - return new ModuleMetadata(); - if ("ActionDefinition".equals(name)) - return new ActionDefinition(); - if ("HumanName".equals(name)) - return new HumanName(); - if ("Ratio".equals(name)) - return new Ratio(); - if ("Duration".equals(name)) - return new Duration(); - if ("CodeableConcept".equals(name)) - return new CodeableConcept(); - if ("Identifier".equals(name)) - return new Identifier(); - if ("Timing".equals(name)) - return new Timing(); - if ("Coding".equals(name)) - return new Coding(); - if ("Range".equals(name)) - return new Range(); - if ("Quantity".equals(name)) - return new Quantity(); - if ("Money".equals(name)) - return new Money(); - if ("Distance".equals(name)) - return new Distance(); - if ("DataRequirement".equals(name)) - return new DataRequirement(); - if ("ParameterDefinition".equals(name)) - return new ParameterDefinition(); - if ("ContactPoint".equals(name)) - return new ContactPoint(); - if ("TriggerDefinition".equals(name)) - return new TriggerDefinition(); - if ("ElementDefinition".equals(name)) - return new ElementDefinition(); - if ("Address".equals(name)) - return new Address(); - if ("Annotation".equals(name)) - return new Annotation(); - if ("Meta".equals(name)) - return new Meta(); - if ("SampledData".equals(name)) - return new SampledData(); - if ("Reference".equals(name)) - return new Reference(); - if ("Narrative".equals(name)) - return new Narrative(); - else - throw new FHIRException("Unknown Resource or Type Name '"+name+"'"); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ResourceType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ResourceType.java deleted file mode 100644 index 4cd5fd8c54b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ResourceType.java +++ /dev/null @@ -1,587 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.exceptions.FHIRException; - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -public enum ResourceType { - Account, - AllergyIntolerance, - Appointment, - AppointmentResponse, - AuditEvent, - Basic, - Binary, - BodySite, - Bundle, - CarePlan, - CareTeam, - Claim, - ClaimResponse, - ClinicalImpression, - CodeSystem, - Communication, - CommunicationRequest, - CompartmentDefinition, - Composition, - ConceptMap, - Condition, - Conformance, - Contract, - Coverage, - DataElement, - DecisionSupportRule, - DecisionSupportServiceModule, - DetectedIssue, - Device, - DeviceComponent, - DeviceMetric, - DeviceUseRequest, - DeviceUseStatement, - DiagnosticOrder, - DiagnosticReport, - DocumentManifest, - DocumentReference, - EligibilityRequest, - EligibilityResponse, - Encounter, - EnrollmentRequest, - EnrollmentResponse, - EpisodeOfCare, - ExpansionProfile, - ExplanationOfBenefit, - FamilyMemberHistory, - Flag, - Goal, - Group, - GuidanceResponse, - HealthcareService, - ImagingExcerpt, - ImagingObjectSelection, - ImagingStudy, - Immunization, - ImmunizationRecommendation, - ImplementationGuide, - Library, - Linkage, - List, - Location, - Measure, - MeasureReport, - Media, - Medication, - MedicationAdministration, - MedicationDispense, - MedicationOrder, - MedicationStatement, - MessageHeader, - ModuleDefinition, - NamingSystem, - NutritionOrder, - Observation, - OperationDefinition, - OperationOutcome, - Order, - OrderResponse, - OrderSet, - Organization, - Parameters, - Patient, - PaymentNotice, - PaymentReconciliation, - Person, - Practitioner, - PractitionerRole, - Procedure, - ProcedureRequest, - ProcessRequest, - ProcessResponse, - Protocol, - Provenance, - Questionnaire, - QuestionnaireResponse, - ReferralRequest, - RelatedPerson, - RiskAssessment, - Schedule, - SearchParameter, - Sequence, - Slot, - Specimen, - StructureDefinition, - StructureMap, - Subscription, - Substance, - SupplyDelivery, - SupplyRequest, - Task, - TestScript, - ValueSet, - VisionPrescription; - - - public String getPath() {; - switch (this) { - case Account: - return "account"; - case AllergyIntolerance: - return "allergyintolerance"; - case Appointment: - return "appointment"; - case AppointmentResponse: - return "appointmentresponse"; - case AuditEvent: - return "auditevent"; - case Basic: - return "basic"; - case Binary: - return "binary"; - case BodySite: - return "bodysite"; - case Bundle: - return "bundle"; - case CarePlan: - return "careplan"; - case CareTeam: - return "careteam"; - case Claim: - return "claim"; - case ClaimResponse: - return "claimresponse"; - case ClinicalImpression: - return "clinicalimpression"; - case CodeSystem: - return "codesystem"; - case Communication: - return "communication"; - case CommunicationRequest: - return "communicationrequest"; - case CompartmentDefinition: - return "compartmentdefinition"; - case Composition: - return "composition"; - case ConceptMap: - return "conceptmap"; - case Condition: - return "condition"; - case Conformance: - return "conformance"; - case Contract: - return "contract"; - case Coverage: - return "coverage"; - case DataElement: - return "dataelement"; - case DecisionSupportRule: - return "decisionsupportrule"; - case DecisionSupportServiceModule: - return "decisionsupportservicemodule"; - case DetectedIssue: - return "detectedissue"; - case Device: - return "device"; - case DeviceComponent: - return "devicecomponent"; - case DeviceMetric: - return "devicemetric"; - case DeviceUseRequest: - return "deviceuserequest"; - case DeviceUseStatement: - return "deviceusestatement"; - case DiagnosticOrder: - return "diagnosticorder"; - case DiagnosticReport: - return "diagnosticreport"; - case DocumentManifest: - return "documentmanifest"; - case DocumentReference: - return "documentreference"; - case EligibilityRequest: - return "eligibilityrequest"; - case EligibilityResponse: - return "eligibilityresponse"; - case Encounter: - return "encounter"; - case EnrollmentRequest: - return "enrollmentrequest"; - case EnrollmentResponse: - return "enrollmentresponse"; - case EpisodeOfCare: - return "episodeofcare"; - case ExpansionProfile: - return "expansionprofile"; - case ExplanationOfBenefit: - return "explanationofbenefit"; - case FamilyMemberHistory: - return "familymemberhistory"; - case Flag: - return "flag"; - case Goal: - return "goal"; - case Group: - return "group"; - case GuidanceResponse: - return "guidanceresponse"; - case HealthcareService: - return "healthcareservice"; - case ImagingExcerpt: - return "imagingexcerpt"; - case ImagingObjectSelection: - return "imagingobjectselection"; - case ImagingStudy: - return "imagingstudy"; - case Immunization: - return "immunization"; - case ImmunizationRecommendation: - return "immunizationrecommendation"; - case ImplementationGuide: - return "implementationguide"; - case Library: - return "library"; - case Linkage: - return "linkage"; - case List: - return "list"; - case Location: - return "location"; - case Measure: - return "measure"; - case MeasureReport: - return "measurereport"; - case Media: - return "media"; - case Medication: - return "medication"; - case MedicationAdministration: - return "medicationadministration"; - case MedicationDispense: - return "medicationdispense"; - case MedicationOrder: - return "medicationorder"; - case MedicationStatement: - return "medicationstatement"; - case MessageHeader: - return "messageheader"; - case ModuleDefinition: - return "moduledefinition"; - case NamingSystem: - return "namingsystem"; - case NutritionOrder: - return "nutritionorder"; - case Observation: - return "observation"; - case OperationDefinition: - return "operationdefinition"; - case OperationOutcome: - return "operationoutcome"; - case Order: - return "order"; - case OrderResponse: - return "orderresponse"; - case OrderSet: - return "orderset"; - case Organization: - return "organization"; - case Parameters: - return "parameters"; - case Patient: - return "patient"; - case PaymentNotice: - return "paymentnotice"; - case PaymentReconciliation: - return "paymentreconciliation"; - case Person: - return "person"; - case Practitioner: - return "practitioner"; - case PractitionerRole: - return "practitionerrole"; - case Procedure: - return "procedure"; - case ProcedureRequest: - return "procedurerequest"; - case ProcessRequest: - return "processrequest"; - case ProcessResponse: - return "processresponse"; - case Protocol: - return "protocol"; - case Provenance: - return "provenance"; - case Questionnaire: - return "questionnaire"; - case QuestionnaireResponse: - return "questionnaireresponse"; - case ReferralRequest: - return "referralrequest"; - case RelatedPerson: - return "relatedperson"; - case RiskAssessment: - return "riskassessment"; - case Schedule: - return "schedule"; - case SearchParameter: - return "searchparameter"; - case Sequence: - return "sequence"; - case Slot: - return "slot"; - case Specimen: - return "specimen"; - case StructureDefinition: - return "structuredefinition"; - case StructureMap: - return "structuremap"; - case Subscription: - return "subscription"; - case Substance: - return "substance"; - case SupplyDelivery: - return "supplydelivery"; - case SupplyRequest: - return "supplyrequest"; - case Task: - return "task"; - case TestScript: - return "testscript"; - case ValueSet: - return "valueset"; - case VisionPrescription: - return "visionprescription"; - } - return null; - } - - - public static ResourceType fromCode(String code) throws FHIRException {; - if ("Account".equals(code)) - return Account; - if ("AllergyIntolerance".equals(code)) - return AllergyIntolerance; - if ("Appointment".equals(code)) - return Appointment; - if ("AppointmentResponse".equals(code)) - return AppointmentResponse; - if ("AuditEvent".equals(code)) - return AuditEvent; - if ("Basic".equals(code)) - return Basic; - if ("Binary".equals(code)) - return Binary; - if ("BodySite".equals(code)) - return BodySite; - if ("Bundle".equals(code)) - return Bundle; - if ("CarePlan".equals(code)) - return CarePlan; - if ("CareTeam".equals(code)) - return CareTeam; - if ("Claim".equals(code)) - return Claim; - if ("ClaimResponse".equals(code)) - return ClaimResponse; - if ("ClinicalImpression".equals(code)) - return ClinicalImpression; - if ("CodeSystem".equals(code)) - return CodeSystem; - if ("Communication".equals(code)) - return Communication; - if ("CommunicationRequest".equals(code)) - return CommunicationRequest; - if ("CompartmentDefinition".equals(code)) - return CompartmentDefinition; - if ("Composition".equals(code)) - return Composition; - if ("ConceptMap".equals(code)) - return ConceptMap; - if ("Condition".equals(code)) - return Condition; - if ("Conformance".equals(code)) - return Conformance; - if ("Contract".equals(code)) - return Contract; - if ("Coverage".equals(code)) - return Coverage; - if ("DataElement".equals(code)) - return DataElement; - if ("DecisionSupportRule".equals(code)) - return DecisionSupportRule; - if ("DecisionSupportServiceModule".equals(code)) - return DecisionSupportServiceModule; - if ("DetectedIssue".equals(code)) - return DetectedIssue; - if ("Device".equals(code)) - return Device; - if ("DeviceComponent".equals(code)) - return DeviceComponent; - if ("DeviceMetric".equals(code)) - return DeviceMetric; - if ("DeviceUseRequest".equals(code)) - return DeviceUseRequest; - if ("DeviceUseStatement".equals(code)) - return DeviceUseStatement; - if ("DiagnosticOrder".equals(code)) - return DiagnosticOrder; - if ("DiagnosticReport".equals(code)) - return DiagnosticReport; - if ("DocumentManifest".equals(code)) - return DocumentManifest; - if ("DocumentReference".equals(code)) - return DocumentReference; - if ("EligibilityRequest".equals(code)) - return EligibilityRequest; - if ("EligibilityResponse".equals(code)) - return EligibilityResponse; - if ("Encounter".equals(code)) - return Encounter; - if ("EnrollmentRequest".equals(code)) - return EnrollmentRequest; - if ("EnrollmentResponse".equals(code)) - return EnrollmentResponse; - if ("EpisodeOfCare".equals(code)) - return EpisodeOfCare; - if ("ExpansionProfile".equals(code)) - return ExpansionProfile; - if ("ExplanationOfBenefit".equals(code)) - return ExplanationOfBenefit; - if ("FamilyMemberHistory".equals(code)) - return FamilyMemberHistory; - if ("Flag".equals(code)) - return Flag; - if ("Goal".equals(code)) - return Goal; - if ("Group".equals(code)) - return Group; - if ("GuidanceResponse".equals(code)) - return GuidanceResponse; - if ("HealthcareService".equals(code)) - return HealthcareService; - if ("ImagingExcerpt".equals(code)) - return ImagingExcerpt; - if ("ImagingObjectSelection".equals(code)) - return ImagingObjectSelection; - if ("ImagingStudy".equals(code)) - return ImagingStudy; - if ("Immunization".equals(code)) - return Immunization; - if ("ImmunizationRecommendation".equals(code)) - return ImmunizationRecommendation; - if ("ImplementationGuide".equals(code)) - return ImplementationGuide; - if ("Library".equals(code)) - return Library; - if ("Linkage".equals(code)) - return Linkage; - if ("List".equals(code)) - return List; - if ("Location".equals(code)) - return Location; - if ("Measure".equals(code)) - return Measure; - if ("MeasureReport".equals(code)) - return MeasureReport; - if ("Media".equals(code)) - return Media; - if ("Medication".equals(code)) - return Medication; - if ("MedicationAdministration".equals(code)) - return MedicationAdministration; - if ("MedicationDispense".equals(code)) - return MedicationDispense; - if ("MedicationOrder".equals(code)) - return MedicationOrder; - if ("MedicationStatement".equals(code)) - return MedicationStatement; - if ("MessageHeader".equals(code)) - return MessageHeader; - if ("ModuleDefinition".equals(code)) - return ModuleDefinition; - if ("NamingSystem".equals(code)) - return NamingSystem; - if ("NutritionOrder".equals(code)) - return NutritionOrder; - if ("Observation".equals(code)) - return Observation; - if ("OperationDefinition".equals(code)) - return OperationDefinition; - if ("OperationOutcome".equals(code)) - return OperationOutcome; - if ("Order".equals(code)) - return Order; - if ("OrderResponse".equals(code)) - return OrderResponse; - if ("OrderSet".equals(code)) - return OrderSet; - if ("Organization".equals(code)) - return Organization; - if ("Parameters".equals(code)) - return Parameters; - if ("Patient".equals(code)) - return Patient; - if ("PaymentNotice".equals(code)) - return PaymentNotice; - if ("PaymentReconciliation".equals(code)) - return PaymentReconciliation; - if ("Person".equals(code)) - return Person; - if ("Practitioner".equals(code)) - return Practitioner; - if ("PractitionerRole".equals(code)) - return PractitionerRole; - if ("Procedure".equals(code)) - return Procedure; - if ("ProcedureRequest".equals(code)) - return ProcedureRequest; - if ("ProcessRequest".equals(code)) - return ProcessRequest; - if ("ProcessResponse".equals(code)) - return ProcessResponse; - if ("Protocol".equals(code)) - return Protocol; - if ("Provenance".equals(code)) - return Provenance; - if ("Questionnaire".equals(code)) - return Questionnaire; - if ("QuestionnaireResponse".equals(code)) - return QuestionnaireResponse; - if ("ReferralRequest".equals(code)) - return ReferralRequest; - if ("RelatedPerson".equals(code)) - return RelatedPerson; - if ("RiskAssessment".equals(code)) - return RiskAssessment; - if ("Schedule".equals(code)) - return Schedule; - if ("SearchParameter".equals(code)) - return SearchParameter; - if ("Sequence".equals(code)) - return Sequence; - if ("Slot".equals(code)) - return Slot; - if ("Specimen".equals(code)) - return Specimen; - if ("StructureDefinition".equals(code)) - return StructureDefinition; - if ("StructureMap".equals(code)) - return StructureMap; - if ("Subscription".equals(code)) - return Subscription; - if ("Substance".equals(code)) - return Substance; - if ("SupplyDelivery".equals(code)) - return SupplyDelivery; - if ("SupplyRequest".equals(code)) - return SupplyRequest; - if ("Task".equals(code)) - return Task; - if ("TestScript".equals(code)) - return TestScript; - if ("ValueSet".equals(code)) - return ValueSet; - if ("VisionPrescription".equals(code)) - return VisionPrescription; - - throw new FHIRException("Unknown resource type"+code); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/RiskAssessment.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/RiskAssessment.java deleted file mode 100644 index bdc31a06e60..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/RiskAssessment.java +++ /dev/null @@ -1,1429 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ -@ResourceDef(name="RiskAssessment", profile="http://hl7.org/fhir/Profile/RiskAssessment") -public class RiskAssessment extends DomainResource { - - @Block() - public static class RiskAssessmentPredictionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * One of the potential outcomes for the patient (e.g. remission, death, a particular condition). - */ - @Child(name = "outcome", type = {CodeableConcept.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Possible outcome for the subject", formalDefinition="One of the potential outcomes for the patient (e.g. remission, death, a particular condition)." ) - protected CodeableConcept outcome; - - /** - * How likely is the outcome (in the specified timeframe). - */ - @Child(name = "probability", type = {DecimalType.class, Range.class, CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Likelihood of specified outcome", formalDefinition="How likely is the outcome (in the specified timeframe)." ) - protected Type probability; - - /** - * Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - @Child(name = "relativeRisk", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Relative likelihood", formalDefinition="Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.)." ) - protected DecimalType relativeRisk; - - /** - * Indicates the period of time or age range of the subject to which the specified probability applies. - */ - @Child(name = "when", type = {Period.class, Range.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Timeframe or age range", formalDefinition="Indicates the period of time or age range of the subject to which the specified probability applies." ) - protected Type when; - - /** - * Additional information explaining the basis for the prediction. - */ - @Child(name = "rationale", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Explanation of prediction", formalDefinition="Additional information explaining the basis for the prediction." ) - protected StringType rationale; - - private static final long serialVersionUID = 647967428L; - - /** - * Constructor - */ - public RiskAssessmentPredictionComponent() { - super(); - } - - /** - * Constructor - */ - public RiskAssessmentPredictionComponent(CodeableConcept outcome) { - super(); - this.outcome = outcome; - } - - /** - * @return {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) - */ - public CodeableConcept getOutcome() { - if (this.outcome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.outcome"); - else if (Configuration.doAutoCreate()) - this.outcome = new CodeableConcept(); // cc - return this.outcome; - } - - public boolean hasOutcome() { - return this.outcome != null && !this.outcome.isEmpty(); - } - - /** - * @param value {@link #outcome} (One of the potential outcomes for the patient (e.g. remission, death, a particular condition).) - */ - public RiskAssessmentPredictionComponent setOutcome(CodeableConcept value) { - this.outcome = value; - return this; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public Type getProbability() { - return this.probability; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public DecimalType getProbabilityDecimalType() throws FHIRException { - if (!(this.probability instanceof DecimalType)) - throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (DecimalType) this.probability; - } - - public boolean hasProbabilityDecimalType() { - return this.probability instanceof DecimalType; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public Range getProbabilityRange() throws FHIRException { - if (!(this.probability instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (Range) this.probability; - } - - public boolean hasProbabilityRange() { - return this.probability instanceof Range; - } - - /** - * @return {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public CodeableConcept getProbabilityCodeableConcept() throws FHIRException { - if (!(this.probability instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.probability.getClass().getName()+" was encountered"); - return (CodeableConcept) this.probability; - } - - public boolean hasProbabilityCodeableConcept() { - return this.probability instanceof CodeableConcept; - } - - public boolean hasProbability() { - return this.probability != null && !this.probability.isEmpty(); - } - - /** - * @param value {@link #probability} (How likely is the outcome (in the specified timeframe).) - */ - public RiskAssessmentPredictionComponent setProbability(Type value) { - this.probability = value; - return this; - } - - /** - * @return {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value - */ - public DecimalType getRelativeRiskElement() { - if (this.relativeRisk == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.relativeRisk"); - else if (Configuration.doAutoCreate()) - this.relativeRisk = new DecimalType(); // bb - return this.relativeRisk; - } - - public boolean hasRelativeRiskElement() { - return this.relativeRisk != null && !this.relativeRisk.isEmpty(); - } - - public boolean hasRelativeRisk() { - return this.relativeRisk != null && !this.relativeRisk.isEmpty(); - } - - /** - * @param value {@link #relativeRisk} (Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).). This is the underlying object with id, value and extensions. The accessor "getRelativeRisk" gives direct access to the value - */ - public RiskAssessmentPredictionComponent setRelativeRiskElement(DecimalType value) { - this.relativeRisk = value; - return this; - } - - /** - * @return Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public BigDecimal getRelativeRisk() { - return this.relativeRisk == null ? null : this.relativeRisk.getValue(); - } - - /** - * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public RiskAssessmentPredictionComponent setRelativeRisk(BigDecimal value) { - if (value == null) - this.relativeRisk = null; - else { - if (this.relativeRisk == null) - this.relativeRisk = new DecimalType(); - this.relativeRisk.setValue(value); - } - return this; - } - - /** - * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public RiskAssessmentPredictionComponent setRelativeRisk(long value) { - this.relativeRisk = new DecimalType(); - this.relativeRisk.setValue(value); - return this; - } - - /** - * @param value Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.). - */ - public RiskAssessmentPredictionComponent setRelativeRisk(double value) { - this.relativeRisk = new DecimalType(); - this.relativeRisk.setValue(value); - return this; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Type getWhen() { - return this.when; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Period getWhenPeriod() throws FHIRException { - if (!(this.when instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.when.getClass().getName()+" was encountered"); - return (Period) this.when; - } - - public boolean hasWhenPeriod() { - return this.when instanceof Period; - } - - /** - * @return {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public Range getWhenRange() throws FHIRException { - if (!(this.when instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.when.getClass().getName()+" was encountered"); - return (Range) this.when; - } - - public boolean hasWhenRange() { - return this.when instanceof Range; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (Indicates the period of time or age range of the subject to which the specified probability applies.) - */ - public RiskAssessmentPredictionComponent setWhen(Type value) { - this.when = value; - return this; - } - - /** - * @return {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public StringType getRationaleElement() { - if (this.rationale == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessmentPredictionComponent.rationale"); - else if (Configuration.doAutoCreate()) - this.rationale = new StringType(); // bb - return this.rationale; - } - - public boolean hasRationaleElement() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - public boolean hasRationale() { - return this.rationale != null && !this.rationale.isEmpty(); - } - - /** - * @param value {@link #rationale} (Additional information explaining the basis for the prediction.). This is the underlying object with id, value and extensions. The accessor "getRationale" gives direct access to the value - */ - public RiskAssessmentPredictionComponent setRationaleElement(StringType value) { - this.rationale = value; - return this; - } - - /** - * @return Additional information explaining the basis for the prediction. - */ - public String getRationale() { - return this.rationale == null ? null : this.rationale.getValue(); - } - - /** - * @param value Additional information explaining the basis for the prediction. - */ - public RiskAssessmentPredictionComponent setRationale(String value) { - if (Utilities.noString(value)) - this.rationale = null; - else { - if (this.rationale == null) - this.rationale = new StringType(); - this.rationale.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("outcome", "CodeableConcept", "One of the potential outcomes for the patient (e.g. remission, death, a particular condition).", 0, java.lang.Integer.MAX_VALUE, outcome)); - childrenList.add(new Property("probability[x]", "decimal|Range|CodeableConcept", "How likely is the outcome (in the specified timeframe).", 0, java.lang.Integer.MAX_VALUE, probability)); - childrenList.add(new Property("relativeRisk", "decimal", "Indicates the risk for this particular subject (with their specific characteristics) divided by the risk of the population in general. (Numbers greater than 1 = higher risk than the population, numbers less than 1 = lower risk.).", 0, java.lang.Integer.MAX_VALUE, relativeRisk)); - childrenList.add(new Property("when[x]", "Period|Range", "Indicates the period of time or age range of the subject to which the specified probability applies.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("rationale", "string", "Additional information explaining the basis for the prediction.", 0, java.lang.Integer.MAX_VALUE, rationale)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept - case -1290561483: /*probability*/ return this.probability == null ? new Base[0] : new Base[] {this.probability}; // Type - case -70741061: /*relativeRisk*/ return this.relativeRisk == null ? new Base[0] : new Base[] {this.relativeRisk}; // DecimalType - case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // Type - case 345689335: /*rationale*/ return this.rationale == null ? new Base[0] : new Base[] {this.rationale}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1106507950: // outcome - this.outcome = castToCodeableConcept(value); // CodeableConcept - break; - case -1290561483: // probability - this.probability = (Type) value; // Type - break; - case -70741061: // relativeRisk - this.relativeRisk = castToDecimal(value); // DecimalType - break; - case 3648314: // when - this.when = (Type) value; // Type - break; - case 345689335: // rationale - this.rationale = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("outcome")) - this.outcome = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("probability[x]")) - this.probability = (Type) value; // Type - else if (name.equals("relativeRisk")) - this.relativeRisk = castToDecimal(value); // DecimalType - else if (name.equals("when[x]")) - this.when = (Type) value; // Type - else if (name.equals("rationale")) - this.rationale = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1106507950: return getOutcome(); // CodeableConcept - case 1430185003: return getProbability(); // Type - case -70741061: throw new FHIRException("Cannot make property relativeRisk as it is not a complex type"); // DecimalType - case 1312831238: return getWhen(); // Type - case 345689335: throw new FHIRException("Cannot make property rationale as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("outcome")) { - this.outcome = new CodeableConcept(); - return this.outcome; - } - else if (name.equals("probabilityDecimal")) { - this.probability = new DecimalType(); - return this.probability; - } - else if (name.equals("probabilityRange")) { - this.probability = new Range(); - return this.probability; - } - else if (name.equals("probabilityCodeableConcept")) { - this.probability = new CodeableConcept(); - return this.probability; - } - else if (name.equals("relativeRisk")) { - throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.relativeRisk"); - } - else if (name.equals("whenPeriod")) { - this.when = new Period(); - return this.when; - } - else if (name.equals("whenRange")) { - this.when = new Range(); - return this.when; - } - else if (name.equals("rationale")) { - throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.rationale"); - } - else - return super.addChild(name); - } - - public RiskAssessmentPredictionComponent copy() { - RiskAssessmentPredictionComponent dst = new RiskAssessmentPredictionComponent(); - copyValues(dst); - dst.outcome = outcome == null ? null : outcome.copy(); - dst.probability = probability == null ? null : probability.copy(); - dst.relativeRisk = relativeRisk == null ? null : relativeRisk.copy(); - dst.when = when == null ? null : when.copy(); - dst.rationale = rationale == null ? null : rationale.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RiskAssessmentPredictionComponent)) - return false; - RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; - return compareDeep(outcome, o.outcome, true) && compareDeep(probability, o.probability, true) && compareDeep(relativeRisk, o.relativeRisk, true) - && compareDeep(when, o.when, true) && compareDeep(rationale, o.rationale, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RiskAssessmentPredictionComponent)) - return false; - RiskAssessmentPredictionComponent o = (RiskAssessmentPredictionComponent) other; - return compareValues(relativeRisk, o.relativeRisk, true) && compareValues(rationale, o.rationale, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (outcome == null || outcome.isEmpty()) && (probability == null || probability.isEmpty()) - && (relativeRisk == null || relativeRisk.isEmpty()) && (when == null || when.isEmpty()) && (rationale == null || rationale.isEmpty()) - ; - } - - public String fhirType() { - return "RiskAssessment.prediction"; - - } - - } - - /** - * The patient or group the risk assessment applies to. - */ - @Child(name = "subject", type = {Patient.class, Group.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who/what does assessment apply to?", formalDefinition="The patient or group the risk assessment applies to." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The patient or group the risk assessment applies to.) - */ - protected Resource subjectTarget; - - /** - * The date (and possibly time) the risk assessment was performed. - */ - @Child(name = "date", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When was assessment made?", formalDefinition="The date (and possibly time) the risk assessment was performed." ) - protected DateTimeType date; - - /** - * For assessments or prognosis specific to a particular condition, indicates the condition being assessed. - */ - @Child(name = "condition", type = {Condition.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Condition assessed", formalDefinition="For assessments or prognosis specific to a particular condition, indicates the condition being assessed." ) - protected Reference condition; - - /** - * The actual object that is the target of the reference (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - protected Condition conditionTarget; - - /** - * The encounter where the assessment was performed. - */ - @Child(name = "encounter", type = {Encounter.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where was assessment performed?", formalDefinition="The encounter where the assessment was performed." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (The encounter where the assessment was performed.) - */ - protected Encounter encounterTarget; - - /** - * The provider or software application that performed the assessment. - */ - @Child(name = "performer", type = {Practitioner.class, Device.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who did assessment?", formalDefinition="The provider or software application that performed the assessment." ) - protected Reference performer; - - /** - * The actual object that is the target of the reference (The provider or software application that performed the assessment.) - */ - protected Resource performerTarget; - - /** - * Business identifier assigned to the risk assessment. - */ - @Child(name = "identifier", type = {Identifier.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier for the assessment", formalDefinition="Business identifier assigned to the risk assessment." ) - protected Identifier identifier; - - /** - * The algorithm, process or mechanism used to evaluate the risk. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Evaluation mechanism", formalDefinition="The algorithm, process or mechanism used to evaluate the risk." ) - protected CodeableConcept method; - - /** - * Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.). - */ - @Child(name = "basis", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Information used in assessment", formalDefinition="Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.)." ) - protected List basis; - /** - * The actual objects that are the target of the reference (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - protected List basisTarget; - - - /** - * Describes the expected outcome for the subject. - */ - @Child(name = "prediction", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Outcome predicted", formalDefinition="Describes the expected outcome for the subject." ) - protected List prediction; - - /** - * A description of the steps that might be taken to reduce the identified risk(s). - */ - @Child(name = "mitigation", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="How to reduce risk", formalDefinition="A description of the steps that might be taken to reduce the identified risk(s)." ) - protected StringType mitigation; - - private static final long serialVersionUID = 724306293L; - - /** - * Constructor - */ - public RiskAssessment() { - super(); - } - - /** - * @return {@link #subject} (The patient or group the risk assessment applies to.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The patient or group the risk assessment applies to.) - */ - public RiskAssessment setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient or group the risk assessment applies to.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient or group the risk assessment applies to.) - */ - public RiskAssessment setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and possibly time) the risk assessment was performed.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public RiskAssessment setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and possibly time) the risk assessment was performed. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and possibly time) the risk assessment was performed. - */ - public RiskAssessment setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public Reference getCondition() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new Reference(); // cc - return this.condition; - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public RiskAssessment setCondition(Reference value) { - this.condition = value; - return this; - } - - /** - * @return {@link #condition} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public Condition getConditionTarget() { - if (this.conditionTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.condition"); - else if (Configuration.doAutoCreate()) - this.conditionTarget = new Condition(); // aa - return this.conditionTarget; - } - - /** - * @param value {@link #condition} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (For assessments or prognosis specific to a particular condition, indicates the condition being assessed.) - */ - public RiskAssessment setConditionTarget(Condition value) { - this.conditionTarget = value; - return this; - } - - /** - * @return {@link #encounter} (The encounter where the assessment was performed.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (The encounter where the assessment was performed.) - */ - public RiskAssessment setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The encounter where the assessment was performed.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The encounter where the assessment was performed.) - */ - public RiskAssessment setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #performer} (The provider or software application that performed the assessment.) - */ - public Reference getPerformer() { - if (this.performer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.performer"); - else if (Configuration.doAutoCreate()) - this.performer = new Reference(); // cc - return this.performer; - } - - public boolean hasPerformer() { - return this.performer != null && !this.performer.isEmpty(); - } - - /** - * @param value {@link #performer} (The provider or software application that performed the assessment.) - */ - public RiskAssessment setPerformer(Reference value) { - this.performer = value; - return this; - } - - /** - * @return {@link #performer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The provider or software application that performed the assessment.) - */ - public Resource getPerformerTarget() { - return this.performerTarget; - } - - /** - * @param value {@link #performer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The provider or software application that performed the assessment.) - */ - public RiskAssessment setPerformerTarget(Resource value) { - this.performerTarget = value; - return this; - } - - /** - * @return {@link #identifier} (Business identifier assigned to the risk assessment.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Business identifier assigned to the risk assessment.) - */ - public RiskAssessment setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #method} (The algorithm, process or mechanism used to evaluate the risk.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (The algorithm, process or mechanism used to evaluate the risk.) - */ - public RiskAssessment setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - public List getBasis() { - if (this.basis == null) - this.basis = new ArrayList(); - return this.basis; - } - - public boolean hasBasis() { - if (this.basis == null) - return false; - for (Reference item : this.basis) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #basis} (Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - // syntactic sugar - public Reference addBasis() { //3 - Reference t = new Reference(); - if (this.basis == null) - this.basis = new ArrayList(); - this.basis.add(t); - return t; - } - - // syntactic sugar - public RiskAssessment addBasis(Reference t) { //3 - if (t == null) - return this; - if (this.basis == null) - this.basis = new ArrayList(); - this.basis.add(t); - return this; - } - - /** - * @return {@link #basis} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).) - */ - public List getBasisTarget() { - if (this.basisTarget == null) - this.basisTarget = new ArrayList(); - return this.basisTarget; - } - - /** - * @return {@link #prediction} (Describes the expected outcome for the subject.) - */ - public List getPrediction() { - if (this.prediction == null) - this.prediction = new ArrayList(); - return this.prediction; - } - - public boolean hasPrediction() { - if (this.prediction == null) - return false; - for (RiskAssessmentPredictionComponent item : this.prediction) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #prediction} (Describes the expected outcome for the subject.) - */ - // syntactic sugar - public RiskAssessmentPredictionComponent addPrediction() { //3 - RiskAssessmentPredictionComponent t = new RiskAssessmentPredictionComponent(); - if (this.prediction == null) - this.prediction = new ArrayList(); - this.prediction.add(t); - return t; - } - - // syntactic sugar - public RiskAssessment addPrediction(RiskAssessmentPredictionComponent t) { //3 - if (t == null) - return this; - if (this.prediction == null) - this.prediction = new ArrayList(); - this.prediction.add(t); - return this; - } - - /** - * @return {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value - */ - public StringType getMitigationElement() { - if (this.mitigation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create RiskAssessment.mitigation"); - else if (Configuration.doAutoCreate()) - this.mitigation = new StringType(); // bb - return this.mitigation; - } - - public boolean hasMitigationElement() { - return this.mitigation != null && !this.mitigation.isEmpty(); - } - - public boolean hasMitigation() { - return this.mitigation != null && !this.mitigation.isEmpty(); - } - - /** - * @param value {@link #mitigation} (A description of the steps that might be taken to reduce the identified risk(s).). This is the underlying object with id, value and extensions. The accessor "getMitigation" gives direct access to the value - */ - public RiskAssessment setMitigationElement(StringType value) { - this.mitigation = value; - return this; - } - - /** - * @return A description of the steps that might be taken to reduce the identified risk(s). - */ - public String getMitigation() { - return this.mitigation == null ? null : this.mitigation.getValue(); - } - - /** - * @param value A description of the steps that might be taken to reduce the identified risk(s). - */ - public RiskAssessment setMitigation(String value) { - if (Utilities.noString(value)) - this.mitigation = null; - else { - if (this.mitigation == null) - this.mitigation = new StringType(); - this.mitigation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("subject", "Reference(Patient|Group)", "The patient or group the risk assessment applies to.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("date", "dateTime", "The date (and possibly time) the risk assessment was performed.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("condition", "Reference(Condition)", "For assessments or prognosis specific to a particular condition, indicates the condition being assessed.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "The encounter where the assessment was performed.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("performer", "Reference(Practitioner|Device)", "The provider or software application that performed the assessment.", 0, java.lang.Integer.MAX_VALUE, performer)); - childrenList.add(new Property("identifier", "Identifier", "Business identifier assigned to the risk assessment.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("method", "CodeableConcept", "The algorithm, process or mechanism used to evaluate the risk.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("basis", "Reference(Any)", "Indicates the source data considered as part of the assessment (FamilyHistory, Observations, Procedures, Conditions, etc.).", 0, java.lang.Integer.MAX_VALUE, basis)); - childrenList.add(new Property("prediction", "", "Describes the expected outcome for the subject.", 0, java.lang.Integer.MAX_VALUE, prediction)); - childrenList.add(new Property("mitigation", "string", "A description of the steps that might be taken to reduce the identified risk(s).", 0, java.lang.Integer.MAX_VALUE, mitigation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case 481140686: /*performer*/ return this.performer == null ? new Base[0] : new Base[] {this.performer}; // Reference - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case 93508670: /*basis*/ return this.basis == null ? new Base[0] : this.basis.toArray(new Base[this.basis.size()]); // Reference - case 1161234575: /*prediction*/ return this.prediction == null ? new Base[0] : this.prediction.toArray(new Base[this.prediction.size()]); // RiskAssessmentPredictionComponent - case 1293793087: /*mitigation*/ return this.mitigation == null ? new Base[0] : new Base[] {this.mitigation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -861311717: // condition - this.condition = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case 481140686: // performer - this.performer = castToReference(value); // Reference - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case 93508670: // basis - this.getBasis().add(castToReference(value)); // Reference - break; - case 1161234575: // prediction - this.getPrediction().add((RiskAssessmentPredictionComponent) value); // RiskAssessmentPredictionComponent - break; - case 1293793087: // mitigation - this.mitigation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("condition")) - this.condition = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("performer")) - this.performer = castToReference(value); // Reference - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("basis")) - this.getBasis().add(castToReference(value)); - else if (name.equals("prediction")) - this.getPrediction().add((RiskAssessmentPredictionComponent) value); - else if (name.equals("mitigation")) - this.mitigation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1867885268: return getSubject(); // Reference - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -861311717: return getCondition(); // Reference - case 1524132147: return getEncounter(); // Reference - case 481140686: return getPerformer(); // Reference - case -1618432855: return getIdentifier(); // Identifier - case -1077554975: return getMethod(); // CodeableConcept - case 93508670: return addBasis(); // Reference - case 1161234575: return addPrediction(); // RiskAssessmentPredictionComponent - case 1293793087: throw new FHIRException("Cannot make property mitigation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.date"); - } - else if (name.equals("condition")) { - this.condition = new Reference(); - return this.condition; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("performer")) { - this.performer = new Reference(); - return this.performer; - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("basis")) { - return addBasis(); - } - else if (name.equals("prediction")) { - return addPrediction(); - } - else if (name.equals("mitigation")) { - throw new FHIRException("Cannot call addChild on a primitive type RiskAssessment.mitigation"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "RiskAssessment"; - - } - - public RiskAssessment copy() { - RiskAssessment dst = new RiskAssessment(); - copyValues(dst); - dst.subject = subject == null ? null : subject.copy(); - dst.date = date == null ? null : date.copy(); - dst.condition = condition == null ? null : condition.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.performer = performer == null ? null : performer.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.method = method == null ? null : method.copy(); - if (basis != null) { - dst.basis = new ArrayList(); - for (Reference i : basis) - dst.basis.add(i.copy()); - }; - if (prediction != null) { - dst.prediction = new ArrayList(); - for (RiskAssessmentPredictionComponent i : prediction) - dst.prediction.add(i.copy()); - }; - dst.mitigation = mitigation == null ? null : mitigation.copy(); - return dst; - } - - protected RiskAssessment typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof RiskAssessment)) - return false; - RiskAssessment o = (RiskAssessment) other; - return compareDeep(subject, o.subject, true) && compareDeep(date, o.date, true) && compareDeep(condition, o.condition, true) - && compareDeep(encounter, o.encounter, true) && compareDeep(performer, o.performer, true) && compareDeep(identifier, o.identifier, true) - && compareDeep(method, o.method, true) && compareDeep(basis, o.basis, true) && compareDeep(prediction, o.prediction, true) - && compareDeep(mitigation, o.mitigation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof RiskAssessment)) - return false; - RiskAssessment o = (RiskAssessment) other; - return compareValues(date, o.date, true) && compareValues(mitigation, o.mitigation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (subject == null || subject.isEmpty()) && (date == null || date.isEmpty()) - && (condition == null || condition.isEmpty()) && (encounter == null || encounter.isEmpty()) - && (performer == null || performer.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (method == null || method.isEmpty()) && (basis == null || basis.isEmpty()) && (prediction == null || prediction.isEmpty()) - && (mitigation == null || mitigation.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.RiskAssessment; - } - - /** - * Search parameter: patient - *

- * Description: Who/what does assessment apply to?
- * Type: reference
- * Path: RiskAssessment.subject
- *

- */ - @SearchParamDefinition(name="patient", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Who/what does assessment apply to?
- * Type: reference
- * Path: RiskAssessment.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RiskAssessment:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("RiskAssessment:patient").toLocked(); - - /** - * Search parameter: condition - *

- * Description: Condition assessed
- * Type: reference
- * Path: RiskAssessment.condition
- *

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

- * Description: Condition assessed
- * Type: reference
- * Path: RiskAssessment.condition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CONDITION = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CONDITION); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RiskAssessment:condition". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CONDITION = new ca.uhn.fhir.model.api.Include("RiskAssessment:condition").toLocked(); - - /** - * Search parameter: subject - *

- * Description: Who/what does assessment apply to?
- * Type: reference
- * Path: RiskAssessment.subject
- *

- */ - @SearchParamDefinition(name="subject", path="RiskAssessment.subject", description="Who/what does assessment apply to?", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Who/what does assessment apply to?
- * Type: reference
- * Path: RiskAssessment.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RiskAssessment:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("RiskAssessment:subject").toLocked(); - - /** - * Search parameter: performer - *

- * Description: Who did assessment?
- * Type: reference
- * Path: RiskAssessment.performer
- *

- */ - @SearchParamDefinition(name="performer", path="RiskAssessment.performer", description="Who did assessment?", type="reference" ) - public static final String SP_PERFORMER = "performer"; - /** - * Fluent Client search parameter constant for performer - *

- * Description: Who did assessment?
- * Type: reference
- * Path: RiskAssessment.performer
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PERFORMER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RiskAssessment:performer". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PERFORMER = new ca.uhn.fhir.model.api.Include("RiskAssessment:performer").toLocked(); - - /** - * Search parameter: method - *

- * Description: Evaluation mechanism
- * Type: token
- * Path: RiskAssessment.method
- *

- */ - @SearchParamDefinition(name="method", path="RiskAssessment.method", description="Evaluation mechanism", type="token" ) - public static final String SP_METHOD = "method"; - /** - * Fluent Client search parameter constant for method - *

- * Description: Evaluation mechanism
- * Type: token
- * Path: RiskAssessment.method
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam METHOD = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_METHOD); - - /** - * Search parameter: encounter - *

- * Description: Where was assessment performed?
- * Type: reference
- * Path: RiskAssessment.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="RiskAssessment.encounter", description="Where was assessment performed?", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Where was assessment performed?
- * Type: reference
- * Path: RiskAssessment.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "RiskAssessment:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("RiskAssessment:encounter").toLocked(); - - /** - * Search parameter: date - *

- * Description: When was assessment made?
- * Type: date
- * Path: RiskAssessment.date
- *

- */ - @SearchParamDefinition(name="date", path="RiskAssessment.date", description="When was assessment made?", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When was assessment made?
- * Type: date
- * Path: RiskAssessment.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: Unique identifier for the assessment
- * Type: token
- * Path: RiskAssessment.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="RiskAssessment.identifier", description="Unique identifier for the assessment", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique identifier for the assessment
- * Type: token
- * Path: RiskAssessment.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SampledData.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SampledData.java deleted file mode 100644 index 52f63992c19..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SampledData.java +++ /dev/null @@ -1,668 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the data. - */ -@DatatypeDef(name="SampledData") -public class SampledData extends Type implements ICompositeType { - - /** - * The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series. - */ - @Child(name = "origin", type = {SimpleQuantity.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Zero value and units", formalDefinition="The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series." ) - protected SimpleQuantity origin; - - /** - * The length of time between sampling times, measured in milliseconds. - */ - @Child(name = "period", type = {DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of milliseconds between samples", formalDefinition="The length of time between sampling times, measured in milliseconds." ) - protected DecimalType period; - - /** - * A correction factor that is applied to the sampled data points before they are added to the origin. - */ - @Child(name = "factor", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Multiply data by this before adding to origin", formalDefinition="A correction factor that is applied to the sampled data points before they are added to the origin." ) - protected DecimalType factor; - - /** - * The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - @Child(name = "lowerLimit", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lower limit of detection", formalDefinition="The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit)." ) - protected DecimalType lowerLimit; - - /** - * The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - @Child(name = "upperLimit", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Upper limit of detection", formalDefinition="The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit)." ) - protected DecimalType upperLimit; - - /** - * The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - @Child(name = "dimensions", type = {PositiveIntType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of sample points at each time point", formalDefinition="The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once." ) - protected PositiveIntType dimensions; - - /** - * A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - @Child(name = "data", type = {StringType.class}, order=6, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Decimal values with spaces, or \"E\" | \"U\" | \"L\"", formalDefinition="A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value." ) - protected StringType data; - - private static final long serialVersionUID = -1763278368L; - - /** - * Constructor - */ - public SampledData() { - super(); - } - - /** - * Constructor - */ - public SampledData(SimpleQuantity origin, DecimalType period, PositiveIntType dimensions, StringType data) { - super(); - this.origin = origin; - this.period = period; - this.dimensions = dimensions; - this.data = data; - } - - /** - * @return {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) - */ - public SimpleQuantity getOrigin() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new SimpleQuantity(); // cc - return this.origin; - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.) - */ - public SampledData setOrigin(SimpleQuantity value) { - this.origin = value; - return this; - } - - /** - * @return {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public DecimalType getPeriodElement() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.period"); - else if (Configuration.doAutoCreate()) - this.period = new DecimalType(); // bb - return this.period; - } - - public boolean hasPeriodElement() { - return this.period != null && !this.period.isEmpty(); - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (The length of time between sampling times, measured in milliseconds.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public SampledData setPeriodElement(DecimalType value) { - this.period = value; - return this; - } - - /** - * @return The length of time between sampling times, measured in milliseconds. - */ - public BigDecimal getPeriod() { - return this.period == null ? null : this.period.getValue(); - } - - /** - * @param value The length of time between sampling times, measured in milliseconds. - */ - public SampledData setPeriod(BigDecimal value) { - if (this.period == null) - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @param value The length of time between sampling times, measured in milliseconds. - */ - public SampledData setPeriod(long value) { - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @param value The length of time between sampling times, measured in milliseconds. - */ - public SampledData setPeriod(double value) { - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @return {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public DecimalType getFactorElement() { - if (this.factor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.factor"); - else if (Configuration.doAutoCreate()) - this.factor = new DecimalType(); // bb - return this.factor; - } - - public boolean hasFactorElement() { - return this.factor != null && !this.factor.isEmpty(); - } - - public boolean hasFactor() { - return this.factor != null && !this.factor.isEmpty(); - } - - /** - * @param value {@link #factor} (A correction factor that is applied to the sampled data points before they are added to the origin.). This is the underlying object with id, value and extensions. The accessor "getFactor" gives direct access to the value - */ - public SampledData setFactorElement(DecimalType value) { - this.factor = value; - return this; - } - - /** - * @return A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public BigDecimal getFactor() { - return this.factor == null ? null : this.factor.getValue(); - } - - /** - * @param value A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public SampledData setFactor(BigDecimal value) { - if (value == null) - this.factor = null; - else { - if (this.factor == null) - this.factor = new DecimalType(); - this.factor.setValue(value); - } - return this; - } - - /** - * @param value A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public SampledData setFactor(long value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @param value A correction factor that is applied to the sampled data points before they are added to the origin. - */ - public SampledData setFactor(double value) { - this.factor = new DecimalType(); - this.factor.setValue(value); - return this; - } - - /** - * @return {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value - */ - public DecimalType getLowerLimitElement() { - if (this.lowerLimit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.lowerLimit"); - else if (Configuration.doAutoCreate()) - this.lowerLimit = new DecimalType(); // bb - return this.lowerLimit; - } - - public boolean hasLowerLimitElement() { - return this.lowerLimit != null && !this.lowerLimit.isEmpty(); - } - - public boolean hasLowerLimit() { - return this.lowerLimit != null && !this.lowerLimit.isEmpty(); - } - - /** - * @param value {@link #lowerLimit} (The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit).). This is the underlying object with id, value and extensions. The accessor "getLowerLimit" gives direct access to the value - */ - public SampledData setLowerLimitElement(DecimalType value) { - this.lowerLimit = value; - return this; - } - - /** - * @return The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public BigDecimal getLowerLimit() { - return this.lowerLimit == null ? null : this.lowerLimit.getValue(); - } - - /** - * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public SampledData setLowerLimit(BigDecimal value) { - if (value == null) - this.lowerLimit = null; - else { - if (this.lowerLimit == null) - this.lowerLimit = new DecimalType(); - this.lowerLimit.setValue(value); - } - return this; - } - - /** - * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public SampledData setLowerLimit(long value) { - this.lowerLimit = new DecimalType(); - this.lowerLimit.setValue(value); - return this; - } - - /** - * @param value The lower limit of detection of the measured points. This is needed if any of the data points have the value "L" (lower than detection limit). - */ - public SampledData setLowerLimit(double value) { - this.lowerLimit = new DecimalType(); - this.lowerLimit.setValue(value); - return this; - } - - /** - * @return {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value - */ - public DecimalType getUpperLimitElement() { - if (this.upperLimit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.upperLimit"); - else if (Configuration.doAutoCreate()) - this.upperLimit = new DecimalType(); // bb - return this.upperLimit; - } - - public boolean hasUpperLimitElement() { - return this.upperLimit != null && !this.upperLimit.isEmpty(); - } - - public boolean hasUpperLimit() { - return this.upperLimit != null && !this.upperLimit.isEmpty(); - } - - /** - * @param value {@link #upperLimit} (The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit).). This is the underlying object with id, value and extensions. The accessor "getUpperLimit" gives direct access to the value - */ - public SampledData setUpperLimitElement(DecimalType value) { - this.upperLimit = value; - return this; - } - - /** - * @return The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public BigDecimal getUpperLimit() { - return this.upperLimit == null ? null : this.upperLimit.getValue(); - } - - /** - * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public SampledData setUpperLimit(BigDecimal value) { - if (value == null) - this.upperLimit = null; - else { - if (this.upperLimit == null) - this.upperLimit = new DecimalType(); - this.upperLimit.setValue(value); - } - return this; - } - - /** - * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public SampledData setUpperLimit(long value) { - this.upperLimit = new DecimalType(); - this.upperLimit.setValue(value); - return this; - } - - /** - * @param value The upper limit of detection of the measured points. This is needed if any of the data points have the value "U" (higher than detection limit). - */ - public SampledData setUpperLimit(double value) { - this.upperLimit = new DecimalType(); - this.upperLimit.setValue(value); - return this; - } - - /** - * @return {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value - */ - public PositiveIntType getDimensionsElement() { - if (this.dimensions == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.dimensions"); - else if (Configuration.doAutoCreate()) - this.dimensions = new PositiveIntType(); // bb - return this.dimensions; - } - - public boolean hasDimensionsElement() { - return this.dimensions != null && !this.dimensions.isEmpty(); - } - - public boolean hasDimensions() { - return this.dimensions != null && !this.dimensions.isEmpty(); - } - - /** - * @param value {@link #dimensions} (The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.). This is the underlying object with id, value and extensions. The accessor "getDimensions" gives direct access to the value - */ - public SampledData setDimensionsElement(PositiveIntType value) { - this.dimensions = value; - return this; - } - - /** - * @return The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - public int getDimensions() { - return this.dimensions == null || this.dimensions.isEmpty() ? 0 : this.dimensions.getValue(); - } - - /** - * @param value The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once. - */ - public SampledData setDimensions(int value) { - if (this.dimensions == null) - this.dimensions = new PositiveIntType(); - this.dimensions.setValue(value); - return this; - } - - /** - * @return {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public StringType getDataElement() { - if (this.data == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SampledData.data"); - else if (Configuration.doAutoCreate()) - this.data = new StringType(); // bb - return this.data; - } - - public boolean hasDataElement() { - return this.data != null && !this.data.isEmpty(); - } - - public boolean hasData() { - return this.data != null && !this.data.isEmpty(); - } - - /** - * @param value {@link #data} (A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value.). This is the underlying object with id, value and extensions. The accessor "getData" gives direct access to the value - */ - public SampledData setDataElement(StringType value) { - this.data = value; - return this; - } - - /** - * @return A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - public String getData() { - return this.data == null ? null : this.data.getValue(); - } - - /** - * @param value A series of data points which are decimal values separated by a single space (character u20). The special values "E" (error), "L" (below detection limit) and "U" (above detection limit) can also be used in place of a decimal value. - */ - public SampledData setData(String value) { - if (this.data == null) - this.data = new StringType(); - this.data.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("origin", "SimpleQuantity", "The base quantity that a measured value of zero represents. In addition, this provides the units of the entire measurement series.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("period", "decimal", "The length of time between sampling times, measured in milliseconds.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("factor", "decimal", "A correction factor that is applied to the sampled data points before they are added to the origin.", 0, java.lang.Integer.MAX_VALUE, factor)); - childrenList.add(new Property("lowerLimit", "decimal", "The lower limit of detection of the measured points. This is needed if any of the data points have the value \"L\" (lower than detection limit).", 0, java.lang.Integer.MAX_VALUE, lowerLimit)); - childrenList.add(new Property("upperLimit", "decimal", "The upper limit of detection of the measured points. This is needed if any of the data points have the value \"U\" (higher than detection limit).", 0, java.lang.Integer.MAX_VALUE, upperLimit)); - childrenList.add(new Property("dimensions", "positiveInt", "The number of sample points at each time point. If this value is greater than one, then the dimensions will be interlaced - all the sample points for a point in time will be recorded at once.", 0, java.lang.Integer.MAX_VALUE, dimensions)); - childrenList.add(new Property("data", "string", "A series of data points which are decimal values separated by a single space (character u20). The special values \"E\" (error), \"L\" (below detection limit) and \"U\" (above detection limit) can also be used in place of a decimal value.", 0, java.lang.Integer.MAX_VALUE, data)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // SimpleQuantity - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType - case -1282148017: /*factor*/ return this.factor == null ? new Base[0] : new Base[] {this.factor}; // DecimalType - case 1209133370: /*lowerLimit*/ return this.lowerLimit == null ? new Base[0] : new Base[] {this.lowerLimit}; // DecimalType - case -1681713095: /*upperLimit*/ return this.upperLimit == null ? new Base[0] : new Base[] {this.upperLimit}; // DecimalType - case 414334925: /*dimensions*/ return this.dimensions == null ? new Base[0] : new Base[] {this.dimensions}; // PositiveIntType - case 3076010: /*data*/ return this.data == null ? new Base[0] : new Base[] {this.data}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1008619738: // origin - this.origin = castToSimpleQuantity(value); // SimpleQuantity - break; - case -991726143: // period - this.period = castToDecimal(value); // DecimalType - break; - case -1282148017: // factor - this.factor = castToDecimal(value); // DecimalType - break; - case 1209133370: // lowerLimit - this.lowerLimit = castToDecimal(value); // DecimalType - break; - case -1681713095: // upperLimit - this.upperLimit = castToDecimal(value); // DecimalType - break; - case 414334925: // dimensions - this.dimensions = castToPositiveInt(value); // PositiveIntType - break; - case 3076010: // data - this.data = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("origin")) - this.origin = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("period")) - this.period = castToDecimal(value); // DecimalType - else if (name.equals("factor")) - this.factor = castToDecimal(value); // DecimalType - else if (name.equals("lowerLimit")) - this.lowerLimit = castToDecimal(value); // DecimalType - else if (name.equals("upperLimit")) - this.upperLimit = castToDecimal(value); // DecimalType - else if (name.equals("dimensions")) - this.dimensions = castToPositiveInt(value); // PositiveIntType - else if (name.equals("data")) - this.data = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1008619738: return getOrigin(); // SimpleQuantity - case -991726143: throw new FHIRException("Cannot make property period as it is not a complex type"); // DecimalType - case -1282148017: throw new FHIRException("Cannot make property factor as it is not a complex type"); // DecimalType - case 1209133370: throw new FHIRException("Cannot make property lowerLimit as it is not a complex type"); // DecimalType - case -1681713095: throw new FHIRException("Cannot make property upperLimit as it is not a complex type"); // DecimalType - case 414334925: throw new FHIRException("Cannot make property dimensions as it is not a complex type"); // PositiveIntType - case 3076010: throw new FHIRException("Cannot make property data as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("origin")) { - this.origin = new SimpleQuantity(); - return this.origin; - } - else if (name.equals("period")) { - throw new FHIRException("Cannot call addChild on a primitive type SampledData.period"); - } - else if (name.equals("factor")) { - throw new FHIRException("Cannot call addChild on a primitive type SampledData.factor"); - } - else if (name.equals("lowerLimit")) { - throw new FHIRException("Cannot call addChild on a primitive type SampledData.lowerLimit"); - } - else if (name.equals("upperLimit")) { - throw new FHIRException("Cannot call addChild on a primitive type SampledData.upperLimit"); - } - else if (name.equals("dimensions")) { - throw new FHIRException("Cannot call addChild on a primitive type SampledData.dimensions"); - } - else if (name.equals("data")) { - throw new FHIRException("Cannot call addChild on a primitive type SampledData.data"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "SampledData"; - - } - - public SampledData copy() { - SampledData dst = new SampledData(); - copyValues(dst); - dst.origin = origin == null ? null : origin.copy(); - dst.period = period == null ? null : period.copy(); - dst.factor = factor == null ? null : factor.copy(); - dst.lowerLimit = lowerLimit == null ? null : lowerLimit.copy(); - dst.upperLimit = upperLimit == null ? null : upperLimit.copy(); - dst.dimensions = dimensions == null ? null : dimensions.copy(); - dst.data = data == null ? null : data.copy(); - return dst; - } - - protected SampledData typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SampledData)) - return false; - SampledData o = (SampledData) other; - return compareDeep(origin, o.origin, true) && compareDeep(period, o.period, true) && compareDeep(factor, o.factor, true) - && compareDeep(lowerLimit, o.lowerLimit, true) && compareDeep(upperLimit, o.upperLimit, true) && compareDeep(dimensions, o.dimensions, true) - && compareDeep(data, o.data, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SampledData)) - return false; - SampledData o = (SampledData) other; - return compareValues(period, o.period, true) && compareValues(factor, o.factor, true) && compareValues(lowerLimit, o.lowerLimit, true) - && compareValues(upperLimit, o.upperLimit, true) && compareValues(dimensions, o.dimensions, true) && compareValues(data, o.data, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (origin == null || origin.isEmpty()) && (period == null || period.isEmpty()) - && (factor == null || factor.isEmpty()) && (lowerLimit == null || lowerLimit.isEmpty()) && (upperLimit == null || upperLimit.isEmpty()) - && (dimensions == null || dimensions.isEmpty()) && (data == null || data.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Schedule.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Schedule.java deleted file mode 100644 index 751b049530c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Schedule.java +++ /dev/null @@ -1,653 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A container for slot(s) of time that may be available for booking appointments. - */ -@ResourceDef(name="Schedule", profile="http://hl7.org/fhir/Profile/Schedule") -public class Schedule extends DomainResource { - - /** - * External Ids for this item. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * A broad categorisation of the service that is to be performed during this appointment. - */ - @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." ) - protected CodeableConcept serviceCategory; - - /** - * The specific service that is to be performed during this appointment. - */ - @Child(name = "serviceType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The specific service that is to be performed during this appointment", formalDefinition="The specific service that is to be performed during this appointment." ) - protected List serviceType; - - /** - * The specialty of a practitioner that would be required to perform the service requested in this appointment. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." ) - protected List specialty; - - /** - * The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. - */ - @Child(name = "actor", type = {Patient.class, Practitioner.class, RelatedPerson.class, Device.class, HealthcareService.class, Location.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson", formalDefinition="The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson." ) - protected Reference actor; - - /** - * The actual object that is the target of the reference (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - protected Resource actorTarget; - - /** - * The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. - */ - @Child(name = "planningHorizon", type = {Period.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a \"template\" for planning outside these dates", formalDefinition="The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a \"template\" for planning outside these dates." ) - protected Period planningHorizon; - - /** - * Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - @Child(name = "comment", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated", formalDefinition="Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated." ) - protected StringType comment; - - private static final long serialVersionUID = 1234951934L; - - /** - * Constructor - */ - public Schedule() { - super(); - } - - /** - * Constructor - */ - public Schedule(Reference actor) { - super(); - this.actor = actor; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Schedule addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); // cc - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) - */ - public Schedule setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) - */ - public List getServiceType() { - if (this.serviceType == null) - this.serviceType = new ArrayList(); - return this.serviceType; - } - - public boolean hasServiceType() { - if (this.serviceType == null) - return false; - for (CodeableConcept item : this.serviceType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceType} (The specific service that is to be performed during this appointment.) - */ - // syntactic sugar - public CodeableConcept addServiceType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return t; - } - - // syntactic sugar - public Schedule addServiceType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return this; - } - - /** - * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public Schedule addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Reference getActor() { - if (this.actor == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.actor"); - else if (Configuration.doAutoCreate()) - this.actor = new Reference(); // cc - return this.actor; - } - - public boolean hasActor() { - return this.actor != null && !this.actor.isEmpty(); - } - - /** - * @param value {@link #actor} (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Schedule setActor(Reference value) { - this.actor = value; - return this; - } - - /** - * @return {@link #actor} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Resource getActorTarget() { - return this.actorTarget; - } - - /** - * @param value {@link #actor} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.) - */ - public Schedule setActorTarget(Resource value) { - this.actorTarget = value; - return this; - } - - /** - * @return {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) - */ - public Period getPlanningHorizon() { - if (this.planningHorizon == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.planningHorizon"); - else if (Configuration.doAutoCreate()) - this.planningHorizon = new Period(); // cc - return this.planningHorizon; - } - - public boolean hasPlanningHorizon() { - return this.planningHorizon != null && !this.planningHorizon.isEmpty(); - } - - /** - * @param value {@link #planningHorizon} (The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates.) - */ - public Schedule setPlanningHorizon(Period value) { - this.planningHorizon = value; - return this; - } - - /** - * @return {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Schedule.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Schedule setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. - */ - public Schedule setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("serviceType", "CodeableConcept", "The specific service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceType)); - childrenList.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("actor", "Reference(Patient|Practitioner|RelatedPerson|Device|HealthcareService|Location)", "The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson.", 0, java.lang.Integer.MAX_VALUE, actor)); - childrenList.add(new Property("planningHorizon", "Period", "The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a \"template\" for planning outside these dates.", 0, java.lang.Integer.MAX_VALUE, planningHorizon)); - childrenList.add(new Property("comment", "string", "Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept - case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept - case 92645877: /*actor*/ return this.actor == null ? new Base[0] : new Base[] {this.actor}; // Reference - case -1718507650: /*planningHorizon*/ return this.planningHorizon == null ? new Base[0] : new Base[] {this.planningHorizon}; // Period - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1281188563: // serviceCategory - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - break; - case -1928370289: // serviceType - this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1694759682: // specialty - this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 92645877: // actor - this.actor = castToReference(value); // Reference - break; - case -1718507650: // planningHorizon - this.planningHorizon = castToPeriod(value); // Period - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("serviceCategory")) - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("serviceType")) - this.getServiceType().add(castToCodeableConcept(value)); - else if (name.equals("specialty")) - this.getSpecialty().add(castToCodeableConcept(value)); - else if (name.equals("actor")) - this.actor = castToReference(value); // Reference - else if (name.equals("planningHorizon")) - this.planningHorizon = castToPeriod(value); // Period - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1281188563: return getServiceCategory(); // CodeableConcept - case -1928370289: return addServiceType(); // CodeableConcept - case -1694759682: return addSpecialty(); // CodeableConcept - case 92645877: return getActor(); // Reference - case -1718507650: return getPlanningHorizon(); // Period - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("serviceCategory")) { - this.serviceCategory = new CodeableConcept(); - return this.serviceCategory; - } - else if (name.equals("serviceType")) { - return addServiceType(); - } - else if (name.equals("specialty")) { - return addSpecialty(); - } - else if (name.equals("actor")) { - this.actor = new Reference(); - return this.actor; - } - else if (name.equals("planningHorizon")) { - this.planningHorizon = new Period(); - return this.planningHorizon; - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type Schedule.comment"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Schedule"; - - } - - public Schedule copy() { - Schedule dst = new Schedule(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - if (serviceType != null) { - dst.serviceType = new ArrayList(); - for (CodeableConcept i : serviceType) - dst.serviceType.add(i.copy()); - }; - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - dst.actor = actor == null ? null : actor.copy(); - dst.planningHorizon = planningHorizon == null ? null : planningHorizon.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - protected Schedule typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Schedule)) - return false; - Schedule o = (Schedule) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(serviceCategory, o.serviceCategory, true) - && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(actor, o.actor, true) - && compareDeep(planningHorizon, o.planningHorizon, true) && compareDeep(comment, o.comment, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Schedule)) - return false; - Schedule o = (Schedule) other; - return compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) - && (serviceType == null || serviceType.isEmpty()) && (specialty == null || specialty.isEmpty()) - && (actor == null || actor.isEmpty()) && (planningHorizon == null || planningHorizon.isEmpty()) - && (comment == null || comment.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Schedule; - } - - /** - * Search parameter: actor - *

- * Description: The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for
- * Type: reference
- * Path: Schedule.actor
- *

- */ - @SearchParamDefinition(name="actor", path="Schedule.actor", description="The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for", type="reference" ) - public static final String SP_ACTOR = "actor"; - /** - * Fluent Client search parameter constant for actor - *

- * Description: The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for
- * Type: reference
- * Path: Schedule.actor
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ACTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ACTOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Schedule:actor". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ACTOR = new ca.uhn.fhir.model.api.Include("Schedule:actor").toLocked(); - - /** - * Search parameter: date - *

- * Description: Search for Schedule resources that have a period that contains this date specified
- * Type: date
- * Path: Schedule.planningHorizon
- *

- */ - @SearchParamDefinition(name="date", path="Schedule.planningHorizon", description="Search for Schedule resources that have a period that contains this date specified", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: Search for Schedule resources that have a period that contains this date specified
- * Type: date
- * Path: Schedule.planningHorizon
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: type - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: A Schedule Identifier
- * Type: token
- * Path: Schedule.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Schedule.identifier", description="A Schedule Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A Schedule Identifier
- * Type: token
- * Path: Schedule.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SearchParameter.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SearchParameter.java deleted file mode 100644 index 99fa2262555..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SearchParameter.java +++ /dev/null @@ -1,1824 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType; -import org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A search parameter that defines a named search item that can be used to search/filter on a resource. - */ -@ResourceDef(name="SearchParameter", profile="http://hl7.org/fhir/Profile/SearchParameter") -public class SearchParameter extends DomainResource { - - public enum XPathUsageType { - /** - * The search parameter is derived directly from the selected nodes based on the type definitions. - */ - NORMAL, - /** - * The search parameter is derived by a phonetic transform from the selected nodes. - */ - PHONETIC, - /** - * The search parameter is based on a spatial transform of the selected nodes. - */ - NEARBY, - /** - * The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle. - */ - DISTANCE, - /** - * The interpretation of the xpath statement is unknown (and can't be automated). - */ - OTHER, - /** - * added to help the parsers - */ - NULL; - public static XPathUsageType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("normal".equals(codeString)) - return NORMAL; - if ("phonetic".equals(codeString)) - return PHONETIC; - if ("nearby".equals(codeString)) - return NEARBY; - if ("distance".equals(codeString)) - return DISTANCE; - if ("other".equals(codeString)) - return OTHER; - throw new FHIRException("Unknown XPathUsageType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NORMAL: return "normal"; - case PHONETIC: return "phonetic"; - case NEARBY: return "nearby"; - case DISTANCE: return "distance"; - case OTHER: return "other"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NORMAL: return "http://hl7.org/fhir/search-xpath-usage"; - case PHONETIC: return "http://hl7.org/fhir/search-xpath-usage"; - case NEARBY: return "http://hl7.org/fhir/search-xpath-usage"; - case DISTANCE: return "http://hl7.org/fhir/search-xpath-usage"; - case OTHER: return "http://hl7.org/fhir/search-xpath-usage"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NORMAL: return "The search parameter is derived directly from the selected nodes based on the type definitions."; - case PHONETIC: return "The search parameter is derived by a phonetic transform from the selected nodes."; - case NEARBY: return "The search parameter is based on a spatial transform of the selected nodes."; - case DISTANCE: return "The search parameter is based on a spatial transform of the selected nodes, using physical distance from the middle."; - case OTHER: return "The interpretation of the xpath statement is unknown (and can't be automated)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NORMAL: return "Normal"; - case PHONETIC: return "Phonetic"; - case NEARBY: return "Nearby"; - case DISTANCE: return "Distance"; - case OTHER: return "Other"; - default: return "?"; - } - } - } - - public static class XPathUsageTypeEnumFactory implements EnumFactory { - public XPathUsageType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("normal".equals(codeString)) - return XPathUsageType.NORMAL; - if ("phonetic".equals(codeString)) - return XPathUsageType.PHONETIC; - if ("nearby".equals(codeString)) - return XPathUsageType.NEARBY; - if ("distance".equals(codeString)) - return XPathUsageType.DISTANCE; - if ("other".equals(codeString)) - return XPathUsageType.OTHER; - throw new IllegalArgumentException("Unknown XPathUsageType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("normal".equals(codeString)) - return new Enumeration(this, XPathUsageType.NORMAL); - if ("phonetic".equals(codeString)) - return new Enumeration(this, XPathUsageType.PHONETIC); - if ("nearby".equals(codeString)) - return new Enumeration(this, XPathUsageType.NEARBY); - if ("distance".equals(codeString)) - return new Enumeration(this, XPathUsageType.DISTANCE); - if ("other".equals(codeString)) - return new Enumeration(this, XPathUsageType.OTHER); - throw new FHIRException("Unknown XPathUsageType code '"+codeString+"'"); - } - public String toCode(XPathUsageType code) { - if (code == XPathUsageType.NORMAL) - return "normal"; - if (code == XPathUsageType.PHONETIC) - return "phonetic"; - if (code == XPathUsageType.NEARBY) - return "nearby"; - if (code == XPathUsageType.DISTANCE) - return "distance"; - if (code == XPathUsageType.OTHER) - return "other"; - return "?"; - } - public String toSystem(XPathUsageType code) { - return code.getSystem(); - } - } - - @Block() - public static class SearchParameterContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the search parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the search parameter." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public SearchParameterContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameterContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SearchParameterContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the search parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the search parameter. - */ - public SearchParameterContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public SearchParameterContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public SearchParameterContactComponent copy() { - SearchParameterContactComponent dst = new SearchParameterContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SearchParameterContactComponent)) - return false; - SearchParameterContactComponent o = (SearchParameterContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SearchParameterContactComponent)) - return false; - SearchParameterContactComponent o = (SearchParameterContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "SearchParameter.contact"; - - } - - } - - /** - * An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL used to reference this search parameter", formalDefinition="An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published." ) - protected UriType url; - - /** - * A free text natural language name identifying the search parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this search parameter", formalDefinition="A free text natural language name identifying the search parameter." ) - protected StringType name; - - /** - * The status of this search parameter definition. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of this search parameter definition." ) - protected Enumeration status; - - /** - * A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Publication Date(/time)", formalDefinition="The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes." ) - protected DateTimeType date; - - /** - * The name of the individual or organization that published the search parameter. - */ - @Child(name = "publisher", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the search parameter." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters." ) - protected List useContext; - - /** - * The Scope and Usage that this search parameter was created to meet. - */ - @Child(name = "requirements", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why this search parameter is defined", formalDefinition="The Scope and Usage that this search parameter was created to meet." ) - protected StringType requirements; - - /** - * The code used in the URL or the parameter name in a parameters resource for this search parameter. - */ - @Child(name = "code", type = {CodeType.class}, order=9, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Code used in URL", formalDefinition="The code used in the URL or the parameter name in a parameters resource for this search parameter." ) - protected CodeType code; - - /** - * The base resource type that this search parameter refers to. - */ - @Child(name = "base", type = {CodeType.class}, order=10, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The resource type this search parameter applies to", formalDefinition="The base resource type that this search parameter refers to." ) - protected CodeType base; - - /** - * The type of value a search parameter refers to, and how the content is interpreted. - */ - @Child(name = "type", type = {CodeType.class}, order=11, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="number | date | string | token | reference | composite | quantity | uri", formalDefinition="The type of value a search parameter refers to, and how the content is interpreted." ) - protected Enumeration type; - - /** - * A description of the search parameters and how it used. - */ - @Child(name = "description", type = {StringType.class}, order=12, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Documentation for search parameter", formalDefinition="A description of the search parameters and how it used." ) - protected StringType description; - - /** - * A FluentPath expression that returns a set of elements for the search parameter. - */ - @Child(name = "expression", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="FluentPath expression that extracts the values", formalDefinition="A FluentPath expression that returns a set of elements for the search parameter." ) - protected StringType expression; - - /** - * An XPath expression that returns a set of elements for the search parameter. - */ - @Child(name = "xpath", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="XPath that extracts the values", formalDefinition="An XPath expression that returns a set of elements for the search parameter." ) - protected StringType xpath; - - /** - * How the search parameter relates to the set of elements returned by evaluating the xpath query. - */ - @Child(name = "xpathUsage", type = {CodeType.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="normal | phonetic | nearby | distance | other", formalDefinition="How the search parameter relates to the set of elements returned by evaluating the xpath query." ) - protected Enumeration xpathUsage; - - /** - * Types of resource (if a resource is referenced). - */ - @Child(name = "target", type = {CodeType.class}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Types of resource (if a resource reference)", formalDefinition="Types of resource (if a resource is referenced)." ) - protected List target; - - private static final long serialVersionUID = -310845178L; - - /** - * Constructor - */ - public SearchParameter() { - super(); - } - - /** - * Constructor - */ - public SearchParameter(UriType url, StringType name, CodeType code, CodeType base, Enumeration type, StringType description) { - super(); - this.url = url; - this.name = name; - this.code = code; - this.base = base; - this.type = type; - this.description = description; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SearchParameter setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published. - */ - public SearchParameter setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the search parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SearchParameter setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the search parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the search parameter. - */ - public SearchParameter setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of this search parameter definition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SearchParameter setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of this search parameter definition. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of this search parameter definition. - */ - public SearchParameter setStatus(ConformanceResourceStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public SearchParameter setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public SearchParameter setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #date} (The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public SearchParameter setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes. - */ - public SearchParameter setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the search parameter.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public SearchParameter setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the search parameter. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the search parameter. - */ - public SearchParameter setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (SearchParameterContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public SearchParameterContactComponent addContact() { //3 - SearchParameterContactComponent t = new SearchParameterContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public SearchParameter addContact(SearchParameterContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public SearchParameter addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (The Scope and Usage that this search parameter was created to meet.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public SearchParameter setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return The Scope and Usage that this search parameter was created to meet. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value The Scope and Usage that this search parameter was created to meet. - */ - public SearchParameter setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (The code used in the URL or the parameter name in a parameters resource for this search parameter.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The code used in the URL or the parameter name in a parameters resource for this search parameter.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public SearchParameter setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return The code used in the URL or the parameter name in a parameters resource for this search parameter. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The code used in the URL or the parameter name in a parameters resource for this search parameter. - */ - public SearchParameter setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public CodeType getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.base"); - else if (Configuration.doAutoCreate()) - this.base = new CodeType(); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The base resource type that this search parameter refers to.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public SearchParameter setBaseElement(CodeType value) { - this.base = value; - return this; - } - - /** - * @return The base resource type that this search parameter refers to. - */ - public String getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The base resource type that this search parameter refers to. - */ - public SearchParameter setBase(String value) { - if (this.base == null) - this.base = new CodeType(); - this.base.setValue(value); - return this; - } - - /** - * @return {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of value a search parameter refers to, and how the content is interpreted.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SearchParameter setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParamType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of value a search parameter refers to, and how the content is interpreted. - */ - public SearchParameter setType(SearchParamType value) { - if (this.type == null) - this.type = new Enumeration(new SearchParamTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the search parameters and how it used.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SearchParameter setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the search parameters and how it used. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the search parameters and how it used. - */ - public SearchParameter setDescription(String value) { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - return this; - } - - /** - * @return {@link #expression} (A FluentPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value - */ - public StringType getExpressionElement() { - if (this.expression == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.expression"); - else if (Configuration.doAutoCreate()) - this.expression = new StringType(); // bb - return this.expression; - } - - public boolean hasExpressionElement() { - return this.expression != null && !this.expression.isEmpty(); - } - - public boolean hasExpression() { - return this.expression != null && !this.expression.isEmpty(); - } - - /** - * @param value {@link #expression} (A FluentPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getExpression" gives direct access to the value - */ - public SearchParameter setExpressionElement(StringType value) { - this.expression = value; - return this; - } - - /** - * @return A FluentPath expression that returns a set of elements for the search parameter. - */ - public String getExpression() { - return this.expression == null ? null : this.expression.getValue(); - } - - /** - * @param value A FluentPath expression that returns a set of elements for the search parameter. - */ - public SearchParameter setExpression(String value) { - if (Utilities.noString(value)) - this.expression = null; - else { - if (this.expression == null) - this.expression = new StringType(); - this.expression.setValue(value); - } - return this; - } - - /** - * @return {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public StringType getXpathElement() { - if (this.xpath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.xpath"); - else if (Configuration.doAutoCreate()) - this.xpath = new StringType(); // bb - return this.xpath; - } - - public boolean hasXpathElement() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - public boolean hasXpath() { - return this.xpath != null && !this.xpath.isEmpty(); - } - - /** - * @param value {@link #xpath} (An XPath expression that returns a set of elements for the search parameter.). This is the underlying object with id, value and extensions. The accessor "getXpath" gives direct access to the value - */ - public SearchParameter setXpathElement(StringType value) { - this.xpath = value; - return this; - } - - /** - * @return An XPath expression that returns a set of elements for the search parameter. - */ - public String getXpath() { - return this.xpath == null ? null : this.xpath.getValue(); - } - - /** - * @param value An XPath expression that returns a set of elements for the search parameter. - */ - public SearchParameter setXpath(String value) { - if (Utilities.noString(value)) - this.xpath = null; - else { - if (this.xpath == null) - this.xpath = new StringType(); - this.xpath.setValue(value); - } - return this; - } - - /** - * @return {@link #xpathUsage} (How the search parameter relates to the set of elements returned by evaluating the xpath query.). This is the underlying object with id, value and extensions. The accessor "getXpathUsage" gives direct access to the value - */ - public Enumeration getXpathUsageElement() { - if (this.xpathUsage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SearchParameter.xpathUsage"); - else if (Configuration.doAutoCreate()) - this.xpathUsage = new Enumeration(new XPathUsageTypeEnumFactory()); // bb - return this.xpathUsage; - } - - public boolean hasXpathUsageElement() { - return this.xpathUsage != null && !this.xpathUsage.isEmpty(); - } - - public boolean hasXpathUsage() { - return this.xpathUsage != null && !this.xpathUsage.isEmpty(); - } - - /** - * @param value {@link #xpathUsage} (How the search parameter relates to the set of elements returned by evaluating the xpath query.). This is the underlying object with id, value and extensions. The accessor "getXpathUsage" gives direct access to the value - */ - public SearchParameter setXpathUsageElement(Enumeration value) { - this.xpathUsage = value; - return this; - } - - /** - * @return How the search parameter relates to the set of elements returned by evaluating the xpath query. - */ - public XPathUsageType getXpathUsage() { - return this.xpathUsage == null ? null : this.xpathUsage.getValue(); - } - - /** - * @param value How the search parameter relates to the set of elements returned by evaluating the xpath query. - */ - public SearchParameter setXpathUsage(XPathUsageType value) { - if (value == null) - this.xpathUsage = null; - else { - if (this.xpathUsage == null) - this.xpathUsage = new Enumeration(new XPathUsageTypeEnumFactory()); - this.xpathUsage.setValue(value); - } - return this; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (CodeType item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Types of resource (if a resource is referenced).) - */ - // syntactic sugar - public CodeType addTargetElement() {//2 - CodeType t = new CodeType(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public SearchParameter addTarget(String value) { //1 - CodeType t = new CodeType(); - t.setValue(value); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @param value {@link #target} (Types of resource (if a resource is referenced).) - */ - public boolean hasTarget(String value) { - if (this.target == null) - return false; - for (CodeType v : this.target) - if (v.equals(value)) // code - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this search parameter when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this search parameter is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the search parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of this search parameter definition.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "A flag to indicate that this search parameter definition is authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("date", "dateTime", "The date (and optionally time) when the search parameter definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the search parameter changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the search parameter.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of search parameters.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "The Scope and Usage that this search parameter was created to meet.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("code", "code", "The code used in the URL or the parameter name in a parameters resource for this search parameter.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("base", "code", "The base resource type that this search parameter refers to.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("type", "code", "The type of value a search parameter refers to, and how the content is interpreted.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "A description of the search parameters and how it used.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("expression", "string", "A FluentPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, expression)); - childrenList.add(new Property("xpath", "string", "An XPath expression that returns a set of elements for the search parameter.", 0, java.lang.Integer.MAX_VALUE, xpath)); - childrenList.add(new Property("xpathUsage", "code", "How the search parameter relates to the set of elements returned by evaluating the xpath query.", 0, java.lang.Integer.MAX_VALUE, xpathUsage)); - childrenList.add(new Property("target", "code", "Types of resource (if a resource is referenced).", 0, java.lang.Integer.MAX_VALUE, target)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // SearchParameterContactComponent - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // CodeType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1795452264: /*expression*/ return this.expression == null ? new Base[0] : new Base[] {this.expression}; // StringType - case 114256029: /*xpath*/ return this.xpath == null ? new Base[0] : new Base[] {this.xpath}; // StringType - case 1801322244: /*xpathUsage*/ return this.xpathUsage == null ? new Base[0] : new Base[] {this.xpathUsage}; // Enumeration - case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // CodeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((SearchParameterContactComponent) value); // SearchParameterContactComponent - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 3016401: // base - this.base = castToCode(value); // CodeType - break; - case 3575610: // type - this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1795452264: // expression - this.expression = castToString(value); // StringType - break; - case 114256029: // xpath - this.xpath = castToString(value); // StringType - break; - case 1801322244: // xpathUsage - this.xpathUsage = new XPathUsageTypeEnumFactory().fromType(value); // Enumeration - break; - case -880905839: // target - this.getTarget().add(castToCode(value)); // CodeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((SearchParameterContactComponent) value); - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("base")) - this.base = castToCode(value); // CodeType - else if (name.equals("type")) - this.type = new SearchParamTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("expression")) - this.expression = castToString(value); // StringType - else if (name.equals("xpath")) - this.xpath = castToString(value); // StringType - else if (name.equals("xpathUsage")) - this.xpathUsage = new XPathUsageTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("target")) - this.getTarget().add(castToCode(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // SearchParameterContactComponent - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 3016401: throw new FHIRException("Cannot make property base as it is not a complex type"); // CodeType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1795452264: throw new FHIRException("Cannot make property expression as it is not a complex type"); // StringType - case 114256029: throw new FHIRException("Cannot make property xpath as it is not a complex type"); // StringType - case 1801322244: throw new FHIRException("Cannot make property xpathUsage as it is not a complex type"); // Enumeration - case -880905839: throw new FHIRException("Cannot make property target as it is not a complex type"); // CodeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.url"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.experimental"); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.date"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.requirements"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.code"); - } - else if (name.equals("base")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.base"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.type"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.description"); - } - else if (name.equals("expression")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.expression"); - } - else if (name.equals("xpath")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.xpath"); - } - else if (name.equals("xpathUsage")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.xpathUsage"); - } - else if (name.equals("target")) { - throw new FHIRException("Cannot call addChild on a primitive type SearchParameter.target"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "SearchParameter"; - - } - - public SearchParameter copy() { - SearchParameter dst = new SearchParameter(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.date = date == null ? null : date.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (SearchParameterContactComponent i : contact) - dst.contact.add(i.copy()); - }; - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.code = code == null ? null : code.copy(); - dst.base = base == null ? null : base.copy(); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - dst.expression = expression == null ? null : expression.copy(); - dst.xpath = xpath == null ? null : xpath.copy(); - dst.xpathUsage = xpathUsage == null ? null : xpathUsage.copy(); - if (target != null) { - dst.target = new ArrayList(); - for (CodeType i : target) - dst.target.add(i.copy()); - }; - return dst; - } - - protected SearchParameter typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SearchParameter)) - return false; - SearchParameter o = (SearchParameter) other; - return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) - && compareDeep(experimental, o.experimental, true) && compareDeep(date, o.date, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(useContext, o.useContext, true) && compareDeep(requirements, o.requirements, true) - && compareDeep(code, o.code, true) && compareDeep(base, o.base, true) && compareDeep(type, o.type, true) - && compareDeep(description, o.description, true) && compareDeep(expression, o.expression, true) - && compareDeep(xpath, o.xpath, true) && compareDeep(xpathUsage, o.xpathUsage, true) && compareDeep(target, o.target, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SearchParameter)) - return false; - SearchParameter o = (SearchParameter) other; - return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(status, o.status, true) - && compareValues(experimental, o.experimental, true) && compareValues(date, o.date, true) && compareValues(publisher, o.publisher, true) - && compareValues(requirements, o.requirements, true) && compareValues(code, o.code, true) && compareValues(base, o.base, true) - && compareValues(type, o.type, true) && compareValues(description, o.description, true) && compareValues(expression, o.expression, true) - && compareValues(xpath, o.xpath, true) && compareValues(xpathUsage, o.xpathUsage, true) && compareValues(target, o.target, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (date == null || date.isEmpty()) && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) - && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (code == null || code.isEmpty()) && (base == null || base.isEmpty()) && (type == null || type.isEmpty()) - && (description == null || description.isEmpty()) && (expression == null || expression.isEmpty()) - && (xpath == null || xpath.isEmpty()) && (xpathUsage == null || xpathUsage.isEmpty()) && (target == null || target.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SearchParameter; - } - - /** - * Search parameter: description - *

- * Description: Documentation for search parameter
- * Type: string
- * Path: SearchParameter.description
- *

- */ - @SearchParamDefinition(name="description", path="SearchParameter.description", description="Documentation for search parameter", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Documentation for search parameter
- * Type: string
- * Path: SearchParameter.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: Informal name for this search parameter
- * Type: string
- * Path: SearchParameter.name
- *

- */ - @SearchParamDefinition(name="name", path="SearchParameter.name", description="Informal name for this search parameter", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Informal name for this search parameter
- * Type: string
- * Path: SearchParameter.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the search parameter
- * Type: token
- * Path: SearchParameter.useContext
- *

- */ - @SearchParamDefinition(name="context", path="SearchParameter.useContext", description="A use context assigned to the search parameter", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the search parameter
- * Type: token
- * Path: SearchParameter.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: target - *

- * Description: Types of resource (if a resource reference)
- * Type: token
- * Path: SearchParameter.target
- *

- */ - @SearchParamDefinition(name="target", path="SearchParameter.target", description="Types of resource (if a resource reference)", type="token" ) - public static final String SP_TARGET = "target"; - /** - * Fluent Client search parameter constant for target - *

- * Description: Types of resource (if a resource reference)
- * Type: token
- * Path: SearchParameter.target
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TARGET = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TARGET); - - /** - * Search parameter: base - *

- * Description: The resource type this search parameter applies to
- * Type: token
- * Path: SearchParameter.base
- *

- */ - @SearchParamDefinition(name="base", path="SearchParameter.base", description="The resource type this search parameter applies to", type="token" ) - public static final String SP_BASE = "base"; - /** - * Fluent Client search parameter constant for base - *

- * Description: The resource type this search parameter applies to
- * Type: token
- * Path: SearchParameter.base
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BASE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BASE); - - /** - * Search parameter: code - *

- * Description: Code used in URL
- * Type: token
- * Path: SearchParameter.code
- *

- */ - @SearchParamDefinition(name="code", path="SearchParameter.code", description="Code used in URL", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: Code used in URL
- * Type: token
- * Path: SearchParameter.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: type - *

- * Description: number | date | string | token | reference | composite | quantity | uri
- * Type: token
- * Path: SearchParameter.type
- *

- */ - @SearchParamDefinition(name="type", path="SearchParameter.type", description="number | date | string | token | reference | composite | quantity | uri", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: number | date | string | token | reference | composite | quantity | uri
- * Type: token
- * Path: SearchParameter.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: url - *

- * Description: Absolute URL used to reference this search parameter
- * Type: uri
- * Path: SearchParameter.url
- *

- */ - @SearchParamDefinition(name="url", path="SearchParameter.url", description="Absolute URL used to reference this search parameter", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Absolute URL used to reference this search parameter
- * Type: uri
- * Path: SearchParameter.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Sequence.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Sequence.java deleted file mode 100644 index fe543c74622..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Sequence.java +++ /dev/null @@ -1,3999 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * Variation and Sequence data. - */ -@ResourceDef(name="Sequence", profile="http://hl7.org/fhir/Profile/Sequence") -public class Sequence extends DomainResource { - - public enum SequenceType { - /** - * Amino acid sequence - */ - AA, - /** - * DNA Sequence - */ - DNA, - /** - * RNA Sequence - */ - RNA, - /** - * added to help the parsers - */ - NULL; - public static SequenceType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("AA".equals(codeString)) - return AA; - if ("DNA".equals(codeString)) - return DNA; - if ("RNA".equals(codeString)) - return RNA; - throw new FHIRException("Unknown SequenceType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AA: return "AA"; - case DNA: return "DNA"; - case RNA: return "RNA"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AA: return "http://hl7.org/fhir/sequence-type"; - case DNA: return "http://hl7.org/fhir/sequence-type"; - case RNA: return "http://hl7.org/fhir/sequence-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AA: return "Amino acid sequence"; - case DNA: return "DNA Sequence"; - case RNA: return "RNA Sequence"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AA: return "AA Sequence"; - case DNA: return "DNA Sequence"; - case RNA: return "RNA Sequence"; - default: return "?"; - } - } - } - - public static class SequenceTypeEnumFactory implements EnumFactory { - public SequenceType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("AA".equals(codeString)) - return SequenceType.AA; - if ("DNA".equals(codeString)) - return SequenceType.DNA; - if ("RNA".equals(codeString)) - return SequenceType.RNA; - throw new IllegalArgumentException("Unknown SequenceType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("AA".equals(codeString)) - return new Enumeration(this, SequenceType.AA); - if ("DNA".equals(codeString)) - return new Enumeration(this, SequenceType.DNA); - if ("RNA".equals(codeString)) - return new Enumeration(this, SequenceType.RNA); - throw new FHIRException("Unknown SequenceType code '"+codeString+"'"); - } - public String toCode(SequenceType code) { - if (code == SequenceType.AA) - return "AA"; - if (code == SequenceType.DNA) - return "DNA"; - if (code == SequenceType.RNA) - return "RNA"; - return "?"; - } - public String toSystem(SequenceType code) { - return code.getSystem(); - } - } - - @Block() - public static class SequenceReferenceSeqComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used. - */ - @Child(name = "chromosome", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The chromosome containing the genetic finding", formalDefinition="The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used." ) - protected CodeableConcept chromosome; - - /** - * The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. - */ - @Child(name = "genomeBuild", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'", formalDefinition="The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used." ) - protected StringType genomeBuild; - - /** - * Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences. - */ - @Child(name = "referenceSeqId", type = {CodeableConcept.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reference identifier", formalDefinition="Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences." ) - protected CodeableConcept referenceSeqId; - - /** - * A Pointer to another Sequence entity as refence sequence. - */ - @Child(name = "referenceSeqPointer", type = {Sequence.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A Pointer to another Sequence entity as refence sequence", formalDefinition="A Pointer to another Sequence entity as refence sequence." ) - protected Reference referenceSeqPointer; - - /** - * The actual object that is the target of the reference (A Pointer to another Sequence entity as refence sequence.) - */ - protected Sequence referenceSeqPointerTarget; - - /** - * A Reference Sequence string. - */ - @Child(name = "referenceSeqString", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A Reference Sequence string", formalDefinition="A Reference Sequence string." ) - protected StringType referenceSeqString; - - /** - * 0-based start position (inclusive) of the window on the reference sequence. - */ - @Child(name = "windowStart", type = {IntegerType.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="0-based start position (inclusive) of the window on the reference sequence", formalDefinition="0-based start position (inclusive) of the window on the reference sequence." ) - protected IntegerType windowStart; - - /** - * 0-based end position (exclusive) of the window on the reference sequence. - */ - @Child(name = "windowEnd", type = {IntegerType.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="0-based end position (exclusive) of the window on the reference sequence", formalDefinition="0-based end position (exclusive) of the window on the reference sequence." ) - protected IntegerType windowEnd; - - private static final long serialVersionUID = -165922935L; - - /** - * Constructor - */ - public SequenceReferenceSeqComponent() { - super(); - } - - /** - * Constructor - */ - public SequenceReferenceSeqComponent(CodeableConcept referenceSeqId, IntegerType windowStart, IntegerType windowEnd) { - super(); - this.referenceSeqId = referenceSeqId; - this.windowStart = windowStart; - this.windowEnd = windowEnd; - } - - /** - * @return {@link #chromosome} (The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used.) - */ - public CodeableConcept getChromosome() { - if (this.chromosome == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.chromosome"); - else if (Configuration.doAutoCreate()) - this.chromosome = new CodeableConcept(); // cc - return this.chromosome; - } - - public boolean hasChromosome() { - return this.chromosome != null && !this.chromosome.isEmpty(); - } - - /** - * @param value {@link #chromosome} (The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used.) - */ - public SequenceReferenceSeqComponent setChromosome(CodeableConcept value) { - this.chromosome = value; - return this; - } - - /** - * @return {@link #genomeBuild} (The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.). This is the underlying object with id, value and extensions. The accessor "getGenomeBuild" gives direct access to the value - */ - public StringType getGenomeBuildElement() { - if (this.genomeBuild == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.genomeBuild"); - else if (Configuration.doAutoCreate()) - this.genomeBuild = new StringType(); // bb - return this.genomeBuild; - } - - public boolean hasGenomeBuildElement() { - return this.genomeBuild != null && !this.genomeBuild.isEmpty(); - } - - public boolean hasGenomeBuild() { - return this.genomeBuild != null && !this.genomeBuild.isEmpty(); - } - - /** - * @param value {@link #genomeBuild} (The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.). This is the underlying object with id, value and extensions. The accessor "getGenomeBuild" gives direct access to the value - */ - public SequenceReferenceSeqComponent setGenomeBuildElement(StringType value) { - this.genomeBuild = value; - return this; - } - - /** - * @return The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. - */ - public String getGenomeBuild() { - return this.genomeBuild == null ? null : this.genomeBuild.getValue(); - } - - /** - * @param value The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used. - */ - public SequenceReferenceSeqComponent setGenomeBuild(String value) { - if (Utilities.noString(value)) - this.genomeBuild = null; - else { - if (this.genomeBuild == null) - this.genomeBuild = new StringType(); - this.genomeBuild.setValue(value); - } - return this; - } - - /** - * @return {@link #referenceSeqId} (Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.) - */ - public CodeableConcept getReferenceSeqId() { - if (this.referenceSeqId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqId"); - else if (Configuration.doAutoCreate()) - this.referenceSeqId = new CodeableConcept(); // cc - return this.referenceSeqId; - } - - public boolean hasReferenceSeqId() { - return this.referenceSeqId != null && !this.referenceSeqId.isEmpty(); - } - - /** - * @param value {@link #referenceSeqId} (Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.) - */ - public SequenceReferenceSeqComponent setReferenceSeqId(CodeableConcept value) { - this.referenceSeqId = value; - return this; - } - - /** - * @return {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.) - */ - public Reference getReferenceSeqPointer() { - if (this.referenceSeqPointer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer"); - else if (Configuration.doAutoCreate()) - this.referenceSeqPointer = new Reference(); // cc - return this.referenceSeqPointer; - } - - public boolean hasReferenceSeqPointer() { - return this.referenceSeqPointer != null && !this.referenceSeqPointer.isEmpty(); - } - - /** - * @param value {@link #referenceSeqPointer} (A Pointer to another Sequence entity as refence sequence.) - */ - public SequenceReferenceSeqComponent setReferenceSeqPointer(Reference value) { - this.referenceSeqPointer = value; - return this; - } - - /** - * @return {@link #referenceSeqPointer} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A Pointer to another Sequence entity as refence sequence.) - */ - public Sequence getReferenceSeqPointerTarget() { - if (this.referenceSeqPointerTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqPointer"); - else if (Configuration.doAutoCreate()) - this.referenceSeqPointerTarget = new Sequence(); // aa - return this.referenceSeqPointerTarget; - } - - /** - * @param value {@link #referenceSeqPointer} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A Pointer to another Sequence entity as refence sequence.) - */ - public SequenceReferenceSeqComponent setReferenceSeqPointerTarget(Sequence value) { - this.referenceSeqPointerTarget = value; - return this; - } - - /** - * @return {@link #referenceSeqString} (A Reference Sequence string.). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value - */ - public StringType getReferenceSeqStringElement() { - if (this.referenceSeqString == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.referenceSeqString"); - else if (Configuration.doAutoCreate()) - this.referenceSeqString = new StringType(); // bb - return this.referenceSeqString; - } - - public boolean hasReferenceSeqStringElement() { - return this.referenceSeqString != null && !this.referenceSeqString.isEmpty(); - } - - public boolean hasReferenceSeqString() { - return this.referenceSeqString != null && !this.referenceSeqString.isEmpty(); - } - - /** - * @param value {@link #referenceSeqString} (A Reference Sequence string.). This is the underlying object with id, value and extensions. The accessor "getReferenceSeqString" gives direct access to the value - */ - public SequenceReferenceSeqComponent setReferenceSeqStringElement(StringType value) { - this.referenceSeqString = value; - return this; - } - - /** - * @return A Reference Sequence string. - */ - public String getReferenceSeqString() { - return this.referenceSeqString == null ? null : this.referenceSeqString.getValue(); - } - - /** - * @param value A Reference Sequence string. - */ - public SequenceReferenceSeqComponent setReferenceSeqString(String value) { - if (Utilities.noString(value)) - this.referenceSeqString = null; - else { - if (this.referenceSeqString == null) - this.referenceSeqString = new StringType(); - this.referenceSeqString.setValue(value); - } - return this; - } - - /** - * @return {@link #windowStart} (0-based start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value - */ - public IntegerType getWindowStartElement() { - if (this.windowStart == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowStart"); - else if (Configuration.doAutoCreate()) - this.windowStart = new IntegerType(); // bb - return this.windowStart; - } - - public boolean hasWindowStartElement() { - return this.windowStart != null && !this.windowStart.isEmpty(); - } - - public boolean hasWindowStart() { - return this.windowStart != null && !this.windowStart.isEmpty(); - } - - /** - * @param value {@link #windowStart} (0-based start position (inclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowStart" gives direct access to the value - */ - public SequenceReferenceSeqComponent setWindowStartElement(IntegerType value) { - this.windowStart = value; - return this; - } - - /** - * @return 0-based start position (inclusive) of the window on the reference sequence. - */ - public int getWindowStart() { - return this.windowStart == null || this.windowStart.isEmpty() ? 0 : this.windowStart.getValue(); - } - - /** - * @param value 0-based start position (inclusive) of the window on the reference sequence. - */ - public SequenceReferenceSeqComponent setWindowStart(int value) { - if (this.windowStart == null) - this.windowStart = new IntegerType(); - this.windowStart.setValue(value); - return this; - } - - /** - * @return {@link #windowEnd} (0-based end position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value - */ - public IntegerType getWindowEndElement() { - if (this.windowEnd == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceReferenceSeqComponent.windowEnd"); - else if (Configuration.doAutoCreate()) - this.windowEnd = new IntegerType(); // bb - return this.windowEnd; - } - - public boolean hasWindowEndElement() { - return this.windowEnd != null && !this.windowEnd.isEmpty(); - } - - public boolean hasWindowEnd() { - return this.windowEnd != null && !this.windowEnd.isEmpty(); - } - - /** - * @param value {@link #windowEnd} (0-based end position (exclusive) of the window on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getWindowEnd" gives direct access to the value - */ - public SequenceReferenceSeqComponent setWindowEndElement(IntegerType value) { - this.windowEnd = value; - return this; - } - - /** - * @return 0-based end position (exclusive) of the window on the reference sequence. - */ - public int getWindowEnd() { - return this.windowEnd == null || this.windowEnd.isEmpty() ? 0 : this.windowEnd.getValue(); - } - - /** - * @param value 0-based end position (exclusive) of the window on the reference sequence. - */ - public SequenceReferenceSeqComponent setWindowEnd(int value) { - if (this.windowEnd == null) - this.windowEnd = new IntegerType(); - this.windowEnd.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("chromosome", "CodeableConcept", "The chromosome containing the genetic finding. The value set will be 1-22, X, Y when the species is human without chromosome abnormality. Otherwise, NCBI-Gene code system should be used.", 0, java.lang.Integer.MAX_VALUE, chromosome)); - childrenList.add(new Property("genomeBuild", "string", "The Genome Build used for reference, following GRCh build versions e.g. 'GRCh 37'. Version number must be included if a versioned release of a primary build was used.", 0, java.lang.Integer.MAX_VALUE, genomeBuild)); - childrenList.add(new Property("referenceSeqId", "CodeableConcept", "Reference identifier of reference sequence submitted to NCBI. It must match the type in the Sequence.type field. For example, the prefix, “NG_” identifies reference sequence for genes, “NM_” for messenger RNA transcripts, and “NP_” for amino acid sequences.", 0, java.lang.Integer.MAX_VALUE, referenceSeqId)); - childrenList.add(new Property("referenceSeqPointer", "Reference(Sequence)", "A Pointer to another Sequence entity as refence sequence.", 0, java.lang.Integer.MAX_VALUE, referenceSeqPointer)); - childrenList.add(new Property("referenceSeqString", "string", "A Reference Sequence string.", 0, java.lang.Integer.MAX_VALUE, referenceSeqString)); - childrenList.add(new Property("windowStart", "integer", "0-based start position (inclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowStart)); - childrenList.add(new Property("windowEnd", "integer", "0-based end position (exclusive) of the window on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, windowEnd)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1499470472: /*chromosome*/ return this.chromosome == null ? new Base[0] : new Base[] {this.chromosome}; // CodeableConcept - case 1061239735: /*genomeBuild*/ return this.genomeBuild == null ? new Base[0] : new Base[] {this.genomeBuild}; // StringType - case -1911500465: /*referenceSeqId*/ return this.referenceSeqId == null ? new Base[0] : new Base[] {this.referenceSeqId}; // CodeableConcept - case 1923414665: /*referenceSeqPointer*/ return this.referenceSeqPointer == null ? new Base[0] : new Base[] {this.referenceSeqPointer}; // Reference - case -1648301499: /*referenceSeqString*/ return this.referenceSeqString == null ? new Base[0] : new Base[] {this.referenceSeqString}; // StringType - case 1903685202: /*windowStart*/ return this.windowStart == null ? new Base[0] : new Base[] {this.windowStart}; // IntegerType - case -217026869: /*windowEnd*/ return this.windowEnd == null ? new Base[0] : new Base[] {this.windowEnd}; // IntegerType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1499470472: // chromosome - this.chromosome = castToCodeableConcept(value); // CodeableConcept - break; - case 1061239735: // genomeBuild - this.genomeBuild = castToString(value); // StringType - break; - case -1911500465: // referenceSeqId - this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept - break; - case 1923414665: // referenceSeqPointer - this.referenceSeqPointer = castToReference(value); // Reference - break; - case -1648301499: // referenceSeqString - this.referenceSeqString = castToString(value); // StringType - break; - case 1903685202: // windowStart - this.windowStart = castToInteger(value); // IntegerType - break; - case -217026869: // windowEnd - this.windowEnd = castToInteger(value); // IntegerType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("chromosome")) - this.chromosome = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("genomeBuild")) - this.genomeBuild = castToString(value); // StringType - else if (name.equals("referenceSeqId")) - this.referenceSeqId = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("referenceSeqPointer")) - this.referenceSeqPointer = castToReference(value); // Reference - else if (name.equals("referenceSeqString")) - this.referenceSeqString = castToString(value); // StringType - else if (name.equals("windowStart")) - this.windowStart = castToInteger(value); // IntegerType - else if (name.equals("windowEnd")) - this.windowEnd = castToInteger(value); // IntegerType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1499470472: return getChromosome(); // CodeableConcept - case 1061239735: throw new FHIRException("Cannot make property genomeBuild as it is not a complex type"); // StringType - case -1911500465: return getReferenceSeqId(); // CodeableConcept - case 1923414665: return getReferenceSeqPointer(); // Reference - case -1648301499: throw new FHIRException("Cannot make property referenceSeqString as it is not a complex type"); // StringType - case 1903685202: throw new FHIRException("Cannot make property windowStart as it is not a complex type"); // IntegerType - case -217026869: throw new FHIRException("Cannot make property windowEnd as it is not a complex type"); // IntegerType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("chromosome")) { - this.chromosome = new CodeableConcept(); - return this.chromosome; - } - else if (name.equals("genomeBuild")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.genomeBuild"); - } - else if (name.equals("referenceSeqId")) { - this.referenceSeqId = new CodeableConcept(); - return this.referenceSeqId; - } - else if (name.equals("referenceSeqPointer")) { - this.referenceSeqPointer = new Reference(); - return this.referenceSeqPointer; - } - else if (name.equals("referenceSeqString")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceSeqString"); - } - else if (name.equals("windowStart")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowStart"); - } - else if (name.equals("windowEnd")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.windowEnd"); - } - else - return super.addChild(name); - } - - public SequenceReferenceSeqComponent copy() { - SequenceReferenceSeqComponent dst = new SequenceReferenceSeqComponent(); - copyValues(dst); - dst.chromosome = chromosome == null ? null : chromosome.copy(); - dst.genomeBuild = genomeBuild == null ? null : genomeBuild.copy(); - dst.referenceSeqId = referenceSeqId == null ? null : referenceSeqId.copy(); - dst.referenceSeqPointer = referenceSeqPointer == null ? null : referenceSeqPointer.copy(); - dst.referenceSeqString = referenceSeqString == null ? null : referenceSeqString.copy(); - dst.windowStart = windowStart == null ? null : windowStart.copy(); - dst.windowEnd = windowEnd == null ? null : windowEnd.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceReferenceSeqComponent)) - return false; - SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other; - return compareDeep(chromosome, o.chromosome, true) && compareDeep(genomeBuild, o.genomeBuild, true) - && compareDeep(referenceSeqId, o.referenceSeqId, true) && compareDeep(referenceSeqPointer, o.referenceSeqPointer, true) - && compareDeep(referenceSeqString, o.referenceSeqString, true) && compareDeep(windowStart, o.windowStart, true) - && compareDeep(windowEnd, o.windowEnd, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceReferenceSeqComponent)) - return false; - SequenceReferenceSeqComponent o = (SequenceReferenceSeqComponent) other; - return compareValues(genomeBuild, o.genomeBuild, true) && compareValues(referenceSeqString, o.referenceSeqString, true) - && compareValues(windowStart, o.windowStart, true) && compareValues(windowEnd, o.windowEnd, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (chromosome == null || chromosome.isEmpty()) && (genomeBuild == null || genomeBuild.isEmpty()) - && (referenceSeqId == null || referenceSeqId.isEmpty()) && (referenceSeqPointer == null || referenceSeqPointer.isEmpty()) - && (referenceSeqString == null || referenceSeqString.isEmpty()) && (windowStart == null || windowStart.isEmpty()) - && (windowEnd == null || windowEnd.isEmpty()); - } - - public String fhirType() { - return "Sequence.referenceSeq"; - - } - - } - - @Block() - public static class SequenceVariationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 0-based start position (inclusive) of the variation on the reference sequence. - */ - @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="0-based start position (inclusive) of the variation on the reference sequence", formalDefinition="0-based start position (inclusive) of the variation on the reference sequence." ) - protected IntegerType start; - - /** - * 0-based end position (exclusive) of the variation on the reference sequence. - */ - @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="0-based end position (exclusive) of the variation on the reference sequence", formalDefinition="0-based end position (exclusive) of the variation on the reference sequence." ) - protected IntegerType end; - - /** - * Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. - */ - @Child(name = "observedAllele", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Nucleotide(s)/amino acids from start position to stop position of observed variation", formalDefinition="Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand." ) - protected StringType observedAllele; - - /** - * Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. - */ - @Child(name = "referenceAllele", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Nucleotide(s)/amino acids from start position to stop position of reference variation", formalDefinition="Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand." ) - protected StringType referenceAllele; - - /** - * Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). - */ - @Child(name = "cigar", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Extended CIGAR string for aligning the sequence with reference bases", formalDefinition="Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm)." ) - protected StringType cigar; - - private static final long serialVersionUID = 913298829L; - - /** - * Constructor - */ - public SequenceVariationComponent() { - super(); - } - - /** - * @return {@link #start} (0-based start position (inclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public IntegerType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceVariationComponent.start"); - else if (Configuration.doAutoCreate()) - this.start = new IntegerType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (0-based start position (inclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public SequenceVariationComponent setStartElement(IntegerType value) { - this.start = value; - return this; - } - - /** - * @return 0-based start position (inclusive) of the variation on the reference sequence. - */ - public int getStart() { - return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); - } - - /** - * @param value 0-based start position (inclusive) of the variation on the reference sequence. - */ - public SequenceVariationComponent setStart(int value) { - if (this.start == null) - this.start = new IntegerType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (0-based end position (exclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public IntegerType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceVariationComponent.end"); - else if (Configuration.doAutoCreate()) - this.end = new IntegerType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (0-based end position (exclusive) of the variation on the reference sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public SequenceVariationComponent setEndElement(IntegerType value) { - this.end = value; - return this; - } - - /** - * @return 0-based end position (exclusive) of the variation on the reference sequence. - */ - public int getEnd() { - return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); - } - - /** - * @param value 0-based end position (exclusive) of the variation on the reference sequence. - */ - public SequenceVariationComponent setEnd(int value) { - if (this.end == null) - this.end = new IntegerType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #observedAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value - */ - public StringType getObservedAlleleElement() { - if (this.observedAllele == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceVariationComponent.observedAllele"); - else if (Configuration.doAutoCreate()) - this.observedAllele = new StringType(); // bb - return this.observedAllele; - } - - public boolean hasObservedAlleleElement() { - return this.observedAllele != null && !this.observedAllele.isEmpty(); - } - - public boolean hasObservedAllele() { - return this.observedAllele != null && !this.observedAllele.isEmpty(); - } - - /** - * @param value {@link #observedAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getObservedAllele" gives direct access to the value - */ - public SequenceVariationComponent setObservedAlleleElement(StringType value) { - this.observedAllele = value; - return this; - } - - /** - * @return Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. - */ - public String getObservedAllele() { - return this.observedAllele == null ? null : this.observedAllele.getValue(); - } - - /** - * @param value Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. - */ - public SequenceVariationComponent setObservedAllele(String value) { - if (Utilities.noString(value)) - this.observedAllele = null; - else { - if (this.observedAllele == null) - this.observedAllele = new StringType(); - this.observedAllele.setValue(value); - } - return this; - } - - /** - * @return {@link #referenceAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value - */ - public StringType getReferenceAlleleElement() { - if (this.referenceAllele == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceVariationComponent.referenceAllele"); - else if (Configuration.doAutoCreate()) - this.referenceAllele = new StringType(); // bb - return this.referenceAllele; - } - - public boolean hasReferenceAlleleElement() { - return this.referenceAllele != null && !this.referenceAllele.isEmpty(); - } - - public boolean hasReferenceAllele() { - return this.referenceAllele != null && !this.referenceAllele.isEmpty(); - } - - /** - * @param value {@link #referenceAllele} (Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.). This is the underlying object with id, value and extensions. The accessor "getReferenceAllele" gives direct access to the value - */ - public SequenceVariationComponent setReferenceAlleleElement(StringType value) { - this.referenceAllele = value; - return this; - } - - /** - * @return Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. - */ - public String getReferenceAllele() { - return this.referenceAllele == null ? null : this.referenceAllele.getValue(); - } - - /** - * @param value Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand. - */ - public SequenceVariationComponent setReferenceAllele(String value) { - if (Utilities.noString(value)) - this.referenceAllele = null; - else { - if (this.referenceAllele == null) - this.referenceAllele = new StringType(); - this.referenceAllele.setValue(value); - } - return this; - } - - /** - * @return {@link #cigar} (Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).). This is the underlying object with id, value and extensions. The accessor "getCigar" gives direct access to the value - */ - public StringType getCigarElement() { - if (this.cigar == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceVariationComponent.cigar"); - else if (Configuration.doAutoCreate()) - this.cigar = new StringType(); // bb - return this.cigar; - } - - public boolean hasCigarElement() { - return this.cigar != null && !this.cigar.isEmpty(); - } - - public boolean hasCigar() { - return this.cigar != null && !this.cigar.isEmpty(); - } - - /** - * @param value {@link #cigar} (Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).). This is the underlying object with id, value and extensions. The accessor "getCigar" gives direct access to the value - */ - public SequenceVariationComponent setCigarElement(StringType value) { - this.cigar = value; - return this; - } - - /** - * @return Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). - */ - public String getCigar() { - return this.cigar == null ? null : this.cigar.getValue(); - } - - /** - * @param value Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm). - */ - public SequenceVariationComponent setCigar(String value) { - if (Utilities.noString(value)) - this.cigar = null; - else { - if (this.cigar == null) - this.cigar = new StringType(); - this.cigar.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "0-based start position (inclusive) of the variation on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "0-based end position (exclusive) of the variation on the reference sequence.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("observedAllele", "string", "Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the observed sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.", 0, java.lang.Integer.MAX_VALUE, observedAllele)); - childrenList.add(new Property("referenceAllele", "string", "Nucleotide(s)/amino acids from start position of sequence to stop position of sequence on the positive (+) strand of the reference sequence. When the sequence type is DNA, it should be the sequence on the positive (+) strand.", 0, java.lang.Integer.MAX_VALUE, referenceAllele)); - childrenList.add(new Property("cigar", "string", "Extended CIGAR string for aligning the sequence with reference bases. See detailed documentation [here](http://support.illumina.com/help/SequencingAnalysisWorkflow/Content/Vault/Informatics/Sequencing_Analysis/CASAVA/swSEQ_mCA_ExtendedCIGARFormat.htm).", 0, java.lang.Integer.MAX_VALUE, cigar)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType - case -1418745787: /*observedAllele*/ return this.observedAllele == null ? new Base[0] : new Base[] {this.observedAllele}; // StringType - case 364045960: /*referenceAllele*/ return this.referenceAllele == null ? new Base[0] : new Base[] {this.referenceAllele}; // StringType - case 94658738: /*cigar*/ return this.cigar == null ? new Base[0] : new Base[] {this.cigar}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 109757538: // start - this.start = castToInteger(value); // IntegerType - break; - case 100571: // end - this.end = castToInteger(value); // IntegerType - break; - case -1418745787: // observedAllele - this.observedAllele = castToString(value); // StringType - break; - case 364045960: // referenceAllele - this.referenceAllele = castToString(value); // StringType - break; - case 94658738: // cigar - this.cigar = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("start")) - this.start = castToInteger(value); // IntegerType - else if (name.equals("end")) - this.end = castToInteger(value); // IntegerType - else if (name.equals("observedAllele")) - this.observedAllele = castToString(value); // StringType - else if (name.equals("referenceAllele")) - this.referenceAllele = castToString(value); // StringType - else if (name.equals("cigar")) - this.cigar = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType - case -1418745787: throw new FHIRException("Cannot make property observedAllele as it is not a complex type"); // StringType - case 364045960: throw new FHIRException("Cannot make property referenceAllele as it is not a complex type"); // StringType - case 94658738: throw new FHIRException("Cannot make property cigar as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); - } - else if (name.equals("observedAllele")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedAllele"); - } - else if (name.equals("referenceAllele")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.referenceAllele"); - } - else if (name.equals("cigar")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.cigar"); - } - else - return super.addChild(name); - } - - public SequenceVariationComponent copy() { - SequenceVariationComponent dst = new SequenceVariationComponent(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.observedAllele = observedAllele == null ? null : observedAllele.copy(); - dst.referenceAllele = referenceAllele == null ? null : referenceAllele.copy(); - dst.cigar = cigar == null ? null : cigar.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceVariationComponent)) - return false; - SequenceVariationComponent o = (SequenceVariationComponent) other; - return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(observedAllele, o.observedAllele, true) - && compareDeep(referenceAllele, o.referenceAllele, true) && compareDeep(cigar, o.cigar, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceVariationComponent)) - return false; - SequenceVariationComponent o = (SequenceVariationComponent) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(observedAllele, o.observedAllele, true) - && compareValues(referenceAllele, o.referenceAllele, true) && compareValues(cigar, o.cigar, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - && (observedAllele == null || observedAllele.isEmpty()) && (referenceAllele == null || referenceAllele.isEmpty()) - && (cigar == null || cigar.isEmpty()); - } - - public String fhirType() { - return "Sequence.variation"; - - } - - } - - @Block() - public static class SequenceQualityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 0-based start position (inclusive) of the sequence. - */ - @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="0-based start position (inclusive) of the sequence", formalDefinition="0-based start position (inclusive) of the sequence." ) - protected IntegerType start; - - /** - * 0-based end position (exclusive) of the sequence. - */ - @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="0-based end position (exclusive) of the sequence", formalDefinition="0-based end position (exclusive) of the sequence." ) - protected IntegerType end; - - /** - * Quality score. - */ - @Child(name = "score", type = {Quantity.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Quality score", formalDefinition="Quality score." ) - protected Quantity score; - - /** - * Method for quality. - */ - @Child(name = "method", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Method for quality", formalDefinition="Method for quality." ) - protected StringType method; - - private static final long serialVersionUID = -1046665930L; - - /** - * Constructor - */ - public SequenceQualityComponent() { - super(); - } - - /** - * @return {@link #start} (0-based start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public IntegerType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceQualityComponent.start"); - else if (Configuration.doAutoCreate()) - this.start = new IntegerType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (0-based start position (inclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public SequenceQualityComponent setStartElement(IntegerType value) { - this.start = value; - return this; - } - - /** - * @return 0-based start position (inclusive) of the sequence. - */ - public int getStart() { - return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); - } - - /** - * @param value 0-based start position (inclusive) of the sequence. - */ - public SequenceQualityComponent setStart(int value) { - if (this.start == null) - this.start = new IntegerType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (0-based end position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public IntegerType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceQualityComponent.end"); - else if (Configuration.doAutoCreate()) - this.end = new IntegerType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (0-based end position (exclusive) of the sequence.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public SequenceQualityComponent setEndElement(IntegerType value) { - this.end = value; - return this; - } - - /** - * @return 0-based end position (exclusive) of the sequence. - */ - public int getEnd() { - return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); - } - - /** - * @param value 0-based end position (exclusive) of the sequence. - */ - public SequenceQualityComponent setEnd(int value) { - if (this.end == null) - this.end = new IntegerType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #score} (Quality score.) - */ - public Quantity getScore() { - if (this.score == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceQualityComponent.score"); - else if (Configuration.doAutoCreate()) - this.score = new Quantity(); // cc - return this.score; - } - - public boolean hasScore() { - return this.score != null && !this.score.isEmpty(); - } - - /** - * @param value {@link #score} (Quality score.) - */ - public SequenceQualityComponent setScore(Quantity value) { - this.score = value; - return this; - } - - /** - * @return {@link #method} (Method for quality.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value - */ - public StringType getMethodElement() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceQualityComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new StringType(); // bb - return this.method; - } - - public boolean hasMethodElement() { - return this.method != null && !this.method.isEmpty(); - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (Method for quality.). This is the underlying object with id, value and extensions. The accessor "getMethod" gives direct access to the value - */ - public SequenceQualityComponent setMethodElement(StringType value) { - this.method = value; - return this; - } - - /** - * @return Method for quality. - */ - public String getMethod() { - return this.method == null ? null : this.method.getValue(); - } - - /** - * @param value Method for quality. - */ - public SequenceQualityComponent setMethod(String value) { - if (Utilities.noString(value)) - this.method = null; - else { - if (this.method == null) - this.method = new StringType(); - this.method.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "0-based start position (inclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "0-based end position (exclusive) of the sequence.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("score", "Quantity", "Quality score.", 0, java.lang.Integer.MAX_VALUE, score)); - childrenList.add(new Property("method", "string", "Method for quality.", 0, java.lang.Integer.MAX_VALUE, method)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType - case 109264530: /*score*/ return this.score == null ? new Base[0] : new Base[] {this.score}; // Quantity - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 109757538: // start - this.start = castToInteger(value); // IntegerType - break; - case 100571: // end - this.end = castToInteger(value); // IntegerType - break; - case 109264530: // score - this.score = castToQuantity(value); // Quantity - break; - case -1077554975: // method - this.method = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("start")) - this.start = castToInteger(value); // IntegerType - else if (name.equals("end")) - this.end = castToInteger(value); // IntegerType - else if (name.equals("score")) - this.score = castToQuantity(value); // Quantity - else if (name.equals("method")) - this.method = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType - case 109264530: return getScore(); // Quantity - case -1077554975: throw new FHIRException("Cannot make property method as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); - } - else if (name.equals("score")) { - this.score = new Quantity(); - return this.score; - } - else if (name.equals("method")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.method"); - } - else - return super.addChild(name); - } - - public SequenceQualityComponent copy() { - SequenceQualityComponent dst = new SequenceQualityComponent(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.score = score == null ? null : score.copy(); - dst.method = method == null ? null : method.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceQualityComponent)) - return false; - SequenceQualityComponent o = (SequenceQualityComponent) other; - return compareDeep(start, o.start, true) && compareDeep(end, o.end, true) && compareDeep(score, o.score, true) - && compareDeep(method, o.method, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceQualityComponent)) - return false; - SequenceQualityComponent o = (SequenceQualityComponent) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true) && compareValues(method, o.method, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - && (score == null || score.isEmpty()) && (method == null || method.isEmpty()); - } - - public String fhirType() { - return "Sequence.quality"; - - } - - } - - @Block() - public static class SequenceRepositoryComponent extends BackboneElement implements IBaseBackboneElement { - /** - * URI of an external repository which contains further details about the genetics data. - */ - @Child(name = "url", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="URI of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." ) - protected UriType url; - - /** - * URI of an external repository which contains further details about the genetics data. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the repository", formalDefinition="URI of an external repository which contains further details about the genetics data." ) - protected StringType name; - - /** - * Id of the variation in this external repository. - */ - @Child(name = "variantId", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Id of the variant", formalDefinition="Id of the variation in this external repository." ) - protected StringType variantId; - - /** - * Id of the read in this external repository. - */ - @Child(name = "readId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Id of the read", formalDefinition="Id of the read in this external repository." ) - protected StringType readId; - - private static final long serialVersionUID = 1218159360L; - - /** - * Constructor - */ - public SequenceRepositoryComponent() { - super(); - } - - /** - * @return {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceRepositoryComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SequenceRepositoryComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return URI of an external repository which contains further details about the genetics data. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value URI of an external repository which contains further details about the genetics data. - */ - public SequenceRepositoryComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceRepositoryComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (URI of an external repository which contains further details about the genetics data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SequenceRepositoryComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return URI of an external repository which contains further details about the genetics data. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value URI of an external repository which contains further details about the genetics data. - */ - public SequenceRepositoryComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #variantId} (Id of the variation in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value - */ - public StringType getVariantIdElement() { - if (this.variantId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceRepositoryComponent.variantId"); - else if (Configuration.doAutoCreate()) - this.variantId = new StringType(); // bb - return this.variantId; - } - - public boolean hasVariantIdElement() { - return this.variantId != null && !this.variantId.isEmpty(); - } - - public boolean hasVariantId() { - return this.variantId != null && !this.variantId.isEmpty(); - } - - /** - * @param value {@link #variantId} (Id of the variation in this external repository.). This is the underlying object with id, value and extensions. The accessor "getVariantId" gives direct access to the value - */ - public SequenceRepositoryComponent setVariantIdElement(StringType value) { - this.variantId = value; - return this; - } - - /** - * @return Id of the variation in this external repository. - */ - public String getVariantId() { - return this.variantId == null ? null : this.variantId.getValue(); - } - - /** - * @param value Id of the variation in this external repository. - */ - public SequenceRepositoryComponent setVariantId(String value) { - if (Utilities.noString(value)) - this.variantId = null; - else { - if (this.variantId == null) - this.variantId = new StringType(); - this.variantId.setValue(value); - } - return this; - } - - /** - * @return {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value - */ - public StringType getReadIdElement() { - if (this.readId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceRepositoryComponent.readId"); - else if (Configuration.doAutoCreate()) - this.readId = new StringType(); // bb - return this.readId; - } - - public boolean hasReadIdElement() { - return this.readId != null && !this.readId.isEmpty(); - } - - public boolean hasReadId() { - return this.readId != null && !this.readId.isEmpty(); - } - - /** - * @param value {@link #readId} (Id of the read in this external repository.). This is the underlying object with id, value and extensions. The accessor "getReadId" gives direct access to the value - */ - public SequenceRepositoryComponent setReadIdElement(StringType value) { - this.readId = value; - return this; - } - - /** - * @return Id of the read in this external repository. - */ - public String getReadId() { - return this.readId == null ? null : this.readId.getValue(); - } - - /** - * @param value Id of the read in this external repository. - */ - public SequenceRepositoryComponent setReadId(String value) { - if (Utilities.noString(value)) - this.readId = null; - else { - if (this.readId == null) - this.readId = new StringType(); - this.readId.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("name", "string", "URI of an external repository which contains further details about the genetics data.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("variantId", "string", "Id of the variation in this external repository.", 0, java.lang.Integer.MAX_VALUE, variantId)); - childrenList.add(new Property("readId", "string", "Id of the read in this external repository.", 0, java.lang.Integer.MAX_VALUE, readId)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -82113408: /*variantId*/ return this.variantId == null ? new Base[0] : new Base[] {this.variantId}; // StringType - case -934980271: /*readId*/ return this.readId == null ? new Base[0] : new Base[] {this.readId}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -82113408: // variantId - this.variantId = castToString(value); // StringType - break; - case -934980271: // readId - this.readId = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("variantId")) - this.variantId = castToString(value); // StringType - else if (name.equals("readId")) - this.readId = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -82113408: throw new FHIRException("Cannot make property variantId as it is not a complex type"); // StringType - case -934980271: throw new FHIRException("Cannot make property readId as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.url"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.name"); - } - else if (name.equals("variantId")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.variantId"); - } - else if (name.equals("readId")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.readId"); - } - else - return super.addChild(name); - } - - public SequenceRepositoryComponent copy() { - SequenceRepositoryComponent dst = new SequenceRepositoryComponent(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.name = name == null ? null : name.copy(); - dst.variantId = variantId == null ? null : variantId.copy(); - dst.readId = readId == null ? null : readId.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceRepositoryComponent)) - return false; - SequenceRepositoryComponent o = (SequenceRepositoryComponent) other; - return compareDeep(url, o.url, true) && compareDeep(name, o.name, true) && compareDeep(variantId, o.variantId, true) - && compareDeep(readId, o.readId, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceRepositoryComponent)) - return false; - SequenceRepositoryComponent o = (SequenceRepositoryComponent) other; - return compareValues(url, o.url, true) && compareValues(name, o.name, true) && compareValues(variantId, o.variantId, true) - && compareValues(readId, o.readId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (name == null || name.isEmpty()) - && (variantId == null || variantId.isEmpty()) && (readId == null || readId.isEmpty()); - } - - public String fhirType() { - return "Sequence.repository"; - - } - - } - - @Block() - public static class SequenceStructureVariationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Precision of boundaries. - */ - @Child(name = "precisionOfBoundaries", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Precision of boundaries", formalDefinition="Precision of boundaries." ) - protected StringType precisionOfBoundaries; - - /** - * Structural Variant reported aCGH ratio. - */ - @Child(name = "reportedaCGHRatio", type = {DecimalType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant reported aCGH ratio", formalDefinition="Structural Variant reported aCGH ratio." ) - protected DecimalType reportedaCGHRatio; - - /** - * Structural Variant Length. - */ - @Child(name = "length", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Length", formalDefinition="Structural Variant Length." ) - protected IntegerType length; - - /** - * Structural variant outer. - */ - @Child(name = "outer", type = {}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="Structural variant outer." ) - protected SequenceStructureVariationOuterComponent outer; - - /** - * Structural variant inner. - */ - @Child(name = "inner", type = {}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="Structural variant inner." ) - protected SequenceStructureVariationInnerComponent inner; - - private static final long serialVersionUID = -1615654736L; - - /** - * Constructor - */ - public SequenceStructureVariationComponent() { - super(); - } - - /** - * @return {@link #precisionOfBoundaries} (Precision of boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecisionOfBoundaries" gives direct access to the value - */ - public StringType getPrecisionOfBoundariesElement() { - if (this.precisionOfBoundaries == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationComponent.precisionOfBoundaries"); - else if (Configuration.doAutoCreate()) - this.precisionOfBoundaries = new StringType(); // bb - return this.precisionOfBoundaries; - } - - public boolean hasPrecisionOfBoundariesElement() { - return this.precisionOfBoundaries != null && !this.precisionOfBoundaries.isEmpty(); - } - - public boolean hasPrecisionOfBoundaries() { - return this.precisionOfBoundaries != null && !this.precisionOfBoundaries.isEmpty(); - } - - /** - * @param value {@link #precisionOfBoundaries} (Precision of boundaries.). This is the underlying object with id, value and extensions. The accessor "getPrecisionOfBoundaries" gives direct access to the value - */ - public SequenceStructureVariationComponent setPrecisionOfBoundariesElement(StringType value) { - this.precisionOfBoundaries = value; - return this; - } - - /** - * @return Precision of boundaries. - */ - public String getPrecisionOfBoundaries() { - return this.precisionOfBoundaries == null ? null : this.precisionOfBoundaries.getValue(); - } - - /** - * @param value Precision of boundaries. - */ - public SequenceStructureVariationComponent setPrecisionOfBoundaries(String value) { - if (Utilities.noString(value)) - this.precisionOfBoundaries = null; - else { - if (this.precisionOfBoundaries == null) - this.precisionOfBoundaries = new StringType(); - this.precisionOfBoundaries.setValue(value); - } - return this; - } - - /** - * @return {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value - */ - public DecimalType getReportedaCGHRatioElement() { - if (this.reportedaCGHRatio == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationComponent.reportedaCGHRatio"); - else if (Configuration.doAutoCreate()) - this.reportedaCGHRatio = new DecimalType(); // bb - return this.reportedaCGHRatio; - } - - public boolean hasReportedaCGHRatioElement() { - return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty(); - } - - public boolean hasReportedaCGHRatio() { - return this.reportedaCGHRatio != null && !this.reportedaCGHRatio.isEmpty(); - } - - /** - * @param value {@link #reportedaCGHRatio} (Structural Variant reported aCGH ratio.). This is the underlying object with id, value and extensions. The accessor "getReportedaCGHRatio" gives direct access to the value - */ - public SequenceStructureVariationComponent setReportedaCGHRatioElement(DecimalType value) { - this.reportedaCGHRatio = value; - return this; - } - - /** - * @return Structural Variant reported aCGH ratio. - */ - public BigDecimal getReportedaCGHRatio() { - return this.reportedaCGHRatio == null ? null : this.reportedaCGHRatio.getValue(); - } - - /** - * @param value Structural Variant reported aCGH ratio. - */ - public SequenceStructureVariationComponent setReportedaCGHRatio(BigDecimal value) { - if (value == null) - this.reportedaCGHRatio = null; - else { - if (this.reportedaCGHRatio == null) - this.reportedaCGHRatio = new DecimalType(); - this.reportedaCGHRatio.setValue(value); - } - return this; - } - - /** - * @param value Structural Variant reported aCGH ratio. - */ - public SequenceStructureVariationComponent setReportedaCGHRatio(long value) { - this.reportedaCGHRatio = new DecimalType(); - this.reportedaCGHRatio.setValue(value); - return this; - } - - /** - * @param value Structural Variant reported aCGH ratio. - */ - public SequenceStructureVariationComponent setReportedaCGHRatio(double value) { - this.reportedaCGHRatio = new DecimalType(); - this.reportedaCGHRatio.setValue(value); - return this; - } - - /** - * @return {@link #length} (Structural Variant Length.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value - */ - public IntegerType getLengthElement() { - if (this.length == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationComponent.length"); - else if (Configuration.doAutoCreate()) - this.length = new IntegerType(); // bb - return this.length; - } - - public boolean hasLengthElement() { - return this.length != null && !this.length.isEmpty(); - } - - public boolean hasLength() { - return this.length != null && !this.length.isEmpty(); - } - - /** - * @param value {@link #length} (Structural Variant Length.). This is the underlying object with id, value and extensions. The accessor "getLength" gives direct access to the value - */ - public SequenceStructureVariationComponent setLengthElement(IntegerType value) { - this.length = value; - return this; - } - - /** - * @return Structural Variant Length. - */ - public int getLength() { - return this.length == null || this.length.isEmpty() ? 0 : this.length.getValue(); - } - - /** - * @param value Structural Variant Length. - */ - public SequenceStructureVariationComponent setLength(int value) { - if (this.length == null) - this.length = new IntegerType(); - this.length.setValue(value); - return this; - } - - /** - * @return {@link #outer} (Structural variant outer.) - */ - public SequenceStructureVariationOuterComponent getOuter() { - if (this.outer == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationComponent.outer"); - else if (Configuration.doAutoCreate()) - this.outer = new SequenceStructureVariationOuterComponent(); // cc - return this.outer; - } - - public boolean hasOuter() { - return this.outer != null && !this.outer.isEmpty(); - } - - /** - * @param value {@link #outer} (Structural variant outer.) - */ - public SequenceStructureVariationComponent setOuter(SequenceStructureVariationOuterComponent value) { - this.outer = value; - return this; - } - - /** - * @return {@link #inner} (Structural variant inner.) - */ - public SequenceStructureVariationInnerComponent getInner() { - if (this.inner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationComponent.inner"); - else if (Configuration.doAutoCreate()) - this.inner = new SequenceStructureVariationInnerComponent(); // cc - return this.inner; - } - - public boolean hasInner() { - return this.inner != null && !this.inner.isEmpty(); - } - - /** - * @param value {@link #inner} (Structural variant inner.) - */ - public SequenceStructureVariationComponent setInner(SequenceStructureVariationInnerComponent value) { - this.inner = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("precisionOfBoundaries", "string", "Precision of boundaries.", 0, java.lang.Integer.MAX_VALUE, precisionOfBoundaries)); - childrenList.add(new Property("reportedaCGHRatio", "decimal", "Structural Variant reported aCGH ratio.", 0, java.lang.Integer.MAX_VALUE, reportedaCGHRatio)); - childrenList.add(new Property("length", "integer", "Structural Variant Length.", 0, java.lang.Integer.MAX_VALUE, length)); - childrenList.add(new Property("outer", "", "Structural variant outer.", 0, java.lang.Integer.MAX_VALUE, outer)); - childrenList.add(new Property("inner", "", "Structural variant inner.", 0, java.lang.Integer.MAX_VALUE, inner)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1591532317: /*precisionOfBoundaries*/ return this.precisionOfBoundaries == null ? new Base[0] : new Base[] {this.precisionOfBoundaries}; // StringType - case -1872600587: /*reportedaCGHRatio*/ return this.reportedaCGHRatio == null ? new Base[0] : new Base[] {this.reportedaCGHRatio}; // DecimalType - case -1106363674: /*length*/ return this.length == null ? new Base[0] : new Base[] {this.length}; // IntegerType - case 106111099: /*outer*/ return this.outer == null ? new Base[0] : new Base[] {this.outer}; // SequenceStructureVariationOuterComponent - case 100355670: /*inner*/ return this.inner == null ? new Base[0] : new Base[] {this.inner}; // SequenceStructureVariationInnerComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1591532317: // precisionOfBoundaries - this.precisionOfBoundaries = castToString(value); // StringType - break; - case -1872600587: // reportedaCGHRatio - this.reportedaCGHRatio = castToDecimal(value); // DecimalType - break; - case -1106363674: // length - this.length = castToInteger(value); // IntegerType - break; - case 106111099: // outer - this.outer = (SequenceStructureVariationOuterComponent) value; // SequenceStructureVariationOuterComponent - break; - case 100355670: // inner - this.inner = (SequenceStructureVariationInnerComponent) value; // SequenceStructureVariationInnerComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("precisionOfBoundaries")) - this.precisionOfBoundaries = castToString(value); // StringType - else if (name.equals("reportedaCGHRatio")) - this.reportedaCGHRatio = castToDecimal(value); // DecimalType - else if (name.equals("length")) - this.length = castToInteger(value); // IntegerType - else if (name.equals("outer")) - this.outer = (SequenceStructureVariationOuterComponent) value; // SequenceStructureVariationOuterComponent - else if (name.equals("inner")) - this.inner = (SequenceStructureVariationInnerComponent) value; // SequenceStructureVariationInnerComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1591532317: throw new FHIRException("Cannot make property precisionOfBoundaries as it is not a complex type"); // StringType - case -1872600587: throw new FHIRException("Cannot make property reportedaCGHRatio as it is not a complex type"); // DecimalType - case -1106363674: throw new FHIRException("Cannot make property length as it is not a complex type"); // IntegerType - case 106111099: return getOuter(); // SequenceStructureVariationOuterComponent - case 100355670: return getInner(); // SequenceStructureVariationInnerComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("precisionOfBoundaries")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.precisionOfBoundaries"); - } - else if (name.equals("reportedaCGHRatio")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.reportedaCGHRatio"); - } - else if (name.equals("length")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.length"); - } - else if (name.equals("outer")) { - this.outer = new SequenceStructureVariationOuterComponent(); - return this.outer; - } - else if (name.equals("inner")) { - this.inner = new SequenceStructureVariationInnerComponent(); - return this.inner; - } - else - return super.addChild(name); - } - - public SequenceStructureVariationComponent copy() { - SequenceStructureVariationComponent dst = new SequenceStructureVariationComponent(); - copyValues(dst); - dst.precisionOfBoundaries = precisionOfBoundaries == null ? null : precisionOfBoundaries.copy(); - dst.reportedaCGHRatio = reportedaCGHRatio == null ? null : reportedaCGHRatio.copy(); - dst.length = length == null ? null : length.copy(); - dst.outer = outer == null ? null : outer.copy(); - dst.inner = inner == null ? null : inner.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceStructureVariationComponent)) - return false; - SequenceStructureVariationComponent o = (SequenceStructureVariationComponent) other; - return compareDeep(precisionOfBoundaries, o.precisionOfBoundaries, true) && compareDeep(reportedaCGHRatio, o.reportedaCGHRatio, true) - && compareDeep(length, o.length, true) && compareDeep(outer, o.outer, true) && compareDeep(inner, o.inner, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceStructureVariationComponent)) - return false; - SequenceStructureVariationComponent o = (SequenceStructureVariationComponent) other; - return compareValues(precisionOfBoundaries, o.precisionOfBoundaries, true) && compareValues(reportedaCGHRatio, o.reportedaCGHRatio, true) - && compareValues(length, o.length, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (precisionOfBoundaries == null || precisionOfBoundaries.isEmpty()) - && (reportedaCGHRatio == null || reportedaCGHRatio.isEmpty()) && (length == null || length.isEmpty()) - && (outer == null || outer.isEmpty()) && (inner == null || inner.isEmpty()); - } - - public String fhirType() { - return "Sequence.structureVariation"; - - } - - } - - @Block() - public static class SequenceStructureVariationOuterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Structural Variant Outer Start-End. - */ - @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." ) - protected IntegerType start; - - /** - * Structural Variant Outer Start-End. - */ - @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Outer Start-End", formalDefinition="Structural Variant Outer Start-End." ) - protected IntegerType end; - - private static final long serialVersionUID = -1798864889L; - - /** - * Constructor - */ - public SequenceStructureVariationOuterComponent() { - super(); - } - - /** - * @return {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public IntegerType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationOuterComponent.start"); - else if (Configuration.doAutoCreate()) - this.start = new IntegerType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public SequenceStructureVariationOuterComponent setStartElement(IntegerType value) { - this.start = value; - return this; - } - - /** - * @return Structural Variant Outer Start-End. - */ - public int getStart() { - return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); - } - - /** - * @param value Structural Variant Outer Start-End. - */ - public SequenceStructureVariationOuterComponent setStart(int value) { - if (this.start == null) - this.start = new IntegerType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public IntegerType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationOuterComponent.end"); - else if (Configuration.doAutoCreate()) - this.end = new IntegerType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Structural Variant Outer Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public SequenceStructureVariationOuterComponent setEndElement(IntegerType value) { - this.end = value; - return this; - } - - /** - * @return Structural Variant Outer Start-End. - */ - public int getEnd() { - return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); - } - - /** - * @param value Structural Variant Outer Start-End. - */ - public SequenceStructureVariationOuterComponent setEnd(int value) { - if (this.end == null) - this.end = new IntegerType(); - this.end.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "Structural Variant Outer Start-End.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 109757538: // start - this.start = castToInteger(value); // IntegerType - break; - case 100571: // end - this.end = castToInteger(value); // IntegerType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("start")) - this.start = castToInteger(value); // IntegerType - else if (name.equals("end")) - this.end = castToInteger(value); // IntegerType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); - } - else - return super.addChild(name); - } - - public SequenceStructureVariationOuterComponent copy() { - SequenceStructureVariationOuterComponent dst = new SequenceStructureVariationOuterComponent(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceStructureVariationOuterComponent)) - return false; - SequenceStructureVariationOuterComponent o = (SequenceStructureVariationOuterComponent) other; - return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceStructureVariationOuterComponent)) - return false; - SequenceStructureVariationOuterComponent o = (SequenceStructureVariationOuterComponent) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - ; - } - - public String fhirType() { - return "Sequence.structureVariation.outer"; - - } - - } - - @Block() - public static class SequenceStructureVariationInnerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Structural Variant Inner Start-End. - */ - @Child(name = "start", type = {IntegerType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." ) - protected IntegerType start; - - /** - * Structural Variant Inner Start-End. - */ - @Child(name = "end", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Structural Variant Inner Start-End", formalDefinition="Structural Variant Inner Start-End." ) - protected IntegerType end; - - private static final long serialVersionUID = -1798864889L; - - /** - * Constructor - */ - public SequenceStructureVariationInnerComponent() { - super(); - } - - /** - * @return {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public IntegerType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationInnerComponent.start"); - else if (Configuration.doAutoCreate()) - this.start = new IntegerType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public SequenceStructureVariationInnerComponent setStartElement(IntegerType value) { - this.start = value; - return this; - } - - /** - * @return Structural Variant Inner Start-End. - */ - public int getStart() { - return this.start == null || this.start.isEmpty() ? 0 : this.start.getValue(); - } - - /** - * @param value Structural Variant Inner Start-End. - */ - public SequenceStructureVariationInnerComponent setStart(int value) { - if (this.start == null) - this.start = new IntegerType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public IntegerType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SequenceStructureVariationInnerComponent.end"); - else if (Configuration.doAutoCreate()) - this.end = new IntegerType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Structural Variant Inner Start-End.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public SequenceStructureVariationInnerComponent setEndElement(IntegerType value) { - this.end = value; - return this; - } - - /** - * @return Structural Variant Inner Start-End. - */ - public int getEnd() { - return this.end == null || this.end.isEmpty() ? 0 : this.end.getValue(); - } - - /** - * @param value Structural Variant Inner Start-End. - */ - public SequenceStructureVariationInnerComponent setEnd(int value) { - if (this.end == null) - this.end = new IntegerType(); - this.end.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("start", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "integer", "Structural Variant Inner Start-End.", 0, java.lang.Integer.MAX_VALUE, end)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // IntegerType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // IntegerType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 109757538: // start - this.start = castToInteger(value); // IntegerType - break; - case 100571: // end - this.end = castToInteger(value); // IntegerType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("start")) - this.start = castToInteger(value); // IntegerType - else if (name.equals("end")) - this.end = castToInteger(value); // IntegerType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // IntegerType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // IntegerType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.end"); - } - else - return super.addChild(name); - } - - public SequenceStructureVariationInnerComponent copy() { - SequenceStructureVariationInnerComponent dst = new SequenceStructureVariationInnerComponent(); - copyValues(dst); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SequenceStructureVariationInnerComponent)) - return false; - SequenceStructureVariationInnerComponent o = (SequenceStructureVariationInnerComponent) other; - return compareDeep(start, o.start, true) && compareDeep(end, o.end, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SequenceStructureVariationInnerComponent)) - return false; - SequenceStructureVariationInnerComponent o = (SequenceStructureVariationInnerComponent) other; - return compareValues(start, o.start, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - ; - } - - public String fhirType() { - return "Sequence.structureVariation.inner"; - - } - - } - - /** - * Amino acid / cDNA transcript / RNA variation. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="AA | DNA | RNA", formalDefinition="Amino acid / cDNA transcript / RNA variation." ) - protected Enumeration type; - - /** - * The patient, or group of patients whose sequencing results are described by this resource. - */ - @Child(name = "patient", type = {Patient.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who and/or what this is about", formalDefinition="The patient, or group of patients whose sequencing results are described by this resource." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (The patient, or group of patients whose sequencing results are described by this resource.) - */ - protected Patient patientTarget; - - /** - * Specimen used for sequencing. - */ - @Child(name = "specimen", type = {Specimen.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specimen used for sequencing", formalDefinition="Specimen used for sequencing." ) - protected Reference specimen; - - /** - * The actual object that is the target of the reference (Specimen used for sequencing.) - */ - protected Specimen specimenTarget; - - /** - * The method for sequencing, for example, chip information. - */ - @Child(name = "device", type = {Device.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The method for sequencing", formalDefinition="The method for sequencing, for example, chip information." ) - protected Reference device; - - /** - * The actual object that is the target of the reference (The method for sequencing, for example, chip information.) - */ - protected Device deviceTarget; - - /** - * Quantity of the sequence. - */ - @Child(name = "quantity", type = {Quantity.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Quantity of the sequence", formalDefinition="Quantity of the sequence." ) - protected Quantity quantity; - - /** - * The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria. - */ - @Child(name = "species", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Supporting tests of human, viruses, and bacteria", formalDefinition="The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria." ) - protected CodeableConcept species; - - /** - * Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) . - */ - @Child(name = "referenceSeq", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Reference sequence", formalDefinition="Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) ." ) - protected List referenceSeq; - - /** - * Variation info in this sequence. - */ - @Child(name = "variation", type = {}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Variation info in this sequence", formalDefinition="Variation info in this sequence." ) - protected SequenceVariationComponent variation; - - /** - * Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing. - */ - @Child(name = "quality", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Sequence Quality", formalDefinition="Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing." ) - protected List quality; - - /** - * The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA. - */ - @Child(name = "allelicState", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The level of occurrence of a single DNA Sequence Variation within a set of chromosomes: Heteroplasmic / Homoplasmic / Homozygous / Heterozygous / Hemizygous", formalDefinition="The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA." ) - protected CodeableConcept allelicState; - - /** - * Allele frequencies. - */ - @Child(name = "allelicFrequency", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Allele frequencies", formalDefinition="Allele frequencies." ) - protected DecimalType allelicFrequency; - - /** - * Values: amplificaiton / deletion / LOH. - */ - @Child(name = "copyNumberEvent", type = {CodeableConcept.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Copy Number Event: Values: amplificaiton / deletion / LOH", formalDefinition="Values: amplificaiton / deletion / LOH." ) - protected CodeableConcept copyNumberEvent; - - /** - * Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. - */ - @Child(name = "readCoverage", type = {IntegerType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Average number of reads representing a given nucleotide in the reconstructed sequence", formalDefinition="Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence." ) - protected IntegerType readCoverage; - - /** - * Configurations of the external repository. - */ - @Child(name = "repository", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External repository", formalDefinition="Configurations of the external repository." ) - protected List repository; - - /** - * Pointer to next atomic sequence which at most contains one variation. - */ - @Child(name = "pointer", type = {Sequence.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Pointer to next atomic sequence", formalDefinition="Pointer to next atomic sequence which at most contains one variation." ) - protected List pointer; - /** - * The actual objects that are the target of the reference (Pointer to next atomic sequence which at most contains one variation.) - */ - protected List pointerTarget; - - - /** - * Observed Sequence. - */ - @Child(name = "observedSeq", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Observed Sequence", formalDefinition="Observed Sequence." ) - protected StringType observedSeq; - - /** - * Analysis of the sequence. - */ - @Child(name = "observation", type = {Observation.class}, order=16, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Observation-genetics", formalDefinition="Analysis of the sequence." ) - protected Reference observation; - - /** - * The actual object that is the target of the reference (Analysis of the sequence.) - */ - protected Observation observationTarget; - - /** - * Structural variant. - */ - @Child(name = "structureVariation", type = {}, order=17, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="", formalDefinition="Structural variant." ) - protected SequenceStructureVariationComponent structureVariation; - - private static final long serialVersionUID = -1153660995L; - - /** - * Constructor - */ - public Sequence() { - super(); - } - - /** - * Constructor - */ - public Sequence(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (Amino acid / cDNA transcript / RNA variation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SequenceTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Amino acid / cDNA transcript / RNA variation.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Sequence setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return Amino acid / cDNA transcript / RNA variation. - */ - public SequenceType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Amino acid / cDNA transcript / RNA variation. - */ - public Sequence setType(SequenceType value) { - if (this.type == null) - this.type = new Enumeration(new SequenceTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #patient} (The patient, or group of patients whose sequencing results are described by this resource.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (The patient, or group of patients whose sequencing results are described by this resource.) - */ - public Sequence setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The patient, or group of patients whose sequencing results are described by this resource.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The patient, or group of patients whose sequencing results are described by this resource.) - */ - public Sequence setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #specimen} (Specimen used for sequencing.) - */ - public Reference getSpecimen() { - if (this.specimen == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.specimen"); - else if (Configuration.doAutoCreate()) - this.specimen = new Reference(); // cc - return this.specimen; - } - - public boolean hasSpecimen() { - return this.specimen != null && !this.specimen.isEmpty(); - } - - /** - * @param value {@link #specimen} (Specimen used for sequencing.) - */ - public Sequence setSpecimen(Reference value) { - this.specimen = value; - return this; - } - - /** - * @return {@link #specimen} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Specimen used for sequencing.) - */ - public Specimen getSpecimenTarget() { - if (this.specimenTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.specimen"); - else if (Configuration.doAutoCreate()) - this.specimenTarget = new Specimen(); // aa - return this.specimenTarget; - } - - /** - * @param value {@link #specimen} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Specimen used for sequencing.) - */ - public Sequence setSpecimenTarget(Specimen value) { - this.specimenTarget = value; - return this; - } - - /** - * @return {@link #device} (The method for sequencing, for example, chip information.) - */ - public Reference getDevice() { - if (this.device == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.device"); - else if (Configuration.doAutoCreate()) - this.device = new Reference(); // cc - return this.device; - } - - public boolean hasDevice() { - return this.device != null && !this.device.isEmpty(); - } - - /** - * @param value {@link #device} (The method for sequencing, for example, chip information.) - */ - public Sequence setDevice(Reference value) { - this.device = value; - return this; - } - - /** - * @return {@link #device} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The method for sequencing, for example, chip information.) - */ - public Device getDeviceTarget() { - if (this.deviceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.device"); - else if (Configuration.doAutoCreate()) - this.deviceTarget = new Device(); // aa - return this.deviceTarget; - } - - /** - * @param value {@link #device} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The method for sequencing, for example, chip information.) - */ - public Sequence setDeviceTarget(Device value) { - this.deviceTarget = value; - return this; - } - - /** - * @return {@link #quantity} (Quantity of the sequence.) - */ - public Quantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Quantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (Quantity of the sequence.) - */ - public Sequence setQuantity(Quantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #species} (The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.) - */ - public CodeableConcept getSpecies() { - if (this.species == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.species"); - else if (Configuration.doAutoCreate()) - this.species = new CodeableConcept(); // cc - return this.species; - } - - public boolean hasSpecies() { - return this.species != null && !this.species.isEmpty(); - } - - /** - * @param value {@link #species} (The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.) - */ - public Sequence setSpecies(CodeableConcept value) { - this.species = value; - return this; - } - - /** - * @return {@link #referenceSeq} (Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .) - */ - public List getReferenceSeq() { - if (this.referenceSeq == null) - this.referenceSeq = new ArrayList(); - return this.referenceSeq; - } - - public boolean hasReferenceSeq() { - if (this.referenceSeq == null) - return false; - for (SequenceReferenceSeqComponent item : this.referenceSeq) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #referenceSeq} (Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .) - */ - // syntactic sugar - public SequenceReferenceSeqComponent addReferenceSeq() { //3 - SequenceReferenceSeqComponent t = new SequenceReferenceSeqComponent(); - if (this.referenceSeq == null) - this.referenceSeq = new ArrayList(); - this.referenceSeq.add(t); - return t; - } - - // syntactic sugar - public Sequence addReferenceSeq(SequenceReferenceSeqComponent t) { //3 - if (t == null) - return this; - if (this.referenceSeq == null) - this.referenceSeq = new ArrayList(); - this.referenceSeq.add(t); - return this; - } - - /** - * @return {@link #variation} (Variation info in this sequence.) - */ - public SequenceVariationComponent getVariation() { - if (this.variation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.variation"); - else if (Configuration.doAutoCreate()) - this.variation = new SequenceVariationComponent(); // cc - return this.variation; - } - - public boolean hasVariation() { - return this.variation != null && !this.variation.isEmpty(); - } - - /** - * @param value {@link #variation} (Variation info in this sequence.) - */ - public Sequence setVariation(SequenceVariationComponent value) { - this.variation = value; - return this; - } - - /** - * @return {@link #quality} (Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.) - */ - public List getQuality() { - if (this.quality == null) - this.quality = new ArrayList(); - return this.quality; - } - - public boolean hasQuality() { - if (this.quality == null) - return false; - for (SequenceQualityComponent item : this.quality) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #quality} (Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.) - */ - // syntactic sugar - public SequenceQualityComponent addQuality() { //3 - SequenceQualityComponent t = new SequenceQualityComponent(); - if (this.quality == null) - this.quality = new ArrayList(); - this.quality.add(t); - return t; - } - - // syntactic sugar - public Sequence addQuality(SequenceQualityComponent t) { //3 - if (t == null) - return this; - if (this.quality == null) - this.quality = new ArrayList(); - this.quality.add(t); - return this; - } - - /** - * @return {@link #allelicState} (The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.) - */ - public CodeableConcept getAllelicState() { - if (this.allelicState == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.allelicState"); - else if (Configuration.doAutoCreate()) - this.allelicState = new CodeableConcept(); // cc - return this.allelicState; - } - - public boolean hasAllelicState() { - return this.allelicState != null && !this.allelicState.isEmpty(); - } - - /** - * @param value {@link #allelicState} (The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.) - */ - public Sequence setAllelicState(CodeableConcept value) { - this.allelicState = value; - return this; - } - - /** - * @return {@link #allelicFrequency} (Allele frequencies.). This is the underlying object with id, value and extensions. The accessor "getAllelicFrequency" gives direct access to the value - */ - public DecimalType getAllelicFrequencyElement() { - if (this.allelicFrequency == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.allelicFrequency"); - else if (Configuration.doAutoCreate()) - this.allelicFrequency = new DecimalType(); // bb - return this.allelicFrequency; - } - - public boolean hasAllelicFrequencyElement() { - return this.allelicFrequency != null && !this.allelicFrequency.isEmpty(); - } - - public boolean hasAllelicFrequency() { - return this.allelicFrequency != null && !this.allelicFrequency.isEmpty(); - } - - /** - * @param value {@link #allelicFrequency} (Allele frequencies.). This is the underlying object with id, value and extensions. The accessor "getAllelicFrequency" gives direct access to the value - */ - public Sequence setAllelicFrequencyElement(DecimalType value) { - this.allelicFrequency = value; - return this; - } - - /** - * @return Allele frequencies. - */ - public BigDecimal getAllelicFrequency() { - return this.allelicFrequency == null ? null : this.allelicFrequency.getValue(); - } - - /** - * @param value Allele frequencies. - */ - public Sequence setAllelicFrequency(BigDecimal value) { - if (value == null) - this.allelicFrequency = null; - else { - if (this.allelicFrequency == null) - this.allelicFrequency = new DecimalType(); - this.allelicFrequency.setValue(value); - } - return this; - } - - /** - * @param value Allele frequencies. - */ - public Sequence setAllelicFrequency(long value) { - this.allelicFrequency = new DecimalType(); - this.allelicFrequency.setValue(value); - return this; - } - - /** - * @param value Allele frequencies. - */ - public Sequence setAllelicFrequency(double value) { - this.allelicFrequency = new DecimalType(); - this.allelicFrequency.setValue(value); - return this; - } - - /** - * @return {@link #copyNumberEvent} (Values: amplificaiton / deletion / LOH.) - */ - public CodeableConcept getCopyNumberEvent() { - if (this.copyNumberEvent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.copyNumberEvent"); - else if (Configuration.doAutoCreate()) - this.copyNumberEvent = new CodeableConcept(); // cc - return this.copyNumberEvent; - } - - public boolean hasCopyNumberEvent() { - return this.copyNumberEvent != null && !this.copyNumberEvent.isEmpty(); - } - - /** - * @param value {@link #copyNumberEvent} (Values: amplificaiton / deletion / LOH.) - */ - public Sequence setCopyNumberEvent(CodeableConcept value) { - this.copyNumberEvent = value; - return this; - } - - /** - * @return {@link #readCoverage} (Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.). This is the underlying object with id, value and extensions. The accessor "getReadCoverage" gives direct access to the value - */ - public IntegerType getReadCoverageElement() { - if (this.readCoverage == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.readCoverage"); - else if (Configuration.doAutoCreate()) - this.readCoverage = new IntegerType(); // bb - return this.readCoverage; - } - - public boolean hasReadCoverageElement() { - return this.readCoverage != null && !this.readCoverage.isEmpty(); - } - - public boolean hasReadCoverage() { - return this.readCoverage != null && !this.readCoverage.isEmpty(); - } - - /** - * @param value {@link #readCoverage} (Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.). This is the underlying object with id, value and extensions. The accessor "getReadCoverage" gives direct access to the value - */ - public Sequence setReadCoverageElement(IntegerType value) { - this.readCoverage = value; - return this; - } - - /** - * @return Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. - */ - public int getReadCoverage() { - return this.readCoverage == null || this.readCoverage.isEmpty() ? 0 : this.readCoverage.getValue(); - } - - /** - * @param value Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence. - */ - public Sequence setReadCoverage(int value) { - if (this.readCoverage == null) - this.readCoverage = new IntegerType(); - this.readCoverage.setValue(value); - return this; - } - - /** - * @return {@link #repository} (Configurations of the external repository.) - */ - public List getRepository() { - if (this.repository == null) - this.repository = new ArrayList(); - return this.repository; - } - - public boolean hasRepository() { - if (this.repository == null) - return false; - for (SequenceRepositoryComponent item : this.repository) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #repository} (Configurations of the external repository.) - */ - // syntactic sugar - public SequenceRepositoryComponent addRepository() { //3 - SequenceRepositoryComponent t = new SequenceRepositoryComponent(); - if (this.repository == null) - this.repository = new ArrayList(); - this.repository.add(t); - return t; - } - - // syntactic sugar - public Sequence addRepository(SequenceRepositoryComponent t) { //3 - if (t == null) - return this; - if (this.repository == null) - this.repository = new ArrayList(); - this.repository.add(t); - return this; - } - - /** - * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variation.) - */ - public List getPointer() { - if (this.pointer == null) - this.pointer = new ArrayList(); - return this.pointer; - } - - public boolean hasPointer() { - if (this.pointer == null) - return false; - for (Reference item : this.pointer) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #pointer} (Pointer to next atomic sequence which at most contains one variation.) - */ - // syntactic sugar - public Reference addPointer() { //3 - Reference t = new Reference(); - if (this.pointer == null) - this.pointer = new ArrayList(); - this.pointer.add(t); - return t; - } - - // syntactic sugar - public Sequence addPointer(Reference t) { //3 - if (t == null) - return this; - if (this.pointer == null) - this.pointer = new ArrayList(); - this.pointer.add(t); - return this; - } - - /** - * @return {@link #pointer} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Pointer to next atomic sequence which at most contains one variation.) - */ - public List getPointerTarget() { - if (this.pointerTarget == null) - this.pointerTarget = new ArrayList(); - return this.pointerTarget; - } - - // syntactic sugar - /** - * @return {@link #pointer} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Pointer to next atomic sequence which at most contains one variation.) - */ - public Sequence addPointerTarget() { - Sequence r = new Sequence(); - if (this.pointerTarget == null) - this.pointerTarget = new ArrayList(); - this.pointerTarget.add(r); - return r; - } - - /** - * @return {@link #observedSeq} (Observed Sequence.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value - */ - public StringType getObservedSeqElement() { - if (this.observedSeq == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.observedSeq"); - else if (Configuration.doAutoCreate()) - this.observedSeq = new StringType(); // bb - return this.observedSeq; - } - - public boolean hasObservedSeqElement() { - return this.observedSeq != null && !this.observedSeq.isEmpty(); - } - - public boolean hasObservedSeq() { - return this.observedSeq != null && !this.observedSeq.isEmpty(); - } - - /** - * @param value {@link #observedSeq} (Observed Sequence.). This is the underlying object with id, value and extensions. The accessor "getObservedSeq" gives direct access to the value - */ - public Sequence setObservedSeqElement(StringType value) { - this.observedSeq = value; - return this; - } - - /** - * @return Observed Sequence. - */ - public String getObservedSeq() { - return this.observedSeq == null ? null : this.observedSeq.getValue(); - } - - /** - * @param value Observed Sequence. - */ - public Sequence setObservedSeq(String value) { - if (Utilities.noString(value)) - this.observedSeq = null; - else { - if (this.observedSeq == null) - this.observedSeq = new StringType(); - this.observedSeq.setValue(value); - } - return this; - } - - /** - * @return {@link #observation} (Analysis of the sequence.) - */ - public Reference getObservation() { - if (this.observation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.observation"); - else if (Configuration.doAutoCreate()) - this.observation = new Reference(); // cc - return this.observation; - } - - public boolean hasObservation() { - return this.observation != null && !this.observation.isEmpty(); - } - - /** - * @param value {@link #observation} (Analysis of the sequence.) - */ - public Sequence setObservation(Reference value) { - this.observation = value; - return this; - } - - /** - * @return {@link #observation} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Analysis of the sequence.) - */ - public Observation getObservationTarget() { - if (this.observationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.observation"); - else if (Configuration.doAutoCreate()) - this.observationTarget = new Observation(); // aa - return this.observationTarget; - } - - /** - * @param value {@link #observation} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Analysis of the sequence.) - */ - public Sequence setObservationTarget(Observation value) { - this.observationTarget = value; - return this; - } - - /** - * @return {@link #structureVariation} (Structural variant.) - */ - public SequenceStructureVariationComponent getStructureVariation() { - if (this.structureVariation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Sequence.structureVariation"); - else if (Configuration.doAutoCreate()) - this.structureVariation = new SequenceStructureVariationComponent(); // cc - return this.structureVariation; - } - - public boolean hasStructureVariation() { - return this.structureVariation != null && !this.structureVariation.isEmpty(); - } - - /** - * @param value {@link #structureVariation} (Structural variant.) - */ - public Sequence setStructureVariation(SequenceStructureVariationComponent value) { - this.structureVariation = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "Amino acid / cDNA transcript / RNA variation.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("patient", "Reference(Patient)", "The patient, or group of patients whose sequencing results are described by this resource.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("specimen", "Reference(Specimen)", "Specimen used for sequencing.", 0, java.lang.Integer.MAX_VALUE, specimen)); - childrenList.add(new Property("device", "Reference(Device)", "The method for sequencing, for example, chip information.", 0, java.lang.Integer.MAX_VALUE, device)); - childrenList.add(new Property("quantity", "Quantity", "Quantity of the sequence.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("species", "CodeableConcept", "The organism from which sample of the sequence was extracted. Supporting tests of human, viruses, and bacteria.", 0, java.lang.Integer.MAX_VALUE, species)); - childrenList.add(new Property("referenceSeq", "", "Reference Sequence. It can be described in two ways. One is provide the unique identifier of reference sequence submitted to NCBI. The start and end position of window on reference sequence should be defined. The other way is using genome build, chromosome number,and also the start, end position of window (this method is specifically for DNA reference sequence) .", 0, java.lang.Integer.MAX_VALUE, referenceSeq)); - childrenList.add(new Property("variation", "", "Variation info in this sequence.", 0, java.lang.Integer.MAX_VALUE, variation)); - childrenList.add(new Property("quality", "", "Quality for sequence quality vary by platform reflecting differences in sequencing chemistry and digital processing.", 0, java.lang.Integer.MAX_VALUE, quality)); - childrenList.add(new Property("allelicState", "CodeableConcept", "The level of occurrence of a single DNA Sequence Variation within a set of chromosomes. Heterozygous indicates the DNA Sequence Variation is only present in one of the two genes contained in homologous chromosomes. Homozygous indicates the DNA Sequence Variation is present in both genes contained in homologous chromosomes. Hemizygous indicates the DNA Sequence Variation exists in the only single copy of a gene in a non- homologous chromosome (the male X and Y chromosome are non-homologous). Hemiplasmic indicates that the DNA Sequence Variation is present in some but not all of the copies of mitochondrial DNA. Homoplasmic indicates that the DNA Sequence Variation is present in all of the copies of mitochondrial DNA.", 0, java.lang.Integer.MAX_VALUE, allelicState)); - childrenList.add(new Property("allelicFrequency", "decimal", "Allele frequencies.", 0, java.lang.Integer.MAX_VALUE, allelicFrequency)); - childrenList.add(new Property("copyNumberEvent", "CodeableConcept", "Values: amplificaiton / deletion / LOH.", 0, java.lang.Integer.MAX_VALUE, copyNumberEvent)); - childrenList.add(new Property("readCoverage", "integer", "Coverage (read depth or depth) is the average number of reads representing a given nucleotide in the reconstructed sequence.", 0, java.lang.Integer.MAX_VALUE, readCoverage)); - childrenList.add(new Property("repository", "", "Configurations of the external repository.", 0, java.lang.Integer.MAX_VALUE, repository)); - childrenList.add(new Property("pointer", "Reference(Sequence)", "Pointer to next atomic sequence which at most contains one variation.", 0, java.lang.Integer.MAX_VALUE, pointer)); - childrenList.add(new Property("observedSeq", "string", "Observed Sequence.", 0, java.lang.Integer.MAX_VALUE, observedSeq)); - childrenList.add(new Property("observation", "Reference(Observation)", "Analysis of the sequence.", 0, java.lang.Integer.MAX_VALUE, observation)); - childrenList.add(new Property("structureVariation", "", "Structural variant.", 0, java.lang.Integer.MAX_VALUE, structureVariation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -2132868344: /*specimen*/ return this.specimen == null ? new Base[0] : new Base[] {this.specimen}; // Reference - case -1335157162: /*device*/ return this.device == null ? new Base[0] : new Base[] {this.device}; // Reference - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Quantity - case -2008465092: /*species*/ return this.species == null ? new Base[0] : new Base[] {this.species}; // CodeableConcept - case -502547180: /*referenceSeq*/ return this.referenceSeq == null ? new Base[0] : this.referenceSeq.toArray(new Base[this.referenceSeq.size()]); // SequenceReferenceSeqComponent - case -81944045: /*variation*/ return this.variation == null ? new Base[0] : new Base[] {this.variation}; // SequenceVariationComponent - case 651215103: /*quality*/ return this.quality == null ? new Base[0] : this.quality.toArray(new Base[this.quality.size()]); // SequenceQualityComponent - case 2079026319: /*allelicState*/ return this.allelicState == null ? new Base[0] : new Base[] {this.allelicState}; // CodeableConcept - case 8650330: /*allelicFrequency*/ return this.allelicFrequency == null ? new Base[0] : new Base[] {this.allelicFrequency}; // DecimalType - case 960854556: /*copyNumberEvent*/ return this.copyNumberEvent == null ? new Base[0] : new Base[] {this.copyNumberEvent}; // CodeableConcept - case -1798816354: /*readCoverage*/ return this.readCoverage == null ? new Base[0] : new Base[] {this.readCoverage}; // IntegerType - case 1950800714: /*repository*/ return this.repository == null ? new Base[0] : this.repository.toArray(new Base[this.repository.size()]); // SequenceRepositoryComponent - case -400605635: /*pointer*/ return this.pointer == null ? new Base[0] : this.pointer.toArray(new Base[this.pointer.size()]); // Reference - case 125541495: /*observedSeq*/ return this.observedSeq == null ? new Base[0] : new Base[] {this.observedSeq}; // StringType - case 122345516: /*observation*/ return this.observation == null ? new Base[0] : new Base[] {this.observation}; // Reference - case 1886586336: /*structureVariation*/ return this.structureVariation == null ? new Base[0] : new Base[] {this.structureVariation}; // SequenceStructureVariationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new SequenceTypeEnumFactory().fromType(value); // Enumeration - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -2132868344: // specimen - this.specimen = castToReference(value); // Reference - break; - case -1335157162: // device - this.device = castToReference(value); // Reference - break; - case -1285004149: // quantity - this.quantity = castToQuantity(value); // Quantity - break; - case -2008465092: // species - this.species = castToCodeableConcept(value); // CodeableConcept - break; - case -502547180: // referenceSeq - this.getReferenceSeq().add((SequenceReferenceSeqComponent) value); // SequenceReferenceSeqComponent - break; - case -81944045: // variation - this.variation = (SequenceVariationComponent) value; // SequenceVariationComponent - break; - case 651215103: // quality - this.getQuality().add((SequenceQualityComponent) value); // SequenceQualityComponent - break; - case 2079026319: // allelicState - this.allelicState = castToCodeableConcept(value); // CodeableConcept - break; - case 8650330: // allelicFrequency - this.allelicFrequency = castToDecimal(value); // DecimalType - break; - case 960854556: // copyNumberEvent - this.copyNumberEvent = castToCodeableConcept(value); // CodeableConcept - break; - case -1798816354: // readCoverage - this.readCoverage = castToInteger(value); // IntegerType - break; - case 1950800714: // repository - this.getRepository().add((SequenceRepositoryComponent) value); // SequenceRepositoryComponent - break; - case -400605635: // pointer - this.getPointer().add(castToReference(value)); // Reference - break; - case 125541495: // observedSeq - this.observedSeq = castToString(value); // StringType - break; - case 122345516: // observation - this.observation = castToReference(value); // Reference - break; - case 1886586336: // structureVariation - this.structureVariation = (SequenceStructureVariationComponent) value; // SequenceStructureVariationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new SequenceTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("specimen")) - this.specimen = castToReference(value); // Reference - else if (name.equals("device")) - this.device = castToReference(value); // Reference - else if (name.equals("quantity")) - this.quantity = castToQuantity(value); // Quantity - else if (name.equals("species")) - this.species = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("referenceSeq")) - this.getReferenceSeq().add((SequenceReferenceSeqComponent) value); - else if (name.equals("variation")) - this.variation = (SequenceVariationComponent) value; // SequenceVariationComponent - else if (name.equals("quality")) - this.getQuality().add((SequenceQualityComponent) value); - else if (name.equals("allelicState")) - this.allelicState = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("allelicFrequency")) - this.allelicFrequency = castToDecimal(value); // DecimalType - else if (name.equals("copyNumberEvent")) - this.copyNumberEvent = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("readCoverage")) - this.readCoverage = castToInteger(value); // IntegerType - else if (name.equals("repository")) - this.getRepository().add((SequenceRepositoryComponent) value); - else if (name.equals("pointer")) - this.getPointer().add(castToReference(value)); - else if (name.equals("observedSeq")) - this.observedSeq = castToString(value); // StringType - else if (name.equals("observation")) - this.observation = castToReference(value); // Reference - else if (name.equals("structureVariation")) - this.structureVariation = (SequenceStructureVariationComponent) value; // SequenceStructureVariationComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case -791418107: return getPatient(); // Reference - case -2132868344: return getSpecimen(); // Reference - case -1335157162: return getDevice(); // Reference - case -1285004149: return getQuantity(); // Quantity - case -2008465092: return getSpecies(); // CodeableConcept - case -502547180: return addReferenceSeq(); // SequenceReferenceSeqComponent - case -81944045: return getVariation(); // SequenceVariationComponent - case 651215103: return addQuality(); // SequenceQualityComponent - case 2079026319: return getAllelicState(); // CodeableConcept - case 8650330: throw new FHIRException("Cannot make property allelicFrequency as it is not a complex type"); // DecimalType - case 960854556: return getCopyNumberEvent(); // CodeableConcept - case -1798816354: throw new FHIRException("Cannot make property readCoverage as it is not a complex type"); // IntegerType - case 1950800714: return addRepository(); // SequenceRepositoryComponent - case -400605635: return addPointer(); // Reference - case 125541495: throw new FHIRException("Cannot make property observedSeq as it is not a complex type"); // StringType - case 122345516: return getObservation(); // Reference - case 1886586336: return getStructureVariation(); // SequenceStructureVariationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.type"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("specimen")) { - this.specimen = new Reference(); - return this.specimen; - } - else if (name.equals("device")) { - this.device = new Reference(); - return this.device; - } - else if (name.equals("quantity")) { - this.quantity = new Quantity(); - return this.quantity; - } - else if (name.equals("species")) { - this.species = new CodeableConcept(); - return this.species; - } - else if (name.equals("referenceSeq")) { - return addReferenceSeq(); - } - else if (name.equals("variation")) { - this.variation = new SequenceVariationComponent(); - return this.variation; - } - else if (name.equals("quality")) { - return addQuality(); - } - else if (name.equals("allelicState")) { - this.allelicState = new CodeableConcept(); - return this.allelicState; - } - else if (name.equals("allelicFrequency")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.allelicFrequency"); - } - else if (name.equals("copyNumberEvent")) { - this.copyNumberEvent = new CodeableConcept(); - return this.copyNumberEvent; - } - else if (name.equals("readCoverage")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.readCoverage"); - } - else if (name.equals("repository")) { - return addRepository(); - } - else if (name.equals("pointer")) { - return addPointer(); - } - else if (name.equals("observedSeq")) { - throw new FHIRException("Cannot call addChild on a primitive type Sequence.observedSeq"); - } - else if (name.equals("observation")) { - this.observation = new Reference(); - return this.observation; - } - else if (name.equals("structureVariation")) { - this.structureVariation = new SequenceStructureVariationComponent(); - return this.structureVariation; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Sequence"; - - } - - public Sequence copy() { - Sequence dst = new Sequence(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.specimen = specimen == null ? null : specimen.copy(); - dst.device = device == null ? null : device.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.species = species == null ? null : species.copy(); - if (referenceSeq != null) { - dst.referenceSeq = new ArrayList(); - for (SequenceReferenceSeqComponent i : referenceSeq) - dst.referenceSeq.add(i.copy()); - }; - dst.variation = variation == null ? null : variation.copy(); - if (quality != null) { - dst.quality = new ArrayList(); - for (SequenceQualityComponent i : quality) - dst.quality.add(i.copy()); - }; - dst.allelicState = allelicState == null ? null : allelicState.copy(); - dst.allelicFrequency = allelicFrequency == null ? null : allelicFrequency.copy(); - dst.copyNumberEvent = copyNumberEvent == null ? null : copyNumberEvent.copy(); - dst.readCoverage = readCoverage == null ? null : readCoverage.copy(); - if (repository != null) { - dst.repository = new ArrayList(); - for (SequenceRepositoryComponent i : repository) - dst.repository.add(i.copy()); - }; - if (pointer != null) { - dst.pointer = new ArrayList(); - for (Reference i : pointer) - dst.pointer.add(i.copy()); - }; - dst.observedSeq = observedSeq == null ? null : observedSeq.copy(); - dst.observation = observation == null ? null : observation.copy(); - dst.structureVariation = structureVariation == null ? null : structureVariation.copy(); - return dst; - } - - protected Sequence typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Sequence)) - return false; - Sequence o = (Sequence) other; - return compareDeep(type, o.type, true) && compareDeep(patient, o.patient, true) && compareDeep(specimen, o.specimen, true) - && compareDeep(device, o.device, true) && compareDeep(quantity, o.quantity, true) && compareDeep(species, o.species, true) - && compareDeep(referenceSeq, o.referenceSeq, true) && compareDeep(variation, o.variation, true) - && compareDeep(quality, o.quality, true) && compareDeep(allelicState, o.allelicState, true) && compareDeep(allelicFrequency, o.allelicFrequency, true) - && compareDeep(copyNumberEvent, o.copyNumberEvent, true) && compareDeep(readCoverage, o.readCoverage, true) - && compareDeep(repository, o.repository, true) && compareDeep(pointer, o.pointer, true) && compareDeep(observedSeq, o.observedSeq, true) - && compareDeep(observation, o.observation, true) && compareDeep(structureVariation, o.structureVariation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Sequence)) - return false; - Sequence o = (Sequence) other; - return compareValues(type, o.type, true) && compareValues(allelicFrequency, o.allelicFrequency, true) - && compareValues(readCoverage, o.readCoverage, true) && compareValues(observedSeq, o.observedSeq, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (patient == null || patient.isEmpty()) - && (specimen == null || specimen.isEmpty()) && (device == null || device.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (species == null || species.isEmpty()) && (referenceSeq == null || referenceSeq.isEmpty()) - && (variation == null || variation.isEmpty()) && (quality == null || quality.isEmpty()) && (allelicState == null || allelicState.isEmpty()) - && (allelicFrequency == null || allelicFrequency.isEmpty()) && (copyNumberEvent == null || copyNumberEvent.isEmpty()) - && (readCoverage == null || readCoverage.isEmpty()) && (repository == null || repository.isEmpty()) - && (pointer == null || pointer.isEmpty()) && (observedSeq == null || observedSeq.isEmpty()) - && (observation == null || observation.isEmpty()) && (structureVariation == null || structureVariation.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Sequence; - } - - /** - * Search parameter: patient - *

- * Description: The subject that the observation is about
- * Type: reference
- * Path: Sequence.patient
- *

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

- * Description: The subject that the observation is about
- * Type: reference
- * Path: Sequence.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Sequence:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Sequence:patient").toLocked(); - - /** - * Search parameter: species - *

- * Description: The organism from which sample of the sequence was extracted.
- * Type: token
- * Path: Sequence.species
- *

- */ - @SearchParamDefinition(name="species", path="Sequence.species", description="The organism from which sample of the sequence was extracted.", type="token" ) - public static final String SP_SPECIES = "species"; - /** - * Fluent Client search parameter constant for species - *

- * Description: The organism from which sample of the sequence was extracted.
- * Type: token
- * Path: Sequence.species
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SPECIES = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SPECIES); - - /** - * Search parameter: coordinate - *

- * Description: Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`
- * Type: composite
- * Path:
- *

- */ - @SearchParamDefinition(name="coordinate", path="", description="Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`", type="composite", compositeOf={"chromosome", "start"} ) - public static final String SP_COORDINATE = "coordinate"; - /** - * Fluent Client search parameter constant for coordinate - *

- * Description: Genomic coordinate of the sequence. For example, a search for sequence in region 1:123-345 can be represented as `coordinate=1$lt345$gt123`
- * Type: composite
- * Path:
- *

- */ - public static final ca.uhn.fhir.rest.gclient.CompositeClientParam COORDINATE = new ca.uhn.fhir.rest.gclient.CompositeClientParam(SP_COORDINATE); - - /** - * Search parameter: start - *

- * Description: Start position (0-based inclusive) of the sequence
- * Type: number
- * Path: Sequence.variation.start
- *

- */ - @SearchParamDefinition(name="start", path="Sequence.variation.start", description="Start position (0-based inclusive) of the sequence", type="number" ) - public static final String SP_START = "start"; - /** - * Fluent Client search parameter constant for start - *

- * Description: Start position (0-based inclusive) of the sequence
- * Type: number
- * Path: Sequence.variation.start
- *

- */ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam START = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_START); - - /** - * Search parameter: type - *

- * Description: The type of the variant: Amino acid / cDNA transcript / RNA variation.
- * Type: token
- * Path: Sequence.type
- *

- */ - @SearchParamDefinition(name="type", path="Sequence.type", description="The type of the variant: Amino acid / cDNA transcript / RNA variation.", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: The type of the variant: Amino acid / cDNA transcript / RNA variation.
- * Type: token
- * Path: Sequence.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: chromosome - *

- * Description: Chromosome of the sequence
- * Type: token
- * Path: Sequence.referenceSeq.chromosome
- *

- */ - @SearchParamDefinition(name="chromosome", path="Sequence.referenceSeq.chromosome", description="Chromosome of the sequence", type="token" ) - public static final String SP_CHROMOSOME = "chromosome"; - /** - * Fluent Client search parameter constant for chromosome - *

- * Description: Chromosome of the sequence
- * Type: token
- * Path: Sequence.referenceSeq.chromosome
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CHROMOSOME = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CHROMOSOME); - - /** - * Search parameter: end - *

- * Description: End position (0-based exclusive) of the sequence
- * Type: number
- * Path: Sequence.variation.end
- *

- */ - @SearchParamDefinition(name="end", path="Sequence.variation.end", description="End position (0-based exclusive) of the sequence", type="number" ) - public static final String SP_END = "end"; - /** - * Fluent Client search parameter constant for end - *

- * Description: End position (0-based exclusive) of the sequence
- * Type: number
- * Path: Sequence.variation.end
- *

- */ - public static final ca.uhn.fhir.rest.gclient.NumberClientParam END = new ca.uhn.fhir.rest.gclient.NumberClientParam(SP_END); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SidType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SidType.java deleted file mode 100644 index 5db305ff134..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SidType.java +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ -package org.hl7.fhir.dstu2016may.model; - -public class SidType extends UriType { - - private static final long serialVersionUID = 5486832330986493589L; - - public String fhirType() { - return "sid"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Signature.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Signature.java deleted file mode 100644 index 73e1043f817..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Signature.java +++ /dev/null @@ -1,485 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a graphical image representing a hand-written signature, or a signature process. Different Signature approaches have different utilities. - */ -@DatatypeDef(name="Signature") -public class Signature extends Type implements ICompositeType { - - /** - * An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document. - */ - @Child(name = "type", type = {Coding.class}, order=0, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Indication of the reason the entity signed the object(s)", formalDefinition="An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document." ) - protected List type; - - /** - * When the digital signature was signed. - */ - @Child(name = "when", type = {InstantType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the signature was created", formalDefinition="When the digital signature was signed." ) - protected InstantType when; - - /** - * A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key). - */ - @Child(name = "who", type = {UriType.class, Practitioner.class, RelatedPerson.class, Patient.class, Device.class, Organization.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who signed the signature", formalDefinition="A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key)." ) - protected Type who; - - /** - * A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc. - */ - @Child(name = "contentType", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The technical format of the signature", formalDefinition="A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc." ) - protected CodeType contentType; - - /** - * The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. - */ - @Child(name = "blob", type = {Base64BinaryType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The actual signature content (XML DigSig. JWT, picture, etc.)", formalDefinition="The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty." ) - protected Base64BinaryType blob; - - private static final long serialVersionUID = -452432714L; - - /** - * Constructor - */ - public Signature() { - super(); - } - - /** - * Constructor - */ - public Signature(InstantType when, Type who) { - super(); - this.when = when; - this.who = who; - } - - /** - * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) - */ - public List getType() { - if (this.type == null) - this.type = new ArrayList(); - return this.type; - } - - public boolean hasType() { - if (this.type == null) - return false; - for (Coding item : this.type) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #type} (An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.) - */ - // syntactic sugar - public Coding addType() { //3 - Coding t = new Coding(); - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return t; - } - - // syntactic sugar - public Signature addType(Coding t) { //3 - if (t == null) - return this; - if (this.type == null) - this.type = new ArrayList(); - this.type.add(t); - return this; - } - - /** - * @return {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public InstantType getWhenElement() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Signature.when"); - else if (Configuration.doAutoCreate()) - this.when = new InstantType(); // bb - return this.when; - } - - public boolean hasWhenElement() { - return this.when != null && !this.when.isEmpty(); - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (When the digital signature was signed.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public Signature setWhenElement(InstantType value) { - this.when = value; - return this; - } - - /** - * @return When the digital signature was signed. - */ - public Date getWhen() { - return this.when == null ? null : this.when.getValue(); - } - - /** - * @param value When the digital signature was signed. - */ - public Signature setWhen(Date value) { - if (this.when == null) - this.when = new InstantType(); - this.when.setValue(value); - return this; - } - - /** - * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public Type getWho() { - return this.who; - } - - /** - * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public UriType getWhoUriType() throws FHIRException { - if (!(this.who instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.who.getClass().getName()+" was encountered"); - return (UriType) this.who; - } - - public boolean hasWhoUriType() { - return this.who instanceof UriType; - } - - /** - * @return {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public Reference getWhoReference() throws FHIRException { - if (!(this.who instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.who.getClass().getName()+" was encountered"); - return (Reference) this.who; - } - - public boolean hasWhoReference() { - return this.who instanceof Reference; - } - - public boolean hasWho() { - return this.who != null && !this.who.isEmpty(); - } - - /** - * @param value {@link #who} (A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).) - */ - public Signature setWho(Type value) { - this.who = value; - return this; - } - - /** - * @return {@link #contentType} (A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public CodeType getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Signature.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new CodeType(); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Signature setContentTypeElement(CodeType value) { - this.contentType = value; - return this; - } - - /** - * @return A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc. - */ - public String getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc. - */ - public Signature setContentType(String value) { - if (Utilities.noString(value)) - this.contentType = null; - else { - if (this.contentType == null) - this.contentType = new CodeType(); - this.contentType.setValue(value); - } - return this; - } - - /** - * @return {@link #blob} (The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Base64BinaryType getBlobElement() { - if (this.blob == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Signature.blob"); - else if (Configuration.doAutoCreate()) - this.blob = new Base64BinaryType(); // bb - return this.blob; - } - - public boolean hasBlobElement() { - return this.blob != null && !this.blob.isEmpty(); - } - - public boolean hasBlob() { - return this.blob != null && !this.blob.isEmpty(); - } - - /** - * @param value {@link #blob} (The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.). This is the underlying object with id, value and extensions. The accessor "getBlob" gives direct access to the value - */ - public Signature setBlobElement(Base64BinaryType value) { - this.blob = value; - return this; - } - - /** - * @return The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. - */ - public byte[] getBlob() { - return this.blob == null ? null : this.blob.getValue(); - } - - /** - * @param value The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty. - */ - public Signature setBlob(byte[] value) { - if (value == null) - this.blob = null; - else { - if (this.blob == null) - this.blob = new Base64BinaryType(); - this.blob.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "An indication of the reason that the entity signed this document. This may be explicitly included as part of the signature information and can be used when determining accountability for various actions concerning the document.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("when", "instant", "When the digital signature was signed.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("who[x]", "uri|Reference(Practitioner|RelatedPerson|Patient|Device|Organization)", "A reference to an application-usable description of the person that signed the certificate (e.g. the signature used their private key).", 0, java.lang.Integer.MAX_VALUE, who)); - childrenList.add(new Property("contentType", "code", "A mime type that indicates the technical format of the signature. Important mime types are application/signature+xml for X ML DigSig, application/jwt for JWT, and image/* for a graphical image of a signature, etc.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("blob", "base64Binary", "The base64 encoding of the Signature content. When signature is not recorded electronically this element would be empty.", 0, java.lang.Integer.MAX_VALUE, blob)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : this.type.toArray(new Base[this.type.size()]); // Coding - case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // InstantType - case 117694: /*who*/ return this.who == null ? new Base[0] : new Base[] {this.who}; // Type - case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // CodeType - case 3026845: /*blob*/ return this.blob == null ? new Base[0] : new Base[] {this.blob}; // Base64BinaryType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.getType().add(castToCoding(value)); // Coding - break; - case 3648314: // when - this.when = castToInstant(value); // InstantType - break; - case 117694: // who - this.who = (Type) value; // Type - break; - case -389131437: // contentType - this.contentType = castToCode(value); // CodeType - break; - case 3026845: // blob - this.blob = castToBase64Binary(value); // Base64BinaryType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.getType().add(castToCoding(value)); - else if (name.equals("when")) - this.when = castToInstant(value); // InstantType - else if (name.equals("who[x]")) - this.who = (Type) value; // Type - else if (name.equals("contentType")) - this.contentType = castToCode(value); // CodeType - else if (name.equals("blob")) - this.blob = castToBase64Binary(value); // Base64BinaryType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return addType(); // Coding - case 3648314: throw new FHIRException("Cannot make property when as it is not a complex type"); // InstantType - case -788654078: return getWho(); // Type - case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // CodeType - case 3026845: throw new FHIRException("Cannot make property blob as it is not a complex type"); // Base64BinaryType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - return addType(); - } - else if (name.equals("when")) { - throw new FHIRException("Cannot call addChild on a primitive type Signature.when"); - } - else if (name.equals("whoUri")) { - this.who = new UriType(); - return this.who; - } - else if (name.equals("whoReference")) { - this.who = new Reference(); - return this.who; - } - else if (name.equals("contentType")) { - throw new FHIRException("Cannot call addChild on a primitive type Signature.contentType"); - } - else if (name.equals("blob")) { - throw new FHIRException("Cannot call addChild on a primitive type Signature.blob"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Signature"; - - } - - public Signature copy() { - Signature dst = new Signature(); - copyValues(dst); - if (type != null) { - dst.type = new ArrayList(); - for (Coding i : type) - dst.type.add(i.copy()); - }; - dst.when = when == null ? null : when.copy(); - dst.who = who == null ? null : who.copy(); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.blob = blob == null ? null : blob.copy(); - return dst; - } - - protected Signature typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Signature)) - return false; - Signature o = (Signature) other; - return compareDeep(type, o.type, true) && compareDeep(when, o.when, true) && compareDeep(who, o.who, true) - && compareDeep(contentType, o.contentType, true) && compareDeep(blob, o.blob, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Signature)) - return false; - Signature o = (Signature) other; - return compareValues(when, o.when, true) && compareValues(contentType, o.contentType, true) && compareValues(blob, o.blob, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (when == null || when.isEmpty()) - && (who == null || who.isEmpty()) && (contentType == null || contentType.isEmpty()) && (blob == null || blob.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java deleted file mode 100644 index 9589ddee626..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SimpleQuantity.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -/** - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ -@DatatypeDef(name="SimpleQuantity", profileOf=Quantity.class) -public class SimpleQuantity extends Quantity { - - private static final long serialVersionUID = 1069574054L; - - public SimpleQuantity copy() { - SimpleQuantity dst = new SimpleQuantity(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - dst.comparator = comparator == null ? null : comparator.copy(); - dst.unit = unit == null ? null : unit.copy(); - dst.system = system == null ? null : system.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected SimpleQuantity typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SimpleQuantity)) - return false; - SimpleQuantity o = (SimpleQuantity) other; - return compareDeep(value, o.value, true) && compareDeep(comparator, o.comparator, true) && compareDeep(unit, o.unit, true) - && compareDeep(system, o.system, true) && compareDeep(code, o.code, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SimpleQuantity)) - return false; - SimpleQuantity o = (SimpleQuantity) other; - return compareValues(value, o.value, true) && compareValues(comparator, o.comparator, true) && compareValues(unit, o.unit, true) - && compareValues(system, o.system, true) && compareValues(code, o.code, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()) && (comparator == null || comparator.isEmpty()) - && (unit == null || unit.isEmpty()) && (system == null || system.isEmpty()) && (code == null || code.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Slot.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Slot.java deleted file mode 100644 index 735a264f12b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Slot.java +++ /dev/null @@ -1,1061 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A slot of time on a schedule that may be available for booking appointments. - */ -@ResourceDef(name="Slot", profile="http://hl7.org/fhir/Profile/Slot") -public class Slot extends DomainResource { - - public enum SlotStatus { - /** - * Indicates that the time interval is busy because one or more events have been scheduled for that interval. - */ - BUSY, - /** - * Indicates that the time interval is free for scheduling. - */ - FREE, - /** - * Indicates that the time interval is busy and that the interval can not be scheduled. - */ - BUSYUNAVAILABLE, - /** - * Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval. - */ - BUSYTENTATIVE, - /** - * added to help the parsers - */ - NULL; - public static SlotStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("busy".equals(codeString)) - return BUSY; - if ("free".equals(codeString)) - return FREE; - if ("busy-unavailable".equals(codeString)) - return BUSYUNAVAILABLE; - if ("busy-tentative".equals(codeString)) - return BUSYTENTATIVE; - throw new FHIRException("Unknown SlotStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case BUSY: return "busy"; - case FREE: return "free"; - case BUSYUNAVAILABLE: return "busy-unavailable"; - case BUSYTENTATIVE: return "busy-tentative"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case BUSY: return "http://hl7.org/fhir/slotstatus"; - case FREE: return "http://hl7.org/fhir/slotstatus"; - case BUSYUNAVAILABLE: return "http://hl7.org/fhir/slotstatus"; - case BUSYTENTATIVE: return "http://hl7.org/fhir/slotstatus"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case BUSY: return "Indicates that the time interval is busy because one or more events have been scheduled for that interval."; - case FREE: return "Indicates that the time interval is free for scheduling."; - case BUSYUNAVAILABLE: return "Indicates that the time interval is busy and that the interval can not be scheduled."; - case BUSYTENTATIVE: return "Indicates that the time interval is busy because one or more events have been tentatively scheduled for that interval."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case BUSY: return "Busy"; - case FREE: return "Free"; - case BUSYUNAVAILABLE: return "Busy (Unavailable)"; - case BUSYTENTATIVE: return "Busy (Tentative)"; - default: return "?"; - } - } - } - - public static class SlotStatusEnumFactory implements EnumFactory { - public SlotStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("busy".equals(codeString)) - return SlotStatus.BUSY; - if ("free".equals(codeString)) - return SlotStatus.FREE; - if ("busy-unavailable".equals(codeString)) - return SlotStatus.BUSYUNAVAILABLE; - if ("busy-tentative".equals(codeString)) - return SlotStatus.BUSYTENTATIVE; - throw new IllegalArgumentException("Unknown SlotStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("busy".equals(codeString)) - return new Enumeration(this, SlotStatus.BUSY); - if ("free".equals(codeString)) - return new Enumeration(this, SlotStatus.FREE); - if ("busy-unavailable".equals(codeString)) - return new Enumeration(this, SlotStatus.BUSYUNAVAILABLE); - if ("busy-tentative".equals(codeString)) - return new Enumeration(this, SlotStatus.BUSYTENTATIVE); - throw new FHIRException("Unknown SlotStatus code '"+codeString+"'"); - } - public String toCode(SlotStatus code) { - if (code == SlotStatus.BUSY) - return "busy"; - if (code == SlotStatus.FREE) - return "free"; - if (code == SlotStatus.BUSYUNAVAILABLE) - return "busy-unavailable"; - if (code == SlotStatus.BUSYTENTATIVE) - return "busy-tentative"; - return "?"; - } - public String toSystem(SlotStatus code) { - return code.getSystem(); - } - } - - /** - * External Ids for this item. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Ids for this item", formalDefinition="External Ids for this item." ) - protected List identifier; - - /** - * A broad categorisation of the service that is to be performed during this appointment. - */ - @Child(name = "serviceCategory", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="A broad categorisation of the service that is to be performed during this appointment", formalDefinition="A broad categorisation of the service that is to be performed during this appointment." ) - protected CodeableConcept serviceCategory; - - /** - * 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. - */ - @Child(name = "serviceType", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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="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." ) - protected List serviceType; - - /** - * The specialty of a practitioner that would be required to perform the service requested in this appointment. - */ - @Child(name = "specialty", type = {CodeableConcept.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment", formalDefinition="The specialty of a practitioner that would be required to perform the service requested in this appointment." ) - protected List specialty; - - /** - * The style of appointment or patient that has been booked in the slot (not service type). - */ - @Child(name = "appointmentType", type = {CodeableConcept.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The style of appointment or patient that has been booked in the slot (not service type)", formalDefinition="The style of appointment or patient that has been booked in the slot (not service type)." ) - protected CodeableConcept appointmentType; - - /** - * The schedule resource that this slot defines an interval of status information. - */ - @Child(name = "schedule", type = {Schedule.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The schedule resource that this slot defines an interval of status information", formalDefinition="The schedule resource that this slot defines an interval of status information." ) - protected Reference schedule; - - /** - * The actual object that is the target of the reference (The schedule resource that this slot defines an interval of status information.) - */ - protected Schedule scheduleTarget; - - /** - * busy | free | busy-unavailable | busy-tentative. - */ - @Child(name = "status", type = {CodeType.class}, order=6, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="busy | free | busy-unavailable | busy-tentative", formalDefinition="busy | free | busy-unavailable | busy-tentative." ) - protected Enumeration status; - - /** - * Date/Time that the slot is to begin. - */ - @Child(name = "start", type = {InstantType.class}, order=7, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date/Time that the slot is to begin", formalDefinition="Date/Time that the slot is to begin." ) - protected InstantType start; - - /** - * Date/Time that the slot is to conclude. - */ - @Child(name = "end", type = {InstantType.class}, order=8, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date/Time that the slot is to conclude", formalDefinition="Date/Time that the slot is to conclude." ) - protected InstantType end; - - /** - * This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - @Child(name = "overbooked", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time", formalDefinition="This slot has already been overbooked, appointments are unlikely to be accepted for this time." ) - protected BooleanType overbooked; - - /** - * Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - @Child(name = "comment", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot", formalDefinition="Comments on the slot to describe any extended information. Such as custom constraints on the slot." ) - protected StringType comment; - - private static final long serialVersionUID = 2085594970L; - - /** - * Constructor - */ - public Slot() { - super(); - } - - /** - * Constructor - */ - public Slot(Reference schedule, Enumeration status, InstantType start, InstantType end) { - super(); - this.schedule = schedule; - this.status = status; - this.start = start; - this.end = end; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (External Ids for this item.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Slot addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) - */ - public CodeableConcept getServiceCategory() { - if (this.serviceCategory == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.serviceCategory"); - else if (Configuration.doAutoCreate()) - this.serviceCategory = new CodeableConcept(); // cc - return this.serviceCategory; - } - - public boolean hasServiceCategory() { - return this.serviceCategory != null && !this.serviceCategory.isEmpty(); - } - - /** - * @param value {@link #serviceCategory} (A broad categorisation of the service that is to be performed during this appointment.) - */ - public Slot setServiceCategory(CodeableConcept value) { - this.serviceCategory = value; - return this; - } - - /** - * @return {@link #serviceType} (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.) - */ - public List getServiceType() { - if (this.serviceType == null) - this.serviceType = new ArrayList(); - return this.serviceType; - } - - public boolean hasServiceType() { - if (this.serviceType == null) - return false; - for (CodeableConcept item : this.serviceType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #serviceType} (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.) - */ - // syntactic sugar - public CodeableConcept addServiceType() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return t; - } - - // syntactic sugar - public Slot addServiceType(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.serviceType == null) - this.serviceType = new ArrayList(); - this.serviceType.add(t); - return this; - } - - /** - * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) - */ - public List getSpecialty() { - if (this.specialty == null) - this.specialty = new ArrayList(); - return this.specialty; - } - - public boolean hasSpecialty() { - if (this.specialty == null) - return false; - for (CodeableConcept item : this.specialty) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #specialty} (The specialty of a practitioner that would be required to perform the service requested in this appointment.) - */ - // syntactic sugar - public CodeableConcept addSpecialty() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return t; - } - - // syntactic sugar - public Slot addSpecialty(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.specialty == null) - this.specialty = new ArrayList(); - this.specialty.add(t); - return this; - } - - /** - * @return {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) - */ - public CodeableConcept getAppointmentType() { - if (this.appointmentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.appointmentType"); - else if (Configuration.doAutoCreate()) - this.appointmentType = new CodeableConcept(); // cc - return this.appointmentType; - } - - public boolean hasAppointmentType() { - return this.appointmentType != null && !this.appointmentType.isEmpty(); - } - - /** - * @param value {@link #appointmentType} (The style of appointment or patient that has been booked in the slot (not service type).) - */ - public Slot setAppointmentType(CodeableConcept value) { - this.appointmentType = value; - return this; - } - - /** - * @return {@link #schedule} (The schedule resource that this slot defines an interval of status information.) - */ - public Reference getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Reference(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (The schedule resource that this slot defines an interval of status information.) - */ - public Slot setSchedule(Reference value) { - this.schedule = value; - return this; - } - - /** - * @return {@link #schedule} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The schedule resource that this slot defines an interval of status information.) - */ - public Schedule getScheduleTarget() { - if (this.scheduleTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.schedule"); - else if (Configuration.doAutoCreate()) - this.scheduleTarget = new Schedule(); // aa - return this.scheduleTarget; - } - - /** - * @param value {@link #schedule} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The schedule resource that this slot defines an interval of status information.) - */ - public Slot setScheduleTarget(Schedule value) { - this.scheduleTarget = value; - return this; - } - - /** - * @return {@link #status} (busy | free | busy-unavailable | busy-tentative.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new SlotStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (busy | free | busy-unavailable | busy-tentative.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Slot setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return busy | free | busy-unavailable | busy-tentative. - */ - public SlotStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value busy | free | busy-unavailable | busy-tentative. - */ - public Slot setStatus(SlotStatus value) { - if (this.status == null) - this.status = new Enumeration(new SlotStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public InstantType getStartElement() { - if (this.start == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.start"); - else if (Configuration.doAutoCreate()) - this.start = new InstantType(); // bb - return this.start; - } - - public boolean hasStartElement() { - return this.start != null && !this.start.isEmpty(); - } - - public boolean hasStart() { - return this.start != null && !this.start.isEmpty(); - } - - /** - * @param value {@link #start} (Date/Time that the slot is to begin.). This is the underlying object with id, value and extensions. The accessor "getStart" gives direct access to the value - */ - public Slot setStartElement(InstantType value) { - this.start = value; - return this; - } - - /** - * @return Date/Time that the slot is to begin. - */ - public Date getStart() { - return this.start == null ? null : this.start.getValue(); - } - - /** - * @param value Date/Time that the slot is to begin. - */ - public Slot setStart(Date value) { - if (this.start == null) - this.start = new InstantType(); - this.start.setValue(value); - return this; - } - - /** - * @return {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (Date/Time that the slot is to conclude.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Slot setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return Date/Time that the slot is to conclude. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value Date/Time that the slot is to conclude. - */ - public Slot setEnd(Date value) { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - return this; - } - - /** - * @return {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value - */ - public BooleanType getOverbookedElement() { - if (this.overbooked == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.overbooked"); - else if (Configuration.doAutoCreate()) - this.overbooked = new BooleanType(); // bb - return this.overbooked; - } - - public boolean hasOverbookedElement() { - return this.overbooked != null && !this.overbooked.isEmpty(); - } - - public boolean hasOverbooked() { - return this.overbooked != null && !this.overbooked.isEmpty(); - } - - /** - * @param value {@link #overbooked} (This slot has already been overbooked, appointments are unlikely to be accepted for this time.). This is the underlying object with id, value and extensions. The accessor "getOverbooked" gives direct access to the value - */ - public Slot setOverbookedElement(BooleanType value) { - this.overbooked = value; - return this; - } - - /** - * @return This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - public boolean getOverbooked() { - return this.overbooked == null || this.overbooked.isEmpty() ? false : this.overbooked.getValue(); - } - - /** - * @param value This slot has already been overbooked, appointments are unlikely to be accepted for this time. - */ - public Slot setOverbooked(boolean value) { - if (this.overbooked == null) - this.overbooked = new BooleanType(); - this.overbooked.setValue(value); - return this; - } - - /** - * @return {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Slot.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (Comments on the slot to describe any extended information. Such as custom constraints on the slot.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public Slot setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value Comments on the slot to describe any extended information. Such as custom constraints on the slot. - */ - public Slot setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "External Ids for this item.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("serviceCategory", "CodeableConcept", "A broad categorisation of the service that is to be performed during this appointment.", 0, java.lang.Integer.MAX_VALUE, serviceCategory)); - childrenList.add(new Property("serviceType", "CodeableConcept", "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.", 0, java.lang.Integer.MAX_VALUE, serviceType)); - childrenList.add(new Property("specialty", "CodeableConcept", "The specialty of a practitioner that would be required to perform the service requested in this appointment.", 0, java.lang.Integer.MAX_VALUE, specialty)); - childrenList.add(new Property("appointmentType", "CodeableConcept", "The style of appointment or patient that has been booked in the slot (not service type).", 0, java.lang.Integer.MAX_VALUE, appointmentType)); - childrenList.add(new Property("schedule", "Reference(Schedule)", "The schedule resource that this slot defines an interval of status information.", 0, java.lang.Integer.MAX_VALUE, schedule)); - childrenList.add(new Property("status", "code", "busy | free | busy-unavailable | busy-tentative.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("start", "instant", "Date/Time that the slot is to begin.", 0, java.lang.Integer.MAX_VALUE, start)); - childrenList.add(new Property("end", "instant", "Date/Time that the slot is to conclude.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("overbooked", "boolean", "This slot has already been overbooked, appointments are unlikely to be accepted for this time.", 0, java.lang.Integer.MAX_VALUE, overbooked)); - childrenList.add(new Property("comment", "string", "Comments on the slot to describe any extended information. Such as custom constraints on the slot.", 0, java.lang.Integer.MAX_VALUE, comment)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 1281188563: /*serviceCategory*/ return this.serviceCategory == null ? new Base[0] : new Base[] {this.serviceCategory}; // CodeableConcept - case -1928370289: /*serviceType*/ return this.serviceType == null ? new Base[0] : this.serviceType.toArray(new Base[this.serviceType.size()]); // CodeableConcept - case -1694759682: /*specialty*/ return this.specialty == null ? new Base[0] : this.specialty.toArray(new Base[this.specialty.size()]); // CodeableConcept - case -1596426375: /*appointmentType*/ return this.appointmentType == null ? new Base[0] : new Base[] {this.appointmentType}; // CodeableConcept - case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Reference - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 109757538: /*start*/ return this.start == null ? new Base[0] : new Base[] {this.start}; // InstantType - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType - case 2068545308: /*overbooked*/ return this.overbooked == null ? new Base[0] : new Base[] {this.overbooked}; // BooleanType - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 1281188563: // serviceCategory - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - break; - case -1928370289: // serviceType - this.getServiceType().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1694759682: // specialty - this.getSpecialty().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1596426375: // appointmentType - this.appointmentType = castToCodeableConcept(value); // CodeableConcept - break; - case -697920873: // schedule - this.schedule = castToReference(value); // Reference - break; - case -892481550: // status - this.status = new SlotStatusEnumFactory().fromType(value); // Enumeration - break; - case 109757538: // start - this.start = castToInstant(value); // InstantType - break; - case 100571: // end - this.end = castToInstant(value); // InstantType - break; - case 2068545308: // overbooked - this.overbooked = castToBoolean(value); // BooleanType - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("serviceCategory")) - this.serviceCategory = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("serviceType")) - this.getServiceType().add(castToCodeableConcept(value)); - else if (name.equals("specialty")) - this.getSpecialty().add(castToCodeableConcept(value)); - else if (name.equals("appointmentType")) - this.appointmentType = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("schedule")) - this.schedule = castToReference(value); // Reference - else if (name.equals("status")) - this.status = new SlotStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("start")) - this.start = castToInstant(value); // InstantType - else if (name.equals("end")) - this.end = castToInstant(value); // InstantType - else if (name.equals("overbooked")) - this.overbooked = castToBoolean(value); // BooleanType - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 1281188563: return getServiceCategory(); // CodeableConcept - case -1928370289: return addServiceType(); // CodeableConcept - case -1694759682: return addSpecialty(); // CodeableConcept - case -1596426375: return getAppointmentType(); // CodeableConcept - case -697920873: return getSchedule(); // Reference - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 109757538: throw new FHIRException("Cannot make property start as it is not a complex type"); // InstantType - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType - case 2068545308: throw new FHIRException("Cannot make property overbooked as it is not a complex type"); // BooleanType - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("serviceCategory")) { - this.serviceCategory = new CodeableConcept(); - return this.serviceCategory; - } - else if (name.equals("serviceType")) { - return addServiceType(); - } - else if (name.equals("specialty")) { - return addSpecialty(); - } - else if (name.equals("appointmentType")) { - this.appointmentType = new CodeableConcept(); - return this.appointmentType; - } - else if (name.equals("schedule")) { - this.schedule = new Reference(); - return this.schedule; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Slot.status"); - } - else if (name.equals("start")) { - throw new FHIRException("Cannot call addChild on a primitive type Slot.start"); - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Slot.end"); - } - else if (name.equals("overbooked")) { - throw new FHIRException("Cannot call addChild on a primitive type Slot.overbooked"); - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type Slot.comment"); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Slot"; - - } - - public Slot copy() { - Slot dst = new Slot(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.serviceCategory = serviceCategory == null ? null : serviceCategory.copy(); - if (serviceType != null) { - dst.serviceType = new ArrayList(); - for (CodeableConcept i : serviceType) - dst.serviceType.add(i.copy()); - }; - if (specialty != null) { - dst.specialty = new ArrayList(); - for (CodeableConcept i : specialty) - dst.specialty.add(i.copy()); - }; - dst.appointmentType = appointmentType == null ? null : appointmentType.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - dst.status = status == null ? null : status.copy(); - dst.start = start == null ? null : start.copy(); - dst.end = end == null ? null : end.copy(); - dst.overbooked = overbooked == null ? null : overbooked.copy(); - dst.comment = comment == null ? null : comment.copy(); - return dst; - } - - protected Slot typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Slot)) - return false; - Slot o = (Slot) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(serviceCategory, o.serviceCategory, true) - && compareDeep(serviceType, o.serviceType, true) && compareDeep(specialty, o.specialty, true) && compareDeep(appointmentType, o.appointmentType, true) - && compareDeep(schedule, o.schedule, true) && compareDeep(status, o.status, true) && compareDeep(start, o.start, true) - && compareDeep(end, o.end, true) && compareDeep(overbooked, o.overbooked, true) && compareDeep(comment, o.comment, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Slot)) - return false; - Slot o = (Slot) other; - return compareValues(status, o.status, true) && compareValues(start, o.start, true) && compareValues(end, o.end, true) - && compareValues(overbooked, o.overbooked, true) && compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (serviceCategory == null || serviceCategory.isEmpty()) - && (serviceType == null || serviceType.isEmpty()) && (specialty == null || specialty.isEmpty()) - && (appointmentType == null || appointmentType.isEmpty()) && (schedule == null || schedule.isEmpty()) - && (status == null || status.isEmpty()) && (start == null || start.isEmpty()) && (end == null || end.isEmpty()) - && (overbooked == null || overbooked.isEmpty()) && (comment == null || comment.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Slot; - } - - /** - * Search parameter: schedule - *

- * Description: The Schedule Resource that we are seeking a slot within
- * Type: reference
- * Path: Slot.schedule
- *

- */ - @SearchParamDefinition(name="schedule", path="Slot.schedule", description="The Schedule Resource that we are seeking a slot within", type="reference" ) - public static final String SP_SCHEDULE = "schedule"; - /** - * Fluent Client search parameter constant for schedule - *

- * Description: The Schedule Resource that we are seeking a slot within
- * Type: reference
- * Path: Slot.schedule
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SCHEDULE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SCHEDULE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Slot:schedule". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SCHEDULE = new ca.uhn.fhir.model.api.Include("Slot:schedule").toLocked(); - - /** - * Search parameter: status - *

- * Description: The free/busy status of the appointment
- * Type: token
- * Path: Slot.status
- *

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

- * Description: The free/busy status of the appointment
- * Type: token
- * Path: Slot.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.DateClientParam START = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_START); - - /** - * Search parameter: slot-type - *

- * Description: The type of appointments that can be booked into the slot
- * Type: token
- * Path: Slot.serviceType
- *

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

- * Description: The type of appointments that can be booked into the slot
- * Type: token
- * Path: Slot.serviceType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam SLOT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_SLOT_TYPE); - - /** - * Search parameter: identifier - *

- * Description: A Slot Identifier
- * Type: token
- * Path: Slot.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Slot.identifier", description="A Slot Identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: A Slot Identifier
- * Type: token
- * Path: Slot.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Specimen.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Specimen.java deleted file mode 100644 index 6d796b56587..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Specimen.java +++ /dev/null @@ -1,2280 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A sample to be used for analysis. - */ -@ResourceDef(name="Specimen", profile="http://hl7.org/fhir/Profile/Specimen") -public class Specimen extends DomainResource { - - public enum SpecimenStatus { - /** - * The physical specimen is present and in good condition. - */ - AVAILABLE, - /** - * There is no physical specimen because it is either lost, destroyed or consumed. - */ - UNAVAILABLE, - /** - * The specimen cannot be used because of a quality issue such as a broken container, contamination, or too old. - */ - UNSATISFACTORY, - /** - * The specimen was entered in error and therefore nullified. - */ - ENTEREDINERROR, - /** - * added to help the parsers - */ - NULL; - public static SpecimenStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return AVAILABLE; - if ("unavailable".equals(codeString)) - return UNAVAILABLE; - if ("unsatisfactory".equals(codeString)) - return UNSATISFACTORY; - if ("entered-in-error".equals(codeString)) - return ENTEREDINERROR; - throw new FHIRException("Unknown SpecimenStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case AVAILABLE: return "available"; - case UNAVAILABLE: return "unavailable"; - case UNSATISFACTORY: return "unsatisfactory"; - case ENTEREDINERROR: return "entered-in-error"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case AVAILABLE: return "http://hl7.org/fhir/specimen-status"; - case UNAVAILABLE: return "http://hl7.org/fhir/specimen-status"; - case UNSATISFACTORY: return "http://hl7.org/fhir/specimen-status"; - case ENTEREDINERROR: return "http://hl7.org/fhir/specimen-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case AVAILABLE: return "The physical specimen is present and in good condition."; - case UNAVAILABLE: return "There is no physical specimen because it is either lost, destroyed or consumed."; - case UNSATISFACTORY: return "The specimen cannot be used because of a quality issue such as a broken container, contamination, or too old."; - case ENTEREDINERROR: return "The specimen was entered in error and therefore nullified."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case AVAILABLE: return "Available"; - case UNAVAILABLE: return "Unavailable"; - case UNSATISFACTORY: return "Unsatisfactory"; - case ENTEREDINERROR: return "Entered-in-error"; - default: return "?"; - } - } - } - - public static class SpecimenStatusEnumFactory implements EnumFactory { - public SpecimenStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return SpecimenStatus.AVAILABLE; - if ("unavailable".equals(codeString)) - return SpecimenStatus.UNAVAILABLE; - if ("unsatisfactory".equals(codeString)) - return SpecimenStatus.UNSATISFACTORY; - if ("entered-in-error".equals(codeString)) - return SpecimenStatus.ENTEREDINERROR; - throw new IllegalArgumentException("Unknown SpecimenStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("available".equals(codeString)) - return new Enumeration(this, SpecimenStatus.AVAILABLE); - if ("unavailable".equals(codeString)) - return new Enumeration(this, SpecimenStatus.UNAVAILABLE); - if ("unsatisfactory".equals(codeString)) - return new Enumeration(this, SpecimenStatus.UNSATISFACTORY); - if ("entered-in-error".equals(codeString)) - return new Enumeration(this, SpecimenStatus.ENTEREDINERROR); - throw new FHIRException("Unknown SpecimenStatus code '"+codeString+"'"); - } - public String toCode(SpecimenStatus code) { - if (code == SpecimenStatus.AVAILABLE) - return "available"; - if (code == SpecimenStatus.UNAVAILABLE) - return "unavailable"; - if (code == SpecimenStatus.UNSATISFACTORY) - return "unsatisfactory"; - if (code == SpecimenStatus.ENTEREDINERROR) - return "entered-in-error"; - return "?"; - } - public String toSystem(SpecimenStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class SpecimenCollectionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Person who collected the specimen. - */ - @Child(name = "collector", type = {Practitioner.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who collected the specimen", formalDefinition="Person who collected the specimen." ) - protected Reference collector; - - /** - * The actual object that is the target of the reference (Person who collected the specimen.) - */ - protected Practitioner collectorTarget; - - /** - * To communicate any details or issues encountered during the specimen collection procedure. - */ - @Child(name = "comment", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Collector comments", formalDefinition="To communicate any details or issues encountered during the specimen collection procedure." ) - protected StringType comment; - - /** - * Time when specimen was collected from subject - the physiologically relevant time. - */ - @Child(name = "collected", type = {DateTimeType.class, Period.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Collection time", formalDefinition="Time when specimen was collected from subject - the physiologically relevant time." ) - protected Type collected; - - /** - * The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @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." ) - protected SimpleQuantity quantity; - - /** - * A coded value specifying the technique that is used to perform the procedure. - */ - @Child(name = "method", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Technique used to perform collection", formalDefinition="A coded value specifying the technique that is used to perform the procedure." ) - protected CodeableConcept method; - - /** - * Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens. - */ - @Child(name = "bodySite", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Anatomical collection site", formalDefinition="Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens." ) - protected CodeableConcept bodySite; - - private static final long serialVersionUID = 2083688215L; - - /** - * Constructor - */ - public SpecimenCollectionComponent() { - super(); - } - - /** - * @return {@link #collector} (Person who collected the specimen.) - */ - public Reference getCollector() { - if (this.collector == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); - else if (Configuration.doAutoCreate()) - this.collector = new Reference(); // cc - return this.collector; - } - - public boolean hasCollector() { - return this.collector != null && !this.collector.isEmpty(); - } - - /** - * @param value {@link #collector} (Person who collected the specimen.) - */ - public SpecimenCollectionComponent setCollector(Reference value) { - this.collector = value; - return this; - } - - /** - * @return {@link #collector} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Person who collected the specimen.) - */ - public Practitioner getCollectorTarget() { - if (this.collectorTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.collector"); - else if (Configuration.doAutoCreate()) - this.collectorTarget = new Practitioner(); // aa - return this.collectorTarget; - } - - /** - * @param value {@link #collector} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Person who collected the specimen.) - */ - public SpecimenCollectionComponent setCollectorTarget(Practitioner value) { - this.collectorTarget = value; - return this; - } - - /** - * @return {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public StringType getCommentElement() { - if (this.comment == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.comment"); - else if (Configuration.doAutoCreate()) - this.comment = new StringType(); // bb - return this.comment; - } - - public boolean hasCommentElement() { - return this.comment != null && !this.comment.isEmpty(); - } - - public boolean hasComment() { - return this.comment != null && !this.comment.isEmpty(); - } - - /** - * @param value {@link #comment} (To communicate any details or issues encountered during the specimen collection procedure.). This is the underlying object with id, value and extensions. The accessor "getComment" gives direct access to the value - */ - public SpecimenCollectionComponent setCommentElement(StringType value) { - this.comment = value; - return this; - } - - /** - * @return To communicate any details or issues encountered during the specimen collection procedure. - */ - public String getComment() { - return this.comment == null ? null : this.comment.getValue(); - } - - /** - * @param value To communicate any details or issues encountered during the specimen collection procedure. - */ - public SpecimenCollectionComponent setComment(String value) { - if (Utilities.noString(value)) - this.comment = null; - else { - if (this.comment == null) - this.comment = new StringType(); - this.comment.setValue(value); - } - return this; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public Type getCollected() { - return this.collected; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public DateTimeType getCollectedDateTimeType() throws FHIRException { - if (!(this.collected instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.collected.getClass().getName()+" was encountered"); - return (DateTimeType) this.collected; - } - - public boolean hasCollectedDateTimeType() { - return this.collected instanceof DateTimeType; - } - - /** - * @return {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public Period getCollectedPeriod() throws FHIRException { - if (!(this.collected instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.collected.getClass().getName()+" was encountered"); - return (Period) this.collected; - } - - public boolean hasCollectedPeriod() { - return this.collected instanceof Period; - } - - public boolean hasCollected() { - return this.collected != null && !this.collected.isEmpty(); - } - - /** - * @param value {@link #collected} (Time when specimen was collected from subject - the physiologically relevant time.) - */ - public SpecimenCollectionComponent setCollected(Type value) { - this.collected = value; - return this; - } - - /** - * @return {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.) - */ - public SpecimenCollectionComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #method} (A coded value specifying the technique that is used to perform the procedure.) - */ - public CodeableConcept getMethod() { - if (this.method == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.method"); - else if (Configuration.doAutoCreate()) - this.method = new CodeableConcept(); // cc - return this.method; - } - - public boolean hasMethod() { - return this.method != null && !this.method.isEmpty(); - } - - /** - * @param value {@link #method} (A coded value specifying the technique that is used to perform the procedure.) - */ - public SpecimenCollectionComponent setMethod(CodeableConcept value) { - this.method = value; - return this; - } - - /** - * @return {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) - */ - public CodeableConcept getBodySite() { - if (this.bodySite == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenCollectionComponent.bodySite"); - else if (Configuration.doAutoCreate()) - this.bodySite = new CodeableConcept(); // cc - return this.bodySite; - } - - public boolean hasBodySite() { - return this.bodySite != null && !this.bodySite.isEmpty(); - } - - /** - * @param value {@link #bodySite} (Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.) - */ - public SpecimenCollectionComponent setBodySite(CodeableConcept value) { - this.bodySite = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("collector", "Reference(Practitioner)", "Person who collected the specimen.", 0, java.lang.Integer.MAX_VALUE, collector)); - childrenList.add(new Property("comment", "string", "To communicate any details or issues encountered during the specimen collection procedure.", 0, java.lang.Integer.MAX_VALUE, comment)); - childrenList.add(new Property("collected[x]", "dateTime|Period", "Time when specimen was collected from subject - the physiologically relevant time.", 0, java.lang.Integer.MAX_VALUE, collected)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The quantity of specimen collected; for instance the volume of a blood sample, or the physical measurement of an anatomic pathology sample.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("method", "CodeableConcept", "A coded value specifying the technique that is used to perform the procedure.", 0, java.lang.Integer.MAX_VALUE, method)); - childrenList.add(new Property("bodySite", "CodeableConcept", "Anatomical location from which the specimen was collected (if subject is a patient). This is the target site. This element is not used for environmental specimens.", 0, java.lang.Integer.MAX_VALUE, bodySite)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1883491469: /*collector*/ return this.collector == null ? new Base[0] : new Base[] {this.collector}; // Reference - case 950398559: /*comment*/ return this.comment == null ? new Base[0] : new Base[] {this.comment}; // StringType - case 1883491145: /*collected*/ return this.collected == null ? new Base[0] : new Base[] {this.collected}; // Type - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case -1077554975: /*method*/ return this.method == null ? new Base[0] : new Base[] {this.method}; // CodeableConcept - case 1702620169: /*bodySite*/ return this.bodySite == null ? new Base[0] : new Base[] {this.bodySite}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1883491469: // collector - this.collector = castToReference(value); // Reference - break; - case 950398559: // comment - this.comment = castToString(value); // StringType - break; - case 1883491145: // collected - this.collected = (Type) value; // Type - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1077554975: // method - this.method = castToCodeableConcept(value); // CodeableConcept - break; - case 1702620169: // bodySite - this.bodySite = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("collector")) - this.collector = castToReference(value); // Reference - else if (name.equals("comment")) - this.comment = castToString(value); // StringType - else if (name.equals("collected[x]")) - this.collected = (Type) value; // Type - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("method")) - this.method = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("bodySite")) - this.bodySite = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1883491469: return getCollector(); // Reference - case 950398559: throw new FHIRException("Cannot make property comment as it is not a complex type"); // StringType - case 1632037015: return getCollected(); // Type - case -1285004149: return getQuantity(); // SimpleQuantity - case -1077554975: return getMethod(); // CodeableConcept - case 1702620169: return getBodySite(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("collector")) { - this.collector = new Reference(); - return this.collector; - } - else if (name.equals("comment")) { - throw new FHIRException("Cannot call addChild on a primitive type Specimen.comment"); - } - else if (name.equals("collectedDateTime")) { - this.collected = new DateTimeType(); - return this.collected; - } - else if (name.equals("collectedPeriod")) { - this.collected = new Period(); - return this.collected; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("method")) { - this.method = new CodeableConcept(); - return this.method; - } - else if (name.equals("bodySite")) { - this.bodySite = new CodeableConcept(); - return this.bodySite; - } - else - return super.addChild(name); - } - - public SpecimenCollectionComponent copy() { - SpecimenCollectionComponent dst = new SpecimenCollectionComponent(); - copyValues(dst); - dst.collector = collector == null ? null : collector.copy(); - dst.comment = comment == null ? null : comment.copy(); - dst.collected = collected == null ? null : collected.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.method = method == null ? null : method.copy(); - dst.bodySite = bodySite == null ? null : bodySite.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SpecimenCollectionComponent)) - return false; - SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; - return compareDeep(collector, o.collector, true) && compareDeep(comment, o.comment, true) && compareDeep(collected, o.collected, true) - && compareDeep(quantity, o.quantity, true) && compareDeep(method, o.method, true) && compareDeep(bodySite, o.bodySite, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SpecimenCollectionComponent)) - return false; - SpecimenCollectionComponent o = (SpecimenCollectionComponent) other; - return compareValues(comment, o.comment, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (collector == null || collector.isEmpty()) && (comment == null || comment.isEmpty()) - && (collected == null || collected.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (method == null || method.isEmpty()) && (bodySite == null || bodySite.isEmpty()); - } - - public String fhirType() { - return "Specimen.collection"; - - } - - } - - @Block() - public static class SpecimenTreatmentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Textual description of procedure. - */ - @Child(name = "description", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Textual description of procedure", formalDefinition="Textual description of procedure." ) - protected StringType description; - - /** - * A coded value specifying the procedure used to process the specimen. - */ - @Child(name = "procedure", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Indicates the treatment or processing step applied to the specimen", formalDefinition="A coded value specifying the procedure used to process the specimen." ) - protected CodeableConcept procedure; - - /** - * Material used in the processing step. - */ - @Child(name = "additive", type = {Substance.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Material used in the processing step", formalDefinition="Material used in the processing step." ) - protected List additive; - /** - * The actual objects that are the target of the reference (Material used in the processing step.) - */ - protected List additiveTarget; - - - private static final long serialVersionUID = -373251521L; - - /** - * Constructor - */ - public SpecimenTreatmentComponent() { - super(); - } - - /** - * @return {@link #description} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenTreatmentComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Textual description of procedure.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SpecimenTreatmentComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Textual description of procedure. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Textual description of procedure. - */ - public SpecimenTreatmentComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #procedure} (A coded value specifying the procedure used to process the specimen.) - */ - public CodeableConcept getProcedure() { - if (this.procedure == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenTreatmentComponent.procedure"); - else if (Configuration.doAutoCreate()) - this.procedure = new CodeableConcept(); // cc - return this.procedure; - } - - public boolean hasProcedure() { - return this.procedure != null && !this.procedure.isEmpty(); - } - - /** - * @param value {@link #procedure} (A coded value specifying the procedure used to process the specimen.) - */ - public SpecimenTreatmentComponent setProcedure(CodeableConcept value) { - this.procedure = value; - return this; - } - - /** - * @return {@link #additive} (Material used in the processing step.) - */ - public List getAdditive() { - if (this.additive == null) - this.additive = new ArrayList(); - return this.additive; - } - - public boolean hasAdditive() { - if (this.additive == null) - return false; - for (Reference item : this.additive) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #additive} (Material used in the processing step.) - */ - // syntactic sugar - public Reference addAdditive() { //3 - Reference t = new Reference(); - if (this.additive == null) - this.additive = new ArrayList(); - this.additive.add(t); - return t; - } - - // syntactic sugar - public SpecimenTreatmentComponent addAdditive(Reference t) { //3 - if (t == null) - return this; - if (this.additive == null) - this.additive = new ArrayList(); - this.additive.add(t); - return this; - } - - /** - * @return {@link #additive} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Material used in the processing step.) - */ - public List getAdditiveTarget() { - if (this.additiveTarget == null) - this.additiveTarget = new ArrayList(); - return this.additiveTarget; - } - - // syntactic sugar - /** - * @return {@link #additive} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Material used in the processing step.) - */ - public Substance addAdditiveTarget() { - Substance r = new Substance(); - if (this.additiveTarget == null) - this.additiveTarget = new ArrayList(); - this.additiveTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("description", "string", "Textual description of procedure.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("procedure", "CodeableConcept", "A coded value specifying the procedure used to process the specimen.", 0, java.lang.Integer.MAX_VALUE, procedure)); - childrenList.add(new Property("additive", "Reference(Substance)", "Material used in the processing step.", 0, java.lang.Integer.MAX_VALUE, additive)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1095204141: /*procedure*/ return this.procedure == null ? new Base[0] : new Base[] {this.procedure}; // CodeableConcept - case -1226589236: /*additive*/ return this.additive == null ? new Base[0] : this.additive.toArray(new Base[this.additive.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1095204141: // procedure - this.procedure = castToCodeableConcept(value); // CodeableConcept - break; - case -1226589236: // additive - this.getAdditive().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("procedure")) - this.procedure = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("additive")) - this.getAdditive().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1095204141: return getProcedure(); // CodeableConcept - case -1226589236: return addAdditive(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Specimen.description"); - } - else if (name.equals("procedure")) { - this.procedure = new CodeableConcept(); - return this.procedure; - } - else if (name.equals("additive")) { - return addAdditive(); - } - else - return super.addChild(name); - } - - public SpecimenTreatmentComponent copy() { - SpecimenTreatmentComponent dst = new SpecimenTreatmentComponent(); - copyValues(dst); - dst.description = description == null ? null : description.copy(); - dst.procedure = procedure == null ? null : procedure.copy(); - if (additive != null) { - dst.additive = new ArrayList(); - for (Reference i : additive) - dst.additive.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SpecimenTreatmentComponent)) - return false; - SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; - return compareDeep(description, o.description, true) && compareDeep(procedure, o.procedure, true) - && compareDeep(additive, o.additive, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SpecimenTreatmentComponent)) - return false; - SpecimenTreatmentComponent o = (SpecimenTreatmentComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (description == null || description.isEmpty()) && (procedure == null || procedure.isEmpty()) - && (additive == null || additive.isEmpty()); - } - - public String fhirType() { - return "Specimen.treatment"; - - } - - } - - @Block() - public static class SpecimenContainerComponent extends BackboneElement implements IBaseBackboneElement { - /** - * 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. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List identifier; - - /** - * Textual description of the container. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Textual description of the container", formalDefinition="Textual description of the container." ) - protected StringType description; - - /** - * The type of container associated with the specimen (e.g. slide, aliquot, etc.). - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Kind of container directly associated with specimen", formalDefinition="The type of container associated with the specimen (e.g. slide, aliquot, etc.)." ) - protected CodeableConcept type; - - /** - * The capacity (volume or other measure) the container may contain. - */ - @Child(name = "capacity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Container volume or size", formalDefinition="The capacity (volume or other measure) the container may contain." ) - protected SimpleQuantity capacity; - - /** - * The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type. - */ - @Child(name = "specimenQuantity", type = {SimpleQuantity.class}, order=5, min=0, max=1, modifier=false, summary=false) - @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." ) - protected SimpleQuantity specimenQuantity; - - /** - * Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA. - */ - @Child(name = "additive", type = {CodeableConcept.class, Substance.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Additive associated with container", formalDefinition="Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA." ) - protected Type additive; - - private static final long serialVersionUID = 187274879L; - - /** - * Constructor - */ - public SpecimenContainerComponent() { - super(); - } - - /** - * @return {@link #identifier} (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 List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (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.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public SpecimenContainerComponent addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #description} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Textual description of the container.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SpecimenContainerComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Textual description of the container. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Textual description of the container. - */ - public SpecimenContainerComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc.).) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of container associated with the specimen (e.g. slide, aliquot, etc.).) - */ - public SpecimenContainerComponent setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #capacity} (The capacity (volume or other measure) the container may contain.) - */ - public SimpleQuantity getCapacity() { - if (this.capacity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.capacity"); - else if (Configuration.doAutoCreate()) - this.capacity = new SimpleQuantity(); // cc - return this.capacity; - } - - public boolean hasCapacity() { - return this.capacity != null && !this.capacity.isEmpty(); - } - - /** - * @param value {@link #capacity} (The capacity (volume or other measure) the container may contain.) - */ - public SpecimenContainerComponent setCapacity(SimpleQuantity value) { - this.capacity = value; - return this; - } - - /** - * @return {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) - */ - public SimpleQuantity getSpecimenQuantity() { - if (this.specimenQuantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SpecimenContainerComponent.specimenQuantity"); - else if (Configuration.doAutoCreate()) - this.specimenQuantity = new SimpleQuantity(); // cc - return this.specimenQuantity; - } - - public boolean hasSpecimenQuantity() { - return this.specimenQuantity != null && !this.specimenQuantity.isEmpty(); - } - - /** - * @param value {@link #specimenQuantity} (The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.) - */ - public SpecimenContainerComponent setSpecimenQuantity(SimpleQuantity value) { - this.specimenQuantity = value; - return this; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) - */ - public Type getAdditive() { - return this.additive; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) - */ - public CodeableConcept getAdditiveCodeableConcept() throws FHIRException { - if (!(this.additive instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.additive.getClass().getName()+" was encountered"); - return (CodeableConcept) this.additive; - } - - public boolean hasAdditiveCodeableConcept() { - return this.additive instanceof CodeableConcept; - } - - /** - * @return {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) - */ - public Reference getAdditiveReference() throws FHIRException { - if (!(this.additive instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.additive.getClass().getName()+" was encountered"); - return (Reference) this.additive; - } - - public boolean hasAdditiveReference() { - return this.additive instanceof Reference; - } - - public boolean hasAdditive() { - return this.additive != null && !this.additive.isEmpty(); - } - - /** - * @param value {@link #additive} (Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.) - */ - public SpecimenContainerComponent setAdditive(Type value) { - this.additive = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("description", "string", "Textual description of the container.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("type", "CodeableConcept", "The type of container associated with the specimen (e.g. slide, aliquot, etc.).", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("capacity", "SimpleQuantity", "The capacity (volume or other measure) the container may contain.", 0, java.lang.Integer.MAX_VALUE, capacity)); - childrenList.add(new Property("specimenQuantity", "SimpleQuantity", "The quantity of specimen in the container; may be volume, dimensions, or other appropriate measurements, depending on the specimen type.", 0, java.lang.Integer.MAX_VALUE, specimenQuantity)); - childrenList.add(new Property("additive[x]", "CodeableConcept|Reference(Substance)", "Introduced substance to preserve, maintain or enhance the specimen. Examples: Formalin, Citrate, EDTA.", 0, java.lang.Integer.MAX_VALUE, additive)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -67824454: /*capacity*/ return this.capacity == null ? new Base[0] : new Base[] {this.capacity}; // SimpleQuantity - case 1485980595: /*specimenQuantity*/ return this.specimenQuantity == null ? new Base[0] : new Base[] {this.specimenQuantity}; // SimpleQuantity - case -1226589236: /*additive*/ return this.additive == null ? new Base[0] : new Base[] {this.additive}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -67824454: // capacity - this.capacity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 1485980595: // specimenQuantity - this.specimenQuantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case -1226589236: // additive - this.additive = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("capacity")) - this.capacity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("specimenQuantity")) - this.specimenQuantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("additive[x]")) - this.additive = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 3575610: return getType(); // CodeableConcept - case -67824454: return getCapacity(); // SimpleQuantity - case 1485980595: return getSpecimenQuantity(); // SimpleQuantity - case 261915956: return getAdditive(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Specimen.description"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("capacity")) { - this.capacity = new SimpleQuantity(); - return this.capacity; - } - else if (name.equals("specimenQuantity")) { - this.specimenQuantity = new SimpleQuantity(); - return this.specimenQuantity; - } - else if (name.equals("additiveCodeableConcept")) { - this.additive = new CodeableConcept(); - return this.additive; - } - else if (name.equals("additiveReference")) { - this.additive = new Reference(); - return this.additive; - } - else - return super.addChild(name); - } - - public SpecimenContainerComponent copy() { - SpecimenContainerComponent dst = new SpecimenContainerComponent(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.description = description == null ? null : description.copy(); - dst.type = type == null ? null : type.copy(); - dst.capacity = capacity == null ? null : capacity.copy(); - dst.specimenQuantity = specimenQuantity == null ? null : specimenQuantity.copy(); - dst.additive = additive == null ? null : additive.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SpecimenContainerComponent)) - return false; - SpecimenContainerComponent o = (SpecimenContainerComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(description, o.description, true) - && compareDeep(type, o.type, true) && compareDeep(capacity, o.capacity, true) && compareDeep(specimenQuantity, o.specimenQuantity, true) - && compareDeep(additive, o.additive, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SpecimenContainerComponent)) - return false; - SpecimenContainerComponent o = (SpecimenContainerComponent) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (description == null || description.isEmpty()) - && (type == null || type.isEmpty()) && (capacity == null || capacity.isEmpty()) && (specimenQuantity == null || specimenQuantity.isEmpty()) - && (additive == null || additive.isEmpty()); - } - - public String fhirType() { - return "Specimen.container"; - - } - - } - - /** - * Id for specimen. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="External Identifier", formalDefinition="Id for specimen." ) - protected List identifier; - - /** - * 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. - */ - @Child(name = "accessionIdentifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Identifier accessionIdentifier; - - /** - * The availability of the specimen. - */ - @Child(name = "status", type = {CodeType.class}, order=2, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="available | unavailable | unsatisfactory | entered-in-error", formalDefinition="The availability of the specimen." ) - protected Enumeration status; - - /** - * The kind of material that forms the specimen. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Kind of material that forms the specimen", formalDefinition="The kind of material that forms the specimen." ) - protected CodeableConcept type; - - /** - * Where the specimen came from. This may be from the patient(s) or from the environment or a device. - */ - @Child(name = "subject", type = {Patient.class, Group.class, Device.class, Substance.class}, order=4, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device", formalDefinition="Where the specimen came from. This may be from the patient(s) or from the environment or a device." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - protected Resource subjectTarget; - - /** - * Time when specimen was received for processing or testing. - */ - @Child(name = "receivedTime", type = {DateTimeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="The time when specimen was received for processing", formalDefinition="Time when specimen was received for processing or testing." ) - protected DateTimeType receivedTime; - - /** - * Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen. - */ - @Child(name = "parent", type = {Specimen.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Specimen from which this specimen originated", formalDefinition="Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen." ) - protected List parent; - /** - * The actual objects that are the target of the reference (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) - */ - protected List parentTarget; - - - /** - * Details concerning the specimen collection. - */ - @Child(name = "collection", type = {}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Collection details", formalDefinition="Details concerning the specimen collection." ) - protected SpecimenCollectionComponent collection; - - /** - * Details concerning treatment and processing steps for the specimen. - */ - @Child(name = "treatment", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Treatment and processing step details", formalDefinition="Details concerning treatment and processing steps for the specimen." ) - protected List treatment; - - /** - * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here. - */ - @Child(name = "container", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @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." ) - protected List container; - - private static final long serialVersionUID = -374913648L; - - /** - * Constructor - */ - public Specimen() { - super(); - } - - /** - * Constructor - */ - public Specimen(Reference subject) { - super(); - this.subject = subject; - } - - /** - * @return {@link #identifier} (Id for specimen.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Id for specimen.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Specimen addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #accessionIdentifier} (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 Identifier getAccessionIdentifier() { - if (this.accessionIdentifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.accessionIdentifier"); - else if (Configuration.doAutoCreate()) - this.accessionIdentifier = new Identifier(); // cc - return this.accessionIdentifier; - } - - public boolean hasAccessionIdentifier() { - return this.accessionIdentifier != null && !this.accessionIdentifier.isEmpty(); - } - - /** - * @param value {@link #accessionIdentifier} (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(Identifier value) { - this.accessionIdentifier = value; - return this; - } - - /** - * @return {@link #status} (The availability of the specimen.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new SpecimenStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The availability of the specimen.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Specimen setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The availability of the specimen. - */ - public SpecimenStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The availability of the specimen. - */ - public Specimen setStatus(SpecimenStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new SpecimenStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #type} (The kind of material that forms the specimen.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The kind of material that forms the specimen.) - */ - public Specimen setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Specimen setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Where the specimen came from. This may be from the patient(s) or from the environment or a device.) - */ - public Specimen setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value - */ - public DateTimeType getReceivedTimeElement() { - if (this.receivedTime == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.receivedTime"); - else if (Configuration.doAutoCreate()) - this.receivedTime = new DateTimeType(); // bb - return this.receivedTime; - } - - public boolean hasReceivedTimeElement() { - return this.receivedTime != null && !this.receivedTime.isEmpty(); - } - - public boolean hasReceivedTime() { - return this.receivedTime != null && !this.receivedTime.isEmpty(); - } - - /** - * @param value {@link #receivedTime} (Time when specimen was received for processing or testing.). This is the underlying object with id, value and extensions. The accessor "getReceivedTime" gives direct access to the value - */ - public Specimen setReceivedTimeElement(DateTimeType value) { - this.receivedTime = value; - return this; - } - - /** - * @return Time when specimen was received for processing or testing. - */ - public Date getReceivedTime() { - return this.receivedTime == null ? null : this.receivedTime.getValue(); - } - - /** - * @param value Time when specimen was received for processing or testing. - */ - public Specimen setReceivedTime(Date value) { - if (value == null) - this.receivedTime = null; - else { - if (this.receivedTime == null) - this.receivedTime = new DateTimeType(); - this.receivedTime.setValue(value); - } - return this; - } - - /** - * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) - */ - public List getParent() { - if (this.parent == null) - this.parent = new ArrayList(); - return this.parent; - } - - public boolean hasParent() { - if (this.parent == null) - return false; - for (Reference item : this.parent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parent} (Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) - */ - // syntactic sugar - public Reference addParent() { //3 - Reference t = new Reference(); - if (this.parent == null) - this.parent = new ArrayList(); - this.parent.add(t); - return t; - } - - // syntactic sugar - public Specimen addParent(Reference t) { //3 - if (t == null) - return this; - if (this.parent == null) - this.parent = new ArrayList(); - this.parent.add(t); - return this; - } - - /** - * @return {@link #parent} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) - */ - public List getParentTarget() { - if (this.parentTarget == null) - this.parentTarget = new ArrayList(); - return this.parentTarget; - } - - // syntactic sugar - /** - * @return {@link #parent} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.) - */ - public Specimen addParentTarget() { - Specimen r = new Specimen(); - if (this.parentTarget == null) - this.parentTarget = new ArrayList(); - this.parentTarget.add(r); - return r; - } - - /** - * @return {@link #collection} (Details concerning the specimen collection.) - */ - public SpecimenCollectionComponent getCollection() { - if (this.collection == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Specimen.collection"); - else if (Configuration.doAutoCreate()) - this.collection = new SpecimenCollectionComponent(); // cc - return this.collection; - } - - public boolean hasCollection() { - return this.collection != null && !this.collection.isEmpty(); - } - - /** - * @param value {@link #collection} (Details concerning the specimen collection.) - */ - public Specimen setCollection(SpecimenCollectionComponent value) { - this.collection = value; - return this; - } - - /** - * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) - */ - public List getTreatment() { - if (this.treatment == null) - this.treatment = new ArrayList(); - return this.treatment; - } - - public boolean hasTreatment() { - if (this.treatment == null) - return false; - for (SpecimenTreatmentComponent item : this.treatment) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #treatment} (Details concerning treatment and processing steps for the specimen.) - */ - // syntactic sugar - public SpecimenTreatmentComponent addTreatment() { //3 - SpecimenTreatmentComponent t = new SpecimenTreatmentComponent(); - if (this.treatment == null) - this.treatment = new ArrayList(); - this.treatment.add(t); - return t; - } - - // syntactic sugar - public Specimen addTreatment(SpecimenTreatmentComponent t) { //3 - if (t == null) - return this; - if (this.treatment == null) - this.treatment = new ArrayList(); - this.treatment.add(t); - return this; - } - - /** - * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) - */ - public List getContainer() { - if (this.container == null) - this.container = new ArrayList(); - return this.container; - } - - public boolean hasContainer() { - if (this.container == null) - return false; - for (SpecimenContainerComponent item : this.container) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #container} (The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.) - */ - // syntactic sugar - public SpecimenContainerComponent addContainer() { //3 - SpecimenContainerComponent t = new SpecimenContainerComponent(); - if (this.container == null) - this.container = new ArrayList(); - this.container.add(t); - return t; - } - - // syntactic sugar - public Specimen addContainer(SpecimenContainerComponent t) { //3 - if (t == null) - return this; - if (this.container == null) - this.container = new ArrayList(); - this.container.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Id for specimen.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("accessionIdentifier", "Identifier", "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.", 0, java.lang.Integer.MAX_VALUE, accessionIdentifier)); - childrenList.add(new Property("status", "code", "The availability of the specimen.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("type", "CodeableConcept", "The kind of material that forms the specimen.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("subject", "Reference(Patient|Group|Device|Substance)", "Where the specimen came from. This may be from the patient(s) or from the environment or a device.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("receivedTime", "dateTime", "Time when specimen was received for processing or testing.", 0, java.lang.Integer.MAX_VALUE, receivedTime)); - childrenList.add(new Property("parent", "Reference(Specimen)", "Reference to the parent (source) specimen which is used when the specimen was either derived from or a component of another specimen.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("collection", "", "Details concerning the specimen collection.", 0, java.lang.Integer.MAX_VALUE, collection)); - childrenList.add(new Property("treatment", "", "Details concerning treatment and processing steps for the specimen.", 0, java.lang.Integer.MAX_VALUE, treatment)); - childrenList.add(new Property("container", "", "The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not addressed here.", 0, java.lang.Integer.MAX_VALUE, container)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 818734061: /*accessionIdentifier*/ return this.accessionIdentifier == null ? new Base[0] : new Base[] {this.accessionIdentifier}; // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case -767961010: /*receivedTime*/ return this.receivedTime == null ? new Base[0] : new Base[] {this.receivedTime}; // DateTimeType - case -995424086: /*parent*/ return this.parent == null ? new Base[0] : this.parent.toArray(new Base[this.parent.size()]); // Reference - case -1741312354: /*collection*/ return this.collection == null ? new Base[0] : new Base[] {this.collection}; // SpecimenCollectionComponent - case -63342472: /*treatment*/ return this.treatment == null ? new Base[0] : this.treatment.toArray(new Base[this.treatment.size()]); // SpecimenTreatmentComponent - case -410956671: /*container*/ return this.container == null ? new Base[0] : this.container.toArray(new Base[this.container.size()]); // SpecimenContainerComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 818734061: // accessionIdentifier - this.accessionIdentifier = castToIdentifier(value); // Identifier - break; - case -892481550: // status - this.status = new SpecimenStatusEnumFactory().fromType(value); // Enumeration - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case -767961010: // receivedTime - this.receivedTime = castToDateTime(value); // DateTimeType - break; - case -995424086: // parent - this.getParent().add(castToReference(value)); // Reference - break; - case -1741312354: // collection - this.collection = (SpecimenCollectionComponent) value; // SpecimenCollectionComponent - break; - case -63342472: // treatment - this.getTreatment().add((SpecimenTreatmentComponent) value); // SpecimenTreatmentComponent - break; - case -410956671: // container - this.getContainer().add((SpecimenContainerComponent) value); // SpecimenContainerComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("accessionIdentifier")) - this.accessionIdentifier = castToIdentifier(value); // Identifier - else if (name.equals("status")) - this.status = new SpecimenStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("receivedTime")) - this.receivedTime = castToDateTime(value); // DateTimeType - else if (name.equals("parent")) - this.getParent().add(castToReference(value)); - else if (name.equals("collection")) - this.collection = (SpecimenCollectionComponent) value; // SpecimenCollectionComponent - else if (name.equals("treatment")) - this.getTreatment().add((SpecimenTreatmentComponent) value); - else if (name.equals("container")) - this.getContainer().add((SpecimenContainerComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 818734061: return getAccessionIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3575610: return getType(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case -767961010: throw new FHIRException("Cannot make property receivedTime as it is not a complex type"); // DateTimeType - case -995424086: return addParent(); // Reference - case -1741312354: return getCollection(); // SpecimenCollectionComponent - case -63342472: return addTreatment(); // SpecimenTreatmentComponent - case -410956671: return addContainer(); // SpecimenContainerComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("accessionIdentifier")) { - this.accessionIdentifier = new Identifier(); - return this.accessionIdentifier; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Specimen.status"); - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("receivedTime")) { - throw new FHIRException("Cannot call addChild on a primitive type Specimen.receivedTime"); - } - else if (name.equals("parent")) { - return addParent(); - } - else if (name.equals("collection")) { - this.collection = new SpecimenCollectionComponent(); - return this.collection; - } - else if (name.equals("treatment")) { - return addTreatment(); - } - else if (name.equals("container")) { - return addContainer(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Specimen"; - - } - - public Specimen copy() { - Specimen dst = new Specimen(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.accessionIdentifier = accessionIdentifier == null ? null : accessionIdentifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.type = type == null ? null : type.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.receivedTime = receivedTime == null ? null : receivedTime.copy(); - if (parent != null) { - dst.parent = new ArrayList(); - for (Reference i : parent) - dst.parent.add(i.copy()); - }; - dst.collection = collection == null ? null : collection.copy(); - if (treatment != null) { - dst.treatment = new ArrayList(); - for (SpecimenTreatmentComponent i : treatment) - dst.treatment.add(i.copy()); - }; - if (container != null) { - dst.container = new ArrayList(); - for (SpecimenContainerComponent i : container) - dst.container.add(i.copy()); - }; - return dst; - } - - protected Specimen typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Specimen)) - return false; - Specimen o = (Specimen) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(accessionIdentifier, o.accessionIdentifier, true) - && compareDeep(status, o.status, true) && compareDeep(type, o.type, true) && compareDeep(subject, o.subject, true) - && compareDeep(receivedTime, o.receivedTime, true) && compareDeep(parent, o.parent, true) && compareDeep(collection, o.collection, true) - && compareDeep(treatment, o.treatment, true) && compareDeep(container, o.container, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Specimen)) - return false; - Specimen o = (Specimen) other; - return compareValues(status, o.status, true) && compareValues(receivedTime, o.receivedTime, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (accessionIdentifier == null || accessionIdentifier.isEmpty()) - && (status == null || status.isEmpty()) && (type == null || type.isEmpty()) && (subject == null || subject.isEmpty()) - && (receivedTime == null || receivedTime.isEmpty()) && (parent == null || parent.isEmpty()) - && (collection == null || collection.isEmpty()) && (treatment == null || treatment.isEmpty()) - && (container == null || container.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Specimen; - } - - /** - * Search parameter: collector - *

- * Description: Who collected the specimen
- * Type: reference
- * Path: Specimen.collection.collector
- *

- */ - @SearchParamDefinition(name="collector", path="Specimen.collection.collector", description="Who collected the specimen", type="reference" ) - public static final String SP_COLLECTOR = "collector"; - /** - * Fluent Client search parameter constant for collector - *

- * Description: Who collected the specimen
- * Type: reference
- * Path: Specimen.collection.collector
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam COLLECTOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_COLLECTOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Specimen:collector". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_COLLECTOR = new ca.uhn.fhir.model.api.Include("Specimen:collector").toLocked(); - - /** - * Search parameter: container-id - *

- * Description: The unique identifier associated with the specimen container
- * Type: token
- * Path: Specimen.container.identifier
- *

- */ - @SearchParamDefinition(name="container-id", path="Specimen.container.identifier", description="The unique identifier associated with the specimen container", type="token" ) - public static final String SP_CONTAINER_ID = "container-id"; - /** - * Fluent Client search parameter constant for container-id - *

- * Description: The unique identifier associated with the specimen container
- * Type: token
- * Path: Specimen.container.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER_ID = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER_ID); - - /** - * Search parameter: patient - *

- * Description: The patient the specimen comes from
- * Type: reference
- * Path: Specimen.subject
- *

- */ - @SearchParamDefinition(name="patient", path="Specimen.subject", description="The patient the specimen comes from", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: The patient the specimen comes from
- * Type: reference
- * Path: Specimen.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Specimen:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("Specimen:patient").toLocked(); - - /** - * Search parameter: bodysite - *

- * Description: The code for the body site from where the specimen originated
- * Type: token
- * Path: Specimen.collection.bodySite
- *

- */ - @SearchParamDefinition(name="bodysite", path="Specimen.collection.bodySite", description="The code for the body site from where the specimen originated", type="token" ) - public static final String SP_BODYSITE = "bodysite"; - /** - * Fluent Client search parameter constant for bodysite - *

- * Description: The code for the body site from where the specimen originated
- * Type: token
- * Path: Specimen.collection.bodySite
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BODYSITE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BODYSITE); - - /** - * Search parameter: container - *

- * Description: The kind of specimen container
- * Type: token
- * Path: Specimen.container.type
- *

- */ - @SearchParamDefinition(name="container", path="Specimen.container.type", description="The kind of specimen container", type="token" ) - public static final String SP_CONTAINER = "container"; - /** - * Fluent Client search parameter constant for container - *

- * Description: The kind of specimen container
- * Type: token
- * Path: Specimen.container.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER); - - /** - * Search parameter: collected - *

- * Description: The date the specimen was collected
- * Type: date
- * Path: Specimen.collection.collected[x]
- *

- */ - @SearchParamDefinition(name="collected", path="Specimen.collection.collected", description="The date the specimen was collected", type="date" ) - public static final String SP_COLLECTED = "collected"; - /** - * Fluent Client search parameter constant for collected - *

- * Description: The date the specimen was collected
- * Type: date
- * Path: Specimen.collection.collected[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam COLLECTED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_COLLECTED); - - /** - * Search parameter: 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 ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Specimen:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Specimen:subject").toLocked(); - - /** - * Search parameter: accession - *

- * Description: The accession number associated with the specimen
- * Type: token
- * Path: Specimen.accessionIdentifier
- *

- */ - @SearchParamDefinition(name="accession", path="Specimen.accessionIdentifier", description="The accession number associated with the specimen", type="token" ) - public static final String SP_ACCESSION = "accession"; - /** - * Fluent Client search parameter constant for accession - *

- * Description: The accession number associated with the specimen
- * Type: token
- * Path: Specimen.accessionIdentifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ACCESSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ACCESSION); - - /** - * Search parameter: parent - *

- * Description: The parent of the specimen
- * Type: reference
- * Path: Specimen.parent
- *

- */ - @SearchParamDefinition(name="parent", path="Specimen.parent", description="The parent of the specimen", type="reference" ) - public static final String SP_PARENT = "parent"; - /** - * Fluent Client search parameter constant for parent - *

- * Description: The parent of the specimen
- * Type: reference
- * Path: Specimen.parent
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Specimen:parent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("Specimen:parent").toLocked(); - - /** - * Search parameter: type - *

- * Description: The specimen type
- * Type: token
- * Path: Specimen.type
- *

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

- * Description: The specimen type
- * Type: token
- * Path: Specimen.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: identifier - *

- * Description: The unique identifier associated with the specimen
- * Type: token
- * Path: Specimen.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Specimen.identifier", description="The unique identifier associated with the specimen", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The unique identifier associated with the specimen
- * Type: token
- * Path: Specimen.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StringType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StringType.java deleted file mode 100644 index d82a72bc42f..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StringType.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ -package org.hl7.fhir.dstu2016may.model; - -import org.apache.commons.lang3.StringUtils; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - - -/** - * Primitive type "string" in FHIR - any sequence of unicode characters less than 1MB in length - */ -@DatatypeDef(name = "string") -public class StringType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Create a new String - */ - public StringType() { - super(); - } - - /** - * Create a new String - */ - public StringType(String theValue) { - setValue(theValue); - } - - /** - * Returns the value of this StringType, or an empty string ("") if the - * value is null. This method is provided as a convenience to - * users of this API. - */ - public String getValueNotNull() { - return StringUtils.defaultString(getValue()); - } - - /** - * Returns the value of this string, or null if no value - * is present - */ - @Override - public String toString() { - return getValue(); - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public StringType copy() { - return new StringType(getValue()); - } - - public String fhirType() { - return "string"; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StructureDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StructureDefinition.java deleted file mode 100644 index dfc6bb9600c..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StructureDefinition.java +++ /dev/null @@ -1,3495 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions, and constraints on resources and data types. - */ -@ResourceDef(name="StructureDefinition", profile="http://hl7.org/fhir/Profile/StructureDefinition") -public class StructureDefinition extends DomainResource { - - public enum StructureDefinitionKind { - /** - * A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions. - */ - DATATYPE, - /** - * A resource defined by the FHIR specification. - */ - RESOURCE, - /** - * A logical model - a conceptual package of data that will be mapped to resources for implementation. - */ - LOGICAL, - /** - * added to help the parsers - */ - NULL; - public static StructureDefinitionKind fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("datatype".equals(codeString)) - return DATATYPE; - if ("resource".equals(codeString)) - return RESOURCE; - if ("logical".equals(codeString)) - return LOGICAL; - throw new FHIRException("Unknown StructureDefinitionKind code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DATATYPE: return "datatype"; - case RESOURCE: return "resource"; - case LOGICAL: return "logical"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DATATYPE: return "http://hl7.org/fhir/structure-definition-kind"; - case RESOURCE: return "http://hl7.org/fhir/structure-definition-kind"; - case LOGICAL: return "http://hl7.org/fhir/structure-definition-kind"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DATATYPE: return "A data type - either a primitive or complex structure that defines a set of data elements. These can be used throughout Resource and extension definitions."; - case RESOURCE: return "A resource defined by the FHIR specification."; - case LOGICAL: return "A logical model - a conceptual package of data that will be mapped to resources for implementation."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DATATYPE: return "Data Type"; - case RESOURCE: return "Resource"; - case LOGICAL: return "Logical Model"; - default: return "?"; - } - } - } - - public static class StructureDefinitionKindEnumFactory implements EnumFactory { - public StructureDefinitionKind fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("datatype".equals(codeString)) - return StructureDefinitionKind.DATATYPE; - if ("resource".equals(codeString)) - return StructureDefinitionKind.RESOURCE; - if ("logical".equals(codeString)) - return StructureDefinitionKind.LOGICAL; - throw new IllegalArgumentException("Unknown StructureDefinitionKind code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("datatype".equals(codeString)) - return new Enumeration(this, StructureDefinitionKind.DATATYPE); - if ("resource".equals(codeString)) - return new Enumeration(this, StructureDefinitionKind.RESOURCE); - if ("logical".equals(codeString)) - return new Enumeration(this, StructureDefinitionKind.LOGICAL); - throw new FHIRException("Unknown StructureDefinitionKind code '"+codeString+"'"); - } - public String toCode(StructureDefinitionKind code) { - if (code == StructureDefinitionKind.DATATYPE) - return "datatype"; - if (code == StructureDefinitionKind.RESOURCE) - return "resource"; - if (code == StructureDefinitionKind.LOGICAL) - return "logical"; - return "?"; - } - public String toSystem(StructureDefinitionKind code) { - return code.getSystem(); - } - } - - public enum ExtensionContext { - /** - * The context is all elements matching a particular resource element path. - */ - RESOURCE, - /** - * The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name). - */ - DATATYPE, - /** - * The context is a particular extension from a particular profile, a uri that identifies the extension definition. - */ - EXTENSION, - /** - * added to help the parsers - */ - NULL; - public static ExtensionContext fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("resource".equals(codeString)) - return RESOURCE; - if ("datatype".equals(codeString)) - return DATATYPE; - if ("extension".equals(codeString)) - return EXTENSION; - throw new FHIRException("Unknown ExtensionContext code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RESOURCE: return "resource"; - case DATATYPE: return "datatype"; - case EXTENSION: return "extension"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESOURCE: return "http://hl7.org/fhir/extension-context"; - case DATATYPE: return "http://hl7.org/fhir/extension-context"; - case EXTENSION: return "http://hl7.org/fhir/extension-context"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESOURCE: return "The context is all elements matching a particular resource element path."; - case DATATYPE: return "The context is all nodes matching a particular data type element path (root or repeating element) or all elements referencing a particular primitive data type (expressed as the datatype name)."; - case EXTENSION: return "The context is a particular extension from a particular profile, a uri that identifies the extension definition."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESOURCE: return "Resource"; - case DATATYPE: return "Datatype"; - case EXTENSION: return "Extension"; - default: return "?"; - } - } - } - - public static class ExtensionContextEnumFactory implements EnumFactory { - public ExtensionContext fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("resource".equals(codeString)) - return ExtensionContext.RESOURCE; - if ("datatype".equals(codeString)) - return ExtensionContext.DATATYPE; - if ("extension".equals(codeString)) - return ExtensionContext.EXTENSION; - throw new IllegalArgumentException("Unknown ExtensionContext code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("resource".equals(codeString)) - return new Enumeration(this, ExtensionContext.RESOURCE); - if ("datatype".equals(codeString)) - return new Enumeration(this, ExtensionContext.DATATYPE); - if ("extension".equals(codeString)) - return new Enumeration(this, ExtensionContext.EXTENSION); - throw new FHIRException("Unknown ExtensionContext code '"+codeString+"'"); - } - public String toCode(ExtensionContext code) { - if (code == ExtensionContext.RESOURCE) - return "resource"; - if (code == ExtensionContext.DATATYPE) - return "datatype"; - if (code == ExtensionContext.EXTENSION) - return "extension"; - return "?"; - } - public String toSystem(ExtensionContext code) { - return code.getSystem(); - } - } - - public enum TypeDerivationRule { - /** - * This definition defines a new type that adds additional elements to the base type - */ - SPECIALIZATION, - /** - * This definition adds additional rules to an existing concrete type - */ - CONSTRAINT, - /** - * added to help the parsers - */ - NULL; - public static TypeDerivationRule fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("specialization".equals(codeString)) - return SPECIALIZATION; - if ("constraint".equals(codeString)) - return CONSTRAINT; - throw new FHIRException("Unknown TypeDerivationRule code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SPECIALIZATION: return "specialization"; - case CONSTRAINT: return "constraint"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SPECIALIZATION: return "http://hl7.org/fhir/type-derivation-rule"; - case CONSTRAINT: return "http://hl7.org/fhir/type-derivation-rule"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SPECIALIZATION: return "This definition defines a new type that adds additional elements to the base type"; - case CONSTRAINT: return "This definition adds additional rules to an existing concrete type"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SPECIALIZATION: return "Specialization"; - case CONSTRAINT: return "Constraint"; - default: return "?"; - } - } - } - - public static class TypeDerivationRuleEnumFactory implements EnumFactory { - public TypeDerivationRule fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("specialization".equals(codeString)) - return TypeDerivationRule.SPECIALIZATION; - if ("constraint".equals(codeString)) - return TypeDerivationRule.CONSTRAINT; - throw new IllegalArgumentException("Unknown TypeDerivationRule code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("specialization".equals(codeString)) - return new Enumeration(this, TypeDerivationRule.SPECIALIZATION); - if ("constraint".equals(codeString)) - return new Enumeration(this, TypeDerivationRule.CONSTRAINT); - throw new FHIRException("Unknown TypeDerivationRule code '"+codeString+"'"); - } - public String toCode(TypeDerivationRule code) { - if (code == TypeDerivationRule.SPECIALIZATION) - return "specialization"; - if (code == TypeDerivationRule.CONSTRAINT) - return "constraint"; - return "?"; - } - public String toSystem(TypeDerivationRule code) { - return code.getSystem(); - } - } - - @Block() - public static class StructureDefinitionContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the structure definition. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the structure definition." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public StructureDefinitionContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the structure definition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureDefinitionContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the structure definition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the structure definition. - */ - public StructureDefinitionContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public StructureDefinitionContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the structure definition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public StructureDefinitionContactComponent copy() { - StructureDefinitionContactComponent dst = new StructureDefinitionContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionContactComponent)) - return false; - StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionContactComponent)) - return false; - StructureDefinitionContactComponent o = (StructureDefinitionContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "StructureDefinition.contact"; - - } - - } - - @Block() - public static class StructureDefinitionMappingComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An Internal id that is used to identify this mapping set when specific mappings are made. - */ - @Child(name = "identity", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Internal id when this mapping is used", formalDefinition="An Internal id that is used to identify this mapping set when specific mappings are made." ) - protected IdType identity; - - /** - * An absolute URI that identifies the specification that this mapping is expressed to. - */ - @Child(name = "uri", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Identifies what this mapping refers to", formalDefinition="An absolute URI that identifies the specification that this mapping is expressed to." ) - protected UriType uri; - - /** - * A name for the specification that is being mapped to. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Names what this mapping refers to", formalDefinition="A name for the specification that is being mapped to." ) - protected StringType name; - - /** - * Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - @Child(name = "comments", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Versions, Issues, Scope limitations etc.", formalDefinition="Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage." ) - protected StringType comments; - - private static final long serialVersionUID = 299630820L; - - /** - * Constructor - */ - public StructureDefinitionMappingComponent() { - super(); - } - - /** - * Constructor - */ - public StructureDefinitionMappingComponent(IdType identity) { - super(); - this.identity = identity; - } - - /** - * @return {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public IdType getIdentityElement() { - if (this.identity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.identity"); - else if (Configuration.doAutoCreate()) - this.identity = new IdType(); // bb - return this.identity; - } - - public boolean hasIdentityElement() { - return this.identity != null && !this.identity.isEmpty(); - } - - public boolean hasIdentity() { - return this.identity != null && !this.identity.isEmpty(); - } - - /** - * @param value {@link #identity} (An Internal id that is used to identify this mapping set when specific mappings are made.). This is the underlying object with id, value and extensions. The accessor "getIdentity" gives direct access to the value - */ - public StructureDefinitionMappingComponent setIdentityElement(IdType value) { - this.identity = value; - return this; - } - - /** - * @return An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public String getIdentity() { - return this.identity == null ? null : this.identity.getValue(); - } - - /** - * @param value An Internal id that is used to identify this mapping set when specific mappings are made. - */ - public StructureDefinitionMappingComponent setIdentity(String value) { - if (this.identity == null) - this.identity = new IdType(); - this.identity.setValue(value); - return this; - } - - /** - * @return {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public UriType getUriElement() { - if (this.uri == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.uri"); - else if (Configuration.doAutoCreate()) - this.uri = new UriType(); // bb - return this.uri; - } - - public boolean hasUriElement() { - return this.uri != null && !this.uri.isEmpty(); - } - - public boolean hasUri() { - return this.uri != null && !this.uri.isEmpty(); - } - - /** - * @param value {@link #uri} (An absolute URI that identifies the specification that this mapping is expressed to.). This is the underlying object with id, value and extensions. The accessor "getUri" gives direct access to the value - */ - public StructureDefinitionMappingComponent setUriElement(UriType value) { - this.uri = value; - return this; - } - - /** - * @return An absolute URI that identifies the specification that this mapping is expressed to. - */ - public String getUri() { - return this.uri == null ? null : this.uri.getValue(); - } - - /** - * @param value An absolute URI that identifies the specification that this mapping is expressed to. - */ - public StructureDefinitionMappingComponent setUri(String value) { - if (Utilities.noString(value)) - this.uri = null; - else { - if (this.uri == null) - this.uri = new UriType(); - this.uri.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A name for the specification that is being mapped to.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureDefinitionMappingComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A name for the specification that is being mapped to. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A name for the specification that is being mapped to. - */ - public StructureDefinitionMappingComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StringType getCommentsElement() { - if (this.comments == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinitionMappingComponent.comments"); - else if (Configuration.doAutoCreate()) - this.comments = new StringType(); // bb - return this.comments; - } - - public boolean hasCommentsElement() { - return this.comments != null && !this.comments.isEmpty(); - } - - public boolean hasComments() { - return this.comments != null && !this.comments.isEmpty(); - } - - /** - * @param value {@link #comments} (Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.). This is the underlying object with id, value and extensions. The accessor "getComments" gives direct access to the value - */ - public StructureDefinitionMappingComponent setCommentsElement(StringType value) { - this.comments = value; - return this; - } - - /** - * @return Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public String getComments() { - return this.comments == null ? null : this.comments.getValue(); - } - - /** - * @param value Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage. - */ - public StructureDefinitionMappingComponent setComments(String value) { - if (Utilities.noString(value)) - this.comments = null; - else { - if (this.comments == null) - this.comments = new StringType(); - this.comments.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identity", "id", "An Internal id that is used to identify this mapping set when specific mappings are made.", 0, java.lang.Integer.MAX_VALUE, identity)); - childrenList.add(new Property("uri", "uri", "An absolute URI that identifies the specification that this mapping is expressed to.", 0, java.lang.Integer.MAX_VALUE, uri)); - childrenList.add(new Property("name", "string", "A name for the specification that is being mapped to.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("comments", "string", "Comments about this mapping, including version notes, issues, scope limitations, and other important notes for usage.", 0, java.lang.Integer.MAX_VALUE, comments)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -135761730: /*identity*/ return this.identity == null ? new Base[0] : new Base[] {this.identity}; // IdType - case 116076: /*uri*/ return this.uri == null ? new Base[0] : new Base[] {this.uri}; // UriType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -602415628: /*comments*/ return this.comments == null ? new Base[0] : new Base[] {this.comments}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -135761730: // identity - this.identity = castToId(value); // IdType - break; - case 116076: // uri - this.uri = castToUri(value); // UriType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -602415628: // comments - this.comments = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identity")) - this.identity = castToId(value); // IdType - else if (name.equals("uri")) - this.uri = castToUri(value); // UriType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("comments")) - this.comments = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -135761730: throw new FHIRException("Cannot make property identity as it is not a complex type"); // IdType - case 116076: throw new FHIRException("Cannot make property uri as it is not a complex type"); // UriType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -602415628: throw new FHIRException("Cannot make property comments as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identity")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.identity"); - } - else if (name.equals("uri")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.uri"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name"); - } - else if (name.equals("comments")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.comments"); - } - else - return super.addChild(name); - } - - public StructureDefinitionMappingComponent copy() { - StructureDefinitionMappingComponent dst = new StructureDefinitionMappingComponent(); - copyValues(dst); - dst.identity = identity == null ? null : identity.copy(); - dst.uri = uri == null ? null : uri.copy(); - dst.name = name == null ? null : name.copy(); - dst.comments = comments == null ? null : comments.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionMappingComponent)) - return false; - StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; - return compareDeep(identity, o.identity, true) && compareDeep(uri, o.uri, true) && compareDeep(name, o.name, true) - && compareDeep(comments, o.comments, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionMappingComponent)) - return false; - StructureDefinitionMappingComponent o = (StructureDefinitionMappingComponent) other; - return compareValues(identity, o.identity, true) && compareValues(uri, o.uri, true) && compareValues(name, o.name, true) - && compareValues(comments, o.comments, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identity == null || identity.isEmpty()) && (uri == null || uri.isEmpty()) - && (name == null || name.isEmpty()) && (comments == null || comments.isEmpty()); - } - - public String fhirType() { - return "StructureDefinition.mapping"; - - } - - } - - @Block() - public static class StructureDefinitionSnapshotComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Captures constraints on each element within the resource. - */ - @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) - protected List element; - - private static final long serialVersionUID = 53896641L; - - /** - * Constructor - */ - public StructureDefinitionSnapshotComponent() { - super(); - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public StructureDefinitionSnapshotComponent addElement(ElementDefinition t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1662836996: // element - this.getElement().add(castToElementDefinition(value)); // ElementDefinition - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("element")) - this.getElement().add(castToElementDefinition(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1662836996: return addElement(); // ElementDefinition - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("element")) { - return addElement(); - } - else - return super.addChild(name); - } - - public StructureDefinitionSnapshotComponent copy() { - StructureDefinitionSnapshotComponent dst = new StructureDefinitionSnapshotComponent(); - copyValues(dst); - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionSnapshotComponent)) - return false; - StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; - return compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionSnapshotComponent)) - return false; - StructureDefinitionSnapshotComponent o = (StructureDefinitionSnapshotComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()); - } - - public String fhirType() { - return "StructureDefinition.snapshot"; - - } - - } - - @Block() - public static class StructureDefinitionDifferentialComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Captures constraints on each element within the resource. - */ - @Child(name = "element", type = {ElementDefinition.class}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Definition of elements in the resource (if no StructureDefinition)", formalDefinition="Captures constraints on each element within the resource." ) - protected List element; - - private static final long serialVersionUID = 53896641L; - - /** - * Constructor - */ - public StructureDefinitionDifferentialComponent() { - super(); - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - public List getElement() { - if (this.element == null) - this.element = new ArrayList(); - return this.element; - } - - public boolean hasElement() { - if (this.element == null) - return false; - for (ElementDefinition item : this.element) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #element} (Captures constraints on each element within the resource.) - */ - // syntactic sugar - public ElementDefinition addElement() { //3 - ElementDefinition t = new ElementDefinition(); - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return t; - } - - // syntactic sugar - public StructureDefinitionDifferentialComponent addElement(ElementDefinition t) { //3 - if (t == null) - return this; - if (this.element == null) - this.element = new ArrayList(); - this.element.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("element", "ElementDefinition", "Captures constraints on each element within the resource.", 0, java.lang.Integer.MAX_VALUE, element)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1662836996: /*element*/ return this.element == null ? new Base[0] : this.element.toArray(new Base[this.element.size()]); // ElementDefinition - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1662836996: // element - this.getElement().add(castToElementDefinition(value)); // ElementDefinition - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("element")) - this.getElement().add(castToElementDefinition(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1662836996: return addElement(); // ElementDefinition - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("element")) { - return addElement(); - } - else - return super.addChild(name); - } - - public StructureDefinitionDifferentialComponent copy() { - StructureDefinitionDifferentialComponent dst = new StructureDefinitionDifferentialComponent(); - copyValues(dst); - if (element != null) { - dst.element = new ArrayList(); - for (ElementDefinition i : element) - dst.element.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinitionDifferentialComponent)) - return false; - StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; - return compareDeep(element, o.element, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinitionDifferentialComponent)) - return false; - StructureDefinitionDifferentialComponent o = (StructureDefinitionDifferentialComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (element == null || element.isEmpty()); - } - - public String fhirType() { - return "StructureDefinition.differential"; - - } - - } - - /** - * An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL used to reference this StructureDefinition", formalDefinition="An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other identifiers for the StructureDefinition", formalDefinition="Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) - protected List identifier; - - /** - * The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id for this version of the StructureDefinition", formalDefinition="The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually." ) - protected StringType version; - - /** - * A free text natural language name identifying the StructureDefinition. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this StructureDefinition", formalDefinition="A free text natural language name identifying the StructureDefinition." ) - protected StringType name; - - /** - * Defined so that applications can use this name when displaying the value of the extension to the user. - */ - @Child(name = "display", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Use this name when displaying the value", formalDefinition="Defined so that applications can use this name when displaying the value of the extension to the user." ) - protected StringType display; - - /** - * The status of the StructureDefinition. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the StructureDefinition." ) - protected Enumeration status; - - /** - * This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the structure definition. - */ - @Child(name = "publisher", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the structure definition." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for this version of the StructureDefinition", formalDefinition="The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes." ) - protected DateTimeType date; - - /** - * A free text natural language description of the StructureDefinition and its use. - */ - @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Natural language description of the StructureDefinition", formalDefinition="A free text natural language description of the StructureDefinition and its use." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions." ) - protected List useContext; - - /** - * Explains why this structure definition is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Scope and Usage this structure definition is for", formalDefinition="Explains why this structure definition is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - @Child(name = "copyright", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) - protected StringType copyright; - - /** - * A set of terms from external terminologies that may be used to assist with indexing and searching of templates. - */ - @Child(name = "code", type = {Coding.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Assist with indexing and finding", formalDefinition="A set of terms from external terminologies that may be used to assist with indexing and searching of templates." ) - protected List code; - - /** - * The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. - */ - @Child(name = "fhirVersion", type = {IdType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FHIR Version this StructureDefinition targets", formalDefinition="The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version." ) - protected IdType fhirVersion; - - /** - * An external specification that the content is mapped to. - */ - @Child(name = "mapping", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="External specification that the content is mapped to", formalDefinition="An external specification that the content is mapped to." ) - protected List mapping; - - /** - * Defines the kind of structure that this definition is describing. - */ - @Child(name = "kind", type = {CodeType.class}, order=17, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="datatype | resource | logical", formalDefinition="Defines the kind of structure that this definition is describing." ) - protected Enumeration kind; - - /** - * Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. - */ - @Child(name = "abstract", type = {BooleanType.class}, order=18, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether the structure is abstract", formalDefinition="Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type." ) - protected BooleanType abstract_; - - /** - * If this is an extension, Identifies the context within FHIR resources where the extension can be used. - */ - @Child(name = "contextType", type = {CodeType.class}, order=19, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="resource | datatype | extension", formalDefinition="If this is an extension, Identifies the context within FHIR resources where the extension can be used." ) - protected Enumeration contextType; - - /** - * Identifies the types of resource or data type elements to which the extension can be applied. - */ - @Child(name = "context", type = {StringType.class}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Where the extension can be used in instances", formalDefinition="Identifies the types of resource or data type elements to which the extension can be applied." ) - protected List context; - - /** - * The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure. - */ - @Child(name = "baseType", type = {CodeType.class}, order=21, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Any datatype or resource, including abstract ones", formalDefinition="The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure." ) - protected CodeType baseType; - - /** - * An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. - */ - @Child(name = "baseDefinition", type = {UriType.class}, order=22, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Definition that this type is constrained/specialized from", formalDefinition="An absolute URI that is the base structure from which this type is derived, either by specialization or constraint." ) - protected UriType baseDefinition; - - /** - * How the type relates to the baseDefinition. - */ - @Child(name = "derivation", type = {CodeType.class}, order=23, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="specialization | constraint - How relates to base definition", formalDefinition="How the type relates to the baseDefinition." ) - protected Enumeration derivation; - - /** - * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition. - */ - @Child(name = "snapshot", type = {}, order=24, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Snapshot view of the structure", formalDefinition="A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition." ) - protected StructureDefinitionSnapshotComponent snapshot; - - /** - * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. - */ - @Child(name = "differential", type = {}, order=25, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Differential view of the structure", formalDefinition="A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies." ) - protected StructureDefinitionDifferentialComponent differential; - - private static final long serialVersionUID = -1505153076L; - - /** - * Constructor - */ - public StructureDefinition() { - super(); - } - - /** - * Constructor - */ - public StructureDefinition(UriType url, StringType name, Enumeration status, Enumeration kind, BooleanType abstract_) { - super(); - this.url = url; - this.name = name; - this.status = status; - this.kind = kind; - this.abstract_ = abstract_; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StructureDefinition setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published. - */ - public StructureDefinition setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StructureDefinition setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually. - */ - public StructureDefinition setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureDefinition setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the StructureDefinition. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the StructureDefinition. - */ - public StructureDefinition setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (Defined so that applications can use this name when displaying the value of the extension to the user.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StructureDefinition setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return Defined so that applications can use this name when displaying the value of the extension to the user. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value Defined so that applications can use this name when displaying the value of the extension to the user. - */ - public StructureDefinition setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the StructureDefinition.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public StructureDefinition setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the StructureDefinition. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the StructureDefinition. - */ - public StructureDefinition setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public StructureDefinition setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public StructureDefinition setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the structure definition.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StructureDefinition setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the structure definition. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the structure definition. - */ - public StructureDefinition setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (StructureDefinitionContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public StructureDefinitionContactComponent addContact() { //3 - StructureDefinitionContactComponent t = new StructureDefinitionContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addContact(StructureDefinitionContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public StructureDefinition setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes. - */ - public StructureDefinition setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the StructureDefinition and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StructureDefinition setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the StructureDefinition and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the StructureDefinition and its use. - */ - public StructureDefinition setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this structure definition is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StructureDefinition setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this structure definition is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this structure definition is needed and why it's been constrained as it has. - */ - public StructureDefinition setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StructureDefinition setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public StructureDefinition setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - public List getCode() { - if (this.code == null) - this.code = new ArrayList(); - return this.code; - } - - public boolean hasCode() { - if (this.code == null) - return false; - for (Coding item : this.code) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #code} (A set of terms from external terminologies that may be used to assist with indexing and searching of templates.) - */ - // syntactic sugar - public Coding addCode() { //3 - Coding t = new Coding(); - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addCode(Coding t) { //3 - if (t == null) - return this; - if (this.code == null) - this.code = new ArrayList(); - this.code.add(t); - return this; - } - - /** - * @return {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public IdType getFhirVersionElement() { - if (this.fhirVersion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.fhirVersion"); - else if (Configuration.doAutoCreate()) - this.fhirVersion = new IdType(); // bb - return this.fhirVersion; - } - - public boolean hasFhirVersionElement() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - public boolean hasFhirVersion() { - return this.fhirVersion != null && !this.fhirVersion.isEmpty(); - } - - /** - * @param value {@link #fhirVersion} (The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.). This is the underlying object with id, value and extensions. The accessor "getFhirVersion" gives direct access to the value - */ - public StructureDefinition setFhirVersionElement(IdType value) { - this.fhirVersion = value; - return this; - } - - /** - * @return The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. - */ - public String getFhirVersion() { - return this.fhirVersion == null ? null : this.fhirVersion.getValue(); - } - - /** - * @param value The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version. - */ - public StructureDefinition setFhirVersion(String value) { - if (Utilities.noString(value)) - this.fhirVersion = null; - else { - if (this.fhirVersion == null) - this.fhirVersion = new IdType(); - this.fhirVersion.setValue(value); - } - return this; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - public List getMapping() { - if (this.mapping == null) - this.mapping = new ArrayList(); - return this.mapping; - } - - public boolean hasMapping() { - if (this.mapping == null) - return false; - for (StructureDefinitionMappingComponent item : this.mapping) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #mapping} (An external specification that the content is mapped to.) - */ - // syntactic sugar - public StructureDefinitionMappingComponent addMapping() { //3 - StructureDefinitionMappingComponent t = new StructureDefinitionMappingComponent(); - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return t; - } - - // syntactic sugar - public StructureDefinition addMapping(StructureDefinitionMappingComponent t) { //3 - if (t == null) - return this; - if (this.mapping == null) - this.mapping = new ArrayList(); - this.mapping.add(t); - return this; - } - - /** - * @return {@link #kind} (Defines the kind of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public Enumeration getKindElement() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new Enumeration(new StructureDefinitionKindEnumFactory()); // bb - return this.kind; - } - - public boolean hasKindElement() { - return this.kind != null && !this.kind.isEmpty(); - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Defines the kind of structure that this definition is describing.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value - */ - public StructureDefinition setKindElement(Enumeration value) { - this.kind = value; - return this; - } - - /** - * @return Defines the kind of structure that this definition is describing. - */ - public StructureDefinitionKind getKind() { - return this.kind == null ? null : this.kind.getValue(); - } - - /** - * @param value Defines the kind of structure that this definition is describing. - */ - public StructureDefinition setKind(StructureDefinitionKind value) { - if (this.kind == null) - this.kind = new Enumeration(new StructureDefinitionKindEnumFactory()); - this.kind.setValue(value); - return this; - } - - /** - * @return {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); // bb - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public StructureDefinition setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. - */ - public boolean getAbstract() { - return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); - } - - /** - * @param value Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type. - */ - public StructureDefinition setAbstract(boolean value) { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - return this; - } - - /** - * @return {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public Enumeration getContextTypeElement() { - if (this.contextType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.contextType"); - else if (Configuration.doAutoCreate()) - this.contextType = new Enumeration(new ExtensionContextEnumFactory()); // bb - return this.contextType; - } - - public boolean hasContextTypeElement() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - public boolean hasContextType() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - /** - * @param value {@link #contextType} (If this is an extension, Identifies the context within FHIR resources where the extension can be used.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public StructureDefinition setContextTypeElement(Enumeration value) { - this.contextType = value; - return this; - } - - /** - * @return If this is an extension, Identifies the context within FHIR resources where the extension can be used. - */ - public ExtensionContext getContextType() { - return this.contextType == null ? null : this.contextType.getValue(); - } - - /** - * @param value If this is an extension, Identifies the context within FHIR resources where the extension can be used. - */ - public StructureDefinition setContextType(ExtensionContext value) { - if (value == null) - this.contextType = null; - else { - if (this.contextType == null) - this.contextType = new Enumeration(new ExtensionContextEnumFactory()); - this.contextType.setValue(value); - } - return this; - } - - /** - * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public List getContext() { - if (this.context == null) - this.context = new ArrayList(); - return this.context; - } - - public boolean hasContext() { - if (this.context == null) - return false; - for (StringType item : this.context) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - // syntactic sugar - public StringType addContextElement() {//2 - StringType t = new StringType(); - if (this.context == null) - this.context = new ArrayList(); - this.context.add(t); - return t; - } - - /** - * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public StructureDefinition addContext(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.context == null) - this.context = new ArrayList(); - this.context.add(t); - return this; - } - - /** - * @param value {@link #context} (Identifies the types of resource or data type elements to which the extension can be applied.) - */ - public boolean hasContext(String value) { - if (this.context == null) - return false; - for (StringType v : this.context) - if (v.equals(value)) // string - return true; - return false; - } - - /** - * @return {@link #baseType} (The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure.). This is the underlying object with id, value and extensions. The accessor "getBaseType" gives direct access to the value - */ - public CodeType getBaseTypeElement() { - if (this.baseType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.baseType"); - else if (Configuration.doAutoCreate()) - this.baseType = new CodeType(); // bb - return this.baseType; - } - - public boolean hasBaseTypeElement() { - return this.baseType != null && !this.baseType.isEmpty(); - } - - public boolean hasBaseType() { - return this.baseType != null && !this.baseType.isEmpty(); - } - - /** - * @param value {@link #baseType} (The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure.). This is the underlying object with id, value and extensions. The accessor "getBaseType" gives direct access to the value - */ - public StructureDefinition setBaseTypeElement(CodeType value) { - this.baseType = value; - return this; - } - - /** - * @return The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure. - */ - public String getBaseType() { - return this.baseType == null ? null : this.baseType.getValue(); - } - - /** - * @param value The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure. - */ - public StructureDefinition setBaseType(String value) { - if (Utilities.noString(value)) - this.baseType = null; - else { - if (this.baseType == null) - this.baseType = new CodeType(); - this.baseType.setValue(value); - } - return this; - } - - /** - * @return {@link #baseDefinition} (An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.). This is the underlying object with id, value and extensions. The accessor "getBaseDefinition" gives direct access to the value - */ - public UriType getBaseDefinitionElement() { - if (this.baseDefinition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.baseDefinition"); - else if (Configuration.doAutoCreate()) - this.baseDefinition = new UriType(); // bb - return this.baseDefinition; - } - - public boolean hasBaseDefinitionElement() { - return this.baseDefinition != null && !this.baseDefinition.isEmpty(); - } - - public boolean hasBaseDefinition() { - return this.baseDefinition != null && !this.baseDefinition.isEmpty(); - } - - /** - * @param value {@link #baseDefinition} (An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.). This is the underlying object with id, value and extensions. The accessor "getBaseDefinition" gives direct access to the value - */ - public StructureDefinition setBaseDefinitionElement(UriType value) { - this.baseDefinition = value; - return this; - } - - /** - * @return An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. - */ - public String getBaseDefinition() { - return this.baseDefinition == null ? null : this.baseDefinition.getValue(); - } - - /** - * @param value An absolute URI that is the base structure from which this type is derived, either by specialization or constraint. - */ - public StructureDefinition setBaseDefinition(String value) { - if (Utilities.noString(value)) - this.baseDefinition = null; - else { - if (this.baseDefinition == null) - this.baseDefinition = new UriType(); - this.baseDefinition.setValue(value); - } - return this; - } - - /** - * @return {@link #derivation} (How the type relates to the baseDefinition.). This is the underlying object with id, value and extensions. The accessor "getDerivation" gives direct access to the value - */ - public Enumeration getDerivationElement() { - if (this.derivation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.derivation"); - else if (Configuration.doAutoCreate()) - this.derivation = new Enumeration(new TypeDerivationRuleEnumFactory()); // bb - return this.derivation; - } - - public boolean hasDerivationElement() { - return this.derivation != null && !this.derivation.isEmpty(); - } - - public boolean hasDerivation() { - return this.derivation != null && !this.derivation.isEmpty(); - } - - /** - * @param value {@link #derivation} (How the type relates to the baseDefinition.). This is the underlying object with id, value and extensions. The accessor "getDerivation" gives direct access to the value - */ - public StructureDefinition setDerivationElement(Enumeration value) { - this.derivation = value; - return this; - } - - /** - * @return How the type relates to the baseDefinition. - */ - public TypeDerivationRule getDerivation() { - return this.derivation == null ? null : this.derivation.getValue(); - } - - /** - * @param value How the type relates to the baseDefinition. - */ - public StructureDefinition setDerivation(TypeDerivationRule value) { - if (value == null) - this.derivation = null; - else { - if (this.derivation == null) - this.derivation = new Enumeration(new TypeDerivationRuleEnumFactory()); - this.derivation.setValue(value); - } - return this; - } - - /** - * @return {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) - */ - public StructureDefinitionSnapshotComponent getSnapshot() { - if (this.snapshot == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.snapshot"); - else if (Configuration.doAutoCreate()) - this.snapshot = new StructureDefinitionSnapshotComponent(); // cc - return this.snapshot; - } - - public boolean hasSnapshot() { - return this.snapshot != null && !this.snapshot.isEmpty(); - } - - /** - * @param value {@link #snapshot} (A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.) - */ - public StructureDefinition setSnapshot(StructureDefinitionSnapshotComponent value) { - this.snapshot = value; - return this; - } - - /** - * @return {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) - */ - public StructureDefinitionDifferentialComponent getDifferential() { - if (this.differential == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureDefinition.differential"); - else if (Configuration.doAutoCreate()) - this.differential = new StructureDefinitionDifferentialComponent(); // cc - return this.differential; - } - - public boolean hasDifferential() { - return this.differential != null && !this.differential.isEmpty(); - } - - /** - * @param value {@link #differential} (A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.) - */ - public StructureDefinition setDifferential(StructureDefinitionDifferentialComponent value) { - this.differential = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this structure definition when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure definition is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this StructureDefinition when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the StructureDefinition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureDefinition author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("display", "string", "Defined so that applications can use this name when displaying the value of the extension to the user.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("status", "code", "The status of the StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This StructureDefinition was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the structure definition.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date this version of the structure definition was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure definition changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the StructureDefinition and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this structure definition is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the structure definition and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("code", "Coding", "A set of terms from external terminologies that may be used to assist with indexing and searching of templates.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("fhirVersion", "id", "The version of the FHIR specification on which this StructureDefinition is based - this is the formal version of the specification, without the revision number, e.g. [publication].[major].[minor], which is 1.4.0 for this version.", 0, java.lang.Integer.MAX_VALUE, fhirVersion)); - childrenList.add(new Property("mapping", "", "An external specification that the content is mapped to.", 0, java.lang.Integer.MAX_VALUE, mapping)); - childrenList.add(new Property("kind", "code", "Defines the kind of structure that this definition is describing.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("abstract", "boolean", "Whether structure this definition describes is abstract or not - that is, whether an actual exchanged item can ever be of this type.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("contextType", "code", "If this is an extension, Identifies the context within FHIR resources where the extension can be used.", 0, java.lang.Integer.MAX_VALUE, contextType)); - childrenList.add(new Property("context", "string", "Identifies the types of resource or data type elements to which the extension can be applied.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("baseType", "code", "The type of type that this structure is derived from - a data type, an extension, a resource, including abstract ones. If this field is present, it indicates that the structure definition is deriving from this type. If it is not present, then the structure definition is the definition of a base abstract structure.", 0, java.lang.Integer.MAX_VALUE, baseType)); - childrenList.add(new Property("baseDefinition", "uri", "An absolute URI that is the base structure from which this type is derived, either by specialization or constraint.", 0, java.lang.Integer.MAX_VALUE, baseDefinition)); - childrenList.add(new Property("derivation", "code", "How the type relates to the baseDefinition.", 0, java.lang.Integer.MAX_VALUE, derivation)); - childrenList.add(new Property("snapshot", "", "A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base StructureDefinition.", 0, java.lang.Integer.MAX_VALUE, snapshot)); - childrenList.add(new Property("differential", "", "A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies.", 0, java.lang.Integer.MAX_VALUE, differential)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // StructureDefinitionContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : this.code.toArray(new Base[this.code.size()]); // Coding - case 461006061: /*fhirVersion*/ return this.fhirVersion == null ? new Base[0] : new Base[] {this.fhirVersion}; // IdType - case 837556430: /*mapping*/ return this.mapping == null ? new Base[0] : this.mapping.toArray(new Base[this.mapping.size()]); // StructureDefinitionMappingComponent - case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration - case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : new Base[] {this.abstract_}; // BooleanType - case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration - case 951530927: /*context*/ return this.context == null ? new Base[0] : this.context.toArray(new Base[this.context.size()]); // StringType - case -1721484885: /*baseType*/ return this.baseType == null ? new Base[0] : new Base[] {this.baseType}; // CodeType - case 1139771140: /*baseDefinition*/ return this.baseDefinition == null ? new Base[0] : new Base[] {this.baseDefinition}; // UriType - case -1353885513: /*derivation*/ return this.derivation == null ? new Base[0] : new Base[] {this.derivation}; // Enumeration - case 284874180: /*snapshot*/ return this.snapshot == null ? new Base[0] : new Base[] {this.snapshot}; // StructureDefinitionSnapshotComponent - case -1196150917: /*differential*/ return this.differential == null ? new Base[0] : new Base[] {this.differential}; // StructureDefinitionDifferentialComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((StructureDefinitionContactComponent) value); // StructureDefinitionContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case 3059181: // code - this.getCode().add(castToCoding(value)); // Coding - break; - case 461006061: // fhirVersion - this.fhirVersion = castToId(value); // IdType - break; - case 837556430: // mapping - this.getMapping().add((StructureDefinitionMappingComponent) value); // StructureDefinitionMappingComponent - break; - case 3292052: // kind - this.kind = new StructureDefinitionKindEnumFactory().fromType(value); // Enumeration - break; - case 1732898850: // abstract - this.abstract_ = castToBoolean(value); // BooleanType - break; - case -102839927: // contextType - this.contextType = new ExtensionContextEnumFactory().fromType(value); // Enumeration - break; - case 951530927: // context - this.getContext().add(castToString(value)); // StringType - break; - case -1721484885: // baseType - this.baseType = castToCode(value); // CodeType - break; - case 1139771140: // baseDefinition - this.baseDefinition = castToUri(value); // UriType - break; - case -1353885513: // derivation - this.derivation = new TypeDerivationRuleEnumFactory().fromType(value); // Enumeration - break; - case 284874180: // snapshot - this.snapshot = (StructureDefinitionSnapshotComponent) value; // StructureDefinitionSnapshotComponent - break; - case -1196150917: // differential - this.differential = (StructureDefinitionDifferentialComponent) value; // StructureDefinitionDifferentialComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((StructureDefinitionContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("code")) - this.getCode().add(castToCoding(value)); - else if (name.equals("fhirVersion")) - this.fhirVersion = castToId(value); // IdType - else if (name.equals("mapping")) - this.getMapping().add((StructureDefinitionMappingComponent) value); - else if (name.equals("kind")) - this.kind = new StructureDefinitionKindEnumFactory().fromType(value); // Enumeration - else if (name.equals("abstract")) - this.abstract_ = castToBoolean(value); // BooleanType - else if (name.equals("contextType")) - this.contextType = new ExtensionContextEnumFactory().fromType(value); // Enumeration - else if (name.equals("context")) - this.getContext().add(castToString(value)); - else if (name.equals("baseType")) - this.baseType = castToCode(value); // CodeType - else if (name.equals("baseDefinition")) - this.baseDefinition = castToUri(value); // UriType - else if (name.equals("derivation")) - this.derivation = new TypeDerivationRuleEnumFactory().fromType(value); // Enumeration - else if (name.equals("snapshot")) - this.snapshot = (StructureDefinitionSnapshotComponent) value; // StructureDefinitionSnapshotComponent - else if (name.equals("differential")) - this.differential = (StructureDefinitionDifferentialComponent) value; // StructureDefinitionDifferentialComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return addIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // StructureDefinitionContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case 3059181: return addCode(); // Coding - case 461006061: throw new FHIRException("Cannot make property fhirVersion as it is not a complex type"); // IdType - case 837556430: return addMapping(); // StructureDefinitionMappingComponent - case 3292052: throw new FHIRException("Cannot make property kind as it is not a complex type"); // Enumeration - case 1732898850: throw new FHIRException("Cannot make property abstract as it is not a complex type"); // BooleanType - case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration - case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // StringType - case -1721484885: throw new FHIRException("Cannot make property baseType as it is not a complex type"); // CodeType - case 1139771140: throw new FHIRException("Cannot make property baseDefinition as it is not a complex type"); // UriType - case -1353885513: throw new FHIRException("Cannot make property derivation as it is not a complex type"); // Enumeration - case 284874180: return getSnapshot(); // StructureDefinitionSnapshotComponent - case -1196150917: return getDifferential(); // StructureDefinitionDifferentialComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.url"); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.name"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.display"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.copyright"); - } - else if (name.equals("code")) { - return addCode(); - } - else if (name.equals("fhirVersion")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.fhirVersion"); - } - else if (name.equals("mapping")) { - return addMapping(); - } - else if (name.equals("kind")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.kind"); - } - else if (name.equals("abstract")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.abstract"); - } - else if (name.equals("contextType")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.contextType"); - } - else if (name.equals("context")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.context"); - } - else if (name.equals("baseType")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.baseType"); - } - else if (name.equals("baseDefinition")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.baseDefinition"); - } - else if (name.equals("derivation")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureDefinition.derivation"); - } - else if (name.equals("snapshot")) { - this.snapshot = new StructureDefinitionSnapshotComponent(); - return this.snapshot; - } - else if (name.equals("differential")) { - this.differential = new StructureDefinitionDifferentialComponent(); - return this.differential; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "StructureDefinition"; - - } - - public StructureDefinition copy() { - StructureDefinition dst = new StructureDefinition(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.display = display == null ? null : display.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (StructureDefinitionContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - if (code != null) { - dst.code = new ArrayList(); - for (Coding i : code) - dst.code.add(i.copy()); - }; - dst.fhirVersion = fhirVersion == null ? null : fhirVersion.copy(); - if (mapping != null) { - dst.mapping = new ArrayList(); - for (StructureDefinitionMappingComponent i : mapping) - dst.mapping.add(i.copy()); - }; - dst.kind = kind == null ? null : kind.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.contextType = contextType == null ? null : contextType.copy(); - if (context != null) { - dst.context = new ArrayList(); - for (StringType i : context) - dst.context.add(i.copy()); - }; - dst.baseType = baseType == null ? null : baseType.copy(); - dst.baseDefinition = baseDefinition == null ? null : baseDefinition.copy(); - dst.derivation = derivation == null ? null : derivation.copy(); - dst.snapshot = snapshot == null ? null : snapshot.copy(); - dst.differential = differential == null ? null : differential.copy(); - return dst; - } - - protected StructureDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureDefinition)) - return false; - StructureDefinition o = (StructureDefinition) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(display, o.display, true) && compareDeep(status, o.status, true) - && compareDeep(experimental, o.experimental, true) && compareDeep(publisher, o.publisher, true) - && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) && compareDeep(description, o.description, true) - && compareDeep(useContext, o.useContext, true) && compareDeep(requirements, o.requirements, true) - && compareDeep(copyright, o.copyright, true) && compareDeep(code, o.code, true) && compareDeep(fhirVersion, o.fhirVersion, true) - && compareDeep(mapping, o.mapping, true) && compareDeep(kind, o.kind, true) && compareDeep(abstract_, o.abstract_, true) - && compareDeep(contextType, o.contextType, true) && compareDeep(context, o.context, true) && compareDeep(baseType, o.baseType, true) - && compareDeep(baseDefinition, o.baseDefinition, true) && compareDeep(derivation, o.derivation, true) - && compareDeep(snapshot, o.snapshot, true) && compareDeep(differential, o.differential, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureDefinition)) - return false; - StructureDefinition o = (StructureDefinition) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(display, o.display, true) && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) - && compareValues(publisher, o.publisher, true) && compareValues(date, o.date, true) && compareValues(description, o.description, true) - && compareValues(requirements, o.requirements, true) && compareValues(copyright, o.copyright, true) - && compareValues(fhirVersion, o.fhirVersion, true) && compareValues(kind, o.kind, true) && compareValues(abstract_, o.abstract_, true) - && compareValues(contextType, o.contextType, true) && compareValues(context, o.context, true) && compareValues(baseType, o.baseType, true) - && compareValues(baseDefinition, o.baseDefinition, true) && compareValues(derivation, o.derivation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (display == null || display.isEmpty()) - && (status == null || status.isEmpty()) && (experimental == null || experimental.isEmpty()) - && (publisher == null || publisher.isEmpty()) && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) - && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (requirements == null || requirements.isEmpty()) && (copyright == null || copyright.isEmpty()) - && (code == null || code.isEmpty()) && (fhirVersion == null || fhirVersion.isEmpty()) && (mapping == null || mapping.isEmpty()) - && (kind == null || kind.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) && (contextType == null || contextType.isEmpty()) - && (context == null || context.isEmpty()) && (baseType == null || baseType.isEmpty()) && (baseDefinition == null || baseDefinition.isEmpty()) - && (derivation == null || derivation.isEmpty()) && (snapshot == null || snapshot.isEmpty()) - && (differential == null || differential.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.StructureDefinition; - } - - /** - * Search parameter: abstract - *

- * Description: Whether the structure is abstract
- * Type: token
- * Path: StructureDefinition.abstract
- *

- */ - @SearchParamDefinition(name="abstract", path="StructureDefinition.abstract", description="Whether the structure is abstract", type="token" ) - public static final String SP_ABSTRACT = "abstract"; - /** - * Fluent Client search parameter constant for abstract - *

- * Description: Whether the structure is abstract
- * Type: token
- * Path: StructureDefinition.abstract
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam ABSTRACT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_ABSTRACT); - - /** - * Search parameter: status - *

- * Description: The current status of the profile
- * Type: token
- * Path: StructureDefinition.status
- *

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

- * Description: The current status of the profile
- * Type: token
- * Path: StructureDefinition.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: experimental - *

- * Description: If for testing purposes, not real usage
- * Type: token
- * Path: StructureDefinition.experimental
- *

- */ - @SearchParamDefinition(name="experimental", path="StructureDefinition.experimental", description="If for testing purposes, not real usage", type="token" ) - public static final String SP_EXPERIMENTAL = "experimental"; - /** - * Fluent Client search parameter constant for experimental - *

- * Description: If for testing purposes, not real usage
- * Type: token
- * Path: StructureDefinition.experimental
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL); - - /** - * Search parameter: display - *

- * Description: Use this name when displaying the value
- * Type: string
- * Path: StructureDefinition.display
- *

- */ - @SearchParamDefinition(name="display", path="StructureDefinition.display", description="Use this name when displaying the value", type="string" ) - public static final String SP_DISPLAY = "display"; - /** - * Fluent Client search parameter constant for display - *

- * Description: Use this name when displaying the value
- * Type: string
- * Path: StructureDefinition.display
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DISPLAY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DISPLAY); - - /** - * Search parameter: ext-context - *

- * Description: Where the extension can be used in instances
- * Type: string
- * Path: StructureDefinition.context
- *

- */ - @SearchParamDefinition(name="ext-context", path="StructureDefinition.context", description="Where the extension can be used in instances", type="string" ) - public static final String SP_EXT_CONTEXT = "ext-context"; - /** - * Fluent Client search parameter constant for ext-context - *

- * Description: Where the extension can be used in instances
- * Type: string
- * Path: StructureDefinition.context
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam EXT_CONTEXT = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_EXT_CONTEXT); - - /** - * Search parameter: code - *

- * Description: A code for the profile
- * Type: token
- * Path: StructureDefinition.code
- *

- */ - @SearchParamDefinition(name="code", path="StructureDefinition.code", description="A code for the profile", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: A code for the profile
- * Type: token
- * Path: StructureDefinition.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: date - *

- * Description: The profile publication date
- * Type: date
- * Path: StructureDefinition.date
- *

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

- * Description: The profile publication date
- * Type: date
- * Path: StructureDefinition.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: type - *

- * Description: Any datatype or resource, including abstract ones
- * Type: token
- * Path: StructureDefinition.baseType
- *

- */ - @SearchParamDefinition(name="type", path="StructureDefinition.baseType", description="Any datatype or resource, including abstract ones", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Any datatype or resource, including abstract ones
- * Type: token
- * Path: StructureDefinition.baseType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: url - *

- * Description: Absolute URL used to reference this StructureDefinition
- * Type: uri
- * Path: StructureDefinition.url
- *

- */ - @SearchParamDefinition(name="url", path="StructureDefinition.url", description="Absolute URL used to reference this StructureDefinition", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Absolute URL used to reference this StructureDefinition
- * Type: uri
- * Path: StructureDefinition.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: kind - *

- * Description: datatype | resource | logical
- * Type: token
- * Path: StructureDefinition.kind
- *

- */ - @SearchParamDefinition(name="kind", path="StructureDefinition.kind", description="datatype | resource | logical", type="token" ) - public static final String SP_KIND = "kind"; - /** - * Fluent Client search parameter constant for kind - *

- * Description: datatype | resource | logical
- * Type: token
- * Path: StructureDefinition.kind
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); - - /** - * Search parameter: version - *

- * Description: The version identifier of the profile
- * Type: token
- * Path: StructureDefinition.version
- *

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

- * Description: The version identifier of the profile
- * Type: token
- * Path: StructureDefinition.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher of the profile
- * Type: string
- * Path: StructureDefinition.publisher
- *

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

- * Description: Name of the publisher of the profile
- * Type: string
- * Path: StructureDefinition.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: derivation - *

- * Description: specialization | constraint - How relates to base definition
- * Type: token
- * Path: StructureDefinition.derivation
- *

- */ - @SearchParamDefinition(name="derivation", path="StructureDefinition.derivation", description="specialization | constraint - How relates to base definition", type="token" ) - public static final String SP_DERIVATION = "derivation"; - /** - * Fluent Client search parameter constant for derivation - *

- * Description: specialization | constraint - How relates to base definition
- * Type: token
- * Path: StructureDefinition.derivation
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam DERIVATION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_DERIVATION); - - /** - * Search parameter: base-path - *

- * Description: Path that identifies the base element
- * Type: token
- * Path: StructureDefinition.snapshot.element.base.path, StructureDefinition.differential.element.base.path
- *

- */ - @SearchParamDefinition(name="base-path", path="StructureDefinition.snapshot.element.base.path | StructureDefinition.differential.element.base.path", description="Path that identifies the base element", type="token" ) - public static final String SP_BASE_PATH = "base-path"; - /** - * Fluent Client search parameter constant for base-path - *

- * Description: Path that identifies the base element
- * Type: token
- * Path: StructureDefinition.snapshot.element.base.path, StructureDefinition.differential.element.base.path
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam BASE_PATH = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_BASE_PATH); - - /** - * Search parameter: valueset - *

- * Description: A vocabulary binding reference
- * Type: reference
- * Path: StructureDefinition.snapshot.element.binding.valueSet[x]
- *

- */ - @SearchParamDefinition(name="valueset", path="StructureDefinition.snapshot.element.binding.valueSet", description="A vocabulary binding reference", type="reference" ) - public static final String SP_VALUESET = "valueset"; - /** - * Fluent Client search parameter constant for valueset - *

- * Description: A vocabulary binding reference
- * Type: reference
- * Path: StructureDefinition.snapshot.element.binding.valueSet[x]
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam VALUESET = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_VALUESET); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "StructureDefinition:valueset". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_VALUESET = new ca.uhn.fhir.model.api.Include("StructureDefinition:valueset").toLocked(); - - /** - * Search parameter: context-type - *

- * Description: resource | datatype | extension
- * Type: token
- * Path: StructureDefinition.contextType
- *

- */ - @SearchParamDefinition(name="context-type", path="StructureDefinition.contextType", description="resource | datatype | extension", type="token" ) - public static final String SP_CONTEXT_TYPE = "context-type"; - /** - * Fluent Client search parameter constant for context-type - *

- * Description: resource | datatype | extension
- * Type: token
- * Path: StructureDefinition.contextType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT_TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT_TYPE); - - /** - * Search parameter: description - *

- * Description: Text search in the description of the profile
- * Type: string
- * Path: StructureDefinition.description
- *

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

- * Description: Text search in the description of the profile
- * Type: string
- * Path: StructureDefinition.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: Name of the profile
- * Type: string
- * Path: StructureDefinition.name
- *

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

- * Description: Name of the profile
- * Type: string
- * Path: StructureDefinition.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: base - *

- * Description: Definition that this type is constrained/specialized from
- * Type: uri
- * Path: StructureDefinition.baseDefinition
- *

- */ - @SearchParamDefinition(name="base", path="StructureDefinition.baseDefinition", description="Definition that this type is constrained/specialized from", type="uri" ) - public static final String SP_BASE = "base"; - /** - * Fluent Client search parameter constant for base - *

- * Description: Definition that this type is constrained/specialized from
- * Type: uri
- * Path: StructureDefinition.baseDefinition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam BASE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_BASE); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the structure
- * Type: token
- * Path: StructureDefinition.useContext
- *

- */ - @SearchParamDefinition(name="context", path="StructureDefinition.useContext", description="A use context assigned to the structure", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the structure
- * Type: token
- * Path: StructureDefinition.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: path - *

- * Description: A path that is constrained in the profile
- * Type: token
- * Path: StructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path
- *

- */ - @SearchParamDefinition(name="path", path="StructureDefinition.snapshot.element.path | StructureDefinition.differential.element.path", description="A path that is constrained in the profile", type="token" ) - public static final String SP_PATH = "path"; - /** - * Fluent Client search parameter constant for path - *

- * Description: A path that is constrained in the profile
- * Type: token
- * Path: StructureDefinition.snapshot.element.path, StructureDefinition.differential.element.path
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PATH = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PATH); - - /** - * Search parameter: identifier - *

- * Description: The identifier of the profile
- * Type: token
- * Path: StructureDefinition.identifier
- *

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

- * Description: The identifier of the profile
- * Type: token
- * Path: StructureDefinition.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StructureMap.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StructureMap.java deleted file mode 100644 index 18a355de319..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/StructureMap.java +++ /dev/null @@ -1,5599 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A Map of relationships between 2 structures that can be used to transform data. - */ -@ResourceDef(name="StructureMap", profile="http://hl7.org/fhir/Profile/StructureMap") -public class StructureMap extends DomainResource { - - public enum StructureMapModelMode { - /** - * This structure describes an instance passed to the mapping engine that is used a source of data - */ - SOURCE, - /** - * This structure describes an instance that the mapping engine may ask for that is used a source of data - */ - QUERIED, - /** - * This structure describes an instance passed to the mapping engine that is used a target of data - */ - TARGET, - /** - * This structure describes an instance that the mapping engine may ask to create that is used a target of data - */ - PRODUCED, - /** - * added to help the parsers - */ - NULL; - public static StructureMapModelMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return SOURCE; - if ("queried".equals(codeString)) - return QUERIED; - if ("target".equals(codeString)) - return TARGET; - if ("produced".equals(codeString)) - return PRODUCED; - throw new FHIRException("Unknown StructureMapModelMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SOURCE: return "source"; - case QUERIED: return "queried"; - case TARGET: return "target"; - case PRODUCED: return "produced"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SOURCE: return "http://hl7.org/fhir/map-model-mode"; - case QUERIED: return "http://hl7.org/fhir/map-model-mode"; - case TARGET: return "http://hl7.org/fhir/map-model-mode"; - case PRODUCED: return "http://hl7.org/fhir/map-model-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SOURCE: return "This structure describes an instance passed to the mapping engine that is used a source of data"; - case QUERIED: return "This structure describes an instance that the mapping engine may ask for that is used a source of data"; - case TARGET: return "This structure describes an instance passed to the mapping engine that is used a target of data"; - case PRODUCED: return "This structure describes an instance that the mapping engine may ask to create that is used a target of data"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SOURCE: return "Source Structure Definition"; - case QUERIED: return "Queried Structure Definition"; - case TARGET: return "Target Structure Definition"; - case PRODUCED: return "Produced Structure Definition"; - default: return "?"; - } - } - } - - public static class StructureMapModelModeEnumFactory implements EnumFactory { - public StructureMapModelMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return StructureMapModelMode.SOURCE; - if ("queried".equals(codeString)) - return StructureMapModelMode.QUERIED; - if ("target".equals(codeString)) - return StructureMapModelMode.TARGET; - if ("produced".equals(codeString)) - return StructureMapModelMode.PRODUCED; - throw new IllegalArgumentException("Unknown StructureMapModelMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return new Enumeration(this, StructureMapModelMode.SOURCE); - if ("queried".equals(codeString)) - return new Enumeration(this, StructureMapModelMode.QUERIED); - if ("target".equals(codeString)) - return new Enumeration(this, StructureMapModelMode.TARGET); - if ("produced".equals(codeString)) - return new Enumeration(this, StructureMapModelMode.PRODUCED); - throw new FHIRException("Unknown StructureMapModelMode code '"+codeString+"'"); - } - public String toCode(StructureMapModelMode code) { - if (code == StructureMapModelMode.SOURCE) - return "source"; - if (code == StructureMapModelMode.QUERIED) - return "queried"; - if (code == StructureMapModelMode.TARGET) - return "target"; - if (code == StructureMapModelMode.PRODUCED) - return "produced"; - return "?"; - } - public String toSystem(StructureMapModelMode code) { - return code.getSystem(); - } - } - - public enum StructureMapInputMode { - /** - * Names an input instance used a source for mapping - */ - SOURCE, - /** - * Names an instance that is being populated - */ - TARGET, - /** - * added to help the parsers - */ - NULL; - public static StructureMapInputMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return SOURCE; - if ("target".equals(codeString)) - return TARGET; - throw new FHIRException("Unknown StructureMapInputMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case SOURCE: return "source"; - case TARGET: return "target"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case SOURCE: return "http://hl7.org/fhir/map-input-mode"; - case TARGET: return "http://hl7.org/fhir/map-input-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case SOURCE: return "Names an input instance used a source for mapping"; - case TARGET: return "Names an instance that is being populated"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case SOURCE: return "Source Instance"; - case TARGET: return "Target Instance"; - default: return "?"; - } - } - } - - public static class StructureMapInputModeEnumFactory implements EnumFactory { - public StructureMapInputMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return StructureMapInputMode.SOURCE; - if ("target".equals(codeString)) - return StructureMapInputMode.TARGET; - throw new IllegalArgumentException("Unknown StructureMapInputMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("source".equals(codeString)) - return new Enumeration(this, StructureMapInputMode.SOURCE); - if ("target".equals(codeString)) - return new Enumeration(this, StructureMapInputMode.TARGET); - throw new FHIRException("Unknown StructureMapInputMode code '"+codeString+"'"); - } - public String toCode(StructureMapInputMode code) { - if (code == StructureMapInputMode.SOURCE) - return "source"; - if (code == StructureMapInputMode.TARGET) - return "target"; - return "?"; - } - public String toSystem(StructureMapInputMode code) { - return code.getSystem(); - } - } - - public enum StructureMapContextType { - /** - * The context specifies a type - */ - TYPE, - /** - * The context specifies a variable - */ - VARIABLE, - /** - * added to help the parsers - */ - NULL; - public static StructureMapContextType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("type".equals(codeString)) - return TYPE; - if ("variable".equals(codeString)) - return VARIABLE; - throw new FHIRException("Unknown StructureMapContextType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case TYPE: return "type"; - case VARIABLE: return "variable"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case TYPE: return "http://hl7.org/fhir/map-context-type"; - case VARIABLE: return "http://hl7.org/fhir/map-context-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case TYPE: return "The context specifies a type"; - case VARIABLE: return "The context specifies a variable"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case TYPE: return "Type"; - case VARIABLE: return "Variable"; - default: return "?"; - } - } - } - - public static class StructureMapContextTypeEnumFactory implements EnumFactory { - public StructureMapContextType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("type".equals(codeString)) - return StructureMapContextType.TYPE; - if ("variable".equals(codeString)) - return StructureMapContextType.VARIABLE; - throw new IllegalArgumentException("Unknown StructureMapContextType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("type".equals(codeString)) - return new Enumeration(this, StructureMapContextType.TYPE); - if ("variable".equals(codeString)) - return new Enumeration(this, StructureMapContextType.VARIABLE); - throw new FHIRException("Unknown StructureMapContextType code '"+codeString+"'"); - } - public String toCode(StructureMapContextType code) { - if (code == StructureMapContextType.TYPE) - return "type"; - if (code == StructureMapContextType.VARIABLE) - return "variable"; - return "?"; - } - public String toSystem(StructureMapContextType code) { - return code.getSystem(); - } - } - - public enum StructureMapListMode { - /** - * when the target list is being assembled, the items for this rule go first. If more that one rule defines a first item (for a given instance of mapping) then this is an error - */ - FIRST, - /** - * the target instance is shared with the target instances generated by another rule (up to the first common n items, then create new ones) - */ - SHARE, - /** - * when the target list is being assembled, the items for this rule go last. If more that one rule defines a last item (for a given instance of mapping) then this is an error - */ - LAST, - /** - * added to help the parsers - */ - NULL; - public static StructureMapListMode fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("first".equals(codeString)) - return FIRST; - if ("share".equals(codeString)) - return SHARE; - if ("last".equals(codeString)) - return LAST; - throw new FHIRException("Unknown StructureMapListMode code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case FIRST: return "first"; - case SHARE: return "share"; - case LAST: return "last"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case FIRST: return "http://hl7.org/fhir/map-list-mode"; - case SHARE: return "http://hl7.org/fhir/map-list-mode"; - case LAST: return "http://hl7.org/fhir/map-list-mode"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case FIRST: return "when the target list is being assembled, the items for this rule go first. If more that one rule defines a first item (for a given instance of mapping) then this is an error"; - case SHARE: return "the target instance is shared with the target instances generated by another rule (up to the first common n items, then create new ones)"; - case LAST: return "when the target list is being assembled, the items for this rule go last. If more that one rule defines a last item (for a given instance of mapping) then this is an error"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case FIRST: return "First"; - case SHARE: return "Share"; - case LAST: return "Last"; - default: return "?"; - } - } - } - - public static class StructureMapListModeEnumFactory implements EnumFactory { - public StructureMapListMode fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("first".equals(codeString)) - return StructureMapListMode.FIRST; - if ("share".equals(codeString)) - return StructureMapListMode.SHARE; - if ("last".equals(codeString)) - return StructureMapListMode.LAST; - throw new IllegalArgumentException("Unknown StructureMapListMode code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("first".equals(codeString)) - return new Enumeration(this, StructureMapListMode.FIRST); - if ("share".equals(codeString)) - return new Enumeration(this, StructureMapListMode.SHARE); - if ("last".equals(codeString)) - return new Enumeration(this, StructureMapListMode.LAST); - throw new FHIRException("Unknown StructureMapListMode code '"+codeString+"'"); - } - public String toCode(StructureMapListMode code) { - if (code == StructureMapListMode.FIRST) - return "first"; - if (code == StructureMapListMode.SHARE) - return "share"; - if (code == StructureMapListMode.LAST) - return "last"; - return "?"; - } - public String toSystem(StructureMapListMode code) { - return code.getSystem(); - } - } - - public enum StructureMapTransform { - /** - * create(type : string) - type is passed through to the application on the standard API, and must be known by it - */ - CREATE, - /** - * copy(source) - */ - COPY, - /** - * truncate(source, length) - source must be stringy type - */ - TRUNCATE, - /** - * escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped - */ - ESCAPE, - /** - * cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known - */ - CAST, - /** - * append(source...) - source is element or string - */ - APPEND, - /** - * translate(source, uri_of_map) - use the translate operation - */ - TRANSLATE, - /** - * reference(source : object) - return a string that references the provided tree properly - */ - REFERENCE, - /** - * something - */ - DATEOP, - /** - * something - */ - UUID, - /** - * something - */ - POINTER, - /** - * something - */ - EVALUATE, - /** - * added to help the parsers - */ - NULL; - public static StructureMapTransform fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return CREATE; - if ("copy".equals(codeString)) - return COPY; - if ("truncate".equals(codeString)) - return TRUNCATE; - if ("escape".equals(codeString)) - return ESCAPE; - if ("cast".equals(codeString)) - return CAST; - if ("append".equals(codeString)) - return APPEND; - if ("translate".equals(codeString)) - return TRANSLATE; - if ("reference".equals(codeString)) - return REFERENCE; - if ("dateOp".equals(codeString)) - return DATEOP; - if ("uuid".equals(codeString)) - return UUID; - if ("pointer".equals(codeString)) - return POINTER; - if ("evaluate".equals(codeString)) - return EVALUATE; - throw new FHIRException("Unknown StructureMapTransform code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case CREATE: return "create"; - case COPY: return "copy"; - case TRUNCATE: return "truncate"; - case ESCAPE: return "escape"; - case CAST: return "cast"; - case APPEND: return "append"; - case TRANSLATE: return "translate"; - case REFERENCE: return "reference"; - case DATEOP: return "dateOp"; - case UUID: return "uuid"; - case POINTER: return "pointer"; - case EVALUATE: return "evaluate"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case CREATE: return "http://hl7.org/fhir/map-transform"; - case COPY: return "http://hl7.org/fhir/map-transform"; - case TRUNCATE: return "http://hl7.org/fhir/map-transform"; - case ESCAPE: return "http://hl7.org/fhir/map-transform"; - case CAST: return "http://hl7.org/fhir/map-transform"; - case APPEND: return "http://hl7.org/fhir/map-transform"; - case TRANSLATE: return "http://hl7.org/fhir/map-transform"; - case REFERENCE: return "http://hl7.org/fhir/map-transform"; - case DATEOP: return "http://hl7.org/fhir/map-transform"; - case UUID: return "http://hl7.org/fhir/map-transform"; - case POINTER: return "http://hl7.org/fhir/map-transform"; - case EVALUATE: return "http://hl7.org/fhir/map-transform"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case CREATE: return "create(type : string) - type is passed through to the application on the standard API, and must be known by it"; - case COPY: return "copy(source)"; - case TRUNCATE: return "truncate(source, length) - source must be stringy type"; - case ESCAPE: return "escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note that this is for when the string itself is escaped"; - case CAST: return "cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one and only one target type known"; - case APPEND: return "append(source...) - source is element or string"; - case TRANSLATE: return "translate(source, uri_of_map) - use the translate operation"; - case REFERENCE: return "reference(source : object) - return a string that references the provided tree properly"; - case DATEOP: return "something"; - case UUID: return "something"; - case POINTER: return "something"; - case EVALUATE: return "something"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case CREATE: return "create"; - case COPY: return "copy"; - case TRUNCATE: return "truncate"; - case ESCAPE: return "escape"; - case CAST: return "cast"; - case APPEND: return "append"; - case TRANSLATE: return "translate"; - case REFERENCE: return "reference"; - case DATEOP: return "dateOp"; - case UUID: return "uuid"; - case POINTER: return "pointer"; - case EVALUATE: return "evaluate"; - default: return "?"; - } - } - } - - public static class StructureMapTransformEnumFactory implements EnumFactory { - public StructureMapTransform fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return StructureMapTransform.CREATE; - if ("copy".equals(codeString)) - return StructureMapTransform.COPY; - if ("truncate".equals(codeString)) - return StructureMapTransform.TRUNCATE; - if ("escape".equals(codeString)) - return StructureMapTransform.ESCAPE; - if ("cast".equals(codeString)) - return StructureMapTransform.CAST; - if ("append".equals(codeString)) - return StructureMapTransform.APPEND; - if ("translate".equals(codeString)) - return StructureMapTransform.TRANSLATE; - if ("reference".equals(codeString)) - return StructureMapTransform.REFERENCE; - if ("dateOp".equals(codeString)) - return StructureMapTransform.DATEOP; - if ("uuid".equals(codeString)) - return StructureMapTransform.UUID; - if ("pointer".equals(codeString)) - return StructureMapTransform.POINTER; - if ("evaluate".equals(codeString)) - return StructureMapTransform.EVALUATE; - throw new IllegalArgumentException("Unknown StructureMapTransform code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("create".equals(codeString)) - return new Enumeration(this, StructureMapTransform.CREATE); - if ("copy".equals(codeString)) - return new Enumeration(this, StructureMapTransform.COPY); - if ("truncate".equals(codeString)) - return new Enumeration(this, StructureMapTransform.TRUNCATE); - if ("escape".equals(codeString)) - return new Enumeration(this, StructureMapTransform.ESCAPE); - if ("cast".equals(codeString)) - return new Enumeration(this, StructureMapTransform.CAST); - if ("append".equals(codeString)) - return new Enumeration(this, StructureMapTransform.APPEND); - if ("translate".equals(codeString)) - return new Enumeration(this, StructureMapTransform.TRANSLATE); - if ("reference".equals(codeString)) - return new Enumeration(this, StructureMapTransform.REFERENCE); - if ("dateOp".equals(codeString)) - return new Enumeration(this, StructureMapTransform.DATEOP); - if ("uuid".equals(codeString)) - return new Enumeration(this, StructureMapTransform.UUID); - if ("pointer".equals(codeString)) - return new Enumeration(this, StructureMapTransform.POINTER); - if ("evaluate".equals(codeString)) - return new Enumeration(this, StructureMapTransform.EVALUATE); - throw new FHIRException("Unknown StructureMapTransform code '"+codeString+"'"); - } - public String toCode(StructureMapTransform code) { - if (code == StructureMapTransform.CREATE) - return "create"; - if (code == StructureMapTransform.COPY) - return "copy"; - if (code == StructureMapTransform.TRUNCATE) - return "truncate"; - if (code == StructureMapTransform.ESCAPE) - return "escape"; - if (code == StructureMapTransform.CAST) - return "cast"; - if (code == StructureMapTransform.APPEND) - return "append"; - if (code == StructureMapTransform.TRANSLATE) - return "translate"; - if (code == StructureMapTransform.REFERENCE) - return "reference"; - if (code == StructureMapTransform.DATEOP) - return "dateOp"; - if (code == StructureMapTransform.UUID) - return "uuid"; - if (code == StructureMapTransform.POINTER) - return "pointer"; - if (code == StructureMapTransform.EVALUATE) - return "evaluate"; - return "?"; - } - public String toSystem(StructureMapTransform code) { - return code.getSystem(); - } - } - - @Block() - public static class StructureMapContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the structure map. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the structure map." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public StructureMapContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the structure map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the structure map.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureMapContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the structure map. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the structure map. - */ - public StructureMapContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public StructureMapContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the structure map.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public StructureMapContactComponent copy() { - StructureMapContactComponent dst = new StructureMapContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapContactComponent)) - return false; - StructureMapContactComponent o = (StructureMapContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapContactComponent)) - return false; - StructureMapContactComponent o = (StructureMapContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "StructureMap.contact"; - - } - - } - - @Block() - public static class StructureMapStructureComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The canonical URL that identifies the structure. - */ - @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Canonical URL for structure definition", formalDefinition="The canonical URL that identifies the structure." ) - protected UriType url; - - /** - * How the referenced structure is used in this mapping. - */ - @Child(name = "mode", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="source | queried | target | produced", formalDefinition="How the referenced structure is used in this mapping." ) - protected Enumeration mode; - - /** - * Documentation that describes how the structure is used in the mapping. - */ - @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Documentation on use of structure", formalDefinition="Documentation that describes how the structure is used in the mapping." ) - protected StringType documentation; - - private static final long serialVersionUID = -451631915L; - - /** - * Constructor - */ - public StructureMapStructureComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapStructureComponent(UriType url, Enumeration mode) { - super(); - this.url = url; - this.mode = mode; - } - - /** - * @return {@link #url} (The canonical URL that identifies the structure.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapStructureComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (The canonical URL that identifies the structure.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StructureMapStructureComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return The canonical URL that identifies the structure. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value The canonical URL that identifies the structure. - */ - public StructureMapStructureComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #mode} (How the referenced structure is used in this mapping.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapStructureComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new StructureMapModelModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (How the referenced structure is used in this mapping.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public StructureMapStructureComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return How the referenced structure is used in this mapping. - */ - public StructureMapModelMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value How the referenced structure is used in this mapping. - */ - public StructureMapStructureComponent setMode(StructureMapModelMode value) { - if (this.mode == null) - this.mode = new Enumeration(new StructureMapModelModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Documentation that describes how the structure is used in the mapping.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapStructureComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Documentation that describes how the structure is used in the mapping.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StructureMapStructureComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation that describes how the structure is used in the mapping. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation that describes how the structure is used in the mapping. - */ - public StructureMapStructureComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "The canonical URL that identifies the structure.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("mode", "code", "How the referenced structure is used in this mapping.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "Documentation that describes how the structure is used in the mapping.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 3357091: // mode - this.mode = new StructureMapModelModeEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("mode")) - this.mode = new StructureMapModelModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.url"); - } - else if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.mode"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); - } - else - return super.addChild(name); - } - - public StructureMapStructureComponent copy() { - StructureMapStructureComponent dst = new StructureMapStructureComponent(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapStructureComponent)) - return false; - StructureMapStructureComponent o = (StructureMapStructureComponent) other; - return compareDeep(url, o.url, true) && compareDeep(mode, o.mode, true) && compareDeep(documentation, o.documentation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapStructureComponent)) - return false; - StructureMapStructureComponent o = (StructureMapStructureComponent) other; - return compareValues(url, o.url, true) && compareValues(mode, o.mode, true) && compareValues(documentation, o.documentation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (mode == null || mode.isEmpty()) - && (documentation == null || documentation.isEmpty()); - } - - public String fhirType() { - return "StructureMap.structure"; - - } - - } - - @Block() - public static class StructureMapGroupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Descriptive name for a user. - */ - @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Descriptive name for a user", formalDefinition="Descriptive name for a user." ) - protected IdType name; - - /** - * Another group that this group adds rules to. - */ - @Child(name = "extends", type = {IdType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Another group that this group adds rules to", formalDefinition="Another group that this group adds rules to." ) - protected IdType extends_; - - /** - * Documentation for this group. - */ - @Child(name = "documentation", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Documentation for this group", formalDefinition="Documentation for this group." ) - protected StringType documentation; - - /** - * A name assigned to an instance of data. The instance must be provided when the mapping is invoked. - */ - @Child(name = "input", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Named instance provided when invoking the map", formalDefinition="A name assigned to an instance of data. The instance must be provided when the mapping is invoked." ) - protected List input; - - /** - * Transform Rule from source to target. - */ - @Child(name = "rule", type = {}, order=5, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Transform Rule from source to target", formalDefinition="Transform Rule from source to target." ) - protected List rule; - - private static final long serialVersionUID = -1311232924L; - - /** - * Constructor - */ - public StructureMapGroupComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupComponent(IdType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Descriptive name for a user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public IdType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new IdType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Descriptive name for a user.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureMapGroupComponent setNameElement(IdType value) { - this.name = value; - return this; - } - - /** - * @return Descriptive name for a user. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Descriptive name for a user. - */ - public StructureMapGroupComponent setName(String value) { - if (this.name == null) - this.name = new IdType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #extends_} (Another group that this group adds rules to.). This is the underlying object with id, value and extensions. The accessor "getExtends" gives direct access to the value - */ - public IdType getExtendsElement() { - if (this.extends_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupComponent.extends_"); - else if (Configuration.doAutoCreate()) - this.extends_ = new IdType(); // bb - return this.extends_; - } - - public boolean hasExtendsElement() { - return this.extends_ != null && !this.extends_.isEmpty(); - } - - public boolean hasExtends() { - return this.extends_ != null && !this.extends_.isEmpty(); - } - - /** - * @param value {@link #extends_} (Another group that this group adds rules to.). This is the underlying object with id, value and extensions. The accessor "getExtends" gives direct access to the value - */ - public StructureMapGroupComponent setExtendsElement(IdType value) { - this.extends_ = value; - return this; - } - - /** - * @return Another group that this group adds rules to. - */ - public String getExtends() { - return this.extends_ == null ? null : this.extends_.getValue(); - } - - /** - * @param value Another group that this group adds rules to. - */ - public StructureMapGroupComponent setExtends(String value) { - if (Utilities.noString(value)) - this.extends_ = null; - else { - if (this.extends_ == null) - this.extends_ = new IdType(); - this.extends_.setValue(value); - } - return this; - } - - /** - * @return {@link #documentation} (Documentation for this group.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Documentation for this group.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StructureMapGroupComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation for this group. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation for this group. - */ - public StructureMapGroupComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - /** - * @return {@link #input} (A name assigned to an instance of data. The instance must be provided when the mapping is invoked.) - */ - public List getInput() { - if (this.input == null) - this.input = new ArrayList(); - return this.input; - } - - public boolean hasInput() { - if (this.input == null) - return false; - for (StructureMapGroupInputComponent item : this.input) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #input} (A name assigned to an instance of data. The instance must be provided when the mapping is invoked.) - */ - // syntactic sugar - public StructureMapGroupInputComponent addInput() { //3 - StructureMapGroupInputComponent t = new StructureMapGroupInputComponent(); - if (this.input == null) - this.input = new ArrayList(); - this.input.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupComponent addInput(StructureMapGroupInputComponent t) { //3 - if (t == null) - return this; - if (this.input == null) - this.input = new ArrayList(); - this.input.add(t); - return this; - } - - /** - * @return {@link #rule} (Transform Rule from source to target.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (StructureMapGroupRuleComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (Transform Rule from source to target.) - */ - // syntactic sugar - public StructureMapGroupRuleComponent addRule() { //3 - StructureMapGroupRuleComponent t = new StructureMapGroupRuleComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupComponent addRule(StructureMapGroupRuleComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "id", "Descriptive name for a user.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("extends", "id", "Another group that this group adds rules to.", 0, java.lang.Integer.MAX_VALUE, extends_)); - childrenList.add(new Property("documentation", "string", "Documentation for this group.", 0, java.lang.Integer.MAX_VALUE, documentation)); - childrenList.add(new Property("input", "", "A name assigned to an instance of data. The instance must be provided when the mapping is invoked.", 0, java.lang.Integer.MAX_VALUE, input)); - childrenList.add(new Property("rule", "", "Transform Rule from source to target.", 0, java.lang.Integer.MAX_VALUE, rule)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType - case -1305664359: /*extends*/ return this.extends_ == null ? new Base[0] : new Base[] {this.extends_}; // IdType - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // StructureMapGroupInputComponent - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // StructureMapGroupRuleComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToId(value); // IdType - break; - case -1305664359: // extends - this.extends_ = castToId(value); // IdType - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - case 100358090: // input - this.getInput().add((StructureMapGroupInputComponent) value); // StructureMapGroupInputComponent - break; - case 3512060: // rule - this.getRule().add((StructureMapGroupRuleComponent) value); // StructureMapGroupRuleComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToId(value); // IdType - else if (name.equals("extends")) - this.extends_ = castToId(value); // IdType - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else if (name.equals("input")) - this.getInput().add((StructureMapGroupInputComponent) value); - else if (name.equals("rule")) - this.getRule().add((StructureMapGroupRuleComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType - case -1305664359: throw new FHIRException("Cannot make property extends as it is not a complex type"); // IdType - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - case 100358090: return addInput(); // StructureMapGroupInputComponent - case 3512060: return addRule(); // StructureMapGroupRuleComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); - } - else if (name.equals("extends")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.extends"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); - } - else if (name.equals("input")) { - return addInput(); - } - else if (name.equals("rule")) { - return addRule(); - } - else - return super.addChild(name); - } - - public StructureMapGroupComponent copy() { - StructureMapGroupComponent dst = new StructureMapGroupComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.extends_ = extends_ == null ? null : extends_.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - if (input != null) { - dst.input = new ArrayList(); - for (StructureMapGroupInputComponent i : input) - dst.input.add(i.copy()); - }; - if (rule != null) { - dst.rule = new ArrayList(); - for (StructureMapGroupRuleComponent i : rule) - dst.rule.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupComponent)) - return false; - StructureMapGroupComponent o = (StructureMapGroupComponent) other; - return compareDeep(name, o.name, true) && compareDeep(extends_, o.extends_, true) && compareDeep(documentation, o.documentation, true) - && compareDeep(input, o.input, true) && compareDeep(rule, o.rule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupComponent)) - return false; - StructureMapGroupComponent o = (StructureMapGroupComponent) other; - return compareValues(name, o.name, true) && compareValues(extends_, o.extends_, true) && compareValues(documentation, o.documentation, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (extends_ == null || extends_.isEmpty()) - && (documentation == null || documentation.isEmpty()) && (input == null || input.isEmpty()) - && (rule == null || rule.isEmpty()); - } - - public String fhirType() { - return "StructureMap.group"; - - } - - } - - @Block() - public static class StructureMapGroupInputComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name for this instance of data. - */ - @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name for this instance of data", formalDefinition="Name for this instance of data." ) - protected IdType name; - - /** - * Type for this instance of data. - */ - @Child(name = "type", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type for this instance of data", formalDefinition="Type for this instance of data." ) - protected StringType type; - - /** - * Mode for this instance of data. - */ - @Child(name = "mode", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="source | target", formalDefinition="Mode for this instance of data." ) - protected Enumeration mode; - - /** - * Documentation for this instance of data. - */ - @Child(name = "documentation", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Documentation for this instance of data", formalDefinition="Documentation for this instance of data." ) - protected StringType documentation; - - private static final long serialVersionUID = -25050724L; - - /** - * Constructor - */ - public StructureMapGroupInputComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupInputComponent(IdType name, Enumeration mode) { - super(); - this.name = name; - this.mode = mode; - } - - /** - * @return {@link #name} (Name for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public IdType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupInputComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new IdType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureMapGroupInputComponent setNameElement(IdType value) { - this.name = value; - return this; - } - - /** - * @return Name for this instance of data. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name for this instance of data. - */ - public StructureMapGroupInputComponent setName(String value) { - if (this.name == null) - this.name = new IdType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #type} (Type for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StringType getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupInputComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new StringType(); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Type for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public StructureMapGroupInputComponent setTypeElement(StringType value) { - this.type = value; - return this; - } - - /** - * @return Type for this instance of data. - */ - public String getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value Type for this instance of data. - */ - public StructureMapGroupInputComponent setType(String value) { - if (Utilities.noString(value)) - this.type = null; - else { - if (this.type == null) - this.type = new StringType(); - this.type.setValue(value); - } - return this; - } - - /** - * @return {@link #mode} (Mode for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public Enumeration getModeElement() { - if (this.mode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupInputComponent.mode"); - else if (Configuration.doAutoCreate()) - this.mode = new Enumeration(new StructureMapInputModeEnumFactory()); // bb - return this.mode; - } - - public boolean hasModeElement() { - return this.mode != null && !this.mode.isEmpty(); - } - - public boolean hasMode() { - return this.mode != null && !this.mode.isEmpty(); - } - - /** - * @param value {@link #mode} (Mode for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getMode" gives direct access to the value - */ - public StructureMapGroupInputComponent setModeElement(Enumeration value) { - this.mode = value; - return this; - } - - /** - * @return Mode for this instance of data. - */ - public StructureMapInputMode getMode() { - return this.mode == null ? null : this.mode.getValue(); - } - - /** - * @param value Mode for this instance of data. - */ - public StructureMapGroupInputComponent setMode(StructureMapInputMode value) { - if (this.mode == null) - this.mode = new Enumeration(new StructureMapInputModeEnumFactory()); - this.mode.setValue(value); - return this; - } - - /** - * @return {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupInputComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StructureMapGroupInputComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation for this instance of data. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation for this instance of data. - */ - public StructureMapGroupInputComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "id", "Name for this instance of data.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("type", "string", "Type for this instance of data.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("mode", "code", "Mode for this instance of data.", 0, java.lang.Integer.MAX_VALUE, mode)); - childrenList.add(new Property("documentation", "string", "Documentation for this instance of data.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType - case 3357091: /*mode*/ return this.mode == null ? new Base[0] : new Base[] {this.mode}; // Enumeration - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToId(value); // IdType - break; - case 3575610: // type - this.type = castToString(value); // StringType - break; - case 3357091: // mode - this.mode = new StructureMapInputModeEnumFactory().fromType(value); // Enumeration - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToId(value); // IdType - else if (name.equals("type")) - this.type = castToString(value); // StringType - else if (name.equals("mode")) - this.mode = new StructureMapInputModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // StringType - case 3357091: throw new FHIRException("Cannot make property mode as it is not a complex type"); // Enumeration - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); - } - else if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.type"); - } - else if (name.equals("mode")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.mode"); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); - } - else - return super.addChild(name); - } - - public StructureMapGroupInputComponent copy() { - StructureMapGroupInputComponent dst = new StructureMapGroupInputComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.type = type == null ? null : type.copy(); - dst.mode = mode == null ? null : mode.copy(); - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupInputComponent)) - return false; - StructureMapGroupInputComponent o = (StructureMapGroupInputComponent) other; - return compareDeep(name, o.name, true) && compareDeep(type, o.type, true) && compareDeep(mode, o.mode, true) - && compareDeep(documentation, o.documentation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupInputComponent)) - return false; - StructureMapGroupInputComponent o = (StructureMapGroupInputComponent) other; - return compareValues(name, o.name, true) && compareValues(type, o.type, true) && compareValues(mode, o.mode, true) - && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (type == null || type.isEmpty()) - && (mode == null || mode.isEmpty()) && (documentation == null || documentation.isEmpty()) - ; - } - - public String fhirType() { - return "StructureMap.group.input"; - - } - - } - - @Block() - public static class StructureMapGroupRuleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name of the rule for internal references. - */ - @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the rule for internal references", formalDefinition="Name of the rule for internal references." ) - protected IdType name; - - /** - * Source inputs to the mapping. - */ - @Child(name = "source", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Source inputs to the mapping", formalDefinition="Source inputs to the mapping." ) - protected List source; - - /** - * Content to create because of this mapping rule. - */ - @Child(name = "target", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content to create because of this mapping rule", formalDefinition="Content to create because of this mapping rule." ) - protected List target; - - /** - * Rules contained in this rule. - */ - @Child(name = "rule", type = {StructureMapGroupRuleComponent.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Rules contained in this rule", formalDefinition="Rules contained in this rule." ) - protected List rule; - - /** - * Which other rules to apply in the context of this rule. - */ - @Child(name = "dependent", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Which other rules to apply in the context of this rule", formalDefinition="Which other rules to apply in the context of this rule." ) - protected List dependent; - - /** - * Documentation for this instance of data. - */ - @Child(name = "documentation", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Documentation for this instance of data", formalDefinition="Documentation for this instance of data." ) - protected StringType documentation; - - private static final long serialVersionUID = 773925517L; - - /** - * Constructor - */ - public StructureMapGroupRuleComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupRuleComponent(IdType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Name of the rule for internal references.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public IdType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new IdType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name of the rule for internal references.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureMapGroupRuleComponent setNameElement(IdType value) { - this.name = value; - return this; - } - - /** - * @return Name of the rule for internal references. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name of the rule for internal references. - */ - public StructureMapGroupRuleComponent setName(String value) { - if (this.name == null) - this.name = new IdType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #source} (Source inputs to the mapping.) - */ - public List getSource() { - if (this.source == null) - this.source = new ArrayList(); - return this.source; - } - - public boolean hasSource() { - if (this.source == null) - return false; - for (StructureMapGroupRuleSourceComponent item : this.source) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #source} (Source inputs to the mapping.) - */ - // syntactic sugar - public StructureMapGroupRuleSourceComponent addSource() { //3 - StructureMapGroupRuleSourceComponent t = new StructureMapGroupRuleSourceComponent(); - if (this.source == null) - this.source = new ArrayList(); - this.source.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupRuleComponent addSource(StructureMapGroupRuleSourceComponent t) { //3 - if (t == null) - return this; - if (this.source == null) - this.source = new ArrayList(); - this.source.add(t); - return this; - } - - /** - * @return {@link #target} (Content to create because of this mapping rule.) - */ - public List getTarget() { - if (this.target == null) - this.target = new ArrayList(); - return this.target; - } - - public boolean hasTarget() { - if (this.target == null) - return false; - for (StructureMapGroupRuleTargetComponent item : this.target) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #target} (Content to create because of this mapping rule.) - */ - // syntactic sugar - public StructureMapGroupRuleTargetComponent addTarget() { //3 - StructureMapGroupRuleTargetComponent t = new StructureMapGroupRuleTargetComponent(); - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupRuleComponent addTarget(StructureMapGroupRuleTargetComponent t) { //3 - if (t == null) - return this; - if (this.target == null) - this.target = new ArrayList(); - this.target.add(t); - return this; - } - - /** - * @return {@link #rule} (Rules contained in this rule.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (StructureMapGroupRuleComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (Rules contained in this rule.) - */ - // syntactic sugar - public StructureMapGroupRuleComponent addRule() { //3 - StructureMapGroupRuleComponent t = new StructureMapGroupRuleComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupRuleComponent addRule(StructureMapGroupRuleComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - /** - * @return {@link #dependent} (Which other rules to apply in the context of this rule.) - */ - public List getDependent() { - if (this.dependent == null) - this.dependent = new ArrayList(); - return this.dependent; - } - - public boolean hasDependent() { - if (this.dependent == null) - return false; - for (StructureMapGroupRuleDependentComponent item : this.dependent) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dependent} (Which other rules to apply in the context of this rule.) - */ - // syntactic sugar - public StructureMapGroupRuleDependentComponent addDependent() { //3 - StructureMapGroupRuleDependentComponent t = new StructureMapGroupRuleDependentComponent(); - if (this.dependent == null) - this.dependent = new ArrayList(); - this.dependent.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupRuleComponent addDependent(StructureMapGroupRuleDependentComponent t) { //3 - if (t == null) - return this; - if (this.dependent == null) - this.dependent = new ArrayList(); - this.dependent.add(t); - return this; - } - - /** - * @return {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StringType getDocumentationElement() { - if (this.documentation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleComponent.documentation"); - else if (Configuration.doAutoCreate()) - this.documentation = new StringType(); // bb - return this.documentation; - } - - public boolean hasDocumentationElement() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - public boolean hasDocumentation() { - return this.documentation != null && !this.documentation.isEmpty(); - } - - /** - * @param value {@link #documentation} (Documentation for this instance of data.). This is the underlying object with id, value and extensions. The accessor "getDocumentation" gives direct access to the value - */ - public StructureMapGroupRuleComponent setDocumentationElement(StringType value) { - this.documentation = value; - return this; - } - - /** - * @return Documentation for this instance of data. - */ - public String getDocumentation() { - return this.documentation == null ? null : this.documentation.getValue(); - } - - /** - * @param value Documentation for this instance of data. - */ - public StructureMapGroupRuleComponent setDocumentation(String value) { - if (Utilities.noString(value)) - this.documentation = null; - else { - if (this.documentation == null) - this.documentation = new StringType(); - this.documentation.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "id", "Name of the rule for internal references.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("source", "", "Source inputs to the mapping.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("target", "", "Content to create because of this mapping rule.", 0, java.lang.Integer.MAX_VALUE, target)); - childrenList.add(new Property("rule", "@StructureMap.group.rule", "Rules contained in this rule.", 0, java.lang.Integer.MAX_VALUE, rule)); - childrenList.add(new Property("dependent", "", "Which other rules to apply in the context of this rule.", 0, java.lang.Integer.MAX_VALUE, dependent)); - childrenList.add(new Property("documentation", "string", "Documentation for this instance of data.", 0, java.lang.Integer.MAX_VALUE, documentation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType - case -896505829: /*source*/ return this.source == null ? new Base[0] : this.source.toArray(new Base[this.source.size()]); // StructureMapGroupRuleSourceComponent - case -880905839: /*target*/ return this.target == null ? new Base[0] : this.target.toArray(new Base[this.target.size()]); // StructureMapGroupRuleTargetComponent - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // StructureMapGroupRuleComponent - case -1109226753: /*dependent*/ return this.dependent == null ? new Base[0] : this.dependent.toArray(new Base[this.dependent.size()]); // StructureMapGroupRuleDependentComponent - case 1587405498: /*documentation*/ return this.documentation == null ? new Base[0] : new Base[] {this.documentation}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToId(value); // IdType - break; - case -896505829: // source - this.getSource().add((StructureMapGroupRuleSourceComponent) value); // StructureMapGroupRuleSourceComponent - break; - case -880905839: // target - this.getTarget().add((StructureMapGroupRuleTargetComponent) value); // StructureMapGroupRuleTargetComponent - break; - case 3512060: // rule - this.getRule().add((StructureMapGroupRuleComponent) value); // StructureMapGroupRuleComponent - break; - case -1109226753: // dependent - this.getDependent().add((StructureMapGroupRuleDependentComponent) value); // StructureMapGroupRuleDependentComponent - break; - case 1587405498: // documentation - this.documentation = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToId(value); // IdType - else if (name.equals("source")) - this.getSource().add((StructureMapGroupRuleSourceComponent) value); - else if (name.equals("target")) - this.getTarget().add((StructureMapGroupRuleTargetComponent) value); - else if (name.equals("rule")) - this.getRule().add((StructureMapGroupRuleComponent) value); - else if (name.equals("dependent")) - this.getDependent().add((StructureMapGroupRuleDependentComponent) value); - else if (name.equals("documentation")) - this.documentation = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType - case -896505829: return addSource(); // StructureMapGroupRuleSourceComponent - case -880905839: return addTarget(); // StructureMapGroupRuleTargetComponent - case 3512060: return addRule(); // StructureMapGroupRuleComponent - case -1109226753: return addDependent(); // StructureMapGroupRuleDependentComponent - case 1587405498: throw new FHIRException("Cannot make property documentation as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); - } - else if (name.equals("source")) { - return addSource(); - } - else if (name.equals("target")) { - return addTarget(); - } - else if (name.equals("rule")) { - return addRule(); - } - else if (name.equals("dependent")) { - return addDependent(); - } - else if (name.equals("documentation")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.documentation"); - } - else - return super.addChild(name); - } - - public StructureMapGroupRuleComponent copy() { - StructureMapGroupRuleComponent dst = new StructureMapGroupRuleComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (source != null) { - dst.source = new ArrayList(); - for (StructureMapGroupRuleSourceComponent i : source) - dst.source.add(i.copy()); - }; - if (target != null) { - dst.target = new ArrayList(); - for (StructureMapGroupRuleTargetComponent i : target) - dst.target.add(i.copy()); - }; - if (rule != null) { - dst.rule = new ArrayList(); - for (StructureMapGroupRuleComponent i : rule) - dst.rule.add(i.copy()); - }; - if (dependent != null) { - dst.dependent = new ArrayList(); - for (StructureMapGroupRuleDependentComponent i : dependent) - dst.dependent.add(i.copy()); - }; - dst.documentation = documentation == null ? null : documentation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupRuleComponent)) - return false; - StructureMapGroupRuleComponent o = (StructureMapGroupRuleComponent) other; - return compareDeep(name, o.name, true) && compareDeep(source, o.source, true) && compareDeep(target, o.target, true) - && compareDeep(rule, o.rule, true) && compareDeep(dependent, o.dependent, true) && compareDeep(documentation, o.documentation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupRuleComponent)) - return false; - StructureMapGroupRuleComponent o = (StructureMapGroupRuleComponent) other; - return compareValues(name, o.name, true) && compareValues(documentation, o.documentation, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (source == null || source.isEmpty()) - && (target == null || target.isEmpty()) && (rule == null || rule.isEmpty()) && (dependent == null || dependent.isEmpty()) - && (documentation == null || documentation.isEmpty()); - } - - public String fhirType() { - return "StructureMap.group.rule"; - - } - - } - - @Block() - public static class StructureMapGroupRuleSourceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Whether this rule applies if the source isn't found. - */ - @Child(name = "required", type = {BooleanType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether this rule applies if the source isn't found", formalDefinition="Whether this rule applies if the source isn't found." ) - protected BooleanType required; - - /** - * Type or variable this rule applies to. - */ - @Child(name = "context", type = {IdType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type or variable this rule applies to", formalDefinition="Type or variable this rule applies to." ) - protected IdType context; - - /** - * How to interpret the context. - */ - @Child(name = "contextType", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="type | variable", formalDefinition="How to interpret the context." ) - protected Enumeration contextType; - - /** - * Optional field for this source. - */ - @Child(name = "element", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Optional field for this source", formalDefinition="Optional field for this source." ) - protected StringType element; - - /** - * How to handle the list mode for this element. - */ - @Child(name = "listMode", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="first | share | last", formalDefinition="How to handle the list mode for this element." ) - protected Enumeration listMode; - - /** - * Named context for field, if a field is specified. - */ - @Child(name = "variable", type = {IdType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Named context for field, if a field is specified", formalDefinition="Named context for field, if a field is specified." ) - protected IdType variable; - - /** - * FluentPath expression - must be true or the rule does not apply. - */ - @Child(name = "condition", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FluentPath expression - must be true or the rule does not apply", formalDefinition="FluentPath expression - must be true or the rule does not apply." ) - protected StringType condition; - - /** - * FluentPath expression - must be true or the mapping engine throws an error instead of completing. - */ - @Child(name = "check", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="FluentPath expression - must be true or the mapping engine throws an error instead of completing", formalDefinition="FluentPath expression - must be true or the mapping engine throws an error instead of completing." ) - protected StringType check; - - private static final long serialVersionUID = -1039728628L; - - /** - * Constructor - */ - public StructureMapGroupRuleSourceComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupRuleSourceComponent(BooleanType required, IdType context, Enumeration contextType) { - super(); - this.required = required; - this.context = context; - this.contextType = contextType; - } - - /** - * @return {@link #required} (Whether this rule applies if the source isn't found.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (Whether this rule applies if the source isn't found.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return Whether this rule applies if the source isn't found. - */ - public boolean getRequired() { - return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); - } - - /** - * @param value Whether this rule applies if the source isn't found. - */ - public StructureMapGroupRuleSourceComponent setRequired(boolean value) { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - return this; - } - - /** - * @return {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value - */ - public IdType getContextElement() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.context"); - else if (Configuration.doAutoCreate()) - this.context = new IdType(); // bb - return this.context; - } - - public boolean hasContextElement() { - return this.context != null && !this.context.isEmpty(); - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setContextElement(IdType value) { - this.context = value; - return this; - } - - /** - * @return Type or variable this rule applies to. - */ - public String getContext() { - return this.context == null ? null : this.context.getValue(); - } - - /** - * @param value Type or variable this rule applies to. - */ - public StructureMapGroupRuleSourceComponent setContext(String value) { - if (this.context == null) - this.context = new IdType(); - this.context.setValue(value); - return this; - } - - /** - * @return {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public Enumeration getContextTypeElement() { - if (this.contextType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.contextType"); - else if (Configuration.doAutoCreate()) - this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); // bb - return this.contextType; - } - - public boolean hasContextTypeElement() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - public boolean hasContextType() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - /** - * @param value {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setContextTypeElement(Enumeration value) { - this.contextType = value; - return this; - } - - /** - * @return How to interpret the context. - */ - public StructureMapContextType getContextType() { - return this.contextType == null ? null : this.contextType.getValue(); - } - - /** - * @param value How to interpret the context. - */ - public StructureMapGroupRuleSourceComponent setContextType(StructureMapContextType value) { - if (this.contextType == null) - this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); - this.contextType.setValue(value); - return this; - } - - /** - * @return {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public StringType getElementElement() { - if (this.element == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.element"); - else if (Configuration.doAutoCreate()) - this.element = new StringType(); // bb - return this.element; - } - - public boolean hasElementElement() { - return this.element != null && !this.element.isEmpty(); - } - - public boolean hasElement() { - return this.element != null && !this.element.isEmpty(); - } - - /** - * @param value {@link #element} (Optional field for this source.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setElementElement(StringType value) { - this.element = value; - return this; - } - - /** - * @return Optional field for this source. - */ - public String getElement() { - return this.element == null ? null : this.element.getValue(); - } - - /** - * @param value Optional field for this source. - */ - public StructureMapGroupRuleSourceComponent setElement(String value) { - if (Utilities.noString(value)) - this.element = null; - else { - if (this.element == null) - this.element = new StringType(); - this.element.setValue(value); - } - return this; - } - - /** - * @return {@link #listMode} (How to handle the list mode for this element.). This is the underlying object with id, value and extensions. The accessor "getListMode" gives direct access to the value - */ - public Enumeration getListModeElement() { - if (this.listMode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.listMode"); - else if (Configuration.doAutoCreate()) - this.listMode = new Enumeration(new StructureMapListModeEnumFactory()); // bb - return this.listMode; - } - - public boolean hasListModeElement() { - return this.listMode != null && !this.listMode.isEmpty(); - } - - public boolean hasListMode() { - return this.listMode != null && !this.listMode.isEmpty(); - } - - /** - * @param value {@link #listMode} (How to handle the list mode for this element.). This is the underlying object with id, value and extensions. The accessor "getListMode" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setListModeElement(Enumeration value) { - this.listMode = value; - return this; - } - - /** - * @return How to handle the list mode for this element. - */ - public StructureMapListMode getListMode() { - return this.listMode == null ? null : this.listMode.getValue(); - } - - /** - * @param value How to handle the list mode for this element. - */ - public StructureMapGroupRuleSourceComponent setListMode(StructureMapListMode value) { - if (value == null) - this.listMode = null; - else { - if (this.listMode == null) - this.listMode = new Enumeration(new StructureMapListModeEnumFactory()); - this.listMode.setValue(value); - } - return this; - } - - /** - * @return {@link #variable} (Named context for field, if a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value - */ - public IdType getVariableElement() { - if (this.variable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.variable"); - else if (Configuration.doAutoCreate()) - this.variable = new IdType(); // bb - return this.variable; - } - - public boolean hasVariableElement() { - return this.variable != null && !this.variable.isEmpty(); - } - - public boolean hasVariable() { - return this.variable != null && !this.variable.isEmpty(); - } - - /** - * @param value {@link #variable} (Named context for field, if a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setVariableElement(IdType value) { - this.variable = value; - return this; - } - - /** - * @return Named context for field, if a field is specified. - */ - public String getVariable() { - return this.variable == null ? null : this.variable.getValue(); - } - - /** - * @param value Named context for field, if a field is specified. - */ - public StructureMapGroupRuleSourceComponent setVariable(String value) { - if (Utilities.noString(value)) - this.variable = null; - else { - if (this.variable == null) - this.variable = new IdType(); - this.variable.setValue(value); - } - return this; - } - - /** - * @return {@link #condition} (FluentPath expression - must be true or the rule does not apply.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value - */ - public StringType getConditionElement() { - if (this.condition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.condition"); - else if (Configuration.doAutoCreate()) - this.condition = new StringType(); // bb - return this.condition; - } - - public boolean hasConditionElement() { - return this.condition != null && !this.condition.isEmpty(); - } - - public boolean hasCondition() { - return this.condition != null && !this.condition.isEmpty(); - } - - /** - * @param value {@link #condition} (FluentPath expression - must be true or the rule does not apply.). This is the underlying object with id, value and extensions. The accessor "getCondition" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setConditionElement(StringType value) { - this.condition = value; - return this; - } - - /** - * @return FluentPath expression - must be true or the rule does not apply. - */ - public String getCondition() { - return this.condition == null ? null : this.condition.getValue(); - } - - /** - * @param value FluentPath expression - must be true or the rule does not apply. - */ - public StructureMapGroupRuleSourceComponent setCondition(String value) { - if (Utilities.noString(value)) - this.condition = null; - else { - if (this.condition == null) - this.condition = new StringType(); - this.condition.setValue(value); - } - return this; - } - - /** - * @return {@link #check} (FluentPath expression - must be true or the mapping engine throws an error instead of completing.). This is the underlying object with id, value and extensions. The accessor "getCheck" gives direct access to the value - */ - public StringType getCheckElement() { - if (this.check == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleSourceComponent.check"); - else if (Configuration.doAutoCreate()) - this.check = new StringType(); // bb - return this.check; - } - - public boolean hasCheckElement() { - return this.check != null && !this.check.isEmpty(); - } - - public boolean hasCheck() { - return this.check != null && !this.check.isEmpty(); - } - - /** - * @param value {@link #check} (FluentPath expression - must be true or the mapping engine throws an error instead of completing.). This is the underlying object with id, value and extensions. The accessor "getCheck" gives direct access to the value - */ - public StructureMapGroupRuleSourceComponent setCheckElement(StringType value) { - this.check = value; - return this; - } - - /** - * @return FluentPath expression - must be true or the mapping engine throws an error instead of completing. - */ - public String getCheck() { - return this.check == null ? null : this.check.getValue(); - } - - /** - * @param value FluentPath expression - must be true or the mapping engine throws an error instead of completing. - */ - public StructureMapGroupRuleSourceComponent setCheck(String value) { - if (Utilities.noString(value)) - this.check = null; - else { - if (this.check == null) - this.check = new StringType(); - this.check.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("required", "boolean", "Whether this rule applies if the source isn't found.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("context", "id", "Type or variable this rule applies to.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("contextType", "code", "How to interpret the context.", 0, java.lang.Integer.MAX_VALUE, contextType)); - childrenList.add(new Property("element", "string", "Optional field for this source.", 0, java.lang.Integer.MAX_VALUE, element)); - childrenList.add(new Property("listMode", "code", "How to handle the list mode for this element.", 0, java.lang.Integer.MAX_VALUE, listMode)); - childrenList.add(new Property("variable", "id", "Named context for field, if a field is specified.", 0, java.lang.Integer.MAX_VALUE, variable)); - childrenList.add(new Property("condition", "string", "FluentPath expression - must be true or the rule does not apply.", 0, java.lang.Integer.MAX_VALUE, condition)); - childrenList.add(new Property("check", "string", "FluentPath expression - must be true or the mapping engine throws an error instead of completing.", 0, java.lang.Integer.MAX_VALUE, check)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType - case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType - case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration - case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType - case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : new Base[] {this.listMode}; // Enumeration - case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType - case -861311717: /*condition*/ return this.condition == null ? new Base[0] : new Base[] {this.condition}; // StringType - case 94627080: /*check*/ return this.check == null ? new Base[0] : new Base[] {this.check}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -393139297: // required - this.required = castToBoolean(value); // BooleanType - break; - case 951530927: // context - this.context = castToId(value); // IdType - break; - case -102839927: // contextType - this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration - break; - case -1662836996: // element - this.element = castToString(value); // StringType - break; - case 1345445729: // listMode - this.listMode = new StructureMapListModeEnumFactory().fromType(value); // Enumeration - break; - case -1249586564: // variable - this.variable = castToId(value); // IdType - break; - case -861311717: // condition - this.condition = castToString(value); // StringType - break; - case 94627080: // check - this.check = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("required")) - this.required = castToBoolean(value); // BooleanType - else if (name.equals("context")) - this.context = castToId(value); // IdType - else if (name.equals("contextType")) - this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("element")) - this.element = castToString(value); // StringType - else if (name.equals("listMode")) - this.listMode = new StructureMapListModeEnumFactory().fromType(value); // Enumeration - else if (name.equals("variable")) - this.variable = castToId(value); // IdType - else if (name.equals("condition")) - this.condition = castToString(value); // StringType - else if (name.equals("check")) - this.check = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType - case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // IdType - case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration - case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // StringType - case 1345445729: throw new FHIRException("Cannot make property listMode as it is not a complex type"); // Enumeration - case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // IdType - case -861311717: throw new FHIRException("Cannot make property condition as it is not a complex type"); // StringType - case 94627080: throw new FHIRException("Cannot make property check as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("required")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.required"); - } - else if (name.equals("context")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.context"); - } - else if (name.equals("contextType")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.contextType"); - } - else if (name.equals("element")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element"); - } - else if (name.equals("listMode")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listMode"); - } - else if (name.equals("variable")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable"); - } - else if (name.equals("condition")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.condition"); - } - else if (name.equals("check")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.check"); - } - else - return super.addChild(name); - } - - public StructureMapGroupRuleSourceComponent copy() { - StructureMapGroupRuleSourceComponent dst = new StructureMapGroupRuleSourceComponent(); - copyValues(dst); - dst.required = required == null ? null : required.copy(); - dst.context = context == null ? null : context.copy(); - dst.contextType = contextType == null ? null : contextType.copy(); - dst.element = element == null ? null : element.copy(); - dst.listMode = listMode == null ? null : listMode.copy(); - dst.variable = variable == null ? null : variable.copy(); - dst.condition = condition == null ? null : condition.copy(); - dst.check = check == null ? null : check.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupRuleSourceComponent)) - return false; - StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other; - return compareDeep(required, o.required, true) && compareDeep(context, o.context, true) && compareDeep(contextType, o.contextType, true) - && compareDeep(element, o.element, true) && compareDeep(listMode, o.listMode, true) && compareDeep(variable, o.variable, true) - && compareDeep(condition, o.condition, true) && compareDeep(check, o.check, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupRuleSourceComponent)) - return false; - StructureMapGroupRuleSourceComponent o = (StructureMapGroupRuleSourceComponent) other; - return compareValues(required, o.required, true) && compareValues(context, o.context, true) && compareValues(contextType, o.contextType, true) - && compareValues(element, o.element, true) && compareValues(listMode, o.listMode, true) && compareValues(variable, o.variable, true) - && compareValues(condition, o.condition, true) && compareValues(check, o.check, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (required == null || required.isEmpty()) && (context == null || context.isEmpty()) - && (contextType == null || contextType.isEmpty()) && (element == null || element.isEmpty()) - && (listMode == null || listMode.isEmpty()) && (variable == null || variable.isEmpty()) && (condition == null || condition.isEmpty()) - && (check == null || check.isEmpty()); - } - - public String fhirType() { - return "StructureMap.group.rule.source"; - - } - - } - - @Block() - public static class StructureMapGroupRuleTargetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Type or variable this rule applies to. - */ - @Child(name = "context", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Type or variable this rule applies to", formalDefinition="Type or variable this rule applies to." ) - protected IdType context; - - /** - * How to interpret the context. - */ - @Child(name = "contextType", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="type | variable", formalDefinition="How to interpret the context." ) - protected Enumeration contextType; - - /** - * Field to create in the context. - */ - @Child(name = "element", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Field to create in the context", formalDefinition="Field to create in the context." ) - protected StringType element; - - /** - * Named context for field, if desired, and a field is specified. - */ - @Child(name = "variable", type = {IdType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Named context for field, if desired, and a field is specified", formalDefinition="Named context for field, if desired, and a field is specified." ) - protected IdType variable; - - /** - * If field is a list, how to manage the list. - */ - @Child(name = "listMode", type = {CodeType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="first | share | last", formalDefinition="If field is a list, how to manage the list." ) - protected List> listMode; - - /** - * Internal rule reference for shared list items. - */ - @Child(name = "listRuleId", type = {IdType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Internal rule reference for shared list items", formalDefinition="Internal rule reference for shared list items." ) - protected IdType listRuleId; - - /** - * How the data is copied / created. - */ - @Child(name = "transform", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="create | copy +", formalDefinition="How the data is copied / created." ) - protected Enumeration transform; - - /** - * Parameters to the transform. - */ - @Child(name = "parameter", type = {}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Parameters to the transform", formalDefinition="Parameters to the transform." ) - protected List parameter; - - private static final long serialVersionUID = 775400884L; - - /** - * Constructor - */ - public StructureMapGroupRuleTargetComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupRuleTargetComponent(IdType context, Enumeration contextType) { - super(); - this.context = context; - this.contextType = contextType; - } - - /** - * @return {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value - */ - public IdType getContextElement() { - if (this.context == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.context"); - else if (Configuration.doAutoCreate()) - this.context = new IdType(); // bb - return this.context; - } - - public boolean hasContextElement() { - return this.context != null && !this.context.isEmpty(); - } - - public boolean hasContext() { - return this.context != null && !this.context.isEmpty(); - } - - /** - * @param value {@link #context} (Type or variable this rule applies to.). This is the underlying object with id, value and extensions. The accessor "getContext" gives direct access to the value - */ - public StructureMapGroupRuleTargetComponent setContextElement(IdType value) { - this.context = value; - return this; - } - - /** - * @return Type or variable this rule applies to. - */ - public String getContext() { - return this.context == null ? null : this.context.getValue(); - } - - /** - * @param value Type or variable this rule applies to. - */ - public StructureMapGroupRuleTargetComponent setContext(String value) { - if (this.context == null) - this.context = new IdType(); - this.context.setValue(value); - return this; - } - - /** - * @return {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public Enumeration getContextTypeElement() { - if (this.contextType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.contextType"); - else if (Configuration.doAutoCreate()) - this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); // bb - return this.contextType; - } - - public boolean hasContextTypeElement() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - public boolean hasContextType() { - return this.contextType != null && !this.contextType.isEmpty(); - } - - /** - * @param value {@link #contextType} (How to interpret the context.). This is the underlying object with id, value and extensions. The accessor "getContextType" gives direct access to the value - */ - public StructureMapGroupRuleTargetComponent setContextTypeElement(Enumeration value) { - this.contextType = value; - return this; - } - - /** - * @return How to interpret the context. - */ - public StructureMapContextType getContextType() { - return this.contextType == null ? null : this.contextType.getValue(); - } - - /** - * @param value How to interpret the context. - */ - public StructureMapGroupRuleTargetComponent setContextType(StructureMapContextType value) { - if (this.contextType == null) - this.contextType = new Enumeration(new StructureMapContextTypeEnumFactory()); - this.contextType.setValue(value); - return this; - } - - /** - * @return {@link #element} (Field to create in the context.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public StringType getElementElement() { - if (this.element == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.element"); - else if (Configuration.doAutoCreate()) - this.element = new StringType(); // bb - return this.element; - } - - public boolean hasElementElement() { - return this.element != null && !this.element.isEmpty(); - } - - public boolean hasElement() { - return this.element != null && !this.element.isEmpty(); - } - - /** - * @param value {@link #element} (Field to create in the context.). This is the underlying object with id, value and extensions. The accessor "getElement" gives direct access to the value - */ - public StructureMapGroupRuleTargetComponent setElementElement(StringType value) { - this.element = value; - return this; - } - - /** - * @return Field to create in the context. - */ - public String getElement() { - return this.element == null ? null : this.element.getValue(); - } - - /** - * @param value Field to create in the context. - */ - public StructureMapGroupRuleTargetComponent setElement(String value) { - if (Utilities.noString(value)) - this.element = null; - else { - if (this.element == null) - this.element = new StringType(); - this.element.setValue(value); - } - return this; - } - - /** - * @return {@link #variable} (Named context for field, if desired, and a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value - */ - public IdType getVariableElement() { - if (this.variable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.variable"); - else if (Configuration.doAutoCreate()) - this.variable = new IdType(); // bb - return this.variable; - } - - public boolean hasVariableElement() { - return this.variable != null && !this.variable.isEmpty(); - } - - public boolean hasVariable() { - return this.variable != null && !this.variable.isEmpty(); - } - - /** - * @param value {@link #variable} (Named context for field, if desired, and a field is specified.). This is the underlying object with id, value and extensions. The accessor "getVariable" gives direct access to the value - */ - public StructureMapGroupRuleTargetComponent setVariableElement(IdType value) { - this.variable = value; - return this; - } - - /** - * @return Named context for field, if desired, and a field is specified. - */ - public String getVariable() { - return this.variable == null ? null : this.variable.getValue(); - } - - /** - * @param value Named context for field, if desired, and a field is specified. - */ - public StructureMapGroupRuleTargetComponent setVariable(String value) { - if (Utilities.noString(value)) - this.variable = null; - else { - if (this.variable == null) - this.variable = new IdType(); - this.variable.setValue(value); - } - return this; - } - - /** - * @return {@link #listMode} (If field is a list, how to manage the list.) - */ - public List> getListMode() { - if (this.listMode == null) - this.listMode = new ArrayList>(); - return this.listMode; - } - - public boolean hasListMode() { - if (this.listMode == null) - return false; - for (Enumeration item : this.listMode) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #listMode} (If field is a list, how to manage the list.) - */ - // syntactic sugar - public Enumeration addListModeElement() {//2 - Enumeration t = new Enumeration(new StructureMapListModeEnumFactory()); - if (this.listMode == null) - this.listMode = new ArrayList>(); - this.listMode.add(t); - return t; - } - - /** - * @param value {@link #listMode} (If field is a list, how to manage the list.) - */ - public StructureMapGroupRuleTargetComponent addListMode(StructureMapListMode value) { //1 - Enumeration t = new Enumeration(new StructureMapListModeEnumFactory()); - t.setValue(value); - if (this.listMode == null) - this.listMode = new ArrayList>(); - this.listMode.add(t); - return this; - } - - /** - * @param value {@link #listMode} (If field is a list, how to manage the list.) - */ - public boolean hasListMode(StructureMapListMode value) { - if (this.listMode == null) - return false; - for (Enumeration v : this.listMode) - if (v.getValue().equals(value)) // code - return true; - return false; - } - - /** - * @return {@link #listRuleId} (Internal rule reference for shared list items.). This is the underlying object with id, value and extensions. The accessor "getListRuleId" gives direct access to the value - */ - public IdType getListRuleIdElement() { - if (this.listRuleId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.listRuleId"); - else if (Configuration.doAutoCreate()) - this.listRuleId = new IdType(); // bb - return this.listRuleId; - } - - public boolean hasListRuleIdElement() { - return this.listRuleId != null && !this.listRuleId.isEmpty(); - } - - public boolean hasListRuleId() { - return this.listRuleId != null && !this.listRuleId.isEmpty(); - } - - /** - * @param value {@link #listRuleId} (Internal rule reference for shared list items.). This is the underlying object with id, value and extensions. The accessor "getListRuleId" gives direct access to the value - */ - public StructureMapGroupRuleTargetComponent setListRuleIdElement(IdType value) { - this.listRuleId = value; - return this; - } - - /** - * @return Internal rule reference for shared list items. - */ - public String getListRuleId() { - return this.listRuleId == null ? null : this.listRuleId.getValue(); - } - - /** - * @param value Internal rule reference for shared list items. - */ - public StructureMapGroupRuleTargetComponent setListRuleId(String value) { - if (Utilities.noString(value)) - this.listRuleId = null; - else { - if (this.listRuleId == null) - this.listRuleId = new IdType(); - this.listRuleId.setValue(value); - } - return this; - } - - /** - * @return {@link #transform} (How the data is copied / created.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value - */ - public Enumeration getTransformElement() { - if (this.transform == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleTargetComponent.transform"); - else if (Configuration.doAutoCreate()) - this.transform = new Enumeration(new StructureMapTransformEnumFactory()); // bb - return this.transform; - } - - public boolean hasTransformElement() { - return this.transform != null && !this.transform.isEmpty(); - } - - public boolean hasTransform() { - return this.transform != null && !this.transform.isEmpty(); - } - - /** - * @param value {@link #transform} (How the data is copied / created.). This is the underlying object with id, value and extensions. The accessor "getTransform" gives direct access to the value - */ - public StructureMapGroupRuleTargetComponent setTransformElement(Enumeration value) { - this.transform = value; - return this; - } - - /** - * @return How the data is copied / created. - */ - public StructureMapTransform getTransform() { - return this.transform == null ? null : this.transform.getValue(); - } - - /** - * @param value How the data is copied / created. - */ - public StructureMapGroupRuleTargetComponent setTransform(StructureMapTransform value) { - if (value == null) - this.transform = null; - else { - if (this.transform == null) - this.transform = new Enumeration(new StructureMapTransformEnumFactory()); - this.transform.setValue(value); - } - return this; - } - - /** - * @return {@link #parameter} (Parameters to the transform.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (StructureMapGroupRuleTargetParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (Parameters to the transform.) - */ - // syntactic sugar - public StructureMapGroupRuleTargetParameterComponent addParameter() { //3 - StructureMapGroupRuleTargetParameterComponent t = new StructureMapGroupRuleTargetParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public StructureMapGroupRuleTargetComponent addParameter(StructureMapGroupRuleTargetParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("context", "id", "Type or variable this rule applies to.", 0, java.lang.Integer.MAX_VALUE, context)); - childrenList.add(new Property("contextType", "code", "How to interpret the context.", 0, java.lang.Integer.MAX_VALUE, contextType)); - childrenList.add(new Property("element", "string", "Field to create in the context.", 0, java.lang.Integer.MAX_VALUE, element)); - childrenList.add(new Property("variable", "id", "Named context for field, if desired, and a field is specified.", 0, java.lang.Integer.MAX_VALUE, variable)); - childrenList.add(new Property("listMode", "code", "If field is a list, how to manage the list.", 0, java.lang.Integer.MAX_VALUE, listMode)); - childrenList.add(new Property("listRuleId", "id", "Internal rule reference for shared list items.", 0, java.lang.Integer.MAX_VALUE, listRuleId)); - childrenList.add(new Property("transform", "code", "How the data is copied / created.", 0, java.lang.Integer.MAX_VALUE, transform)); - childrenList.add(new Property("parameter", "", "Parameters to the transform.", 0, java.lang.Integer.MAX_VALUE, parameter)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 951530927: /*context*/ return this.context == null ? new Base[0] : new Base[] {this.context}; // IdType - case -102839927: /*contextType*/ return this.contextType == null ? new Base[0] : new Base[] {this.contextType}; // Enumeration - case -1662836996: /*element*/ return this.element == null ? new Base[0] : new Base[] {this.element}; // StringType - case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : new Base[] {this.variable}; // IdType - case 1345445729: /*listMode*/ return this.listMode == null ? new Base[0] : this.listMode.toArray(new Base[this.listMode.size()]); // Enumeration - case 337117045: /*listRuleId*/ return this.listRuleId == null ? new Base[0] : new Base[] {this.listRuleId}; // IdType - case 1052666732: /*transform*/ return this.transform == null ? new Base[0] : new Base[] {this.transform}; // Enumeration - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // StructureMapGroupRuleTargetParameterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 951530927: // context - this.context = castToId(value); // IdType - break; - case -102839927: // contextType - this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration - break; - case -1662836996: // element - this.element = castToString(value); // StringType - break; - case -1249586564: // variable - this.variable = castToId(value); // IdType - break; - case 1345445729: // listMode - this.getListMode().add(new StructureMapListModeEnumFactory().fromType(value)); // Enumeration - break; - case 337117045: // listRuleId - this.listRuleId = castToId(value); // IdType - break; - case 1052666732: // transform - this.transform = new StructureMapTransformEnumFactory().fromType(value); // Enumeration - break; - case 1954460585: // parameter - this.getParameter().add((StructureMapGroupRuleTargetParameterComponent) value); // StructureMapGroupRuleTargetParameterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("context")) - this.context = castToId(value); // IdType - else if (name.equals("contextType")) - this.contextType = new StructureMapContextTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("element")) - this.element = castToString(value); // StringType - else if (name.equals("variable")) - this.variable = castToId(value); // IdType - else if (name.equals("listMode")) - this.getListMode().add(new StructureMapListModeEnumFactory().fromType(value)); - else if (name.equals("listRuleId")) - this.listRuleId = castToId(value); // IdType - else if (name.equals("transform")) - this.transform = new StructureMapTransformEnumFactory().fromType(value); // Enumeration - else if (name.equals("parameter")) - this.getParameter().add((StructureMapGroupRuleTargetParameterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 951530927: throw new FHIRException("Cannot make property context as it is not a complex type"); // IdType - case -102839927: throw new FHIRException("Cannot make property contextType as it is not a complex type"); // Enumeration - case -1662836996: throw new FHIRException("Cannot make property element as it is not a complex type"); // StringType - case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // IdType - case 1345445729: throw new FHIRException("Cannot make property listMode as it is not a complex type"); // Enumeration - case 337117045: throw new FHIRException("Cannot make property listRuleId as it is not a complex type"); // IdType - case 1052666732: throw new FHIRException("Cannot make property transform as it is not a complex type"); // Enumeration - case 1954460585: return addParameter(); // StructureMapGroupRuleTargetParameterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("context")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.context"); - } - else if (name.equals("contextType")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.contextType"); - } - else if (name.equals("element")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.element"); - } - else if (name.equals("variable")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable"); - } - else if (name.equals("listMode")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listMode"); - } - else if (name.equals("listRuleId")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.listRuleId"); - } - else if (name.equals("transform")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.transform"); - } - else if (name.equals("parameter")) { - return addParameter(); - } - else - return super.addChild(name); - } - - public StructureMapGroupRuleTargetComponent copy() { - StructureMapGroupRuleTargetComponent dst = new StructureMapGroupRuleTargetComponent(); - copyValues(dst); - dst.context = context == null ? null : context.copy(); - dst.contextType = contextType == null ? null : contextType.copy(); - dst.element = element == null ? null : element.copy(); - dst.variable = variable == null ? null : variable.copy(); - if (listMode != null) { - dst.listMode = new ArrayList>(); - for (Enumeration i : listMode) - dst.listMode.add(i.copy()); - }; - dst.listRuleId = listRuleId == null ? null : listRuleId.copy(); - dst.transform = transform == null ? null : transform.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (StructureMapGroupRuleTargetParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupRuleTargetComponent)) - return false; - StructureMapGroupRuleTargetComponent o = (StructureMapGroupRuleTargetComponent) other; - return compareDeep(context, o.context, true) && compareDeep(contextType, o.contextType, true) && compareDeep(element, o.element, true) - && compareDeep(variable, o.variable, true) && compareDeep(listMode, o.listMode, true) && compareDeep(listRuleId, o.listRuleId, true) - && compareDeep(transform, o.transform, true) && compareDeep(parameter, o.parameter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupRuleTargetComponent)) - return false; - StructureMapGroupRuleTargetComponent o = (StructureMapGroupRuleTargetComponent) other; - return compareValues(context, o.context, true) && compareValues(contextType, o.contextType, true) && compareValues(element, o.element, true) - && compareValues(variable, o.variable, true) && compareValues(listMode, o.listMode, true) && compareValues(listRuleId, o.listRuleId, true) - && compareValues(transform, o.transform, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (context == null || context.isEmpty()) && (contextType == null || contextType.isEmpty()) - && (element == null || element.isEmpty()) && (variable == null || variable.isEmpty()) && (listMode == null || listMode.isEmpty()) - && (listRuleId == null || listRuleId.isEmpty()) && (transform == null || transform.isEmpty()) - && (parameter == null || parameter.isEmpty()); - } - - public String fhirType() { - return "StructureMap.group.rule.target"; - - } - - } - - @Block() - public static class StructureMapGroupRuleTargetParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Parameter value - variable or literal. - */ - @Child(name = "value", type = {IdType.class, StringType.class, BooleanType.class, IntegerType.class, DecimalType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Parameter value - variable or literal", formalDefinition="Parameter value - variable or literal." ) - protected Type value; - - private static final long serialVersionUID = -732981989L; - - /** - * Constructor - */ - public StructureMapGroupRuleTargetParameterComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupRuleTargetParameterComponent(Type value) { - super(); - this.value = value; - } - - /** - * @return {@link #value} (Parameter value - variable or literal.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (Parameter value - variable or literal.) - */ - public IdType getValueIdType() throws FHIRException { - if (!(this.value instanceof IdType)) - throw new FHIRException("Type mismatch: the type IdType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IdType) this.value; - } - - public boolean hasValueIdType() { - return this.value instanceof IdType; - } - - /** - * @return {@link #value} (Parameter value - variable or literal.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (Parameter value - variable or literal.) - */ - public BooleanType getValueBooleanType() throws FHIRException { - if (!(this.value instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - public boolean hasValueBooleanType() { - return this.value instanceof BooleanType; - } - - /** - * @return {@link #value} (Parameter value - variable or literal.) - */ - public IntegerType getValueIntegerType() throws FHIRException { - if (!(this.value instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - public boolean hasValueIntegerType() { - return this.value instanceof IntegerType; - } - - /** - * @return {@link #value} (Parameter value - variable or literal.) - */ - public DecimalType getValueDecimalType() throws FHIRException { - if (!(this.value instanceof DecimalType)) - throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DecimalType) this.value; - } - - public boolean hasValueDecimalType() { - return this.value instanceof DecimalType; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (Parameter value - variable or literal.) - */ - public StructureMapGroupRuleTargetParameterComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("value[x]", "id|string|boolean|integer|decimal", "Parameter value - variable or literal.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("valueId")) { - this.value = new IdType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else - return super.addChild(name); - } - - public StructureMapGroupRuleTargetParameterComponent copy() { - StructureMapGroupRuleTargetParameterComponent dst = new StructureMapGroupRuleTargetParameterComponent(); - copyValues(dst); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupRuleTargetParameterComponent)) - return false; - StructureMapGroupRuleTargetParameterComponent o = (StructureMapGroupRuleTargetParameterComponent) other; - return compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupRuleTargetParameterComponent)) - return false; - StructureMapGroupRuleTargetParameterComponent o = (StructureMapGroupRuleTargetParameterComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "StructureMap.group.rule.target.parameter"; - - } - - } - - @Block() - public static class StructureMapGroupRuleDependentComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Name of a rule or group to apply. - */ - @Child(name = "name", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of a rule or group to apply", formalDefinition="Name of a rule or group to apply." ) - protected IdType name; - - /** - * Names of variables to pass to the rule or group. - */ - @Child(name = "variable", type = {StringType.class}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Names of variables to pass to the rule or group", formalDefinition="Names of variables to pass to the rule or group." ) - protected List variable; - - private static final long serialVersionUID = 1021661591L; - - /** - * Constructor - */ - public StructureMapGroupRuleDependentComponent() { - super(); - } - - /** - * Constructor - */ - public StructureMapGroupRuleDependentComponent(IdType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Name of a rule or group to apply.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public IdType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMapGroupRuleDependentComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new IdType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Name of a rule or group to apply.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureMapGroupRuleDependentComponent setNameElement(IdType value) { - this.name = value; - return this; - } - - /** - * @return Name of a rule or group to apply. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Name of a rule or group to apply. - */ - public StructureMapGroupRuleDependentComponent setName(String value) { - if (this.name == null) - this.name = new IdType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #variable} (Names of variables to pass to the rule or group.) - */ - public List getVariable() { - if (this.variable == null) - this.variable = new ArrayList(); - return this.variable; - } - - public boolean hasVariable() { - if (this.variable == null) - return false; - for (StringType item : this.variable) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #variable} (Names of variables to pass to the rule or group.) - */ - // syntactic sugar - public StringType addVariableElement() {//2 - StringType t = new StringType(); - if (this.variable == null) - this.variable = new ArrayList(); - this.variable.add(t); - return t; - } - - /** - * @param value {@link #variable} (Names of variables to pass to the rule or group.) - */ - public StructureMapGroupRuleDependentComponent addVariable(String value) { //1 - StringType t = new StringType(); - t.setValue(value); - if (this.variable == null) - this.variable = new ArrayList(); - this.variable.add(t); - return this; - } - - /** - * @param value {@link #variable} (Names of variables to pass to the rule or group.) - */ - public boolean hasVariable(String value) { - if (this.variable == null) - return false; - for (StringType v : this.variable) - if (v.equals(value)) // string - return true; - return false; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "id", "Name of a rule or group to apply.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("variable", "string", "Names of variables to pass to the rule or group.", 0, java.lang.Integer.MAX_VALUE, variable)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // IdType - case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : this.variable.toArray(new Base[this.variable.size()]); // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToId(value); // IdType - break; - case -1249586564: // variable - this.getVariable().add(castToString(value)); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToId(value); // IdType - else if (name.equals("variable")) - this.getVariable().add(castToString(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // IdType - case -1249586564: throw new FHIRException("Cannot make property variable as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); - } - else if (name.equals("variable")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.variable"); - } - else - return super.addChild(name); - } - - public StructureMapGroupRuleDependentComponent copy() { - StructureMapGroupRuleDependentComponent dst = new StructureMapGroupRuleDependentComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (variable != null) { - dst.variable = new ArrayList(); - for (StringType i : variable) - dst.variable.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMapGroupRuleDependentComponent)) - return false; - StructureMapGroupRuleDependentComponent o = (StructureMapGroupRuleDependentComponent) other; - return compareDeep(name, o.name, true) && compareDeep(variable, o.variable, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMapGroupRuleDependentComponent)) - return false; - StructureMapGroupRuleDependentComponent o = (StructureMapGroupRuleDependentComponent) other; - return compareValues(name, o.name, true) && compareValues(variable, o.variable, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (variable == null || variable.isEmpty()) - ; - } - - public String fhirType() { - return "StructureMap.group.rule.dependent"; - - } - - } - - /** - * An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL used to reference this StructureMap", formalDefinition="An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI). - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other identifiers for the StructureMap", formalDefinition="Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI)." ) - protected List identifier; - - /** - * The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id for this version of the StructureMap", formalDefinition="The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually." ) - protected StringType version; - - /** - * A free text natural language name identifying the StructureMap. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this StructureMap", formalDefinition="A free text natural language name identifying the StructureMap." ) - protected StringType name; - - /** - * The status of the StructureMap. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the StructureMap." ) - protected Enumeration status; - - /** - * This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the structure map. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the structure map." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. - */ - @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for this version of the StructureMap", formalDefinition="The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes." ) - protected DateTimeType date; - - /** - * A free text natural language description of the StructureMap and its use. - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Natural language description of the StructureMap", formalDefinition="A free text natural language description of the StructureMap and its use." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps." ) - protected List useContext; - - /** - * Explains why this structure map is needed and why it's been designed as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Scope and Usage this structure map is for", formalDefinition="Explains why this structure map is needed and why it's been designed as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) - protected StringType copyright; - - /** - * A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced. - */ - @Child(name = "structure", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Structure Definition used by this map", formalDefinition="A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced." ) - protected List structure; - - /** - * Other maps used by this map (canonical URLs). - */ - @Child(name = "import", type = {UriType.class}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Other maps used by this map (canonical URLs)", formalDefinition="Other maps used by this map (canonical URLs)." ) - protected List import_; - - /** - * Named sections for reader convenience. - */ - @Child(name = "group", type = {}, order=15, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Named sections for reader convenience", formalDefinition="Named sections for reader convenience." ) - protected List group; - - private static final long serialVersionUID = 710892955L; - - /** - * Constructor - */ - public StructureMap() { - super(); - } - - /** - * Constructor - */ - public StructureMap(UriType url, StringType name, Enumeration status) { - super(); - this.url = url; - this.name = name; - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StructureMap setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published. - */ - public StructureMap setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public StructureMap addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StructureMap setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually. - */ - public StructureMap setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the StructureMap.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the StructureMap.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StructureMap setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the StructureMap. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the StructureMap. - */ - public StructureMap setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the StructureMap.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the StructureMap.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public StructureMap setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the StructureMap. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the StructureMap. - */ - public StructureMap setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public StructureMap setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public StructureMap setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the structure map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the structure map.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StructureMap setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the structure map. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the structure map. - */ - public StructureMap setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (StructureMapContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public StructureMapContactComponent addContact() { //3 - StructureMapContactComponent t = new StructureMapContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public StructureMap addContact(StructureMapContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public StructureMap setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes. - */ - public StructureMap setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the StructureMap and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the StructureMap and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StructureMap setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the StructureMap and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the StructureMap and its use. - */ - public StructureMap setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public StructureMap addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this structure map is needed and why it's been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this structure map is needed and why it's been designed as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StructureMap setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this structure map is needed and why it's been designed as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this structure map is needed and why it's been designed as it has. - */ - public StructureMap setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create StructureMap.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StructureMap setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public StructureMap setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #structure} (A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.) - */ - public List getStructure() { - if (this.structure == null) - this.structure = new ArrayList(); - return this.structure; - } - - public boolean hasStructure() { - if (this.structure == null) - return false; - for (StructureMapStructureComponent item : this.structure) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #structure} (A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.) - */ - // syntactic sugar - public StructureMapStructureComponent addStructure() { //3 - StructureMapStructureComponent t = new StructureMapStructureComponent(); - if (this.structure == null) - this.structure = new ArrayList(); - this.structure.add(t); - return t; - } - - // syntactic sugar - public StructureMap addStructure(StructureMapStructureComponent t) { //3 - if (t == null) - return this; - if (this.structure == null) - this.structure = new ArrayList(); - this.structure.add(t); - return this; - } - - /** - * @return {@link #import_} (Other maps used by this map (canonical URLs).) - */ - public List getImport() { - if (this.import_ == null) - this.import_ = new ArrayList(); - return this.import_; - } - - public boolean hasImport() { - if (this.import_ == null) - return false; - for (UriType item : this.import_) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #import_} (Other maps used by this map (canonical URLs).) - */ - // syntactic sugar - public UriType addImportElement() {//2 - UriType t = new UriType(); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return t; - } - - /** - * @param value {@link #import_} (Other maps used by this map (canonical URLs).) - */ - public StructureMap addImport(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return this; - } - - /** - * @param value {@link #import_} (Other maps used by this map (canonical URLs).) - */ - public boolean hasImport(String value) { - if (this.import_ == null) - return false; - for (UriType v : this.import_) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #group} (Named sections for reader convenience.) - */ - public List getGroup() { - if (this.group == null) - this.group = new ArrayList(); - return this.group; - } - - public boolean hasGroup() { - if (this.group == null) - return false; - for (StructureMapGroupComponent item : this.group) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #group} (Named sections for reader convenience.) - */ - // syntactic sugar - public StructureMapGroupComponent addGroup() { //3 - StructureMapGroupComponent t = new StructureMapGroupComponent(); - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return t; - } - - // syntactic sugar - public StructureMap addGroup(StructureMapGroupComponent t) { //3 - if (t == null) - return this; - if (this.group == null) - this.group = new ArrayList(); - this.group.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this structure map when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this structure map is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this StructureMap when it is represented in other formats, or referenced in a specification, model, design or an instance (should be globally unique OID, UUID, or URI), (if it's not possible to use the literal URI).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the StructureMap when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the StructureMap author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the StructureMap.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the StructureMap.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This StructureMap was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the structure map.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date this version of the structure map was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the structure map changes.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the StructureMap and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of structure maps.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this structure map is needed and why it's been designed as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the structure map and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("structure", "", "A structure definition used by this map. The structure definition may describe instances that are converted, or the instances that are produced.", 0, java.lang.Integer.MAX_VALUE, structure)); - childrenList.add(new Property("import", "uri", "Other maps used by this map (canonical URLs).", 0, java.lang.Integer.MAX_VALUE, import_)); - childrenList.add(new Property("group", "", "Named sections for reader convenience.", 0, java.lang.Integer.MAX_VALUE, group)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // StructureMapContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case 144518515: /*structure*/ return this.structure == null ? new Base[0] : this.structure.toArray(new Base[this.structure.size()]); // StructureMapStructureComponent - case -1184795739: /*import*/ return this.import_ == null ? new Base[0] : this.import_.toArray(new Base[this.import_.size()]); // UriType - case 98629247: /*group*/ return this.group == null ? new Base[0] : this.group.toArray(new Base[this.group.size()]); // StructureMapGroupComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((StructureMapContactComponent) value); // StructureMapContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case 144518515: // structure - this.getStructure().add((StructureMapStructureComponent) value); // StructureMapStructureComponent - break; - case -1184795739: // import - this.getImport().add(castToUri(value)); // UriType - break; - case 98629247: // group - this.getGroup().add((StructureMapGroupComponent) value); // StructureMapGroupComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((StructureMapContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("structure")) - this.getStructure().add((StructureMapStructureComponent) value); - else if (name.equals("import")) - this.getImport().add(castToUri(value)); - else if (name.equals("group")) - this.getGroup().add((StructureMapGroupComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return addIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // StructureMapContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case 144518515: return addStructure(); // StructureMapStructureComponent - case -1184795739: throw new FHIRException("Cannot make property import as it is not a complex type"); // UriType - case 98629247: return addGroup(); // StructureMapGroupComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.url"); - } - else if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.copyright"); - } - else if (name.equals("structure")) { - return addStructure(); - } - else if (name.equals("import")) { - throw new FHIRException("Cannot call addChild on a primitive type StructureMap.import"); - } - else if (name.equals("group")) { - return addGroup(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "StructureMap"; - - } - - public StructureMap copy() { - StructureMap dst = new StructureMap(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (StructureMapContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - if (structure != null) { - dst.structure = new ArrayList(); - for (StructureMapStructureComponent i : structure) - dst.structure.add(i.copy()); - }; - if (import_ != null) { - dst.import_ = new ArrayList(); - for (UriType i : import_) - dst.import_.add(i.copy()); - }; - if (group != null) { - dst.group = new ArrayList(); - for (StructureMapGroupComponent i : group) - dst.group.add(i.copy()); - }; - return dst; - } - - protected StructureMap typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof StructureMap)) - return false; - StructureMap o = (StructureMap) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) - && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(structure, o.structure, true) && compareDeep(import_, o.import_, true) && compareDeep(group, o.group, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof StructureMap)) - return false; - StructureMap o = (StructureMap) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true) && compareValues(import_, o.import_, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (structure == null || structure.isEmpty()) - && (import_ == null || import_.isEmpty()) && (group == null || group.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.StructureMap; - } - - /** - * Search parameter: status - *

- * Description: The current status of the profile
- * Type: token
- * Path: StructureMap.status
- *

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

- * Description: The current status of the profile
- * Type: token
- * Path: StructureMap.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

- * Description: Text search in the description of the profile
- * Type: string
- * Path: StructureMap.description
- *

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

- * Description: Text search in the description of the profile
- * Type: string
- * Path: StructureMap.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: Name of the profile
- * Type: string
- * Path: StructureMap.name
- *

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

- * Description: Name of the profile
- * Type: string
- * Path: StructureMap.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the structure
- * Type: token
- * Path: StructureMap.useContext
- *

- */ - @SearchParamDefinition(name="context", path="StructureMap.useContext", description="A use context assigned to the structure", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the structure
- * Type: token
- * Path: StructureMap.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: experimental - *

- * Description: Whether the map is defined purely for experimental reasons
- * Type: token
- * Path: StructureMap.experimental
- *

- */ - @SearchParamDefinition(name="experimental", path="StructureMap.experimental", description="Whether the map is defined purely for experimental reasons", type="token" ) - public static final String SP_EXPERIMENTAL = "experimental"; - /** - * Fluent Client search parameter constant for experimental - *

- * Description: Whether the map is defined purely for experimental reasons
- * Type: token
- * Path: StructureMap.experimental
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam EXPERIMENTAL = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_EXPERIMENTAL); - - /** - * Search parameter: date - *

- * Description: The profile publication date
- * Type: date
- * Path: StructureMap.date
- *

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

- * Description: The profile publication date
- * Type: date
- * Path: StructureMap.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: The identifier of the profile
- * Type: token
- * Path: StructureMap.identifier
- *

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

- * Description: The identifier of the profile
- * Type: token
- * Path: StructureMap.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: url - *

- * Description: The url that identifies the structure map
- * Type: uri
- * Path: StructureMap.url
- *

- */ - @SearchParamDefinition(name="url", path="StructureMap.url", description="The url that identifies the structure map", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The url that identifies the structure map
- * Type: uri
- * Path: StructureMap.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: publisher - *

- * Description: Name of the publisher of the profile
- * Type: string
- * Path: StructureMap.publisher
- *

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

- * Description: Name of the publisher of the profile
- * Type: string
- * Path: StructureMap.publisher
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: version - *

- * Description: The version identifier of the profile
- * Type: token
- * Path: StructureMap.version
- *

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

- * Description: The version identifier of the profile
- * Type: token
- * Path: StructureMap.version
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Subscription.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Subscription.java deleted file mode 100644 index 15ee6c5f87b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Subscription.java +++ /dev/null @@ -1,1420 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take an appropriate action. - */ -@ResourceDef(name="Subscription", profile="http://hl7.org/fhir/Profile/Subscription") -public class Subscription extends DomainResource { - - public enum SubscriptionStatus { - /** - * The client has requested the subscription, and the server has not yet set it up. - */ - REQUESTED, - /** - * The subscription is active. - */ - ACTIVE, - /** - * The server has an error executing the notification. - */ - ERROR, - /** - * Too many errors have occurred or the subscription has expired. - */ - OFF, - /** - * added to help the parsers - */ - NULL; - public static SubscriptionStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("active".equals(codeString)) - return ACTIVE; - if ("error".equals(codeString)) - return ERROR; - if ("off".equals(codeString)) - return OFF; - throw new FHIRException("Unknown SubscriptionStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case ACTIVE: return "active"; - case ERROR: return "error"; - case OFF: return "off"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return "http://hl7.org/fhir/subscription-status"; - case ACTIVE: return "http://hl7.org/fhir/subscription-status"; - case ERROR: return "http://hl7.org/fhir/subscription-status"; - case OFF: return "http://hl7.org/fhir/subscription-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "The client has requested the subscription, and the server has not yet set it up."; - case ACTIVE: return "The subscription is active."; - case ERROR: return "The server has an error executing the notification."; - case OFF: return "Too many errors have occurred or the subscription has expired."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case ACTIVE: return "Active"; - case ERROR: return "Error"; - case OFF: return "Off"; - default: return "?"; - } - } - } - - public static class SubscriptionStatusEnumFactory implements EnumFactory { - public SubscriptionStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return SubscriptionStatus.REQUESTED; - if ("active".equals(codeString)) - return SubscriptionStatus.ACTIVE; - if ("error".equals(codeString)) - return SubscriptionStatus.ERROR; - if ("off".equals(codeString)) - return SubscriptionStatus.OFF; - throw new IllegalArgumentException("Unknown SubscriptionStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return new Enumeration(this, SubscriptionStatus.REQUESTED); - if ("active".equals(codeString)) - return new Enumeration(this, SubscriptionStatus.ACTIVE); - if ("error".equals(codeString)) - return new Enumeration(this, SubscriptionStatus.ERROR); - if ("off".equals(codeString)) - return new Enumeration(this, SubscriptionStatus.OFF); - throw new FHIRException("Unknown SubscriptionStatus code '"+codeString+"'"); - } - public String toCode(SubscriptionStatus code) { - if (code == SubscriptionStatus.REQUESTED) - return "requested"; - if (code == SubscriptionStatus.ACTIVE) - return "active"; - if (code == SubscriptionStatus.ERROR) - return "error"; - if (code == SubscriptionStatus.OFF) - return "off"; - return "?"; - } - public String toSystem(SubscriptionStatus code) { - return code.getSystem(); - } - } - - public enum SubscriptionChannelType { - /** - * The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made. - */ - RESTHOOK, - /** - * The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL. - */ - WEBSOCKET, - /** - * The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). - */ - EMAIL, - /** - * The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). - */ - SMS, - /** - * The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the application identified in the URI. - */ - MESSAGE, - /** - * added to help the parsers - */ - NULL; - public static SubscriptionChannelType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return RESTHOOK; - if ("websocket".equals(codeString)) - return WEBSOCKET; - if ("email".equals(codeString)) - return EMAIL; - if ("sms".equals(codeString)) - return SMS; - if ("message".equals(codeString)) - return MESSAGE; - throw new FHIRException("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RESTHOOK: return "rest-hook"; - case WEBSOCKET: return "websocket"; - case EMAIL: return "email"; - case SMS: return "sms"; - case MESSAGE: return "message"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESTHOOK: return "http://hl7.org/fhir/subscription-channel-type"; - case WEBSOCKET: return "http://hl7.org/fhir/subscription-channel-type"; - case EMAIL: return "http://hl7.org/fhir/subscription-channel-type"; - case SMS: return "http://hl7.org/fhir/subscription-channel-type"; - case MESSAGE: return "http://hl7.org/fhir/subscription-channel-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESTHOOK: return "The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the service base, and an update (PUT) is made."; - case WEBSOCKET: return "The channel is executed by sending a packet across a web socket connection maintained by the client. The URL identifies the websocket, and the client binds to this URL."; - case EMAIL: return "The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:)."; - case SMS: return "The channel is executed by sending an SMS message to the phone number identified in the URL (tel:)."; - case MESSAGE: return "The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the application identified in the URI."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESTHOOK: return "Rest Hook"; - case WEBSOCKET: return "Websocket"; - case EMAIL: return "Email"; - case SMS: return "SMS"; - case MESSAGE: return "Message"; - default: return "?"; - } - } - } - - public static class SubscriptionChannelTypeEnumFactory implements EnumFactory { - public SubscriptionChannelType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return SubscriptionChannelType.RESTHOOK; - if ("websocket".equals(codeString)) - return SubscriptionChannelType.WEBSOCKET; - if ("email".equals(codeString)) - return SubscriptionChannelType.EMAIL; - if ("sms".equals(codeString)) - return SubscriptionChannelType.SMS; - if ("message".equals(codeString)) - return SubscriptionChannelType.MESSAGE; - throw new IllegalArgumentException("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("rest-hook".equals(codeString)) - return new Enumeration(this, SubscriptionChannelType.RESTHOOK); - if ("websocket".equals(codeString)) - return new Enumeration(this, SubscriptionChannelType.WEBSOCKET); - if ("email".equals(codeString)) - return new Enumeration(this, SubscriptionChannelType.EMAIL); - if ("sms".equals(codeString)) - return new Enumeration(this, SubscriptionChannelType.SMS); - if ("message".equals(codeString)) - return new Enumeration(this, SubscriptionChannelType.MESSAGE); - throw new FHIRException("Unknown SubscriptionChannelType code '"+codeString+"'"); - } - public String toCode(SubscriptionChannelType code) { - if (code == SubscriptionChannelType.RESTHOOK) - return "rest-hook"; - if (code == SubscriptionChannelType.WEBSOCKET) - return "websocket"; - if (code == SubscriptionChannelType.EMAIL) - return "email"; - if (code == SubscriptionChannelType.SMS) - return "sms"; - if (code == SubscriptionChannelType.MESSAGE) - return "message"; - return "?"; - } - public String toSystem(SubscriptionChannelType code) { - return code.getSystem(); - } - } - - @Block() - public static class SubscriptionChannelComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The type of channel to send notifications on. - */ - @Child(name = "type", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="rest-hook | websocket | email | sms | message", formalDefinition="The type of channel to send notifications on." ) - protected Enumeration type; - - /** - * The uri that describes the actual end-point to send messages to. - */ - @Child(name = "endpoint", type = {UriType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Where the channel points to", formalDefinition="The uri that describes the actual end-point to send messages to." ) - protected UriType endpoint; - - /** - * The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. - */ - @Child(name = "payload", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Mimetype to send, or blank for no payload", formalDefinition="The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification." ) - protected StringType payload; - - /** - * Additional headers / information to send as part of the notification. - */ - @Child(name = "header", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Usage depends on the channel type", formalDefinition="Additional headers / information to send as part of the notification." ) - protected StringType header; - - private static final long serialVersionUID = -279715391L; - - /** - * Constructor - */ - public SubscriptionChannelComponent() { - super(); - } - - /** - * Constructor - */ - public SubscriptionChannelComponent(Enumeration type, StringType payload) { - super(); - this.type = type; - this.payload = payload; - } - - /** - * @return {@link #type} (The type of channel to send notifications on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of channel to send notifications on.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public SubscriptionChannelComponent setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of channel to send notifications on. - */ - public SubscriptionChannelType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of channel to send notifications on. - */ - public SubscriptionChannelComponent setType(SubscriptionChannelType value) { - if (this.type == null) - this.type = new Enumeration(new SubscriptionChannelTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #endpoint} (The uri that describes the actual end-point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public UriType getEndpointElement() { - if (this.endpoint == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.endpoint"); - else if (Configuration.doAutoCreate()) - this.endpoint = new UriType(); // bb - return this.endpoint; - } - - public boolean hasEndpointElement() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - public boolean hasEndpoint() { - return this.endpoint != null && !this.endpoint.isEmpty(); - } - - /** - * @param value {@link #endpoint} (The uri that describes the actual end-point to send messages to.). This is the underlying object with id, value and extensions. The accessor "getEndpoint" gives direct access to the value - */ - public SubscriptionChannelComponent setEndpointElement(UriType value) { - this.endpoint = value; - return this; - } - - /** - * @return The uri that describes the actual end-point to send messages to. - */ - public String getEndpoint() { - return this.endpoint == null ? null : this.endpoint.getValue(); - } - - /** - * @param value The uri that describes the actual end-point to send messages to. - */ - public SubscriptionChannelComponent setEndpoint(String value) { - if (Utilities.noString(value)) - this.endpoint = null; - else { - if (this.endpoint == null) - this.endpoint = new UriType(); - this.endpoint.setValue(value); - } - return this; - } - - /** - * @return {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value - */ - public StringType getPayloadElement() { - if (this.payload == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.payload"); - else if (Configuration.doAutoCreate()) - this.payload = new StringType(); // bb - return this.payload; - } - - public boolean hasPayloadElement() { - return this.payload != null && !this.payload.isEmpty(); - } - - public boolean hasPayload() { - return this.payload != null && !this.payload.isEmpty(); - } - - /** - * @param value {@link #payload} (The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.). This is the underlying object with id, value and extensions. The accessor "getPayload" gives direct access to the value - */ - public SubscriptionChannelComponent setPayloadElement(StringType value) { - this.payload = value; - return this; - } - - /** - * @return The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. - */ - public String getPayload() { - return this.payload == null ? null : this.payload.getValue(); - } - - /** - * @param value The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification. - */ - public SubscriptionChannelComponent setPayload(String value) { - if (this.payload == null) - this.payload = new StringType(); - this.payload.setValue(value); - return this; - } - - /** - * @return {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value - */ - public StringType getHeaderElement() { - if (this.header == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubscriptionChannelComponent.header"); - else if (Configuration.doAutoCreate()) - this.header = new StringType(); // bb - return this.header; - } - - public boolean hasHeaderElement() { - return this.header != null && !this.header.isEmpty(); - } - - public boolean hasHeader() { - return this.header != null && !this.header.isEmpty(); - } - - /** - * @param value {@link #header} (Additional headers / information to send as part of the notification.). This is the underlying object with id, value and extensions. The accessor "getHeader" gives direct access to the value - */ - public SubscriptionChannelComponent setHeaderElement(StringType value) { - this.header = value; - return this; - } - - /** - * @return Additional headers / information to send as part of the notification. - */ - public String getHeader() { - return this.header == null ? null : this.header.getValue(); - } - - /** - * @param value Additional headers / information to send as part of the notification. - */ - public SubscriptionChannelComponent setHeader(String value) { - if (Utilities.noString(value)) - this.header = null; - else { - if (this.header == null) - this.header = new StringType(); - this.header.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of channel to send notifications on.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("endpoint", "uri", "The uri that describes the actual end-point to send messages to.", 0, java.lang.Integer.MAX_VALUE, endpoint)); - childrenList.add(new Property("payload", "string", "The mime type to send the payload in - either application/xml+fhir, or application/json+fhir. If the mime type is blank, then there is no payload in the notification, just a notification.", 0, java.lang.Integer.MAX_VALUE, payload)); - childrenList.add(new Property("header", "string", "Additional headers / information to send as part of the notification.", 0, java.lang.Integer.MAX_VALUE, header)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 1741102485: /*endpoint*/ return this.endpoint == null ? new Base[0] : new Base[] {this.endpoint}; // UriType - case -786701938: /*payload*/ return this.payload == null ? new Base[0] : new Base[] {this.payload}; // StringType - case -1221270899: /*header*/ return this.header == null ? new Base[0] : new Base[] {this.header}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new SubscriptionChannelTypeEnumFactory().fromType(value); // Enumeration - break; - case 1741102485: // endpoint - this.endpoint = castToUri(value); // UriType - break; - case -786701938: // payload - this.payload = castToString(value); // StringType - break; - case -1221270899: // header - this.header = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new SubscriptionChannelTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("endpoint")) - this.endpoint = castToUri(value); // UriType - else if (name.equals("payload")) - this.payload = castToString(value); // StringType - else if (name.equals("header")) - this.header = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 1741102485: throw new FHIRException("Cannot make property endpoint as it is not a complex type"); // UriType - case -786701938: throw new FHIRException("Cannot make property payload as it is not a complex type"); // StringType - case -1221270899: throw new FHIRException("Cannot make property header as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.type"); - } - else if (name.equals("endpoint")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.endpoint"); - } - else if (name.equals("payload")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.payload"); - } - else if (name.equals("header")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.header"); - } - else - return super.addChild(name); - } - - public SubscriptionChannelComponent copy() { - SubscriptionChannelComponent dst = new SubscriptionChannelComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.endpoint = endpoint == null ? null : endpoint.copy(); - dst.payload = payload == null ? null : payload.copy(); - dst.header = header == null ? null : header.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubscriptionChannelComponent)) - return false; - SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; - return compareDeep(type, o.type, true) && compareDeep(endpoint, o.endpoint, true) && compareDeep(payload, o.payload, true) - && compareDeep(header, o.header, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubscriptionChannelComponent)) - return false; - SubscriptionChannelComponent o = (SubscriptionChannelComponent) other; - return compareValues(type, o.type, true) && compareValues(endpoint, o.endpoint, true) && compareValues(payload, o.payload, true) - && compareValues(header, o.header, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (endpoint == null || endpoint.isEmpty()) - && (payload == null || payload.isEmpty()) && (header == null || header.isEmpty()); - } - - public String fhirType() { - return "Subscription.channel"; - - } - - } - - /** - * The rules that the server should use to determine when to generate notifications for this subscription. - */ - @Child(name = "criteria", type = {StringType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Rule for server push criteria", formalDefinition="The rules that the server should use to determine when to generate notifications for this subscription." ) - protected StringType criteria; - - /** - * Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting. - */ - @Child(name = "contact", type = {ContactPoint.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for source (e.g. troubleshooting)", formalDefinition="Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting." ) - protected List contact; - - /** - * A description of why this subscription is defined. - */ - @Child(name = "reason", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Description of why this subscription was created", formalDefinition="A description of why this subscription is defined." ) - protected StringType reason; - - /** - * The status of the subscription, which marks the server state for managing the subscription. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="requested | active | error | off", formalDefinition="The status of the subscription, which marks the server state for managing the subscription." ) - protected Enumeration status; - - /** - * A record of the last error that occurred when the server processed a notification. - */ - @Child(name = "error", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Latest error note", formalDefinition="A record of the last error that occurred when the server processed a notification." ) - protected StringType error; - - /** - * Details where to send notifications when resources are received that meet the criteria. - */ - @Child(name = "channel", type = {}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The channel on which to report matches to the criteria", formalDefinition="Details where to send notifications when resources are received that meet the criteria." ) - protected SubscriptionChannelComponent channel; - - /** - * The time for the server to turn the subscription off. - */ - @Child(name = "end", type = {InstantType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When to automatically delete the subscription", formalDefinition="The time for the server to turn the subscription off." ) - protected InstantType end; - - /** - * A tag to add to any resource that matches the criteria, after the subscription is processed. - */ - @Child(name = "tag", type = {Coding.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="A tag to add to matching resources", formalDefinition="A tag to add to any resource that matches the criteria, after the subscription is processed." ) - protected List tag; - - private static final long serialVersionUID = -1390870804L; - - /** - * Constructor - */ - public Subscription() { - super(); - } - - /** - * Constructor - */ - public Subscription(StringType criteria, StringType reason, Enumeration status, SubscriptionChannelComponent channel) { - super(); - this.criteria = criteria; - this.reason = reason; - this.status = status; - this.channel = channel; - } - - /** - * @return {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public StringType getCriteriaElement() { - if (this.criteria == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.criteria"); - else if (Configuration.doAutoCreate()) - this.criteria = new StringType(); // bb - return this.criteria; - } - - public boolean hasCriteriaElement() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - public boolean hasCriteria() { - return this.criteria != null && !this.criteria.isEmpty(); - } - - /** - * @param value {@link #criteria} (The rules that the server should use to determine when to generate notifications for this subscription.). This is the underlying object with id, value and extensions. The accessor "getCriteria" gives direct access to the value - */ - public Subscription setCriteriaElement(StringType value) { - this.criteria = value; - return this; - } - - /** - * @return The rules that the server should use to determine when to generate notifications for this subscription. - */ - public String getCriteria() { - return this.criteria == null ? null : this.criteria.getValue(); - } - - /** - * @param value The rules that the server should use to determine when to generate notifications for this subscription. - */ - public Subscription setCriteria(String value) { - if (this.criteria == null) - this.criteria = new StringType(); - this.criteria.setValue(value); - return this; - } - - /** - * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ContactPoint item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.) - */ - // syntactic sugar - public ContactPoint addContact() { //3 - ContactPoint t = new ContactPoint(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public Subscription addContact(ContactPoint t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #reason} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public StringType getReasonElement() { - if (this.reason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.reason"); - else if (Configuration.doAutoCreate()) - this.reason = new StringType(); // bb - return this.reason; - } - - public boolean hasReasonElement() { - return this.reason != null && !this.reason.isEmpty(); - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (A description of why this subscription is defined.). This is the underlying object with id, value and extensions. The accessor "getReason" gives direct access to the value - */ - public Subscription setReasonElement(StringType value) { - this.reason = value; - return this; - } - - /** - * @return A description of why this subscription is defined. - */ - public String getReason() { - return this.reason == null ? null : this.reason.getValue(); - } - - /** - * @param value A description of why this subscription is defined. - */ - public Subscription setReason(String value) { - if (this.reason == null) - this.reason = new StringType(); - this.reason.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new SubscriptionStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the subscription, which marks the server state for managing the subscription.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Subscription setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the subscription, which marks the server state for managing the subscription. - */ - public SubscriptionStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the subscription, which marks the server state for managing the subscription. - */ - public Subscription setStatus(SubscriptionStatus value) { - if (this.status == null) - this.status = new Enumeration(new SubscriptionStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value - */ - public StringType getErrorElement() { - if (this.error == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.error"); - else if (Configuration.doAutoCreate()) - this.error = new StringType(); // bb - return this.error; - } - - public boolean hasErrorElement() { - return this.error != null && !this.error.isEmpty(); - } - - public boolean hasError() { - return this.error != null && !this.error.isEmpty(); - } - - /** - * @param value {@link #error} (A record of the last error that occurred when the server processed a notification.). This is the underlying object with id, value and extensions. The accessor "getError" gives direct access to the value - */ - public Subscription setErrorElement(StringType value) { - this.error = value; - return this; - } - - /** - * @return A record of the last error that occurred when the server processed a notification. - */ - public String getError() { - return this.error == null ? null : this.error.getValue(); - } - - /** - * @param value A record of the last error that occurred when the server processed a notification. - */ - public Subscription setError(String value) { - if (Utilities.noString(value)) - this.error = null; - else { - if (this.error == null) - this.error = new StringType(); - this.error.setValue(value); - } - return this; - } - - /** - * @return {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) - */ - public SubscriptionChannelComponent getChannel() { - if (this.channel == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.channel"); - else if (Configuration.doAutoCreate()) - this.channel = new SubscriptionChannelComponent(); // cc - return this.channel; - } - - public boolean hasChannel() { - return this.channel != null && !this.channel.isEmpty(); - } - - /** - * @param value {@link #channel} (Details where to send notifications when resources are received that meet the criteria.) - */ - public Subscription setChannel(SubscriptionChannelComponent value) { - this.channel = value; - return this; - } - - /** - * @return {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public InstantType getEndElement() { - if (this.end == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Subscription.end"); - else if (Configuration.doAutoCreate()) - this.end = new InstantType(); // bb - return this.end; - } - - public boolean hasEndElement() { - return this.end != null && !this.end.isEmpty(); - } - - public boolean hasEnd() { - return this.end != null && !this.end.isEmpty(); - } - - /** - * @param value {@link #end} (The time for the server to turn the subscription off.). This is the underlying object with id, value and extensions. The accessor "getEnd" gives direct access to the value - */ - public Subscription setEndElement(InstantType value) { - this.end = value; - return this; - } - - /** - * @return The time for the server to turn the subscription off. - */ - public Date getEnd() { - return this.end == null ? null : this.end.getValue(); - } - - /** - * @param value The time for the server to turn the subscription off. - */ - public Subscription setEnd(Date value) { - if (value == null) - this.end = null; - else { - if (this.end == null) - this.end = new InstantType(); - this.end.setValue(value); - } - return this; - } - - /** - * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) - */ - public List getTag() { - if (this.tag == null) - this.tag = new ArrayList(); - return this.tag; - } - - public boolean hasTag() { - if (this.tag == null) - return false; - for (Coding item : this.tag) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #tag} (A tag to add to any resource that matches the criteria, after the subscription is processed.) - */ - // syntactic sugar - public Coding addTag() { //3 - Coding t = new Coding(); - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return t; - } - - // syntactic sugar - public Subscription addTag(Coding t) { //3 - if (t == null) - return this; - if (this.tag == null) - this.tag = new ArrayList(); - this.tag.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("criteria", "string", "The rules that the server should use to determine when to generate notifications for this subscription.", 0, java.lang.Integer.MAX_VALUE, criteria)); - childrenList.add(new Property("contact", "ContactPoint", "Contact details for a human to contact about the subscription. The primary use of this for system administrator troubleshooting.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("reason", "string", "A description of why this subscription is defined.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("status", "code", "The status of the subscription, which marks the server state for managing the subscription.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("error", "string", "A record of the last error that occurred when the server processed a notification.", 0, java.lang.Integer.MAX_VALUE, error)); - childrenList.add(new Property("channel", "", "Details where to send notifications when resources are received that meet the criteria.", 0, java.lang.Integer.MAX_VALUE, channel)); - childrenList.add(new Property("end", "instant", "The time for the server to turn the subscription off.", 0, java.lang.Integer.MAX_VALUE, end)); - childrenList.add(new Property("tag", "Coding", "A tag to add to any resource that matches the criteria, after the subscription is processed.", 0, java.lang.Integer.MAX_VALUE, tag)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1952046943: /*criteria*/ return this.criteria == null ? new Base[0] : new Base[] {this.criteria}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ContactPoint - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 96784904: /*error*/ return this.error == null ? new Base[0] : new Base[] {this.error}; // StringType - case 738950403: /*channel*/ return this.channel == null ? new Base[0] : new Base[] {this.channel}; // SubscriptionChannelComponent - case 100571: /*end*/ return this.end == null ? new Base[0] : new Base[] {this.end}; // InstantType - case 114586: /*tag*/ return this.tag == null ? new Base[0] : this.tag.toArray(new Base[this.tag.size()]); // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1952046943: // criteria - this.criteria = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add(castToContactPoint(value)); // ContactPoint - break; - case -934964668: // reason - this.reason = castToString(value); // StringType - break; - case -892481550: // status - this.status = new SubscriptionStatusEnumFactory().fromType(value); // Enumeration - break; - case 96784904: // error - this.error = castToString(value); // StringType - break; - case 738950403: // channel - this.channel = (SubscriptionChannelComponent) value; // SubscriptionChannelComponent - break; - case 100571: // end - this.end = castToInstant(value); // InstantType - break; - case 114586: // tag - this.getTag().add(castToCoding(value)); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("criteria")) - this.criteria = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add(castToContactPoint(value)); - else if (name.equals("reason")) - this.reason = castToString(value); // StringType - else if (name.equals("status")) - this.status = new SubscriptionStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("error")) - this.error = castToString(value); // StringType - else if (name.equals("channel")) - this.channel = (SubscriptionChannelComponent) value; // SubscriptionChannelComponent - else if (name.equals("end")) - this.end = castToInstant(value); // InstantType - else if (name.equals("tag")) - this.getTag().add(castToCoding(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1952046943: throw new FHIRException("Cannot make property criteria as it is not a complex type"); // StringType - case 951526432: return addContact(); // ContactPoint - case -934964668: throw new FHIRException("Cannot make property reason as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 96784904: throw new FHIRException("Cannot make property error as it is not a complex type"); // StringType - case 738950403: return getChannel(); // SubscriptionChannelComponent - case 100571: throw new FHIRException("Cannot make property end as it is not a complex type"); // InstantType - case 114586: return addTag(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("criteria")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.criteria"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("reason")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.reason"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.status"); - } - else if (name.equals("error")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.error"); - } - else if (name.equals("channel")) { - this.channel = new SubscriptionChannelComponent(); - return this.channel; - } - else if (name.equals("end")) { - throw new FHIRException("Cannot call addChild on a primitive type Subscription.end"); - } - else if (name.equals("tag")) { - return addTag(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Subscription"; - - } - - public Subscription copy() { - Subscription dst = new Subscription(); - copyValues(dst); - dst.criteria = criteria == null ? null : criteria.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ContactPoint i : contact) - dst.contact.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - dst.status = status == null ? null : status.copy(); - dst.error = error == null ? null : error.copy(); - dst.channel = channel == null ? null : channel.copy(); - dst.end = end == null ? null : end.copy(); - if (tag != null) { - dst.tag = new ArrayList(); - for (Coding i : tag) - dst.tag.add(i.copy()); - }; - return dst; - } - - protected Subscription typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Subscription)) - return false; - Subscription o = (Subscription) other; - return compareDeep(criteria, o.criteria, true) && compareDeep(contact, o.contact, true) && compareDeep(reason, o.reason, true) - && compareDeep(status, o.status, true) && compareDeep(error, o.error, true) && compareDeep(channel, o.channel, true) - && compareDeep(end, o.end, true) && compareDeep(tag, o.tag, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Subscription)) - return false; - Subscription o = (Subscription) other; - return compareValues(criteria, o.criteria, true) && compareValues(reason, o.reason, true) && compareValues(status, o.status, true) - && compareValues(error, o.error, true) && compareValues(end, o.end, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (criteria == null || criteria.isEmpty()) && (contact == null || contact.isEmpty()) - && (reason == null || reason.isEmpty()) && (status == null || status.isEmpty()) && (error == null || error.isEmpty()) - && (channel == null || channel.isEmpty()) && (end == null || end.isEmpty()) && (tag == null || tag.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Subscription; - } - - /** - * Search parameter: criteria - *

- * Description: Rule for server push criteria
- * Type: string
- * Path: Subscription.criteria
- *

- */ - @SearchParamDefinition(name="criteria", path="Subscription.criteria", description="Rule for server push criteria", type="string" ) - public static final String SP_CRITERIA = "criteria"; - /** - * Fluent Client search parameter constant for criteria - *

- * Description: Rule for server push criteria
- * Type: string
- * Path: Subscription.criteria
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam CRITERIA = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_CRITERIA); - - /** - * Search parameter: status - *

- * Description: requested | active | error | off
- * Type: token
- * Path: Subscription.status
- *

- */ - @SearchParamDefinition(name="status", path="Subscription.status", description="requested | active | error | off", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: requested | active | error | off
- * Type: token
- * Path: Subscription.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: tag - *

- * Description: A tag to add to matching resources
- * Type: token
- * Path: Subscription.tag
- *

- */ - @SearchParamDefinition(name="tag", path="Subscription.tag", description="A tag to add to matching resources", type="token" ) - public static final String SP_TAG = "tag"; - /** - * Fluent Client search parameter constant for tag - *

- * Description: A tag to add to matching resources
- * Type: token
- * Path: Subscription.tag
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TAG = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TAG); - - /** - * Search parameter: payload - *

- * Description: Mimetype to send, or blank for no payload
- * Type: string
- * Path: Subscription.channel.payload
- *

- */ - @SearchParamDefinition(name="payload", path="Subscription.channel.payload", description="Mimetype to send, or blank for no payload", type="string" ) - public static final String SP_PAYLOAD = "payload"; - /** - * Fluent Client search parameter constant for payload - *

- * Description: Mimetype to send, or blank for no payload
- * Type: string
- * Path: Subscription.channel.payload
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PAYLOAD = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PAYLOAD); - - /** - * Search parameter: type - *

- * Description: rest-hook | websocket | email | sms | message
- * Type: token
- * Path: Subscription.channel.type
- *

- */ - @SearchParamDefinition(name="type", path="Subscription.channel.type", description="rest-hook | websocket | email | sms | message", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: rest-hook | websocket | email | sms | message
- * Type: token
- * Path: Subscription.channel.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: contact - *

- * Description: Contact details for source (e.g. troubleshooting)
- * Type: token
- * Path: Subscription.contact
- *

- */ - @SearchParamDefinition(name="contact", path="Subscription.contact", description="Contact details for source (e.g. troubleshooting)", type="token" ) - public static final String SP_CONTACT = "contact"; - /** - * Fluent Client search parameter constant for contact - *

- * Description: Contact details for source (e.g. troubleshooting)
- * Type: token
- * Path: Subscription.contact
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTACT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTACT); - - /** - * Search parameter: url - *

- * Description: Where the channel points to
- * Type: uri
- * Path: Subscription.channel.endpoint
- *

- */ - @SearchParamDefinition(name="url", path="Subscription.channel.endpoint", description="Where the channel points to", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Where the channel points to
- * Type: uri
- * Path: Subscription.channel.endpoint
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Substance.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Substance.java deleted file mode 100644 index 48168cc9b6d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Substance.java +++ /dev/null @@ -1,1125 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A homogeneous material with a definite composition. - */ -@ResourceDef(name="Substance", profile="http://hl7.org/fhir/Profile/Substance") -public class Substance extends DomainResource { - - @Block() - public static class SubstanceInstanceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifier associated with the package/container (usually a label affixed directly). - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Identifier of the package/container", formalDefinition="Identifier associated with the package/container (usually a label affixed directly)." ) - protected Identifier identifier; - - /** - * When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - @Child(name = "expiry", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @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." ) - protected DateTimeType expiry; - - /** - * The amount of the substance. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount of substance in the package", formalDefinition="The amount of the substance." ) - protected SimpleQuantity quantity; - - private static final long serialVersionUID = -794314734L; - - /** - * Constructor - */ - public SubstanceInstanceComponent() { - super(); - } - - /** - * @return {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier associated with the package/container (usually a label affixed directly).) - */ - public SubstanceInstanceComponent setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public DateTimeType getExpiryElement() { - if (this.expiry == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.expiry"); - else if (Configuration.doAutoCreate()) - this.expiry = new DateTimeType(); // bb - return this.expiry; - } - - public boolean hasExpiryElement() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - public boolean hasExpiry() { - return this.expiry != null && !this.expiry.isEmpty(); - } - - /** - * @param value {@link #expiry} (When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.). This is the underlying object with id, value and extensions. The accessor "getExpiry" gives direct access to the value - */ - public SubstanceInstanceComponent setExpiryElement(DateTimeType value) { - this.expiry = value; - return this; - } - - /** - * @return When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - public Date getExpiry() { - return this.expiry == null ? null : this.expiry.getValue(); - } - - /** - * @param value When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry. - */ - public SubstanceInstanceComponent setExpiry(Date value) { - if (value == null) - this.expiry = null; - else { - if (this.expiry == null) - this.expiry = new DateTimeType(); - this.expiry.setValue(value); - } - return this; - } - - /** - * @return {@link #quantity} (The amount of the substance.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceInstanceComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the substance.) - */ - public SubstanceInstanceComponent setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier associated with the package/container (usually a label affixed directly).", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("expiry", "dateTime", "When the substance is no longer valid to use. For some substances, a single arbitrary date is used for expiry.", 0, java.lang.Integer.MAX_VALUE, expiry)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of the substance.", 0, java.lang.Integer.MAX_VALUE, quantity)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -1289159373: /*expiry*/ return this.expiry == null ? new Base[0] : new Base[] {this.expiry}; // DateTimeType - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -1289159373: // expiry - this.expiry = castToDateTime(value); // DateTimeType - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("expiry")) - this.expiry = castToDateTime(value); // DateTimeType - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -1289159373: throw new FHIRException("Cannot make property expiry as it is not a complex type"); // DateTimeType - case -1285004149: return getQuantity(); // SimpleQuantity - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("expiry")) { - throw new FHIRException("Cannot call addChild on a primitive type Substance.expiry"); - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else - return super.addChild(name); - } - - public SubstanceInstanceComponent copy() { - SubstanceInstanceComponent dst = new SubstanceInstanceComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.expiry = expiry == null ? null : expiry.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubstanceInstanceComponent)) - return false; - SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(expiry, o.expiry, true) && compareDeep(quantity, o.quantity, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubstanceInstanceComponent)) - return false; - SubstanceInstanceComponent o = (SubstanceInstanceComponent) other; - return compareValues(expiry, o.expiry, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (expiry == null || expiry.isEmpty()) - && (quantity == null || quantity.isEmpty()); - } - - public String fhirType() { - return "Substance.instance"; - - } - - } - - @Block() - public static class SubstanceIngredientComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The amount of the ingredient in the substance - a concentration ratio. - */ - @Child(name = "quantity", type = {Ratio.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Optional amount (concentration)", formalDefinition="The amount of the ingredient in the substance - a concentration ratio." ) - protected Ratio quantity; - - /** - * Another substance that is a component of this substance. - */ - @Child(name = "substance", type = {Substance.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="A component of the substance", formalDefinition="Another substance that is a component of this substance." ) - protected Reference substance; - - /** - * The actual object that is the target of the reference (Another substance that is a component of this substance.) - */ - protected Substance substanceTarget; - - private static final long serialVersionUID = -1783242034L; - - /** - * Constructor - */ - public SubstanceIngredientComponent() { - super(); - } - - /** - * Constructor - */ - public SubstanceIngredientComponent(Reference substance) { - super(); - this.substance = substance; - } - - /** - * @return {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) - */ - public Ratio getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new Ratio(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of the ingredient in the substance - a concentration ratio.) - */ - public SubstanceIngredientComponent setQuantity(Ratio value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #substance} (Another substance that is a component of this substance.) - */ - public Reference getSubstance() { - if (this.substance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substance = new Reference(); // cc - return this.substance; - } - - public boolean hasSubstance() { - return this.substance != null && !this.substance.isEmpty(); - } - - /** - * @param value {@link #substance} (Another substance that is a component of this substance.) - */ - public SubstanceIngredientComponent setSubstance(Reference value) { - this.substance = value; - return this; - } - - /** - * @return {@link #substance} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Another substance that is a component of this substance.) - */ - public Substance getSubstanceTarget() { - if (this.substanceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SubstanceIngredientComponent.substance"); - else if (Configuration.doAutoCreate()) - this.substanceTarget = new Substance(); // aa - return this.substanceTarget; - } - - /** - * @param value {@link #substance} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Another substance that is a component of this substance.) - */ - public SubstanceIngredientComponent setSubstanceTarget(Substance value) { - this.substanceTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("quantity", "Ratio", "The amount of the ingredient in the substance - a concentration ratio.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("substance", "Reference(Substance)", "Another substance that is a component of this substance.", 0, java.lang.Integer.MAX_VALUE, substance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // Ratio - case 530040176: /*substance*/ return this.substance == null ? new Base[0] : new Base[] {this.substance}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1285004149: // quantity - this.quantity = castToRatio(value); // Ratio - break; - case 530040176: // substance - this.substance = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("quantity")) - this.quantity = castToRatio(value); // Ratio - else if (name.equals("substance")) - this.substance = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1285004149: return getQuantity(); // Ratio - case 530040176: return getSubstance(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("quantity")) { - this.quantity = new Ratio(); - return this.quantity; - } - else if (name.equals("substance")) { - this.substance = new Reference(); - return this.substance; - } - else - return super.addChild(name); - } - - public SubstanceIngredientComponent copy() { - SubstanceIngredientComponent dst = new SubstanceIngredientComponent(); - copyValues(dst); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.substance = substance == null ? null : substance.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SubstanceIngredientComponent)) - return false; - SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; - return compareDeep(quantity, o.quantity, true) && compareDeep(substance, o.substance, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SubstanceIngredientComponent)) - return false; - SubstanceIngredientComponent o = (SubstanceIngredientComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (quantity == null || quantity.isEmpty()) && (substance == null || substance.isEmpty()) - ; - } - - public String fhirType() { - return "Substance.ingredient"; - - } - - } - - /** - * Unique identifier for the substance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for the substance." ) - protected List identifier; - - /** - * A code that classifies the general type of substance. This is used for searching, sorting and display purposes. - */ - @Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="What class/type of substance this is", formalDefinition="A code that classifies the general type of substance. This is used for searching, sorting and display purposes." ) - protected List category; - - /** - * A code (or set of codes) that identify this substance. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="What substance this is", formalDefinition="A code (or set of codes) that identify this substance." ) - protected CodeableConcept code; - - /** - * A description of the substance - its appearance, handling requirements, and other usage notes. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Textual description of the substance, comments", formalDefinition="A description of the substance - its appearance, handling requirements, and other usage notes." ) - protected StringType description; - - /** - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. - */ - @Child(name = "instance", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @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." ) - protected List instance; - - /** - * A substance can be composed of other substances. - */ - @Child(name = "ingredient", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Composition information about the substance", formalDefinition="A substance can be composed of other substances." ) - protected List ingredient; - - private static final long serialVersionUID = -1653977206L; - - /** - * Constructor - */ - public Substance() { - super(); - } - - /** - * Constructor - */ - public Substance(CodeableConcept code) { - super(); - this.code = code; - } - - /** - * @return {@link #identifier} (Unique identifier for the substance.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Unique identifier for the substance.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public Substance addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #category} (A code that classifies the general type of substance. This is used for searching, sorting and display purposes.) - */ - public List getCategory() { - if (this.category == null) - this.category = new ArrayList(); - return this.category; - } - - public boolean hasCategory() { - if (this.category == null) - return false; - for (CodeableConcept item : this.category) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #category} (A code that classifies the general type of substance. This is used for searching, sorting and display purposes.) - */ - // syntactic sugar - public CodeableConcept addCategory() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return t; - } - - // syntactic sugar - public Substance addCategory(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.category == null) - this.category = new ArrayList(); - this.category.add(t); - return this; - } - - /** - * @return {@link #code} (A code (or set of codes) that identify this substance.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code (or set of codes) that identify this substance.) - */ - public Substance setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Substance.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of the substance - its appearance, handling requirements, and other usage notes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Substance setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of the substance - its appearance, handling requirements, and other usage notes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of the substance - its appearance, handling requirements, and other usage notes. - */ - public Substance setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) - */ - public List getInstance() { - if (this.instance == null) - this.instance = new ArrayList(); - return this.instance; - } - - public boolean hasInstance() { - if (this.instance == null) - return false; - for (SubstanceInstanceComponent item : this.instance) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #instance} (Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.) - */ - // syntactic sugar - public SubstanceInstanceComponent addInstance() { //3 - SubstanceInstanceComponent t = new SubstanceInstanceComponent(); - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return t; - } - - // syntactic sugar - public Substance addInstance(SubstanceInstanceComponent t) { //3 - if (t == null) - return this; - if (this.instance == null) - this.instance = new ArrayList(); - this.instance.add(t); - return this; - } - - /** - * @return {@link #ingredient} (A substance can be composed of other substances.) - */ - public List getIngredient() { - if (this.ingredient == null) - this.ingredient = new ArrayList(); - return this.ingredient; - } - - public boolean hasIngredient() { - if (this.ingredient == null) - return false; - for (SubstanceIngredientComponent item : this.ingredient) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ingredient} (A substance can be composed of other substances.) - */ - // syntactic sugar - public SubstanceIngredientComponent addIngredient() { //3 - SubstanceIngredientComponent t = new SubstanceIngredientComponent(); - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return t; - } - - // syntactic sugar - public Substance addIngredient(SubstanceIngredientComponent t) { //3 - if (t == null) - return this; - if (this.ingredient == null) - this.ingredient = new ArrayList(); - this.ingredient.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for the substance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("category", "CodeableConcept", "A code that classifies the general type of substance. This is used for searching, sorting and display purposes.", 0, java.lang.Integer.MAX_VALUE, category)); - childrenList.add(new Property("code", "CodeableConcept", "A code (or set of codes) that identify this substance.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("description", "string", "A description of the substance - its appearance, handling requirements, and other usage notes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("instance", "", "Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance.", 0, java.lang.Integer.MAX_VALUE, instance)); - childrenList.add(new Property("ingredient", "", "A substance can be composed of other substances.", 0, java.lang.Integer.MAX_VALUE, ingredient)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case 50511102: /*category*/ return this.category == null ? new Base[0] : this.category.toArray(new Base[this.category.size()]); // CodeableConcept - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case 555127957: /*instance*/ return this.instance == null ? new Base[0] : this.instance.toArray(new Base[this.instance.size()]); // SubstanceInstanceComponent - case -206409263: /*ingredient*/ return this.ingredient == null ? new Base[0] : this.ingredient.toArray(new Base[this.ingredient.size()]); // SubstanceIngredientComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case 50511102: // category - this.getCategory().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case 555127957: // instance - this.getInstance().add((SubstanceInstanceComponent) value); // SubstanceInstanceComponent - break; - case -206409263: // ingredient - this.getIngredient().add((SubstanceIngredientComponent) value); // SubstanceIngredientComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("category")) - this.getCategory().add(castToCodeableConcept(value)); - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("instance")) - this.getInstance().add((SubstanceInstanceComponent) value); - else if (name.equals("ingredient")) - this.getIngredient().add((SubstanceIngredientComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case 50511102: return addCategory(); // CodeableConcept - case 3059181: return getCode(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case 555127957: return addInstance(); // SubstanceInstanceComponent - case -206409263: return addIngredient(); // SubstanceIngredientComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("category")) { - return addCategory(); - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Substance.description"); - } - else if (name.equals("instance")) { - return addInstance(); - } - else if (name.equals("ingredient")) { - return addIngredient(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Substance"; - - } - - public Substance copy() { - Substance dst = new Substance(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - if (category != null) { - dst.category = new ArrayList(); - for (CodeableConcept i : category) - dst.category.add(i.copy()); - }; - dst.code = code == null ? null : code.copy(); - dst.description = description == null ? null : description.copy(); - if (instance != null) { - dst.instance = new ArrayList(); - for (SubstanceInstanceComponent i : instance) - dst.instance.add(i.copy()); - }; - if (ingredient != null) { - dst.ingredient = new ArrayList(); - for (SubstanceIngredientComponent i : ingredient) - dst.ingredient.add(i.copy()); - }; - return dst; - } - - protected Substance typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Substance)) - return false; - Substance o = (Substance) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(category, o.category, true) && compareDeep(code, o.code, true) - && compareDeep(description, o.description, true) && compareDeep(instance, o.instance, true) && compareDeep(ingredient, o.ingredient, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Substance)) - return false; - Substance o = (Substance) other; - return compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (category == null || category.isEmpty()) - && (code == null || code.isEmpty()) && (description == null || description.isEmpty()) && (instance == null || instance.isEmpty()) - && (ingredient == null || ingredient.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Substance; - } - - /** - * Search parameter: substance - *

- * Description: A component of the substance
- * Type: reference
- * Path: Substance.ingredient.substance
- *

- */ - @SearchParamDefinition(name="substance", path="Substance.ingredient.substance", description="A component of the substance", type="reference" ) - public static final String SP_SUBSTANCE = "substance"; - /** - * Fluent Client search parameter constant for substance - *

- * Description: A component of the substance
- * Type: reference
- * Path: Substance.ingredient.substance
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBSTANCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBSTANCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Substance:substance". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBSTANCE = new ca.uhn.fhir.model.api.Include("Substance:substance").toLocked(); - - /** - * Search parameter: container-identifier - *

- * Description: Identifier of the package/container
- * Type: token
- * Path: Substance.instance.identifier
- *

- */ - @SearchParamDefinition(name="container-identifier", path="Substance.instance.identifier", description="Identifier of the package/container", type="token" ) - public static final String SP_CONTAINER_IDENTIFIER = "container-identifier"; - /** - * Fluent Client search parameter constant for container-identifier - *

- * Description: Identifier of the package/container
- * Type: token
- * Path: Substance.instance.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTAINER_IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTAINER_IDENTIFIER); - - /** - * Search parameter: category - *

- * Description: The category of the substance
- * Type: token
- * Path: Substance.category
- *

- */ - @SearchParamDefinition(name="category", path="Substance.category", description="The category of the substance", type="token" ) - public static final String SP_CATEGORY = "category"; - /** - * Fluent Client search parameter constant for category - *

- * Description: The category of the substance
- * Type: token
- * Path: Substance.category
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CATEGORY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CATEGORY); - - /** - * Search parameter: quantity - *

- * Description: Amount of substance in the package
- * Type: quantity
- * Path: Substance.instance.quantity
- *

- */ - @SearchParamDefinition(name="quantity", path="Substance.instance.quantity", description="Amount of substance in the package", type="quantity" ) - public static final String SP_QUANTITY = "quantity"; - /** - * Fluent Client search parameter constant for quantity - *

- * Description: Amount of substance in the package
- * Type: quantity
- * Path: Substance.instance.quantity
- *

- */ - public static final ca.uhn.fhir.rest.gclient.QuantityClientParam QUANTITY = new ca.uhn.fhir.rest.gclient.QuantityClientParam(SP_QUANTITY); - - /** - * Search parameter: code - *

- * Description: The code of the substance
- * Type: token
- * Path: Substance.code
- *

- */ - @SearchParamDefinition(name="code", path="Substance.code", description="The code of the substance", type="token" ) - public static final String SP_CODE = "code"; - /** - * Fluent Client search parameter constant for code - *

- * Description: The code of the substance
- * Type: token
- * Path: Substance.code
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CODE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CODE); - - /** - * Search parameter: identifier - *

- * Description: Unique identifier for the substance
- * Type: token
- * Path: Substance.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Substance.identifier", description="Unique identifier for the substance", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique identifier for the substance
- * Type: token
- * Path: Substance.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: expiry - *

- * Description: Expiry date of package or container of substance
- * Type: date
- * Path: Substance.instance.expiry
- *

- */ - @SearchParamDefinition(name="expiry", path="Substance.instance.expiry", description="Expiry date of package or container of substance", type="date" ) - public static final String SP_EXPIRY = "expiry"; - /** - * Fluent Client search parameter constant for expiry - *

- * Description: Expiry date of package or container of substance
- * Type: date
- * Path: Substance.instance.expiry
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam EXPIRY = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_EXPIRY); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java deleted file mode 100644 index b3b8511578b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SupplyDelivery.java +++ /dev/null @@ -1,1044 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; - -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; -/** - * Record of delivery of what is supplied. - */ -@ResourceDef(name="SupplyDelivery", profile="http://hl7.org/fhir/Profile/SupplyDelivery") -public class SupplyDelivery extends DomainResource { - - public enum SupplyDeliveryStatus { - /** - * Supply has been requested, but not delivered. - */ - INPROGRESS, - /** - * Supply has been delivered ("completed"). - */ - COMPLETED, - /** - * Dispensing was not completed. - */ - ABANDONED, - /** - * added to help the parsers - */ - NULL; - public static SupplyDeliveryStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("completed".equals(codeString)) - return COMPLETED; - if ("abandoned".equals(codeString)) - return ABANDONED; - throw new FHIRException("Unknown SupplyDeliveryStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case INPROGRESS: return "in-progress"; - case COMPLETED: return "completed"; - case ABANDONED: return "abandoned"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case INPROGRESS: return "http://hl7.org/fhir/supplydelivery-status"; - case COMPLETED: return "http://hl7.org/fhir/supplydelivery-status"; - case ABANDONED: return "http://hl7.org/fhir/supplydelivery-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case INPROGRESS: return "Supply has been requested, but not delivered."; - case COMPLETED: return "Supply has been delivered (\"completed\")."; - case ABANDONED: return "Dispensing was not completed."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case INPROGRESS: return "In Progress"; - case COMPLETED: return "Delivered"; - case ABANDONED: return "Abandoned"; - default: return "?"; - } - } - } - - public static class SupplyDeliveryStatusEnumFactory implements EnumFactory { - public SupplyDeliveryStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return SupplyDeliveryStatus.INPROGRESS; - if ("completed".equals(codeString)) - return SupplyDeliveryStatus.COMPLETED; - if ("abandoned".equals(codeString)) - return SupplyDeliveryStatus.ABANDONED; - throw new IllegalArgumentException("Unknown SupplyDeliveryStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("in-progress".equals(codeString)) - return new Enumeration(this, SupplyDeliveryStatus.INPROGRESS); - if ("completed".equals(codeString)) - return new Enumeration(this, SupplyDeliveryStatus.COMPLETED); - if ("abandoned".equals(codeString)) - return new Enumeration(this, SupplyDeliveryStatus.ABANDONED); - throw new FHIRException("Unknown SupplyDeliveryStatus code '"+codeString+"'"); - } - public String toCode(SupplyDeliveryStatus code) { - if (code == SupplyDeliveryStatus.INPROGRESS) - return "in-progress"; - if (code == SupplyDeliveryStatus.COMPLETED) - return "completed"; - if (code == SupplyDeliveryStatus.ABANDONED) - return "abandoned"; - return "?"; - } - public String toSystem(SupplyDeliveryStatus code) { - return code.getSystem(); - } - } - - /** - * Identifier assigned by the dispensing facility when the item(s) is dispensed. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="External identifier", formalDefinition="Identifier assigned by the dispensing facility when the item(s) is dispensed." ) - protected Identifier identifier; - - /** - * A code specifying the state of the dispense event. - */ - @Child(name = "status", type = {CodeType.class}, order=1, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="in-progress | completed | abandoned", formalDefinition="A code specifying the state of the dispense event." ) - protected Enumeration status; - - /** - * A link to a resource representing the person whom the delivered item is for. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the delivered item is for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person whom the delivered item is for.) - */ - protected Patient patientTarget; - - /** - * Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=3, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept type; - - /** - * The amount of supply that has been dispensed. Includes unit of measure. - */ - @Child(name = "quantity", type = {SimpleQuantity.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Amount dispensed", formalDefinition="The amount of supply that has been dispensed. Includes unit of measure." ) - protected SimpleQuantity quantity; - - /** - * Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list. - */ - @Child(name = "suppliedItem", type = {Medication.class, Substance.class, Device.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Medication, Substance, or Device supplied", formalDefinition="Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list." ) - protected Reference suppliedItem; - - /** - * The actual object that is the target of the reference (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - protected Resource suppliedItemTarget; - - /** - * The individual responsible for dispensing the medication, supplier or device. - */ - @Child(name = "supplier", type = {Practitioner.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Dispenser", formalDefinition="The individual responsible for dispensing the medication, supplier or device." ) - protected Reference supplier; - - /** - * The actual object that is the target of the reference (The individual responsible for dispensing the medication, supplier or device.) - */ - protected Practitioner supplierTarget; - - /** - * The time the dispense event occurred. - */ - @Child(name = "whenPrepared", type = {Period.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Dispensing time", formalDefinition="The time the dispense event occurred." ) - protected Period whenPrepared; - - /** - * The time the dispensed item was sent or handed to the patient (or agent). - */ - @Child(name = "time", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Handover time", formalDefinition="The time the dispensed item was sent or handed to the patient (or agent)." ) - protected DateTimeType time; - - /** - * Identification of the facility/location where the Supply was shipped to, as part of the dispense event. - */ - @Child(name = "destination", type = {Location.class}, order=9, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference destination; - - /** - * The actual object that is the target of the reference (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - protected Location destinationTarget; - - /** - * Identifies the person who picked up the Supply. - */ - @Child(name = "receiver", type = {Practitioner.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who collected the Supply", formalDefinition="Identifies the person who picked up the Supply." ) - protected List receiver; - /** - * The actual objects that are the target of the reference (Identifies the person who picked up the Supply.) - */ - protected List receiverTarget; - - - private static final long serialVersionUID = -1520129707L; - - /** - * Constructor - */ - public SupplyDelivery() { - super(); - } - - /** - * @return {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier assigned by the dispensing facility when the item(s) is dispensed.) - */ - public SupplyDelivery setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new SupplyDeliveryStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (A code specifying the state of the dispense event.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SupplyDelivery setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return A code specifying the state of the dispense event. - */ - public SupplyDeliveryStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value A code specifying the state of the dispense event. - */ - public SupplyDelivery setStatus(SupplyDeliveryStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new SupplyDeliveryStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person whom the delivered item is for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person whom the delivered item is for.) - */ - public SupplyDelivery setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the delivered item is for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the delivered item is for.) - */ - public SupplyDelivery setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.) - */ - public SupplyDelivery setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public SimpleQuantity getQuantity() { - if (this.quantity == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.quantity"); - else if (Configuration.doAutoCreate()) - this.quantity = new SimpleQuantity(); // cc - return this.quantity; - } - - public boolean hasQuantity() { - return this.quantity != null && !this.quantity.isEmpty(); - } - - /** - * @param value {@link #quantity} (The amount of supply that has been dispensed. Includes unit of measure.) - */ - public SupplyDelivery setQuantity(SimpleQuantity value) { - this.quantity = value; - return this; - } - - /** - * @return {@link #suppliedItem} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Reference getSuppliedItem() { - if (this.suppliedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.suppliedItem"); - else if (Configuration.doAutoCreate()) - this.suppliedItem = new Reference(); // cc - return this.suppliedItem; - } - - public boolean hasSuppliedItem() { - return this.suppliedItem != null && !this.suppliedItem.isEmpty(); - } - - /** - * @param value {@link #suppliedItem} (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDelivery setSuppliedItem(Reference value) { - this.suppliedItem = value; - return this; - } - - /** - * @return {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public Resource getSuppliedItemTarget() { - return this.suppliedItemTarget; - } - - /** - * @param value {@link #suppliedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.) - */ - public SupplyDelivery setSuppliedItemTarget(Resource value) { - this.suppliedItemTarget = value; - return this; - } - - /** - * @return {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public Reference getSupplier() { - if (this.supplier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.supplier"); - else if (Configuration.doAutoCreate()) - this.supplier = new Reference(); // cc - return this.supplier; - } - - public boolean hasSupplier() { - return this.supplier != null && !this.supplier.isEmpty(); - } - - /** - * @param value {@link #supplier} (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDelivery setSupplier(Reference value) { - this.supplier = value; - return this; - } - - /** - * @return {@link #supplier} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) - */ - public Practitioner getSupplierTarget() { - if (this.supplierTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.supplier"); - else if (Configuration.doAutoCreate()) - this.supplierTarget = new Practitioner(); // aa - return this.supplierTarget; - } - - /** - * @param value {@link #supplier} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The individual responsible for dispensing the medication, supplier or device.) - */ - public SupplyDelivery setSupplierTarget(Practitioner value) { - this.supplierTarget = value; - return this; - } - - /** - * @return {@link #whenPrepared} (The time the dispense event occurred.) - */ - public Period getWhenPrepared() { - if (this.whenPrepared == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.whenPrepared"); - else if (Configuration.doAutoCreate()) - this.whenPrepared = new Period(); // cc - return this.whenPrepared; - } - - public boolean hasWhenPrepared() { - return this.whenPrepared != null && !this.whenPrepared.isEmpty(); - } - - /** - * @param value {@link #whenPrepared} (The time the dispense event occurred.) - */ - public SupplyDelivery setWhenPrepared(Period value) { - this.whenPrepared = value; - return this; - } - - /** - * @return {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public DateTimeType getTimeElement() { - if (this.time == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.time"); - else if (Configuration.doAutoCreate()) - this.time = new DateTimeType(); // bb - return this.time; - } - - public boolean hasTimeElement() { - return this.time != null && !this.time.isEmpty(); - } - - public boolean hasTime() { - return this.time != null && !this.time.isEmpty(); - } - - /** - * @param value {@link #time} (The time the dispensed item was sent or handed to the patient (or agent).). This is the underlying object with id, value and extensions. The accessor "getTime" gives direct access to the value - */ - public SupplyDelivery setTimeElement(DateTimeType value) { - this.time = value; - return this; - } - - /** - * @return The time the dispensed item was sent or handed to the patient (or agent). - */ - public Date getTime() { - return this.time == null ? null : this.time.getValue(); - } - - /** - * @param value The time the dispensed item was sent or handed to the patient (or agent). - */ - public SupplyDelivery setTime(Date value) { - if (value == null) - this.time = null; - else { - if (this.time == null) - this.time = new DateTimeType(); - this.time.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Reference getDestination() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new Reference(); // cc - return this.destination; - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDelivery setDestination(Reference value) { - this.destination = value; - return this; - } - - /** - * @return {@link #destination} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public Location getDestinationTarget() { - if (this.destinationTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyDelivery.destination"); - else if (Configuration.doAutoCreate()) - this.destinationTarget = new Location(); // aa - return this.destinationTarget; - } - - /** - * @param value {@link #destination} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Identification of the facility/location where the Supply was shipped to, as part of the dispense event.) - */ - public SupplyDelivery setDestinationTarget(Location value) { - this.destinationTarget = value; - return this; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - public List getReceiver() { - if (this.receiver == null) - this.receiver = new ArrayList(); - return this.receiver; - } - - public boolean hasReceiver() { - if (this.receiver == null) - return false; - for (Reference item : this.receiver) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #receiver} (Identifies the person who picked up the Supply.) - */ - // syntactic sugar - public Reference addReceiver() { //3 - Reference t = new Reference(); - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return t; - } - - // syntactic sugar - public SupplyDelivery addReceiver(Reference t) { //3 - if (t == null) - return this; - if (this.receiver == null) - this.receiver = new ArrayList(); - this.receiver.add(t); - return this; - } - - /** - * @return {@link #receiver} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) - */ - public List getReceiverTarget() { - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - return this.receiverTarget; - } - - // syntactic sugar - /** - * @return {@link #receiver} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Identifies the person who picked up the Supply.) - */ - public Practitioner addReceiverTarget() { - Practitioner r = new Practitioner(); - if (this.receiverTarget == null) - this.receiverTarget = new ArrayList(); - this.receiverTarget.add(r); - return r; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Identifier assigned by the dispensing facility when the item(s) is dispensed.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "A code specifying the state of the dispense event.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the delivered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("type", "CodeableConcept", "Indicates the type of dispensing event that is performed. Examples include: Trial Fill, Completion of Trial, Partial Fill, Emergency Fill, Samples, etc.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("quantity", "SimpleQuantity", "The amount of supply that has been dispensed. Includes unit of measure.", 0, java.lang.Integer.MAX_VALUE, quantity)); - childrenList.add(new Property("suppliedItem", "Reference(Medication|Substance|Device)", "Identifies the medication, substance or device being dispensed. This is either a link to a resource representing the details of the item or a simple attribute carrying a code that identifies the item from a known list.", 0, java.lang.Integer.MAX_VALUE, suppliedItem)); - childrenList.add(new Property("supplier", "Reference(Practitioner)", "The individual responsible for dispensing the medication, supplier or device.", 0, java.lang.Integer.MAX_VALUE, supplier)); - childrenList.add(new Property("whenPrepared", "Period", "The time the dispense event occurred.", 0, java.lang.Integer.MAX_VALUE, whenPrepared)); - childrenList.add(new Property("time", "dateTime", "The time the dispensed item was sent or handed to the patient (or agent).", 0, java.lang.Integer.MAX_VALUE, time)); - childrenList.add(new Property("destination", "Reference(Location)", "Identification of the facility/location where the Supply was shipped to, as part of the dispense event.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("receiver", "Reference(Practitioner)", "Identifies the person who picked up the Supply.", 0, java.lang.Integer.MAX_VALUE, receiver)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1285004149: /*quantity*/ return this.quantity == null ? new Base[0] : new Base[] {this.quantity}; // SimpleQuantity - case 1993333233: /*suppliedItem*/ return this.suppliedItem == null ? new Base[0] : new Base[] {this.suppliedItem}; // Reference - case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : new Base[] {this.supplier}; // Reference - case -562837097: /*whenPrepared*/ return this.whenPrepared == null ? new Base[0] : new Base[] {this.whenPrepared}; // Period - case 3560141: /*time*/ return this.time == null ? new Base[0] : new Base[] {this.time}; // DateTimeType - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // Reference - case -808719889: /*receiver*/ return this.receiver == null ? new Base[0] : this.receiver.toArray(new Base[this.receiver.size()]); // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -892481550: // status - this.status = new SupplyDeliveryStatusEnumFactory().fromType(value); // Enumeration - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1285004149: // quantity - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - break; - case 1993333233: // suppliedItem - this.suppliedItem = castToReference(value); // Reference - break; - case -1663305268: // supplier - this.supplier = castToReference(value); // Reference - break; - case -562837097: // whenPrepared - this.whenPrepared = castToPeriod(value); // Period - break; - case 3560141: // time - this.time = castToDateTime(value); // DateTimeType - break; - case -1429847026: // destination - this.destination = castToReference(value); // Reference - break; - case -808719889: // receiver - this.getReceiver().add(castToReference(value)); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("status")) - this.status = new SupplyDeliveryStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("quantity")) - this.quantity = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("suppliedItem")) - this.suppliedItem = castToReference(value); // Reference - else if (name.equals("supplier")) - this.supplier = castToReference(value); // Reference - else if (name.equals("whenPrepared")) - this.whenPrepared = castToPeriod(value); // Period - else if (name.equals("time")) - this.time = castToDateTime(value); // DateTimeType - else if (name.equals("destination")) - this.destination = castToReference(value); // Reference - else if (name.equals("receiver")) - this.getReceiver().add(castToReference(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -791418107: return getPatient(); // Reference - case 3575610: return getType(); // CodeableConcept - case -1285004149: return getQuantity(); // SimpleQuantity - case 1993333233: return getSuppliedItem(); // Reference - case -1663305268: return getSupplier(); // Reference - case -562837097: return getWhenPrepared(); // Period - case 3560141: throw new FHIRException("Cannot make property time as it is not a complex type"); // DateTimeType - case -1429847026: return getDestination(); // Reference - case -808719889: return addReceiver(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type SupplyDelivery.status"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("quantity")) { - this.quantity = new SimpleQuantity(); - return this.quantity; - } - else if (name.equals("suppliedItem")) { - this.suppliedItem = new Reference(); - return this.suppliedItem; - } - else if (name.equals("supplier")) { - this.supplier = new Reference(); - return this.supplier; - } - else if (name.equals("whenPrepared")) { - this.whenPrepared = new Period(); - return this.whenPrepared; - } - else if (name.equals("time")) { - throw new FHIRException("Cannot call addChild on a primitive type SupplyDelivery.time"); - } - else if (name.equals("destination")) { - this.destination = new Reference(); - return this.destination; - } - else if (name.equals("receiver")) { - return addReceiver(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "SupplyDelivery"; - - } - - public SupplyDelivery copy() { - SupplyDelivery dst = new SupplyDelivery(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.type = type == null ? null : type.copy(); - dst.quantity = quantity == null ? null : quantity.copy(); - dst.suppliedItem = suppliedItem == null ? null : suppliedItem.copy(); - dst.supplier = supplier == null ? null : supplier.copy(); - dst.whenPrepared = whenPrepared == null ? null : whenPrepared.copy(); - dst.time = time == null ? null : time.copy(); - dst.destination = destination == null ? null : destination.copy(); - if (receiver != null) { - dst.receiver = new ArrayList(); - for (Reference i : receiver) - dst.receiver.add(i.copy()); - }; - return dst; - } - - protected SupplyDelivery typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SupplyDelivery)) - return false; - SupplyDelivery o = (SupplyDelivery) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(patient, o.patient, true) - && compareDeep(type, o.type, true) && compareDeep(quantity, o.quantity, true) && compareDeep(suppliedItem, o.suppliedItem, true) - && compareDeep(supplier, o.supplier, true) && compareDeep(whenPrepared, o.whenPrepared, true) && compareDeep(time, o.time, true) - && compareDeep(destination, o.destination, true) && compareDeep(receiver, o.receiver, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SupplyDelivery)) - return false; - SupplyDelivery o = (SupplyDelivery) other; - return compareValues(status, o.status, true) && compareValues(time, o.time, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (patient == null || patient.isEmpty()) && (type == null || type.isEmpty()) && (quantity == null || quantity.isEmpty()) - && (suppliedItem == null || suppliedItem.isEmpty()) && (supplier == null || supplier.isEmpty()) - && (whenPrepared == null || whenPrepared.isEmpty()) && (time == null || time.isEmpty()) && (destination == null || destination.isEmpty()) - && (receiver == null || receiver.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SupplyDelivery; - } - - /** - * Search parameter: patient - *

- * Description: Patient for whom the item is supplied
- * Type: reference
- * Path: SupplyDelivery.patient
- *

- */ - @SearchParamDefinition(name="patient", path="SupplyDelivery.patient", description="Patient for whom the item is supplied", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient for whom the item is supplied
- * Type: reference
- * Path: SupplyDelivery.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SupplyDelivery:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("SupplyDelivery:patient").toLocked(); - - /** - * Search parameter: receiver - *

- * Description: Who collected the Supply
- * Type: reference
- * Path: SupplyDelivery.receiver
- *

- */ - @SearchParamDefinition(name="receiver", path="SupplyDelivery.receiver", description="Who collected the Supply", type="reference" ) - public static final String SP_RECEIVER = "receiver"; - /** - * Fluent Client search parameter constant for receiver - *

- * Description: Who collected the Supply
- * Type: reference
- * Path: SupplyDelivery.receiver
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam RECEIVER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_RECEIVER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SupplyDelivery:receiver". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_RECEIVER = new ca.uhn.fhir.model.api.Include("SupplyDelivery:receiver").toLocked(); - - /** - * Search parameter: status - *

- * Description: in-progress | completed | abandoned
- * Type: token
- * Path: SupplyDelivery.status
- *

- */ - @SearchParamDefinition(name="status", path="SupplyDelivery.status", description="in-progress | completed | abandoned", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: in-progress | completed | abandoned
- * Type: token
- * Path: SupplyDelivery.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: identifier - *

- * Description: External identifier
- * Type: token
- * Path: SupplyDelivery.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="SupplyDelivery.identifier", description="External identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: External identifier
- * Type: token
- * Path: SupplyDelivery.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: supplier - *

- * Description: Dispenser
- * Type: reference
- * Path: SupplyDelivery.supplier
- *

- */ - @SearchParamDefinition(name="supplier", path="SupplyDelivery.supplier", description="Dispenser", type="reference" ) - public static final String SP_SUPPLIER = "supplier"; - /** - * Fluent Client search parameter constant for supplier - *

- * Description: Dispenser
- * Type: reference
- * Path: SupplyDelivery.supplier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLIER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPLIER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SupplyDelivery:supplier". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLIER = new ca.uhn.fhir.model.api.Include("SupplyDelivery:supplier").toLocked(); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SupplyRequest.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SupplyRequest.java deleted file mode 100644 index 201af41e2ed..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/SupplyRequest.java +++ /dev/null @@ -1,1229 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; - -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; -/** - * A record of a request for a medication, substance or device used in the healthcare setting. - */ -@ResourceDef(name="SupplyRequest", profile="http://hl7.org/fhir/Profile/SupplyRequest") -public class SupplyRequest extends DomainResource { - - public enum SupplyRequestStatus { - /** - * Supply has been requested, but not dispensed. - */ - REQUESTED, - /** - * Supply has been received by the requestor. - */ - COMPLETED, - /** - * The supply will not be completed because the supplier was unable or unwilling to supply the item. - */ - FAILED, - /** - * The orderer of the supply cancelled the request. - */ - CANCELLED, - /** - * added to help the parsers - */ - NULL; - public static SupplyRequestStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return REQUESTED; - if ("completed".equals(codeString)) - return COMPLETED; - if ("failed".equals(codeString)) - return FAILED; - if ("cancelled".equals(codeString)) - return CANCELLED; - throw new FHIRException("Unknown SupplyRequestStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case REQUESTED: return "requested"; - case COMPLETED: return "completed"; - case FAILED: return "failed"; - case CANCELLED: return "cancelled"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case REQUESTED: return "http://hl7.org/fhir/supplyrequest-status"; - case COMPLETED: return "http://hl7.org/fhir/supplyrequest-status"; - case FAILED: return "http://hl7.org/fhir/supplyrequest-status"; - case CANCELLED: return "http://hl7.org/fhir/supplyrequest-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case REQUESTED: return "Supply has been requested, but not dispensed."; - case COMPLETED: return "Supply has been received by the requestor."; - case FAILED: return "The supply will not be completed because the supplier was unable or unwilling to supply the item."; - case CANCELLED: return "The orderer of the supply cancelled the request."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case REQUESTED: return "Requested"; - case COMPLETED: return "Received"; - case FAILED: return "Failed"; - case CANCELLED: return "Cancelled"; - default: return "?"; - } - } - } - - public static class SupplyRequestStatusEnumFactory implements EnumFactory { - public SupplyRequestStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return SupplyRequestStatus.REQUESTED; - if ("completed".equals(codeString)) - return SupplyRequestStatus.COMPLETED; - if ("failed".equals(codeString)) - return SupplyRequestStatus.FAILED; - if ("cancelled".equals(codeString)) - return SupplyRequestStatus.CANCELLED; - throw new IllegalArgumentException("Unknown SupplyRequestStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("requested".equals(codeString)) - return new Enumeration(this, SupplyRequestStatus.REQUESTED); - if ("completed".equals(codeString)) - return new Enumeration(this, SupplyRequestStatus.COMPLETED); - if ("failed".equals(codeString)) - return new Enumeration(this, SupplyRequestStatus.FAILED); - if ("cancelled".equals(codeString)) - return new Enumeration(this, SupplyRequestStatus.CANCELLED); - throw new FHIRException("Unknown SupplyRequestStatus code '"+codeString+"'"); - } - public String toCode(SupplyRequestStatus code) { - if (code == SupplyRequestStatus.REQUESTED) - return "requested"; - if (code == SupplyRequestStatus.COMPLETED) - return "completed"; - if (code == SupplyRequestStatus.FAILED) - return "failed"; - if (code == SupplyRequestStatus.CANCELLED) - return "cancelled"; - return "?"; - } - public String toSystem(SupplyRequestStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class SupplyRequestWhenComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Code indicating when the request should be fulfilled. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fulfilment code", formalDefinition="Code indicating when the request should be fulfilled." ) - protected CodeableConcept code; - - /** - * Formal fulfillment schedule. - */ - @Child(name = "schedule", type = {Timing.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Formal fulfillment schedule", formalDefinition="Formal fulfillment schedule." ) - protected Timing schedule; - - private static final long serialVersionUID = 307115287L; - - /** - * Constructor - */ - public SupplyRequestWhenComponent() { - super(); - } - - /** - * @return {@link #code} (Code indicating when the request should be fulfilled.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequestWhenComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Code indicating when the request should be fulfilled.) - */ - public SupplyRequestWhenComponent setCode(CodeableConcept value) { - this.code = value; - return this; - } - - /** - * @return {@link #schedule} (Formal fulfillment schedule.) - */ - public Timing getSchedule() { - if (this.schedule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequestWhenComponent.schedule"); - else if (Configuration.doAutoCreate()) - this.schedule = new Timing(); // cc - return this.schedule; - } - - public boolean hasSchedule() { - return this.schedule != null && !this.schedule.isEmpty(); - } - - /** - * @param value {@link #schedule} (Formal fulfillment schedule.) - */ - public SupplyRequestWhenComponent setSchedule(Timing value) { - this.schedule = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "CodeableConcept", "Code indicating when the request should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("schedule", "Timing", "Formal fulfillment schedule.", 0, java.lang.Integer.MAX_VALUE, schedule)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - case -697920873: /*schedule*/ return this.schedule == null ? new Base[0] : new Base[] {this.schedule}; // Timing - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - case -697920873: // schedule - this.schedule = castToTiming(value); // Timing - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("schedule")) - this.schedule = castToTiming(value); // Timing - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: return getCode(); // CodeableConcept - case -697920873: return getSchedule(); // Timing - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else if (name.equals("schedule")) { - this.schedule = new Timing(); - return this.schedule; - } - else - return super.addChild(name); - } - - public SupplyRequestWhenComponent copy() { - SupplyRequestWhenComponent dst = new SupplyRequestWhenComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.schedule = schedule == null ? null : schedule.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SupplyRequestWhenComponent)) - return false; - SupplyRequestWhenComponent o = (SupplyRequestWhenComponent) other; - return compareDeep(code, o.code, true) && compareDeep(schedule, o.schedule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SupplyRequestWhenComponent)) - return false; - SupplyRequestWhenComponent o = (SupplyRequestWhenComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (schedule == null || schedule.isEmpty()) - ; - } - - public String fhirType() { - return "SupplyRequest.when"; - - } - - } - - /** - * A link to a resource representing the person whom the ordered item is for. - */ - @Child(name = "patient", type = {Patient.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Patient for whom the item is supplied", formalDefinition="A link to a resource representing the person whom the ordered item is for." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person whom the ordered item is for.) - */ - protected Patient patientTarget; - - /** - * The Practitioner , Organization or Patient who initiated this order for the supply. - */ - @Child(name = "source", type = {Practitioner.class, Organization.class, Patient.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who initiated this order", formalDefinition="The Practitioner , Organization or Patient who initiated this order for the supply." ) - protected Reference source; - - /** - * The actual object that is the target of the reference (The Practitioner , Organization or Patient who initiated this order for the supply.) - */ - protected Resource sourceTarget; - - /** - * When the request was made. - */ - @Child(name = "date", type = {DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the request was made", formalDefinition="When the request was made." ) - protected DateTimeType date; - - /** - * Unique identifier for this supply request. - */ - @Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Unique identifier", formalDefinition="Unique identifier for this supply request." ) - protected Identifier identifier; - - /** - * Status of the supply request. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=0, max=1, modifier=true, summary=true) - @Description(shortDefinition="requested | completed | failed | cancelled", formalDefinition="Status of the supply request." ) - protected Enumeration status; - - /** - * Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process. - */ - @Child(name = "kind", type = {CodeableConcept.class}, order=5, min=0, max=1, modifier=false, summary=true) - @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." ) - protected CodeableConcept kind; - - /** - * The item that is requested to be supplied. - */ - @Child(name = "orderedItem", type = {Medication.class, Substance.class, Device.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Medication, Substance, or Device requested to be supplied", formalDefinition="The item that is requested to be supplied." ) - protected Reference orderedItem; - - /** - * The actual object that is the target of the reference (The item that is requested to be supplied.) - */ - protected Resource orderedItemTarget; - - /** - * Who is intended to fulfill the request. - */ - @Child(name = "supplier", type = {Organization.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Who is intended to fulfill the request", formalDefinition="Who is intended to fulfill the request." ) - protected List supplier; - /** - * The actual objects that are the target of the reference (Who is intended to fulfill the request.) - */ - protected List supplierTarget; - - - /** - * Why the supply item was requested. - */ - @Child(name = "reason", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Why the supply item was requested", formalDefinition="Why the supply item was requested." ) - protected Type reason; - - /** - * When the request should be fulfilled. - */ - @Child(name = "when", type = {}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the request should be fulfilled", formalDefinition="When the request should be fulfilled." ) - protected SupplyRequestWhenComponent when; - - private static final long serialVersionUID = 1649766198L; - - /** - * Constructor - */ - public SupplyRequest() { - super(); - } - - /** - * @return {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person whom the ordered item is for.) - */ - public SupplyRequest setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person whom the ordered item is for.) - */ - public SupplyRequest setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #source} (The Practitioner , Organization or Patient who initiated this order for the supply.) - */ - public Reference getSource() { - if (this.source == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.source"); - else if (Configuration.doAutoCreate()) - this.source = new Reference(); // cc - return this.source; - } - - public boolean hasSource() { - return this.source != null && !this.source.isEmpty(); - } - - /** - * @param value {@link #source} (The Practitioner , Organization or Patient who initiated this order for the supply.) - */ - public SupplyRequest setSource(Reference value) { - this.source = value; - return this; - } - - /** - * @return {@link #source} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The Practitioner , Organization or Patient who initiated this order for the supply.) - */ - public Resource getSourceTarget() { - return this.sourceTarget; - } - - /** - * @param value {@link #source} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The Practitioner , Organization or Patient who initiated this order for the supply.) - */ - public SupplyRequest setSourceTarget(Resource value) { - this.sourceTarget = value; - return this; - } - - /** - * @return {@link #date} (When the request was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (When the request was made.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public SupplyRequest setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return When the request was made. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value When the request was made. - */ - public SupplyRequest setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Unique identifier for this supply request.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Unique identifier for this supply request.) - */ - public SupplyRequest setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new SupplyRequestStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (Status of the supply request.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public SupplyRequest setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return Status of the supply request. - */ - public SupplyRequestStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value Status of the supply request. - */ - public SupplyRequest setStatus(SupplyRequestStatus value) { - if (value == null) - this.status = null; - else { - if (this.status == null) - this.status = new Enumeration(new SupplyRequestStatusEnumFactory()); - this.status.setValue(value); - } - return this; - } - - /** - * @return {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public CodeableConcept getKind() { - if (this.kind == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.kind"); - else if (Configuration.doAutoCreate()) - this.kind = new CodeableConcept(); // cc - return this.kind; - } - - public boolean hasKind() { - return this.kind != null && !this.kind.isEmpty(); - } - - /** - * @param value {@link #kind} (Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.) - */ - public SupplyRequest setKind(CodeableConcept value) { - this.kind = value; - return this; - } - - /** - * @return {@link #orderedItem} (The item that is requested to be supplied.) - */ - public Reference getOrderedItem() { - if (this.orderedItem == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.orderedItem"); - else if (Configuration.doAutoCreate()) - this.orderedItem = new Reference(); // cc - return this.orderedItem; - } - - public boolean hasOrderedItem() { - return this.orderedItem != null && !this.orderedItem.isEmpty(); - } - - /** - * @param value {@link #orderedItem} (The item that is requested to be supplied.) - */ - public SupplyRequest setOrderedItem(Reference value) { - this.orderedItem = value; - return this; - } - - /** - * @return {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) - */ - public Resource getOrderedItemTarget() { - return this.orderedItemTarget; - } - - /** - * @param value {@link #orderedItem} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The item that is requested to be supplied.) - */ - public SupplyRequest setOrderedItemTarget(Resource value) { - this.orderedItemTarget = value; - return this; - } - - /** - * @return {@link #supplier} (Who is intended to fulfill the request.) - */ - public List getSupplier() { - if (this.supplier == null) - this.supplier = new ArrayList(); - return this.supplier; - } - - public boolean hasSupplier() { - if (this.supplier == null) - return false; - for (Reference item : this.supplier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #supplier} (Who is intended to fulfill the request.) - */ - // syntactic sugar - public Reference addSupplier() { //3 - Reference t = new Reference(); - if (this.supplier == null) - this.supplier = new ArrayList(); - this.supplier.add(t); - return t; - } - - // syntactic sugar - public SupplyRequest addSupplier(Reference t) { //3 - if (t == null) - return this; - if (this.supplier == null) - this.supplier = new ArrayList(); - this.supplier.add(t); - return this; - } - - /** - * @return {@link #supplier} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Who is intended to fulfill the request.) - */ - public List getSupplierTarget() { - if (this.supplierTarget == null) - this.supplierTarget = new ArrayList(); - return this.supplierTarget; - } - - // syntactic sugar - /** - * @return {@link #supplier} (Add an actual object that is the target of the reference. The reference library doesn't use these, but you can use this to hold the resources if you resolvethemt. Who is intended to fulfill the request.) - */ - public Organization addSupplierTarget() { - Organization r = new Organization(); - if (this.supplierTarget == null) - this.supplierTarget = new ArrayList(); - this.supplierTarget.add(r); - return r; - } - - /** - * @return {@link #reason} (Why the supply item was requested.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Why the supply item was requested.) - */ - public CodeableConcept getReasonCodeableConcept() throws FHIRException { - if (!(this.reason instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - public boolean hasReasonCodeableConcept() { - return this.reason instanceof CodeableConcept; - } - - /** - * @return {@link #reason} (Why the supply item was requested.) - */ - public Reference getReasonReference() throws FHIRException { - if (!(this.reason instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReasonReference() { - return this.reason instanceof Reference; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Why the supply item was requested.) - */ - public SupplyRequest setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #when} (When the request should be fulfilled.) - */ - public SupplyRequestWhenComponent getWhen() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SupplyRequest.when"); - else if (Configuration.doAutoCreate()) - this.when = new SupplyRequestWhenComponent(); // cc - return this.when; - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (When the request should be fulfilled.) - */ - public SupplyRequest setWhen(SupplyRequestWhenComponent value) { - this.when = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person whom the ordered item is for.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("source", "Reference(Practitioner|Organization|Patient)", "The Practitioner , Organization or Patient who initiated this order for the supply.", 0, java.lang.Integer.MAX_VALUE, source)); - childrenList.add(new Property("date", "dateTime", "When the request was made.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("identifier", "Identifier", "Unique identifier for this supply request.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("status", "code", "Status of the supply request.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("kind", "CodeableConcept", "Category of supply, e.g. central, non-stock, etc. This is used to support work flows associated with the supply process.", 0, java.lang.Integer.MAX_VALUE, kind)); - childrenList.add(new Property("orderedItem", "Reference(Medication|Substance|Device)", "The item that is requested to be supplied.", 0, java.lang.Integer.MAX_VALUE, orderedItem)); - childrenList.add(new Property("supplier", "Reference(Organization)", "Who is intended to fulfill the request.", 0, java.lang.Integer.MAX_VALUE, supplier)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Any)", "Why the supply item was requested.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("when", "", "When the request should be fulfilled.", 0, java.lang.Integer.MAX_VALUE, when)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Reference - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // CodeableConcept - case 2129914144: /*orderedItem*/ return this.orderedItem == null ? new Base[0] : new Base[] {this.orderedItem}; // Reference - case -1663305268: /*supplier*/ return this.supplier == null ? new Base[0] : this.supplier.toArray(new Base[this.supplier.size()]); // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type - case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // SupplyRequestWhenComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case -896505829: // source - this.source = castToReference(value); // Reference - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -892481550: // status - this.status = new SupplyRequestStatusEnumFactory().fromType(value); // Enumeration - break; - case 3292052: // kind - this.kind = castToCodeableConcept(value); // CodeableConcept - break; - case 2129914144: // orderedItem - this.orderedItem = castToReference(value); // Reference - break; - case -1663305268: // supplier - this.getSupplier().add(castToReference(value)); // Reference - break; - case -934964668: // reason - this.reason = (Type) value; // Type - break; - case 3648314: // when - this.when = (SupplyRequestWhenComponent) value; // SupplyRequestWhenComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("source")) - this.source = castToReference(value); // Reference - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("status")) - this.status = new SupplyRequestStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("kind")) - this.kind = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("orderedItem")) - this.orderedItem = castToReference(value); // Reference - else if (name.equals("supplier")) - this.getSupplier().add(castToReference(value)); - else if (name.equals("reason[x]")) - this.reason = (Type) value; // Type - else if (name.equals("when")) - this.when = (SupplyRequestWhenComponent) value; // SupplyRequestWhenComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -791418107: return getPatient(); // Reference - case -896505829: return getSource(); // Reference - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1618432855: return getIdentifier(); // Identifier - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case 3292052: return getKind(); // CodeableConcept - case 2129914144: return getOrderedItem(); // Reference - case -1663305268: return addSupplier(); // Reference - case -669418564: return getReason(); // Type - case 3648314: return getWhen(); // SupplyRequestWhenComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("source")) { - this.source = new Reference(); - return this.source; - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.date"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type SupplyRequest.status"); - } - else if (name.equals("kind")) { - this.kind = new CodeableConcept(); - return this.kind; - } - else if (name.equals("orderedItem")) { - this.orderedItem = new Reference(); - return this.orderedItem; - } - else if (name.equals("supplier")) { - return addSupplier(); - } - else if (name.equals("reasonCodeableConcept")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("reasonReference")) { - this.reason = new Reference(); - return this.reason; - } - else if (name.equals("when")) { - this.when = new SupplyRequestWhenComponent(); - return this.when; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "SupplyRequest"; - - } - - public SupplyRequest copy() { - SupplyRequest dst = new SupplyRequest(); - copyValues(dst); - dst.patient = patient == null ? null : patient.copy(); - dst.source = source == null ? null : source.copy(); - dst.date = date == null ? null : date.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.status = status == null ? null : status.copy(); - dst.kind = kind == null ? null : kind.copy(); - dst.orderedItem = orderedItem == null ? null : orderedItem.copy(); - if (supplier != null) { - dst.supplier = new ArrayList(); - for (Reference i : supplier) - dst.supplier.add(i.copy()); - }; - dst.reason = reason == null ? null : reason.copy(); - dst.when = when == null ? null : when.copy(); - return dst; - } - - protected SupplyRequest typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SupplyRequest)) - return false; - SupplyRequest o = (SupplyRequest) other; - return compareDeep(patient, o.patient, true) && compareDeep(source, o.source, true) && compareDeep(date, o.date, true) - && compareDeep(identifier, o.identifier, true) && compareDeep(status, o.status, true) && compareDeep(kind, o.kind, true) - && compareDeep(orderedItem, o.orderedItem, true) && compareDeep(supplier, o.supplier, true) && compareDeep(reason, o.reason, true) - && compareDeep(when, o.when, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SupplyRequest)) - return false; - SupplyRequest o = (SupplyRequest) other; - return compareValues(date, o.date, true) && compareValues(status, o.status, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (patient == null || patient.isEmpty()) && (source == null || source.isEmpty()) - && (date == null || date.isEmpty()) && (identifier == null || identifier.isEmpty()) && (status == null || status.isEmpty()) - && (kind == null || kind.isEmpty()) && (orderedItem == null || orderedItem.isEmpty()) && (supplier == null || supplier.isEmpty()) - && (reason == null || reason.isEmpty()) && (when == null || when.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.SupplyRequest; - } - - /** - * Search parameter: patient - *

- * Description: Patient for whom the item is supplied
- * Type: reference
- * Path: SupplyRequest.patient
- *

- */ - @SearchParamDefinition(name="patient", path="SupplyRequest.patient", description="Patient for whom the item is supplied", type="reference" ) - public static final String SP_PATIENT = "patient"; - /** - * Fluent Client search parameter constant for patient - *

- * Description: Patient for whom the item is supplied
- * Type: reference
- * Path: SupplyRequest.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SupplyRequest:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("SupplyRequest:patient").toLocked(); - - /** - * Search parameter: source - *

- * Description: Who initiated this order
- * Type: reference
- * Path: SupplyRequest.source
- *

- */ - @SearchParamDefinition(name="source", path="SupplyRequest.source", description="Who initiated this order", type="reference" ) - public static final String SP_SOURCE = "source"; - /** - * Fluent Client search parameter constant for source - *

- * Description: Who initiated this order
- * Type: reference
- * Path: SupplyRequest.source
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SOURCE = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SOURCE); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SupplyRequest:source". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SOURCE = new ca.uhn.fhir.model.api.Include("SupplyRequest:source").toLocked(); - - /** - * Search parameter: status - *

- * Description: requested | completed | failed | cancelled
- * Type: token
- * Path: SupplyRequest.status
- *

- */ - @SearchParamDefinition(name="status", path="SupplyRequest.status", description="requested | completed | failed | cancelled", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: requested | completed | failed | cancelled
- * Type: token
- * Path: SupplyRequest.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: date - *

- * Description: When the request was made
- * Type: date
- * Path: SupplyRequest.date
- *

- */ - @SearchParamDefinition(name="date", path="SupplyRequest.date", description="When the request was made", type="date" ) - public static final String SP_DATE = "date"; - /** - * Fluent Client search parameter constant for date - *

- * Description: When the request was made
- * Type: date
- * Path: SupplyRequest.date
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: Unique identifier
- * Type: token
- * Path: SupplyRequest.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="SupplyRequest.identifier", description="Unique identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Unique identifier
- * Type: token
- * Path: SupplyRequest.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: supplier - *

- * Description: Who is intended to fulfill the request
- * Type: reference
- * Path: SupplyRequest.supplier
- *

- */ - @SearchParamDefinition(name="supplier", path="SupplyRequest.supplier", description="Who is intended to fulfill the request", type="reference" ) - public static final String SP_SUPPLIER = "supplier"; - /** - * Fluent Client search parameter constant for supplier - *

- * Description: Who is intended to fulfill the request
- * Type: reference
- * Path: SupplyRequest.supplier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUPPLIER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUPPLIER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "SupplyRequest:supplier". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUPPLIER = new ca.uhn.fhir.model.api.Include("SupplyRequest:supplier").toLocked(); - - /** - * Search parameter: kind - *

- * Description: The kind of supply (central, non-stock, etc.)
- * Type: token
- * Path: SupplyRequest.kind
- *

- */ - @SearchParamDefinition(name="kind", path="SupplyRequest.kind", description="The kind of supply (central, non-stock, etc.)", type="token" ) - public static final String SP_KIND = "kind"; - /** - * Fluent Client search parameter constant for kind - *

- * Description: The kind of supply (central, non-stock, etc.)
- * Type: token
- * Path: SupplyRequest.kind
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam KIND = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_KIND); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Task.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Task.java deleted file mode 100644 index 41519c426da..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Task.java +++ /dev/null @@ -1,2474 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A task to be performed. - */ -@ResourceDef(name="Task", profile="http://hl7.org/fhir/Profile/Task") -public class Task extends DomainResource { - - public enum TaskPriority { - /** - * This task has low priority. - */ - LOW, - /** - * This task has normal priority. - */ - NORMAL, - /** - * This task has high priority. - */ - HIGH, - /** - * added to help the parsers - */ - NULL; - public static TaskPriority fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return LOW; - if ("normal".equals(codeString)) - return NORMAL; - if ("high".equals(codeString)) - return HIGH; - throw new FHIRException("Unknown TaskPriority code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case LOW: return "low"; - case NORMAL: return "normal"; - case HIGH: return "high"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case LOW: return "http://hl7.org/fhir/task-priority"; - case NORMAL: return "http://hl7.org/fhir/task-priority"; - case HIGH: return "http://hl7.org/fhir/task-priority"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case LOW: return "This task has low priority."; - case NORMAL: return "This task has normal priority."; - case HIGH: return "This task has high priority."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case LOW: return "Low"; - case NORMAL: return "Normal"; - case HIGH: return "High"; - default: return "?"; - } - } - } - - public static class TaskPriorityEnumFactory implements EnumFactory { - public TaskPriority fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return TaskPriority.LOW; - if ("normal".equals(codeString)) - return TaskPriority.NORMAL; - if ("high".equals(codeString)) - return TaskPriority.HIGH; - throw new IllegalArgumentException("Unknown TaskPriority code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("low".equals(codeString)) - return new Enumeration(this, TaskPriority.LOW); - if ("normal".equals(codeString)) - return new Enumeration(this, TaskPriority.NORMAL); - if ("high".equals(codeString)) - return new Enumeration(this, TaskPriority.HIGH); - throw new FHIRException("Unknown TaskPriority code '"+codeString+"'"); - } - public String toCode(TaskPriority code) { - if (code == TaskPriority.LOW) - return "low"; - if (code == TaskPriority.NORMAL) - return "normal"; - if (code == TaskPriority.HIGH) - return "high"; - return "?"; - } - public String toSystem(TaskPriority code) { - return code.getSystem(); - } - } - - public enum TaskStatus { - /** - * The task is not yet ready to be acted upon. - */ - DRAFT, - /** - * The task is ready to be acted upon - */ - REQUESTED, - /** - * A potential performer has claimed ownership of the task and is evaluating whether to perform it - */ - RECEIVED, - /** - * The potential performer has agreed to execute the task but has not yet started work - */ - ACCEPTED, - /** - * The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action. - */ - REJECTED, - /** - * Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given. - */ - READY, - /** - * Task has been started but is not yet complete. - */ - INPROGRESS, - /** - * Task has been started but work has been paused - */ - ONHOLD, - /** - * The task was attempted but could not be completed due to some error. - */ - FAILED, - /** - * The task has been completed (more or less) as requested. - */ - COMPLETED, - /** - * added to help the parsers - */ - NULL; - public static TaskStatus fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return DRAFT; - if ("requested".equals(codeString)) - return REQUESTED; - if ("received".equals(codeString)) - return RECEIVED; - if ("accepted".equals(codeString)) - return ACCEPTED; - if ("rejected".equals(codeString)) - return REJECTED; - if ("ready".equals(codeString)) - return READY; - if ("in-progress".equals(codeString)) - return INPROGRESS; - if ("on-hold".equals(codeString)) - return ONHOLD; - if ("failed".equals(codeString)) - return FAILED; - if ("completed".equals(codeString)) - return COMPLETED; - throw new FHIRException("Unknown TaskStatus code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case DRAFT: return "draft"; - case REQUESTED: return "requested"; - case RECEIVED: return "received"; - case ACCEPTED: return "accepted"; - case REJECTED: return "rejected"; - case READY: return "ready"; - case INPROGRESS: return "in-progress"; - case ONHOLD: return "on-hold"; - case FAILED: return "failed"; - case COMPLETED: return "completed"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case DRAFT: return "http://hl7.org/fhir/task-status"; - case REQUESTED: return "http://hl7.org/fhir/task-status"; - case RECEIVED: return "http://hl7.org/fhir/task-status"; - case ACCEPTED: return "http://hl7.org/fhir/task-status"; - case REJECTED: return "http://hl7.org/fhir/task-status"; - case READY: return "http://hl7.org/fhir/task-status"; - case INPROGRESS: return "http://hl7.org/fhir/task-status"; - case ONHOLD: return "http://hl7.org/fhir/task-status"; - case FAILED: return "http://hl7.org/fhir/task-status"; - case COMPLETED: return "http://hl7.org/fhir/task-status"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case DRAFT: return "The task is not yet ready to be acted upon."; - case REQUESTED: return "The task is ready to be acted upon"; - case RECEIVED: return "A potential performer has claimed ownership of the task and is evaluating whether to perform it"; - case ACCEPTED: return "The potential performer has agreed to execute the task but has not yet started work"; - case REJECTED: return "The potential performer who claimed ownership of the task has decided not to execute it prior to performing any action."; - case READY: return "Task is ready to be performed, but no action has yet been taken. Used in place of requested/received/accepted/rejected when request assignment and acceptance is a given."; - case INPROGRESS: return "Task has been started but is not yet complete."; - case ONHOLD: return "Task has been started but work has been paused"; - case FAILED: return "The task was attempted but could not be completed due to some error."; - case COMPLETED: return "The task has been completed (more or less) as requested."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case DRAFT: return "Draft"; - case REQUESTED: return "Requested"; - case RECEIVED: return "Received"; - case ACCEPTED: return "Accepted"; - case REJECTED: return "Rejected"; - case READY: return "Ready"; - case INPROGRESS: return "In Progress"; - case ONHOLD: return "On Hold"; - case FAILED: return "Failed"; - case COMPLETED: return "Completed"; - default: return "?"; - } - } - } - - public static class TaskStatusEnumFactory implements EnumFactory { - public TaskStatus fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return TaskStatus.DRAFT; - if ("requested".equals(codeString)) - return TaskStatus.REQUESTED; - if ("received".equals(codeString)) - return TaskStatus.RECEIVED; - if ("accepted".equals(codeString)) - return TaskStatus.ACCEPTED; - if ("rejected".equals(codeString)) - return TaskStatus.REJECTED; - if ("ready".equals(codeString)) - return TaskStatus.READY; - if ("in-progress".equals(codeString)) - return TaskStatus.INPROGRESS; - if ("on-hold".equals(codeString)) - return TaskStatus.ONHOLD; - if ("failed".equals(codeString)) - return TaskStatus.FAILED; - if ("completed".equals(codeString)) - return TaskStatus.COMPLETED; - throw new IllegalArgumentException("Unknown TaskStatus code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("draft".equals(codeString)) - return new Enumeration(this, TaskStatus.DRAFT); - if ("requested".equals(codeString)) - return new Enumeration(this, TaskStatus.REQUESTED); - if ("received".equals(codeString)) - return new Enumeration(this, TaskStatus.RECEIVED); - if ("accepted".equals(codeString)) - return new Enumeration(this, TaskStatus.ACCEPTED); - if ("rejected".equals(codeString)) - return new Enumeration(this, TaskStatus.REJECTED); - if ("ready".equals(codeString)) - return new Enumeration(this, TaskStatus.READY); - if ("in-progress".equals(codeString)) - return new Enumeration(this, TaskStatus.INPROGRESS); - if ("on-hold".equals(codeString)) - return new Enumeration(this, TaskStatus.ONHOLD); - if ("failed".equals(codeString)) - return new Enumeration(this, TaskStatus.FAILED); - if ("completed".equals(codeString)) - return new Enumeration(this, TaskStatus.COMPLETED); - throw new FHIRException("Unknown TaskStatus code '"+codeString+"'"); - } - public String toCode(TaskStatus code) { - if (code == TaskStatus.DRAFT) - return "draft"; - if (code == TaskStatus.REQUESTED) - return "requested"; - if (code == TaskStatus.RECEIVED) - return "received"; - if (code == TaskStatus.ACCEPTED) - return "accepted"; - if (code == TaskStatus.REJECTED) - return "rejected"; - if (code == TaskStatus.READY) - return "ready"; - if (code == TaskStatus.INPROGRESS) - return "in-progress"; - if (code == TaskStatus.ONHOLD) - return "on-hold"; - if (code == TaskStatus.FAILED) - return "failed"; - if (code == TaskStatus.COMPLETED) - return "completed"; - return "?"; - } - public String toSystem(TaskStatus code) { - return code.getSystem(); - } - } - - @Block() - public static class ParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the input parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Input Name", formalDefinition="The name of the input parameter." ) - protected StringType name; - - /** - * The value of the input parameter as a basic type. - */ - @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Input Value", formalDefinition="The value of the input parameter as a basic type." ) - protected org.hl7.fhir.dstu2016may.model.Type value; - - private static final long serialVersionUID = 342865819L; - - /** - * Constructor - */ - public ParameterComponent() { - super(); - } - - /** - * Constructor - */ - public ParameterComponent(StringType name, org.hl7.fhir.dstu2016may.model.Type value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (The name of the input parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the input parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the input parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the input parameter. - */ - public ParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the input parameter as a basic type.) - */ - public org.hl7.fhir.dstu2016may.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the input parameter as a basic type.) - */ - public ParameterComponent setValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the input parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "The value of the input parameter as a basic type.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value[x]")) - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.name"); - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else if (name.equals("valueBase64Binary")) { - this.value = new Base64BinaryType(); - return this.value; - } - else if (name.equals("valueInstant")) { - this.value = new InstantType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueUri")) { - this.value = new UriType(); - return this.value; - } - else if (name.equals("valueDate")) { - this.value = new DateType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueCode")) { - this.value = new CodeType(); - return this.value; - } - else if (name.equals("valueOid")) { - this.value = new OidType(); - return this.value; - } - else if (name.equals("valueId")) { - this.value = new IdType(); - return this.value; - } - else if (name.equals("valueUnsignedInt")) { - this.value = new UnsignedIntType(); - return this.value; - } - else if (name.equals("valuePositiveInt")) { - this.value = new PositiveIntType(); - return this.value; - } - else if (name.equals("valueMarkdown")) { - this.value = new MarkdownType(); - return this.value; - } - else if (name.equals("valueAnnotation")) { - this.value = new Annotation(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueIdentifier")) { - this.value = new Identifier(); - return this.value; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else if (name.equals("valueRatio")) { - this.value = new Ratio(); - return this.value; - } - else if (name.equals("valueSampledData")) { - this.value = new SampledData(); - return this.value; - } - else if (name.equals("valueSignature")) { - this.value = new Signature(); - return this.value; - } - else if (name.equals("valueHumanName")) { - this.value = new HumanName(); - return this.value; - } - else if (name.equals("valueAddress")) { - this.value = new Address(); - return this.value; - } - else if (name.equals("valueContactPoint")) { - this.value = new ContactPoint(); - return this.value; - } - else if (name.equals("valueTiming")) { - this.value = new Timing(); - return this.value; - } - else if (name.equals("valueReference")) { - this.value = new Reference(); - return this.value; - } - else if (name.equals("valueMeta")) { - this.value = new Meta(); - return this.value; - } - else - return super.addChild(name); - } - - public ParameterComponent copy() { - ParameterComponent dst = new ParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ParameterComponent)) - return false; - ParameterComponent o = (ParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ParameterComponent)) - return false; - ParameterComponent o = (ParameterComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "Task.input"; - - } - - } - - @Block() - public static class TaskOutputComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the Output parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Output Name", formalDefinition="The name of the Output parameter." ) - protected StringType name; - - /** - * The value of the Output parameter as a basic type. - */ - @Child(name = "value", type = {}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Output Value", formalDefinition="The value of the Output parameter as a basic type." ) - protected org.hl7.fhir.dstu2016may.model.Type value; - - private static final long serialVersionUID = 342865819L; - - /** - * Constructor - */ - public TaskOutputComponent() { - super(); - } - - /** - * Constructor - */ - public TaskOutputComponent(StringType name, org.hl7.fhir.dstu2016may.model.Type value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (The name of the Output parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TaskOutputComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the Output parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TaskOutputComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the Output parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the Output parameter. - */ - public TaskOutputComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the Output parameter as a basic type.) - */ - public org.hl7.fhir.dstu2016may.model.Type getValue() { - return this.value; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the Output parameter as a basic type.) - */ - public TaskOutputComponent setValue(org.hl7.fhir.dstu2016may.model.Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the Output parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "*", "The value of the Output parameter as a basic type.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // org.hl7.fhir.dstu2016may.model.Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value[x]")) - this.value = (org.hl7.fhir.dstu2016may.model.Type) value; // org.hl7.fhir.dstu2016may.model.Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1410166417: return getValue(); // org.hl7.fhir.dstu2016may.model.Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.name"); - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else if (name.equals("valueBase64Binary")) { - this.value = new Base64BinaryType(); - return this.value; - } - else if (name.equals("valueInstant")) { - this.value = new InstantType(); - return this.value; - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueUri")) { - this.value = new UriType(); - return this.value; - } - else if (name.equals("valueDate")) { - this.value = new DateType(); - return this.value; - } - else if (name.equals("valueDateTime")) { - this.value = new DateTimeType(); - return this.value; - } - else if (name.equals("valueTime")) { - this.value = new TimeType(); - return this.value; - } - else if (name.equals("valueCode")) { - this.value = new CodeType(); - return this.value; - } - else if (name.equals("valueOid")) { - this.value = new OidType(); - return this.value; - } - else if (name.equals("valueId")) { - this.value = new IdType(); - return this.value; - } - else if (name.equals("valueUnsignedInt")) { - this.value = new UnsignedIntType(); - return this.value; - } - else if (name.equals("valuePositiveInt")) { - this.value = new PositiveIntType(); - return this.value; - } - else if (name.equals("valueMarkdown")) { - this.value = new MarkdownType(); - return this.value; - } - else if (name.equals("valueAnnotation")) { - this.value = new Annotation(); - return this.value; - } - else if (name.equals("valueAttachment")) { - this.value = new Attachment(); - return this.value; - } - else if (name.equals("valueIdentifier")) { - this.value = new Identifier(); - return this.value; - } - else if (name.equals("valueCodeableConcept")) { - this.value = new CodeableConcept(); - return this.value; - } - else if (name.equals("valueCoding")) { - this.value = new Coding(); - return this.value; - } - else if (name.equals("valueQuantity")) { - this.value = new Quantity(); - return this.value; - } - else if (name.equals("valueRange")) { - this.value = new Range(); - return this.value; - } - else if (name.equals("valuePeriod")) { - this.value = new Period(); - return this.value; - } - else if (name.equals("valueRatio")) { - this.value = new Ratio(); - return this.value; - } - else if (name.equals("valueSampledData")) { - this.value = new SampledData(); - return this.value; - } - else if (name.equals("valueSignature")) { - this.value = new Signature(); - return this.value; - } - else if (name.equals("valueHumanName")) { - this.value = new HumanName(); - return this.value; - } - else if (name.equals("valueAddress")) { - this.value = new Address(); - return this.value; - } - else if (name.equals("valueContactPoint")) { - this.value = new ContactPoint(); - return this.value; - } - else if (name.equals("valueTiming")) { - this.value = new Timing(); - return this.value; - } - else if (name.equals("valueReference")) { - this.value = new Reference(); - return this.value; - } - else if (name.equals("valueMeta")) { - this.value = new Meta(); - return this.value; - } - else - return super.addChild(name); - } - - public TaskOutputComponent copy() { - TaskOutputComponent dst = new TaskOutputComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TaskOutputComponent)) - return false; - TaskOutputComponent o = (TaskOutputComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TaskOutputComponent)) - return false; - TaskOutputComponent o = (TaskOutputComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "Task.output"; - - } - - } - - /** - * The business identifier for this task. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Task Instance Identifier", formalDefinition="The business identifier for this task." ) - protected Identifier identifier; - - /** - * A name or code (or both) briefly describing what the task involves. - */ - @Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Type", formalDefinition="A name or code (or both) briefly describing what the task involves." ) - protected CodeableConcept type; - - /** - * A description of this task. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Description", formalDefinition="A description of this task." ) - protected StringType description; - - /** - * The type of participant that can execute the task. - */ - @Child(name = "performerType", type = {Coding.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="requester | dispatcher | scheduler | performer | monitor | manager | acquirer | reviewer", formalDefinition="The type of participant that can execute the task." ) - protected List performerType; - - /** - * The priority of the task among other tasks of the same type. - */ - @Child(name = "priority", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="low | normal | high", formalDefinition="The priority of the task among other tasks of the same type." ) - protected Enumeration priority; - - /** - * The current status of the task. - */ - @Child(name = "status", type = {CodeType.class}, order=5, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="draft | requested | received | accepted | +", formalDefinition="The current status of the task." ) - protected Enumeration status; - - /** - * An explaination as to why this task failed. - */ - @Child(name = "failureReason", type = {CodeableConcept.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Failure Reason", formalDefinition="An explaination as to why this task failed." ) - protected CodeableConcept failureReason; - - /** - * The subject of the task. - */ - @Child(name = "subject", type = {}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Task Subject", formalDefinition="The subject of the task." ) - protected Reference subject; - - /** - * The actual object that is the target of the reference (The subject of the task.) - */ - protected Resource subjectTarget; - - /** - * The entity who benefits from the performance of the service specified in the task (e.g., the patient). - */ - @Child(name = "for", type = {}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Beneficiary of the Task", formalDefinition="The entity who benefits from the performance of the service specified in the task (e.g., the patient)." ) - protected Reference for_; - - /** - * The actual object that is the target of the reference (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) - */ - protected Resource for_Target; - - /** - * A reference to a formal or informal definition of the task. - */ - @Child(name = "definition", type = {UriType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Definition", formalDefinition="A reference to a formal or informal definition of the task." ) - protected UriType definition; - - /** - * The date and time this task was created. - */ - @Child(name = "created", type = {DateTimeType.class}, order=10, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Task Creation Date", formalDefinition="The date and time this task was created." ) - protected DateTimeType created; - - /** - * The date and time of last modification to this task. - */ - @Child(name = "lastModified", type = {DateTimeType.class}, order=11, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Task Last Modified Date", formalDefinition="The date and time of last modification to this task." ) - protected DateTimeType lastModified; - - /** - * The creator of the task. - */ - @Child(name = "creator", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=12, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Task Creator", formalDefinition="The creator of the task." ) - protected Reference creator; - - /** - * The actual object that is the target of the reference (The creator of the task.) - */ - protected Resource creatorTarget; - - /** - * The owner of this task. The participant who can execute this task. - */ - @Child(name = "owner", type = {Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Task Owner", formalDefinition="The owner of this task. The participant who can execute this task." ) - protected Reference owner; - - /** - * The actual object that is the target of the reference (The owner of this task. The participant who can execute this task.) - */ - protected Resource ownerTarget; - - /** - * Task that this particular task is part of. - */ - @Child(name = "parent", type = {Task.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Composite task", formalDefinition="Task that this particular task is part of." ) - protected Reference parent; - - /** - * The actual object that is the target of the reference (Task that this particular task is part of.) - */ - protected Task parentTarget; - - /** - * Inputs to the task. - */ - @Child(name = "input", type = {}, order=15, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Task Input", formalDefinition="Inputs to the task." ) - protected List input; - - /** - * Outputs produced by the Task. - */ - @Child(name = "output", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Task Output", formalDefinition="Outputs produced by the Task." ) - protected List output; - - private static final long serialVersionUID = 969281174L; - - /** - * Constructor - */ - public Task() { - super(); - } - - /** - * Constructor - */ - public Task(Enumeration status, DateTimeType created, DateTimeType lastModified, Reference creator) { - super(); - this.status = status; - this.created = created; - this.lastModified = lastModified; - this.creator = creator; - } - - /** - * @return {@link #identifier} (The business identifier for this task.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (The business identifier for this task.) - */ - public Task setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #type} (A name or code (or both) briefly describing what the task involves.) - */ - public CodeableConcept getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.type"); - else if (Configuration.doAutoCreate()) - this.type = new CodeableConcept(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (A name or code (or both) briefly describing what the task involves.) - */ - public Task setType(CodeableConcept value) { - this.type = value; - return this; - } - - /** - * @return {@link #description} (A description of this task.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A description of this task.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public Task setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A description of this task. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A description of this task. - */ - public Task setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #performerType} (The type of participant that can execute the task.) - */ - public List getPerformerType() { - if (this.performerType == null) - this.performerType = new ArrayList(); - return this.performerType; - } - - public boolean hasPerformerType() { - if (this.performerType == null) - return false; - for (Coding item : this.performerType) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #performerType} (The type of participant that can execute the task.) - */ - // syntactic sugar - public Coding addPerformerType() { //3 - Coding t = new Coding(); - if (this.performerType == null) - this.performerType = new ArrayList(); - this.performerType.add(t); - return t; - } - - // syntactic sugar - public Task addPerformerType(Coding t) { //3 - if (t == null) - return this; - if (this.performerType == null) - this.performerType = new ArrayList(); - this.performerType.add(t); - return this; - } - - /** - * @return {@link #priority} (The priority of the task among other tasks of the same type.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Enumeration getPriorityElement() { - if (this.priority == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.priority"); - else if (Configuration.doAutoCreate()) - this.priority = new Enumeration(new TaskPriorityEnumFactory()); // bb - return this.priority; - } - - public boolean hasPriorityElement() { - return this.priority != null && !this.priority.isEmpty(); - } - - public boolean hasPriority() { - return this.priority != null && !this.priority.isEmpty(); - } - - /** - * @param value {@link #priority} (The priority of the task among other tasks of the same type.). This is the underlying object with id, value and extensions. The accessor "getPriority" gives direct access to the value - */ - public Task setPriorityElement(Enumeration value) { - this.priority = value; - return this; - } - - /** - * @return The priority of the task among other tasks of the same type. - */ - public TaskPriority getPriority() { - return this.priority == null ? null : this.priority.getValue(); - } - - /** - * @param value The priority of the task among other tasks of the same type. - */ - public Task setPriority(TaskPriority value) { - if (value == null) - this.priority = null; - else { - if (this.priority == null) - this.priority = new Enumeration(new TaskPriorityEnumFactory()); - this.priority.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The current status of the task.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new TaskStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The current status of the task.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Task setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The current status of the task. - */ - public TaskStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The current status of the task. - */ - public Task setStatus(TaskStatus value) { - if (this.status == null) - this.status = new Enumeration(new TaskStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #failureReason} (An explaination as to why this task failed.) - */ - public CodeableConcept getFailureReason() { - if (this.failureReason == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.failureReason"); - else if (Configuration.doAutoCreate()) - this.failureReason = new CodeableConcept(); // cc - return this.failureReason; - } - - public boolean hasFailureReason() { - return this.failureReason != null && !this.failureReason.isEmpty(); - } - - /** - * @param value {@link #failureReason} (An explaination as to why this task failed.) - */ - public Task setFailureReason(CodeableConcept value) { - this.failureReason = value; - return this; - } - - /** - * @return {@link #subject} (The subject of the task.) - */ - public Reference getSubject() { - if (this.subject == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.subject"); - else if (Configuration.doAutoCreate()) - this.subject = new Reference(); // cc - return this.subject; - } - - public boolean hasSubject() { - return this.subject != null && !this.subject.isEmpty(); - } - - /** - * @param value {@link #subject} (The subject of the task.) - */ - public Task setSubject(Reference value) { - this.subject = value; - return this; - } - - /** - * @return {@link #subject} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The subject of the task.) - */ - public Resource getSubjectTarget() { - return this.subjectTarget; - } - - /** - * @param value {@link #subject} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The subject of the task.) - */ - public Task setSubjectTarget(Resource value) { - this.subjectTarget = value; - return this; - } - - /** - * @return {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) - */ - public Reference getFor() { - if (this.for_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.for_"); - else if (Configuration.doAutoCreate()) - this.for_ = new Reference(); // cc - return this.for_; - } - - public boolean hasFor() { - return this.for_ != null && !this.for_.isEmpty(); - } - - /** - * @param value {@link #for_} (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) - */ - public Task setFor(Reference value) { - this.for_ = value; - return this; - } - - /** - * @return {@link #for_} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) - */ - public Resource getForTarget() { - return this.for_Target; - } - - /** - * @param value {@link #for_} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The entity who benefits from the performance of the service specified in the task (e.g., the patient).) - */ - public Task setForTarget(Resource value) { - this.for_Target = value; - return this; - } - - /** - * @return {@link #definition} (A reference to a formal or informal definition of the task.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public UriType getDefinitionElement() { - if (this.definition == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.definition"); - else if (Configuration.doAutoCreate()) - this.definition = new UriType(); // bb - return this.definition; - } - - public boolean hasDefinitionElement() { - return this.definition != null && !this.definition.isEmpty(); - } - - public boolean hasDefinition() { - return this.definition != null && !this.definition.isEmpty(); - } - - /** - * @param value {@link #definition} (A reference to a formal or informal definition of the task.). This is the underlying object with id, value and extensions. The accessor "getDefinition" gives direct access to the value - */ - public Task setDefinitionElement(UriType value) { - this.definition = value; - return this; - } - - /** - * @return A reference to a formal or informal definition of the task. - */ - public String getDefinition() { - return this.definition == null ? null : this.definition.getValue(); - } - - /** - * @param value A reference to a formal or informal definition of the task. - */ - public Task setDefinition(String value) { - if (Utilities.noString(value)) - this.definition = null; - else { - if (this.definition == null) - this.definition = new UriType(); - this.definition.setValue(value); - } - return this; - } - - /** - * @return {@link #created} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public DateTimeType getCreatedElement() { - if (this.created == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.created"); - else if (Configuration.doAutoCreate()) - this.created = new DateTimeType(); // bb - return this.created; - } - - public boolean hasCreatedElement() { - return this.created != null && !this.created.isEmpty(); - } - - public boolean hasCreated() { - return this.created != null && !this.created.isEmpty(); - } - - /** - * @param value {@link #created} (The date and time this task was created.). This is the underlying object with id, value and extensions. The accessor "getCreated" gives direct access to the value - */ - public Task setCreatedElement(DateTimeType value) { - this.created = value; - return this; - } - - /** - * @return The date and time this task was created. - */ - public Date getCreated() { - return this.created == null ? null : this.created.getValue(); - } - - /** - * @param value The date and time this task was created. - */ - public Task setCreated(Date value) { - if (this.created == null) - this.created = new DateTimeType(); - this.created.setValue(value); - return this; - } - - /** - * @return {@link #lastModified} (The date and time of last modification to this task.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public DateTimeType getLastModifiedElement() { - if (this.lastModified == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.lastModified"); - else if (Configuration.doAutoCreate()) - this.lastModified = new DateTimeType(); // bb - return this.lastModified; - } - - public boolean hasLastModifiedElement() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - public boolean hasLastModified() { - return this.lastModified != null && !this.lastModified.isEmpty(); - } - - /** - * @param value {@link #lastModified} (The date and time of last modification to this task.). This is the underlying object with id, value and extensions. The accessor "getLastModified" gives direct access to the value - */ - public Task setLastModifiedElement(DateTimeType value) { - this.lastModified = value; - return this; - } - - /** - * @return The date and time of last modification to this task. - */ - public Date getLastModified() { - return this.lastModified == null ? null : this.lastModified.getValue(); - } - - /** - * @param value The date and time of last modification to this task. - */ - public Task setLastModified(Date value) { - if (this.lastModified == null) - this.lastModified = new DateTimeType(); - this.lastModified.setValue(value); - return this; - } - - /** - * @return {@link #creator} (The creator of the task.) - */ - public Reference getCreator() { - if (this.creator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.creator"); - else if (Configuration.doAutoCreate()) - this.creator = new Reference(); // cc - return this.creator; - } - - public boolean hasCreator() { - return this.creator != null && !this.creator.isEmpty(); - } - - /** - * @param value {@link #creator} (The creator of the task.) - */ - public Task setCreator(Reference value) { - this.creator = value; - return this; - } - - /** - * @return {@link #creator} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The creator of the task.) - */ - public Resource getCreatorTarget() { - return this.creatorTarget; - } - - /** - * @param value {@link #creator} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The creator of the task.) - */ - public Task setCreatorTarget(Resource value) { - this.creatorTarget = value; - return this; - } - - /** - * @return {@link #owner} (The owner of this task. The participant who can execute this task.) - */ - public Reference getOwner() { - if (this.owner == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.owner"); - else if (Configuration.doAutoCreate()) - this.owner = new Reference(); // cc - return this.owner; - } - - public boolean hasOwner() { - return this.owner != null && !this.owner.isEmpty(); - } - - /** - * @param value {@link #owner} (The owner of this task. The participant who can execute this task.) - */ - public Task setOwner(Reference value) { - this.owner = value; - return this; - } - - /** - * @return {@link #owner} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The owner of this task. The participant who can execute this task.) - */ - public Resource getOwnerTarget() { - return this.ownerTarget; - } - - /** - * @param value {@link #owner} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The owner of this task. The participant who can execute this task.) - */ - public Task setOwnerTarget(Resource value) { - this.ownerTarget = value; - return this; - } - - /** - * @return {@link #parent} (Task that this particular task is part of.) - */ - public Reference getParent() { - if (this.parent == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.parent"); - else if (Configuration.doAutoCreate()) - this.parent = new Reference(); // cc - return this.parent; - } - - public boolean hasParent() { - return this.parent != null && !this.parent.isEmpty(); - } - - /** - * @param value {@link #parent} (Task that this particular task is part of.) - */ - public Task setParent(Reference value) { - this.parent = value; - return this; - } - - /** - * @return {@link #parent} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Task that this particular task is part of.) - */ - public Task getParentTarget() { - if (this.parentTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Task.parent"); - else if (Configuration.doAutoCreate()) - this.parentTarget = new Task(); // aa - return this.parentTarget; - } - - /** - * @param value {@link #parent} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Task that this particular task is part of.) - */ - public Task setParentTarget(Task value) { - this.parentTarget = value; - return this; - } - - /** - * @return {@link #input} (Inputs to the task.) - */ - public List getInput() { - if (this.input == null) - this.input = new ArrayList(); - return this.input; - } - - public boolean hasInput() { - if (this.input == null) - return false; - for (ParameterComponent item : this.input) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #input} (Inputs to the task.) - */ - // syntactic sugar - public ParameterComponent addInput() { //3 - ParameterComponent t = new ParameterComponent(); - if (this.input == null) - this.input = new ArrayList(); - this.input.add(t); - return t; - } - - // syntactic sugar - public Task addInput(ParameterComponent t) { //3 - if (t == null) - return this; - if (this.input == null) - this.input = new ArrayList(); - this.input.add(t); - return this; - } - - /** - * @return {@link #output} (Outputs produced by the Task.) - */ - public List getOutput() { - if (this.output == null) - this.output = new ArrayList(); - return this.output; - } - - public boolean hasOutput() { - if (this.output == null) - return false; - for (TaskOutputComponent item : this.output) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #output} (Outputs produced by the Task.) - */ - // syntactic sugar - public TaskOutputComponent addOutput() { //3 - TaskOutputComponent t = new TaskOutputComponent(); - if (this.output == null) - this.output = new ArrayList(); - this.output.add(t); - return t; - } - - // syntactic sugar - public Task addOutput(TaskOutputComponent t) { //3 - if (t == null) - return this; - if (this.output == null) - this.output = new ArrayList(); - this.output.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "The business identifier for this task.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("type", "CodeableConcept", "A name or code (or both) briefly describing what the task involves.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("description", "string", "A description of this task.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("performerType", "Coding", "The type of participant that can execute the task.", 0, java.lang.Integer.MAX_VALUE, performerType)); - childrenList.add(new Property("priority", "code", "The priority of the task among other tasks of the same type.", 0, java.lang.Integer.MAX_VALUE, priority)); - childrenList.add(new Property("status", "code", "The current status of the task.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("failureReason", "CodeableConcept", "An explaination as to why this task failed.", 0, java.lang.Integer.MAX_VALUE, failureReason)); - childrenList.add(new Property("subject", "Reference(Any)", "The subject of the task.", 0, java.lang.Integer.MAX_VALUE, subject)); - childrenList.add(new Property("for", "Reference(Any)", "The entity who benefits from the performance of the service specified in the task (e.g., the patient).", 0, java.lang.Integer.MAX_VALUE, for_)); - childrenList.add(new Property("definition", "uri", "A reference to a formal or informal definition of the task.", 0, java.lang.Integer.MAX_VALUE, definition)); - childrenList.add(new Property("created", "dateTime", "The date and time this task was created.", 0, java.lang.Integer.MAX_VALUE, created)); - childrenList.add(new Property("lastModified", "dateTime", "The date and time of last modification to this task.", 0, java.lang.Integer.MAX_VALUE, lastModified)); - childrenList.add(new Property("creator", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The creator of the task.", 0, java.lang.Integer.MAX_VALUE, creator)); - childrenList.add(new Property("owner", "Reference(Device|Organization|Patient|Practitioner|RelatedPerson)", "The owner of this task. The participant who can execute this task.", 0, java.lang.Integer.MAX_VALUE, owner)); - childrenList.add(new Property("parent", "Reference(Task)", "Task that this particular task is part of.", 0, java.lang.Integer.MAX_VALUE, parent)); - childrenList.add(new Property("input", "", "Inputs to the task.", 0, java.lang.Integer.MAX_VALUE, input)); - childrenList.add(new Property("output", "", "Outputs produced by the Task.", 0, java.lang.Integer.MAX_VALUE, output)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -901444568: /*performerType*/ return this.performerType == null ? new Base[0] : this.performerType.toArray(new Base[this.performerType.size()]); // Coding - case -1165461084: /*priority*/ return this.priority == null ? new Base[0] : new Base[] {this.priority}; // Enumeration - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1990598546: /*failureReason*/ return this.failureReason == null ? new Base[0] : new Base[] {this.failureReason}; // CodeableConcept - case -1867885268: /*subject*/ return this.subject == null ? new Base[0] : new Base[] {this.subject}; // Reference - case 101577: /*for*/ return this.for_ == null ? new Base[0] : new Base[] {this.for_}; // Reference - case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // UriType - case 1028554472: /*created*/ return this.created == null ? new Base[0] : new Base[] {this.created}; // DateTimeType - case 1959003007: /*lastModified*/ return this.lastModified == null ? new Base[0] : new Base[] {this.lastModified}; // DateTimeType - case 1028554796: /*creator*/ return this.creator == null ? new Base[0] : new Base[] {this.creator}; // Reference - case 106164915: /*owner*/ return this.owner == null ? new Base[0] : new Base[] {this.owner}; // Reference - case -995424086: /*parent*/ return this.parent == null ? new Base[0] : new Base[] {this.parent}; // Reference - case 100358090: /*input*/ return this.input == null ? new Base[0] : this.input.toArray(new Base[this.input.size()]); // ParameterComponent - case -1005512447: /*output*/ return this.output == null ? new Base[0] : this.output.toArray(new Base[this.output.size()]); // TaskOutputComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 3575610: // type - this.type = castToCodeableConcept(value); // CodeableConcept - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -901444568: // performerType - this.getPerformerType().add(castToCoding(value)); // Coding - break; - case -1165461084: // priority - this.priority = new TaskPriorityEnumFactory().fromType(value); // Enumeration - break; - case -892481550: // status - this.status = new TaskStatusEnumFactory().fromType(value); // Enumeration - break; - case -1990598546: // failureReason - this.failureReason = castToCodeableConcept(value); // CodeableConcept - break; - case -1867885268: // subject - this.subject = castToReference(value); // Reference - break; - case 101577: // for - this.for_ = castToReference(value); // Reference - break; - case -1014418093: // definition - this.definition = castToUri(value); // UriType - break; - case 1028554472: // created - this.created = castToDateTime(value); // DateTimeType - break; - case 1959003007: // lastModified - this.lastModified = castToDateTime(value); // DateTimeType - break; - case 1028554796: // creator - this.creator = castToReference(value); // Reference - break; - case 106164915: // owner - this.owner = castToReference(value); // Reference - break; - case -995424086: // parent - this.parent = castToReference(value); // Reference - break; - case 100358090: // input - this.getInput().add((ParameterComponent) value); // ParameterComponent - break; - case -1005512447: // output - this.getOutput().add((TaskOutputComponent) value); // TaskOutputComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("type")) - this.type = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("performerType")) - this.getPerformerType().add(castToCoding(value)); - else if (name.equals("priority")) - this.priority = new TaskPriorityEnumFactory().fromType(value); // Enumeration - else if (name.equals("status")) - this.status = new TaskStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("failureReason")) - this.failureReason = castToCodeableConcept(value); // CodeableConcept - else if (name.equals("subject")) - this.subject = castToReference(value); // Reference - else if (name.equals("for")) - this.for_ = castToReference(value); // Reference - else if (name.equals("definition")) - this.definition = castToUri(value); // UriType - else if (name.equals("created")) - this.created = castToDateTime(value); // DateTimeType - else if (name.equals("lastModified")) - this.lastModified = castToDateTime(value); // DateTimeType - else if (name.equals("creator")) - this.creator = castToReference(value); // Reference - else if (name.equals("owner")) - this.owner = castToReference(value); // Reference - else if (name.equals("parent")) - this.parent = castToReference(value); // Reference - else if (name.equals("input")) - this.getInput().add((ParameterComponent) value); - else if (name.equals("output")) - this.getOutput().add((TaskOutputComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return getIdentifier(); // Identifier - case 3575610: return getType(); // CodeableConcept - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -901444568: return addPerformerType(); // Coding - case -1165461084: throw new FHIRException("Cannot make property priority as it is not a complex type"); // Enumeration - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1990598546: return getFailureReason(); // CodeableConcept - case -1867885268: return getSubject(); // Reference - case 101577: return getFor(); // Reference - case -1014418093: throw new FHIRException("Cannot make property definition as it is not a complex type"); // UriType - case 1028554472: throw new FHIRException("Cannot make property created as it is not a complex type"); // DateTimeType - case 1959003007: throw new FHIRException("Cannot make property lastModified as it is not a complex type"); // DateTimeType - case 1028554796: return getCreator(); // Reference - case 106164915: return getOwner(); // Reference - case -995424086: return getParent(); // Reference - case 100358090: return addInput(); // ParameterComponent - case -1005512447: return addOutput(); // TaskOutputComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("type")) { - this.type = new CodeableConcept(); - return this.type; - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.description"); - } - else if (name.equals("performerType")) { - return addPerformerType(); - } - else if (name.equals("priority")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.priority"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.status"); - } - else if (name.equals("failureReason")) { - this.failureReason = new CodeableConcept(); - return this.failureReason; - } - else if (name.equals("subject")) { - this.subject = new Reference(); - return this.subject; - } - else if (name.equals("for")) { - this.for_ = new Reference(); - return this.for_; - } - else if (name.equals("definition")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.definition"); - } - else if (name.equals("created")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.created"); - } - else if (name.equals("lastModified")) { - throw new FHIRException("Cannot call addChild on a primitive type Task.lastModified"); - } - else if (name.equals("creator")) { - this.creator = new Reference(); - return this.creator; - } - else if (name.equals("owner")) { - this.owner = new Reference(); - return this.owner; - } - else if (name.equals("parent")) { - this.parent = new Reference(); - return this.parent; - } - else if (name.equals("input")) { - return addInput(); - } - else if (name.equals("output")) { - return addOutput(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Task"; - - } - - public Task copy() { - Task dst = new Task(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.type = type == null ? null : type.copy(); - dst.description = description == null ? null : description.copy(); - if (performerType != null) { - dst.performerType = new ArrayList(); - for (Coding i : performerType) - dst.performerType.add(i.copy()); - }; - dst.priority = priority == null ? null : priority.copy(); - dst.status = status == null ? null : status.copy(); - dst.failureReason = failureReason == null ? null : failureReason.copy(); - dst.subject = subject == null ? null : subject.copy(); - dst.for_ = for_ == null ? null : for_.copy(); - dst.definition = definition == null ? null : definition.copy(); - dst.created = created == null ? null : created.copy(); - dst.lastModified = lastModified == null ? null : lastModified.copy(); - dst.creator = creator == null ? null : creator.copy(); - dst.owner = owner == null ? null : owner.copy(); - dst.parent = parent == null ? null : parent.copy(); - if (input != null) { - dst.input = new ArrayList(); - for (ParameterComponent i : input) - dst.input.add(i.copy()); - }; - if (output != null) { - dst.output = new ArrayList(); - for (TaskOutputComponent i : output) - dst.output.add(i.copy()); - }; - return dst; - } - - protected Task typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Task)) - return false; - Task o = (Task) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(type, o.type, true) && compareDeep(description, o.description, true) - && compareDeep(performerType, o.performerType, true) && compareDeep(priority, o.priority, true) - && compareDeep(status, o.status, true) && compareDeep(failureReason, o.failureReason, true) && compareDeep(subject, o.subject, true) - && compareDeep(for_, o.for_, true) && compareDeep(definition, o.definition, true) && compareDeep(created, o.created, true) - && compareDeep(lastModified, o.lastModified, true) && compareDeep(creator, o.creator, true) && compareDeep(owner, o.owner, true) - && compareDeep(parent, o.parent, true) && compareDeep(input, o.input, true) && compareDeep(output, o.output, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Task)) - return false; - Task o = (Task) other; - return compareValues(description, o.description, true) && compareValues(priority, o.priority, true) - && compareValues(status, o.status, true) && compareValues(definition, o.definition, true) && compareValues(created, o.created, true) - && compareValues(lastModified, o.lastModified, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (type == null || type.isEmpty()) - && (description == null || description.isEmpty()) && (performerType == null || performerType.isEmpty()) - && (priority == null || priority.isEmpty()) && (status == null || status.isEmpty()) && (failureReason == null || failureReason.isEmpty()) - && (subject == null || subject.isEmpty()) && (for_ == null || for_.isEmpty()) && (definition == null || definition.isEmpty()) - && (created == null || created.isEmpty()) && (lastModified == null || lastModified.isEmpty()) - && (creator == null || creator.isEmpty()) && (owner == null || owner.isEmpty()) && (parent == null || parent.isEmpty()) - && (input == null || input.isEmpty()) && (output == null || output.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.Task; - } - - /** - * Search parameter: definition - *

- * Description: Search by task definition
- * Type: uri
- * Path: Task.definition
- *

- */ - @SearchParamDefinition(name="definition", path="Task.definition", description="Search by task definition", type="uri" ) - public static final String SP_DEFINITION = "definition"; - /** - * Fluent Client search parameter constant for definition - *

- * Description: Search by task definition
- * Type: uri
- * Path: Task.definition
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam DEFINITION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_DEFINITION); - - /** - * Search parameter: status - *

- * Description: Search by task status
- * Type: token
- * Path: Task.status
- *

- */ - @SearchParamDefinition(name="status", path="Task.status", description="Search by task status", type="token" ) - public static final String SP_STATUS = "status"; - /** - * Fluent Client search parameter constant for status - *

- * Description: Search by task status
- * Type: token
- * Path: Task.status
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: subject - *

- * Description: Search by task subject
- * Type: reference
- * Path: Task.subject
- *

- */ - @SearchParamDefinition(name="subject", path="Task.subject", description="Search by task subject", type="reference" ) - public static final String SP_SUBJECT = "subject"; - /** - * Fluent Client search parameter constant for subject - *

- * Description: Search by task subject
- * Type: reference
- * Path: Task.subject
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam SUBJECT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_SUBJECT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Task:subject". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_SUBJECT = new ca.uhn.fhir.model.api.Include("Task:subject").toLocked(); - - /** - * Search parameter: parent - *

- * Description: Search by parent task
- * Type: reference
- * Path: Task.parent
- *

- */ - @SearchParamDefinition(name="parent", path="Task.parent", description="Search by parent task", type="reference" ) - public static final String SP_PARENT = "parent"; - /** - * Fluent Client search parameter constant for parent - *

- * Description: Search by parent task
- * Type: reference
- * Path: Task.parent
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PARENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PARENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Task:parent". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PARENT = new ca.uhn.fhir.model.api.Include("Task:parent").toLocked(); - - /** - * Search parameter: type - *

- * Description: Search by task type
- * Type: token
- * Path: Task.type
- *

- */ - @SearchParamDefinition(name="type", path="Task.type", description="Search by task type", type="token" ) - public static final String SP_TYPE = "type"; - /** - * Fluent Client search parameter constant for type - *

- * Description: Search by task type
- * Type: token
- * Path: Task.type
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam TYPE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_TYPE); - - /** - * Search parameter: modified - *

- * Description: Search by last modification date
- * Type: date
- * Path: Task.lastModified
- *

- */ - @SearchParamDefinition(name="modified", path="Task.lastModified", description="Search by last modification date", type="date" ) - public static final String SP_MODIFIED = "modified"; - /** - * Fluent Client search parameter constant for modified - *

- * Description: Search by last modification date
- * Type: date
- * Path: Task.lastModified
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam MODIFIED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_MODIFIED); - - /** - * Search parameter: creator - *

- * Description: Search by task creator
- * Type: reference
- * Path: Task.creator
- *

- */ - @SearchParamDefinition(name="creator", path="Task.creator", description="Search by task creator", type="reference" ) - public static final String SP_CREATOR = "creator"; - /** - * Fluent Client search parameter constant for creator - *

- * Description: Search by task creator
- * Type: reference
- * Path: Task.creator
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam CREATOR = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_CREATOR); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Task:creator". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_CREATOR = new ca.uhn.fhir.model.api.Include("Task:creator").toLocked(); - - /** - * Search parameter: failure - *

- * Description: Search by failure reason
- * Type: token
- * Path: Task.failureReason
- *

- */ - @SearchParamDefinition(name="failure", path="Task.failureReason", description="Search by failure reason", type="token" ) - public static final String SP_FAILURE = "failure"; - /** - * Fluent Client search parameter constant for failure - *

- * Description: Search by failure reason
- * Type: token
- * Path: Task.failureReason
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam FAILURE = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_FAILURE); - - /** - * Search parameter: created - *

- * Description: Search by creation date
- * Type: date
- * Path: Task.created
- *

- */ - @SearchParamDefinition(name="created", path="Task.created", description="Search by creation date", type="date" ) - public static final String SP_CREATED = "created"; - /** - * Fluent Client search parameter constant for created - *

- * Description: Search by creation date
- * Type: date
- * Path: Task.created
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam CREATED = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_CREATED); - - /** - * Search parameter: priority - *

- * Description: Search by task priority
- * Type: token
- * Path: Task.priority
- *

- */ - @SearchParamDefinition(name="priority", path="Task.priority", description="Search by task priority", type="token" ) - public static final String SP_PRIORITY = "priority"; - /** - * Fluent Client search parameter constant for priority - *

- * Description: Search by task priority
- * Type: token
- * Path: Task.priority
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PRIORITY = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PRIORITY); - - /** - * Search parameter: owner - *

- * Description: Search by task owner
- * Type: reference
- * Path: Task.owner
- *

- */ - @SearchParamDefinition(name="owner", path="Task.owner", description="Search by task owner", type="reference" ) - public static final String SP_OWNER = "owner"; - /** - * Fluent Client search parameter constant for owner - *

- * Description: Search by task owner
- * Type: reference
- * Path: Task.owner
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam OWNER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_OWNER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "Task:owner". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_OWNER = new ca.uhn.fhir.model.api.Include("Task:owner").toLocked(); - - /** - * Search parameter: performer - *

- * Description: Search by recommended type of performer (e.g., Requester, Performer, Scheduler).
- * Type: token
- * Path: Task.performerType
- *

- */ - @SearchParamDefinition(name="performer", path="Task.performerType", description="Search by recommended type of performer (e.g., Requester, Performer, Scheduler).", type="token" ) - public static final String SP_PERFORMER = "performer"; - /** - * Fluent Client search parameter constant for performer - *

- * Description: Search by recommended type of performer (e.g., Requester, Performer, Scheduler).
- * Type: token
- * Path: Task.performerType
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam PERFORMER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_PERFORMER); - - /** - * Search parameter: identifier - *

- * Description: Search for a task instance by its business identifier
- * Type: token
- * Path: Task.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="Task.identifier", description="Search for a task instance by its business identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Search for a task instance by its business identifier
- * Type: token
- * Path: Task.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java deleted file mode 100644 index 76175a748e2..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TemporalPrecisionEnum.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.util.Calendar; -import java.util.Date; - -import org.apache.commons.lang3.time.DateUtils; - -public enum TemporalPrecisionEnum { - - YEAR(Calendar.YEAR) { - @Override - public Date add(Date theInput, int theAmount) { - return DateUtils.addYears(theInput, theAmount); - } - }, - - MONTH(Calendar.MONTH) { - @Override - public Date add(Date theInput, int theAmount) { - return DateUtils.addMonths(theInput, theAmount); - } - }, - DAY(Calendar.DATE) { - @Override - public Date add(Date theInput, int theAmount) { - return DateUtils.addDays(theInput, theAmount); - } - }, - MINUTE(Calendar.MINUTE) { - @Override - public Date add(Date theInput, int theAmount) { - return DateUtils.addMinutes(theInput, theAmount); - } - }, - SECOND(Calendar.SECOND) { - @Override - public Date add(Date theInput, int theAmount) { - return DateUtils.addSeconds(theInput, theAmount); - } - }, - MILLI(Calendar.MILLISECOND) { - @Override - public Date add(Date theInput, int theAmount) { - return DateUtils.addMilliseconds(theInput, theAmount); - } - }, - - ; - - private int myCalendarConstant; - - TemporalPrecisionEnum(int theCalendarConstant) { - myCalendarConstant = theCalendarConstant; - } - - public abstract Date add(Date theInput, int theAmount); - - public int getCalendarConstant() { - return myCalendarConstant; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TestScript.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TestScript.java deleted file mode 100644 index 3216788e2ad..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TestScript.java +++ /dev/null @@ -1,10956 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance against the FHIR specification. - */ -@ResourceDef(name="TestScript", profile="http://hl7.org/fhir/Profile/TestScript") -public class TestScript extends DomainResource { - - public enum ContentType { - /** - * XML content-type corresponding to the application/xml+fhir mime-type. - */ - XML, - /** - * JSON content-type corresponding to the application/json+fhir mime-type. - */ - JSON, - /** - * added to help the parsers - */ - NULL; - public static ContentType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("xml".equals(codeString)) - return XML; - if ("json".equals(codeString)) - return JSON; - throw new FHIRException("Unknown ContentType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case XML: return "xml"; - case JSON: return "json"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case XML: return "http://hl7.org/fhir/content-type"; - case JSON: return "http://hl7.org/fhir/content-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case XML: return "XML content-type corresponding to the application/xml+fhir mime-type."; - case JSON: return "JSON content-type corresponding to the application/json+fhir mime-type."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case XML: return "xml"; - case JSON: return "json"; - default: return "?"; - } - } - } - - public static class ContentTypeEnumFactory implements EnumFactory { - public ContentType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("xml".equals(codeString)) - return ContentType.XML; - if ("json".equals(codeString)) - return ContentType.JSON; - throw new IllegalArgumentException("Unknown ContentType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("xml".equals(codeString)) - return new Enumeration(this, ContentType.XML); - if ("json".equals(codeString)) - return new Enumeration(this, ContentType.JSON); - throw new FHIRException("Unknown ContentType code '"+codeString+"'"); - } - public String toCode(ContentType code) { - if (code == ContentType.XML) - return "xml"; - if (code == ContentType.JSON) - return "json"; - return "?"; - } - public String toSystem(ContentType code) { - return code.getSystem(); - } - } - - public enum AssertionDirectionType { - /** - * The assertion is evaluated on the response. This is the default value. - */ - RESPONSE, - /** - * The assertion is evaluated on the request. - */ - REQUEST, - /** - * added to help the parsers - */ - NULL; - public static AssertionDirectionType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("response".equals(codeString)) - return RESPONSE; - if ("request".equals(codeString)) - return REQUEST; - throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RESPONSE: return "response"; - case REQUEST: return "request"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RESPONSE: return "http://hl7.org/fhir/assert-direction-codes"; - case REQUEST: return "http://hl7.org/fhir/assert-direction-codes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RESPONSE: return "The assertion is evaluated on the response. This is the default value."; - case REQUEST: return "The assertion is evaluated on the request."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RESPONSE: return "response"; - case REQUEST: return "request"; - default: return "?"; - } - } - } - - public static class AssertionDirectionTypeEnumFactory implements EnumFactory { - public AssertionDirectionType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("response".equals(codeString)) - return AssertionDirectionType.RESPONSE; - if ("request".equals(codeString)) - return AssertionDirectionType.REQUEST; - throw new IllegalArgumentException("Unknown AssertionDirectionType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("response".equals(codeString)) - return new Enumeration(this, AssertionDirectionType.RESPONSE); - if ("request".equals(codeString)) - return new Enumeration(this, AssertionDirectionType.REQUEST); - throw new FHIRException("Unknown AssertionDirectionType code '"+codeString+"'"); - } - public String toCode(AssertionDirectionType code) { - if (code == AssertionDirectionType.RESPONSE) - return "response"; - if (code == AssertionDirectionType.REQUEST) - return "request"; - return "?"; - } - public String toSystem(AssertionDirectionType code) { - return code.getSystem(); - } - } - - public enum AssertionOperatorType { - /** - * Default value. Equals comparison. - */ - EQUALS, - /** - * Not equals comparison. - */ - NOTEQUALS, - /** - * Compare value within a known set of values. - */ - IN, - /** - * Compare value not within a known set of values. - */ - NOTIN, - /** - * Compare value to be greater than a known value. - */ - GREATERTHAN, - /** - * Compare value to be less than a known value. - */ - LESSTHAN, - /** - * Compare value is empty. - */ - EMPTY, - /** - * Compare value is not empty. - */ - NOTEMPTY, - /** - * Compare value string contains a known value. - */ - CONTAINS, - /** - * Compare value string does not contain a known value. - */ - NOTCONTAINS, - /** - * added to help the parsers - */ - NULL; - public static AssertionOperatorType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("equals".equals(codeString)) - return EQUALS; - if ("notEquals".equals(codeString)) - return NOTEQUALS; - if ("in".equals(codeString)) - return IN; - if ("notIn".equals(codeString)) - return NOTIN; - if ("greaterThan".equals(codeString)) - return GREATERTHAN; - if ("lessThan".equals(codeString)) - return LESSTHAN; - if ("empty".equals(codeString)) - return EMPTY; - if ("notEmpty".equals(codeString)) - return NOTEMPTY; - if ("contains".equals(codeString)) - return CONTAINS; - if ("notContains".equals(codeString)) - return NOTCONTAINS; - throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case EQUALS: return "equals"; - case NOTEQUALS: return "notEquals"; - case IN: return "in"; - case NOTIN: return "notIn"; - case GREATERTHAN: return "greaterThan"; - case LESSTHAN: return "lessThan"; - case EMPTY: return "empty"; - case NOTEMPTY: return "notEmpty"; - case CONTAINS: return "contains"; - case NOTCONTAINS: return "notContains"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUALS: return "http://hl7.org/fhir/assert-operator-codes"; - case NOTEQUALS: return "http://hl7.org/fhir/assert-operator-codes"; - case IN: return "http://hl7.org/fhir/assert-operator-codes"; - case NOTIN: return "http://hl7.org/fhir/assert-operator-codes"; - case GREATERTHAN: return "http://hl7.org/fhir/assert-operator-codes"; - case LESSTHAN: return "http://hl7.org/fhir/assert-operator-codes"; - case EMPTY: return "http://hl7.org/fhir/assert-operator-codes"; - case NOTEMPTY: return "http://hl7.org/fhir/assert-operator-codes"; - case CONTAINS: return "http://hl7.org/fhir/assert-operator-codes"; - case NOTCONTAINS: return "http://hl7.org/fhir/assert-operator-codes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EQUALS: return "Default value. Equals comparison."; - case NOTEQUALS: return "Not equals comparison."; - case IN: return "Compare value within a known set of values."; - case NOTIN: return "Compare value not within a known set of values."; - case GREATERTHAN: return "Compare value to be greater than a known value."; - case LESSTHAN: return "Compare value to be less than a known value."; - case EMPTY: return "Compare value is empty."; - case NOTEMPTY: return "Compare value is not empty."; - case CONTAINS: return "Compare value string contains a known value."; - case NOTCONTAINS: return "Compare value string does not contain a known value."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUALS: return "equals"; - case NOTEQUALS: return "notEquals"; - case IN: return "in"; - case NOTIN: return "notIn"; - case GREATERTHAN: return "greaterThan"; - case LESSTHAN: return "lessThan"; - case EMPTY: return "empty"; - case NOTEMPTY: return "notEmpty"; - case CONTAINS: return "contains"; - case NOTCONTAINS: return "notContains"; - default: return "?"; - } - } - } - - public static class AssertionOperatorTypeEnumFactory implements EnumFactory { - public AssertionOperatorType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("equals".equals(codeString)) - return AssertionOperatorType.EQUALS; - if ("notEquals".equals(codeString)) - return AssertionOperatorType.NOTEQUALS; - if ("in".equals(codeString)) - return AssertionOperatorType.IN; - if ("notIn".equals(codeString)) - return AssertionOperatorType.NOTIN; - if ("greaterThan".equals(codeString)) - return AssertionOperatorType.GREATERTHAN; - if ("lessThan".equals(codeString)) - return AssertionOperatorType.LESSTHAN; - if ("empty".equals(codeString)) - return AssertionOperatorType.EMPTY; - if ("notEmpty".equals(codeString)) - return AssertionOperatorType.NOTEMPTY; - if ("contains".equals(codeString)) - return AssertionOperatorType.CONTAINS; - if ("notContains".equals(codeString)) - return AssertionOperatorType.NOTCONTAINS; - throw new IllegalArgumentException("Unknown AssertionOperatorType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("equals".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.EQUALS); - if ("notEquals".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.NOTEQUALS); - if ("in".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.IN); - if ("notIn".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.NOTIN); - if ("greaterThan".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.GREATERTHAN); - if ("lessThan".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.LESSTHAN); - if ("empty".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.EMPTY); - if ("notEmpty".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.NOTEMPTY); - if ("contains".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.CONTAINS); - if ("notContains".equals(codeString)) - return new Enumeration(this, AssertionOperatorType.NOTCONTAINS); - throw new FHIRException("Unknown AssertionOperatorType code '"+codeString+"'"); - } - public String toCode(AssertionOperatorType code) { - if (code == AssertionOperatorType.EQUALS) - return "equals"; - if (code == AssertionOperatorType.NOTEQUALS) - return "notEquals"; - if (code == AssertionOperatorType.IN) - return "in"; - if (code == AssertionOperatorType.NOTIN) - return "notIn"; - if (code == AssertionOperatorType.GREATERTHAN) - return "greaterThan"; - if (code == AssertionOperatorType.LESSTHAN) - return "lessThan"; - if (code == AssertionOperatorType.EMPTY) - return "empty"; - if (code == AssertionOperatorType.NOTEMPTY) - return "notEmpty"; - if (code == AssertionOperatorType.CONTAINS) - return "contains"; - if (code == AssertionOperatorType.NOTCONTAINS) - return "notContains"; - return "?"; - } - public String toSystem(AssertionOperatorType code) { - return code.getSystem(); - } - } - - public enum AssertionResponseTypes { - /** - * Response code is 200. - */ - OKAY, - /** - * Response code is 201. - */ - CREATED, - /** - * Response code is 204. - */ - NOCONTENT, - /** - * Response code is 304. - */ - NOTMODIFIED, - /** - * Response code is 400. - */ - BAD, - /** - * Response code is 403. - */ - FORBIDDEN, - /** - * Response code is 404. - */ - NOTFOUND, - /** - * Response code is 405. - */ - METHODNOTALLOWED, - /** - * Response code is 409. - */ - CONFLICT, - /** - * Response code is 410. - */ - GONE, - /** - * Response code is 412. - */ - PRECONDITIONFAILED, - /** - * Response code is 422. - */ - UNPROCESSABLE, - /** - * added to help the parsers - */ - NULL; - public static AssertionResponseTypes fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("okay".equals(codeString)) - return OKAY; - if ("created".equals(codeString)) - return CREATED; - if ("noContent".equals(codeString)) - return NOCONTENT; - if ("notModified".equals(codeString)) - return NOTMODIFIED; - if ("bad".equals(codeString)) - return BAD; - if ("forbidden".equals(codeString)) - return FORBIDDEN; - if ("notFound".equals(codeString)) - return NOTFOUND; - if ("methodNotAllowed".equals(codeString)) - return METHODNOTALLOWED; - if ("conflict".equals(codeString)) - return CONFLICT; - if ("gone".equals(codeString)) - return GONE; - if ("preconditionFailed".equals(codeString)) - return PRECONDITIONFAILED; - if ("unprocessable".equals(codeString)) - return UNPROCESSABLE; - throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case OKAY: return "okay"; - case CREATED: return "created"; - case NOCONTENT: return "noContent"; - case NOTMODIFIED: return "notModified"; - case BAD: return "bad"; - case FORBIDDEN: return "forbidden"; - case NOTFOUND: return "notFound"; - case METHODNOTALLOWED: return "methodNotAllowed"; - case CONFLICT: return "conflict"; - case GONE: return "gone"; - case PRECONDITIONFAILED: return "preconditionFailed"; - case UNPROCESSABLE: return "unprocessable"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case OKAY: return "http://hl7.org/fhir/assert-response-code-types"; - case CREATED: return "http://hl7.org/fhir/assert-response-code-types"; - case NOCONTENT: return "http://hl7.org/fhir/assert-response-code-types"; - case NOTMODIFIED: return "http://hl7.org/fhir/assert-response-code-types"; - case BAD: return "http://hl7.org/fhir/assert-response-code-types"; - case FORBIDDEN: return "http://hl7.org/fhir/assert-response-code-types"; - case NOTFOUND: return "http://hl7.org/fhir/assert-response-code-types"; - case METHODNOTALLOWED: return "http://hl7.org/fhir/assert-response-code-types"; - case CONFLICT: return "http://hl7.org/fhir/assert-response-code-types"; - case GONE: return "http://hl7.org/fhir/assert-response-code-types"; - case PRECONDITIONFAILED: return "http://hl7.org/fhir/assert-response-code-types"; - case UNPROCESSABLE: return "http://hl7.org/fhir/assert-response-code-types"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case OKAY: return "Response code is 200."; - case CREATED: return "Response code is 201."; - case NOCONTENT: return "Response code is 204."; - case NOTMODIFIED: return "Response code is 304."; - case BAD: return "Response code is 400."; - case FORBIDDEN: return "Response code is 403."; - case NOTFOUND: return "Response code is 404."; - case METHODNOTALLOWED: return "Response code is 405."; - case CONFLICT: return "Response code is 409."; - case GONE: return "Response code is 410."; - case PRECONDITIONFAILED: return "Response code is 412."; - case UNPROCESSABLE: return "Response code is 422."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case OKAY: return "okay"; - case CREATED: return "created"; - case NOCONTENT: return "noContent"; - case NOTMODIFIED: return "notModified"; - case BAD: return "bad"; - case FORBIDDEN: return "forbidden"; - case NOTFOUND: return "notFound"; - case METHODNOTALLOWED: return "methodNotAllowed"; - case CONFLICT: return "conflict"; - case GONE: return "gone"; - case PRECONDITIONFAILED: return "preconditionFailed"; - case UNPROCESSABLE: return "unprocessable"; - default: return "?"; - } - } - } - - public static class AssertionResponseTypesEnumFactory implements EnumFactory { - public AssertionResponseTypes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("okay".equals(codeString)) - return AssertionResponseTypes.OKAY; - if ("created".equals(codeString)) - return AssertionResponseTypes.CREATED; - if ("noContent".equals(codeString)) - return AssertionResponseTypes.NOCONTENT; - if ("notModified".equals(codeString)) - return AssertionResponseTypes.NOTMODIFIED; - if ("bad".equals(codeString)) - return AssertionResponseTypes.BAD; - if ("forbidden".equals(codeString)) - return AssertionResponseTypes.FORBIDDEN; - if ("notFound".equals(codeString)) - return AssertionResponseTypes.NOTFOUND; - if ("methodNotAllowed".equals(codeString)) - return AssertionResponseTypes.METHODNOTALLOWED; - if ("conflict".equals(codeString)) - return AssertionResponseTypes.CONFLICT; - if ("gone".equals(codeString)) - return AssertionResponseTypes.GONE; - if ("preconditionFailed".equals(codeString)) - return AssertionResponseTypes.PRECONDITIONFAILED; - if ("unprocessable".equals(codeString)) - return AssertionResponseTypes.UNPROCESSABLE; - throw new IllegalArgumentException("Unknown AssertionResponseTypes code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("okay".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.OKAY); - if ("created".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.CREATED); - if ("noContent".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.NOCONTENT); - if ("notModified".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.NOTMODIFIED); - if ("bad".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.BAD); - if ("forbidden".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.FORBIDDEN); - if ("notFound".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.NOTFOUND); - if ("methodNotAllowed".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.METHODNOTALLOWED); - if ("conflict".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.CONFLICT); - if ("gone".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.GONE); - if ("preconditionFailed".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.PRECONDITIONFAILED); - if ("unprocessable".equals(codeString)) - return new Enumeration(this, AssertionResponseTypes.UNPROCESSABLE); - throw new FHIRException("Unknown AssertionResponseTypes code '"+codeString+"'"); - } - public String toCode(AssertionResponseTypes code) { - if (code == AssertionResponseTypes.OKAY) - return "okay"; - if (code == AssertionResponseTypes.CREATED) - return "created"; - if (code == AssertionResponseTypes.NOCONTENT) - return "noContent"; - if (code == AssertionResponseTypes.NOTMODIFIED) - return "notModified"; - if (code == AssertionResponseTypes.BAD) - return "bad"; - if (code == AssertionResponseTypes.FORBIDDEN) - return "forbidden"; - if (code == AssertionResponseTypes.NOTFOUND) - return "notFound"; - if (code == AssertionResponseTypes.METHODNOTALLOWED) - return "methodNotAllowed"; - if (code == AssertionResponseTypes.CONFLICT) - return "conflict"; - if (code == AssertionResponseTypes.GONE) - return "gone"; - if (code == AssertionResponseTypes.PRECONDITIONFAILED) - return "preconditionFailed"; - if (code == AssertionResponseTypes.UNPROCESSABLE) - return "unprocessable"; - return "?"; - } - public String toSystem(AssertionResponseTypes code) { - return code.getSystem(); - } - } - - @Block() - public static class TestScriptContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the Test Script. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the Test Script." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public TestScriptContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the Test Script.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TestScriptContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the Test Script. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the Test Script. - */ - public TestScriptContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public TestScriptContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the Test Script.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public TestScriptContactComponent copy() { - TestScriptContactComponent dst = new TestScriptContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptContactComponent)) - return false; - TestScriptContactComponent o = (TestScriptContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptContactComponent)) - return false; - TestScriptContactComponent o = (TestScriptContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.contact"; - - } - - } - - @Block() - public static class TestScriptOriginComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. - */ - @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The index of the abstract origin server starting at 1", formalDefinition="Abstract name given to an origin server in this test script. The name is provided as a number starting at 1." ) - protected IntegerType index; - - /** - * The type of origin profile the test system supports. - */ - @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="FHIR-Client | FHIR-SDC-FormFiller", formalDefinition="The type of origin profile the test system supports." ) - protected Coding profile; - - private static final long serialVersionUID = -1239935149L; - - /** - * Constructor - */ - public TestScriptOriginComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptOriginComponent(IntegerType index, Coding profile) { - super(); - this.index = index; - this.profile = profile; - } - - /** - * @return {@link #index} (Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value - */ - public IntegerType getIndexElement() { - if (this.index == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptOriginComponent.index"); - else if (Configuration.doAutoCreate()) - this.index = new IntegerType(); // bb - return this.index; - } - - public boolean hasIndexElement() { - return this.index != null && !this.index.isEmpty(); - } - - public boolean hasIndex() { - return this.index != null && !this.index.isEmpty(); - } - - /** - * @param value {@link #index} (Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value - */ - public TestScriptOriginComponent setIndexElement(IntegerType value) { - this.index = value; - return this; - } - - /** - * @return Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. - */ - public int getIndex() { - return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue(); - } - - /** - * @param value Abstract name given to an origin server in this test script. The name is provided as a number starting at 1. - */ - public TestScriptOriginComponent setIndex(int value) { - if (this.index == null) - this.index = new IntegerType(); - this.index.setValue(value); - return this; - } - - /** - * @return {@link #profile} (The type of origin profile the test system supports.) - */ - public Coding getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptOriginComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Coding(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (The type of origin profile the test system supports.) - */ - public TestScriptOriginComponent setProfile(Coding value) { - this.profile = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("index", "integer", "Abstract name given to an origin server in this test script. The name is provided as a number starting at 1.", 0, java.lang.Integer.MAX_VALUE, index)); - childrenList.add(new Property("profile", "Coding", "The type of origin profile the test system supports.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 100346066: // index - this.index = castToInteger(value); // IntegerType - break; - case -309425751: // profile - this.profile = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("index")) - this.index = castToInteger(value); // IntegerType - else if (name.equals("profile")) - this.profile = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 100346066: throw new FHIRException("Cannot make property index as it is not a complex type"); // IntegerType - case -309425751: return getProfile(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("index")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.index"); - } - else if (name.equals("profile")) { - this.profile = new Coding(); - return this.profile; - } - else - return super.addChild(name); - } - - public TestScriptOriginComponent copy() { - TestScriptOriginComponent dst = new TestScriptOriginComponent(); - copyValues(dst); - dst.index = index == null ? null : index.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptOriginComponent)) - return false; - TestScriptOriginComponent o = (TestScriptOriginComponent) other; - return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptOriginComponent)) - return false; - TestScriptOriginComponent o = (TestScriptOriginComponent) other; - return compareValues(index, o.index, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (index == null || index.isEmpty()) && (profile == null || profile.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.origin"; - - } - - } - - @Block() - public static class TestScriptDestinationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. - */ - @Child(name = "index", type = {IntegerType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The index of the abstract destination server starting at 1", formalDefinition="Abstract name given to a destination server in this test script. The name is provided as a number starting at 1." ) - protected IntegerType index; - - /** - * The type of destination profile the test system supports. - */ - @Child(name = "profile", type = {Coding.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="FHIR-Server | FHIR-SDC-FormManager | FHIR-SDC-FormReceiver | FHIR-SDC-FormProcessor", formalDefinition="The type of destination profile the test system supports." ) - protected Coding profile; - - private static final long serialVersionUID = -1239935149L; - - /** - * Constructor - */ - public TestScriptDestinationComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptDestinationComponent(IntegerType index, Coding profile) { - super(); - this.index = index; - this.profile = profile; - } - - /** - * @return {@link #index} (Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value - */ - public IntegerType getIndexElement() { - if (this.index == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptDestinationComponent.index"); - else if (Configuration.doAutoCreate()) - this.index = new IntegerType(); // bb - return this.index; - } - - public boolean hasIndexElement() { - return this.index != null && !this.index.isEmpty(); - } - - public boolean hasIndex() { - return this.index != null && !this.index.isEmpty(); - } - - /** - * @param value {@link #index} (Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.). This is the underlying object with id, value and extensions. The accessor "getIndex" gives direct access to the value - */ - public TestScriptDestinationComponent setIndexElement(IntegerType value) { - this.index = value; - return this; - } - - /** - * @return Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. - */ - public int getIndex() { - return this.index == null || this.index.isEmpty() ? 0 : this.index.getValue(); - } - - /** - * @param value Abstract name given to a destination server in this test script. The name is provided as a number starting at 1. - */ - public TestScriptDestinationComponent setIndex(int value) { - if (this.index == null) - this.index = new IntegerType(); - this.index.setValue(value); - return this; - } - - /** - * @return {@link #profile} (The type of destination profile the test system supports.) - */ - public Coding getProfile() { - if (this.profile == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptDestinationComponent.profile"); - else if (Configuration.doAutoCreate()) - this.profile = new Coding(); // cc - return this.profile; - } - - public boolean hasProfile() { - return this.profile != null && !this.profile.isEmpty(); - } - - /** - * @param value {@link #profile} (The type of destination profile the test system supports.) - */ - public TestScriptDestinationComponent setProfile(Coding value) { - this.profile = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("index", "integer", "Abstract name given to a destination server in this test script. The name is provided as a number starting at 1.", 0, java.lang.Integer.MAX_VALUE, index)); - childrenList.add(new Property("profile", "Coding", "The type of destination profile the test system supports.", 0, java.lang.Integer.MAX_VALUE, profile)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 100346066: /*index*/ return this.index == null ? new Base[0] : new Base[] {this.index}; // IntegerType - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : new Base[] {this.profile}; // Coding - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 100346066: // index - this.index = castToInteger(value); // IntegerType - break; - case -309425751: // profile - this.profile = castToCoding(value); // Coding - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("index")) - this.index = castToInteger(value); // IntegerType - else if (name.equals("profile")) - this.profile = castToCoding(value); // Coding - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 100346066: throw new FHIRException("Cannot make property index as it is not a complex type"); // IntegerType - case -309425751: return getProfile(); // Coding - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("index")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.index"); - } - else if (name.equals("profile")) { - this.profile = new Coding(); - return this.profile; - } - else - return super.addChild(name); - } - - public TestScriptDestinationComponent copy() { - TestScriptDestinationComponent dst = new TestScriptDestinationComponent(); - copyValues(dst); - dst.index = index == null ? null : index.copy(); - dst.profile = profile == null ? null : profile.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptDestinationComponent)) - return false; - TestScriptDestinationComponent o = (TestScriptDestinationComponent) other; - return compareDeep(index, o.index, true) && compareDeep(profile, o.profile, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptDestinationComponent)) - return false; - TestScriptDestinationComponent o = (TestScriptDestinationComponent) other; - return compareValues(index, o.index, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (index == null || index.isEmpty()) && (profile == null || profile.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.destination"; - - } - - } - - @Block() - public static class TestScriptMetadataComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A link to the FHIR specification that this test is covering. - */ - @Child(name = "link", type = {}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Links to the FHIR specification", formalDefinition="A link to the FHIR specification that this test is covering." ) - protected List link; - - /** - * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. - */ - @Child(name = "capability", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Capabilities that are assumed to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." ) - protected List capability; - - private static final long serialVersionUID = 745183328L; - - /** - * Constructor - */ - public TestScriptMetadataComponent() { - super(); - } - - /** - * @return {@link #link} (A link to the FHIR specification that this test is covering.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (TestScriptMetadataLinkComponent item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (A link to the FHIR specification that this test is covering.) - */ - // syntactic sugar - public TestScriptMetadataLinkComponent addLink() { //3 - TestScriptMetadataLinkComponent t = new TestScriptMetadataLinkComponent(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - // syntactic sugar - public TestScriptMetadataComponent addLink(TestScriptMetadataLinkComponent t) { //3 - if (t == null) - return this; - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public List getCapability() { - if (this.capability == null) - this.capability = new ArrayList(); - return this.capability; - } - - public boolean hasCapability() { - if (this.capability == null) - return false; - for (TestScriptMetadataCapabilityComponent item : this.capability) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #capability} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) - */ - // syntactic sugar - public TestScriptMetadataCapabilityComponent addCapability() { //3 - TestScriptMetadataCapabilityComponent t = new TestScriptMetadataCapabilityComponent(); - if (this.capability == null) - this.capability = new ArrayList(); - this.capability.add(t); - return t; - } - - // syntactic sugar - public TestScriptMetadataComponent addCapability(TestScriptMetadataCapabilityComponent t) { //3 - if (t == null) - return this; - if (this.capability == null) - this.capability = new ArrayList(); - this.capability.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("link", "", "A link to the FHIR specification that this test is covering.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("capability", "", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, capability)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // TestScriptMetadataLinkComponent - case -783669992: /*capability*/ return this.capability == null ? new Base[0] : this.capability.toArray(new Base[this.capability.size()]); // TestScriptMetadataCapabilityComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3321850: // link - this.getLink().add((TestScriptMetadataLinkComponent) value); // TestScriptMetadataLinkComponent - break; - case -783669992: // capability - this.getCapability().add((TestScriptMetadataCapabilityComponent) value); // TestScriptMetadataCapabilityComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("link")) - this.getLink().add((TestScriptMetadataLinkComponent) value); - else if (name.equals("capability")) - this.getCapability().add((TestScriptMetadataCapabilityComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3321850: return addLink(); // TestScriptMetadataLinkComponent - case -783669992: return addCapability(); // TestScriptMetadataCapabilityComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("link")) { - return addLink(); - } - else if (name.equals("capability")) { - return addCapability(); - } - else - return super.addChild(name); - } - - public TestScriptMetadataComponent copy() { - TestScriptMetadataComponent dst = new TestScriptMetadataComponent(); - copyValues(dst); - if (link != null) { - dst.link = new ArrayList(); - for (TestScriptMetadataLinkComponent i : link) - dst.link.add(i.copy()); - }; - if (capability != null) { - dst.capability = new ArrayList(); - for (TestScriptMetadataCapabilityComponent i : capability) - dst.capability.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptMetadataComponent)) - return false; - TestScriptMetadataComponent o = (TestScriptMetadataComponent) other; - return compareDeep(link, o.link, true) && compareDeep(capability, o.capability, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptMetadataComponent)) - return false; - TestScriptMetadataComponent o = (TestScriptMetadataComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (link == null || link.isEmpty()) && (capability == null || capability.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.metadata"; - - } - - } - - @Block() - public static class TestScriptMetadataLinkComponent extends BackboneElement implements IBaseBackboneElement { - /** - * URL to a particular requirement or feature within the FHIR specification. - */ - @Child(name = "url", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="URL to the specification", formalDefinition="URL to a particular requirement or feature within the FHIR specification." ) - protected UriType url; - - /** - * Short description of the link. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Short description", formalDefinition="Short description of the link." ) - protected StringType description; - - private static final long serialVersionUID = 213372298L; - - /** - * Constructor - */ - public TestScriptMetadataLinkComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptMetadataLinkComponent(UriType url) { - super(); - this.url = url; - } - - /** - * @return {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (URL to a particular requirement or feature within the FHIR specification.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public TestScriptMetadataLinkComponent setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return URL to a particular requirement or feature within the FHIR specification. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value URL to a particular requirement or feature within the FHIR specification. - */ - public TestScriptMetadataLinkComponent setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #description} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataLinkComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Short description of the link.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public TestScriptMetadataLinkComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Short description of the link. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Short description of the link. - */ - public TestScriptMetadataLinkComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "URL to a particular requirement or feature within the FHIR specification.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("description", "string", "Short description of the link.", 0, java.lang.Integer.MAX_VALUE, description)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.url"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); - } - else - return super.addChild(name); - } - - public TestScriptMetadataLinkComponent copy() { - TestScriptMetadataLinkComponent dst = new TestScriptMetadataLinkComponent(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.description = description == null ? null : description.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptMetadataLinkComponent)) - return false; - TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other; - return compareDeep(url, o.url, true) && compareDeep(description, o.description, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptMetadataLinkComponent)) - return false; - TestScriptMetadataLinkComponent o = (TestScriptMetadataLinkComponent) other; - return compareValues(url, o.url, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (description == null || description.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.metadata.link"; - - } - - } - - @Block() - public static class TestScriptMetadataCapabilityComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. - */ - @Child(name = "required", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Are the capabilities required?", formalDefinition="Whether or not the test execution will require the given capabilities of the server in order for this test script to execute." ) - protected BooleanType required; - - /** - * Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. - */ - @Child(name = "validated", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Are the capabilities validated?", formalDefinition="Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute." ) - protected BooleanType validated; - - /** - * Description of the capabilities that this test script is requiring the server to support. - */ - @Child(name = "description", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The expected capabilities of the server", formalDefinition="Description of the capabilities that this test script is requiring the server to support." ) - protected StringType description; - - /** - * Which origin server these requirements apply to. - */ - @Child(name = "origin", type = {IntegerType.class}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Which origin server these requirements apply to", formalDefinition="Which origin server these requirements apply to." ) - protected List origin; - - /** - * Which server these requirements apply to. - */ - @Child(name = "destination", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Which server these requirements apply to", formalDefinition="Which server these requirements apply to." ) - protected IntegerType destination; - - /** - * Links to the FHIR specification that describes this interaction and the resources involved in more detail. - */ - @Child(name = "link", type = {UriType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Links to the FHIR specification", formalDefinition="Links to the FHIR specification that describes this interaction and the resources involved in more detail." ) - protected List link; - - /** - * Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped. - */ - @Child(name = "conformance", type = {Conformance.class}, order=7, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Required Conformance", formalDefinition="Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped." ) - protected Reference conformance; - - /** - * The actual object that is the target of the reference (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) - */ - protected Conformance conformanceTarget; - - private static final long serialVersionUID = 500671983L; - - /** - * Constructor - */ - public TestScriptMetadataCapabilityComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptMetadataCapabilityComponent(Reference conformance) { - super(); - this.conformance = conformance; - } - - /** - * @return {@link #required} (Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public BooleanType getRequiredElement() { - if (this.required == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.required"); - else if (Configuration.doAutoCreate()) - this.required = new BooleanType(); // bb - return this.required; - } - - public boolean hasRequiredElement() { - return this.required != null && !this.required.isEmpty(); - } - - public boolean hasRequired() { - return this.required != null && !this.required.isEmpty(); - } - - /** - * @param value {@link #required} (Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getRequired" gives direct access to the value - */ - public TestScriptMetadataCapabilityComponent setRequiredElement(BooleanType value) { - this.required = value; - return this; - } - - /** - * @return Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. - */ - public boolean getRequired() { - return this.required == null || this.required.isEmpty() ? false : this.required.getValue(); - } - - /** - * @param value Whether or not the test execution will require the given capabilities of the server in order for this test script to execute. - */ - public TestScriptMetadataCapabilityComponent setRequired(boolean value) { - if (this.required == null) - this.required = new BooleanType(); - this.required.setValue(value); - return this; - } - - /** - * @return {@link #validated} (Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getValidated" gives direct access to the value - */ - public BooleanType getValidatedElement() { - if (this.validated == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.validated"); - else if (Configuration.doAutoCreate()) - this.validated = new BooleanType(); // bb - return this.validated; - } - - public boolean hasValidatedElement() { - return this.validated != null && !this.validated.isEmpty(); - } - - public boolean hasValidated() { - return this.validated != null && !this.validated.isEmpty(); - } - - /** - * @param value {@link #validated} (Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.). This is the underlying object with id, value and extensions. The accessor "getValidated" gives direct access to the value - */ - public TestScriptMetadataCapabilityComponent setValidatedElement(BooleanType value) { - this.validated = value; - return this; - } - - /** - * @return Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. - */ - public boolean getValidated() { - return this.validated == null || this.validated.isEmpty() ? false : this.validated.getValue(); - } - - /** - * @param value Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute. - */ - public TestScriptMetadataCapabilityComponent setValidated(boolean value) { - if (this.validated == null) - this.validated = new BooleanType(); - this.validated.setValue(value); - return this; - } - - /** - * @return {@link #description} (Description of the capabilities that this test script is requiring the server to support.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (Description of the capabilities that this test script is requiring the server to support.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public TestScriptMetadataCapabilityComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return Description of the capabilities that this test script is requiring the server to support. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value Description of the capabilities that this test script is requiring the server to support. - */ - public TestScriptMetadataCapabilityComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #origin} (Which origin server these requirements apply to.) - */ - public List getOrigin() { - if (this.origin == null) - this.origin = new ArrayList(); - return this.origin; - } - - public boolean hasOrigin() { - if (this.origin == null) - return false; - for (IntegerType item : this.origin) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #origin} (Which origin server these requirements apply to.) - */ - // syntactic sugar - public IntegerType addOriginElement() {//2 - IntegerType t = new IntegerType(); - if (this.origin == null) - this.origin = new ArrayList(); - this.origin.add(t); - return t; - } - - /** - * @param value {@link #origin} (Which origin server these requirements apply to.) - */ - public TestScriptMetadataCapabilityComponent addOrigin(int value) { //1 - IntegerType t = new IntegerType(); - t.setValue(value); - if (this.origin == null) - this.origin = new ArrayList(); - this.origin.add(t); - return this; - } - - /** - * @param value {@link #origin} (Which origin server these requirements apply to.) - */ - public boolean hasOrigin(int value) { - if (this.origin == null) - return false; - for (IntegerType v : this.origin) - if (v.equals(value)) // integer - return true; - return false; - } - - /** - * @return {@link #destination} (Which server these requirements apply to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value - */ - public IntegerType getDestinationElement() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new IntegerType(); // bb - return this.destination; - } - - public boolean hasDestinationElement() { - return this.destination != null && !this.destination.isEmpty(); - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (Which server these requirements apply to.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value - */ - public TestScriptMetadataCapabilityComponent setDestinationElement(IntegerType value) { - this.destination = value; - return this; - } - - /** - * @return Which server these requirements apply to. - */ - public int getDestination() { - return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); - } - - /** - * @param value Which server these requirements apply to. - */ - public TestScriptMetadataCapabilityComponent setDestination(int value) { - if (this.destination == null) - this.destination = new IntegerType(); - this.destination.setValue(value); - return this; - } - - /** - * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) - */ - public List getLink() { - if (this.link == null) - this.link = new ArrayList(); - return this.link; - } - - public boolean hasLink() { - if (this.link == null) - return false; - for (UriType item : this.link) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) - */ - // syntactic sugar - public UriType addLinkElement() {//2 - UriType t = new UriType(); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return t; - } - - /** - * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) - */ - public TestScriptMetadataCapabilityComponent addLink(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.link == null) - this.link = new ArrayList(); - this.link.add(t); - return this; - } - - /** - * @param value {@link #link} (Links to the FHIR specification that describes this interaction and the resources involved in more detail.) - */ - public boolean hasLink(String value) { - if (this.link == null) - return false; - for (UriType v : this.link) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #conformance} (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) - */ - public Reference getConformance() { - if (this.conformance == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.conformance"); - else if (Configuration.doAutoCreate()) - this.conformance = new Reference(); // cc - return this.conformance; - } - - public boolean hasConformance() { - return this.conformance != null && !this.conformance.isEmpty(); - } - - /** - * @param value {@link #conformance} (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) - */ - public TestScriptMetadataCapabilityComponent setConformance(Reference value) { - this.conformance = value; - return this; - } - - /** - * @return {@link #conformance} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) - */ - public Conformance getConformanceTarget() { - if (this.conformanceTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptMetadataCapabilityComponent.conformance"); - else if (Configuration.doAutoCreate()) - this.conformanceTarget = new Conformance(); // aa - return this.conformanceTarget; - } - - /** - * @param value {@link #conformance} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.) - */ - public TestScriptMetadataCapabilityComponent setConformanceTarget(Conformance value) { - this.conformanceTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("required", "boolean", "Whether or not the test execution will require the given capabilities of the server in order for this test script to execute.", 0, java.lang.Integer.MAX_VALUE, required)); - childrenList.add(new Property("validated", "boolean", "Whether or not the test execution will validate the given capabilities of the server in order for this test script to execute.", 0, java.lang.Integer.MAX_VALUE, validated)); - childrenList.add(new Property("description", "string", "Description of the capabilities that this test script is requiring the server to support.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("origin", "integer", "Which origin server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("destination", "integer", "Which server these requirements apply to.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("link", "uri", "Links to the FHIR specification that describes this interaction and the resources involved in more detail.", 0, java.lang.Integer.MAX_VALUE, link)); - childrenList.add(new Property("conformance", "Reference(Conformance)", "Minimum conformance required of server for test script to execute successfully. If server does not meet at a minimum the reference conformance definition, then all tests in this script are skipped.", 0, java.lang.Integer.MAX_VALUE, conformance)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -393139297: /*required*/ return this.required == null ? new Base[0] : new Base[] {this.required}; // BooleanType - case -1109784050: /*validated*/ return this.validated == null ? new Base[0] : new Base[] {this.validated}; // BooleanType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // IntegerType - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType - case 3321850: /*link*/ return this.link == null ? new Base[0] : this.link.toArray(new Base[this.link.size()]); // UriType - case 1374858133: /*conformance*/ return this.conformance == null ? new Base[0] : new Base[] {this.conformance}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -393139297: // required - this.required = castToBoolean(value); // BooleanType - break; - case -1109784050: // validated - this.validated = castToBoolean(value); // BooleanType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1008619738: // origin - this.getOrigin().add(castToInteger(value)); // IntegerType - break; - case -1429847026: // destination - this.destination = castToInteger(value); // IntegerType - break; - case 3321850: // link - this.getLink().add(castToUri(value)); // UriType - break; - case 1374858133: // conformance - this.conformance = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("required")) - this.required = castToBoolean(value); // BooleanType - else if (name.equals("validated")) - this.validated = castToBoolean(value); // BooleanType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("origin")) - this.getOrigin().add(castToInteger(value)); - else if (name.equals("destination")) - this.destination = castToInteger(value); // IntegerType - else if (name.equals("link")) - this.getLink().add(castToUri(value)); - else if (name.equals("conformance")) - this.conformance = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -393139297: throw new FHIRException("Cannot make property required as it is not a complex type"); // BooleanType - case -1109784050: throw new FHIRException("Cannot make property validated as it is not a complex type"); // BooleanType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1008619738: throw new FHIRException("Cannot make property origin as it is not a complex type"); // IntegerType - case -1429847026: throw new FHIRException("Cannot make property destination as it is not a complex type"); // IntegerType - case 3321850: throw new FHIRException("Cannot make property link as it is not a complex type"); // UriType - case 1374858133: return getConformance(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("required")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.required"); - } - else if (name.equals("validated")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.validated"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); - } - else if (name.equals("origin")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin"); - } - else if (name.equals("destination")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination"); - } - else if (name.equals("link")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.link"); - } - else if (name.equals("conformance")) { - this.conformance = new Reference(); - return this.conformance; - } - else - return super.addChild(name); - } - - public TestScriptMetadataCapabilityComponent copy() { - TestScriptMetadataCapabilityComponent dst = new TestScriptMetadataCapabilityComponent(); - copyValues(dst); - dst.required = required == null ? null : required.copy(); - dst.validated = validated == null ? null : validated.copy(); - dst.description = description == null ? null : description.copy(); - if (origin != null) { - dst.origin = new ArrayList(); - for (IntegerType i : origin) - dst.origin.add(i.copy()); - }; - dst.destination = destination == null ? null : destination.copy(); - if (link != null) { - dst.link = new ArrayList(); - for (UriType i : link) - dst.link.add(i.copy()); - }; - dst.conformance = conformance == null ? null : conformance.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptMetadataCapabilityComponent)) - return false; - TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other; - return compareDeep(required, o.required, true) && compareDeep(validated, o.validated, true) && compareDeep(description, o.description, true) - && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(link, o.link, true) - && compareDeep(conformance, o.conformance, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptMetadataCapabilityComponent)) - return false; - TestScriptMetadataCapabilityComponent o = (TestScriptMetadataCapabilityComponent) other; - return compareValues(required, o.required, true) && compareValues(validated, o.validated, true) && compareValues(description, o.description, true) - && compareValues(origin, o.origin, true) && compareValues(destination, o.destination, true) && compareValues(link, o.link, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (required == null || required.isEmpty()) && (validated == null || validated.isEmpty()) - && (description == null || description.isEmpty()) && (origin == null || origin.isEmpty()) - && (destination == null || destination.isEmpty()) && (link == null || link.isEmpty()) && (conformance == null || conformance.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.metadata.capability"; - - } - - } - - @Block() - public static class TestScriptFixtureComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. - */ - @Child(name = "autocreate", type = {BooleanType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether or not to implicitly create the fixture during setup", formalDefinition="Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section." ) - protected BooleanType autocreate; - - /** - * Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. - */ - @Child(name = "autodelete", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether or not to implicitly delete the fixture during teardown", formalDefinition="Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section." ) - protected BooleanType autodelete; - - /** - * Reference to the resource (containing the contents of the resource needed for operations). - */ - @Child(name = "resource", type = {}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Reference of the resource", formalDefinition="Reference to the resource (containing the contents of the resource needed for operations)." ) - protected Reference resource; - - /** - * The actual object that is the target of the reference (Reference to the resource (containing the contents of the resource needed for operations).) - */ - protected Resource resourceTarget; - - private static final long serialVersionUID = 1110683307L; - - /** - * Constructor - */ - public TestScriptFixtureComponent() { - super(); - } - - /** - * @return {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value - */ - public BooleanType getAutocreateElement() { - if (this.autocreate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptFixtureComponent.autocreate"); - else if (Configuration.doAutoCreate()) - this.autocreate = new BooleanType(); // bb - return this.autocreate; - } - - public boolean hasAutocreateElement() { - return this.autocreate != null && !this.autocreate.isEmpty(); - } - - public boolean hasAutocreate() { - return this.autocreate != null && !this.autocreate.isEmpty(); - } - - /** - * @param value {@link #autocreate} (Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.). This is the underlying object with id, value and extensions. The accessor "getAutocreate" gives direct access to the value - */ - public TestScriptFixtureComponent setAutocreateElement(BooleanType value) { - this.autocreate = value; - return this; - } - - /** - * @return Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. - */ - public boolean getAutocreate() { - return this.autocreate == null || this.autocreate.isEmpty() ? false : this.autocreate.getValue(); - } - - /** - * @param value Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section. - */ - public TestScriptFixtureComponent setAutocreate(boolean value) { - if (this.autocreate == null) - this.autocreate = new BooleanType(); - this.autocreate.setValue(value); - return this; - } - - /** - * @return {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value - */ - public BooleanType getAutodeleteElement() { - if (this.autodelete == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptFixtureComponent.autodelete"); - else if (Configuration.doAutoCreate()) - this.autodelete = new BooleanType(); // bb - return this.autodelete; - } - - public boolean hasAutodeleteElement() { - return this.autodelete != null && !this.autodelete.isEmpty(); - } - - public boolean hasAutodelete() { - return this.autodelete != null && !this.autodelete.isEmpty(); - } - - /** - * @param value {@link #autodelete} (Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.). This is the underlying object with id, value and extensions. The accessor "getAutodelete" gives direct access to the value - */ - public TestScriptFixtureComponent setAutodeleteElement(BooleanType value) { - this.autodelete = value; - return this; - } - - /** - * @return Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. - */ - public boolean getAutodelete() { - return this.autodelete == null || this.autodelete.isEmpty() ? false : this.autodelete.getValue(); - } - - /** - * @param value Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section. - */ - public TestScriptFixtureComponent setAutodelete(boolean value) { - if (this.autodelete == null) - this.autodelete = new BooleanType(); - this.autodelete.setValue(value); - return this; - } - - /** - * @return {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptFixtureComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (Reference to the resource (containing the contents of the resource needed for operations).) - */ - public TestScriptFixtureComponent setResource(Reference value) { - this.resource = value; - return this; - } - - /** - * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the resource (containing the contents of the resource needed for operations).) - */ - public Resource getResourceTarget() { - return this.resourceTarget; - } - - /** - * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the resource (containing the contents of the resource needed for operations).) - */ - public TestScriptFixtureComponent setResourceTarget(Resource value) { - this.resourceTarget = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("autocreate", "boolean", "Whether or not to implicitly create the fixture during setup. If true, the fixture is automatically created on each server being tested during setup, therefore no create operation is required for this fixture in the TestScript.setup section.", 0, java.lang.Integer.MAX_VALUE, autocreate)); - childrenList.add(new Property("autodelete", "boolean", "Whether or not to implicitly delete the fixture during teardown If true, the fixture is automatically deleted on each server being tested during teardown, therefore no delete operation is required for this fixture in the TestScript.teardown section.", 0, java.lang.Integer.MAX_VALUE, autodelete)); - childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the resource needed for operations).", 0, java.lang.Integer.MAX_VALUE, resource)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 73154411: /*autocreate*/ return this.autocreate == null ? new Base[0] : new Base[] {this.autocreate}; // BooleanType - case 89990170: /*autodelete*/ return this.autodelete == null ? new Base[0] : new Base[] {this.autodelete}; // BooleanType - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 73154411: // autocreate - this.autocreate = castToBoolean(value); // BooleanType - break; - case 89990170: // autodelete - this.autodelete = castToBoolean(value); // BooleanType - break; - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("autocreate")) - this.autocreate = castToBoolean(value); // BooleanType - else if (name.equals("autodelete")) - this.autodelete = castToBoolean(value); // BooleanType - else if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 73154411: throw new FHIRException("Cannot make property autocreate as it is not a complex type"); // BooleanType - case 89990170: throw new FHIRException("Cannot make property autodelete as it is not a complex type"); // BooleanType - case -341064690: return getResource(); // Reference - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("autocreate")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.autocreate"); - } - else if (name.equals("autodelete")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.autodelete"); - } - else if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else - return super.addChild(name); - } - - public TestScriptFixtureComponent copy() { - TestScriptFixtureComponent dst = new TestScriptFixtureComponent(); - copyValues(dst); - dst.autocreate = autocreate == null ? null : autocreate.copy(); - dst.autodelete = autodelete == null ? null : autodelete.copy(); - dst.resource = resource == null ? null : resource.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptFixtureComponent)) - return false; - TestScriptFixtureComponent o = (TestScriptFixtureComponent) other; - return compareDeep(autocreate, o.autocreate, true) && compareDeep(autodelete, o.autodelete, true) - && compareDeep(resource, o.resource, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptFixtureComponent)) - return false; - TestScriptFixtureComponent o = (TestScriptFixtureComponent) other; - return compareValues(autocreate, o.autocreate, true) && compareValues(autodelete, o.autodelete, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (autocreate == null || autocreate.isEmpty()) && (autodelete == null || autodelete.isEmpty()) - && (resource == null || resource.isEmpty()); - } - - public String fhirType() { - return "TestScript.fixture"; - - } - - } - - @Block() - public static class TestScriptVariableComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Descriptive name for this variable. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Descriptive name for this variable", formalDefinition="Descriptive name for this variable." ) - protected StringType name; - - /** - * A default, hard-coded, or user-defined value for this variable. - */ - @Child(name = "defaultValue", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Default, hard-coded, or user-defined value for this variable", formalDefinition="A default, hard-coded, or user-defined value for this variable." ) - protected StringType defaultValue; - - /** - * Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. - */ - @Child(name = "headerField", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="HTTP header field name for source", formalDefinition="Will be used to grab the HTTP header field value from the headers that sourceId is pointing to." ) - protected StringType headerField; - - /** - * XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both. - */ - @Child(name = "path", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="XPath or JSONPath against the fixture body", formalDefinition="XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both." ) - protected StringType path; - - /** - * Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. - */ - @Child(name = "sourceId", type = {IdType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Fixture Id of source expression or headerField within this variable", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable." ) - protected IdType sourceId; - - private static final long serialVersionUID = 1821729272L; - - /** - * Constructor - */ - public TestScriptVariableComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptVariableComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (Descriptive name for this variable.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptVariableComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Descriptive name for this variable.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TestScriptVariableComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Descriptive name for this variable. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Descriptive name for this variable. - */ - public TestScriptVariableComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #defaultValue} (A default, hard-coded, or user-defined value for this variable.). This is the underlying object with id, value and extensions. The accessor "getDefaultValue" gives direct access to the value - */ - public StringType getDefaultValueElement() { - if (this.defaultValue == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptVariableComponent.defaultValue"); - else if (Configuration.doAutoCreate()) - this.defaultValue = new StringType(); // bb - return this.defaultValue; - } - - public boolean hasDefaultValueElement() { - return this.defaultValue != null && !this.defaultValue.isEmpty(); - } - - public boolean hasDefaultValue() { - return this.defaultValue != null && !this.defaultValue.isEmpty(); - } - - /** - * @param value {@link #defaultValue} (A default, hard-coded, or user-defined value for this variable.). This is the underlying object with id, value and extensions. The accessor "getDefaultValue" gives direct access to the value - */ - public TestScriptVariableComponent setDefaultValueElement(StringType value) { - this.defaultValue = value; - return this; - } - - /** - * @return A default, hard-coded, or user-defined value for this variable. - */ - public String getDefaultValue() { - return this.defaultValue == null ? null : this.defaultValue.getValue(); - } - - /** - * @param value A default, hard-coded, or user-defined value for this variable. - */ - public TestScriptVariableComponent setDefaultValue(String value) { - if (Utilities.noString(value)) - this.defaultValue = null; - else { - if (this.defaultValue == null) - this.defaultValue = new StringType(); - this.defaultValue.setValue(value); - } - return this; - } - - /** - * @return {@link #headerField} (Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value - */ - public StringType getHeaderFieldElement() { - if (this.headerField == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptVariableComponent.headerField"); - else if (Configuration.doAutoCreate()) - this.headerField = new StringType(); // bb - return this.headerField; - } - - public boolean hasHeaderFieldElement() { - return this.headerField != null && !this.headerField.isEmpty(); - } - - public boolean hasHeaderField() { - return this.headerField != null && !this.headerField.isEmpty(); - } - - /** - * @param value {@link #headerField} (Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value - */ - public TestScriptVariableComponent setHeaderFieldElement(StringType value) { - this.headerField = value; - return this; - } - - /** - * @return Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. - */ - public String getHeaderField() { - return this.headerField == null ? null : this.headerField.getValue(); - } - - /** - * @param value Will be used to grab the HTTP header field value from the headers that sourceId is pointing to. - */ - public TestScriptVariableComponent setHeaderField(String value) { - if (Utilities.noString(value)) - this.headerField = null; - else { - if (this.headerField == null) - this.headerField = new StringType(); - this.headerField.setValue(value); - } - return this; - } - - /** - * @return {@link #path} (XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptVariableComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public TestScriptVariableComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both. - */ - public TestScriptVariableComponent setPath(String value) { - if (Utilities.noString(value)) - this.path = null; - else { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - } - return this; - } - - /** - * @return {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value - */ - public IdType getSourceIdElement() { - if (this.sourceId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptVariableComponent.sourceId"); - else if (Configuration.doAutoCreate()) - this.sourceId = new IdType(); // bb - return this.sourceId; - } - - public boolean hasSourceIdElement() { - return this.sourceId != null && !this.sourceId.isEmpty(); - } - - public boolean hasSourceId() { - return this.sourceId != null && !this.sourceId.isEmpty(); - } - - /** - * @param value {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value - */ - public TestScriptVariableComponent setSourceIdElement(IdType value) { - this.sourceId = value; - return this; - } - - /** - * @return Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. - */ - public String getSourceId() { - return this.sourceId == null ? null : this.sourceId.getValue(); - } - - /** - * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable. - */ - public TestScriptVariableComponent setSourceId(String value) { - if (Utilities.noString(value)) - this.sourceId = null; - else { - if (this.sourceId == null) - this.sourceId = new IdType(); - this.sourceId.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Descriptive name for this variable.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("defaultValue", "string", "A default, hard-coded, or user-defined value for this variable.", 0, java.lang.Integer.MAX_VALUE, defaultValue)); - childrenList.add(new Property("headerField", "string", "Will be used to grab the HTTP header field value from the headers that sourceId is pointing to.", 0, java.lang.Integer.MAX_VALUE, headerField)); - childrenList.add(new Property("path", "string", "XPath or JSONPath against the fixture body. When variables are defined, either headerField must be specified or path, but not both.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField against within this variable.", 0, java.lang.Integer.MAX_VALUE, sourceId)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -659125328: /*defaultValue*/ return this.defaultValue == null ? new Base[0] : new Base[] {this.defaultValue}; // StringType - case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -659125328: // defaultValue - this.defaultValue = castToString(value); // StringType - break; - case 1160732269: // headerField - this.headerField = castToString(value); // StringType - break; - case 3433509: // path - this.path = castToString(value); // StringType - break; - case 1746327190: // sourceId - this.sourceId = castToId(value); // IdType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("defaultValue")) - this.defaultValue = castToString(value); // StringType - else if (name.equals("headerField")) - this.headerField = castToString(value); // StringType - else if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("sourceId")) - this.sourceId = castToId(value); // IdType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -659125328: throw new FHIRException("Cannot make property defaultValue as it is not a complex type"); // StringType - case 1160732269: throw new FHIRException("Cannot make property headerField as it is not a complex type"); // StringType - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case 1746327190: throw new FHIRException("Cannot make property sourceId as it is not a complex type"); // IdType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("defaultValue")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.defaultValue"); - } - else if (name.equals("headerField")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField"); - } - else if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.path"); - } - else if (name.equals("sourceId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId"); - } - else - return super.addChild(name); - } - - public TestScriptVariableComponent copy() { - TestScriptVariableComponent dst = new TestScriptVariableComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.defaultValue = defaultValue == null ? null : defaultValue.copy(); - dst.headerField = headerField == null ? null : headerField.copy(); - dst.path = path == null ? null : path.copy(); - dst.sourceId = sourceId == null ? null : sourceId.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptVariableComponent)) - return false; - TestScriptVariableComponent o = (TestScriptVariableComponent) other; - return compareDeep(name, o.name, true) && compareDeep(defaultValue, o.defaultValue, true) && compareDeep(headerField, o.headerField, true) - && compareDeep(path, o.path, true) && compareDeep(sourceId, o.sourceId, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptVariableComponent)) - return false; - TestScriptVariableComponent o = (TestScriptVariableComponent) other; - return compareValues(name, o.name, true) && compareValues(defaultValue, o.defaultValue, true) && compareValues(headerField, o.headerField, true) - && compareValues(path, o.path, true) && compareValues(sourceId, o.sourceId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (defaultValue == null || defaultValue.isEmpty()) - && (headerField == null || headerField.isEmpty()) && (path == null || path.isEmpty()) && (sourceId == null || sourceId.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.variable"; - - } - - } - - @Block() - public static class TestScriptRuleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Reference to the resource (containing the contents of the rule needed for assertions). - */ - @Child(name = "resource", type = {}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Assert rule resource reference", formalDefinition="Reference to the resource (containing the contents of the rule needed for assertions)." ) - protected Reference resource; - - /** - * The actual object that is the target of the reference (Reference to the resource (containing the contents of the rule needed for assertions).) - */ - protected Resource resourceTarget; - - /** - * Each rule template can take one or more parameters for rule evaluation. - */ - @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) - protected List param; - - private static final long serialVersionUID = -524260474L; - - /** - * Constructor - */ - public TestScriptRuleComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptRuleComponent(Reference resource) { - super(); - this.resource = resource; - } - - /** - * @return {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRuleComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (Reference to the resource (containing the contents of the rule needed for assertions).) - */ - public TestScriptRuleComponent setResource(Reference value) { - this.resource = value; - return this; - } - - /** - * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the resource (containing the contents of the rule needed for assertions).) - */ - public Resource getResourceTarget() { - return this.resourceTarget; - } - - /** - * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the resource (containing the contents of the rule needed for assertions).) - */ - public TestScriptRuleComponent setResourceTarget(Resource value) { - this.resourceTarget = value; - return this; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - public List getParam() { - if (this.param == null) - this.param = new ArrayList(); - return this.param; - } - - public boolean hasParam() { - if (this.param == null) - return false; - for (TestScriptRuleParamComponent item : this.param) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - // syntactic sugar - public TestScriptRuleParamComponent addParam() { //3 - TestScriptRuleParamComponent t = new TestScriptRuleParamComponent(); - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return t; - } - - // syntactic sugar - public TestScriptRuleComponent addParam(TestScriptRuleParamComponent t) { //3 - if (t == null) - return this; - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the rule needed for assertions).", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // TestScriptRuleParamComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - case 106436749: // param - this.getParam().add((TestScriptRuleParamComponent) value); // TestScriptRuleParamComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else if (name.equals("param")) - this.getParam().add((TestScriptRuleParamComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -341064690: return getResource(); // Reference - case 106436749: return addParam(); // TestScriptRuleParamComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else if (name.equals("param")) { - return addParam(); - } - else - return super.addChild(name); - } - - public TestScriptRuleComponent copy() { - TestScriptRuleComponent dst = new TestScriptRuleComponent(); - copyValues(dst); - dst.resource = resource == null ? null : resource.copy(); - if (param != null) { - dst.param = new ArrayList(); - for (TestScriptRuleParamComponent i : param) - dst.param.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptRuleComponent)) - return false; - TestScriptRuleComponent o = (TestScriptRuleComponent) other; - return compareDeep(resource, o.resource, true) && compareDeep(param, o.param, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptRuleComponent)) - return false; - TestScriptRuleComponent o = (TestScriptRuleComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (resource == null || resource.isEmpty()) && (param == null || param.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.rule"; - - } - - } - - @Block() - public static class TestScriptRuleParamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Descriptive name for this parameter that matches the external assert rule parameter name. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." ) - protected StringType name; - - /** - * The explict or dynamic value for the parameter that will be passed on to the external rule template. - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The explict or dynamic value for the parameter that will be passed on to the external rule template." ) - protected StringType value; - - private static final long serialVersionUID = 395259392L; - - /** - * Constructor - */ - public TestScriptRuleParamComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptRuleParamComponent(StringType name, StringType value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRuleParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TestScriptRuleParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Descriptive name for this parameter that matches the external assert rule parameter name. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Descriptive name for this parameter that matches the external assert rule parameter name. - */ - public TestScriptRuleParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The explict or dynamic value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRuleParamComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The explict or dynamic value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public TestScriptRuleParamComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The explict or dynamic value for the parameter that will be passed on to the external rule template. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The explict or dynamic value for the parameter that will be passed on to the external rule template. - */ - public TestScriptRuleParamComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value", "string", "The explict or dynamic value for the parameter that will be passed on to the external rule template.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); - } - else - return super.addChild(name); - } - - public TestScriptRuleParamComponent copy() { - TestScriptRuleParamComponent dst = new TestScriptRuleParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptRuleParamComponent)) - return false; - TestScriptRuleParamComponent o = (TestScriptRuleParamComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptRuleParamComponent)) - return false; - TestScriptRuleParamComponent o = (TestScriptRuleParamComponent) other; - return compareValues(name, o.name, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.rule.param"; - - } - - } - - @Block() - public static class TestScriptRulesetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Reference to the resource (containing the contents of the ruleset needed for assertions). - */ - @Child(name = "resource", type = {}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Assert ruleset resource reference", formalDefinition="Reference to the resource (containing the contents of the ruleset needed for assertions)." ) - protected Reference resource; - - /** - * The actual object that is the target of the reference (Reference to the resource (containing the contents of the ruleset needed for assertions).) - */ - protected Resource resourceTarget; - - /** - * The referenced rule within the external ruleset template. - */ - @Child(name = "rule", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." ) - protected List rule; - - private static final long serialVersionUID = 5813554L; - - /** - * Constructor - */ - public TestScriptRulesetComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptRulesetComponent(Reference resource) { - super(); - this.resource = resource; - } - - /** - * @return {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).) - */ - public Reference getResource() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRulesetComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new Reference(); // cc - return this.resource; - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (Reference to the resource (containing the contents of the ruleset needed for assertions).) - */ - public TestScriptRulesetComponent setResource(Reference value) { - this.resource = value; - return this; - } - - /** - * @return {@link #resource} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (Reference to the resource (containing the contents of the ruleset needed for assertions).) - */ - public Resource getResourceTarget() { - return this.resourceTarget; - } - - /** - * @param value {@link #resource} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (Reference to the resource (containing the contents of the ruleset needed for assertions).) - */ - public TestScriptRulesetComponent setResourceTarget(Resource value) { - this.resourceTarget = value; - return this; - } - - /** - * @return {@link #rule} (The referenced rule within the external ruleset template.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (TestScriptRulesetRuleComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (The referenced rule within the external ruleset template.) - */ - // syntactic sugar - public TestScriptRulesetRuleComponent addRule() { //3 - TestScriptRulesetRuleComponent t = new TestScriptRulesetRuleComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public TestScriptRulesetComponent addRule(TestScriptRulesetRuleComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("resource", "Reference(Any)", "Reference to the resource (containing the contents of the ruleset needed for assertions).", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // Reference - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // TestScriptRulesetRuleComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -341064690: // resource - this.resource = castToReference(value); // Reference - break; - case 3512060: // rule - this.getRule().add((TestScriptRulesetRuleComponent) value); // TestScriptRulesetRuleComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("resource")) - this.resource = castToReference(value); // Reference - else if (name.equals("rule")) - this.getRule().add((TestScriptRulesetRuleComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -341064690: return getResource(); // Reference - case 3512060: return addRule(); // TestScriptRulesetRuleComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("resource")) { - this.resource = new Reference(); - return this.resource; - } - else if (name.equals("rule")) { - return addRule(); - } - else - return super.addChild(name); - } - - public TestScriptRulesetComponent copy() { - TestScriptRulesetComponent dst = new TestScriptRulesetComponent(); - copyValues(dst); - dst.resource = resource == null ? null : resource.copy(); - if (rule != null) { - dst.rule = new ArrayList(); - for (TestScriptRulesetRuleComponent i : rule) - dst.rule.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptRulesetComponent)) - return false; - TestScriptRulesetComponent o = (TestScriptRulesetComponent) other; - return compareDeep(resource, o.resource, true) && compareDeep(rule, o.rule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptRulesetComponent)) - return false; - TestScriptRulesetComponent o = (TestScriptRulesetComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (resource == null || resource.isEmpty()) && (rule == null || rule.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.ruleset"; - - } - - } - - @Block() - public static class TestScriptRulesetRuleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Id of the referenced rule within the external ruleset template. - */ - @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." ) - protected IdType ruleId; - - /** - * Each rule template can take one or more parameters for rule evaluation. - */ - @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Ruleset rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) - protected List param; - - private static final long serialVersionUID = 155033950L; - - /** - * Constructor - */ - public TestScriptRulesetRuleComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptRulesetRuleComponent(IdType ruleId) { - super(); - this.ruleId = ruleId; - } - - /** - * @return {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value - */ - public IdType getRuleIdElement() { - if (this.ruleId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRulesetRuleComponent.ruleId"); - else if (Configuration.doAutoCreate()) - this.ruleId = new IdType(); // bb - return this.ruleId; - } - - public boolean hasRuleIdElement() { - return this.ruleId != null && !this.ruleId.isEmpty(); - } - - public boolean hasRuleId() { - return this.ruleId != null && !this.ruleId.isEmpty(); - } - - /** - * @param value {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value - */ - public TestScriptRulesetRuleComponent setRuleIdElement(IdType value) { - this.ruleId = value; - return this; - } - - /** - * @return Id of the referenced rule within the external ruleset template. - */ - public String getRuleId() { - return this.ruleId == null ? null : this.ruleId.getValue(); - } - - /** - * @param value Id of the referenced rule within the external ruleset template. - */ - public TestScriptRulesetRuleComponent setRuleId(String value) { - if (this.ruleId == null) - this.ruleId = new IdType(); - this.ruleId.setValue(value); - return this; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - public List getParam() { - if (this.param == null) - this.param = new ArrayList(); - return this.param; - } - - public boolean hasParam() { - if (this.param == null) - return false; - for (TestScriptRulesetRuleParamComponent item : this.param) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - // syntactic sugar - public TestScriptRulesetRuleParamComponent addParam() { //3 - TestScriptRulesetRuleParamComponent t = new TestScriptRulesetRuleParamComponent(); - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return t; - } - - // syntactic sugar - public TestScriptRulesetRuleComponent addParam(TestScriptRulesetRuleParamComponent t) { //3 - if (t == null) - return this; - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, ruleId)); - childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType - case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // TestScriptRulesetRuleParamComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -919875273: // ruleId - this.ruleId = castToId(value); // IdType - break; - case 106436749: // param - this.getParam().add((TestScriptRulesetRuleParamComponent) value); // TestScriptRulesetRuleParamComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("ruleId")) - this.ruleId = castToId(value); // IdType - else if (name.equals("param")) - this.getParam().add((TestScriptRulesetRuleParamComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -919875273: throw new FHIRException("Cannot make property ruleId as it is not a complex type"); // IdType - case 106436749: return addParam(); // TestScriptRulesetRuleParamComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("ruleId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId"); - } - else if (name.equals("param")) { - return addParam(); - } - else - return super.addChild(name); - } - - public TestScriptRulesetRuleComponent copy() { - TestScriptRulesetRuleComponent dst = new TestScriptRulesetRuleComponent(); - copyValues(dst); - dst.ruleId = ruleId == null ? null : ruleId.copy(); - if (param != null) { - dst.param = new ArrayList(); - for (TestScriptRulesetRuleParamComponent i : param) - dst.param.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptRulesetRuleComponent)) - return false; - TestScriptRulesetRuleComponent o = (TestScriptRulesetRuleComponent) other; - return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptRulesetRuleComponent)) - return false; - TestScriptRulesetRuleComponent o = (TestScriptRulesetRuleComponent) other; - return compareValues(ruleId, o.ruleId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (ruleId == null || ruleId.isEmpty()) && (param == null || param.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.ruleset.rule"; - - } - - } - - @Block() - public static class TestScriptRulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Descriptive name for this parameter that matches the external assert ruleset rule parameter name. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter name matching external assert ruleset rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert ruleset rule parameter name." ) - protected StringType name; - - /** - * The value for the parameter that will be passed on to the external ruleset rule template. - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external ruleset rule template." ) - protected StringType value; - - private static final long serialVersionUID = 395259392L; - - /** - * Constructor - */ - public TestScriptRulesetRuleParamComponent() { - super(); - } - - /** - * Constructor - */ - public TestScriptRulesetRuleParamComponent(StringType name, StringType value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRulesetRuleParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TestScriptRulesetRuleParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name. - */ - public TestScriptRulesetRuleParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptRulesetRuleParamComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public TestScriptRulesetRuleParamComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value for the parameter that will be passed on to the external ruleset rule template. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value for the parameter that will be passed on to the external ruleset rule template. - */ - public TestScriptRulesetRuleParamComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); - } - else - return super.addChild(name); - } - - public TestScriptRulesetRuleParamComponent copy() { - TestScriptRulesetRuleParamComponent dst = new TestScriptRulesetRuleParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptRulesetRuleParamComponent)) - return false; - TestScriptRulesetRuleParamComponent o = (TestScriptRulesetRuleParamComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptRulesetRuleParamComponent)) - return false; - TestScriptRulesetRuleParamComponent o = (TestScriptRulesetRuleParamComponent) other; - return compareValues(name, o.name, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.ruleset.rule.param"; - - } - - } - - @Block() - public static class TestScriptSetupComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. - */ - @Child(name = "metadata", type = {TestScriptMetadataComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Capabilities that are assumed to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." ) - protected TestScriptMetadataComponent metadata; - - /** - * Action would contain either an operation or an assertion. - */ - @Child(name = "action", type = {}, order=2, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A setup operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." ) - protected List action; - - private static final long serialVersionUID = 9850834L; - - /** - * Constructor - */ - public TestScriptSetupComponent() { - super(); - } - - /** - * @return {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public TestScriptMetadataComponent getMetadata() { - if (this.metadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptSetupComponent.metadata"); - else if (Configuration.doAutoCreate()) - this.metadata = new TestScriptMetadataComponent(); // cc - return this.metadata; - } - - public boolean hasMetadata() { - return this.metadata != null && !this.metadata.isEmpty(); - } - - /** - * @param value {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public TestScriptSetupComponent setMetadata(TestScriptMetadataComponent value) { - this.metadata = value; - return this; - } - - /** - * @return {@link #action} (Action would contain either an operation or an assertion.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (SetupActionComponent item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Action would contain either an operation or an assertion.) - */ - // syntactic sugar - public SetupActionComponent addAction() { //3 - SetupActionComponent t = new SetupActionComponent(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public TestScriptSetupComponent addAction(SetupActionComponent t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("metadata", "@TestScript.metadata", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata)); - childrenList.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // SetupActionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -450004177: // metadata - this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent - break; - case -1422950858: // action - this.getAction().add((SetupActionComponent) value); // SetupActionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("metadata")) - this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent - else if (name.equals("action")) - this.getAction().add((SetupActionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -450004177: return getMetadata(); // TestScriptMetadataComponent - case -1422950858: return addAction(); // SetupActionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("metadata")) { - this.metadata = new TestScriptMetadataComponent(); - return this.metadata; - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public TestScriptSetupComponent copy() { - TestScriptSetupComponent dst = new TestScriptSetupComponent(); - copyValues(dst); - dst.metadata = metadata == null ? null : metadata.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (SetupActionComponent i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptSetupComponent)) - return false; - TestScriptSetupComponent o = (TestScriptSetupComponent) other; - return compareDeep(metadata, o.metadata, true) && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptSetupComponent)) - return false; - TestScriptSetupComponent o = (TestScriptSetupComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (metadata == null || metadata.isEmpty()) && (action == null || action.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup"; - - } - - } - - @Block() - public static class SetupActionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The operation to perform. - */ - @Child(name = "operation", type = {}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The setup operation to perform", formalDefinition="The operation to perform." ) - protected SetupActionOperationComponent operation; - - /** - * Evaluates the results of previous operations to determine if the server under test behaves appropriately. - */ - @Child(name = "assert", type = {}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." ) - protected SetupActionAssertComponent assert_; - - private static final long serialVersionUID = -252088305L; - - /** - * Constructor - */ - public SetupActionComponent() { - super(); - } - - /** - * @return {@link #operation} (The operation to perform.) - */ - public SetupActionOperationComponent getOperation() { - if (this.operation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionComponent.operation"); - else if (Configuration.doAutoCreate()) - this.operation = new SetupActionOperationComponent(); // cc - return this.operation; - } - - public boolean hasOperation() { - return this.operation != null && !this.operation.isEmpty(); - } - - /** - * @param value {@link #operation} (The operation to perform.) - */ - public SetupActionComponent setOperation(SetupActionOperationComponent value) { - this.operation = value; - return this; - } - - /** - * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) - */ - public SetupActionAssertComponent getAssert() { - if (this.assert_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionComponent.assert_"); - else if (Configuration.doAutoCreate()) - this.assert_ = new SetupActionAssertComponent(); // cc - return this.assert_; - } - - public boolean hasAssert() { - return this.assert_ != null && !this.assert_.isEmpty(); - } - - /** - * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) - */ - public SetupActionComponent setAssert(SetupActionAssertComponent value) { - this.assert_ = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("operation", "", "The operation to perform.", 0, java.lang.Integer.MAX_VALUE, operation)); - childrenList.add(new Property("assert", "", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, java.lang.Integer.MAX_VALUE, assert_)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent - case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1662702951: // operation - this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent - break; - case -1408208058: // assert - this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("operation")) - this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent - else if (name.equals("assert")) - this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1662702951: return getOperation(); // SetupActionOperationComponent - case -1408208058: return getAssert(); // SetupActionAssertComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("operation")) { - this.operation = new SetupActionOperationComponent(); - return this.operation; - } - else if (name.equals("assert")) { - this.assert_ = new SetupActionAssertComponent(); - return this.assert_; - } - else - return super.addChild(name); - } - - public SetupActionComponent copy() { - SetupActionComponent dst = new SetupActionComponent(); - copyValues(dst); - dst.operation = operation == null ? null : operation.copy(); - dst.assert_ = assert_ == null ? null : assert_.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionComponent)) - return false; - SetupActionComponent o = (SetupActionComponent) other; - return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionComponent)) - return false; - SetupActionComponent o = (SetupActionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (operation == null || operation.isEmpty()) && (assert_ == null || assert_.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action"; - - } - - } - - @Block() - public static class SetupActionOperationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Server interaction or operation type. - */ - @Child(name = "type", type = {Coding.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The operation code type that will be executed", formalDefinition="Server interaction or operation type." ) - protected Coding type; - - /** - * The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. - */ - @Child(name = "resource", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://hl7-fhir.github.io/resourcelist.html." ) - protected CodeType resource; - - /** - * The label would be used for tracking/logging purposes by test engines. - */ - @Child(name = "label", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tracking/logging operation label", formalDefinition="The label would be used for tracking/logging purposes by test engines." ) - protected StringType label; - - /** - * The description would be used by test engines for tracking and reporting purposes. - */ - @Child(name = "description", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tracking/reporting operation description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." ) - protected StringType description; - - /** - * The content-type or mime-type to use for RESTful operation in the 'Accept' header. - */ - @Child(name = "accept", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Accept' header." ) - protected Enumeration accept; - - /** - * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. - */ - @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." ) - protected Enumeration contentType; - - /** - * The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. - */ - @Child(name = "destination", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Server responding to the request", formalDefinition="The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section." ) - protected IntegerType destination; - - /** - * Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. - */ - @Child(name = "encodeRequestUrl", type = {BooleanType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Whether or not to send the request url in encoded format", formalDefinition="Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths." ) - protected BooleanType encodeRequestUrl; - - /** - * The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. - */ - @Child(name = "origin", type = {IntegerType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Server initiating the request", formalDefinition="The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section." ) - protected IntegerType origin; - - /** - * Path plus parameters after [type]. Used to set parts of the request URL explicitly. - */ - @Child(name = "params", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Explicitly defined path parameters", formalDefinition="Path plus parameters after [type]. Used to set parts of the request URL explicitly." ) - protected StringType params; - - /** - * Header elements would be used to set HTTP headers. - */ - @Child(name = "requestHeader", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Each operation can have one ore more header elements", formalDefinition="Header elements would be used to set HTTP headers." ) - protected List requestHeader; - - /** - * The fixture id (maybe new) to map to the response. - */ - @Child(name = "responseId", type = {IdType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Fixture Id of mapped response", formalDefinition="The fixture id (maybe new) to map to the response." ) - protected IdType responseId; - - /** - * The id of the fixture used as the body of a PUT or POST request. - */ - @Child(name = "sourceId", type = {IdType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Fixture Id of body for PUT and POST requests", formalDefinition="The id of the fixture used as the body of a PUT or POST request." ) - protected IdType sourceId; - - /** - * Id of fixture used for extracting the [id], [type], and [vid] for GET requests. - */ - @Child(name = "targetId", type = {IdType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of fixture used for extracting the [id], [type], and [vid] for GET requests", formalDefinition="Id of fixture used for extracting the [id], [type], and [vid] for GET requests." ) - protected IdType targetId; - - /** - * Complete request URL. - */ - @Child(name = "url", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Request URL", formalDefinition="Complete request URL." ) - protected StringType url; - - private static final long serialVersionUID = 606457859L; - - /** - * Constructor - */ - public SetupActionOperationComponent() { - super(); - } - - /** - * @return {@link #type} (Server interaction or operation type.) - */ - public Coding getType() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.type"); - else if (Configuration.doAutoCreate()) - this.type = new Coding(); // cc - return this.type; - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (Server interaction or operation type.) - */ - public SetupActionOperationComponent setType(Coding value) { - this.type = value; - return this; - } - - /** - * @return {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value - */ - public CodeType getResourceElement() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new CodeType(); // bb - return this.resource; - } - - public boolean hasResourceElement() { - return this.resource != null && !this.resource.isEmpty(); - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value - */ - public SetupActionOperationComponent setResourceElement(CodeType value) { - this.resource = value; - return this; - } - - /** - * @return The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. - */ - public String getResource() { - return this.resource == null ? null : this.resource.getValue(); - } - - /** - * @param value The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. - */ - public SetupActionOperationComponent setResource(String value) { - if (Utilities.noString(value)) - this.resource = null; - else { - if (this.resource == null) - this.resource = new CodeType(); - this.resource.setValue(value); - } - return this; - } - - /** - * @return {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); // bb - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public SetupActionOperationComponent setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return The label would be used for tracking/logging purposes by test engines. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value The label would be used for tracking/logging purposes by test engines. - */ - public SetupActionOperationComponent setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (The description would be used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The description would be used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SetupActionOperationComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The description would be used by test engines for tracking and reporting purposes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The description would be used by test engines for tracking and reporting purposes. - */ - public SetupActionOperationComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #accept} (The content-type or mime-type to use for RESTful operation in the 'Accept' header.). This is the underlying object with id, value and extensions. The accessor "getAccept" gives direct access to the value - */ - public Enumeration getAcceptElement() { - if (this.accept == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.accept"); - else if (Configuration.doAutoCreate()) - this.accept = new Enumeration(new ContentTypeEnumFactory()); // bb - return this.accept; - } - - public boolean hasAcceptElement() { - return this.accept != null && !this.accept.isEmpty(); - } - - public boolean hasAccept() { - return this.accept != null && !this.accept.isEmpty(); - } - - /** - * @param value {@link #accept} (The content-type or mime-type to use for RESTful operation in the 'Accept' header.). This is the underlying object with id, value and extensions. The accessor "getAccept" gives direct access to the value - */ - public SetupActionOperationComponent setAcceptElement(Enumeration value) { - this.accept = value; - return this; - } - - /** - * @return The content-type or mime-type to use for RESTful operation in the 'Accept' header. - */ - public ContentType getAccept() { - return this.accept == null ? null : this.accept.getValue(); - } - - /** - * @param value The content-type or mime-type to use for RESTful operation in the 'Accept' header. - */ - public SetupActionOperationComponent setAccept(ContentType value) { - if (value == null) - this.accept = null; - else { - if (this.accept == null) - this.accept = new Enumeration(new ContentTypeEnumFactory()); - this.accept.setValue(value); - } - return this; - } - - /** - * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Enumeration getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public SetupActionOperationComponent setContentTypeElement(Enumeration value) { - this.contentType = value; - return this; - } - - /** - * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. - */ - public ContentType getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. - */ - public SetupActionOperationComponent setContentType(ContentType value) { - if (value == null) - this.contentType = null; - else { - if (this.contentType == null) - this.contentType = new Enumeration(new ContentTypeEnumFactory()); - this.contentType.setValue(value); - } - return this; - } - - /** - * @return {@link #destination} (The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value - */ - public IntegerType getDestinationElement() { - if (this.destination == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.destination"); - else if (Configuration.doAutoCreate()) - this.destination = new IntegerType(); // bb - return this.destination; - } - - public boolean hasDestinationElement() { - return this.destination != null && !this.destination.isEmpty(); - } - - public boolean hasDestination() { - return this.destination != null && !this.destination.isEmpty(); - } - - /** - * @param value {@link #destination} (The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.). This is the underlying object with id, value and extensions. The accessor "getDestination" gives direct access to the value - */ - public SetupActionOperationComponent setDestinationElement(IntegerType value) { - this.destination = value; - return this; - } - - /** - * @return The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. - */ - public int getDestination() { - return this.destination == null || this.destination.isEmpty() ? 0 : this.destination.getValue(); - } - - /** - * @param value The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section. - */ - public SetupActionOperationComponent setDestination(int value) { - if (this.destination == null) - this.destination = new IntegerType(); - this.destination.setValue(value); - return this; - } - - /** - * @return {@link #encodeRequestUrl} (Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.). This is the underlying object with id, value and extensions. The accessor "getEncodeRequestUrl" gives direct access to the value - */ - public BooleanType getEncodeRequestUrlElement() { - if (this.encodeRequestUrl == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.encodeRequestUrl"); - else if (Configuration.doAutoCreate()) - this.encodeRequestUrl = new BooleanType(); // bb - return this.encodeRequestUrl; - } - - public boolean hasEncodeRequestUrlElement() { - return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty(); - } - - public boolean hasEncodeRequestUrl() { - return this.encodeRequestUrl != null && !this.encodeRequestUrl.isEmpty(); - } - - /** - * @param value {@link #encodeRequestUrl} (Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.). This is the underlying object with id, value and extensions. The accessor "getEncodeRequestUrl" gives direct access to the value - */ - public SetupActionOperationComponent setEncodeRequestUrlElement(BooleanType value) { - this.encodeRequestUrl = value; - return this; - } - - /** - * @return Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. - */ - public boolean getEncodeRequestUrl() { - return this.encodeRequestUrl == null || this.encodeRequestUrl.isEmpty() ? false : this.encodeRequestUrl.getValue(); - } - - /** - * @param value Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths. - */ - public SetupActionOperationComponent setEncodeRequestUrl(boolean value) { - if (this.encodeRequestUrl == null) - this.encodeRequestUrl = new BooleanType(); - this.encodeRequestUrl.setValue(value); - return this; - } - - /** - * @return {@link #origin} (The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.). This is the underlying object with id, value and extensions. The accessor "getOrigin" gives direct access to the value - */ - public IntegerType getOriginElement() { - if (this.origin == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.origin"); - else if (Configuration.doAutoCreate()) - this.origin = new IntegerType(); // bb - return this.origin; - } - - public boolean hasOriginElement() { - return this.origin != null && !this.origin.isEmpty(); - } - - public boolean hasOrigin() { - return this.origin != null && !this.origin.isEmpty(); - } - - /** - * @param value {@link #origin} (The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.). This is the underlying object with id, value and extensions. The accessor "getOrigin" gives direct access to the value - */ - public SetupActionOperationComponent setOriginElement(IntegerType value) { - this.origin = value; - return this; - } - - /** - * @return The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. - */ - public int getOrigin() { - return this.origin == null || this.origin.isEmpty() ? 0 : this.origin.getValue(); - } - - /** - * @param value The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section. - */ - public SetupActionOperationComponent setOrigin(int value) { - if (this.origin == null) - this.origin = new IntegerType(); - this.origin.setValue(value); - return this; - } - - /** - * @return {@link #params} (Path plus parameters after [type]. Used to set parts of the request URL explicitly.). This is the underlying object with id, value and extensions. The accessor "getParams" gives direct access to the value - */ - public StringType getParamsElement() { - if (this.params == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.params"); - else if (Configuration.doAutoCreate()) - this.params = new StringType(); // bb - return this.params; - } - - public boolean hasParamsElement() { - return this.params != null && !this.params.isEmpty(); - } - - public boolean hasParams() { - return this.params != null && !this.params.isEmpty(); - } - - /** - * @param value {@link #params} (Path plus parameters after [type]. Used to set parts of the request URL explicitly.). This is the underlying object with id, value and extensions. The accessor "getParams" gives direct access to the value - */ - public SetupActionOperationComponent setParamsElement(StringType value) { - this.params = value; - return this; - } - - /** - * @return Path plus parameters after [type]. Used to set parts of the request URL explicitly. - */ - public String getParams() { - return this.params == null ? null : this.params.getValue(); - } - - /** - * @param value Path plus parameters after [type]. Used to set parts of the request URL explicitly. - */ - public SetupActionOperationComponent setParams(String value) { - if (Utilities.noString(value)) - this.params = null; - else { - if (this.params == null) - this.params = new StringType(); - this.params.setValue(value); - } - return this; - } - - /** - * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.) - */ - public List getRequestHeader() { - if (this.requestHeader == null) - this.requestHeader = new ArrayList(); - return this.requestHeader; - } - - public boolean hasRequestHeader() { - if (this.requestHeader == null) - return false; - for (SetupActionOperationRequestHeaderComponent item : this.requestHeader) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #requestHeader} (Header elements would be used to set HTTP headers.) - */ - // syntactic sugar - public SetupActionOperationRequestHeaderComponent addRequestHeader() { //3 - SetupActionOperationRequestHeaderComponent t = new SetupActionOperationRequestHeaderComponent(); - if (this.requestHeader == null) - this.requestHeader = new ArrayList(); - this.requestHeader.add(t); - return t; - } - - // syntactic sugar - public SetupActionOperationComponent addRequestHeader(SetupActionOperationRequestHeaderComponent t) { //3 - if (t == null) - return this; - if (this.requestHeader == null) - this.requestHeader = new ArrayList(); - this.requestHeader.add(t); - return this; - } - - /** - * @return {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value - */ - public IdType getResponseIdElement() { - if (this.responseId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.responseId"); - else if (Configuration.doAutoCreate()) - this.responseId = new IdType(); // bb - return this.responseId; - } - - public boolean hasResponseIdElement() { - return this.responseId != null && !this.responseId.isEmpty(); - } - - public boolean hasResponseId() { - return this.responseId != null && !this.responseId.isEmpty(); - } - - /** - * @param value {@link #responseId} (The fixture id (maybe new) to map to the response.). This is the underlying object with id, value and extensions. The accessor "getResponseId" gives direct access to the value - */ - public SetupActionOperationComponent setResponseIdElement(IdType value) { - this.responseId = value; - return this; - } - - /** - * @return The fixture id (maybe new) to map to the response. - */ - public String getResponseId() { - return this.responseId == null ? null : this.responseId.getValue(); - } - - /** - * @param value The fixture id (maybe new) to map to the response. - */ - public SetupActionOperationComponent setResponseId(String value) { - if (Utilities.noString(value)) - this.responseId = null; - else { - if (this.responseId == null) - this.responseId = new IdType(); - this.responseId.setValue(value); - } - return this; - } - - /** - * @return {@link #sourceId} (The id of the fixture used as the body of a PUT or POST request.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value - */ - public IdType getSourceIdElement() { - if (this.sourceId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.sourceId"); - else if (Configuration.doAutoCreate()) - this.sourceId = new IdType(); // bb - return this.sourceId; - } - - public boolean hasSourceIdElement() { - return this.sourceId != null && !this.sourceId.isEmpty(); - } - - public boolean hasSourceId() { - return this.sourceId != null && !this.sourceId.isEmpty(); - } - - /** - * @param value {@link #sourceId} (The id of the fixture used as the body of a PUT or POST request.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value - */ - public SetupActionOperationComponent setSourceIdElement(IdType value) { - this.sourceId = value; - return this; - } - - /** - * @return The id of the fixture used as the body of a PUT or POST request. - */ - public String getSourceId() { - return this.sourceId == null ? null : this.sourceId.getValue(); - } - - /** - * @param value The id of the fixture used as the body of a PUT or POST request. - */ - public SetupActionOperationComponent setSourceId(String value) { - if (Utilities.noString(value)) - this.sourceId = null; - else { - if (this.sourceId == null) - this.sourceId = new IdType(); - this.sourceId.setValue(value); - } - return this; - } - - /** - * @return {@link #targetId} (Id of fixture used for extracting the [id], [type], and [vid] for GET requests.). This is the underlying object with id, value and extensions. The accessor "getTargetId" gives direct access to the value - */ - public IdType getTargetIdElement() { - if (this.targetId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.targetId"); - else if (Configuration.doAutoCreate()) - this.targetId = new IdType(); // bb - return this.targetId; - } - - public boolean hasTargetIdElement() { - return this.targetId != null && !this.targetId.isEmpty(); - } - - public boolean hasTargetId() { - return this.targetId != null && !this.targetId.isEmpty(); - } - - /** - * @param value {@link #targetId} (Id of fixture used for extracting the [id], [type], and [vid] for GET requests.). This is the underlying object with id, value and extensions. The accessor "getTargetId" gives direct access to the value - */ - public SetupActionOperationComponent setTargetIdElement(IdType value) { - this.targetId = value; - return this; - } - - /** - * @return Id of fixture used for extracting the [id], [type], and [vid] for GET requests. - */ - public String getTargetId() { - return this.targetId == null ? null : this.targetId.getValue(); - } - - /** - * @param value Id of fixture used for extracting the [id], [type], and [vid] for GET requests. - */ - public SetupActionOperationComponent setTargetId(String value) { - if (Utilities.noString(value)) - this.targetId = null; - else { - if (this.targetId == null) - this.targetId = new IdType(); - this.targetId.setValue(value); - } - return this; - } - - /** - * @return {@link #url} (Complete request URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public StringType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationComponent.url"); - else if (Configuration.doAutoCreate()) - this.url = new StringType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (Complete request URL.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public SetupActionOperationComponent setUrlElement(StringType value) { - this.url = value; - return this; - } - - /** - * @return Complete request URL. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value Complete request URL. - */ - public SetupActionOperationComponent setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new StringType(); - this.url.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "Coding", "Server interaction or operation type.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("resource", "code", "The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("accept", "code", "The content-type or mime-type to use for RESTful operation in the 'Accept' header.", 0, java.lang.Integer.MAX_VALUE, accept)); - childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("destination", "integer", "The server where the request message is destined for. Must be one of the server numbers listed in TestScript.destination section.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("encodeRequestUrl", "boolean", "Whether or not to implicitly send the request url in encoded format. The default is true to match the standard RESTful client behavior. Set to false when communicating with a server that does not support encoded url paths.", 0, java.lang.Integer.MAX_VALUE, encodeRequestUrl)); - childrenList.add(new Property("origin", "integer", "The server where the request message originates from. Must be one of the server numbers listed in TestScript.origin section.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("params", "string", "Path plus parameters after [type]. Used to set parts of the request URL explicitly.", 0, java.lang.Integer.MAX_VALUE, params)); - childrenList.add(new Property("requestHeader", "", "Header elements would be used to set HTTP headers.", 0, java.lang.Integer.MAX_VALUE, requestHeader)); - childrenList.add(new Property("responseId", "id", "The fixture id (maybe new) to map to the response.", 0, java.lang.Integer.MAX_VALUE, responseId)); - childrenList.add(new Property("sourceId", "id", "The id of the fixture used as the body of a PUT or POST request.", 0, java.lang.Integer.MAX_VALUE, sourceId)); - childrenList.add(new Property("targetId", "id", "Id of fixture used for extracting the [id], [type], and [vid] for GET requests.", 0, java.lang.Integer.MAX_VALUE, targetId)); - childrenList.add(new Property("url", "string", "Complete request URL.", 0, java.lang.Integer.MAX_VALUE, url)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType - case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -1423461112: /*accept*/ return this.accept == null ? new Base[0] : new Base[] {this.accept}; // Enumeration - case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // Enumeration - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : new Base[] {this.destination}; // IntegerType - case -1760554218: /*encodeRequestUrl*/ return this.encodeRequestUrl == null ? new Base[0] : new Base[] {this.encodeRequestUrl}; // BooleanType - case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : new Base[] {this.origin}; // IntegerType - case -995427962: /*params*/ return this.params == null ? new Base[0] : new Base[] {this.params}; // StringType - case 1074158076: /*requestHeader*/ return this.requestHeader == null ? new Base[0] : this.requestHeader.toArray(new Base[this.requestHeader.size()]); // SetupActionOperationRequestHeaderComponent - case -633138884: /*responseId*/ return this.responseId == null ? new Base[0] : new Base[] {this.responseId}; // IdType - case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType - case -441951604: /*targetId*/ return this.targetId == null ? new Base[0] : new Base[] {this.targetId}; // IdType - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = castToCoding(value); // Coding - break; - case -341064690: // resource - this.resource = castToCode(value); // CodeType - break; - case 102727412: // label - this.label = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -1423461112: // accept - this.accept = new ContentTypeEnumFactory().fromType(value); // Enumeration - break; - case -389131437: // contentType - this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration - break; - case -1429847026: // destination - this.destination = castToInteger(value); // IntegerType - break; - case -1760554218: // encodeRequestUrl - this.encodeRequestUrl = castToBoolean(value); // BooleanType - break; - case -1008619738: // origin - this.origin = castToInteger(value); // IntegerType - break; - case -995427962: // params - this.params = castToString(value); // StringType - break; - case 1074158076: // requestHeader - this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value); // SetupActionOperationRequestHeaderComponent - break; - case -633138884: // responseId - this.responseId = castToId(value); // IdType - break; - case 1746327190: // sourceId - this.sourceId = castToId(value); // IdType - break; - case -441951604: // targetId - this.targetId = castToId(value); // IdType - break; - case 116079: // url - this.url = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = castToCoding(value); // Coding - else if (name.equals("resource")) - this.resource = castToCode(value); // CodeType - else if (name.equals("label")) - this.label = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("accept")) - this.accept = new ContentTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("contentType")) - this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("destination")) - this.destination = castToInteger(value); // IntegerType - else if (name.equals("encodeRequestUrl")) - this.encodeRequestUrl = castToBoolean(value); // BooleanType - else if (name.equals("origin")) - this.origin = castToInteger(value); // IntegerType - else if (name.equals("params")) - this.params = castToString(value); // StringType - else if (name.equals("requestHeader")) - this.getRequestHeader().add((SetupActionOperationRequestHeaderComponent) value); - else if (name.equals("responseId")) - this.responseId = castToId(value); // IdType - else if (name.equals("sourceId")) - this.sourceId = castToId(value); // IdType - else if (name.equals("targetId")) - this.targetId = castToId(value); // IdType - else if (name.equals("url")) - this.url = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: return getType(); // Coding - case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // CodeType - case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -1423461112: throw new FHIRException("Cannot make property accept as it is not a complex type"); // Enumeration - case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // Enumeration - case -1429847026: throw new FHIRException("Cannot make property destination as it is not a complex type"); // IntegerType - case -1760554218: throw new FHIRException("Cannot make property encodeRequestUrl as it is not a complex type"); // BooleanType - case -1008619738: throw new FHIRException("Cannot make property origin as it is not a complex type"); // IntegerType - case -995427962: throw new FHIRException("Cannot make property params as it is not a complex type"); // StringType - case 1074158076: return addRequestHeader(); // SetupActionOperationRequestHeaderComponent - case -633138884: throw new FHIRException("Cannot make property responseId as it is not a complex type"); // IdType - case 1746327190: throw new FHIRException("Cannot make property sourceId as it is not a complex type"); // IdType - case -441951604: throw new FHIRException("Cannot make property targetId as it is not a complex type"); // IdType - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - this.type = new Coding(); - return this.type; - } - else if (name.equals("resource")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource"); - } - else if (name.equals("label")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.label"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); - } - else if (name.equals("accept")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.accept"); - } - else if (name.equals("contentType")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType"); - } - else if (name.equals("destination")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.destination"); - } - else if (name.equals("encodeRequestUrl")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.encodeRequestUrl"); - } - else if (name.equals("origin")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.origin"); - } - else if (name.equals("params")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.params"); - } - else if (name.equals("requestHeader")) { - return addRequestHeader(); - } - else if (name.equals("responseId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseId"); - } - else if (name.equals("sourceId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId"); - } - else if (name.equals("targetId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.targetId"); - } - else if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.url"); - } - else - return super.addChild(name); - } - - public SetupActionOperationComponent copy() { - SetupActionOperationComponent dst = new SetupActionOperationComponent(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.resource = resource == null ? null : resource.copy(); - dst.label = label == null ? null : label.copy(); - dst.description = description == null ? null : description.copy(); - dst.accept = accept == null ? null : accept.copy(); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.destination = destination == null ? null : destination.copy(); - dst.encodeRequestUrl = encodeRequestUrl == null ? null : encodeRequestUrl.copy(); - dst.origin = origin == null ? null : origin.copy(); - dst.params = params == null ? null : params.copy(); - if (requestHeader != null) { - dst.requestHeader = new ArrayList(); - for (SetupActionOperationRequestHeaderComponent i : requestHeader) - dst.requestHeader.add(i.copy()); - }; - dst.responseId = responseId == null ? null : responseId.copy(); - dst.sourceId = sourceId == null ? null : sourceId.copy(); - dst.targetId = targetId == null ? null : targetId.copy(); - dst.url = url == null ? null : url.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionOperationComponent)) - return false; - SetupActionOperationComponent o = (SetupActionOperationComponent) other; - return compareDeep(type, o.type, true) && compareDeep(resource, o.resource, true) && compareDeep(label, o.label, true) - && compareDeep(description, o.description, true) && compareDeep(accept, o.accept, true) && compareDeep(contentType, o.contentType, true) - && compareDeep(destination, o.destination, true) && compareDeep(encodeRequestUrl, o.encodeRequestUrl, true) - && compareDeep(origin, o.origin, true) && compareDeep(params, o.params, true) && compareDeep(requestHeader, o.requestHeader, true) - && compareDeep(responseId, o.responseId, true) && compareDeep(sourceId, o.sourceId, true) && compareDeep(targetId, o.targetId, true) - && compareDeep(url, o.url, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionOperationComponent)) - return false; - SetupActionOperationComponent o = (SetupActionOperationComponent) other; - return compareValues(resource, o.resource, true) && compareValues(label, o.label, true) && compareValues(description, o.description, true) - && compareValues(accept, o.accept, true) && compareValues(contentType, o.contentType, true) && compareValues(destination, o.destination, true) - && compareValues(encodeRequestUrl, o.encodeRequestUrl, true) && compareValues(origin, o.origin, true) - && compareValues(params, o.params, true) && compareValues(responseId, o.responseId, true) && compareValues(sourceId, o.sourceId, true) - && compareValues(targetId, o.targetId, true) && compareValues(url, o.url, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (resource == null || resource.isEmpty()) - && (label == null || label.isEmpty()) && (description == null || description.isEmpty()) && (accept == null || accept.isEmpty()) - && (contentType == null || contentType.isEmpty()) && (destination == null || destination.isEmpty()) - && (encodeRequestUrl == null || encodeRequestUrl.isEmpty()) && (origin == null || origin.isEmpty()) - && (params == null || params.isEmpty()) && (requestHeader == null || requestHeader.isEmpty()) - && (responseId == null || responseId.isEmpty()) && (sourceId == null || sourceId.isEmpty()) - && (targetId == null || targetId.isEmpty()) && (url == null || url.isEmpty()); - } - - public String fhirType() { - return "TestScript.setup.action.operation"; - - } - - } - - @Block() - public static class SetupActionOperationRequestHeaderComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The HTTP header field e.g. "Accept". - */ - @Child(name = "field", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field e.g. \"Accept\"." ) - protected StringType field; - - /** - * The value of the header e.g. "application/xml". - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="HTTP headerfield value", formalDefinition="The value of the header e.g. \"application/xml\"." ) - protected StringType value; - - private static final long serialVersionUID = 274395337L; - - /** - * Constructor - */ - public SetupActionOperationRequestHeaderComponent() { - super(); - } - - /** - * Constructor - */ - public SetupActionOperationRequestHeaderComponent(StringType field, StringType value) { - super(); - this.field = field; - this.value = value; - } - - /** - * @return {@link #field} (The HTTP header field e.g. "Accept".). This is the underlying object with id, value and extensions. The accessor "getField" gives direct access to the value - */ - public StringType getFieldElement() { - if (this.field == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.field"); - else if (Configuration.doAutoCreate()) - this.field = new StringType(); // bb - return this.field; - } - - public boolean hasFieldElement() { - return this.field != null && !this.field.isEmpty(); - } - - public boolean hasField() { - return this.field != null && !this.field.isEmpty(); - } - - /** - * @param value {@link #field} (The HTTP header field e.g. "Accept".). This is the underlying object with id, value and extensions. The accessor "getField" gives direct access to the value - */ - public SetupActionOperationRequestHeaderComponent setFieldElement(StringType value) { - this.field = value; - return this; - } - - /** - * @return The HTTP header field e.g. "Accept". - */ - public String getField() { - return this.field == null ? null : this.field.getValue(); - } - - /** - * @param value The HTTP header field e.g. "Accept". - */ - public SetupActionOperationRequestHeaderComponent setField(String value) { - if (this.field == null) - this.field = new StringType(); - this.field.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the header e.g. "application/xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionOperationRequestHeaderComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the header e.g. "application/xml".). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SetupActionOperationRequestHeaderComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value of the header e.g. "application/xml". - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value of the header e.g. "application/xml". - */ - public SetupActionOperationRequestHeaderComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("field", "string", "The HTTP header field e.g. \"Accept\".", 0, java.lang.Integer.MAX_VALUE, field)); - childrenList.add(new Property("value", "string", "The value of the header e.g. \"application/xml\".", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 97427706: /*field*/ return this.field == null ? new Base[0] : new Base[] {this.field}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 97427706: // field - this.field = castToString(value); // StringType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("field")) - this.field = castToString(value); // StringType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 97427706: throw new FHIRException("Cannot make property field as it is not a complex type"); // StringType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("field")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.field"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); - } - else - return super.addChild(name); - } - - public SetupActionOperationRequestHeaderComponent copy() { - SetupActionOperationRequestHeaderComponent dst = new SetupActionOperationRequestHeaderComponent(); - copyValues(dst); - dst.field = field == null ? null : field.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionOperationRequestHeaderComponent)) - return false; - SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other; - return compareDeep(field, o.field, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionOperationRequestHeaderComponent)) - return false; - SetupActionOperationRequestHeaderComponent o = (SetupActionOperationRequestHeaderComponent) other; - return compareValues(field, o.field, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (field == null || field.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action.operation.requestHeader"; - - } - - } - - @Block() - public static class SetupActionAssertComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The label would be used for tracking/logging purposes by test engines. - */ - @Child(name = "label", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tracking/logging assertion label", formalDefinition="The label would be used for tracking/logging purposes by test engines." ) - protected StringType label; - - /** - * The description would be used by test engines for tracking and reporting purposes. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tracking/reporting assertion description", formalDefinition="The description would be used by test engines for tracking and reporting purposes." ) - protected StringType description; - - /** - * The direction to use for the assertion. - */ - @Child(name = "direction", type = {CodeType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="response | request", formalDefinition="The direction to use for the assertion." ) - protected Enumeration direction; - - /** - * Id of fixture used to compare the "sourceId/path" evaluations to. - */ - @Child(name = "compareToSourceId", type = {StringType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of fixture used to compare the \"sourceId/path\" evaluations to", formalDefinition="Id of fixture used to compare the \"sourceId/path\" evaluations to." ) - protected StringType compareToSourceId; - - /** - * XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to. - */ - @Child(name = "compareToSourcePath", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to", formalDefinition="XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to." ) - protected StringType compareToSourcePath; - - /** - * The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. - */ - @Child(name = "contentType", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="xml | json", formalDefinition="The content-type or mime-type to use for RESTful operation in the 'Content-Type' header." ) - protected Enumeration contentType; - - /** - * The HTTP header field name e.g. 'Location'. - */ - @Child(name = "headerField", type = {StringType.class}, order=7, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="HTTP header field name", formalDefinition="The HTTP header field name e.g. 'Location'." ) - protected StringType headerField; - - /** - * The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. - */ - @Child(name = "minimumId", type = {StringType.class}, order=8, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Fixture Id of minimum content resource", formalDefinition="The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId." ) - protected StringType minimumId; - - /** - * Whether or not the test execution performs validation on the bundle navigation links. - */ - @Child(name = "navigationLinks", type = {BooleanType.class}, order=9, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Perform validation on navigation links?", formalDefinition="Whether or not the test execution performs validation on the bundle navigation links." ) - protected BooleanType navigationLinks; - - /** - * The operator type. - */ - @Child(name = "operator", type = {CodeType.class}, order=10, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains", formalDefinition="The operator type." ) - protected Enumeration operator; - - /** - * The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. - */ - @Child(name = "path", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="XPath or JSONPath expression", formalDefinition="The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server." ) - protected StringType path; - - /** - * The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. - */ - @Child(name = "resource", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Resource type", formalDefinition="The type of the resource. See http://hl7-fhir.github.io/resourcelist.html." ) - protected CodeType resource; - - /** - * okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. - */ - @Child(name = "response", type = {CodeType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable", formalDefinition="okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable." ) - protected Enumeration response; - - /** - * The value of the HTTP response code to be tested. - */ - @Child(name = "responseCode", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="HTTP response code to test", formalDefinition="The value of the HTTP response code to be tested." ) - protected StringType responseCode; - - /** - * The TestScript.rule this assert will evaluate. - */ - @Child(name = "rule", type = {}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The reference to a TestScript.rule", formalDefinition="The TestScript.rule this assert will evaluate." ) - protected SetupActionAssertRuleComponent rule; - - /** - * The TestScript.ruleset this assert will evaluate. - */ - @Child(name = "ruleset", type = {}, order=16, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The reference to a TestScript.ruleset", formalDefinition="The TestScript.ruleset this assert will evaluate." ) - protected SetupActionAssertRulesetComponent ruleset; - - /** - * Fixture to evaluate the XPath/JSONPath expression or the headerField against. - */ - @Child(name = "sourceId", type = {IdType.class}, order=17, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Fixture Id of source expression or headerField", formalDefinition="Fixture to evaluate the XPath/JSONPath expression or the headerField against." ) - protected IdType sourceId; - - /** - * The ID of the Profile to validate against. - */ - @Child(name = "validateProfileId", type = {IdType.class}, order=18, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Profile Id of validation profile reference", formalDefinition="The ID of the Profile to validate against." ) - protected IdType validateProfileId; - - /** - * The value to compare to. - */ - @Child(name = "value", type = {StringType.class}, order=19, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The value to compare to", formalDefinition="The value to compare to." ) - protected StringType value; - - /** - * Whether or not the test execution will produce a warning only on error for this assert. - */ - @Child(name = "warningOnly", type = {BooleanType.class}, order=20, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Will this assert produce a warning only on error?", formalDefinition="Whether or not the test execution will produce a warning only on error for this assert." ) - protected BooleanType warningOnly; - - private static final long serialVersionUID = -561290310L; - - /** - * Constructor - */ - public SetupActionAssertComponent() { - super(); - } - - /** - * @return {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public StringType getLabelElement() { - if (this.label == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.label"); - else if (Configuration.doAutoCreate()) - this.label = new StringType(); // bb - return this.label; - } - - public boolean hasLabelElement() { - return this.label != null && !this.label.isEmpty(); - } - - public boolean hasLabel() { - return this.label != null && !this.label.isEmpty(); - } - - /** - * @param value {@link #label} (The label would be used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getLabel" gives direct access to the value - */ - public SetupActionAssertComponent setLabelElement(StringType value) { - this.label = value; - return this; - } - - /** - * @return The label would be used for tracking/logging purposes by test engines. - */ - public String getLabel() { - return this.label == null ? null : this.label.getValue(); - } - - /** - * @param value The label would be used for tracking/logging purposes by test engines. - */ - public SetupActionAssertComponent setLabel(String value) { - if (Utilities.noString(value)) - this.label = null; - else { - if (this.label == null) - this.label = new StringType(); - this.label.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (The description would be used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (The description would be used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public SetupActionAssertComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return The description would be used by test engines for tracking and reporting purposes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value The description would be used by test engines for tracking and reporting purposes. - */ - public SetupActionAssertComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #direction} (The direction to use for the assertion.). This is the underlying object with id, value and extensions. The accessor "getDirection" gives direct access to the value - */ - public Enumeration getDirectionElement() { - if (this.direction == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.direction"); - else if (Configuration.doAutoCreate()) - this.direction = new Enumeration(new AssertionDirectionTypeEnumFactory()); // bb - return this.direction; - } - - public boolean hasDirectionElement() { - return this.direction != null && !this.direction.isEmpty(); - } - - public boolean hasDirection() { - return this.direction != null && !this.direction.isEmpty(); - } - - /** - * @param value {@link #direction} (The direction to use for the assertion.). This is the underlying object with id, value and extensions. The accessor "getDirection" gives direct access to the value - */ - public SetupActionAssertComponent setDirectionElement(Enumeration value) { - this.direction = value; - return this; - } - - /** - * @return The direction to use for the assertion. - */ - public AssertionDirectionType getDirection() { - return this.direction == null ? null : this.direction.getValue(); - } - - /** - * @param value The direction to use for the assertion. - */ - public SetupActionAssertComponent setDirection(AssertionDirectionType value) { - if (value == null) - this.direction = null; - else { - if (this.direction == null) - this.direction = new Enumeration(new AssertionDirectionTypeEnumFactory()); - this.direction.setValue(value); - } - return this; - } - - /** - * @return {@link #compareToSourceId} (Id of fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value - */ - public StringType getCompareToSourceIdElement() { - if (this.compareToSourceId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourceId"); - else if (Configuration.doAutoCreate()) - this.compareToSourceId = new StringType(); // bb - return this.compareToSourceId; - } - - public boolean hasCompareToSourceIdElement() { - return this.compareToSourceId != null && !this.compareToSourceId.isEmpty(); - } - - public boolean hasCompareToSourceId() { - return this.compareToSourceId != null && !this.compareToSourceId.isEmpty(); - } - - /** - * @param value {@link #compareToSourceId} (Id of fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourceId" gives direct access to the value - */ - public SetupActionAssertComponent setCompareToSourceIdElement(StringType value) { - this.compareToSourceId = value; - return this; - } - - /** - * @return Id of fixture used to compare the "sourceId/path" evaluations to. - */ - public String getCompareToSourceId() { - return this.compareToSourceId == null ? null : this.compareToSourceId.getValue(); - } - - /** - * @param value Id of fixture used to compare the "sourceId/path" evaluations to. - */ - public SetupActionAssertComponent setCompareToSourceId(String value) { - if (Utilities.noString(value)) - this.compareToSourceId = null; - else { - if (this.compareToSourceId == null) - this.compareToSourceId = new StringType(); - this.compareToSourceId.setValue(value); - } - return this; - } - - /** - * @return {@link #compareToSourcePath} (XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value - */ - public StringType getCompareToSourcePathElement() { - if (this.compareToSourcePath == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.compareToSourcePath"); - else if (Configuration.doAutoCreate()) - this.compareToSourcePath = new StringType(); // bb - return this.compareToSourcePath; - } - - public boolean hasCompareToSourcePathElement() { - return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty(); - } - - public boolean hasCompareToSourcePath() { - return this.compareToSourcePath != null && !this.compareToSourcePath.isEmpty(); - } - - /** - * @param value {@link #compareToSourcePath} (XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to.). This is the underlying object with id, value and extensions. The accessor "getCompareToSourcePath" gives direct access to the value - */ - public SetupActionAssertComponent setCompareToSourcePathElement(StringType value) { - this.compareToSourcePath = value; - return this; - } - - /** - * @return XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to. - */ - public String getCompareToSourcePath() { - return this.compareToSourcePath == null ? null : this.compareToSourcePath.getValue(); - } - - /** - * @param value XPath or JSONPath expression against fixture used to compare the "sourceId/path" evaluations to. - */ - public SetupActionAssertComponent setCompareToSourcePath(String value) { - if (Utilities.noString(value)) - this.compareToSourcePath = null; - else { - if (this.compareToSourcePath == null) - this.compareToSourcePath = new StringType(); - this.compareToSourcePath.setValue(value); - } - return this; - } - - /** - * @return {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public Enumeration getContentTypeElement() { - if (this.contentType == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.contentType"); - else if (Configuration.doAutoCreate()) - this.contentType = new Enumeration(new ContentTypeEnumFactory()); // bb - return this.contentType; - } - - public boolean hasContentTypeElement() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - public boolean hasContentType() { - return this.contentType != null && !this.contentType.isEmpty(); - } - - /** - * @param value {@link #contentType} (The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.). This is the underlying object with id, value and extensions. The accessor "getContentType" gives direct access to the value - */ - public SetupActionAssertComponent setContentTypeElement(Enumeration value) { - this.contentType = value; - return this; - } - - /** - * @return The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. - */ - public ContentType getContentType() { - return this.contentType == null ? null : this.contentType.getValue(); - } - - /** - * @param value The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. - */ - public SetupActionAssertComponent setContentType(ContentType value) { - if (value == null) - this.contentType = null; - else { - if (this.contentType == null) - this.contentType = new Enumeration(new ContentTypeEnumFactory()); - this.contentType.setValue(value); - } - return this; - } - - /** - * @return {@link #headerField} (The HTTP header field name e.g. 'Location'.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value - */ - public StringType getHeaderFieldElement() { - if (this.headerField == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.headerField"); - else if (Configuration.doAutoCreate()) - this.headerField = new StringType(); // bb - return this.headerField; - } - - public boolean hasHeaderFieldElement() { - return this.headerField != null && !this.headerField.isEmpty(); - } - - public boolean hasHeaderField() { - return this.headerField != null && !this.headerField.isEmpty(); - } - - /** - * @param value {@link #headerField} (The HTTP header field name e.g. 'Location'.). This is the underlying object with id, value and extensions. The accessor "getHeaderField" gives direct access to the value - */ - public SetupActionAssertComponent setHeaderFieldElement(StringType value) { - this.headerField = value; - return this; - } - - /** - * @return The HTTP header field name e.g. 'Location'. - */ - public String getHeaderField() { - return this.headerField == null ? null : this.headerField.getValue(); - } - - /** - * @param value The HTTP header field name e.g. 'Location'. - */ - public SetupActionAssertComponent setHeaderField(String value) { - if (Utilities.noString(value)) - this.headerField = null; - else { - if (this.headerField == null) - this.headerField = new StringType(); - this.headerField.setValue(value); - } - return this; - } - - /** - * @return {@link #minimumId} (The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value - */ - public StringType getMinimumIdElement() { - if (this.minimumId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.minimumId"); - else if (Configuration.doAutoCreate()) - this.minimumId = new StringType(); // bb - return this.minimumId; - } - - public boolean hasMinimumIdElement() { - return this.minimumId != null && !this.minimumId.isEmpty(); - } - - public boolean hasMinimumId() { - return this.minimumId != null && !this.minimumId.isEmpty(); - } - - /** - * @param value {@link #minimumId} (The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.). This is the underlying object with id, value and extensions. The accessor "getMinimumId" gives direct access to the value - */ - public SetupActionAssertComponent setMinimumIdElement(StringType value) { - this.minimumId = value; - return this; - } - - /** - * @return The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. - */ - public String getMinimumId() { - return this.minimumId == null ? null : this.minimumId.getValue(); - } - - /** - * @param value The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId. - */ - public SetupActionAssertComponent setMinimumId(String value) { - if (Utilities.noString(value)) - this.minimumId = null; - else { - if (this.minimumId == null) - this.minimumId = new StringType(); - this.minimumId.setValue(value); - } - return this; - } - - /** - * @return {@link #navigationLinks} (Whether or not the test execution performs validation on the bundle navigation links.). This is the underlying object with id, value and extensions. The accessor "getNavigationLinks" gives direct access to the value - */ - public BooleanType getNavigationLinksElement() { - if (this.navigationLinks == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.navigationLinks"); - else if (Configuration.doAutoCreate()) - this.navigationLinks = new BooleanType(); // bb - return this.navigationLinks; - } - - public boolean hasNavigationLinksElement() { - return this.navigationLinks != null && !this.navigationLinks.isEmpty(); - } - - public boolean hasNavigationLinks() { - return this.navigationLinks != null && !this.navigationLinks.isEmpty(); - } - - /** - * @param value {@link #navigationLinks} (Whether or not the test execution performs validation on the bundle navigation links.). This is the underlying object with id, value and extensions. The accessor "getNavigationLinks" gives direct access to the value - */ - public SetupActionAssertComponent setNavigationLinksElement(BooleanType value) { - this.navigationLinks = value; - return this; - } - - /** - * @return Whether or not the test execution performs validation on the bundle navigation links. - */ - public boolean getNavigationLinks() { - return this.navigationLinks == null || this.navigationLinks.isEmpty() ? false : this.navigationLinks.getValue(); - } - - /** - * @param value Whether or not the test execution performs validation on the bundle navigation links. - */ - public SetupActionAssertComponent setNavigationLinks(boolean value) { - if (this.navigationLinks == null) - this.navigationLinks = new BooleanType(); - this.navigationLinks.setValue(value); - return this; - } - - /** - * @return {@link #operator} (The operator type.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value - */ - public Enumeration getOperatorElement() { - if (this.operator == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.operator"); - else if (Configuration.doAutoCreate()) - this.operator = new Enumeration(new AssertionOperatorTypeEnumFactory()); // bb - return this.operator; - } - - public boolean hasOperatorElement() { - return this.operator != null && !this.operator.isEmpty(); - } - - public boolean hasOperator() { - return this.operator != null && !this.operator.isEmpty(); - } - - /** - * @param value {@link #operator} (The operator type.). This is the underlying object with id, value and extensions. The accessor "getOperator" gives direct access to the value - */ - public SetupActionAssertComponent setOperatorElement(Enumeration value) { - this.operator = value; - return this; - } - - /** - * @return The operator type. - */ - public AssertionOperatorType getOperator() { - return this.operator == null ? null : this.operator.getValue(); - } - - /** - * @param value The operator type. - */ - public SetupActionAssertComponent setOperator(AssertionOperatorType value) { - if (value == null) - this.operator = null; - else { - if (this.operator == null) - this.operator = new Enumeration(new AssertionOperatorTypeEnumFactory()); - this.operator.setValue(value); - } - return this; - } - - /** - * @return {@link #path} (The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public StringType getPathElement() { - if (this.path == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.path"); - else if (Configuration.doAutoCreate()) - this.path = new StringType(); // bb - return this.path; - } - - public boolean hasPathElement() { - return this.path != null && !this.path.isEmpty(); - } - - public boolean hasPath() { - return this.path != null && !this.path.isEmpty(); - } - - /** - * @param value {@link #path} (The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.). This is the underlying object with id, value and extensions. The accessor "getPath" gives direct access to the value - */ - public SetupActionAssertComponent setPathElement(StringType value) { - this.path = value; - return this; - } - - /** - * @return The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. - */ - public String getPath() { - return this.path == null ? null : this.path.getValue(); - } - - /** - * @param value The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server. - */ - public SetupActionAssertComponent setPath(String value) { - if (Utilities.noString(value)) - this.path = null; - else { - if (this.path == null) - this.path = new StringType(); - this.path.setValue(value); - } - return this; - } - - /** - * @return {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value - */ - public CodeType getResourceElement() { - if (this.resource == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.resource"); - else if (Configuration.doAutoCreate()) - this.resource = new CodeType(); // bb - return this.resource; - } - - public boolean hasResourceElement() { - return this.resource != null && !this.resource.isEmpty(); - } - - public boolean hasResource() { - return this.resource != null && !this.resource.isEmpty(); - } - - /** - * @param value {@link #resource} (The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.). This is the underlying object with id, value and extensions. The accessor "getResource" gives direct access to the value - */ - public SetupActionAssertComponent setResourceElement(CodeType value) { - this.resource = value; - return this; - } - - /** - * @return The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. - */ - public String getResource() { - return this.resource == null ? null : this.resource.getValue(); - } - - /** - * @param value The type of the resource. See http://hl7-fhir.github.io/resourcelist.html. - */ - public SetupActionAssertComponent setResource(String value) { - if (Utilities.noString(value)) - this.resource = null; - else { - if (this.resource == null) - this.resource = new CodeType(); - this.resource.setValue(value); - } - return this; - } - - /** - * @return {@link #response} (okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.). This is the underlying object with id, value and extensions. The accessor "getResponse" gives direct access to the value - */ - public Enumeration getResponseElement() { - if (this.response == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.response"); - else if (Configuration.doAutoCreate()) - this.response = new Enumeration(new AssertionResponseTypesEnumFactory()); // bb - return this.response; - } - - public boolean hasResponseElement() { - return this.response != null && !this.response.isEmpty(); - } - - public boolean hasResponse() { - return this.response != null && !this.response.isEmpty(); - } - - /** - * @param value {@link #response} (okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.). This is the underlying object with id, value and extensions. The accessor "getResponse" gives direct access to the value - */ - public SetupActionAssertComponent setResponseElement(Enumeration value) { - this.response = value; - return this; - } - - /** - * @return okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. - */ - public AssertionResponseTypes getResponse() { - return this.response == null ? null : this.response.getValue(); - } - - /** - * @param value okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. - */ - public SetupActionAssertComponent setResponse(AssertionResponseTypes value) { - if (value == null) - this.response = null; - else { - if (this.response == null) - this.response = new Enumeration(new AssertionResponseTypesEnumFactory()); - this.response.setValue(value); - } - return this; - } - - /** - * @return {@link #responseCode} (The value of the HTTP response code to be tested.). This is the underlying object with id, value and extensions. The accessor "getResponseCode" gives direct access to the value - */ - public StringType getResponseCodeElement() { - if (this.responseCode == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.responseCode"); - else if (Configuration.doAutoCreate()) - this.responseCode = new StringType(); // bb - return this.responseCode; - } - - public boolean hasResponseCodeElement() { - return this.responseCode != null && !this.responseCode.isEmpty(); - } - - public boolean hasResponseCode() { - return this.responseCode != null && !this.responseCode.isEmpty(); - } - - /** - * @param value {@link #responseCode} (The value of the HTTP response code to be tested.). This is the underlying object with id, value and extensions. The accessor "getResponseCode" gives direct access to the value - */ - public SetupActionAssertComponent setResponseCodeElement(StringType value) { - this.responseCode = value; - return this; - } - - /** - * @return The value of the HTTP response code to be tested. - */ - public String getResponseCode() { - return this.responseCode == null ? null : this.responseCode.getValue(); - } - - /** - * @param value The value of the HTTP response code to be tested. - */ - public SetupActionAssertComponent setResponseCode(String value) { - if (Utilities.noString(value)) - this.responseCode = null; - else { - if (this.responseCode == null) - this.responseCode = new StringType(); - this.responseCode.setValue(value); - } - return this; - } - - /** - * @return {@link #rule} (The TestScript.rule this assert will evaluate.) - */ - public SetupActionAssertRuleComponent getRule() { - if (this.rule == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.rule"); - else if (Configuration.doAutoCreate()) - this.rule = new SetupActionAssertRuleComponent(); // cc - return this.rule; - } - - public boolean hasRule() { - return this.rule != null && !this.rule.isEmpty(); - } - - /** - * @param value {@link #rule} (The TestScript.rule this assert will evaluate.) - */ - public SetupActionAssertComponent setRule(SetupActionAssertRuleComponent value) { - this.rule = value; - return this; - } - - /** - * @return {@link #ruleset} (The TestScript.ruleset this assert will evaluate.) - */ - public SetupActionAssertRulesetComponent getRuleset() { - if (this.ruleset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.ruleset"); - else if (Configuration.doAutoCreate()) - this.ruleset = new SetupActionAssertRulesetComponent(); // cc - return this.ruleset; - } - - public boolean hasRuleset() { - return this.ruleset != null && !this.ruleset.isEmpty(); - } - - /** - * @param value {@link #ruleset} (The TestScript.ruleset this assert will evaluate.) - */ - public SetupActionAssertComponent setRuleset(SetupActionAssertRulesetComponent value) { - this.ruleset = value; - return this; - } - - /** - * @return {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value - */ - public IdType getSourceIdElement() { - if (this.sourceId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.sourceId"); - else if (Configuration.doAutoCreate()) - this.sourceId = new IdType(); // bb - return this.sourceId; - } - - public boolean hasSourceIdElement() { - return this.sourceId != null && !this.sourceId.isEmpty(); - } - - public boolean hasSourceId() { - return this.sourceId != null && !this.sourceId.isEmpty(); - } - - /** - * @param value {@link #sourceId} (Fixture to evaluate the XPath/JSONPath expression or the headerField against.). This is the underlying object with id, value and extensions. The accessor "getSourceId" gives direct access to the value - */ - public SetupActionAssertComponent setSourceIdElement(IdType value) { - this.sourceId = value; - return this; - } - - /** - * @return Fixture to evaluate the XPath/JSONPath expression or the headerField against. - */ - public String getSourceId() { - return this.sourceId == null ? null : this.sourceId.getValue(); - } - - /** - * @param value Fixture to evaluate the XPath/JSONPath expression or the headerField against. - */ - public SetupActionAssertComponent setSourceId(String value) { - if (Utilities.noString(value)) - this.sourceId = null; - else { - if (this.sourceId == null) - this.sourceId = new IdType(); - this.sourceId.setValue(value); - } - return this; - } - - /** - * @return {@link #validateProfileId} (The ID of the Profile to validate against.). This is the underlying object with id, value and extensions. The accessor "getValidateProfileId" gives direct access to the value - */ - public IdType getValidateProfileIdElement() { - if (this.validateProfileId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.validateProfileId"); - else if (Configuration.doAutoCreate()) - this.validateProfileId = new IdType(); // bb - return this.validateProfileId; - } - - public boolean hasValidateProfileIdElement() { - return this.validateProfileId != null && !this.validateProfileId.isEmpty(); - } - - public boolean hasValidateProfileId() { - return this.validateProfileId != null && !this.validateProfileId.isEmpty(); - } - - /** - * @param value {@link #validateProfileId} (The ID of the Profile to validate against.). This is the underlying object with id, value and extensions. The accessor "getValidateProfileId" gives direct access to the value - */ - public SetupActionAssertComponent setValidateProfileIdElement(IdType value) { - this.validateProfileId = value; - return this; - } - - /** - * @return The ID of the Profile to validate against. - */ - public String getValidateProfileId() { - return this.validateProfileId == null ? null : this.validateProfileId.getValue(); - } - - /** - * @param value The ID of the Profile to validate against. - */ - public SetupActionAssertComponent setValidateProfileId(String value) { - if (Utilities.noString(value)) - this.validateProfileId = null; - else { - if (this.validateProfileId == null) - this.validateProfileId = new IdType(); - this.validateProfileId.setValue(value); - } - return this; - } - - /** - * @return {@link #value} (The value to compare to.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value to compare to.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SetupActionAssertComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value to compare to. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value to compare to. - */ - public SetupActionAssertComponent setValue(String value) { - if (Utilities.noString(value)) - this.value = null; - else { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - } - return this; - } - - /** - * @return {@link #warningOnly} (Whether or not the test execution will produce a warning only on error for this assert.). This is the underlying object with id, value and extensions. The accessor "getWarningOnly" gives direct access to the value - */ - public BooleanType getWarningOnlyElement() { - if (this.warningOnly == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertComponent.warningOnly"); - else if (Configuration.doAutoCreate()) - this.warningOnly = new BooleanType(); // bb - return this.warningOnly; - } - - public boolean hasWarningOnlyElement() { - return this.warningOnly != null && !this.warningOnly.isEmpty(); - } - - public boolean hasWarningOnly() { - return this.warningOnly != null && !this.warningOnly.isEmpty(); - } - - /** - * @param value {@link #warningOnly} (Whether or not the test execution will produce a warning only on error for this assert.). This is the underlying object with id, value and extensions. The accessor "getWarningOnly" gives direct access to the value - */ - public SetupActionAssertComponent setWarningOnlyElement(BooleanType value) { - this.warningOnly = value; - return this; - } - - /** - * @return Whether or not the test execution will produce a warning only on error for this assert. - */ - public boolean getWarningOnly() { - return this.warningOnly == null || this.warningOnly.isEmpty() ? false : this.warningOnly.getValue(); - } - - /** - * @param value Whether or not the test execution will produce a warning only on error for this assert. - */ - public SetupActionAssertComponent setWarningOnly(boolean value) { - if (this.warningOnly == null) - this.warningOnly = new BooleanType(); - this.warningOnly.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("label", "string", "The label would be used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, label)); - childrenList.add(new Property("description", "string", "The description would be used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("direction", "code", "The direction to use for the assertion.", 0, java.lang.Integer.MAX_VALUE, direction)); - childrenList.add(new Property("compareToSourceId", "string", "Id of fixture used to compare the \"sourceId/path\" evaluations to.", 0, java.lang.Integer.MAX_VALUE, compareToSourceId)); - childrenList.add(new Property("compareToSourcePath", "string", "XPath or JSONPath expression against fixture used to compare the \"sourceId/path\" evaluations to.", 0, java.lang.Integer.MAX_VALUE, compareToSourcePath)); - childrenList.add(new Property("contentType", "code", "The content-type or mime-type to use for RESTful operation in the 'Content-Type' header.", 0, java.lang.Integer.MAX_VALUE, contentType)); - childrenList.add(new Property("headerField", "string", "The HTTP header field name e.g. 'Location'.", 0, java.lang.Integer.MAX_VALUE, headerField)); - childrenList.add(new Property("minimumId", "string", "The ID of a fixture. Asserts that the response contains at a minimum the fixture specified by minimumId.", 0, java.lang.Integer.MAX_VALUE, minimumId)); - childrenList.add(new Property("navigationLinks", "boolean", "Whether or not the test execution performs validation on the bundle navigation links.", 0, java.lang.Integer.MAX_VALUE, navigationLinks)); - childrenList.add(new Property("operator", "code", "The operator type.", 0, java.lang.Integer.MAX_VALUE, operator)); - childrenList.add(new Property("path", "string", "The XPath or JSONPath expression to be evaluated against the fixture representing the response received from server.", 0, java.lang.Integer.MAX_VALUE, path)); - childrenList.add(new Property("resource", "code", "The type of the resource. See http://hl7-fhir.github.io/resourcelist.html.", 0, java.lang.Integer.MAX_VALUE, resource)); - childrenList.add(new Property("response", "code", "okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable.", 0, java.lang.Integer.MAX_VALUE, response)); - childrenList.add(new Property("responseCode", "string", "The value of the HTTP response code to be tested.", 0, java.lang.Integer.MAX_VALUE, responseCode)); - childrenList.add(new Property("rule", "", "The TestScript.rule this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, rule)); - childrenList.add(new Property("ruleset", "", "The TestScript.ruleset this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("sourceId", "id", "Fixture to evaluate the XPath/JSONPath expression or the headerField against.", 0, java.lang.Integer.MAX_VALUE, sourceId)); - childrenList.add(new Property("validateProfileId", "id", "The ID of the Profile to validate against.", 0, java.lang.Integer.MAX_VALUE, validateProfileId)); - childrenList.add(new Property("value", "string", "The value to compare to.", 0, java.lang.Integer.MAX_VALUE, value)); - childrenList.add(new Property("warningOnly", "boolean", "Whether or not the test execution will produce a warning only on error for this assert.", 0, java.lang.Integer.MAX_VALUE, warningOnly)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 102727412: /*label*/ return this.label == null ? new Base[0] : new Base[] {this.label}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -962590849: /*direction*/ return this.direction == null ? new Base[0] : new Base[] {this.direction}; // Enumeration - case 2081856758: /*compareToSourceId*/ return this.compareToSourceId == null ? new Base[0] : new Base[] {this.compareToSourceId}; // StringType - case -790206144: /*compareToSourcePath*/ return this.compareToSourcePath == null ? new Base[0] : new Base[] {this.compareToSourcePath}; // StringType - case -389131437: /*contentType*/ return this.contentType == null ? new Base[0] : new Base[] {this.contentType}; // Enumeration - case 1160732269: /*headerField*/ return this.headerField == null ? new Base[0] : new Base[] {this.headerField}; // StringType - case 818925001: /*minimumId*/ return this.minimumId == null ? new Base[0] : new Base[] {this.minimumId}; // StringType - case 1001488901: /*navigationLinks*/ return this.navigationLinks == null ? new Base[0] : new Base[] {this.navigationLinks}; // BooleanType - case -500553564: /*operator*/ return this.operator == null ? new Base[0] : new Base[] {this.operator}; // Enumeration - case 3433509: /*path*/ return this.path == null ? new Base[0] : new Base[] {this.path}; // StringType - case -341064690: /*resource*/ return this.resource == null ? new Base[0] : new Base[] {this.resource}; // CodeType - case -340323263: /*response*/ return this.response == null ? new Base[0] : new Base[] {this.response}; // Enumeration - case 1438723534: /*responseCode*/ return this.responseCode == null ? new Base[0] : new Base[] {this.responseCode}; // StringType - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : new Base[] {this.rule}; // SetupActionAssertRuleComponent - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : new Base[] {this.ruleset}; // SetupActionAssertRulesetComponent - case 1746327190: /*sourceId*/ return this.sourceId == null ? new Base[0] : new Base[] {this.sourceId}; // IdType - case 1555541038: /*validateProfileId*/ return this.validateProfileId == null ? new Base[0] : new Base[] {this.validateProfileId}; // IdType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - case -481159832: /*warningOnly*/ return this.warningOnly == null ? new Base[0] : new Base[] {this.warningOnly}; // BooleanType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 102727412: // label - this.label = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -962590849: // direction - this.direction = new AssertionDirectionTypeEnumFactory().fromType(value); // Enumeration - break; - case 2081856758: // compareToSourceId - this.compareToSourceId = castToString(value); // StringType - break; - case -790206144: // compareToSourcePath - this.compareToSourcePath = castToString(value); // StringType - break; - case -389131437: // contentType - this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration - break; - case 1160732269: // headerField - this.headerField = castToString(value); // StringType - break; - case 818925001: // minimumId - this.minimumId = castToString(value); // StringType - break; - case 1001488901: // navigationLinks - this.navigationLinks = castToBoolean(value); // BooleanType - break; - case -500553564: // operator - this.operator = new AssertionOperatorTypeEnumFactory().fromType(value); // Enumeration - break; - case 3433509: // path - this.path = castToString(value); // StringType - break; - case -341064690: // resource - this.resource = castToCode(value); // CodeType - break; - case -340323263: // response - this.response = new AssertionResponseTypesEnumFactory().fromType(value); // Enumeration - break; - case 1438723534: // responseCode - this.responseCode = castToString(value); // StringType - break; - case 3512060: // rule - this.rule = (SetupActionAssertRuleComponent) value; // SetupActionAssertRuleComponent - break; - case 1548678118: // ruleset - this.ruleset = (SetupActionAssertRulesetComponent) value; // SetupActionAssertRulesetComponent - break; - case 1746327190: // sourceId - this.sourceId = castToId(value); // IdType - break; - case 1555541038: // validateProfileId - this.validateProfileId = castToId(value); // IdType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - case -481159832: // warningOnly - this.warningOnly = castToBoolean(value); // BooleanType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("label")) - this.label = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("direction")) - this.direction = new AssertionDirectionTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("compareToSourceId")) - this.compareToSourceId = castToString(value); // StringType - else if (name.equals("compareToSourcePath")) - this.compareToSourcePath = castToString(value); // StringType - else if (name.equals("contentType")) - this.contentType = new ContentTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("headerField")) - this.headerField = castToString(value); // StringType - else if (name.equals("minimumId")) - this.minimumId = castToString(value); // StringType - else if (name.equals("navigationLinks")) - this.navigationLinks = castToBoolean(value); // BooleanType - else if (name.equals("operator")) - this.operator = new AssertionOperatorTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("path")) - this.path = castToString(value); // StringType - else if (name.equals("resource")) - this.resource = castToCode(value); // CodeType - else if (name.equals("response")) - this.response = new AssertionResponseTypesEnumFactory().fromType(value); // Enumeration - else if (name.equals("responseCode")) - this.responseCode = castToString(value); // StringType - else if (name.equals("rule")) - this.rule = (SetupActionAssertRuleComponent) value; // SetupActionAssertRuleComponent - else if (name.equals("ruleset")) - this.ruleset = (SetupActionAssertRulesetComponent) value; // SetupActionAssertRulesetComponent - else if (name.equals("sourceId")) - this.sourceId = castToId(value); // IdType - else if (name.equals("validateProfileId")) - this.validateProfileId = castToId(value); // IdType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else if (name.equals("warningOnly")) - this.warningOnly = castToBoolean(value); // BooleanType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 102727412: throw new FHIRException("Cannot make property label as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -962590849: throw new FHIRException("Cannot make property direction as it is not a complex type"); // Enumeration - case 2081856758: throw new FHIRException("Cannot make property compareToSourceId as it is not a complex type"); // StringType - case -790206144: throw new FHIRException("Cannot make property compareToSourcePath as it is not a complex type"); // StringType - case -389131437: throw new FHIRException("Cannot make property contentType as it is not a complex type"); // Enumeration - case 1160732269: throw new FHIRException("Cannot make property headerField as it is not a complex type"); // StringType - case 818925001: throw new FHIRException("Cannot make property minimumId as it is not a complex type"); // StringType - case 1001488901: throw new FHIRException("Cannot make property navigationLinks as it is not a complex type"); // BooleanType - case -500553564: throw new FHIRException("Cannot make property operator as it is not a complex type"); // Enumeration - case 3433509: throw new FHIRException("Cannot make property path as it is not a complex type"); // StringType - case -341064690: throw new FHIRException("Cannot make property resource as it is not a complex type"); // CodeType - case -340323263: throw new FHIRException("Cannot make property response as it is not a complex type"); // Enumeration - case 1438723534: throw new FHIRException("Cannot make property responseCode as it is not a complex type"); // StringType - case 3512060: return getRule(); // SetupActionAssertRuleComponent - case 1548678118: return getRuleset(); // SetupActionAssertRulesetComponent - case 1746327190: throw new FHIRException("Cannot make property sourceId as it is not a complex type"); // IdType - case 1555541038: throw new FHIRException("Cannot make property validateProfileId as it is not a complex type"); // IdType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - case -481159832: throw new FHIRException("Cannot make property warningOnly as it is not a complex type"); // BooleanType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("label")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.label"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); - } - else if (name.equals("direction")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.direction"); - } - else if (name.equals("compareToSourceId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourceId"); - } - else if (name.equals("compareToSourcePath")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.compareToSourcePath"); - } - else if (name.equals("contentType")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.contentType"); - } - else if (name.equals("headerField")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.headerField"); - } - else if (name.equals("minimumId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.minimumId"); - } - else if (name.equals("navigationLinks")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.navigationLinks"); - } - else if (name.equals("operator")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.operator"); - } - else if (name.equals("path")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.path"); - } - else if (name.equals("resource")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.resource"); - } - else if (name.equals("response")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.response"); - } - else if (name.equals("responseCode")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.responseCode"); - } - else if (name.equals("rule")) { - this.rule = new SetupActionAssertRuleComponent(); - return this.rule; - } - else if (name.equals("ruleset")) { - this.ruleset = new SetupActionAssertRulesetComponent(); - return this.ruleset; - } - else if (name.equals("sourceId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.sourceId"); - } - else if (name.equals("validateProfileId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.validateProfileId"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); - } - else if (name.equals("warningOnly")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.warningOnly"); - } - else - return super.addChild(name); - } - - public SetupActionAssertComponent copy() { - SetupActionAssertComponent dst = new SetupActionAssertComponent(); - copyValues(dst); - dst.label = label == null ? null : label.copy(); - dst.description = description == null ? null : description.copy(); - dst.direction = direction == null ? null : direction.copy(); - dst.compareToSourceId = compareToSourceId == null ? null : compareToSourceId.copy(); - dst.compareToSourcePath = compareToSourcePath == null ? null : compareToSourcePath.copy(); - dst.contentType = contentType == null ? null : contentType.copy(); - dst.headerField = headerField == null ? null : headerField.copy(); - dst.minimumId = minimumId == null ? null : minimumId.copy(); - dst.navigationLinks = navigationLinks == null ? null : navigationLinks.copy(); - dst.operator = operator == null ? null : operator.copy(); - dst.path = path == null ? null : path.copy(); - dst.resource = resource == null ? null : resource.copy(); - dst.response = response == null ? null : response.copy(); - dst.responseCode = responseCode == null ? null : responseCode.copy(); - dst.rule = rule == null ? null : rule.copy(); - dst.ruleset = ruleset == null ? null : ruleset.copy(); - dst.sourceId = sourceId == null ? null : sourceId.copy(); - dst.validateProfileId = validateProfileId == null ? null : validateProfileId.copy(); - dst.value = value == null ? null : value.copy(); - dst.warningOnly = warningOnly == null ? null : warningOnly.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionAssertComponent)) - return false; - SetupActionAssertComponent o = (SetupActionAssertComponent) other; - return compareDeep(label, o.label, true) && compareDeep(description, o.description, true) && compareDeep(direction, o.direction, true) - && compareDeep(compareToSourceId, o.compareToSourceId, true) && compareDeep(compareToSourcePath, o.compareToSourcePath, true) - && compareDeep(contentType, o.contentType, true) && compareDeep(headerField, o.headerField, true) - && compareDeep(minimumId, o.minimumId, true) && compareDeep(navigationLinks, o.navigationLinks, true) - && compareDeep(operator, o.operator, true) && compareDeep(path, o.path, true) && compareDeep(resource, o.resource, true) - && compareDeep(response, o.response, true) && compareDeep(responseCode, o.responseCode, true) && compareDeep(rule, o.rule, true) - && compareDeep(ruleset, o.ruleset, true) && compareDeep(sourceId, o.sourceId, true) && compareDeep(validateProfileId, o.validateProfileId, true) - && compareDeep(value, o.value, true) && compareDeep(warningOnly, o.warningOnly, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionAssertComponent)) - return false; - SetupActionAssertComponent o = (SetupActionAssertComponent) other; - return compareValues(label, o.label, true) && compareValues(description, o.description, true) && compareValues(direction, o.direction, true) - && compareValues(compareToSourceId, o.compareToSourceId, true) && compareValues(compareToSourcePath, o.compareToSourcePath, true) - && compareValues(contentType, o.contentType, true) && compareValues(headerField, o.headerField, true) - && compareValues(minimumId, o.minimumId, true) && compareValues(navigationLinks, o.navigationLinks, true) - && compareValues(operator, o.operator, true) && compareValues(path, o.path, true) && compareValues(resource, o.resource, true) - && compareValues(response, o.response, true) && compareValues(responseCode, o.responseCode, true) && compareValues(sourceId, o.sourceId, true) - && compareValues(validateProfileId, o.validateProfileId, true) && compareValues(value, o.value, true) - && compareValues(warningOnly, o.warningOnly, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (label == null || label.isEmpty()) && (description == null || description.isEmpty()) - && (direction == null || direction.isEmpty()) && (compareToSourceId == null || compareToSourceId.isEmpty()) - && (compareToSourcePath == null || compareToSourcePath.isEmpty()) && (contentType == null || contentType.isEmpty()) - && (headerField == null || headerField.isEmpty()) && (minimumId == null || minimumId.isEmpty()) - && (navigationLinks == null || navigationLinks.isEmpty()) && (operator == null || operator.isEmpty()) - && (path == null || path.isEmpty()) && (resource == null || resource.isEmpty()) && (response == null || response.isEmpty()) - && (responseCode == null || responseCode.isEmpty()) && (rule == null || rule.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (sourceId == null || sourceId.isEmpty()) && (validateProfileId == null || validateProfileId.isEmpty()) - && (value == null || value.isEmpty()) && (warningOnly == null || warningOnly.isEmpty()); - } - - public String fhirType() { - return "TestScript.setup.action.assert"; - - } - - } - - @Block() - public static class SetupActionAssertRuleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The TestScript.rule id value this assert will evaluate. - */ - @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of the TestScript.rule", formalDefinition="The TestScript.rule id value this assert will evaluate." ) - protected IdType ruleId; - - /** - * Each rule template can take one or more parameters for rule evaluation. - */ - @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) - protected List param; - - private static final long serialVersionUID = -319928210L; - - /** - * Constructor - */ - public SetupActionAssertRuleComponent() { - super(); - } - - /** - * Constructor - */ - public SetupActionAssertRuleComponent(IdType ruleId) { - super(); - this.ruleId = ruleId; - } - - /** - * @return {@link #ruleId} (The TestScript.rule id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value - */ - public IdType getRuleIdElement() { - if (this.ruleId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRuleComponent.ruleId"); - else if (Configuration.doAutoCreate()) - this.ruleId = new IdType(); // bb - return this.ruleId; - } - - public boolean hasRuleIdElement() { - return this.ruleId != null && !this.ruleId.isEmpty(); - } - - public boolean hasRuleId() { - return this.ruleId != null && !this.ruleId.isEmpty(); - } - - /** - * @param value {@link #ruleId} (The TestScript.rule id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value - */ - public SetupActionAssertRuleComponent setRuleIdElement(IdType value) { - this.ruleId = value; - return this; - } - - /** - * @return The TestScript.rule id value this assert will evaluate. - */ - public String getRuleId() { - return this.ruleId == null ? null : this.ruleId.getValue(); - } - - /** - * @param value The TestScript.rule id value this assert will evaluate. - */ - public SetupActionAssertRuleComponent setRuleId(String value) { - if (this.ruleId == null) - this.ruleId = new IdType(); - this.ruleId.setValue(value); - return this; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - public List getParam() { - if (this.param == null) - this.param = new ArrayList(); - return this.param; - } - - public boolean hasParam() { - if (this.param == null) - return false; - for (SetupActionAssertRuleParamComponent item : this.param) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - // syntactic sugar - public SetupActionAssertRuleParamComponent addParam() { //3 - SetupActionAssertRuleParamComponent t = new SetupActionAssertRuleParamComponent(); - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return t; - } - - // syntactic sugar - public SetupActionAssertRuleComponent addParam(SetupActionAssertRuleParamComponent t) { //3 - if (t == null) - return this; - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("ruleId", "id", "The TestScript.rule id value this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, ruleId)); - childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType - case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // SetupActionAssertRuleParamComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -919875273: // ruleId - this.ruleId = castToId(value); // IdType - break; - case 106436749: // param - this.getParam().add((SetupActionAssertRuleParamComponent) value); // SetupActionAssertRuleParamComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("ruleId")) - this.ruleId = castToId(value); // IdType - else if (name.equals("param")) - this.getParam().add((SetupActionAssertRuleParamComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -919875273: throw new FHIRException("Cannot make property ruleId as it is not a complex type"); // IdType - case 106436749: return addParam(); // SetupActionAssertRuleParamComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("ruleId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId"); - } - else if (name.equals("param")) { - return addParam(); - } - else - return super.addChild(name); - } - - public SetupActionAssertRuleComponent copy() { - SetupActionAssertRuleComponent dst = new SetupActionAssertRuleComponent(); - copyValues(dst); - dst.ruleId = ruleId == null ? null : ruleId.copy(); - if (param != null) { - dst.param = new ArrayList(); - for (SetupActionAssertRuleParamComponent i : param) - dst.param.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionAssertRuleComponent)) - return false; - SetupActionAssertRuleComponent o = (SetupActionAssertRuleComponent) other; - return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionAssertRuleComponent)) - return false; - SetupActionAssertRuleComponent o = (SetupActionAssertRuleComponent) other; - return compareValues(ruleId, o.ruleId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (ruleId == null || ruleId.isEmpty()) && (param == null || param.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action.assert.rule"; - - } - - } - - @Block() - public static class SetupActionAssertRuleParamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Descriptive name for this parameter that matches the external assert rule parameter name. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter name matching external assert rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert rule parameter name." ) - protected StringType name; - - /** - * The value for the parameter that will be passed on to the external rule template. - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external rule template." ) - protected StringType value; - - private static final long serialVersionUID = 395259392L; - - /** - * Constructor - */ - public SetupActionAssertRuleParamComponent() { - super(); - } - - /** - * Constructor - */ - public SetupActionAssertRuleParamComponent(StringType name, StringType value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRuleParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Descriptive name for this parameter that matches the external assert rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SetupActionAssertRuleParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Descriptive name for this parameter that matches the external assert rule parameter name. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Descriptive name for this parameter that matches the external assert rule parameter name. - */ - public SetupActionAssertRuleParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRuleParamComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value for the parameter that will be passed on to the external rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SetupActionAssertRuleParamComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value for the parameter that will be passed on to the external rule template. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value for the parameter that will be passed on to the external rule template. - */ - public SetupActionAssertRuleParamComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value", "string", "The value for the parameter that will be passed on to the external rule template.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); - } - else - return super.addChild(name); - } - - public SetupActionAssertRuleParamComponent copy() { - SetupActionAssertRuleParamComponent dst = new SetupActionAssertRuleParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionAssertRuleParamComponent)) - return false; - SetupActionAssertRuleParamComponent o = (SetupActionAssertRuleParamComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionAssertRuleParamComponent)) - return false; - SetupActionAssertRuleParamComponent o = (SetupActionAssertRuleParamComponent) other; - return compareValues(name, o.name, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action.assert.rule.param"; - - } - - } - - @Block() - public static class SetupActionAssertRulesetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The TestScript.ruleset id value this assert will evaluate. - */ - @Child(name = "rulesetId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of the TestScript.ruleset", formalDefinition="The TestScript.ruleset id value this assert will evaluate." ) - protected IdType rulesetId; - - /** - * The referenced rule within the external ruleset template. - */ - @Child(name = "rule", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="The referenced rule within the ruleset", formalDefinition="The referenced rule within the external ruleset template." ) - protected List rule; - - private static final long serialVersionUID = 2070600738L; - - /** - * Constructor - */ - public SetupActionAssertRulesetComponent() { - super(); - } - - /** - * Constructor - */ - public SetupActionAssertRulesetComponent(IdType rulesetId) { - super(); - this.rulesetId = rulesetId; - } - - /** - * @return {@link #rulesetId} (The TestScript.ruleset id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRulesetId" gives direct access to the value - */ - public IdType getRulesetIdElement() { - if (this.rulesetId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRulesetComponent.rulesetId"); - else if (Configuration.doAutoCreate()) - this.rulesetId = new IdType(); // bb - return this.rulesetId; - } - - public boolean hasRulesetIdElement() { - return this.rulesetId != null && !this.rulesetId.isEmpty(); - } - - public boolean hasRulesetId() { - return this.rulesetId != null && !this.rulesetId.isEmpty(); - } - - /** - * @param value {@link #rulesetId} (The TestScript.ruleset id value this assert will evaluate.). This is the underlying object with id, value and extensions. The accessor "getRulesetId" gives direct access to the value - */ - public SetupActionAssertRulesetComponent setRulesetIdElement(IdType value) { - this.rulesetId = value; - return this; - } - - /** - * @return The TestScript.ruleset id value this assert will evaluate. - */ - public String getRulesetId() { - return this.rulesetId == null ? null : this.rulesetId.getValue(); - } - - /** - * @param value The TestScript.ruleset id value this assert will evaluate. - */ - public SetupActionAssertRulesetComponent setRulesetId(String value) { - if (this.rulesetId == null) - this.rulesetId = new IdType(); - this.rulesetId.setValue(value); - return this; - } - - /** - * @return {@link #rule} (The referenced rule within the external ruleset template.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (SetupActionAssertRulesetRuleComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (The referenced rule within the external ruleset template.) - */ - // syntactic sugar - public SetupActionAssertRulesetRuleComponent addRule() { //3 - SetupActionAssertRulesetRuleComponent t = new SetupActionAssertRulesetRuleComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public SetupActionAssertRulesetComponent addRule(SetupActionAssertRulesetRuleComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("rulesetId", "id", "The TestScript.ruleset id value this assert will evaluate.", 0, java.lang.Integer.MAX_VALUE, rulesetId)); - childrenList.add(new Property("rule", "", "The referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, rule)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -2073977951: /*rulesetId*/ return this.rulesetId == null ? new Base[0] : new Base[] {this.rulesetId}; // IdType - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // SetupActionAssertRulesetRuleComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -2073977951: // rulesetId - this.rulesetId = castToId(value); // IdType - break; - case 3512060: // rule - this.getRule().add((SetupActionAssertRulesetRuleComponent) value); // SetupActionAssertRulesetRuleComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("rulesetId")) - this.rulesetId = castToId(value); // IdType - else if (name.equals("rule")) - this.getRule().add((SetupActionAssertRulesetRuleComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -2073977951: throw new FHIRException("Cannot make property rulesetId as it is not a complex type"); // IdType - case 3512060: return addRule(); // SetupActionAssertRulesetRuleComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("rulesetId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.rulesetId"); - } - else if (name.equals("rule")) { - return addRule(); - } - else - return super.addChild(name); - } - - public SetupActionAssertRulesetComponent copy() { - SetupActionAssertRulesetComponent dst = new SetupActionAssertRulesetComponent(); - copyValues(dst); - dst.rulesetId = rulesetId == null ? null : rulesetId.copy(); - if (rule != null) { - dst.rule = new ArrayList(); - for (SetupActionAssertRulesetRuleComponent i : rule) - dst.rule.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionAssertRulesetComponent)) - return false; - SetupActionAssertRulesetComponent o = (SetupActionAssertRulesetComponent) other; - return compareDeep(rulesetId, o.rulesetId, true) && compareDeep(rule, o.rule, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionAssertRulesetComponent)) - return false; - SetupActionAssertRulesetComponent o = (SetupActionAssertRulesetComponent) other; - return compareValues(rulesetId, o.rulesetId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (rulesetId == null || rulesetId.isEmpty()) && (rule == null || rule.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action.assert.ruleset"; - - } - - } - - @Block() - public static class SetupActionAssertRulesetRuleComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Id of the referenced rule within the external ruleset template. - */ - @Child(name = "ruleId", type = {IdType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Id of referenced rule within the ruleset", formalDefinition="Id of the referenced rule within the external ruleset template." ) - protected IdType ruleId; - - /** - * Each rule template can take one or more parameters for rule evaluation. - */ - @Child(name = "param", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Rule parameter template", formalDefinition="Each rule template can take one or more parameters for rule evaluation." ) - protected List param; - - private static final long serialVersionUID = 52246314L; - - /** - * Constructor - */ - public SetupActionAssertRulesetRuleComponent() { - super(); - } - - /** - * Constructor - */ - public SetupActionAssertRulesetRuleComponent(IdType ruleId) { - super(); - this.ruleId = ruleId; - } - - /** - * @return {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value - */ - public IdType getRuleIdElement() { - if (this.ruleId == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRulesetRuleComponent.ruleId"); - else if (Configuration.doAutoCreate()) - this.ruleId = new IdType(); // bb - return this.ruleId; - } - - public boolean hasRuleIdElement() { - return this.ruleId != null && !this.ruleId.isEmpty(); - } - - public boolean hasRuleId() { - return this.ruleId != null && !this.ruleId.isEmpty(); - } - - /** - * @param value {@link #ruleId} (Id of the referenced rule within the external ruleset template.). This is the underlying object with id, value and extensions. The accessor "getRuleId" gives direct access to the value - */ - public SetupActionAssertRulesetRuleComponent setRuleIdElement(IdType value) { - this.ruleId = value; - return this; - } - - /** - * @return Id of the referenced rule within the external ruleset template. - */ - public String getRuleId() { - return this.ruleId == null ? null : this.ruleId.getValue(); - } - - /** - * @param value Id of the referenced rule within the external ruleset template. - */ - public SetupActionAssertRulesetRuleComponent setRuleId(String value) { - if (this.ruleId == null) - this.ruleId = new IdType(); - this.ruleId.setValue(value); - return this; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - public List getParam() { - if (this.param == null) - this.param = new ArrayList(); - return this.param; - } - - public boolean hasParam() { - if (this.param == null) - return false; - for (SetupActionAssertRulesetRuleParamComponent item : this.param) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #param} (Each rule template can take one or more parameters for rule evaluation.) - */ - // syntactic sugar - public SetupActionAssertRulesetRuleParamComponent addParam() { //3 - SetupActionAssertRulesetRuleParamComponent t = new SetupActionAssertRulesetRuleParamComponent(); - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return t; - } - - // syntactic sugar - public SetupActionAssertRulesetRuleComponent addParam(SetupActionAssertRulesetRuleParamComponent t) { //3 - if (t == null) - return this; - if (this.param == null) - this.param = new ArrayList(); - this.param.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("ruleId", "id", "Id of the referenced rule within the external ruleset template.", 0, java.lang.Integer.MAX_VALUE, ruleId)); - childrenList.add(new Property("param", "", "Each rule template can take one or more parameters for rule evaluation.", 0, java.lang.Integer.MAX_VALUE, param)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -919875273: /*ruleId*/ return this.ruleId == null ? new Base[0] : new Base[] {this.ruleId}; // IdType - case 106436749: /*param*/ return this.param == null ? new Base[0] : this.param.toArray(new Base[this.param.size()]); // SetupActionAssertRulesetRuleParamComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -919875273: // ruleId - this.ruleId = castToId(value); // IdType - break; - case 106436749: // param - this.getParam().add((SetupActionAssertRulesetRuleParamComponent) value); // SetupActionAssertRulesetRuleParamComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("ruleId")) - this.ruleId = castToId(value); // IdType - else if (name.equals("param")) - this.getParam().add((SetupActionAssertRulesetRuleParamComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -919875273: throw new FHIRException("Cannot make property ruleId as it is not a complex type"); // IdType - case 106436749: return addParam(); // SetupActionAssertRulesetRuleParamComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("ruleId")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.ruleId"); - } - else if (name.equals("param")) { - return addParam(); - } - else - return super.addChild(name); - } - - public SetupActionAssertRulesetRuleComponent copy() { - SetupActionAssertRulesetRuleComponent dst = new SetupActionAssertRulesetRuleComponent(); - copyValues(dst); - dst.ruleId = ruleId == null ? null : ruleId.copy(); - if (param != null) { - dst.param = new ArrayList(); - for (SetupActionAssertRulesetRuleParamComponent i : param) - dst.param.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionAssertRulesetRuleComponent)) - return false; - SetupActionAssertRulesetRuleComponent o = (SetupActionAssertRulesetRuleComponent) other; - return compareDeep(ruleId, o.ruleId, true) && compareDeep(param, o.param, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionAssertRulesetRuleComponent)) - return false; - SetupActionAssertRulesetRuleComponent o = (SetupActionAssertRulesetRuleComponent) other; - return compareValues(ruleId, o.ruleId, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (ruleId == null || ruleId.isEmpty()) && (param == null || param.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action.assert.ruleset.rule"; - - } - - } - - @Block() - public static class SetupActionAssertRulesetRuleParamComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Descriptive name for this parameter that matches the external assert ruleset rule parameter name. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter name matching external assert ruleset rule parameter", formalDefinition="Descriptive name for this parameter that matches the external assert ruleset rule parameter name." ) - protected StringType name; - - /** - * The value for the parameter that will be passed on to the external ruleset rule template. - */ - @Child(name = "value", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Parameter value defined either explicitly or dynamically", formalDefinition="The value for the parameter that will be passed on to the external ruleset rule template." ) - protected StringType value; - - private static final long serialVersionUID = 395259392L; - - /** - * Constructor - */ - public SetupActionAssertRulesetRuleParamComponent() { - super(); - } - - /** - * Constructor - */ - public SetupActionAssertRulesetRuleParamComponent(StringType name, StringType value) { - super(); - this.name = name; - this.value = value; - } - - /** - * @return {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRulesetRuleParamComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (Descriptive name for this parameter that matches the external assert ruleset rule parameter name.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public SetupActionAssertRulesetRuleParamComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return Descriptive name for this parameter that matches the external assert ruleset rule parameter name. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value Descriptive name for this parameter that matches the external assert ruleset rule parameter name. - */ - public SetupActionAssertRulesetRuleParamComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create SetupActionAssertRulesetRuleParamComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value for the parameter that will be passed on to the external ruleset rule template.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public SetupActionAssertRulesetRuleParamComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The value for the parameter that will be passed on to the external ruleset rule template. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The value for the parameter that will be passed on to the external ruleset rule template. - */ - public SetupActionAssertRulesetRuleParamComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "Descriptive name for this parameter that matches the external assert ruleset rule parameter name.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value", "string", "The value for the parameter that will be passed on to the external ruleset rule template.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.value"); - } - else - return super.addChild(name); - } - - public SetupActionAssertRulesetRuleParamComponent copy() { - SetupActionAssertRulesetRuleParamComponent dst = new SetupActionAssertRulesetRuleParamComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof SetupActionAssertRulesetRuleParamComponent)) - return false; - SetupActionAssertRulesetRuleParamComponent o = (SetupActionAssertRulesetRuleParamComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof SetupActionAssertRulesetRuleParamComponent)) - return false; - SetupActionAssertRulesetRuleParamComponent o = (SetupActionAssertRulesetRuleParamComponent) other; - return compareValues(name, o.name, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.setup.action.assert.ruleset.rule.param"; - - } - - } - - @Block() - public static class TestScriptTestComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of this test used for tracking/logging purposes by test engines. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tracking/logging name of this test", formalDefinition="The name of this test used for tracking/logging purposes by test engines." ) - protected StringType name; - - /** - * A short description of the test used by test engines for tracking and reporting purposes. - */ - @Child(name = "description", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Tracking/reporting short description of the test", formalDefinition="A short description of the test used by test engines for tracking and reporting purposes." ) - protected StringType description; - - /** - * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. - */ - @Child(name = "metadata", type = {TestScriptMetadataComponent.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Capabilities that are expected to function correctly on the FHIR server being tested", formalDefinition="Capabilities that must exist and are assumed to function correctly on the FHIR server being tested." ) - protected TestScriptMetadataComponent metadata; - - /** - * Action would contain either an operation or an assertion. - */ - @Child(name = "action", type = {}, order=4, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A test operation or assert to perform", formalDefinition="Action would contain either an operation or an assertion." ) - protected List action; - - private static final long serialVersionUID = -1607790780L; - - /** - * Constructor - */ - public TestScriptTestComponent() { - super(); - } - - /** - * @return {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptTestComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of this test used for tracking/logging purposes by test engines.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TestScriptTestComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of this test used for tracking/logging purposes by test engines. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of this test used for tracking/logging purposes by test engines. - */ - public TestScriptTestComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptTestComponent.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A short description of the test used by test engines for tracking and reporting purposes.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public TestScriptTestComponent setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A short description of the test used by test engines for tracking and reporting purposes. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A short description of the test used by test engines for tracking and reporting purposes. - */ - public TestScriptTestComponent setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public TestScriptMetadataComponent getMetadata() { - if (this.metadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScriptTestComponent.metadata"); - else if (Configuration.doAutoCreate()) - this.metadata = new TestScriptMetadataComponent(); // cc - return this.metadata; - } - - public boolean hasMetadata() { - return this.metadata != null && !this.metadata.isEmpty(); - } - - /** - * @param value {@link #metadata} (Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public TestScriptTestComponent setMetadata(TestScriptMetadataComponent value) { - this.metadata = value; - return this; - } - - /** - * @return {@link #action} (Action would contain either an operation or an assertion.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (TestActionComponent item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (Action would contain either an operation or an assertion.) - */ - // syntactic sugar - public TestActionComponent addAction() { //3 - TestActionComponent t = new TestActionComponent(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public TestScriptTestComponent addAction(TestActionComponent t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of this test used for tracking/logging purposes by test engines.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("description", "string", "A short description of the test used by test engines for tracking and reporting purposes.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("metadata", "@TestScript.metadata", "Capabilities that must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata)); - childrenList.add(new Property("action", "", "Action would contain either an operation or an assertion.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TestActionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -450004177: // metadata - this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent - break; - case -1422950858: // action - this.getAction().add((TestActionComponent) value); // TestActionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("metadata")) - this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent - else if (name.equals("action")) - this.getAction().add((TestActionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -450004177: return getMetadata(); // TestScriptMetadataComponent - case -1422950858: return addAction(); // TestActionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); - } - else if (name.equals("metadata")) { - this.metadata = new TestScriptMetadataComponent(); - return this.metadata; - } - else if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public TestScriptTestComponent copy() { - TestScriptTestComponent dst = new TestScriptTestComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.description = description == null ? null : description.copy(); - dst.metadata = metadata == null ? null : metadata.copy(); - if (action != null) { - dst.action = new ArrayList(); - for (TestActionComponent i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptTestComponent)) - return false; - TestScriptTestComponent o = (TestScriptTestComponent) other; - return compareDeep(name, o.name, true) && compareDeep(description, o.description, true) && compareDeep(metadata, o.metadata, true) - && compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptTestComponent)) - return false; - TestScriptTestComponent o = (TestScriptTestComponent) other; - return compareValues(name, o.name, true) && compareValues(description, o.description, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (description == null || description.isEmpty()) - && (metadata == null || metadata.isEmpty()) && (action == null || action.isEmpty()); - } - - public String fhirType() { - return "TestScript.test"; - - } - - } - - @Block() - public static class TestActionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An operation would involve a REST request to a server. - */ - @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The setup operation to perform", formalDefinition="An operation would involve a REST request to a server." ) - protected SetupActionOperationComponent operation; - - /** - * Evaluates the results of previous operations to determine if the server under test behaves appropriately. - */ - @Child(name = "assert", type = {SetupActionAssertComponent.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The setup assertion to perform", formalDefinition="Evaluates the results of previous operations to determine if the server under test behaves appropriately." ) - protected SetupActionAssertComponent assert_; - - private static final long serialVersionUID = -252088305L; - - /** - * Constructor - */ - public TestActionComponent() { - super(); - } - - /** - * @return {@link #operation} (An operation would involve a REST request to a server.) - */ - public SetupActionOperationComponent getOperation() { - if (this.operation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestActionComponent.operation"); - else if (Configuration.doAutoCreate()) - this.operation = new SetupActionOperationComponent(); // cc - return this.operation; - } - - public boolean hasOperation() { - return this.operation != null && !this.operation.isEmpty(); - } - - /** - * @param value {@link #operation} (An operation would involve a REST request to a server.) - */ - public TestActionComponent setOperation(SetupActionOperationComponent value) { - this.operation = value; - return this; - } - - /** - * @return {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) - */ - public SetupActionAssertComponent getAssert() { - if (this.assert_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestActionComponent.assert_"); - else if (Configuration.doAutoCreate()) - this.assert_ = new SetupActionAssertComponent(); // cc - return this.assert_; - } - - public boolean hasAssert() { - return this.assert_ != null && !this.assert_.isEmpty(); - } - - /** - * @param value {@link #assert_} (Evaluates the results of previous operations to determine if the server under test behaves appropriately.) - */ - public TestActionComponent setAssert(SetupActionAssertComponent value) { - this.assert_ = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, java.lang.Integer.MAX_VALUE, operation)); - childrenList.add(new Property("assert", "@TestScript.setup.action.assert", "Evaluates the results of previous operations to determine if the server under test behaves appropriately.", 0, java.lang.Integer.MAX_VALUE, assert_)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent - case -1408208058: /*assert*/ return this.assert_ == null ? new Base[0] : new Base[] {this.assert_}; // SetupActionAssertComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1662702951: // operation - this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent - break; - case -1408208058: // assert - this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("operation")) - this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent - else if (name.equals("assert")) - this.assert_ = (SetupActionAssertComponent) value; // SetupActionAssertComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1662702951: return getOperation(); // SetupActionOperationComponent - case -1408208058: return getAssert(); // SetupActionAssertComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("operation")) { - this.operation = new SetupActionOperationComponent(); - return this.operation; - } - else if (name.equals("assert")) { - this.assert_ = new SetupActionAssertComponent(); - return this.assert_; - } - else - return super.addChild(name); - } - - public TestActionComponent copy() { - TestActionComponent dst = new TestActionComponent(); - copyValues(dst); - dst.operation = operation == null ? null : operation.copy(); - dst.assert_ = assert_ == null ? null : assert_.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestActionComponent)) - return false; - TestActionComponent o = (TestActionComponent) other; - return compareDeep(operation, o.operation, true) && compareDeep(assert_, o.assert_, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestActionComponent)) - return false; - TestActionComponent o = (TestActionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (operation == null || operation.isEmpty()) && (assert_ == null || assert_.isEmpty()) - ; - } - - public String fhirType() { - return "TestScript.test.action"; - - } - - } - - @Block() - public static class TestScriptTeardownComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The teardown action will only contain an operation. - */ - @Child(name = "action", type = {}, order=1, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="One or more teardown operations to perform", formalDefinition="The teardown action will only contain an operation." ) - protected List action; - - private static final long serialVersionUID = 1168638089L; - - /** - * Constructor - */ - public TestScriptTeardownComponent() { - super(); - } - - /** - * @return {@link #action} (The teardown action will only contain an operation.) - */ - public List getAction() { - if (this.action == null) - this.action = new ArrayList(); - return this.action; - } - - public boolean hasAction() { - if (this.action == null) - return false; - for (TeardownActionComponent item : this.action) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #action} (The teardown action will only contain an operation.) - */ - // syntactic sugar - public TeardownActionComponent addAction() { //3 - TeardownActionComponent t = new TeardownActionComponent(); - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return t; - } - - // syntactic sugar - public TestScriptTeardownComponent addAction(TeardownActionComponent t) { //3 - if (t == null) - return this; - if (this.action == null) - this.action = new ArrayList(); - this.action.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("action", "", "The teardown action will only contain an operation.", 0, java.lang.Integer.MAX_VALUE, action)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1422950858: /*action*/ return this.action == null ? new Base[0] : this.action.toArray(new Base[this.action.size()]); // TeardownActionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1422950858: // action - this.getAction().add((TeardownActionComponent) value); // TeardownActionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("action")) - this.getAction().add((TeardownActionComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1422950858: return addAction(); // TeardownActionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("action")) { - return addAction(); - } - else - return super.addChild(name); - } - - public TestScriptTeardownComponent copy() { - TestScriptTeardownComponent dst = new TestScriptTeardownComponent(); - copyValues(dst); - if (action != null) { - dst.action = new ArrayList(); - for (TeardownActionComponent i : action) - dst.action.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScriptTeardownComponent)) - return false; - TestScriptTeardownComponent o = (TestScriptTeardownComponent) other; - return compareDeep(action, o.action, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScriptTeardownComponent)) - return false; - TestScriptTeardownComponent o = (TestScriptTeardownComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (action == null || action.isEmpty()); - } - - public String fhirType() { - return "TestScript.teardown"; - - } - - } - - @Block() - public static class TeardownActionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An operation would involve a REST request to a server. - */ - @Child(name = "operation", type = {SetupActionOperationComponent.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="The teardown operation to perform", formalDefinition="An operation would involve a REST request to a server." ) - protected SetupActionOperationComponent operation; - - private static final long serialVersionUID = -1099598054L; - - /** - * Constructor - */ - public TeardownActionComponent() { - super(); - } - - /** - * @return {@link #operation} (An operation would involve a REST request to a server.) - */ - public SetupActionOperationComponent getOperation() { - if (this.operation == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TeardownActionComponent.operation"); - else if (Configuration.doAutoCreate()) - this.operation = new SetupActionOperationComponent(); // cc - return this.operation; - } - - public boolean hasOperation() { - return this.operation != null && !this.operation.isEmpty(); - } - - /** - * @param value {@link #operation} (An operation would involve a REST request to a server.) - */ - public TeardownActionComponent setOperation(SetupActionOperationComponent value) { - this.operation = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("operation", "@TestScript.setup.action.operation", "An operation would involve a REST request to a server.", 0, java.lang.Integer.MAX_VALUE, operation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 1662702951: /*operation*/ return this.operation == null ? new Base[0] : new Base[] {this.operation}; // SetupActionOperationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 1662702951: // operation - this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("operation")) - this.operation = (SetupActionOperationComponent) value; // SetupActionOperationComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 1662702951: return getOperation(); // SetupActionOperationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("operation")) { - this.operation = new SetupActionOperationComponent(); - return this.operation; - } - else - return super.addChild(name); - } - - public TeardownActionComponent copy() { - TeardownActionComponent dst = new TeardownActionComponent(); - copyValues(dst); - dst.operation = operation == null ? null : operation.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TeardownActionComponent)) - return false; - TeardownActionComponent o = (TeardownActionComponent) other; - return compareDeep(operation, o.operation, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TeardownActionComponent)) - return false; - TeardownActionComponent o = (TeardownActionComponent) other; - return true; - } - - public boolean isEmpty() { - return super.isEmpty() && (operation == null || operation.isEmpty()); - } - - public String fhirType() { - return "TestScript.teardown.action"; - - } - - } - - /** - * An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Absolute URL used to reference this TestScript", formalDefinition="An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published." ) - protected UriType url; - - /** - * The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually. - */ - @Child(name = "version", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical id for this version of the TestScript", formalDefinition="The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually." ) - protected StringType version; - - /** - * A free text natural language name identifying the TestScript. - */ - @Child(name = "name", type = {StringType.class}, order=2, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this TestScript", formalDefinition="A free text natural language name identifying the TestScript." ) - protected StringType name; - - /** - * The status of the TestScript. - */ - @Child(name = "status", type = {CodeType.class}, order=3, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the TestScript." ) - protected Enumeration status; - - /** - * Identifier for the TestScript assigned for external purposes outside the context of FHIR. - */ - @Child(name = "identifier", type = {Identifier.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="External identifier", formalDefinition="Identifier for the TestScript assigned for external purposes outside the context of FHIR." ) - protected Identifier identifier; - - /** - * This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the Test Script. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (Organization or individual)", formalDefinition="The name of the individual or organization that published the Test Script." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change. - */ - @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for this version of the TestScript", formalDefinition="The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change." ) - protected DateTimeType date; - - /** - * A free text natural language description of the TestScript and its use. - */ - @Child(name = "description", type = {StringType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Natural language description of the TestScript", formalDefinition="A free text natural language description of the TestScript and its use." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts." ) - protected List useContext; - - /** - * Explains why this Test Script is needed and why it's been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=11, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Scope and Usage this Test Script is for", formalDefinition="Explains why this Test Script is needed and why it's been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - @Child(name = "copyright", type = {StringType.class}, order=12, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings." ) - protected StringType copyright; - - /** - * An abstract server used in operations within this test script in the origin element. - */ - @Child(name = "origin", type = {}, order=13, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="An abstract server representing a client or sender in a message exchange", formalDefinition="An abstract server used in operations within this test script in the origin element." ) - protected List origin; - - /** - * An abstract server used in operations within this test script in the destination element. - */ - @Child(name = "destination", type = {}, order=14, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="An abstract server representing a destination or receiver in a message exchange", formalDefinition="An abstract server used in operations within this test script in the destination element." ) - protected List destination; - - /** - * The required capability must exist and are assumed to function correctly on the FHIR server being tested. - */ - @Child(name = "metadata", type = {}, order=15, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Required capability that is assumed to function correctly on the FHIR server being tested", formalDefinition="The required capability must exist and are assumed to function correctly on the FHIR server being tested." ) - protected TestScriptMetadataComponent metadata; - - /** - * Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. - */ - @Child(name = "fixture", type = {}, order=16, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Fixture in the test script - by reference (uri)", formalDefinition="Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute." ) - protected List fixture; - - /** - * Reference to the profile to be used for validation. - */ - @Child(name = "profile", type = {}, order=17, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Reference of the validation profile", formalDefinition="Reference to the profile to be used for validation." ) - protected List profile; - /** - * The actual objects that are the target of the reference (Reference to the profile to be used for validation.) - */ - protected List profileTarget; - - - /** - * Variable is set based either on element value in response body or on header field value in the response headers. - */ - @Child(name = "variable", type = {}, order=18, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Placeholder for evaluated elements", formalDefinition="Variable is set based either on element value in response body or on header field value in the response headers." ) - protected List variable; - - /** - * Assert rule to be used in one or more asserts within the test script. - */ - @Child(name = "rule", type = {}, order=19, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Assert rule used within the test script", formalDefinition="Assert rule to be used in one or more asserts within the test script." ) - protected List rule; - - /** - * Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied. - */ - @Child(name = "ruleset", type = {}, order=20, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Assert ruleset used within the test script", formalDefinition="Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied." ) - protected List ruleset; - - /** - * A series of required setup operations before tests are executed. - */ - @Child(name = "setup", type = {}, order=21, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="A series of required setup operations before tests are executed", formalDefinition="A series of required setup operations before tests are executed." ) - protected TestScriptSetupComponent setup; - - /** - * A test in this script. - */ - @Child(name = "test", type = {}, order=22, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A test in this script", formalDefinition="A test in this script." ) - protected List test; - - /** - * A series of operations required to clean up after the all the tests are executed (successfully or otherwise). - */ - @Child(name = "teardown", type = {}, order=23, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="A series of required clean up steps", formalDefinition="A series of operations required to clean up after the all the tests are executed (successfully or otherwise)." ) - protected TestScriptTeardownComponent teardown; - - private static final long serialVersionUID = -468958725L; - - /** - * Constructor - */ - public TestScript() { - super(); - } - - /** - * Constructor - */ - public TestScript(UriType url, StringType name, Enumeration status) { - super(); - this.url = url; - this.name = name; - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public TestScript setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published. - */ - public TestScript setUrl(String value) { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - return this; - } - - /** - * @return {@link #version} (The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public TestScript setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually. - */ - public TestScript setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name identifying the TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name identifying the TestScript.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public TestScript setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name identifying the TestScript. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name identifying the TestScript. - */ - public TestScript setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #status} (The status of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the TestScript.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public TestScript setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the TestScript. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the TestScript. - */ - public TestScript setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Identifier for the TestScript assigned for external purposes outside the context of FHIR.) - */ - public TestScript setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #experimental} (This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public TestScript setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public TestScript setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the Test Script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the Test Script.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public TestScript setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the Test Script. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the Test Script. - */ - public TestScript setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (TestScriptContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public TestScriptContactComponent addContact() { //3 - TestScriptContactComponent t = new TestScriptContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public TestScript addContact(TestScriptContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public TestScript setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change. - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change. - */ - public TestScript setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the TestScript and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the TestScript and its use.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public TestScript setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the TestScript and its use. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the TestScript and its use. - */ - public TestScript setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public TestScript addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #requirements} (Explains why this Test Script is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this Test Script is needed and why it's been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public TestScript setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this Test Script is needed and why it's been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this Test Script is needed and why it's been constrained as it has. - */ - public TestScript setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public TestScript setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings. - */ - public TestScript setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #origin} (An abstract server used in operations within this test script in the origin element.) - */ - public List getOrigin() { - if (this.origin == null) - this.origin = new ArrayList(); - return this.origin; - } - - public boolean hasOrigin() { - if (this.origin == null) - return false; - for (TestScriptOriginComponent item : this.origin) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #origin} (An abstract server used in operations within this test script in the origin element.) - */ - // syntactic sugar - public TestScriptOriginComponent addOrigin() { //3 - TestScriptOriginComponent t = new TestScriptOriginComponent(); - if (this.origin == null) - this.origin = new ArrayList(); - this.origin.add(t); - return t; - } - - // syntactic sugar - public TestScript addOrigin(TestScriptOriginComponent t) { //3 - if (t == null) - return this; - if (this.origin == null) - this.origin = new ArrayList(); - this.origin.add(t); - return this; - } - - /** - * @return {@link #destination} (An abstract server used in operations within this test script in the destination element.) - */ - public List getDestination() { - if (this.destination == null) - this.destination = new ArrayList(); - return this.destination; - } - - public boolean hasDestination() { - if (this.destination == null) - return false; - for (TestScriptDestinationComponent item : this.destination) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #destination} (An abstract server used in operations within this test script in the destination element.) - */ - // syntactic sugar - public TestScriptDestinationComponent addDestination() { //3 - TestScriptDestinationComponent t = new TestScriptDestinationComponent(); - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return t; - } - - // syntactic sugar - public TestScript addDestination(TestScriptDestinationComponent t) { //3 - if (t == null) - return this; - if (this.destination == null) - this.destination = new ArrayList(); - this.destination.add(t); - return this; - } - - /** - * @return {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public TestScriptMetadataComponent getMetadata() { - if (this.metadata == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.metadata"); - else if (Configuration.doAutoCreate()) - this.metadata = new TestScriptMetadataComponent(); // cc - return this.metadata; - } - - public boolean hasMetadata() { - return this.metadata != null && !this.metadata.isEmpty(); - } - - /** - * @param value {@link #metadata} (The required capability must exist and are assumed to function correctly on the FHIR server being tested.) - */ - public TestScript setMetadata(TestScriptMetadataComponent value) { - this.metadata = value; - return this; - } - - /** - * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.) - */ - public List getFixture() { - if (this.fixture == null) - this.fixture = new ArrayList(); - return this.fixture; - } - - public boolean hasFixture() { - if (this.fixture == null) - return false; - for (TestScriptFixtureComponent item : this.fixture) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #fixture} (Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.) - */ - // syntactic sugar - public TestScriptFixtureComponent addFixture() { //3 - TestScriptFixtureComponent t = new TestScriptFixtureComponent(); - if (this.fixture == null) - this.fixture = new ArrayList(); - this.fixture.add(t); - return t; - } - - // syntactic sugar - public TestScript addFixture(TestScriptFixtureComponent t) { //3 - if (t == null) - return this; - if (this.fixture == null) - this.fixture = new ArrayList(); - this.fixture.add(t); - return this; - } - - /** - * @return {@link #profile} (Reference to the profile to be used for validation.) - */ - public List getProfile() { - if (this.profile == null) - this.profile = new ArrayList(); - return this.profile; - } - - public boolean hasProfile() { - if (this.profile == null) - return false; - for (Reference item : this.profile) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #profile} (Reference to the profile to be used for validation.) - */ - // syntactic sugar - public Reference addProfile() { //3 - Reference t = new Reference(); - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return t; - } - - // syntactic sugar - public TestScript addProfile(Reference t) { //3 - if (t == null) - return this; - if (this.profile == null) - this.profile = new ArrayList(); - this.profile.add(t); - return this; - } - - /** - * @return {@link #profile} (The actual objects that are the target of the reference. The reference library doesn't populate this, but you can use this to hold the resources if you resolvethemt. Reference to the profile to be used for validation.) - */ - public List getProfileTarget() { - if (this.profileTarget == null) - this.profileTarget = new ArrayList(); - return this.profileTarget; - } - - /** - * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.) - */ - public List getVariable() { - if (this.variable == null) - this.variable = new ArrayList(); - return this.variable; - } - - public boolean hasVariable() { - if (this.variable == null) - return false; - for (TestScriptVariableComponent item : this.variable) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #variable} (Variable is set based either on element value in response body or on header field value in the response headers.) - */ - // syntactic sugar - public TestScriptVariableComponent addVariable() { //3 - TestScriptVariableComponent t = new TestScriptVariableComponent(); - if (this.variable == null) - this.variable = new ArrayList(); - this.variable.add(t); - return t; - } - - // syntactic sugar - public TestScript addVariable(TestScriptVariableComponent t) { //3 - if (t == null) - return this; - if (this.variable == null) - this.variable = new ArrayList(); - this.variable.add(t); - return this; - } - - /** - * @return {@link #rule} (Assert rule to be used in one or more asserts within the test script.) - */ - public List getRule() { - if (this.rule == null) - this.rule = new ArrayList(); - return this.rule; - } - - public boolean hasRule() { - if (this.rule == null) - return false; - for (TestScriptRuleComponent item : this.rule) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #rule} (Assert rule to be used in one or more asserts within the test script.) - */ - // syntactic sugar - public TestScriptRuleComponent addRule() { //3 - TestScriptRuleComponent t = new TestScriptRuleComponent(); - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return t; - } - - // syntactic sugar - public TestScript addRule(TestScriptRuleComponent t) { //3 - if (t == null) - return this; - if (this.rule == null) - this.rule = new ArrayList(); - this.rule.add(t); - return this; - } - - /** - * @return {@link #ruleset} (Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied.) - */ - public List getRuleset() { - if (this.ruleset == null) - this.ruleset = new ArrayList(); - return this.ruleset; - } - - public boolean hasRuleset() { - if (this.ruleset == null) - return false; - for (TestScriptRulesetComponent item : this.ruleset) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #ruleset} (Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied.) - */ - // syntactic sugar - public TestScriptRulesetComponent addRuleset() { //3 - TestScriptRulesetComponent t = new TestScriptRulesetComponent(); - if (this.ruleset == null) - this.ruleset = new ArrayList(); - this.ruleset.add(t); - return t; - } - - // syntactic sugar - public TestScript addRuleset(TestScriptRulesetComponent t) { //3 - if (t == null) - return this; - if (this.ruleset == null) - this.ruleset = new ArrayList(); - this.ruleset.add(t); - return this; - } - - /** - * @return {@link #setup} (A series of required setup operations before tests are executed.) - */ - public TestScriptSetupComponent getSetup() { - if (this.setup == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.setup"); - else if (Configuration.doAutoCreate()) - this.setup = new TestScriptSetupComponent(); // cc - return this.setup; - } - - public boolean hasSetup() { - return this.setup != null && !this.setup.isEmpty(); - } - - /** - * @param value {@link #setup} (A series of required setup operations before tests are executed.) - */ - public TestScript setSetup(TestScriptSetupComponent value) { - this.setup = value; - return this; - } - - /** - * @return {@link #test} (A test in this script.) - */ - public List getTest() { - if (this.test == null) - this.test = new ArrayList(); - return this.test; - } - - public boolean hasTest() { - if (this.test == null) - return false; - for (TestScriptTestComponent item : this.test) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #test} (A test in this script.) - */ - // syntactic sugar - public TestScriptTestComponent addTest() { //3 - TestScriptTestComponent t = new TestScriptTestComponent(); - if (this.test == null) - this.test = new ArrayList(); - this.test.add(t); - return t; - } - - // syntactic sugar - public TestScript addTest(TestScriptTestComponent t) { //3 - if (t == null) - return this; - if (this.test == null) - this.test = new ArrayList(); - this.test.add(t); - return this; - } - - /** - * @return {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).) - */ - public TestScriptTeardownComponent getTeardown() { - if (this.teardown == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TestScript.teardown"); - else if (Configuration.doAutoCreate()) - this.teardown = new TestScriptTeardownComponent(); // cc - return this.teardown; - } - - public boolean hasTeardown() { - return this.teardown != null && !this.teardown.isEmpty(); - } - - /** - * @param value {@link #teardown} (A series of operations required to clean up after the all the tests are executed (successfully or otherwise).) - */ - public TestScript setTeardown(TestScriptTeardownComponent value) { - this.teardown = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this Test Script. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this Test Script is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("version", "string", "The identifier that is used to identify this version of the TestScript. This is an arbitrary value managed by the TestScript author manually.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name identifying the TestScript.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the TestScript.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("identifier", "Identifier", "Identifier for the TestScript assigned for external purposes outside the context of FHIR.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("experimental", "boolean", "This TestScript was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the Test Script.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date this version of the test tcript was published. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the test cases change.", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("description", "string", "A free text natural language description of the TestScript and its use.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of Test Scripts.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("requirements", "string", "Explains why this Test Script is needed and why it's been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the Test Script and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the details of the constraints and mappings.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("origin", "", "An abstract server used in operations within this test script in the origin element.", 0, java.lang.Integer.MAX_VALUE, origin)); - childrenList.add(new Property("destination", "", "An abstract server used in operations within this test script in the destination element.", 0, java.lang.Integer.MAX_VALUE, destination)); - childrenList.add(new Property("metadata", "", "The required capability must exist and are assumed to function correctly on the FHIR server being tested.", 0, java.lang.Integer.MAX_VALUE, metadata)); - childrenList.add(new Property("fixture", "", "Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute.", 0, java.lang.Integer.MAX_VALUE, fixture)); - childrenList.add(new Property("profile", "Reference(Any)", "Reference to the profile to be used for validation.", 0, java.lang.Integer.MAX_VALUE, profile)); - childrenList.add(new Property("variable", "", "Variable is set based either on element value in response body or on header field value in the response headers.", 0, java.lang.Integer.MAX_VALUE, variable)); - childrenList.add(new Property("rule", "", "Assert rule to be used in one or more asserts within the test script.", 0, java.lang.Integer.MAX_VALUE, rule)); - childrenList.add(new Property("ruleset", "", "Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them all applied.", 0, java.lang.Integer.MAX_VALUE, ruleset)); - childrenList.add(new Property("setup", "", "A series of required setup operations before tests are executed.", 0, java.lang.Integer.MAX_VALUE, setup)); - childrenList.add(new Property("test", "", "A test in this script.", 0, java.lang.Integer.MAX_VALUE, test)); - childrenList.add(new Property("teardown", "", "A series of operations required to clean up after the all the tests are executed (successfully or otherwise).", 0, java.lang.Integer.MAX_VALUE, teardown)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // TestScriptContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case -1008619738: /*origin*/ return this.origin == null ? new Base[0] : this.origin.toArray(new Base[this.origin.size()]); // TestScriptOriginComponent - case -1429847026: /*destination*/ return this.destination == null ? new Base[0] : this.destination.toArray(new Base[this.destination.size()]); // TestScriptDestinationComponent - case -450004177: /*metadata*/ return this.metadata == null ? new Base[0] : new Base[] {this.metadata}; // TestScriptMetadataComponent - case -843449847: /*fixture*/ return this.fixture == null ? new Base[0] : this.fixture.toArray(new Base[this.fixture.size()]); // TestScriptFixtureComponent - case -309425751: /*profile*/ return this.profile == null ? new Base[0] : this.profile.toArray(new Base[this.profile.size()]); // Reference - case -1249586564: /*variable*/ return this.variable == null ? new Base[0] : this.variable.toArray(new Base[this.variable.size()]); // TestScriptVariableComponent - case 3512060: /*rule*/ return this.rule == null ? new Base[0] : this.rule.toArray(new Base[this.rule.size()]); // TestScriptRuleComponent - case 1548678118: /*ruleset*/ return this.ruleset == null ? new Base[0] : this.ruleset.toArray(new Base[this.ruleset.size()]); // TestScriptRulesetComponent - case 109329021: /*setup*/ return this.setup == null ? new Base[0] : new Base[] {this.setup}; // TestScriptSetupComponent - case 3556498: /*test*/ return this.test == null ? new Base[0] : this.test.toArray(new Base[this.test.size()]); // TestScriptTestComponent - case -1663474172: /*teardown*/ return this.teardown == null ? new Base[0] : new Base[] {this.teardown}; // TestScriptTeardownComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((TestScriptContactComponent) value); // TestScriptContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case -1008619738: // origin - this.getOrigin().add((TestScriptOriginComponent) value); // TestScriptOriginComponent - break; - case -1429847026: // destination - this.getDestination().add((TestScriptDestinationComponent) value); // TestScriptDestinationComponent - break; - case -450004177: // metadata - this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent - break; - case -843449847: // fixture - this.getFixture().add((TestScriptFixtureComponent) value); // TestScriptFixtureComponent - break; - case -309425751: // profile - this.getProfile().add(castToReference(value)); // Reference - break; - case -1249586564: // variable - this.getVariable().add((TestScriptVariableComponent) value); // TestScriptVariableComponent - break; - case 3512060: // rule - this.getRule().add((TestScriptRuleComponent) value); // TestScriptRuleComponent - break; - case 1548678118: // ruleset - this.getRuleset().add((TestScriptRulesetComponent) value); // TestScriptRulesetComponent - break; - case 109329021: // setup - this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent - break; - case 3556498: // test - this.getTest().add((TestScriptTestComponent) value); // TestScriptTestComponent - break; - case -1663474172: // teardown - this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((TestScriptContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("origin")) - this.getOrigin().add((TestScriptOriginComponent) value); - else if (name.equals("destination")) - this.getDestination().add((TestScriptDestinationComponent) value); - else if (name.equals("metadata")) - this.metadata = (TestScriptMetadataComponent) value; // TestScriptMetadataComponent - else if (name.equals("fixture")) - this.getFixture().add((TestScriptFixtureComponent) value); - else if (name.equals("profile")) - this.getProfile().add(castToReference(value)); - else if (name.equals("variable")) - this.getVariable().add((TestScriptVariableComponent) value); - else if (name.equals("rule")) - this.getRule().add((TestScriptRuleComponent) value); - else if (name.equals("ruleset")) - this.getRuleset().add((TestScriptRulesetComponent) value); - else if (name.equals("setup")) - this.setup = (TestScriptSetupComponent) value; // TestScriptSetupComponent - else if (name.equals("test")) - this.getTest().add((TestScriptTestComponent) value); - else if (name.equals("teardown")) - this.teardown = (TestScriptTeardownComponent) value; // TestScriptTeardownComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -1618432855: return getIdentifier(); // Identifier - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // TestScriptContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case -1008619738: return addOrigin(); // TestScriptOriginComponent - case -1429847026: return addDestination(); // TestScriptDestinationComponent - case -450004177: return getMetadata(); // TestScriptMetadataComponent - case -843449847: return addFixture(); // TestScriptFixtureComponent - case -309425751: return addProfile(); // Reference - case -1249586564: return addVariable(); // TestScriptVariableComponent - case 3512060: return addRule(); // TestScriptRuleComponent - case 1548678118: return addRuleset(); // TestScriptRulesetComponent - case 109329021: return getSetup(); // TestScriptSetupComponent - case 3556498: return addTest(); // TestScriptTestComponent - case -1663474172: return getTeardown(); // TestScriptTeardownComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.url"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.status"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.date"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type TestScript.copyright"); - } - else if (name.equals("origin")) { - return addOrigin(); - } - else if (name.equals("destination")) { - return addDestination(); - } - else if (name.equals("metadata")) { - this.metadata = new TestScriptMetadataComponent(); - return this.metadata; - } - else if (name.equals("fixture")) { - return addFixture(); - } - else if (name.equals("profile")) { - return addProfile(); - } - else if (name.equals("variable")) { - return addVariable(); - } - else if (name.equals("rule")) { - return addRule(); - } - else if (name.equals("ruleset")) { - return addRuleset(); - } - else if (name.equals("setup")) { - this.setup = new TestScriptSetupComponent(); - return this.setup; - } - else if (name.equals("test")) { - return addTest(); - } - else if (name.equals("teardown")) { - this.teardown = new TestScriptTeardownComponent(); - return this.teardown; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "TestScript"; - - } - - public TestScript copy() { - TestScript dst = new TestScript(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (TestScriptContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - if (origin != null) { - dst.origin = new ArrayList(); - for (TestScriptOriginComponent i : origin) - dst.origin.add(i.copy()); - }; - if (destination != null) { - dst.destination = new ArrayList(); - for (TestScriptDestinationComponent i : destination) - dst.destination.add(i.copy()); - }; - dst.metadata = metadata == null ? null : metadata.copy(); - if (fixture != null) { - dst.fixture = new ArrayList(); - for (TestScriptFixtureComponent i : fixture) - dst.fixture.add(i.copy()); - }; - if (profile != null) { - dst.profile = new ArrayList(); - for (Reference i : profile) - dst.profile.add(i.copy()); - }; - if (variable != null) { - dst.variable = new ArrayList(); - for (TestScriptVariableComponent i : variable) - dst.variable.add(i.copy()); - }; - if (rule != null) { - dst.rule = new ArrayList(); - for (TestScriptRuleComponent i : rule) - dst.rule.add(i.copy()); - }; - if (ruleset != null) { - dst.ruleset = new ArrayList(); - for (TestScriptRulesetComponent i : ruleset) - dst.ruleset.add(i.copy()); - }; - dst.setup = setup == null ? null : setup.copy(); - if (test != null) { - dst.test = new ArrayList(); - for (TestScriptTestComponent i : test) - dst.test.add(i.copy()); - }; - dst.teardown = teardown == null ? null : teardown.copy(); - return dst; - } - - protected TestScript typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TestScript)) - return false; - TestScript o = (TestScript) other; - return compareDeep(url, o.url, true) && compareDeep(version, o.version, true) && compareDeep(name, o.name, true) - && compareDeep(status, o.status, true) && compareDeep(identifier, o.identifier, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) - && compareDeep(description, o.description, true) && compareDeep(useContext, o.useContext, true) - && compareDeep(requirements, o.requirements, true) && compareDeep(copyright, o.copyright, true) - && compareDeep(origin, o.origin, true) && compareDeep(destination, o.destination, true) && compareDeep(metadata, o.metadata, true) - && compareDeep(fixture, o.fixture, true) && compareDeep(profile, o.profile, true) && compareDeep(variable, o.variable, true) - && compareDeep(rule, o.rule, true) && compareDeep(ruleset, o.ruleset, true) && compareDeep(setup, o.setup, true) - && compareDeep(test, o.test, true) && compareDeep(teardown, o.teardown, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TestScript)) - return false; - TestScript o = (TestScript) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(description, o.description, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (version == null || version.isEmpty()) - && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (description == null || description.isEmpty()) - && (useContext == null || useContext.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (origin == null || origin.isEmpty()) && (destination == null || destination.isEmpty()) - && (metadata == null || metadata.isEmpty()) && (fixture == null || fixture.isEmpty()) && (profile == null || profile.isEmpty()) - && (variable == null || variable.isEmpty()) && (rule == null || rule.isEmpty()) && (ruleset == null || ruleset.isEmpty()) - && (setup == null || setup.isEmpty()) && (test == null || test.isEmpty()) && (teardown == null || teardown.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.TestScript; - } - - /** - * Search parameter: testscript-test-capability - *

- * Description: TestScript test required and validated capability
- * Type: string
- * Path: TestScript.test.metadata.capability.description
- *

- */ - @SearchParamDefinition(name="testscript-test-capability", path="TestScript.test.metadata.capability.description", description="TestScript test required and validated capability", type="string" ) - public static final String SP_TESTSCRIPT_TEST_CAPABILITY = "testscript-test-capability"; - /** - * Fluent Client search parameter constant for testscript-test-capability - *

- * Description: TestScript test required and validated capability
- * Type: string
- * Path: TestScript.test.metadata.capability.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_TEST_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_TEST_CAPABILITY); - - /** - * Search parameter: testscript-setup-capability - *

- * Description: TestScript setup required and validated capability
- * Type: string
- * Path: TestScript.setup.metadata.capability.description
- *

- */ - @SearchParamDefinition(name="testscript-setup-capability", path="TestScript.setup.metadata.capability.description", description="TestScript setup required and validated capability", type="string" ) - public static final String SP_TESTSCRIPT_SETUP_CAPABILITY = "testscript-setup-capability"; - /** - * Fluent Client search parameter constant for testscript-setup-capability - *

- * Description: TestScript setup required and validated capability
- * Type: string
- * Path: TestScript.setup.metadata.capability.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_SETUP_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_SETUP_CAPABILITY); - - /** - * Search parameter: description - *

- * Description: Natural language description of the TestScript
- * Type: string
- * Path: TestScript.description
- *

- */ - @SearchParamDefinition(name="description", path="TestScript.description", description="Natural language description of the TestScript", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

- * Description: Natural language description of the TestScript
- * Type: string
- * Path: TestScript.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

- * Description: Informal name for this TestScript
- * Type: string
- * Path: TestScript.name
- *

- */ - @SearchParamDefinition(name="name", path="TestScript.name", description="Informal name for this TestScript", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

- * Description: Informal name for this TestScript
- * Type: string
- * Path: TestScript.name
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: testscript-capability - *

- * Description: TestScript required and validated capability
- * Type: string
- * Path: TestScript.metadata.capability.description
- *

- */ - @SearchParamDefinition(name="testscript-capability", path="TestScript.metadata.capability.description", description="TestScript required and validated capability", type="string" ) - public static final String SP_TESTSCRIPT_CAPABILITY = "testscript-capability"; - /** - * Fluent Client search parameter constant for testscript-capability - *

- * Description: TestScript required and validated capability
- * Type: string
- * Path: TestScript.metadata.capability.description
- *

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam TESTSCRIPT_CAPABILITY = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_TESTSCRIPT_CAPABILITY); - - /** - * Search parameter: identifier - *

- * Description: External identifier
- * Type: token
- * Path: TestScript.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="TestScript.identifier", description="External identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: External identifier
- * Type: token
- * Path: TestScript.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: url - *

- * Description: Absolute URL used to reference this TestScript
- * Type: uri
- * Path: TestScript.url
- *

- */ - @SearchParamDefinition(name="url", path="TestScript.url", description="Absolute URL used to reference this TestScript", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: Absolute URL used to reference this TestScript
- * Type: uri
- * Path: TestScript.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TimeType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TimeType.java deleted file mode 100644 index de1c686a69b..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TimeType.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -package org.hl7.fhir.dstu2016may.model; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * 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] - */ -@DatatypeDef(name="time") -public class TimeType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public TimeType() { - // nothing - } - - /** - * Constructor - */ - public TimeType(String theValue) { - setValue(theValue); - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - @Override - public TimeType copy() { - return new TimeType(getValue()); - } - - public String fhirType() { - return "time"; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Timing.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Timing.java deleted file mode 100644 index 7db4d6e7243..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Timing.java +++ /dev/null @@ -1,1811 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseDatatypeElement; -import org.hl7.fhir.instance.model.api.ICompositeType; - -import ca.uhn.fhir.model.api.annotation.Block; -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning care of various kinds. - */ -@DatatypeDef(name="Timing") -public class Timing extends Type implements ICompositeType { - - public enum UnitsOfTime { - /** - * null - */ - S, - /** - * null - */ - MIN, - /** - * null - */ - H, - /** - * null - */ - D, - /** - * null - */ - WK, - /** - * null - */ - MO, - /** - * null - */ - A, - /** - * added to help the parsers - */ - NULL; - public static UnitsOfTime fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return S; - if ("min".equals(codeString)) - return MIN; - if ("h".equals(codeString)) - return H; - if ("d".equals(codeString)) - return D; - if ("wk".equals(codeString)) - return WK; - if ("mo".equals(codeString)) - return MO; - if ("a".equals(codeString)) - return A; - throw new FHIRException("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case S: return "s"; - case MIN: return "min"; - case H: return "h"; - case D: return "d"; - case WK: return "wk"; - case MO: return "mo"; - case A: return "a"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case S: return "http://unitsofmeasure.org"; - case MIN: return "http://unitsofmeasure.org"; - case H: return "http://unitsofmeasure.org"; - case D: return "http://unitsofmeasure.org"; - case WK: return "http://unitsofmeasure.org"; - case MO: return "http://unitsofmeasure.org"; - case A: return "http://unitsofmeasure.org"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case S: return ""; - case MIN: return ""; - case H: return ""; - case D: return ""; - case WK: return ""; - case MO: return ""; - case A: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case S: return "s"; - case MIN: return "min"; - case H: return "h"; - case D: return "d"; - case WK: return "wk"; - case MO: return "mo"; - case A: return "a"; - default: return "?"; - } - } - } - - public static class UnitsOfTimeEnumFactory implements EnumFactory { - public UnitsOfTime fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return UnitsOfTime.S; - if ("min".equals(codeString)) - return UnitsOfTime.MIN; - if ("h".equals(codeString)) - return UnitsOfTime.H; - if ("d".equals(codeString)) - return UnitsOfTime.D; - if ("wk".equals(codeString)) - return UnitsOfTime.WK; - if ("mo".equals(codeString)) - return UnitsOfTime.MO; - if ("a".equals(codeString)) - return UnitsOfTime.A; - throw new IllegalArgumentException("Unknown UnitsOfTime code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("s".equals(codeString)) - return new Enumeration(this, UnitsOfTime.S); - if ("min".equals(codeString)) - return new Enumeration(this, UnitsOfTime.MIN); - if ("h".equals(codeString)) - return new Enumeration(this, UnitsOfTime.H); - if ("d".equals(codeString)) - return new Enumeration(this, UnitsOfTime.D); - if ("wk".equals(codeString)) - return new Enumeration(this, UnitsOfTime.WK); - if ("mo".equals(codeString)) - return new Enumeration(this, UnitsOfTime.MO); - if ("a".equals(codeString)) - return new Enumeration(this, UnitsOfTime.A); - throw new FHIRException("Unknown UnitsOfTime code '"+codeString+"'"); - } - public String toCode(UnitsOfTime code) { - if (code == UnitsOfTime.S) - return "s"; - if (code == UnitsOfTime.MIN) - return "min"; - if (code == UnitsOfTime.H) - return "h"; - if (code == UnitsOfTime.D) - return "d"; - if (code == UnitsOfTime.WK) - return "wk"; - if (code == UnitsOfTime.MO) - return "mo"; - if (code == UnitsOfTime.A) - return "a"; - return "?"; - } - public String toSystem(UnitsOfTime code) { - return code.getSystem(); - } - } - - public enum EventTiming { - /** - * null - */ - HS, - /** - * null - */ - WAKE, - /** - * null - */ - C, - /** - * null - */ - CM, - /** - * null - */ - CD, - /** - * null - */ - CV, - /** - * null - */ - AC, - /** - * null - */ - ACM, - /** - * null - */ - ACD, - /** - * null - */ - ACV, - /** - * null - */ - PC, - /** - * null - */ - PCM, - /** - * null - */ - PCD, - /** - * null - */ - PCV, - /** - * added to help the parsers - */ - NULL; - public static EventTiming fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return HS; - if ("WAKE".equals(codeString)) - return WAKE; - if ("C".equals(codeString)) - return C; - if ("CM".equals(codeString)) - return CM; - if ("CD".equals(codeString)) - return CD; - if ("CV".equals(codeString)) - return CV; - if ("AC".equals(codeString)) - return AC; - if ("ACM".equals(codeString)) - return ACM; - if ("ACD".equals(codeString)) - return ACD; - if ("ACV".equals(codeString)) - return ACV; - if ("PC".equals(codeString)) - return PC; - if ("PCM".equals(codeString)) - return PCM; - if ("PCD".equals(codeString)) - return PCD; - if ("PCV".equals(codeString)) - return PCV; - throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case HS: return "HS"; - case WAKE: return "WAKE"; - case C: return "C"; - case CM: return "CM"; - case CD: return "CD"; - case CV: return "CV"; - case AC: return "AC"; - case ACM: return "ACM"; - case ACD: return "ACD"; - case ACV: return "ACV"; - case PC: return "PC"; - case PCM: return "PCM"; - case PCD: return "PCD"; - case PCV: return "PCV"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case HS: return "http://hl7.org/fhir/v3/TimingEvent"; - case WAKE: return "http://hl7.org/fhir/v3/TimingEvent"; - case C: return "http://hl7.org/fhir/v3/TimingEvent"; - case CM: return "http://hl7.org/fhir/v3/TimingEvent"; - case CD: return "http://hl7.org/fhir/v3/TimingEvent"; - case CV: return "http://hl7.org/fhir/v3/TimingEvent"; - case AC: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACM: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACD: return "http://hl7.org/fhir/v3/TimingEvent"; - case ACV: return "http://hl7.org/fhir/v3/TimingEvent"; - case PC: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCM: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCD: return "http://hl7.org/fhir/v3/TimingEvent"; - case PCV: return "http://hl7.org/fhir/v3/TimingEvent"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case HS: return ""; - case WAKE: return ""; - case C: return ""; - case CM: return ""; - case CD: return ""; - case CV: return ""; - case AC: return ""; - case ACM: return ""; - case ACD: return ""; - case ACV: return ""; - case PC: return ""; - case PCM: return ""; - case PCD: return ""; - case PCV: return ""; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case HS: return "HS"; - case WAKE: return "WAKE"; - case C: return "C"; - case CM: return "CM"; - case CD: return "CD"; - case CV: return "CV"; - case AC: return "AC"; - case ACM: return "ACM"; - case ACD: return "ACD"; - case ACV: return "ACV"; - case PC: return "PC"; - case PCM: return "PCM"; - case PCD: return "PCD"; - case PCV: return "PCV"; - default: return "?"; - } - } - } - - public static class EventTimingEnumFactory implements EnumFactory { - public EventTiming fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return EventTiming.HS; - if ("WAKE".equals(codeString)) - return EventTiming.WAKE; - if ("C".equals(codeString)) - return EventTiming.C; - if ("CM".equals(codeString)) - return EventTiming.CM; - if ("CD".equals(codeString)) - return EventTiming.CD; - if ("CV".equals(codeString)) - return EventTiming.CV; - if ("AC".equals(codeString)) - return EventTiming.AC; - if ("ACM".equals(codeString)) - return EventTiming.ACM; - if ("ACD".equals(codeString)) - return EventTiming.ACD; - if ("ACV".equals(codeString)) - return EventTiming.ACV; - if ("PC".equals(codeString)) - return EventTiming.PC; - if ("PCM".equals(codeString)) - return EventTiming.PCM; - if ("PCD".equals(codeString)) - return EventTiming.PCD; - if ("PCV".equals(codeString)) - return EventTiming.PCV; - throw new IllegalArgumentException("Unknown EventTiming code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("HS".equals(codeString)) - return new Enumeration(this, EventTiming.HS); - if ("WAKE".equals(codeString)) - return new Enumeration(this, EventTiming.WAKE); - if ("C".equals(codeString)) - return new Enumeration(this, EventTiming.C); - if ("CM".equals(codeString)) - return new Enumeration(this, EventTiming.CM); - if ("CD".equals(codeString)) - return new Enumeration(this, EventTiming.CD); - if ("CV".equals(codeString)) - return new Enumeration(this, EventTiming.CV); - if ("AC".equals(codeString)) - return new Enumeration(this, EventTiming.AC); - if ("ACM".equals(codeString)) - return new Enumeration(this, EventTiming.ACM); - if ("ACD".equals(codeString)) - return new Enumeration(this, EventTiming.ACD); - if ("ACV".equals(codeString)) - return new Enumeration(this, EventTiming.ACV); - if ("PC".equals(codeString)) - return new Enumeration(this, EventTiming.PC); - if ("PCM".equals(codeString)) - return new Enumeration(this, EventTiming.PCM); - if ("PCD".equals(codeString)) - return new Enumeration(this, EventTiming.PCD); - if ("PCV".equals(codeString)) - return new Enumeration(this, EventTiming.PCV); - throw new FHIRException("Unknown EventTiming code '"+codeString+"'"); - } - public String toCode(EventTiming code) { - if (code == EventTiming.HS) - return "HS"; - if (code == EventTiming.WAKE) - return "WAKE"; - if (code == EventTiming.C) - return "C"; - if (code == EventTiming.CM) - return "CM"; - if (code == EventTiming.CD) - return "CD"; - if (code == EventTiming.CV) - return "CV"; - if (code == EventTiming.AC) - return "AC"; - if (code == EventTiming.ACM) - return "ACM"; - if (code == EventTiming.ACD) - return "ACD"; - if (code == EventTiming.ACV) - return "ACV"; - if (code == EventTiming.PC) - return "PC"; - if (code == EventTiming.PCM) - return "PCM"; - if (code == EventTiming.PCD) - return "PCD"; - if (code == EventTiming.PCV) - return "PCV"; - return "?"; - } - public String toSystem(EventTiming code) { - return code.getSystem(); - } - } - - @Block() - public static class TimingRepeatComponent extends Element implements IBaseDatatypeElement { - /** - * Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule. - */ - @Child(name = "bounds", type = {Duration.class, Range.class, Period.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Length/Range of lengths, or (Start and/or end) limits", formalDefinition="Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule." ) - protected Type bounds; - - /** - * A total count of the desired number of repetitions. - */ - @Child(name = "count", type = {IntegerType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Number of times to repeat", formalDefinition="A total count of the desired number of repetitions." ) - protected IntegerType count; - - /** - * A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). - */ - @Child(name = "countMax", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Maximum number of times to repeat", formalDefinition="A maximum value for the count of the desired repetitions (e.g. do something 6-8 times)." ) - protected IntegerType countMax; - - /** - * How long this thing happens for when it happens. - */ - @Child(name = "duration", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How long when it happens", formalDefinition="How long this thing happens for when it happens." ) - protected DecimalType duration; - - /** - * The upper limit of how long this thing happens for when it happens. - */ - @Child(name = "durationMax", type = {DecimalType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="How long when it happens (Max)", formalDefinition="The upper limit of how long this thing happens for when it happens." ) - protected DecimalType durationMax; - - /** - * The units of time for the duration, in UCUM units. - */ - @Child(name = "durationUnit", type = {CodeType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the duration, in UCUM units." ) - protected Enumeration durationUnit; - - /** - * The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). - */ - @Child(name = "frequency", type = {IntegerType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided)." ) - protected IntegerType frequency; - - /** - * If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. - */ - @Child(name = "frequencyMax", type = {IntegerType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Event occurs up to frequencyMax times per period", formalDefinition="If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range." ) - protected IntegerType frequencyMax; - - /** - * Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - @Child(name = "period", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Event occurs frequency times per period", formalDefinition="Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period." ) - protected DecimalType period; - - /** - * If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - @Child(name = "periodMax", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Upper limit of period (3-4 hours)", formalDefinition="If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days." ) - protected DecimalType periodMax; - - /** - * The units of time for the period in UCUM units. - */ - @Child(name = "periodUnit", type = {CodeType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="s | min | h | d | wk | mo | a - unit of time (UCUM)", formalDefinition="The units of time for the period in UCUM units." ) - protected Enumeration periodUnit; - - /** - * A real world event that the occurrence of the event should be tied to. - */ - @Child(name = "when", type = {CodeType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Regular life events the event is tied to", formalDefinition="A real world event that the occurrence of the event should be tied to." ) - protected Enumeration when; - - /** - * The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. - */ - @Child(name = "offset", type = {UnsignedIntType.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Minutes from event (before or after)", formalDefinition="The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event." ) - protected UnsignedIntType offset; - - private static final long serialVersionUID = -1317919984L; - - /** - * Constructor - */ - public TimingRepeatComponent() { - super(); - } - - /** - * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) - */ - public Type getBounds() { - return this.bounds; - } - - /** - * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) - */ - public Duration getBoundsDuration() throws FHIRException { - if (!(this.bounds instanceof Duration)) - throw new FHIRException("Type mismatch: the type Duration was expected, but "+this.bounds.getClass().getName()+" was encountered"); - return (Duration) this.bounds; - } - - public boolean hasBoundsDuration() { - return this.bounds instanceof Duration; - } - - /** - * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) - */ - public Range getBoundsRange() throws FHIRException { - if (!(this.bounds instanceof Range)) - throw new FHIRException("Type mismatch: the type Range was expected, but "+this.bounds.getClass().getName()+" was encountered"); - return (Range) this.bounds; - } - - public boolean hasBoundsRange() { - return this.bounds instanceof Range; - } - - /** - * @return {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) - */ - public Period getBoundsPeriod() throws FHIRException { - if (!(this.bounds instanceof Period)) - throw new FHIRException("Type mismatch: the type Period was expected, but "+this.bounds.getClass().getName()+" was encountered"); - return (Period) this.bounds; - } - - public boolean hasBoundsPeriod() { - return this.bounds instanceof Period; - } - - public boolean hasBounds() { - return this.bounds != null && !this.bounds.isEmpty(); - } - - /** - * @param value {@link #bounds} (Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.) - */ - public TimingRepeatComponent setBounds(Type value) { - this.bounds = value; - return this; - } - - /** - * @return {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public IntegerType getCountElement() { - if (this.count == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.count"); - else if (Configuration.doAutoCreate()) - this.count = new IntegerType(); // bb - return this.count; - } - - public boolean hasCountElement() { - return this.count != null && !this.count.isEmpty(); - } - - public boolean hasCount() { - return this.count != null && !this.count.isEmpty(); - } - - /** - * @param value {@link #count} (A total count of the desired number of repetitions.). This is the underlying object with id, value and extensions. The accessor "getCount" gives direct access to the value - */ - public TimingRepeatComponent setCountElement(IntegerType value) { - this.count = value; - return this; - } - - /** - * @return A total count of the desired number of repetitions. - */ - public int getCount() { - return this.count == null || this.count.isEmpty() ? 0 : this.count.getValue(); - } - - /** - * @param value A total count of the desired number of repetitions. - */ - public TimingRepeatComponent setCount(int value) { - if (this.count == null) - this.count = new IntegerType(); - this.count.setValue(value); - return this; - } - - /** - * @return {@link #countMax} (A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).). This is the underlying object with id, value and extensions. The accessor "getCountMax" gives direct access to the value - */ - public IntegerType getCountMaxElement() { - if (this.countMax == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.countMax"); - else if (Configuration.doAutoCreate()) - this.countMax = new IntegerType(); // bb - return this.countMax; - } - - public boolean hasCountMaxElement() { - return this.countMax != null && !this.countMax.isEmpty(); - } - - public boolean hasCountMax() { - return this.countMax != null && !this.countMax.isEmpty(); - } - - /** - * @param value {@link #countMax} (A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).). This is the underlying object with id, value and extensions. The accessor "getCountMax" gives direct access to the value - */ - public TimingRepeatComponent setCountMaxElement(IntegerType value) { - this.countMax = value; - return this; - } - - /** - * @return A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). - */ - public int getCountMax() { - return this.countMax == null || this.countMax.isEmpty() ? 0 : this.countMax.getValue(); - } - - /** - * @param value A maximum value for the count of the desired repetitions (e.g. do something 6-8 times). - */ - public TimingRepeatComponent setCountMax(int value) { - if (this.countMax == null) - this.countMax = new IntegerType(); - this.countMax.setValue(value); - return this; - } - - /** - * @return {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public DecimalType getDurationElement() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new DecimalType(); // bb - return this.duration; - } - - public boolean hasDurationElement() { - return this.duration != null && !this.duration.isEmpty(); - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (How long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDuration" gives direct access to the value - */ - public TimingRepeatComponent setDurationElement(DecimalType value) { - this.duration = value; - return this; - } - - /** - * @return How long this thing happens for when it happens. - */ - public BigDecimal getDuration() { - return this.duration == null ? null : this.duration.getValue(); - } - - /** - * @param value How long this thing happens for when it happens. - */ - public TimingRepeatComponent setDuration(BigDecimal value) { - if (value == null) - this.duration = null; - else { - if (this.duration == null) - this.duration = new DecimalType(); - this.duration.setValue(value); - } - return this; - } - - /** - * @param value How long this thing happens for when it happens. - */ - public TimingRepeatComponent setDuration(long value) { - this.duration = new DecimalType(); - this.duration.setValue(value); - return this; - } - - /** - * @param value How long this thing happens for when it happens. - */ - public TimingRepeatComponent setDuration(double value) { - this.duration = new DecimalType(); - this.duration.setValue(value); - return this; - } - - /** - * @return {@link #durationMax} (The upper limit of how long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDurationMax" gives direct access to the value - */ - public DecimalType getDurationMaxElement() { - if (this.durationMax == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.durationMax"); - else if (Configuration.doAutoCreate()) - this.durationMax = new DecimalType(); // bb - return this.durationMax; - } - - public boolean hasDurationMaxElement() { - return this.durationMax != null && !this.durationMax.isEmpty(); - } - - public boolean hasDurationMax() { - return this.durationMax != null && !this.durationMax.isEmpty(); - } - - /** - * @param value {@link #durationMax} (The upper limit of how long this thing happens for when it happens.). This is the underlying object with id, value and extensions. The accessor "getDurationMax" gives direct access to the value - */ - public TimingRepeatComponent setDurationMaxElement(DecimalType value) { - this.durationMax = value; - return this; - } - - /** - * @return The upper limit of how long this thing happens for when it happens. - */ - public BigDecimal getDurationMax() { - return this.durationMax == null ? null : this.durationMax.getValue(); - } - - /** - * @param value The upper limit of how long this thing happens for when it happens. - */ - public TimingRepeatComponent setDurationMax(BigDecimal value) { - if (value == null) - this.durationMax = null; - else { - if (this.durationMax == null) - this.durationMax = new DecimalType(); - this.durationMax.setValue(value); - } - return this; - } - - /** - * @param value The upper limit of how long this thing happens for when it happens. - */ - public TimingRepeatComponent setDurationMax(long value) { - this.durationMax = new DecimalType(); - this.durationMax.setValue(value); - return this; - } - - /** - * @param value The upper limit of how long this thing happens for when it happens. - */ - public TimingRepeatComponent setDurationMax(double value) { - this.durationMax = new DecimalType(); - this.durationMax.setValue(value); - return this; - } - - /** - * @return {@link #durationUnit} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnit" gives direct access to the value - */ - public Enumeration getDurationUnitElement() { - if (this.durationUnit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.durationUnit"); - else if (Configuration.doAutoCreate()) - this.durationUnit = new Enumeration(new UnitsOfTimeEnumFactory()); // bb - return this.durationUnit; - } - - public boolean hasDurationUnitElement() { - return this.durationUnit != null && !this.durationUnit.isEmpty(); - } - - public boolean hasDurationUnit() { - return this.durationUnit != null && !this.durationUnit.isEmpty(); - } - - /** - * @param value {@link #durationUnit} (The units of time for the duration, in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getDurationUnit" gives direct access to the value - */ - public TimingRepeatComponent setDurationUnitElement(Enumeration value) { - this.durationUnit = value; - return this; - } - - /** - * @return The units of time for the duration, in UCUM units. - */ - public UnitsOfTime getDurationUnit() { - return this.durationUnit == null ? null : this.durationUnit.getValue(); - } - - /** - * @param value The units of time for the duration, in UCUM units. - */ - public TimingRepeatComponent setDurationUnit(UnitsOfTime value) { - if (value == null) - this.durationUnit = null; - else { - if (this.durationUnit == null) - this.durationUnit = new Enumeration(new UnitsOfTimeEnumFactory()); - this.durationUnit.setValue(value); - } - return this; - } - - /** - * @return {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value - */ - public IntegerType getFrequencyElement() { - if (this.frequency == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.frequency"); - else if (Configuration.doAutoCreate()) - this.frequency = new IntegerType(); // bb - return this.frequency; - } - - public boolean hasFrequencyElement() { - return this.frequency != null && !this.frequency.isEmpty(); - } - - public boolean hasFrequency() { - return this.frequency != null && !this.frequency.isEmpty(); - } - - /** - * @param value {@link #frequency} (The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).). This is the underlying object with id, value and extensions. The accessor "getFrequency" gives direct access to the value - */ - public TimingRepeatComponent setFrequencyElement(IntegerType value) { - this.frequency = value; - return this; - } - - /** - * @return The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). - */ - public int getFrequency() { - return this.frequency == null || this.frequency.isEmpty() ? 0 : this.frequency.getValue(); - } - - /** - * @param value The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided). - */ - public TimingRepeatComponent setFrequency(int value) { - if (this.frequency == null) - this.frequency = new IntegerType(); - this.frequency.setValue(value); - return this; - } - - /** - * @return {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value - */ - public IntegerType getFrequencyMaxElement() { - if (this.frequencyMax == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.frequencyMax"); - else if (Configuration.doAutoCreate()) - this.frequencyMax = new IntegerType(); // bb - return this.frequencyMax; - } - - public boolean hasFrequencyMaxElement() { - return this.frequencyMax != null && !this.frequencyMax.isEmpty(); - } - - public boolean hasFrequencyMax() { - return this.frequencyMax != null && !this.frequencyMax.isEmpty(); - } - - /** - * @param value {@link #frequencyMax} (If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.). This is the underlying object with id, value and extensions. The accessor "getFrequencyMax" gives direct access to the value - */ - public TimingRepeatComponent setFrequencyMaxElement(IntegerType value) { - this.frequencyMax = value; - return this; - } - - /** - * @return If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. - */ - public int getFrequencyMax() { - return this.frequencyMax == null || this.frequencyMax.isEmpty() ? 0 : this.frequencyMax.getValue(); - } - - /** - * @param value If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range. - */ - public TimingRepeatComponent setFrequencyMax(int value) { - if (this.frequencyMax == null) - this.frequencyMax = new IntegerType(); - this.frequencyMax.setValue(value); - return this; - } - - /** - * @return {@link #period} (Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public DecimalType getPeriodElement() { - if (this.period == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.period"); - else if (Configuration.doAutoCreate()) - this.period = new DecimalType(); // bb - return this.period; - } - - public boolean hasPeriodElement() { - return this.period != null && !this.period.isEmpty(); - } - - public boolean hasPeriod() { - return this.period != null && !this.period.isEmpty(); - } - - /** - * @param value {@link #period} (Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period.). This is the underlying object with id, value and extensions. The accessor "getPeriod" gives direct access to the value - */ - public TimingRepeatComponent setPeriodElement(DecimalType value) { - this.period = value; - return this; - } - - /** - * @return Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - public BigDecimal getPeriod() { - return this.period == null ? null : this.period.getValue(); - } - - /** - * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - public TimingRepeatComponent setPeriod(BigDecimal value) { - if (value == null) - this.period = null; - else { - if (this.period == null) - this.period = new DecimalType(); - this.period.setValue(value); - } - return this; - } - - /** - * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - public TimingRepeatComponent setPeriod(long value) { - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @param value Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. - */ - public TimingRepeatComponent setPeriod(double value) { - this.period = new DecimalType(); - this.period.setValue(value); - return this; - } - - /** - * @return {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value - */ - public DecimalType getPeriodMaxElement() { - if (this.periodMax == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.periodMax"); - else if (Configuration.doAutoCreate()) - this.periodMax = new DecimalType(); // bb - return this.periodMax; - } - - public boolean hasPeriodMaxElement() { - return this.periodMax != null && !this.periodMax.isEmpty(); - } - - public boolean hasPeriodMax() { - return this.periodMax != null && !this.periodMax.isEmpty(); - } - - /** - * @param value {@link #periodMax} (If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.). This is the underlying object with id, value and extensions. The accessor "getPeriodMax" gives direct access to the value - */ - public TimingRepeatComponent setPeriodMaxElement(DecimalType value) { - this.periodMax = value; - return this; - } - - /** - * @return If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - public BigDecimal getPeriodMax() { - return this.periodMax == null ? null : this.periodMax.getValue(); - } - - /** - * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - public TimingRepeatComponent setPeriodMax(BigDecimal value) { - if (value == null) - this.periodMax = null; - else { - if (this.periodMax == null) - this.periodMax = new DecimalType(); - this.periodMax.setValue(value); - } - return this; - } - - /** - * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - public TimingRepeatComponent setPeriodMax(long value) { - this.periodMax = new DecimalType(); - this.periodMax.setValue(value); - return this; - } - - /** - * @param value If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days. - */ - public TimingRepeatComponent setPeriodMax(double value) { - this.periodMax = new DecimalType(); - this.periodMax.setValue(value); - return this; - } - - /** - * @return {@link #periodUnit} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnit" gives direct access to the value - */ - public Enumeration getPeriodUnitElement() { - if (this.periodUnit == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.periodUnit"); - else if (Configuration.doAutoCreate()) - this.periodUnit = new Enumeration(new UnitsOfTimeEnumFactory()); // bb - return this.periodUnit; - } - - public boolean hasPeriodUnitElement() { - return this.periodUnit != null && !this.periodUnit.isEmpty(); - } - - public boolean hasPeriodUnit() { - return this.periodUnit != null && !this.periodUnit.isEmpty(); - } - - /** - * @param value {@link #periodUnit} (The units of time for the period in UCUM units.). This is the underlying object with id, value and extensions. The accessor "getPeriodUnit" gives direct access to the value - */ - public TimingRepeatComponent setPeriodUnitElement(Enumeration value) { - this.periodUnit = value; - return this; - } - - /** - * @return The units of time for the period in UCUM units. - */ - public UnitsOfTime getPeriodUnit() { - return this.periodUnit == null ? null : this.periodUnit.getValue(); - } - - /** - * @param value The units of time for the period in UCUM units. - */ - public TimingRepeatComponent setPeriodUnit(UnitsOfTime value) { - if (value == null) - this.periodUnit = null; - else { - if (this.periodUnit == null) - this.periodUnit = new Enumeration(new UnitsOfTimeEnumFactory()); - this.periodUnit.setValue(value); - } - return this; - } - - /** - * @return {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public Enumeration getWhenElement() { - if (this.when == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.when"); - else if (Configuration.doAutoCreate()) - this.when = new Enumeration(new EventTimingEnumFactory()); // bb - return this.when; - } - - public boolean hasWhenElement() { - return this.when != null && !this.when.isEmpty(); - } - - public boolean hasWhen() { - return this.when != null && !this.when.isEmpty(); - } - - /** - * @param value {@link #when} (A real world event that the occurrence of the event should be tied to.). This is the underlying object with id, value and extensions. The accessor "getWhen" gives direct access to the value - */ - public TimingRepeatComponent setWhenElement(Enumeration value) { - this.when = value; - return this; - } - - /** - * @return A real world event that the occurrence of the event should be tied to. - */ - public EventTiming getWhen() { - return this.when == null ? null : this.when.getValue(); - } - - /** - * @param value A real world event that the occurrence of the event should be tied to. - */ - public TimingRepeatComponent setWhen(EventTiming value) { - if (value == null) - this.when = null; - else { - if (this.when == null) - this.when = new Enumeration(new EventTimingEnumFactory()); - this.when.setValue(value); - } - return this; - } - - /** - * @return {@link #offset} (The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value - */ - public UnsignedIntType getOffsetElement() { - if (this.offset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TimingRepeatComponent.offset"); - else if (Configuration.doAutoCreate()) - this.offset = new UnsignedIntType(); // bb - return this.offset; - } - - public boolean hasOffsetElement() { - return this.offset != null && !this.offset.isEmpty(); - } - - public boolean hasOffset() { - return this.offset != null && !this.offset.isEmpty(); - } - - /** - * @param value {@link #offset} (The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value - */ - public TimingRepeatComponent setOffsetElement(UnsignedIntType value) { - this.offset = value; - return this; - } - - /** - * @return The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. - */ - public int getOffset() { - return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue(); - } - - /** - * @param value The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event. - */ - public TimingRepeatComponent setOffset(int value) { - if (this.offset == null) - this.offset = new UnsignedIntType(); - this.offset.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("bounds[x]", "Duration|Range|Period", "Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.", 0, java.lang.Integer.MAX_VALUE, bounds)); - childrenList.add(new Property("count", "integer", "A total count of the desired number of repetitions.", 0, java.lang.Integer.MAX_VALUE, count)); - childrenList.add(new Property("countMax", "integer", "A maximum value for the count of the desired repetitions (e.g. do something 6-8 times).", 0, java.lang.Integer.MAX_VALUE, countMax)); - childrenList.add(new Property("duration", "decimal", "How long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("durationMax", "decimal", "The upper limit of how long this thing happens for when it happens.", 0, java.lang.Integer.MAX_VALUE, durationMax)); - childrenList.add(new Property("durationUnit", "code", "The units of time for the duration, in UCUM units.", 0, java.lang.Integer.MAX_VALUE, durationUnit)); - childrenList.add(new Property("frequency", "integer", "The number of times to repeat the action within the specified period / period range (i.e. both period and periodMax provided).", 0, java.lang.Integer.MAX_VALUE, frequency)); - childrenList.add(new Property("frequencyMax", "integer", "If present, indicates that the frequency is a range - so repeat between [frequency] and [frequencyMax] times within the period or period range.", 0, java.lang.Integer.MAX_VALUE, frequencyMax)); - childrenList.add(new Property("period", "decimal", "Indicates the duration of time over which repetitions are to occur; e.g. to express \"3 times per day\", 3 would be the frequency and \"1 day\" would be the period.", 0, java.lang.Integer.MAX_VALUE, period)); - childrenList.add(new Property("periodMax", "decimal", "If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as \"do this once every 3-5 days.", 0, java.lang.Integer.MAX_VALUE, periodMax)); - childrenList.add(new Property("periodUnit", "code", "The units of time for the period in UCUM units.", 0, java.lang.Integer.MAX_VALUE, periodUnit)); - childrenList.add(new Property("when", "code", "A real world event that the occurrence of the event should be tied to.", 0, java.lang.Integer.MAX_VALUE, when)); - childrenList.add(new Property("offset", "unsignedInt", "The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.", 0, java.lang.Integer.MAX_VALUE, offset)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1383205195: /*bounds*/ return this.bounds == null ? new Base[0] : new Base[] {this.bounds}; // Type - case 94851343: /*count*/ return this.count == null ? new Base[0] : new Base[] {this.count}; // IntegerType - case -372044331: /*countMax*/ return this.countMax == null ? new Base[0] : new Base[] {this.countMax}; // IntegerType - case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // DecimalType - case -478083280: /*durationMax*/ return this.durationMax == null ? new Base[0] : new Base[] {this.durationMax}; // DecimalType - case -1935429320: /*durationUnit*/ return this.durationUnit == null ? new Base[0] : new Base[] {this.durationUnit}; // Enumeration - case -70023844: /*frequency*/ return this.frequency == null ? new Base[0] : new Base[] {this.frequency}; // IntegerType - case 1273846376: /*frequencyMax*/ return this.frequencyMax == null ? new Base[0] : new Base[] {this.frequencyMax}; // IntegerType - case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // DecimalType - case 566580195: /*periodMax*/ return this.periodMax == null ? new Base[0] : new Base[] {this.periodMax}; // DecimalType - case 384367333: /*periodUnit*/ return this.periodUnit == null ? new Base[0] : new Base[] {this.periodUnit}; // Enumeration - case 3648314: /*when*/ return this.when == null ? new Base[0] : new Base[] {this.when}; // Enumeration - case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // UnsignedIntType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1383205195: // bounds - this.bounds = (Type) value; // Type - break; - case 94851343: // count - this.count = castToInteger(value); // IntegerType - break; - case -372044331: // countMax - this.countMax = castToInteger(value); // IntegerType - break; - case -1992012396: // duration - this.duration = castToDecimal(value); // DecimalType - break; - case -478083280: // durationMax - this.durationMax = castToDecimal(value); // DecimalType - break; - case -1935429320: // durationUnit - this.durationUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration - break; - case -70023844: // frequency - this.frequency = castToInteger(value); // IntegerType - break; - case 1273846376: // frequencyMax - this.frequencyMax = castToInteger(value); // IntegerType - break; - case -991726143: // period - this.period = castToDecimal(value); // DecimalType - break; - case 566580195: // periodMax - this.periodMax = castToDecimal(value); // DecimalType - break; - case 384367333: // periodUnit - this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration - break; - case 3648314: // when - this.when = new EventTimingEnumFactory().fromType(value); // Enumeration - break; - case -1019779949: // offset - this.offset = castToUnsignedInt(value); // UnsignedIntType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("bounds[x]")) - this.bounds = (Type) value; // Type - else if (name.equals("count")) - this.count = castToInteger(value); // IntegerType - else if (name.equals("countMax")) - this.countMax = castToInteger(value); // IntegerType - else if (name.equals("duration")) - this.duration = castToDecimal(value); // DecimalType - else if (name.equals("durationMax")) - this.durationMax = castToDecimal(value); // DecimalType - else if (name.equals("durationUnit")) - this.durationUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration - else if (name.equals("frequency")) - this.frequency = castToInteger(value); // IntegerType - else if (name.equals("frequencyMax")) - this.frequencyMax = castToInteger(value); // IntegerType - else if (name.equals("period")) - this.period = castToDecimal(value); // DecimalType - else if (name.equals("periodMax")) - this.periodMax = castToDecimal(value); // DecimalType - else if (name.equals("periodUnit")) - this.periodUnit = new UnitsOfTimeEnumFactory().fromType(value); // Enumeration - else if (name.equals("when")) - this.when = new EventTimingEnumFactory().fromType(value); // Enumeration - else if (name.equals("offset")) - this.offset = castToUnsignedInt(value); // UnsignedIntType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1149635157: return getBounds(); // Type - case 94851343: throw new FHIRException("Cannot make property count as it is not a complex type"); // IntegerType - case -372044331: throw new FHIRException("Cannot make property countMax as it is not a complex type"); // IntegerType - case -1992012396: throw new FHIRException("Cannot make property duration as it is not a complex type"); // DecimalType - case -478083280: throw new FHIRException("Cannot make property durationMax as it is not a complex type"); // DecimalType - case -1935429320: throw new FHIRException("Cannot make property durationUnit as it is not a complex type"); // Enumeration - case -70023844: throw new FHIRException("Cannot make property frequency as it is not a complex type"); // IntegerType - case 1273846376: throw new FHIRException("Cannot make property frequencyMax as it is not a complex type"); // IntegerType - case -991726143: throw new FHIRException("Cannot make property period as it is not a complex type"); // DecimalType - case 566580195: throw new FHIRException("Cannot make property periodMax as it is not a complex type"); // DecimalType - case 384367333: throw new FHIRException("Cannot make property periodUnit as it is not a complex type"); // Enumeration - case 3648314: throw new FHIRException("Cannot make property when as it is not a complex type"); // Enumeration - case -1019779949: throw new FHIRException("Cannot make property offset as it is not a complex type"); // UnsignedIntType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("boundsDuration")) { - this.bounds = new Duration(); - return this.bounds; - } - else if (name.equals("boundsRange")) { - this.bounds = new Range(); - return this.bounds; - } - else if (name.equals("boundsPeriod")) { - this.bounds = new Period(); - return this.bounds; - } - else if (name.equals("count")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.count"); - } - else if (name.equals("countMax")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.countMax"); - } - else if (name.equals("duration")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.duration"); - } - else if (name.equals("durationMax")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.durationMax"); - } - else if (name.equals("durationUnit")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.durationUnit"); - } - else if (name.equals("frequency")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.frequency"); - } - else if (name.equals("frequencyMax")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.frequencyMax"); - } - else if (name.equals("period")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.period"); - } - else if (name.equals("periodMax")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.periodMax"); - } - else if (name.equals("periodUnit")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.periodUnit"); - } - else if (name.equals("when")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.when"); - } - else if (name.equals("offset")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.offset"); - } - else - return super.addChild(name); - } - - public TimingRepeatComponent copy() { - TimingRepeatComponent dst = new TimingRepeatComponent(); - copyValues(dst); - dst.bounds = bounds == null ? null : bounds.copy(); - dst.count = count == null ? null : count.copy(); - dst.countMax = countMax == null ? null : countMax.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.durationMax = durationMax == null ? null : durationMax.copy(); - dst.durationUnit = durationUnit == null ? null : durationUnit.copy(); - dst.frequency = frequency == null ? null : frequency.copy(); - dst.frequencyMax = frequencyMax == null ? null : frequencyMax.copy(); - dst.period = period == null ? null : period.copy(); - dst.periodMax = periodMax == null ? null : periodMax.copy(); - dst.periodUnit = periodUnit == null ? null : periodUnit.copy(); - dst.when = when == null ? null : when.copy(); - dst.offset = offset == null ? null : offset.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TimingRepeatComponent)) - return false; - TimingRepeatComponent o = (TimingRepeatComponent) other; - return compareDeep(bounds, o.bounds, true) && compareDeep(count, o.count, true) && compareDeep(countMax, o.countMax, true) - && compareDeep(duration, o.duration, true) && compareDeep(durationMax, o.durationMax, true) && compareDeep(durationUnit, o.durationUnit, true) - && compareDeep(frequency, o.frequency, true) && compareDeep(frequencyMax, o.frequencyMax, true) - && compareDeep(period, o.period, true) && compareDeep(periodMax, o.periodMax, true) && compareDeep(periodUnit, o.periodUnit, true) - && compareDeep(when, o.when, true) && compareDeep(offset, o.offset, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TimingRepeatComponent)) - return false; - TimingRepeatComponent o = (TimingRepeatComponent) other; - return compareValues(count, o.count, true) && compareValues(countMax, o.countMax, true) && compareValues(duration, o.duration, true) - && compareValues(durationMax, o.durationMax, true) && compareValues(durationUnit, o.durationUnit, true) - && compareValues(frequency, o.frequency, true) && compareValues(frequencyMax, o.frequencyMax, true) - && compareValues(period, o.period, true) && compareValues(periodMax, o.periodMax, true) && compareValues(periodUnit, o.periodUnit, true) - && compareValues(when, o.when, true) && compareValues(offset, o.offset, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (bounds == null || bounds.isEmpty()) && (count == null || count.isEmpty()) - && (countMax == null || countMax.isEmpty()) && (duration == null || duration.isEmpty()) && (durationMax == null || durationMax.isEmpty()) - && (durationUnit == null || durationUnit.isEmpty()) && (frequency == null || frequency.isEmpty()) - && (frequencyMax == null || frequencyMax.isEmpty()) && (period == null || period.isEmpty()) - && (periodMax == null || periodMax.isEmpty()) && (periodUnit == null || periodUnit.isEmpty()) - && (when == null || when.isEmpty()) && (offset == null || offset.isEmpty()); - } - - public String fhirType() { - return "Timing.repeat"; - - } - - } - - /** - * Identifies specific times when the event occurs. - */ - @Child(name = "event", type = {DateTimeType.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="When the event occurs", formalDefinition="Identifies specific times when the event occurs." ) - protected List event; - - /** - * A set of rules that describe when the event should occur. - */ - @Child(name = "repeat", type = {}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When the event is to occur", formalDefinition="A set of rules that describe when the event should occur." ) - protected TimingRepeatComponent repeat; - - /** - * A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing. - */ - @Child(name = "code", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="QD | QOD | Q4H | Q6H | BID | TID | QID | AM | PM +", formalDefinition="A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing." ) - protected CodeableConcept code; - - private static final long serialVersionUID = 791565112L; - - /** - * Constructor - */ - public Timing() { - super(); - } - - /** - * @return {@link #event} (Identifies specific times when the event occurs.) - */ - public List getEvent() { - if (this.event == null) - this.event = new ArrayList(); - return this.event; - } - - public boolean hasEvent() { - if (this.event == null) - return false; - for (DateTimeType item : this.event) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #event} (Identifies specific times when the event occurs.) - */ - // syntactic sugar - public DateTimeType addEventElement() {//2 - DateTimeType t = new DateTimeType(); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return t; - } - - /** - * @param value {@link #event} (Identifies specific times when the event occurs.) - */ - public Timing addEvent(Date value) { //1 - DateTimeType t = new DateTimeType(); - t.setValue(value); - if (this.event == null) - this.event = new ArrayList(); - this.event.add(t); - return this; - } - - /** - * @param value {@link #event} (Identifies specific times when the event occurs.) - */ - public boolean hasEvent(Date value) { - if (this.event == null) - return false; - for (DateTimeType v : this.event) - if (v.equals(value)) // dateTime - return true; - return false; - } - - /** - * @return {@link #repeat} (A set of rules that describe when the event should occur.) - */ - public TimingRepeatComponent getRepeat() { - if (this.repeat == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Timing.repeat"); - else if (Configuration.doAutoCreate()) - this.repeat = new TimingRepeatComponent(); // cc - return this.repeat; - } - - public boolean hasRepeat() { - return this.repeat != null && !this.repeat.isEmpty(); - } - - /** - * @param value {@link #repeat} (A set of rules that describe when the event should occur.) - */ - public Timing setRepeat(TimingRepeatComponent value) { - this.repeat = value; - return this; - } - - /** - * @return {@link #code} (A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.) - */ - public CodeableConcept getCode() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create Timing.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeableConcept(); // cc - return this.code; - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.) - */ - public Timing setCode(CodeableConcept value) { - this.code = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("event", "dateTime", "Identifies specific times when the event occurs.", 0, java.lang.Integer.MAX_VALUE, event)); - childrenList.add(new Property("repeat", "", "A set of rules that describe when the event should occur.", 0, java.lang.Integer.MAX_VALUE, repeat)); - childrenList.add(new Property("code", "CodeableConcept", "A code for the timing pattern. Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing.", 0, java.lang.Integer.MAX_VALUE, code)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 96891546: /*event*/ return this.event == null ? new Base[0] : this.event.toArray(new Base[this.event.size()]); // DateTimeType - case -934531685: /*repeat*/ return this.repeat == null ? new Base[0] : new Base[] {this.repeat}; // TimingRepeatComponent - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 96891546: // event - this.getEvent().add(castToDateTime(value)); // DateTimeType - break; - case -934531685: // repeat - this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent - break; - case 3059181: // code - this.code = castToCodeableConcept(value); // CodeableConcept - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("event")) - this.getEvent().add(castToDateTime(value)); - else if (name.equals("repeat")) - this.repeat = (TimingRepeatComponent) value; // TimingRepeatComponent - else if (name.equals("code")) - this.code = castToCodeableConcept(value); // CodeableConcept - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 96891546: throw new FHIRException("Cannot make property event as it is not a complex type"); // DateTimeType - case -934531685: return getRepeat(); // TimingRepeatComponent - case 3059181: return getCode(); // CodeableConcept - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("event")) { - throw new FHIRException("Cannot call addChild on a primitive type Timing.event"); - } - else if (name.equals("repeat")) { - this.repeat = new TimingRepeatComponent(); - return this.repeat; - } - else if (name.equals("code")) { - this.code = new CodeableConcept(); - return this.code; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "Timing"; - - } - - public Timing copy() { - Timing dst = new Timing(); - copyValues(dst); - if (event != null) { - dst.event = new ArrayList(); - for (DateTimeType i : event) - dst.event.add(i.copy()); - }; - dst.repeat = repeat == null ? null : repeat.copy(); - dst.code = code == null ? null : code.copy(); - return dst; - } - - protected Timing typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof Timing)) - return false; - Timing o = (Timing) other; - return compareDeep(event, o.event, true) && compareDeep(repeat, o.repeat, true) && compareDeep(code, o.code, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof Timing)) - return false; - Timing o = (Timing) other; - return compareValues(event, o.event, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (event == null || event.isEmpty()) && (repeat == null || repeat.isEmpty()) - && (code == null || code.isEmpty()); - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java deleted file mode 100644 index cd17c4b4f53..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/TriggerDefinition.java +++ /dev/null @@ -1,595 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.utilities.Utilities; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.model.api.annotation.Description; -/** - * A description of a triggering event. - */ -@DatatypeDef(name="TriggerDefinition") -public class TriggerDefinition extends Type implements ICompositeType { - - public enum TriggerType { - /** - * The trigger occurs in response to a specific named event - */ - NAMEDEVENT, - /** - * The trigger occurs at a specific time or periodically as described by a timing or schedule - */ - PERIODIC, - /** - * The trigger occurs whenever data of a particular type is added - */ - DATAADDED, - /** - * The trigger occurs whenever data of a particular type is modified - */ - DATAMODIFIED, - /** - * The trigger occurs whenever data of a particular type is removed - */ - DATAREMOVED, - /** - * The trigger occurs whenever data of a particular type is accessed - */ - DATAACCESSED, - /** - * The trigger occurs whenever access to data of a particular type is completed - */ - DATAACCESSENDED, - /** - * added to help the parsers - */ - NULL; - public static TriggerType fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("named-event".equals(codeString)) - return NAMEDEVENT; - if ("periodic".equals(codeString)) - return PERIODIC; - if ("data-added".equals(codeString)) - return DATAADDED; - if ("data-modified".equals(codeString)) - return DATAMODIFIED; - if ("data-removed".equals(codeString)) - return DATAREMOVED; - if ("data-accessed".equals(codeString)) - return DATAACCESSED; - if ("data-access-ended".equals(codeString)) - return DATAACCESSENDED; - throw new FHIRException("Unknown TriggerType code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case NAMEDEVENT: return "named-event"; - case PERIODIC: return "periodic"; - case DATAADDED: return "data-added"; - case DATAMODIFIED: return "data-modified"; - case DATAREMOVED: return "data-removed"; - case DATAACCESSED: return "data-accessed"; - case DATAACCESSENDED: return "data-access-ended"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case NAMEDEVENT: return "http://hl7.org/fhir/trigger-type"; - case PERIODIC: return "http://hl7.org/fhir/trigger-type"; - case DATAADDED: return "http://hl7.org/fhir/trigger-type"; - case DATAMODIFIED: return "http://hl7.org/fhir/trigger-type"; - case DATAREMOVED: return "http://hl7.org/fhir/trigger-type"; - case DATAACCESSED: return "http://hl7.org/fhir/trigger-type"; - case DATAACCESSENDED: return "http://hl7.org/fhir/trigger-type"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case NAMEDEVENT: return "The trigger occurs in response to a specific named event"; - case PERIODIC: return "The trigger occurs at a specific time or periodically as described by a timing or schedule"; - case DATAADDED: return "The trigger occurs whenever data of a particular type is added"; - case DATAMODIFIED: return "The trigger occurs whenever data of a particular type is modified"; - case DATAREMOVED: return "The trigger occurs whenever data of a particular type is removed"; - case DATAACCESSED: return "The trigger occurs whenever data of a particular type is accessed"; - case DATAACCESSENDED: return "The trigger occurs whenever access to data of a particular type is completed"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case NAMEDEVENT: return "Named Event"; - case PERIODIC: return "Periodic"; - case DATAADDED: return "Data Added"; - case DATAMODIFIED: return "Data Modified"; - case DATAREMOVED: return "Data Removed"; - case DATAACCESSED: return "Data Accessed"; - case DATAACCESSENDED: return "Data Access Ended"; - default: return "?"; - } - } - } - - public static class TriggerTypeEnumFactory implements EnumFactory { - public TriggerType fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("named-event".equals(codeString)) - return TriggerType.NAMEDEVENT; - if ("periodic".equals(codeString)) - return TriggerType.PERIODIC; - if ("data-added".equals(codeString)) - return TriggerType.DATAADDED; - if ("data-modified".equals(codeString)) - return TriggerType.DATAMODIFIED; - if ("data-removed".equals(codeString)) - return TriggerType.DATAREMOVED; - if ("data-accessed".equals(codeString)) - return TriggerType.DATAACCESSED; - if ("data-access-ended".equals(codeString)) - return TriggerType.DATAACCESSENDED; - throw new IllegalArgumentException("Unknown TriggerType code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("named-event".equals(codeString)) - return new Enumeration(this, TriggerType.NAMEDEVENT); - if ("periodic".equals(codeString)) - return new Enumeration(this, TriggerType.PERIODIC); - if ("data-added".equals(codeString)) - return new Enumeration(this, TriggerType.DATAADDED); - if ("data-modified".equals(codeString)) - return new Enumeration(this, TriggerType.DATAMODIFIED); - if ("data-removed".equals(codeString)) - return new Enumeration(this, TriggerType.DATAREMOVED); - if ("data-accessed".equals(codeString)) - return new Enumeration(this, TriggerType.DATAACCESSED); - if ("data-access-ended".equals(codeString)) - return new Enumeration(this, TriggerType.DATAACCESSENDED); - throw new FHIRException("Unknown TriggerType code '"+codeString+"'"); - } - public String toCode(TriggerType code) { - if (code == TriggerType.NAMEDEVENT) - return "named-event"; - if (code == TriggerType.PERIODIC) - return "periodic"; - if (code == TriggerType.DATAADDED) - return "data-added"; - if (code == TriggerType.DATAMODIFIED) - return "data-modified"; - if (code == TriggerType.DATAREMOVED) - return "data-removed"; - if (code == TriggerType.DATAACCESSED) - return "data-accessed"; - if (code == TriggerType.DATAACCESSENDED) - return "data-access-ended"; - return "?"; - } - public String toSystem(TriggerType code) { - return code.getSystem(); - } - } - - /** - * The type of triggering event. - */ - @Child(name = "type", type = {CodeType.class}, order=0, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="named-event | periodic | data-added | data-modified | data-removed | data-accessed | data-access-ended", formalDefinition="The type of triggering event." ) - protected Enumeration type; - - /** - * The name of the event (if this is a named-event trigger). - */ - @Child(name = "eventName", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the event", formalDefinition="The name of the event (if this is a named-event trigger)." ) - protected StringType eventName; - - /** - * The timing of the event (if this is a period trigger). - */ - @Child(name = "eventTiming", type = {Timing.class, Schedule.class, DateType.class, DateTimeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Timing of the event", formalDefinition="The timing of the event (if this is a period trigger)." ) - protected Type eventTiming; - - /** - * The triggering data of the event (if this is a data trigger). - */ - @Child(name = "eventData", type = {DataRequirement.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Triggering data of the event", formalDefinition="The triggering data of the event (if this is a data trigger)." ) - protected DataRequirement eventData; - - private static final long serialVersionUID = -1695534864L; - - /** - * Constructor - */ - public TriggerDefinition() { - super(); - } - - /** - * Constructor - */ - public TriggerDefinition(Enumeration type) { - super(); - this.type = type; - } - - /** - * @return {@link #type} (The type of triggering event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public Enumeration getTypeElement() { - if (this.type == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TriggerDefinition.type"); - else if (Configuration.doAutoCreate()) - this.type = new Enumeration(new TriggerTypeEnumFactory()); // bb - return this.type; - } - - public boolean hasTypeElement() { - return this.type != null && !this.type.isEmpty(); - } - - public boolean hasType() { - return this.type != null && !this.type.isEmpty(); - } - - /** - * @param value {@link #type} (The type of triggering event.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value - */ - public TriggerDefinition setTypeElement(Enumeration value) { - this.type = value; - return this; - } - - /** - * @return The type of triggering event. - */ - public TriggerType getType() { - return this.type == null ? null : this.type.getValue(); - } - - /** - * @param value The type of triggering event. - */ - public TriggerDefinition setType(TriggerType value) { - if (this.type == null) - this.type = new Enumeration(new TriggerTypeEnumFactory()); - this.type.setValue(value); - return this; - } - - /** - * @return {@link #eventName} (The name of the event (if this is a named-event trigger).). This is the underlying object with id, value and extensions. The accessor "getEventName" gives direct access to the value - */ - public StringType getEventNameElement() { - if (this.eventName == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TriggerDefinition.eventName"); - else if (Configuration.doAutoCreate()) - this.eventName = new StringType(); // bb - return this.eventName; - } - - public boolean hasEventNameElement() { - return this.eventName != null && !this.eventName.isEmpty(); - } - - public boolean hasEventName() { - return this.eventName != null && !this.eventName.isEmpty(); - } - - /** - * @param value {@link #eventName} (The name of the event (if this is a named-event trigger).). This is the underlying object with id, value and extensions. The accessor "getEventName" gives direct access to the value - */ - public TriggerDefinition setEventNameElement(StringType value) { - this.eventName = value; - return this; - } - - /** - * @return The name of the event (if this is a named-event trigger). - */ - public String getEventName() { - return this.eventName == null ? null : this.eventName.getValue(); - } - - /** - * @param value The name of the event (if this is a named-event trigger). - */ - public TriggerDefinition setEventName(String value) { - if (Utilities.noString(value)) - this.eventName = null; - else { - if (this.eventName == null) - this.eventName = new StringType(); - this.eventName.setValue(value); - } - return this; - } - - /** - * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) - */ - public Type getEventTiming() { - return this.eventTiming; - } - - /** - * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) - */ - public Timing getEventTimingTiming() throws FHIRException { - if (!(this.eventTiming instanceof Timing)) - throw new FHIRException("Type mismatch: the type Timing was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); - return (Timing) this.eventTiming; - } - - public boolean hasEventTimingTiming() { - return this.eventTiming instanceof Timing; - } - - /** - * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) - */ - public Reference getEventTimingReference() throws FHIRException { - if (!(this.eventTiming instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); - return (Reference) this.eventTiming; - } - - public boolean hasEventTimingReference() { - return this.eventTiming instanceof Reference; - } - - /** - * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) - */ - public DateType getEventTimingDateType() throws FHIRException { - if (!(this.eventTiming instanceof DateType)) - throw new FHIRException("Type mismatch: the type DateType was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); - return (DateType) this.eventTiming; - } - - public boolean hasEventTimingDateType() { - return this.eventTiming instanceof DateType; - } - - /** - * @return {@link #eventTiming} (The timing of the event (if this is a period trigger).) - */ - public DateTimeType getEventTimingDateTimeType() throws FHIRException { - if (!(this.eventTiming instanceof DateTimeType)) - throw new FHIRException("Type mismatch: the type DateTimeType was expected, but "+this.eventTiming.getClass().getName()+" was encountered"); - return (DateTimeType) this.eventTiming; - } - - public boolean hasEventTimingDateTimeType() { - return this.eventTiming instanceof DateTimeType; - } - - public boolean hasEventTiming() { - return this.eventTiming != null && !this.eventTiming.isEmpty(); - } - - /** - * @param value {@link #eventTiming} (The timing of the event (if this is a period trigger).) - */ - public TriggerDefinition setEventTiming(Type value) { - this.eventTiming = value; - return this; - } - - /** - * @return {@link #eventData} (The triggering data of the event (if this is a data trigger).) - */ - public DataRequirement getEventData() { - if (this.eventData == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create TriggerDefinition.eventData"); - else if (Configuration.doAutoCreate()) - this.eventData = new DataRequirement(); // cc - return this.eventData; - } - - public boolean hasEventData() { - return this.eventData != null && !this.eventData.isEmpty(); - } - - /** - * @param value {@link #eventData} (The triggering data of the event (if this is a data trigger).) - */ - public TriggerDefinition setEventData(DataRequirement value) { - this.eventData = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("type", "code", "The type of triggering event.", 0, java.lang.Integer.MAX_VALUE, type)); - childrenList.add(new Property("eventName", "string", "The name of the event (if this is a named-event trigger).", 0, java.lang.Integer.MAX_VALUE, eventName)); - childrenList.add(new Property("eventTiming[x]", "Timing|Reference(Schedule)|date|dateTime", "The timing of the event (if this is a period trigger).", 0, java.lang.Integer.MAX_VALUE, eventTiming)); - childrenList.add(new Property("eventData", "DataRequirement", "The triggering data of the event (if this is a data trigger).", 0, java.lang.Integer.MAX_VALUE, eventData)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration - case 31228997: /*eventName*/ return this.eventName == null ? new Base[0] : new Base[] {this.eventName}; // StringType - case 125465476: /*eventTiming*/ return this.eventTiming == null ? new Base[0] : new Base[] {this.eventTiming}; // Type - case 30931300: /*eventData*/ return this.eventData == null ? new Base[0] : new Base[] {this.eventData}; // DataRequirement - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3575610: // type - this.type = new TriggerTypeEnumFactory().fromType(value); // Enumeration - break; - case 31228997: // eventName - this.eventName = castToString(value); // StringType - break; - case 125465476: // eventTiming - this.eventTiming = (Type) value; // Type - break; - case 30931300: // eventData - this.eventData = castToDataRequirement(value); // DataRequirement - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("type")) - this.type = new TriggerTypeEnumFactory().fromType(value); // Enumeration - else if (name.equals("eventName")) - this.eventName = castToString(value); // StringType - else if (name.equals("eventTiming[x]")) - this.eventTiming = (Type) value; // Type - else if (name.equals("eventData")) - this.eventData = castToDataRequirement(value); // DataRequirement - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3575610: throw new FHIRException("Cannot make property type as it is not a complex type"); // Enumeration - case 31228997: throw new FHIRException("Cannot make property eventName as it is not a complex type"); // StringType - case 1120539260: return getEventTiming(); // Type - case 30931300: return getEventData(); // DataRequirement - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("type")) { - throw new FHIRException("Cannot call addChild on a primitive type TriggerDefinition.type"); - } - else if (name.equals("eventName")) { - throw new FHIRException("Cannot call addChild on a primitive type TriggerDefinition.eventName"); - } - else if (name.equals("eventTimingTiming")) { - this.eventTiming = new Timing(); - return this.eventTiming; - } - else if (name.equals("eventTimingReference")) { - this.eventTiming = new Reference(); - return this.eventTiming; - } - else if (name.equals("eventTimingDate")) { - this.eventTiming = new DateType(); - return this.eventTiming; - } - else if (name.equals("eventTimingDateTime")) { - this.eventTiming = new DateTimeType(); - return this.eventTiming; - } - else if (name.equals("eventData")) { - this.eventData = new DataRequirement(); - return this.eventData; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "TriggerDefinition"; - - } - - public TriggerDefinition copy() { - TriggerDefinition dst = new TriggerDefinition(); - copyValues(dst); - dst.type = type == null ? null : type.copy(); - dst.eventName = eventName == null ? null : eventName.copy(); - dst.eventTiming = eventTiming == null ? null : eventTiming.copy(); - dst.eventData = eventData == null ? null : eventData.copy(); - return dst; - } - - protected TriggerDefinition typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof TriggerDefinition)) - return false; - TriggerDefinition o = (TriggerDefinition) other; - return compareDeep(type, o.type, true) && compareDeep(eventName, o.eventName, true) && compareDeep(eventTiming, o.eventTiming, true) - && compareDeep(eventData, o.eventData, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof TriggerDefinition)) - return false; - TriggerDefinition o = (TriggerDefinition) other; - return compareValues(type, o.type, true) && compareValues(eventName, o.eventName, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (type == null || type.isEmpty()) && (eventName == null || eventName.isEmpty()) - && (eventTiming == null || eventTiming.isEmpty()) && (eventData == null || eventData.isEmpty()) - ; - } - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Type.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Type.java deleted file mode 100644 index 500d639083e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/Type.java +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -package org.hl7.fhir.dstu2016may.model; - -import org.hl7.fhir.instance.model.api.IBaseDatatype; - -import ca.uhn.fhir.model.api.IElement; - -/** - * An element that is a type. Used when the element type in FHIR is a choice of more than one data type - */ -public abstract class Type extends Element implements IBaseDatatype, IElement { - - private static final long serialVersionUID = 4623040030733049991L; - - public Type copy() { - return typedCopy(); - } - - protected abstract Type typedCopy(); -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java deleted file mode 100644 index 15e90d790a4..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UnsignedIntType.java +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ -/** - * - */ -package org.hl7.fhir.dstu2016may.model; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "integer" in FHIR: A signed 32-bit integer - */ -@DatatypeDef(name = "unsignedInt", profileOf=IntegerType.class) -public class UnsignedIntType extends IntegerType { - - - /** - * - */ - private static final long serialVersionUID = -7991875974606711355L; - - /** - * Constructor - */ - public UnsignedIntType() { - // nothing - } - - /** - * Constructor - */ - public UnsignedIntType(int theInteger) { - setValue(theInteger); - } - - /** - * Constructor - * - * @param theIntegerAsString - * A string representation of an integer - * @throws IllegalArgumentException - * If the string is not a valid integer representation - */ - public UnsignedIntType(String theIntegerAsString) { - setValueAsString(theIntegerAsString); - } - - /** - * Constructor - * - * @param theValue The value - * @throws IllegalArgumentException If the value is too large to fit in a signed integer - */ - public UnsignedIntType(Long theValue) { - if (theValue < 0 || theValue > java.lang.Integer.MAX_VALUE) { - throw new IllegalArgumentException - (theValue + " cannot be cast to int without changing its value."); - } - if(theValue!=null) { - setValue((int)theValue.longValue()); - } - } - - @Override - public UnsignedIntType copy() { - return new UnsignedIntType(getValue()); - } - - public String fhirType() { - return "unsignedInt"; - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UriType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UriType.java deleted file mode 100644 index 6ebb6ca3374..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UriType.java +++ /dev/null @@ -1,163 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ -package org.hl7.fhir.dstu2016may.model; - -import java.net.URI; -import java.net.URISyntaxException; - -import org.apache.commons.lang3.StringUtils; - -import ca.uhn.fhir.model.api.annotation.DatatypeDef; - -/** - * Primitive type "uri" in FHIR: any valid URI. Sometimes constrained to be only an absolute URI, and sometimes constrained to be a literal reference - */ -@DatatypeDef(name = "uri") -public class UriType extends PrimitiveType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public UriType() { - // nothing - } - - /** - * Constructor - */ - public UriType(String theValue) { - setValueAsString(theValue); - } - - /** - * Constructor - */ - public UriType(URI theValue) { - setValue(theValue.toString()); - } - - @Override - public UriType copy() { - return new UriType(getValue()); - } - - @Override - protected String encode(String theValue) { - return theValue; - } - - /** - * Compares the given string to the string representation of this URI. In many cases it is preferable to use this - * instead of the standard {@link #equals(Object)} method, since that method returns false unless it is - * passed an instance of {@link UriType} - */ - public boolean equals(String theString) { - return StringUtils.equals(getValueAsString(), theString); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - - String normalize = normalize(getValue()); - result = prime * result + ((normalize == null) ? 0 : normalize.hashCode()); - - return result; - } - - private String normalize(String theValue) { - if (theValue == null) { - return null; - } - try { - URI retVal = new URI(getValue()).normalize(); - String urlString = retVal.toString(); - if (urlString.endsWith("/") && urlString.length() > 1) { - retVal = new URI(urlString.substring(0, urlString.length() - 1)); - } - return retVal.toASCIIString(); - } catch (URISyntaxException e) { - // ourLog.debug("Failed to normalize URL '{}', message was: {}", urlString, e.toString()); - return theValue; - } - } - - @Override - protected String parse(String theValue) { - return theValue; - } - - /** - * Creates a new OidType instance which uses the given OID as the content (and prepends "urn:oid:" to the OID string - * in the value of the newly created OidType, per the FHIR specification). - * - * @param theOid - * The OID to use (null is acceptable and will result in a UriDt instance with a - * null value) - * @return A new UriDt instance - */ - public static OidType fromOid(String theOid) { - if (theOid == null) { - return new OidType(); - } - return new OidType("urn:oid:" + theOid); - } - - @Override - public boolean equalsDeep(Base obj) { - if (!super.equalsDeep(obj)) - return false; - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - - UriType other = (UriType) obj; - if (getValue() == null && other.getValue() == null) { - return true; - } - if (getValue() == null || other.getValue() == null) { - return false; - } - - String normalize = normalize(getValue()); - String normalize2 = normalize(other.getValue()); - return normalize.equals(normalize2); - } - - public String fhirType() { - return "uri"; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UuidType.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UuidType.java deleted file mode 100644 index a47cb6d1f65..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/UuidType.java +++ /dev/null @@ -1,70 +0,0 @@ -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ -package org.hl7.fhir.dstu2016may.model; - -import java.net.URI; - -public class UuidType extends UriType { - - private static final long serialVersionUID = 3L; - - /** - * Constructor - */ - public UuidType() { - super(); - } - - /** - * Constructor - */ - public UuidType(String theValue) { - super(theValue); - } - - /** - * Constructor - */ - public UuidType(URI theValue) { - super(theValue); - } - - /** - * Constructor - */ - @Override - public UuidType copy() { - return new UuidType(getValue()); - } - - public String fhirType() { - return "uuid"; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ValueSet.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ValueSet.java deleted file mode 100644 index 34a8adb19dd..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/ValueSet.java +++ /dev/null @@ -1,4674 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus; -import org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * A value set specifies a set of codes drawn from one or more code systems. - */ -@ResourceDef(name="ValueSet", profile="http://hl7.org/fhir/Profile/ValueSet") -public class ValueSet extends DomainResource { - - public enum FilterOperator { - /** - * The specified property of the code equals the provided value. - */ - EQUAL, - /** - * Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself. - */ - ISA, - /** - * The specified property of the code does not have an is-a relationship with the provided value. - */ - ISNOTA, - /** - * The specified property of the code matches the regex specified in the provided value. - */ - REGEX, - /** - * The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list). - */ - IN, - /** - * The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list). - */ - NOTIN, - /** - * added to help the parsers - */ - NULL; - public static FilterOperator fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return EQUAL; - if ("is-a".equals(codeString)) - return ISA; - if ("is-not-a".equals(codeString)) - return ISNOTA; - if ("regex".equals(codeString)) - return REGEX; - if ("in".equals(codeString)) - return IN; - if ("not-in".equals(codeString)) - return NOTIN; - throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case EQUAL: return "="; - case ISA: return "is-a"; - case ISNOTA: return "is-not-a"; - case REGEX: return "regex"; - case IN: return "in"; - case NOTIN: return "not-in"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case EQUAL: return "http://hl7.org/fhir/filter-operator"; - case ISA: return "http://hl7.org/fhir/filter-operator"; - case ISNOTA: return "http://hl7.org/fhir/filter-operator"; - case REGEX: return "http://hl7.org/fhir/filter-operator"; - case IN: return "http://hl7.org/fhir/filter-operator"; - case NOTIN: return "http://hl7.org/fhir/filter-operator"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case EQUAL: return "The specified property of the code equals the provided value."; - case ISA: return "Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, including the provided concept itself."; - case ISNOTA: return "The specified property of the code does not have an is-a relationship with the provided value."; - case REGEX: return "The specified property of the code matches the regex specified in the provided value."; - case IN: return "The specified property of the code is in the set of codes or concepts specified in the provided value (comma separated list)."; - case NOTIN: return "The specified property of the code is not in the set of codes or concepts specified in the provided value (comma separated list)."; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case EQUAL: return "Equals"; - case ISA: return "Is A (by subsumption)"; - case ISNOTA: return "Not (Is A) (by subsumption)"; - case REGEX: return "Regular Expression"; - case IN: return "In Set"; - case NOTIN: return "Not in Set"; - default: return "?"; - } - } - } - - public static class FilterOperatorEnumFactory implements EnumFactory { - public FilterOperator fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return FilterOperator.EQUAL; - if ("is-a".equals(codeString)) - return FilterOperator.ISA; - if ("is-not-a".equals(codeString)) - return FilterOperator.ISNOTA; - if ("regex".equals(codeString)) - return FilterOperator.REGEX; - if ("in".equals(codeString)) - return FilterOperator.IN; - if ("not-in".equals(codeString)) - return FilterOperator.NOTIN; - throw new IllegalArgumentException("Unknown FilterOperator code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("=".equals(codeString)) - return new Enumeration(this, FilterOperator.EQUAL); - if ("is-a".equals(codeString)) - return new Enumeration(this, FilterOperator.ISA); - if ("is-not-a".equals(codeString)) - return new Enumeration(this, FilterOperator.ISNOTA); - if ("regex".equals(codeString)) - return new Enumeration(this, FilterOperator.REGEX); - if ("in".equals(codeString)) - return new Enumeration(this, FilterOperator.IN); - if ("not-in".equals(codeString)) - return new Enumeration(this, FilterOperator.NOTIN); - throw new FHIRException("Unknown FilterOperator code '"+codeString+"'"); - } - public String toCode(FilterOperator code) { - if (code == FilterOperator.EQUAL) - return "="; - if (code == FilterOperator.ISA) - return "is-a"; - if (code == FilterOperator.ISNOTA) - return "is-not-a"; - if (code == FilterOperator.REGEX) - return "regex"; - if (code == FilterOperator.IN) - return "in"; - if (code == FilterOperator.NOTIN) - return "not-in"; - return "?"; - } - public String toSystem(FilterOperator code) { - return code.getSystem(); - } - } - - @Block() - public static class ValueSetContactComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of an individual to contact regarding the value set. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of an individual to contact", formalDefinition="The name of an individual to contact regarding the value set." ) - protected StringType name; - - /** - * Contact details for individual (if a name was provided) or the publisher. - */ - @Child(name = "telecom", type = {ContactPoint.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details for individual or publisher", formalDefinition="Contact details for individual (if a name was provided) or the publisher." ) - protected List telecom; - - private static final long serialVersionUID = -1179697803L; - - /** - * Constructor - */ - public ValueSetContactComponent() { - super(); - } - - /** - * @return {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetContactComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of an individual to contact regarding the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSetContactComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of an individual to contact regarding the value set. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of an individual to contact regarding the value set. - */ - public ValueSetContactComponent setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - public List getTelecom() { - if (this.telecom == null) - this.telecom = new ArrayList(); - return this.telecom; - } - - public boolean hasTelecom() { - if (this.telecom == null) - return false; - for (ContactPoint item : this.telecom) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #telecom} (Contact details for individual (if a name was provided) or the publisher.) - */ - // syntactic sugar - public ContactPoint addTelecom() { //3 - ContactPoint t = new ContactPoint(); - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return t; - } - - // syntactic sugar - public ValueSetContactComponent addTelecom(ContactPoint t) { //3 - if (t == null) - return this; - if (this.telecom == null) - this.telecom = new ArrayList(); - this.telecom.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of an individual to contact regarding the value set.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("telecom", "ContactPoint", "Contact details for individual (if a name was provided) or the publisher.", 0, java.lang.Integer.MAX_VALUE, telecom)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -1429363305: /*telecom*/ return this.telecom == null ? new Base[0] : this.telecom.toArray(new Base[this.telecom.size()]); // ContactPoint - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -1429363305: // telecom - this.getTelecom().add(castToContactPoint(value)); // ContactPoint - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("telecom")) - this.getTelecom().add(castToContactPoint(value)); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1429363305: return addTelecom(); // ContactPoint - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name"); - } - else if (name.equals("telecom")) { - return addTelecom(); - } - else - return super.addChild(name); - } - - public ValueSetContactComponent copy() { - ValueSetContactComponent dst = new ValueSetContactComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - if (telecom != null) { - dst.telecom = new ArrayList(); - for (ContactPoint i : telecom) - dst.telecom.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetContactComponent)) - return false; - ValueSetContactComponent o = (ValueSetContactComponent) other; - return compareDeep(name, o.name, true) && compareDeep(telecom, o.telecom, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetContactComponent)) - return false; - ValueSetContactComponent o = (ValueSetContactComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (telecom == null || telecom.isEmpty()) - ; - } - - public String fhirType() { - return "ValueSet.contact"; - - } - - } - - @Block() - public static class ValueSetComposeComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri. - */ - @Child(name = "import", type = {UriType.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Import the contents of another value set", formalDefinition="Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri." ) - protected List import_; - - /** - * Include one or more codes from a code system. - */ - @Child(name = "include", type = {}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Include one or more codes from a code system", formalDefinition="Include one or more codes from a code system." ) - protected List include; - - /** - * Exclude one or more codes from the value set. - */ - @Child(name = "exclude", type = {ConceptSetComponent.class}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Explicitly exclude codes", formalDefinition="Exclude one or more codes from the value set." ) - protected List exclude; - - private static final long serialVersionUID = -703166694L; - - /** - * Constructor - */ - public ValueSetComposeComponent() { - super(); - } - - /** - * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - public List getImport() { - if (this.import_ == null) - this.import_ = new ArrayList(); - return this.import_; - } - - public boolean hasImport() { - if (this.import_ == null) - return false; - for (UriType item : this.import_) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - // syntactic sugar - public UriType addImportElement() {//2 - UriType t = new UriType(); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return t; - } - - /** - * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - public ValueSetComposeComponent addImport(String value) { //1 - UriType t = new UriType(); - t.setValue(value); - if (this.import_ == null) - this.import_ = new ArrayList(); - this.import_.add(t); - return this; - } - - /** - * @param value {@link #import_} (Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.) - */ - public boolean hasImport(String value) { - if (this.import_ == null) - return false; - for (UriType v : this.import_) - if (v.equals(value)) // uri - return true; - return false; - } - - /** - * @return {@link #include} (Include one or more codes from a code system.) - */ - public List getInclude() { - if (this.include == null) - this.include = new ArrayList(); - return this.include; - } - - public boolean hasInclude() { - if (this.include == null) - return false; - for (ConceptSetComponent item : this.include) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #include} (Include one or more codes from a code system.) - */ - // syntactic sugar - public ConceptSetComponent addInclude() { //3 - ConceptSetComponent t = new ConceptSetComponent(); - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return t; - } - - // syntactic sugar - public ValueSetComposeComponent addInclude(ConceptSetComponent t) { //3 - if (t == null) - return this; - if (this.include == null) - this.include = new ArrayList(); - this.include.add(t); - return this; - } - - /** - * @return {@link #exclude} (Exclude one or more codes from the value set.) - */ - public List getExclude() { - if (this.exclude == null) - this.exclude = new ArrayList(); - return this.exclude; - } - - public boolean hasExclude() { - if (this.exclude == null) - return false; - for (ConceptSetComponent item : this.exclude) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #exclude} (Exclude one or more codes from the value set.) - */ - // syntactic sugar - public ConceptSetComponent addExclude() { //3 - ConceptSetComponent t = new ConceptSetComponent(); - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return t; - } - - // syntactic sugar - public ValueSetComposeComponent addExclude(ConceptSetComponent t) { //3 - if (t == null) - return this; - if (this.exclude == null) - this.exclude = new ArrayList(); - this.exclude.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("import", "uri", "Includes the contents of the referenced value set as a part of the contents of this value set. This is an absolute URI that is a reference to ValueSet.uri.", 0, java.lang.Integer.MAX_VALUE, import_)); - childrenList.add(new Property("include", "", "Include one or more codes from a code system.", 0, java.lang.Integer.MAX_VALUE, include)); - childrenList.add(new Property("exclude", "@ValueSet.compose.include", "Exclude one or more codes from the value set.", 0, java.lang.Integer.MAX_VALUE, exclude)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1184795739: /*import*/ return this.import_ == null ? new Base[0] : this.import_.toArray(new Base[this.import_.size()]); // UriType - case 1942574248: /*include*/ return this.include == null ? new Base[0] : this.include.toArray(new Base[this.include.size()]); // ConceptSetComponent - case -1321148966: /*exclude*/ return this.exclude == null ? new Base[0] : this.exclude.toArray(new Base[this.exclude.size()]); // ConceptSetComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1184795739: // import - this.getImport().add(castToUri(value)); // UriType - break; - case 1942574248: // include - this.getInclude().add((ConceptSetComponent) value); // ConceptSetComponent - break; - case -1321148966: // exclude - this.getExclude().add((ConceptSetComponent) value); // ConceptSetComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("import")) - this.getImport().add(castToUri(value)); - else if (name.equals("include")) - this.getInclude().add((ConceptSetComponent) value); - else if (name.equals("exclude")) - this.getExclude().add((ConceptSetComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1184795739: throw new FHIRException("Cannot make property import as it is not a complex type"); // UriType - case 1942574248: return addInclude(); // ConceptSetComponent - case -1321148966: return addExclude(); // ConceptSetComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("import")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.import"); - } - else if (name.equals("include")) { - return addInclude(); - } - else if (name.equals("exclude")) { - return addExclude(); - } - else - return super.addChild(name); - } - - public ValueSetComposeComponent copy() { - ValueSetComposeComponent dst = new ValueSetComposeComponent(); - copyValues(dst); - if (import_ != null) { - dst.import_ = new ArrayList(); - for (UriType i : import_) - dst.import_.add(i.copy()); - }; - if (include != null) { - dst.include = new ArrayList(); - for (ConceptSetComponent i : include) - dst.include.add(i.copy()); - }; - if (exclude != null) { - dst.exclude = new ArrayList(); - for (ConceptSetComponent i : exclude) - dst.exclude.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetComposeComponent)) - return false; - ValueSetComposeComponent o = (ValueSetComposeComponent) other; - return compareDeep(import_, o.import_, true) && compareDeep(include, o.include, true) && compareDeep(exclude, o.exclude, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetComposeComponent)) - return false; - ValueSetComposeComponent o = (ValueSetComposeComponent) other; - return compareValues(import_, o.import_, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (import_ == null || import_.isEmpty()) && (include == null || include.isEmpty()) - && (exclude == null || exclude.isEmpty()); - } - - public String fhirType() { - return "ValueSet.compose"; - - } - - } - - @Block() - public static class ConceptSetComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI which is the code system from which the selected codes come from. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="The system the codes come from", formalDefinition="An absolute URI which is the code system from which the selected codes come from." ) - protected UriType system; - - /** - * The version of the code system that the codes are selected from. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Specific version of the code system referred to", formalDefinition="The version of the code system that the codes are selected from." ) - protected StringType version; - - /** - * Specifies a concept to be included or excluded. - */ - @Child(name = "concept", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="A concept defined in the system", formalDefinition="Specifies a concept to be included or excluded." ) - protected List concept; - - /** - * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true. - */ - @Child(name = "filter", type = {}, order=4, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Select codes/concepts by their properties (including relationships)", formalDefinition="Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true." ) - protected List filter; - - private static final long serialVersionUID = -196054471L; - - /** - * Constructor - */ - public ConceptSetComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptSetComponent(UriType system) { - super(); - this.system = system; - } - - /** - * @return {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI which is the code system from which the selected codes come from.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ConceptSetComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI which is the code system from which the selected codes come from. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI which is the code system from which the selected codes come from. - */ - public ConceptSetComponent setSystem(String value) { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of the code system that the codes are selected from.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ConceptSetComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of the code system that the codes are selected from. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of the code system that the codes are selected from. - */ - public ConceptSetComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #concept} (Specifies a concept to be included or excluded.) - */ - public List getConcept() { - if (this.concept == null) - this.concept = new ArrayList(); - return this.concept; - } - - public boolean hasConcept() { - if (this.concept == null) - return false; - for (ConceptReferenceComponent item : this.concept) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #concept} (Specifies a concept to be included or excluded.) - */ - // syntactic sugar - public ConceptReferenceComponent addConcept() { //3 - ConceptReferenceComponent t = new ConceptReferenceComponent(); - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return t; - } - - // syntactic sugar - public ConceptSetComponent addConcept(ConceptReferenceComponent t) { //3 - if (t == null) - return this; - if (this.concept == null) - this.concept = new ArrayList(); - this.concept.add(t); - return this; - } - - /** - * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) - */ - public List getFilter() { - if (this.filter == null) - this.filter = new ArrayList(); - return this.filter; - } - - public boolean hasFilter() { - if (this.filter == null) - return false; - for (ConceptSetFilterComponent item : this.filter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #filter} (Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.) - */ - // syntactic sugar - public ConceptSetFilterComponent addFilter() { //3 - ConceptSetFilterComponent t = new ConceptSetFilterComponent(); - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return t; - } - - // syntactic sugar - public ConceptSetComponent addFilter(ConceptSetFilterComponent t) { //3 - if (t == null) - return this; - if (this.filter == null) - this.filter = new ArrayList(); - this.filter.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI which is the code system from which the selected codes come from.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("version", "string", "The version of the code system that the codes are selected from.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("concept", "", "Specifies a concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, concept)); - childrenList.add(new Property("filter", "", "Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. If multiple filters are specified, they SHALL all be true.", 0, java.lang.Integer.MAX_VALUE, filter)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 951024232: /*concept*/ return this.concept == null ? new Base[0] : this.concept.toArray(new Base[this.concept.size()]); // ConceptReferenceComponent - case -1274492040: /*filter*/ return this.filter == null ? new Base[0] : this.filter.toArray(new Base[this.filter.size()]); // ConceptSetFilterComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 951024232: // concept - this.getConcept().add((ConceptReferenceComponent) value); // ConceptReferenceComponent - break; - case -1274492040: // filter - this.getFilter().add((ConceptSetFilterComponent) value); // ConceptSetFilterComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("concept")) - this.getConcept().add((ConceptReferenceComponent) value); - else if (name.equals("filter")) - this.getFilter().add((ConceptSetFilterComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 951024232: return addConcept(); // ConceptReferenceComponent - case -1274492040: return addFilter(); // ConceptSetFilterComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); - } - else if (name.equals("concept")) { - return addConcept(); - } - else if (name.equals("filter")) { - return addFilter(); - } - else - return super.addChild(name); - } - - public ConceptSetComponent copy() { - ConceptSetComponent dst = new ConceptSetComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.version = version == null ? null : version.copy(); - if (concept != null) { - dst.concept = new ArrayList(); - for (ConceptReferenceComponent i : concept) - dst.concept.add(i.copy()); - }; - if (filter != null) { - dst.filter = new ArrayList(); - for (ConceptSetFilterComponent i : filter) - dst.filter.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptSetComponent)) - return false; - ConceptSetComponent o = (ConceptSetComponent) other; - return compareDeep(system, o.system, true) && compareDeep(version, o.version, true) && compareDeep(concept, o.concept, true) - && compareDeep(filter, o.filter, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptSetComponent)) - return false; - ConceptSetComponent o = (ConceptSetComponent) other; - return compareValues(system, o.system, true) && compareValues(version, o.version, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (version == null || version.isEmpty()) - && (concept == null || concept.isEmpty()) && (filter == null || filter.isEmpty()); - } - - public String fhirType() { - return "ValueSet.compose.include"; - - } - - } - - @Block() - public static class ConceptReferenceComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Specifies a code for the concept to be included or excluded. - */ - @Child(name = "code", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code or expression from system", formalDefinition="Specifies a code for the concept to be included or excluded." ) - protected CodeType code; - - /** - * The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - @Child(name = "display", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Test to display for this code for this value set", formalDefinition="The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system." ) - protected StringType display; - - /** - * Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc. - */ - @Child(name = "designation", type = {}, order=3, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Additional representations for this valueset", formalDefinition="Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc." ) - protected List designation; - - private static final long serialVersionUID = 260579971L; - - /** - * Constructor - */ - public ConceptReferenceComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptReferenceComponent(CodeType code) { - super(); - this.code = code; - } - - /** - * @return {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (Specifies a code for the concept to be included or excluded.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ConceptReferenceComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return Specifies a code for the concept to be included or excluded. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value Specifies a code for the concept to be included or excluded. - */ - public ConceptReferenceComponent setCode(String value) { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - return this; - } - - /** - * @return {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ConceptReferenceComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system. - */ - public ConceptReferenceComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.) - */ - public List getDesignation() { - if (this.designation == null) - this.designation = new ArrayList(); - return this.designation; - } - - public boolean hasDesignation() { - if (this.designation == null) - return false; - for (ConceptReferenceDesignationComponent item : this.designation) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #designation} (Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.) - */ - // syntactic sugar - public ConceptReferenceDesignationComponent addDesignation() { //3 - ConceptReferenceDesignationComponent t = new ConceptReferenceDesignationComponent(); - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return t; - } - - // syntactic sugar - public ConceptReferenceComponent addDesignation(ConceptReferenceDesignationComponent t) { //3 - if (t == null) - return this; - if (this.designation == null) - this.designation = new ArrayList(); - this.designation.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("code", "code", "Specifies a code for the concept to be included or excluded.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "The text to display to the user for this concept in the context of this valueset. If no display is provided, then applications using the value set use the display specified for the code by the system.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("designation", "", "Additional representations for this concept when used in this value set - other languages, aliases, specialized purposes, used for particular purposes, etc.", 0, java.lang.Integer.MAX_VALUE, designation)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - case -900931593: /*designation*/ return this.designation == null ? new Base[0] : this.designation.toArray(new Base[this.designation.size()]); // ConceptReferenceDesignationComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - case -900931593: // designation - this.getDesignation().add((ConceptReferenceDesignationComponent) value); // ConceptReferenceDesignationComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else if (name.equals("designation")) - this.getDesignation().add((ConceptReferenceDesignationComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - case -900931593: return addDesignation(); // ConceptReferenceDesignationComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display"); - } - else if (name.equals("designation")) { - return addDesignation(); - } - else - return super.addChild(name); - } - - public ConceptReferenceComponent copy() { - ConceptReferenceComponent dst = new ConceptReferenceComponent(); - copyValues(dst); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - if (designation != null) { - dst.designation = new ArrayList(); - for (ConceptReferenceDesignationComponent i : designation) - dst.designation.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptReferenceComponent)) - return false; - ConceptReferenceComponent o = (ConceptReferenceComponent) other; - return compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(designation, o.designation, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptReferenceComponent)) - return false; - ConceptReferenceComponent o = (ConceptReferenceComponent) other; - return compareValues(code, o.code, true) && compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (designation == null || designation.isEmpty()); - } - - public String fhirType() { - return "ValueSet.compose.include.concept"; - - } - - } - - @Block() - public static class ConceptReferenceDesignationComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The language this designation is defined for. - */ - @Child(name = "language", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Human language of the designation", formalDefinition="The language this designation is defined for." ) - protected CodeType language; - - /** - * A code that details how this designation would be used. - */ - @Child(name = "use", type = {Coding.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Details how this designation would be used", formalDefinition="A code that details how this designation would be used." ) - protected Coding use; - - /** - * The text value for this designation. - */ - @Child(name = "value", type = {StringType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="The text value for this designation", formalDefinition="The text value for this designation." ) - protected StringType value; - - private static final long serialVersionUID = 1515662414L; - - /** - * Constructor - */ - public ConceptReferenceDesignationComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptReferenceDesignationComponent(StringType value) { - super(); - this.value = value; - } - - /** - * @return {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public CodeType getLanguageElement() { - if (this.language == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.language"); - else if (Configuration.doAutoCreate()) - this.language = new CodeType(); // bb - return this.language; - } - - public boolean hasLanguageElement() { - return this.language != null && !this.language.isEmpty(); - } - - public boolean hasLanguage() { - return this.language != null && !this.language.isEmpty(); - } - - /** - * @param value {@link #language} (The language this designation is defined for.). This is the underlying object with id, value and extensions. The accessor "getLanguage" gives direct access to the value - */ - public ConceptReferenceDesignationComponent setLanguageElement(CodeType value) { - this.language = value; - return this; - } - - /** - * @return The language this designation is defined for. - */ - public String getLanguage() { - return this.language == null ? null : this.language.getValue(); - } - - /** - * @param value The language this designation is defined for. - */ - public ConceptReferenceDesignationComponent setLanguage(String value) { - if (Utilities.noString(value)) - this.language = null; - else { - if (this.language == null) - this.language = new CodeType(); - this.language.setValue(value); - } - return this; - } - - /** - * @return {@link #use} (A code that details how this designation would be used.) - */ - public Coding getUse() { - if (this.use == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.use"); - else if (Configuration.doAutoCreate()) - this.use = new Coding(); // cc - return this.use; - } - - public boolean hasUse() { - return this.use != null && !this.use.isEmpty(); - } - - /** - * @param value {@link #use} (A code that details how this designation would be used.) - */ - public ConceptReferenceDesignationComponent setUse(Coding value) { - this.use = value; - return this; - } - - /** - * @return {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public StringType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptReferenceDesignationComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new StringType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The text value for this designation.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptReferenceDesignationComponent setValueElement(StringType value) { - this.value = value; - return this; - } - - /** - * @return The text value for this designation. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The text value for this designation. - */ - public ConceptReferenceDesignationComponent setValue(String value) { - if (this.value == null) - this.value = new StringType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("language", "code", "The language this designation is defined for.", 0, java.lang.Integer.MAX_VALUE, language)); - childrenList.add(new Property("use", "Coding", "A code that details how this designation would be used.", 0, java.lang.Integer.MAX_VALUE, use)); - childrenList.add(new Property("value", "string", "The text value for this designation.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeType - case 116103: /*use*/ return this.use == null ? new Base[0] : new Base[] {this.use}; // Coding - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1613589672: // language - this.language = castToCode(value); // CodeType - break; - case 116103: // use - this.use = castToCoding(value); // Coding - break; - case 111972721: // value - this.value = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("language")) - this.language = castToCode(value); // CodeType - else if (name.equals("use")) - this.use = castToCoding(value); // Coding - else if (name.equals("value")) - this.value = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1613589672: throw new FHIRException("Cannot make property language as it is not a complex type"); // CodeType - case 116103: return getUse(); // Coding - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("language")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.language"); - } - else if (name.equals("use")) { - this.use = new Coding(); - return this.use; - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.value"); - } - else - return super.addChild(name); - } - - public ConceptReferenceDesignationComponent copy() { - ConceptReferenceDesignationComponent dst = new ConceptReferenceDesignationComponent(); - copyValues(dst); - dst.language = language == null ? null : language.copy(); - dst.use = use == null ? null : use.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptReferenceDesignationComponent)) - return false; - ConceptReferenceDesignationComponent o = (ConceptReferenceDesignationComponent) other; - return compareDeep(language, o.language, true) && compareDeep(use, o.use, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptReferenceDesignationComponent)) - return false; - ConceptReferenceDesignationComponent o = (ConceptReferenceDesignationComponent) other; - return compareValues(language, o.language, true) && compareValues(value, o.value, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (language == null || language.isEmpty()) && (use == null || use.isEmpty()) - && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ValueSet.compose.include.concept.designation"; - - } - - } - - @Block() - public static class ConceptSetFilterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * A code that identifies a property defined in the code system. - */ - @Child(name = "property", type = {CodeType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="A property defined by the code system", formalDefinition="A code that identifies a property defined in the code system." ) - protected CodeType property; - - /** - * The kind of operation to perform as a part of the filter criteria. - */ - @Child(name = "op", type = {CodeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="= | is-a | is-not-a | regex | in | not-in", formalDefinition="The kind of operation to perform as a part of the filter criteria." ) - protected Enumeration op; - - /** - * The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value. - */ - @Child(name = "value", type = {CodeType.class}, order=3, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code from the system, or regex criteria", formalDefinition="The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value." ) - protected CodeType value; - - private static final long serialVersionUID = 1985515000L; - - /** - * Constructor - */ - public ConceptSetFilterComponent() { - super(); - } - - /** - * Constructor - */ - public ConceptSetFilterComponent(CodeType property, Enumeration op, CodeType value) { - super(); - this.property = property; - this.op = op; - this.value = value; - } - - /** - * @return {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value - */ - public CodeType getPropertyElement() { - if (this.property == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.property"); - else if (Configuration.doAutoCreate()) - this.property = new CodeType(); // bb - return this.property; - } - - public boolean hasPropertyElement() { - return this.property != null && !this.property.isEmpty(); - } - - public boolean hasProperty() { - return this.property != null && !this.property.isEmpty(); - } - - /** - * @param value {@link #property} (A code that identifies a property defined in the code system.). This is the underlying object with id, value and extensions. The accessor "getProperty" gives direct access to the value - */ - public ConceptSetFilterComponent setPropertyElement(CodeType value) { - this.property = value; - return this; - } - - /** - * @return A code that identifies a property defined in the code system. - */ - public String getProperty() { - return this.property == null ? null : this.property.getValue(); - } - - /** - * @param value A code that identifies a property defined in the code system. - */ - public ConceptSetFilterComponent setProperty(String value) { - if (this.property == null) - this.property = new CodeType(); - this.property.setValue(value); - return this; - } - - /** - * @return {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value - */ - public Enumeration getOpElement() { - if (this.op == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.op"); - else if (Configuration.doAutoCreate()) - this.op = new Enumeration(new FilterOperatorEnumFactory()); // bb - return this.op; - } - - public boolean hasOpElement() { - return this.op != null && !this.op.isEmpty(); - } - - public boolean hasOp() { - return this.op != null && !this.op.isEmpty(); - } - - /** - * @param value {@link #op} (The kind of operation to perform as a part of the filter criteria.). This is the underlying object with id, value and extensions. The accessor "getOp" gives direct access to the value - */ - public ConceptSetFilterComponent setOpElement(Enumeration value) { - this.op = value; - return this; - } - - /** - * @return The kind of operation to perform as a part of the filter criteria. - */ - public FilterOperator getOp() { - return this.op == null ? null : this.op.getValue(); - } - - /** - * @param value The kind of operation to perform as a part of the filter criteria. - */ - public ConceptSetFilterComponent setOp(FilterOperator value) { - if (this.op == null) - this.op = new Enumeration(new FilterOperatorEnumFactory()); - this.op.setValue(value); - return this; - } - - /** - * @return {@link #value} (The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public CodeType getValueElement() { - if (this.value == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ConceptSetFilterComponent.value"); - else if (Configuration.doAutoCreate()) - this.value = new CodeType(); // bb - return this.value; - } - - public boolean hasValueElement() { - return this.value != null && !this.value.isEmpty(); - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value - */ - public ConceptSetFilterComponent setValueElement(CodeType value) { - this.value = value; - return this; - } - - /** - * @return The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value. - */ - public String getValue() { - return this.value == null ? null : this.value.getValue(); - } - - /** - * @param value The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value. - */ - public ConceptSetFilterComponent setValue(String value) { - if (this.value == null) - this.value = new CodeType(); - this.value.setValue(value); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("property", "code", "A code that identifies a property defined in the code system.", 0, java.lang.Integer.MAX_VALUE, property)); - childrenList.add(new Property("op", "code", "The kind of operation to perform as a part of the filter criteria.", 0, java.lang.Integer.MAX_VALUE, op)); - childrenList.add(new Property("value", "code", "The match value may be either a code defined by the system, or a string value, which is a regex match on the literal string of the property value.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -993141291: /*property*/ return this.property == null ? new Base[0] : new Base[] {this.property}; // CodeType - case 3553: /*op*/ return this.op == null ? new Base[0] : new Base[] {this.op}; // Enumeration - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // CodeType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -993141291: // property - this.property = castToCode(value); // CodeType - break; - case 3553: // op - this.op = new FilterOperatorEnumFactory().fromType(value); // Enumeration - break; - case 111972721: // value - this.value = castToCode(value); // CodeType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("property")) - this.property = castToCode(value); // CodeType - else if (name.equals("op")) - this.op = new FilterOperatorEnumFactory().fromType(value); // Enumeration - else if (name.equals("value")) - this.value = castToCode(value); // CodeType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -993141291: throw new FHIRException("Cannot make property property as it is not a complex type"); // CodeType - case 3553: throw new FHIRException("Cannot make property op as it is not a complex type"); // Enumeration - case 111972721: throw new FHIRException("Cannot make property value as it is not a complex type"); // CodeType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("property")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.property"); - } - else if (name.equals("op")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.op"); - } - else if (name.equals("value")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.value"); - } - else - return super.addChild(name); - } - - public ConceptSetFilterComponent copy() { - ConceptSetFilterComponent dst = new ConceptSetFilterComponent(); - copyValues(dst); - dst.property = property == null ? null : property.copy(); - dst.op = op == null ? null : op.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ConceptSetFilterComponent)) - return false; - ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; - return compareDeep(property, o.property, true) && compareDeep(op, o.op, true) && compareDeep(value, o.value, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ConceptSetFilterComponent)) - return false; - ConceptSetFilterComponent o = (ConceptSetFilterComponent) other; - return compareValues(property, o.property, true) && compareValues(op, o.op, true) && compareValues(value, o.value, true) - ; - } - - public boolean isEmpty() { - return super.isEmpty() && (property == null || property.isEmpty()) && (op == null || op.isEmpty()) - && (value == null || value.isEmpty()); - } - - public String fhirType() { - return "ValueSet.compose.include.filter"; - - } - - } - - @Block() - public static class ValueSetExpansionComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - @Child(name = "identifier", type = {UriType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Uniquely identifies this expansion", formalDefinition="An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so." ) - protected UriType identifier; - - /** - * The time at which the expansion was produced by the expanding system. - */ - @Child(name = "timestamp", type = {DateTimeType.class}, order=2, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Time ValueSet expansion happened", formalDefinition="The time at which the expansion was produced by the expanding system." ) - protected DateTimeType timestamp; - - /** - * The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. - */ - @Child(name = "total", type = {IntegerType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Total number of codes in the expansion", formalDefinition="The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter." ) - protected IntegerType total; - - /** - * If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present. - */ - @Child(name = "offset", type = {IntegerType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Offset at which this resource starts", formalDefinition="If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present." ) - protected IntegerType offset; - - /** - * A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. - */ - @Child(name = "parameter", type = {}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Parameter that controlled the expansion process", formalDefinition="A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion." ) - protected List parameter; - - /** - * The codes that are contained in the value set expansion. - */ - @Child(name = "contains", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Codes in the value set", formalDefinition="The codes that are contained in the value set expansion." ) - protected List contains; - - private static final long serialVersionUID = -43471993L; - - /** - * Constructor - */ - public ValueSetExpansionComponent() { - super(); - } - - /** - * Constructor - */ - public ValueSetExpansionComponent(UriType identifier, DateTimeType timestamp) { - super(); - this.identifier = identifier; - this.timestamp = timestamp; - } - - /** - * @return {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public UriType getIdentifierElement() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new UriType(); // bb - return this.identifier; - } - - public boolean hasIdentifierElement() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.). This is the underlying object with id, value and extensions. The accessor "getIdentifier" gives direct access to the value - */ - public ValueSetExpansionComponent setIdentifierElement(UriType value) { - this.identifier = value; - return this; - } - - /** - * @return An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - public String getIdentifier() { - return this.identifier == null ? null : this.identifier.getValue(); - } - - /** - * @param value An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so. - */ - public ValueSetExpansionComponent setIdentifier(String value) { - if (this.identifier == null) - this.identifier = new UriType(); - this.identifier.setValue(value); - return this; - } - - /** - * @return {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public DateTimeType getTimestampElement() { - if (this.timestamp == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.timestamp"); - else if (Configuration.doAutoCreate()) - this.timestamp = new DateTimeType(); // bb - return this.timestamp; - } - - public boolean hasTimestampElement() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - public boolean hasTimestamp() { - return this.timestamp != null && !this.timestamp.isEmpty(); - } - - /** - * @param value {@link #timestamp} (The time at which the expansion was produced by the expanding system.). This is the underlying object with id, value and extensions. The accessor "getTimestamp" gives direct access to the value - */ - public ValueSetExpansionComponent setTimestampElement(DateTimeType value) { - this.timestamp = value; - return this; - } - - /** - * @return The time at which the expansion was produced by the expanding system. - */ - public Date getTimestamp() { - return this.timestamp == null ? null : this.timestamp.getValue(); - } - - /** - * @param value The time at which the expansion was produced by the expanding system. - */ - public ValueSetExpansionComponent setTimestamp(Date value) { - if (this.timestamp == null) - this.timestamp = new DateTimeType(); - this.timestamp.setValue(value); - return this; - } - - /** - * @return {@link #total} (The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public IntegerType getTotalElement() { - if (this.total == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.total"); - else if (Configuration.doAutoCreate()) - this.total = new IntegerType(); // bb - return this.total; - } - - public boolean hasTotalElement() { - return this.total != null && !this.total.isEmpty(); - } - - public boolean hasTotal() { - return this.total != null && !this.total.isEmpty(); - } - - /** - * @param value {@link #total} (The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.). This is the underlying object with id, value and extensions. The accessor "getTotal" gives direct access to the value - */ - public ValueSetExpansionComponent setTotalElement(IntegerType value) { - this.total = value; - return this; - } - - /** - * @return The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. - */ - public int getTotal() { - return this.total == null || this.total.isEmpty() ? 0 : this.total.getValue(); - } - - /** - * @param value The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter. - */ - public ValueSetExpansionComponent setTotal(int value) { - if (this.total == null) - this.total = new IntegerType(); - this.total.setValue(value); - return this; - } - - /** - * @return {@link #offset} (If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value - */ - public IntegerType getOffsetElement() { - if (this.offset == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionComponent.offset"); - else if (Configuration.doAutoCreate()) - this.offset = new IntegerType(); // bb - return this.offset; - } - - public boolean hasOffsetElement() { - return this.offset != null && !this.offset.isEmpty(); - } - - public boolean hasOffset() { - return this.offset != null && !this.offset.isEmpty(); - } - - /** - * @param value {@link #offset} (If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.). This is the underlying object with id, value and extensions. The accessor "getOffset" gives direct access to the value - */ - public ValueSetExpansionComponent setOffsetElement(IntegerType value) { - this.offset = value; - return this; - } - - /** - * @return If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present. - */ - public int getOffset() { - return this.offset == null || this.offset.isEmpty() ? 0 : this.offset.getValue(); - } - - /** - * @param value If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present. - */ - public ValueSetExpansionComponent setOffset(int value) { - if (this.offset == null) - this.offset = new IntegerType(); - this.offset.setValue(value); - return this; - } - - /** - * @return {@link #parameter} (A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) - */ - public List getParameter() { - if (this.parameter == null) - this.parameter = new ArrayList(); - return this.parameter; - } - - public boolean hasParameter() { - if (this.parameter == null) - return false; - for (ValueSetExpansionParameterComponent item : this.parameter) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #parameter} (A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.) - */ - // syntactic sugar - public ValueSetExpansionParameterComponent addParameter() { //3 - ValueSetExpansionParameterComponent t = new ValueSetExpansionParameterComponent(); - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return t; - } - - // syntactic sugar - public ValueSetExpansionComponent addParameter(ValueSetExpansionParameterComponent t) { //3 - if (t == null) - return this; - if (this.parameter == null) - this.parameter = new ArrayList(); - this.parameter.add(t); - return this; - } - - /** - * @return {@link #contains} (The codes that are contained in the value set expansion.) - */ - public List getContains() { - if (this.contains == null) - this.contains = new ArrayList(); - return this.contains; - } - - public boolean hasContains() { - if (this.contains == null) - return false; - for (ValueSetExpansionContainsComponent item : this.contains) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contains} (The codes that are contained in the value set expansion.) - */ - // syntactic sugar - public ValueSetExpansionContainsComponent addContains() { //3 - ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return t; - } - - // syntactic sugar - public ValueSetExpansionComponent addContains(ValueSetExpansionContainsComponent t) { //3 - if (t == null) - return this; - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "uri", "An identifier that uniquely identifies this expansion of the valueset. Systems may re-use the same identifier as long as the expansion and the definition remain the same, but are not required to do so.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("timestamp", "dateTime", "The time at which the expansion was produced by the expanding system.", 0, java.lang.Integer.MAX_VALUE, timestamp)); - childrenList.add(new Property("total", "integer", "The total number of concepts in the expansion. If the number of concept nodes in this resource is less than the stated number, then the server can return more using the offset parameter.", 0, java.lang.Integer.MAX_VALUE, total)); - childrenList.add(new Property("offset", "integer", "If paging is being used, the offset at which this resource starts. I.e. this resource is a partial view into the expansion. If paging is not being used, this element SHALL not be present.", 0, java.lang.Integer.MAX_VALUE, offset)); - childrenList.add(new Property("parameter", "", "A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check whether the expansion is suitable for a particular purpose, or to pick the correct expansion.", 0, java.lang.Integer.MAX_VALUE, parameter)); - childrenList.add(new Property("contains", "", "The codes that are contained in the value set expansion.", 0, java.lang.Integer.MAX_VALUE, contains)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // UriType - case 55126294: /*timestamp*/ return this.timestamp == null ? new Base[0] : new Base[] {this.timestamp}; // DateTimeType - case 110549828: /*total*/ return this.total == null ? new Base[0] : new Base[] {this.total}; // IntegerType - case -1019779949: /*offset*/ return this.offset == null ? new Base[0] : new Base[] {this.offset}; // IntegerType - case 1954460585: /*parameter*/ return this.parameter == null ? new Base[0] : this.parameter.toArray(new Base[this.parameter.size()]); // ValueSetExpansionParameterComponent - case -567445985: /*contains*/ return this.contains == null ? new Base[0] : this.contains.toArray(new Base[this.contains.size()]); // ValueSetExpansionContainsComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.identifier = castToUri(value); // UriType - break; - case 55126294: // timestamp - this.timestamp = castToDateTime(value); // DateTimeType - break; - case 110549828: // total - this.total = castToInteger(value); // IntegerType - break; - case -1019779949: // offset - this.offset = castToInteger(value); // IntegerType - break; - case 1954460585: // parameter - this.getParameter().add((ValueSetExpansionParameterComponent) value); // ValueSetExpansionParameterComponent - break; - case -567445985: // contains - this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.identifier = castToUri(value); // UriType - else if (name.equals("timestamp")) - this.timestamp = castToDateTime(value); // DateTimeType - else if (name.equals("total")) - this.total = castToInteger(value); // IntegerType - else if (name.equals("offset")) - this.offset = castToInteger(value); // IntegerType - else if (name.equals("parameter")) - this.getParameter().add((ValueSetExpansionParameterComponent) value); - else if (name.equals("contains")) - this.getContains().add((ValueSetExpansionContainsComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: throw new FHIRException("Cannot make property identifier as it is not a complex type"); // UriType - case 55126294: throw new FHIRException("Cannot make property timestamp as it is not a complex type"); // DateTimeType - case 110549828: throw new FHIRException("Cannot make property total as it is not a complex type"); // IntegerType - case -1019779949: throw new FHIRException("Cannot make property offset as it is not a complex type"); // IntegerType - case 1954460585: return addParameter(); // ValueSetExpansionParameterComponent - case -567445985: return addContains(); // ValueSetExpansionContainsComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.identifier"); - } - else if (name.equals("timestamp")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.timestamp"); - } - else if (name.equals("total")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.total"); - } - else if (name.equals("offset")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.offset"); - } - else if (name.equals("parameter")) { - return addParameter(); - } - else if (name.equals("contains")) { - return addContains(); - } - else - return super.addChild(name); - } - - public ValueSetExpansionComponent copy() { - ValueSetExpansionComponent dst = new ValueSetExpansionComponent(); - copyValues(dst); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.timestamp = timestamp == null ? null : timestamp.copy(); - dst.total = total == null ? null : total.copy(); - dst.offset = offset == null ? null : offset.copy(); - if (parameter != null) { - dst.parameter = new ArrayList(); - for (ValueSetExpansionParameterComponent i : parameter) - dst.parameter.add(i.copy()); - }; - if (contains != null) { - dst.contains = new ArrayList(); - for (ValueSetExpansionContainsComponent i : contains) - dst.contains.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetExpansionComponent)) - return false; - ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(timestamp, o.timestamp, true) - && compareDeep(total, o.total, true) && compareDeep(offset, o.offset, true) && compareDeep(parameter, o.parameter, true) - && compareDeep(contains, o.contains, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetExpansionComponent)) - return false; - ValueSetExpansionComponent o = (ValueSetExpansionComponent) other; - return compareValues(identifier, o.identifier, true) && compareValues(timestamp, o.timestamp, true) - && compareValues(total, o.total, true) && compareValues(offset, o.offset, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (timestamp == null || timestamp.isEmpty()) - && (total == null || total.isEmpty()) && (offset == null || offset.isEmpty()) && (parameter == null || parameter.isEmpty()) - && (contains == null || contains.isEmpty()); - } - - public String fhirType() { - return "ValueSet.expansion"; - - } - - } - - @Block() - public static class ValueSetExpansionParameterComponent extends BackboneElement implements IBaseBackboneElement { - /** - * The name of the parameter. - */ - @Child(name = "name", type = {StringType.class}, order=1, min=1, max=1, modifier=false, summary=false) - @Description(shortDefinition="Name as assigned by the server", formalDefinition="The name of the parameter." ) - protected StringType name; - - /** - * The value of the parameter. - */ - @Child(name = "value", type = {StringType.class, BooleanType.class, IntegerType.class, DecimalType.class, UriType.class, CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Value of the named parameter", formalDefinition="The value of the parameter." ) - protected Type value; - - private static final long serialVersionUID = 1172641169L; - - /** - * Constructor - */ - public ValueSetExpansionParameterComponent() { - super(); - } - - /** - * Constructor - */ - public ValueSetExpansionParameterComponent(StringType name) { - super(); - this.name = name; - } - - /** - * @return {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionParameterComponent.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (The name of the parameter.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSetExpansionParameterComponent setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return The name of the parameter. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value The name of the parameter. - */ - public ValueSetExpansionParameterComponent setName(String value) { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - return this; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public Type getValue() { - return this.value; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public StringType getValueStringType() throws FHIRException { - if (!(this.value instanceof StringType)) - throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (StringType) this.value; - } - - public boolean hasValueStringType() { - return this.value instanceof StringType; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public BooleanType getValueBooleanType() throws FHIRException { - if (!(this.value instanceof BooleanType)) - throw new FHIRException("Type mismatch: the type BooleanType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (BooleanType) this.value; - } - - public boolean hasValueBooleanType() { - return this.value instanceof BooleanType; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public IntegerType getValueIntegerType() throws FHIRException { - if (!(this.value instanceof IntegerType)) - throw new FHIRException("Type mismatch: the type IntegerType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (IntegerType) this.value; - } - - public boolean hasValueIntegerType() { - return this.value instanceof IntegerType; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public DecimalType getValueDecimalType() throws FHIRException { - if (!(this.value instanceof DecimalType)) - throw new FHIRException("Type mismatch: the type DecimalType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (DecimalType) this.value; - } - - public boolean hasValueDecimalType() { - return this.value instanceof DecimalType; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public UriType getValueUriType() throws FHIRException { - if (!(this.value instanceof UriType)) - throw new FHIRException("Type mismatch: the type UriType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (UriType) this.value; - } - - public boolean hasValueUriType() { - return this.value instanceof UriType; - } - - /** - * @return {@link #value} (The value of the parameter.) - */ - public CodeType getValueCodeType() throws FHIRException { - if (!(this.value instanceof CodeType)) - throw new FHIRException("Type mismatch: the type CodeType was expected, but "+this.value.getClass().getName()+" was encountered"); - return (CodeType) this.value; - } - - public boolean hasValueCodeType() { - return this.value instanceof CodeType; - } - - public boolean hasValue() { - return this.value != null && !this.value.isEmpty(); - } - - /** - * @param value {@link #value} (The value of the parameter.) - */ - public ValueSetExpansionParameterComponent setValue(Type value) { - this.value = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("name", "string", "The name of the parameter.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("value[x]", "string|boolean|integer|decimal|uri|code", "The value of the parameter.", 0, java.lang.Integer.MAX_VALUE, value)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 3373707: // name - this.name = castToString(value); // StringType - break; - case 111972721: // value - this.value = (Type) value; // Type - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("value[x]")) - this.value = (Type) value; // Type - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -1410166417: return getValue(); // Type - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name"); - } - else if (name.equals("valueString")) { - this.value = new StringType(); - return this.value; - } - else if (name.equals("valueBoolean")) { - this.value = new BooleanType(); - return this.value; - } - else if (name.equals("valueInteger")) { - this.value = new IntegerType(); - return this.value; - } - else if (name.equals("valueDecimal")) { - this.value = new DecimalType(); - return this.value; - } - else if (name.equals("valueUri")) { - this.value = new UriType(); - return this.value; - } - else if (name.equals("valueCode")) { - this.value = new CodeType(); - return this.value; - } - else - return super.addChild(name); - } - - public ValueSetExpansionParameterComponent copy() { - ValueSetExpansionParameterComponent dst = new ValueSetExpansionParameterComponent(); - copyValues(dst); - dst.name = name == null ? null : name.copy(); - dst.value = value == null ? null : value.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetExpansionParameterComponent)) - return false; - ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; - return compareDeep(name, o.name, true) && compareDeep(value, o.value, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetExpansionParameterComponent)) - return false; - ValueSetExpansionParameterComponent o = (ValueSetExpansionParameterComponent) other; - return compareValues(name, o.name, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (name == null || name.isEmpty()) && (value == null || value.isEmpty()) - ; - } - - public String fhirType() { - return "ValueSet.expansion.parameter"; - - } - - } - - @Block() - public static class ValueSetExpansionContainsComponent extends BackboneElement implements IBaseBackboneElement { - /** - * An absolute URI which is the code system in which the code for this item in the expansion is defined. - */ - @Child(name = "system", type = {UriType.class}, order=1, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="System value for the code", formalDefinition="An absolute URI which is the code system in which the code for this item in the expansion is defined." ) - protected UriType system; - - /** - * If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - @Child(name = "abstract", type = {BooleanType.class}, order=2, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="If user cannot select this entry", formalDefinition="If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value." ) - protected BooleanType abstract_; - - /** - * The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - @Child(name = "version", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Version in which this code/display is defined", formalDefinition="The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence." ) - protected StringType version; - - /** - * The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. - */ - @Child(name = "code", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Code - if blank, this is not a selectable code", formalDefinition="The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set." ) - protected CodeType code; - - /** - * The recommended display for this item in the expansion. - */ - @Child(name = "display", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="User display for the concept", formalDefinition="The recommended display for this item in the expansion." ) - protected StringType display; - - /** - * Other codes and entries contained under this entry in the hierarchy. - */ - @Child(name = "contains", type = {ValueSetExpansionContainsComponent.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false) - @Description(shortDefinition="Codes contained under this entry", formalDefinition="Other codes and entries contained under this entry in the hierarchy." ) - protected List contains; - - private static final long serialVersionUID = -2038349483L; - - /** - * Constructor - */ - public ValueSetExpansionContainsComponent() { - super(); - } - - /** - * @return {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public UriType getSystemElement() { - if (this.system == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.system"); - else if (Configuration.doAutoCreate()) - this.system = new UriType(); // bb - return this.system; - } - - public boolean hasSystemElement() { - return this.system != null && !this.system.isEmpty(); - } - - public boolean hasSystem() { - return this.system != null && !this.system.isEmpty(); - } - - /** - * @param value {@link #system} (An absolute URI which is the code system in which the code for this item in the expansion is defined.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setSystemElement(UriType value) { - this.system = value; - return this; - } - - /** - * @return An absolute URI which is the code system in which the code for this item in the expansion is defined. - */ - public String getSystem() { - return this.system == null ? null : this.system.getValue(); - } - - /** - * @param value An absolute URI which is the code system in which the code for this item in the expansion is defined. - */ - public ValueSetExpansionContainsComponent setSystem(String value) { - if (Utilities.noString(value)) - this.system = null; - else { - if (this.system == null) - this.system = new UriType(); - this.system.setValue(value); - } - return this; - } - - /** - * @return {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public BooleanType getAbstractElement() { - if (this.abstract_ == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.abstract_"); - else if (Configuration.doAutoCreate()) - this.abstract_ = new BooleanType(); // bb - return this.abstract_; - } - - public boolean hasAbstractElement() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - public boolean hasAbstract() { - return this.abstract_ != null && !this.abstract_.isEmpty(); - } - - /** - * @param value {@link #abstract_} (If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.). This is the underlying object with id, value and extensions. The accessor "getAbstract" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setAbstractElement(BooleanType value) { - this.abstract_ = value; - return this; - } - - /** - * @return If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - public boolean getAbstract() { - return this.abstract_ == null || this.abstract_.isEmpty() ? false : this.abstract_.getValue(); - } - - /** - * @param value If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value. - */ - public ValueSetExpansionContainsComponent setAbstract(boolean value) { - if (this.abstract_ == null) - this.abstract_ = new BooleanType(); - this.abstract_.setValue(value); - return this; - } - - /** - * @return {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence. - */ - public ValueSetExpansionContainsComponent setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #code} (The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public CodeType getCodeElement() { - if (this.code == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.code"); - else if (Configuration.doAutoCreate()) - this.code = new CodeType(); // bb - return this.code; - } - - public boolean hasCodeElement() { - return this.code != null && !this.code.isEmpty(); - } - - public boolean hasCode() { - return this.code != null && !this.code.isEmpty(); - } - - /** - * @param value {@link #code} (The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setCodeElement(CodeType value) { - this.code = value; - return this; - } - - /** - * @return The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. - */ - public String getCode() { - return this.code == null ? null : this.code.getValue(); - } - - /** - * @param value The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set. - */ - public ValueSetExpansionContainsComponent setCode(String value) { - if (Utilities.noString(value)) - this.code = null; - else { - if (this.code == null) - this.code = new CodeType(); - this.code.setValue(value); - } - return this; - } - - /** - * @return {@link #display} (The recommended display for this item in the expansion.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public StringType getDisplayElement() { - if (this.display == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSetExpansionContainsComponent.display"); - else if (Configuration.doAutoCreate()) - this.display = new StringType(); // bb - return this.display; - } - - public boolean hasDisplayElement() { - return this.display != null && !this.display.isEmpty(); - } - - public boolean hasDisplay() { - return this.display != null && !this.display.isEmpty(); - } - - /** - * @param value {@link #display} (The recommended display for this item in the expansion.). This is the underlying object with id, value and extensions. The accessor "getDisplay" gives direct access to the value - */ - public ValueSetExpansionContainsComponent setDisplayElement(StringType value) { - this.display = value; - return this; - } - - /** - * @return The recommended display for this item in the expansion. - */ - public String getDisplay() { - return this.display == null ? null : this.display.getValue(); - } - - /** - * @param value The recommended display for this item in the expansion. - */ - public ValueSetExpansionContainsComponent setDisplay(String value) { - if (Utilities.noString(value)) - this.display = null; - else { - if (this.display == null) - this.display = new StringType(); - this.display.setValue(value); - } - return this; - } - - /** - * @return {@link #contains} (Other codes and entries contained under this entry in the hierarchy.) - */ - public List getContains() { - if (this.contains == null) - this.contains = new ArrayList(); - return this.contains; - } - - public boolean hasContains() { - if (this.contains == null) - return false; - for (ValueSetExpansionContainsComponent item : this.contains) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contains} (Other codes and entries contained under this entry in the hierarchy.) - */ - // syntactic sugar - public ValueSetExpansionContainsComponent addContains() { //3 - ValueSetExpansionContainsComponent t = new ValueSetExpansionContainsComponent(); - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return t; - } - - // syntactic sugar - public ValueSetExpansionContainsComponent addContains(ValueSetExpansionContainsComponent t) { //3 - if (t == null) - return this; - if (this.contains == null) - this.contains = new ArrayList(); - this.contains.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("system", "uri", "An absolute URI which is the code system in which the code for this item in the expansion is defined.", 0, java.lang.Integer.MAX_VALUE, system)); - childrenList.add(new Property("abstract", "boolean", "If true, this entry is included in the expansion for navigational purposes, and the user cannot select the code directly as a proper value.", 0, java.lang.Integer.MAX_VALUE, abstract_)); - childrenList.add(new Property("version", "string", "The version of this code system that defined this code and/or display. This should only be used with code systems that do not enforce concept permanence.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("code", "code", "The code for this item in the expansion hierarchy. If this code is missing the entry in the hierarchy is a place holder (abstract) and does not represent a valid code in the value set.", 0, java.lang.Integer.MAX_VALUE, code)); - childrenList.add(new Property("display", "string", "The recommended display for this item in the expansion.", 0, java.lang.Integer.MAX_VALUE, display)); - childrenList.add(new Property("contains", "@ValueSet.expansion.contains", "Other codes and entries contained under this entry in the hierarchy.", 0, java.lang.Integer.MAX_VALUE, contains)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -887328209: /*system*/ return this.system == null ? new Base[0] : new Base[] {this.system}; // UriType - case 1732898850: /*abstract*/ return this.abstract_ == null ? new Base[0] : new Base[] {this.abstract_}; // BooleanType - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeType - case 1671764162: /*display*/ return this.display == null ? new Base[0] : new Base[] {this.display}; // StringType - case -567445985: /*contains*/ return this.contains == null ? new Base[0] : this.contains.toArray(new Base[this.contains.size()]); // ValueSetExpansionContainsComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -887328209: // system - this.system = castToUri(value); // UriType - break; - case 1732898850: // abstract - this.abstract_ = castToBoolean(value); // BooleanType - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3059181: // code - this.code = castToCode(value); // CodeType - break; - case 1671764162: // display - this.display = castToString(value); // StringType - break; - case -567445985: // contains - this.getContains().add((ValueSetExpansionContainsComponent) value); // ValueSetExpansionContainsComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("system")) - this.system = castToUri(value); // UriType - else if (name.equals("abstract")) - this.abstract_ = castToBoolean(value); // BooleanType - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("code")) - this.code = castToCode(value); // CodeType - else if (name.equals("display")) - this.display = castToString(value); // StringType - else if (name.equals("contains")) - this.getContains().add((ValueSetExpansionContainsComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -887328209: throw new FHIRException("Cannot make property system as it is not a complex type"); // UriType - case 1732898850: throw new FHIRException("Cannot make property abstract as it is not a complex type"); // BooleanType - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3059181: throw new FHIRException("Cannot make property code as it is not a complex type"); // CodeType - case 1671764162: throw new FHIRException("Cannot make property display as it is not a complex type"); // StringType - case -567445985: return addContains(); // ValueSetExpansionContainsComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("system")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.system"); - } - else if (name.equals("abstract")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.abstract"); - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); - } - else if (name.equals("code")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.code"); - } - else if (name.equals("display")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.display"); - } - else if (name.equals("contains")) { - return addContains(); - } - else - return super.addChild(name); - } - - public ValueSetExpansionContainsComponent copy() { - ValueSetExpansionContainsComponent dst = new ValueSetExpansionContainsComponent(); - copyValues(dst); - dst.system = system == null ? null : system.copy(); - dst.abstract_ = abstract_ == null ? null : abstract_.copy(); - dst.version = version == null ? null : version.copy(); - dst.code = code == null ? null : code.copy(); - dst.display = display == null ? null : display.copy(); - if (contains != null) { - dst.contains = new ArrayList(); - for (ValueSetExpansionContainsComponent i : contains) - dst.contains.add(i.copy()); - }; - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSetExpansionContainsComponent)) - return false; - ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; - return compareDeep(system, o.system, true) && compareDeep(abstract_, o.abstract_, true) && compareDeep(version, o.version, true) - && compareDeep(code, o.code, true) && compareDeep(display, o.display, true) && compareDeep(contains, o.contains, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSetExpansionContainsComponent)) - return false; - ValueSetExpansionContainsComponent o = (ValueSetExpansionContainsComponent) other; - return compareValues(system, o.system, true) && compareValues(abstract_, o.abstract_, true) && compareValues(version, o.version, true) - && compareValues(code, o.code, true) && compareValues(display, o.display, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (system == null || system.isEmpty()) && (abstract_ == null || abstract_.isEmpty()) - && (version == null || version.isEmpty()) && (code == null || code.isEmpty()) && (display == null || display.isEmpty()) - && (contains == null || contains.isEmpty()); - } - - public String fhirType() { - return "ValueSet.expansion.contains"; - - } - - } - - /** - * An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. - */ - @Child(name = "url", type = {UriType.class}, order=0, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Globally unique logical identifier for value set", formalDefinition="An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published." ) - protected UriType url; - - /** - * Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance. - */ - @Child(name = "identifier", type = {Identifier.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Additional identifier for the value set (e.g. HL7 v2 / CDA)", formalDefinition="Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance." ) - protected Identifier identifier; - - /** - * Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - @Child(name = "version", type = {StringType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Logical identifier for this version of the value set", formalDefinition="Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp." ) - protected StringType version; - - /** - * A free text natural language name describing the value set. - */ - @Child(name = "name", type = {StringType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Informal name for this value set", formalDefinition="A free text natural language name describing the value set." ) - protected StringType name; - - /** - * The status of the value set. - */ - @Child(name = "status", type = {CodeType.class}, order=4, min=1, max=1, modifier=true, summary=true) - @Description(shortDefinition="draft | active | retired", formalDefinition="The status of the value set." ) - protected Enumeration status; - - /** - * This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - @Child(name = "experimental", type = {BooleanType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="If for testing purposes, not real usage", formalDefinition="This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage." ) - protected BooleanType experimental; - - /** - * The name of the individual or organization that published the value set. - */ - @Child(name = "publisher", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Name of the publisher (organization or individual)", formalDefinition="The name of the individual or organization that published the value set." ) - protected StringType publisher; - - /** - * Contacts to assist a user in finding and communicating with the publisher. - */ - @Child(name = "contact", type = {}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Contact details of the publisher", formalDefinition="Contacts to assist a user in finding and communicating with the publisher." ) - protected List contact; - - /** - * The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). - */ - @Child(name = "date", type = {DateTimeType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Date for given status", formalDefinition="The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition')." ) - protected DateTimeType date; - - /** - * If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. - */ - @Child(name = "lockedDate", type = {DateType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Fixed date for all referenced code systems and value sets", formalDefinition="If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date." ) - protected DateType lockedDate; - - /** - * A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. - */ - @Child(name = "description", type = {StringType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Human language description of the value set", formalDefinition="A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set." ) - protected StringType description; - - /** - * The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions. - */ - @Child(name = "useContext", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Content intends to support these contexts", formalDefinition="The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions." ) - protected List useContext; - - /** - * If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - @Child(name = "immutable", type = {BooleanType.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Indicates whether or not any change to the content logical definition may occur", formalDefinition="If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change." ) - protected BooleanType immutable; - - /** - * Explains why this value set is needed and why it has been constrained as it has. - */ - @Child(name = "requirements", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Why needed", formalDefinition="Explains why this value set is needed and why it has been constrained as it has." ) - protected StringType requirements; - - /** - * A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. - */ - @Child(name = "copyright", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Use and/or publishing restrictions", formalDefinition="A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set." ) - protected StringType copyright; - - /** - * Whether this is intended to be used with an extensible binding or not. - */ - @Child(name = "extensible", type = {BooleanType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Whether this is intended to be used with an extensible binding", formalDefinition="Whether this is intended to be used with an extensible binding or not." ) - protected BooleanType extensible; - - /** - * A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set. - */ - @Child(name = "compose", type = {}, order=16, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="When value set includes codes from elsewhere", formalDefinition="A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set." ) - protected ValueSetComposeComponent compose; - - /** - * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed. - */ - @Child(name = "expansion", type = {}, order=17, min=0, max=1, modifier=false, summary=false) - @Description(shortDefinition="Used when the value set is \"expanded\"", formalDefinition="A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed." ) - protected ValueSetExpansionComponent expansion; - - private static final long serialVersionUID = 1847545818L; - - /** - * Constructor - */ - public ValueSet() { - super(); - } - - /** - * Constructor - */ - public ValueSet(Enumeration status) { - super(); - this.status = status; - } - - /** - * @return {@link #url} (An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public UriType getUrlElement() { - if (this.url == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.url"); - else if (Configuration.doAutoCreate()) - this.url = new UriType(); // bb - return this.url; - } - - public boolean hasUrlElement() { - return this.url != null && !this.url.isEmpty(); - } - - public boolean hasUrl() { - return this.url != null && !this.url.isEmpty(); - } - - /** - * @param value {@link #url} (An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.). This is the underlying object with id, value and extensions. The accessor "getUrl" gives direct access to the value - */ - public ValueSet setUrlElement(UriType value) { - this.url = value; - return this; - } - - /** - * @return An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. - */ - public String getUrl() { - return this.url == null ? null : this.url.getValue(); - } - - /** - * @param value An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published. - */ - public ValueSet setUrl(String value) { - if (Utilities.noString(value)) - this.url = null; - else { - if (this.url == null) - this.url = new UriType(); - this.url.setValue(value); - } - return this; - } - - /** - * @return {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public Identifier getIdentifier() { - if (this.identifier == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.identifier"); - else if (Configuration.doAutoCreate()) - this.identifier = new Identifier(); // cc - return this.identifier; - } - - public boolean hasIdentifier() { - return this.identifier != null && !this.identifier.isEmpty(); - } - - /** - * @param value {@link #identifier} (Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.) - */ - public ValueSet setIdentifier(Identifier value) { - this.identifier = value; - return this; - } - - /** - * @return {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public StringType getVersionElement() { - if (this.version == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.version"); - else if (Configuration.doAutoCreate()) - this.version = new StringType(); // bb - return this.version; - } - - public boolean hasVersionElement() { - return this.version != null && !this.version.isEmpty(); - } - - public boolean hasVersion() { - return this.version != null && !this.version.isEmpty(); - } - - /** - * @param value {@link #version} (Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.). This is the underlying object with id, value and extensions. The accessor "getVersion" gives direct access to the value - */ - public ValueSet setVersionElement(StringType value) { - this.version = value; - return this; - } - - /** - * @return Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public String getVersion() { - return this.version == null ? null : this.version.getValue(); - } - - /** - * @param value Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp. - */ - public ValueSet setVersion(String value) { - if (Utilities.noString(value)) - this.version = null; - else { - if (this.version == null) - this.version = new StringType(); - this.version.setValue(value); - } - return this; - } - - /** - * @return {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public StringType getNameElement() { - if (this.name == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.name"); - else if (Configuration.doAutoCreate()) - this.name = new StringType(); // bb - return this.name; - } - - public boolean hasNameElement() { - return this.name != null && !this.name.isEmpty(); - } - - public boolean hasName() { - return this.name != null && !this.name.isEmpty(); - } - - /** - * @param value {@link #name} (A free text natural language name describing the value set.). This is the underlying object with id, value and extensions. The accessor "getName" gives direct access to the value - */ - public ValueSet setNameElement(StringType value) { - this.name = value; - return this; - } - - /** - * @return A free text natural language name describing the value set. - */ - public String getName() { - return this.name == null ? null : this.name.getValue(); - } - - /** - * @param value A free text natural language name describing the value set. - */ - public ValueSet setName(String value) { - if (Utilities.noString(value)) - this.name = null; - else { - if (this.name == null) - this.name = new StringType(); - this.name.setValue(value); - } - return this; - } - - /** - * @return {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public Enumeration getStatusElement() { - if (this.status == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.status"); - else if (Configuration.doAutoCreate()) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); // bb - return this.status; - } - - public boolean hasStatusElement() { - return this.status != null && !this.status.isEmpty(); - } - - public boolean hasStatus() { - return this.status != null && !this.status.isEmpty(); - } - - /** - * @param value {@link #status} (The status of the value set.). This is the underlying object with id, value and extensions. The accessor "getStatus" gives direct access to the value - */ - public ValueSet setStatusElement(Enumeration value) { - this.status = value; - return this; - } - - /** - * @return The status of the value set. - */ - public ConformanceResourceStatus getStatus() { - return this.status == null ? null : this.status.getValue(); - } - - /** - * @param value The status of the value set. - */ - public ValueSet setStatus(ConformanceResourceStatus value) { - if (this.status == null) - this.status = new Enumeration(new ConformanceResourceStatusEnumFactory()); - this.status.setValue(value); - return this; - } - - /** - * @return {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public BooleanType getExperimentalElement() { - if (this.experimental == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.experimental"); - else if (Configuration.doAutoCreate()) - this.experimental = new BooleanType(); // bb - return this.experimental; - } - - public boolean hasExperimentalElement() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - public boolean hasExperimental() { - return this.experimental != null && !this.experimental.isEmpty(); - } - - /** - * @param value {@link #experimental} (This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.). This is the underlying object with id, value and extensions. The accessor "getExperimental" gives direct access to the value - */ - public ValueSet setExperimentalElement(BooleanType value) { - this.experimental = value; - return this; - } - - /** - * @return This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public boolean getExperimental() { - return this.experimental == null || this.experimental.isEmpty() ? false : this.experimental.getValue(); - } - - /** - * @param value This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage. - */ - public ValueSet setExperimental(boolean value) { - if (this.experimental == null) - this.experimental = new BooleanType(); - this.experimental.setValue(value); - return this; - } - - /** - * @return {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public StringType getPublisherElement() { - if (this.publisher == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.publisher"); - else if (Configuration.doAutoCreate()) - this.publisher = new StringType(); // bb - return this.publisher; - } - - public boolean hasPublisherElement() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - public boolean hasPublisher() { - return this.publisher != null && !this.publisher.isEmpty(); - } - - /** - * @param value {@link #publisher} (The name of the individual or organization that published the value set.). This is the underlying object with id, value and extensions. The accessor "getPublisher" gives direct access to the value - */ - public ValueSet setPublisherElement(StringType value) { - this.publisher = value; - return this; - } - - /** - * @return The name of the individual or organization that published the value set. - */ - public String getPublisher() { - return this.publisher == null ? null : this.publisher.getValue(); - } - - /** - * @param value The name of the individual or organization that published the value set. - */ - public ValueSet setPublisher(String value) { - if (Utilities.noString(value)) - this.publisher = null; - else { - if (this.publisher == null) - this.publisher = new StringType(); - this.publisher.setValue(value); - } - return this; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - public List getContact() { - if (this.contact == null) - this.contact = new ArrayList(); - return this.contact; - } - - public boolean hasContact() { - if (this.contact == null) - return false; - for (ValueSetContactComponent item : this.contact) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #contact} (Contacts to assist a user in finding and communicating with the publisher.) - */ - // syntactic sugar - public ValueSetContactComponent addContact() { //3 - ValueSetContactComponent t = new ValueSetContactComponent(); - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return t; - } - - // syntactic sugar - public ValueSet addContact(ValueSetContactComponent t) { //3 - if (t == null) - return this; - if (this.contact == null) - this.contact = new ArrayList(); - this.contact.add(t); - return this; - } - - /** - * @return {@link #date} (The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public DateTimeType getDateElement() { - if (this.date == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.date"); - else if (Configuration.doAutoCreate()) - this.date = new DateTimeType(); // bb - return this.date; - } - - public boolean hasDateElement() { - return this.date != null && !this.date.isEmpty(); - } - - public boolean hasDate() { - return this.date != null && !this.date.isEmpty(); - } - - /** - * @param value {@link #date} (The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').). This is the underlying object with id, value and extensions. The accessor "getDate" gives direct access to the value - */ - public ValueSet setDateElement(DateTimeType value) { - this.date = value; - return this; - } - - /** - * @return The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). - */ - public Date getDate() { - return this.date == null ? null : this.date.getValue(); - } - - /** - * @param value The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition'). - */ - public ValueSet setDate(Date value) { - if (value == null) - this.date = null; - else { - if (this.date == null) - this.date = new DateTimeType(); - this.date.setValue(value); - } - return this; - } - - /** - * @return {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value - */ - public DateType getLockedDateElement() { - if (this.lockedDate == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.lockedDate"); - else if (Configuration.doAutoCreate()) - this.lockedDate = new DateType(); // bb - return this.lockedDate; - } - - public boolean hasLockedDateElement() { - return this.lockedDate != null && !this.lockedDate.isEmpty(); - } - - public boolean hasLockedDate() { - return this.lockedDate != null && !this.lockedDate.isEmpty(); - } - - /** - * @param value {@link #lockedDate} (If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.). This is the underlying object with id, value and extensions. The accessor "getLockedDate" gives direct access to the value - */ - public ValueSet setLockedDateElement(DateType value) { - this.lockedDate = value; - return this; - } - - /** - * @return If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. - */ - public Date getLockedDate() { - return this.lockedDate == null ? null : this.lockedDate.getValue(); - } - - /** - * @param value If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date. - */ - public ValueSet setLockedDate(Date value) { - if (value == null) - this.lockedDate = null; - else { - if (this.lockedDate == null) - this.lockedDate = new DateType(); - this.lockedDate.setValue(value); - } - return this; - } - - /** - * @return {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public StringType getDescriptionElement() { - if (this.description == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.description"); - else if (Configuration.doAutoCreate()) - this.description = new StringType(); // bb - return this.description; - } - - public boolean hasDescriptionElement() { - return this.description != null && !this.description.isEmpty(); - } - - public boolean hasDescription() { - return this.description != null && !this.description.isEmpty(); - } - - /** - * @param value {@link #description} (A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.). This is the underlying object with id, value and extensions. The accessor "getDescription" gives direct access to the value - */ - public ValueSet setDescriptionElement(StringType value) { - this.description = value; - return this; - } - - /** - * @return A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. - */ - public String getDescription() { - return this.description == null ? null : this.description.getValue(); - } - - /** - * @param value A free text natural language description of the use of the value set - reason for definition, "the semantic space" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set. - */ - public ValueSet setDescription(String value) { - if (Utilities.noString(value)) - this.description = null; - else { - if (this.description == null) - this.description = new StringType(); - this.description.setValue(value); - } - return this; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) - */ - public List getUseContext() { - if (this.useContext == null) - this.useContext = new ArrayList(); - return this.useContext; - } - - public boolean hasUseContext() { - if (this.useContext == null) - return false; - for (CodeableConcept item : this.useContext) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #useContext} (The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.) - */ - // syntactic sugar - public CodeableConcept addUseContext() { //3 - CodeableConcept t = new CodeableConcept(); - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return t; - } - - // syntactic sugar - public ValueSet addUseContext(CodeableConcept t) { //3 - if (t == null) - return this; - if (this.useContext == null) - this.useContext = new ArrayList(); - this.useContext.add(t); - return this; - } - - /** - * @return {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value - */ - public BooleanType getImmutableElement() { - if (this.immutable == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.immutable"); - else if (Configuration.doAutoCreate()) - this.immutable = new BooleanType(); // bb - return this.immutable; - } - - public boolean hasImmutableElement() { - return this.immutable != null && !this.immutable.isEmpty(); - } - - public boolean hasImmutable() { - return this.immutable != null && !this.immutable.isEmpty(); - } - - /** - * @param value {@link #immutable} (If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.). This is the underlying object with id, value and extensions. The accessor "getImmutable" gives direct access to the value - */ - public ValueSet setImmutableElement(BooleanType value) { - this.immutable = value; - return this; - } - - /** - * @return If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - public boolean getImmutable() { - return this.immutable == null || this.immutable.isEmpty() ? false : this.immutable.getValue(); - } - - /** - * @param value If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change. - */ - public ValueSet setImmutable(boolean value) { - if (this.immutable == null) - this.immutable = new BooleanType(); - this.immutable.setValue(value); - return this; - } - - /** - * @return {@link #requirements} (Explains why this value set is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public StringType getRequirementsElement() { - if (this.requirements == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.requirements"); - else if (Configuration.doAutoCreate()) - this.requirements = new StringType(); // bb - return this.requirements; - } - - public boolean hasRequirementsElement() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - public boolean hasRequirements() { - return this.requirements != null && !this.requirements.isEmpty(); - } - - /** - * @param value {@link #requirements} (Explains why this value set is needed and why it has been constrained as it has.). This is the underlying object with id, value and extensions. The accessor "getRequirements" gives direct access to the value - */ - public ValueSet setRequirementsElement(StringType value) { - this.requirements = value; - return this; - } - - /** - * @return Explains why this value set is needed and why it has been constrained as it has. - */ - public String getRequirements() { - return this.requirements == null ? null : this.requirements.getValue(); - } - - /** - * @param value Explains why this value set is needed and why it has been constrained as it has. - */ - public ValueSet setRequirements(String value) { - if (Utilities.noString(value)) - this.requirements = null; - else { - if (this.requirements == null) - this.requirements = new StringType(); - this.requirements.setValue(value); - } - return this; - } - - /** - * @return {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public StringType getCopyrightElement() { - if (this.copyright == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.copyright"); - else if (Configuration.doAutoCreate()) - this.copyright = new StringType(); // bb - return this.copyright; - } - - public boolean hasCopyrightElement() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - public boolean hasCopyright() { - return this.copyright != null && !this.copyright.isEmpty(); - } - - /** - * @param value {@link #copyright} (A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.). This is the underlying object with id, value and extensions. The accessor "getCopyright" gives direct access to the value - */ - public ValueSet setCopyrightElement(StringType value) { - this.copyright = value; - return this; - } - - /** - * @return A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. - */ - public String getCopyright() { - return this.copyright == null ? null : this.copyright.getValue(); - } - - /** - * @param value A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set. - */ - public ValueSet setCopyright(String value) { - if (Utilities.noString(value)) - this.copyright = null; - else { - if (this.copyright == null) - this.copyright = new StringType(); - this.copyright.setValue(value); - } - return this; - } - - /** - * @return {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value - */ - public BooleanType getExtensibleElement() { - if (this.extensible == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.extensible"); - else if (Configuration.doAutoCreate()) - this.extensible = new BooleanType(); // bb - return this.extensible; - } - - public boolean hasExtensibleElement() { - return this.extensible != null && !this.extensible.isEmpty(); - } - - public boolean hasExtensible() { - return this.extensible != null && !this.extensible.isEmpty(); - } - - /** - * @param value {@link #extensible} (Whether this is intended to be used with an extensible binding or not.). This is the underlying object with id, value and extensions. The accessor "getExtensible" gives direct access to the value - */ - public ValueSet setExtensibleElement(BooleanType value) { - this.extensible = value; - return this; - } - - /** - * @return Whether this is intended to be used with an extensible binding or not. - */ - public boolean getExtensible() { - return this.extensible == null || this.extensible.isEmpty() ? false : this.extensible.getValue(); - } - - /** - * @param value Whether this is intended to be used with an extensible binding or not. - */ - public ValueSet setExtensible(boolean value) { - if (this.extensible == null) - this.extensible = new BooleanType(); - this.extensible.setValue(value); - return this; - } - - /** - * @return {@link #compose} (A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.) - */ - public ValueSetComposeComponent getCompose() { - if (this.compose == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.compose"); - else if (Configuration.doAutoCreate()) - this.compose = new ValueSetComposeComponent(); // cc - return this.compose; - } - - public boolean hasCompose() { - return this.compose != null && !this.compose.isEmpty(); - } - - /** - * @param value {@link #compose} (A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.) - */ - public ValueSet setCompose(ValueSetComposeComponent value) { - this.compose = value; - return this; - } - - /** - * @return {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) - */ - public ValueSetExpansionComponent getExpansion() { - if (this.expansion == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create ValueSet.expansion"); - else if (Configuration.doAutoCreate()) - this.expansion = new ValueSetExpansionComponent(); // cc - return this.expansion; - } - - public boolean hasExpansion() { - return this.expansion != null && !this.expansion.isEmpty(); - } - - /** - * @param value {@link #expansion} (A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.) - */ - public ValueSet setExpansion(ValueSetExpansionComponent value) { - this.expansion = value; - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("url", "uri", "An absolute URL that is used to identify this value set when it is referenced in a specification, model, design or an instance. This SHALL be a URL, SHOULD be globally unique, and SHOULD be an address at which this value set is (or will be) published.", 0, java.lang.Integer.MAX_VALUE, url)); - childrenList.add(new Property("identifier", "Identifier", "Formal identifier that is used to identify this value set when it is represented in other formats, or referenced in a specification, model, design or an instance.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("version", "string", "Used to identify this version of the value set when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the profile author manually and the value should be a timestamp.", 0, java.lang.Integer.MAX_VALUE, version)); - childrenList.add(new Property("name", "string", "A free text natural language name describing the value set.", 0, java.lang.Integer.MAX_VALUE, name)); - childrenList.add(new Property("status", "code", "The status of the value set.", 0, java.lang.Integer.MAX_VALUE, status)); - childrenList.add(new Property("experimental", "boolean", "This valueset was authored for testing purposes (or education/evaluation/marketing), and is not intended to be used for genuine usage.", 0, java.lang.Integer.MAX_VALUE, experimental)); - childrenList.add(new Property("publisher", "string", "The name of the individual or organization that published the value set.", 0, java.lang.Integer.MAX_VALUE, publisher)); - childrenList.add(new Property("contact", "", "Contacts to assist a user in finding and communicating with the publisher.", 0, java.lang.Integer.MAX_VALUE, contact)); - childrenList.add(new Property("date", "dateTime", "The date that the value set status was last changed. The date must change when the business version changes, if it does, and it must change if the status code changes. In addition, it should change when the substantive content of the implementation guide changes (e.g. the 'content logical definition').", 0, java.lang.Integer.MAX_VALUE, date)); - childrenList.add(new Property("lockedDate", "date", "If a locked date is defined, then the Content Logical Definition must be evaluated using the current version of all referenced code system(s) and value set instances as of the locked date.", 0, java.lang.Integer.MAX_VALUE, lockedDate)); - childrenList.add(new Property("description", "string", "A free text natural language description of the use of the value set - reason for definition, \"the semantic space\" to be included in the value set, conditions of use, etc. The description may include a list of expected usages for the value set and can also describe the approach taken to build the value set.", 0, java.lang.Integer.MAX_VALUE, description)); - childrenList.add(new Property("useContext", "CodeableConcept", "The content was developed with a focus and intent of supporting the contexts that are listed. These terms may be used to assist with indexing and searching of value set definitions.", 0, java.lang.Integer.MAX_VALUE, useContext)); - childrenList.add(new Property("immutable", "boolean", "If this is set to 'true', then no new versions of the content logical definition can be created. Note: Other metadata might still change.", 0, java.lang.Integer.MAX_VALUE, immutable)); - childrenList.add(new Property("requirements", "string", "Explains why this value set is needed and why it has been constrained as it has.", 0, java.lang.Integer.MAX_VALUE, requirements)); - childrenList.add(new Property("copyright", "string", "A copyright statement relating to the value set and/or its contents. Copyright statements are generally legal restrictions on the use and publishing of the value set.", 0, java.lang.Integer.MAX_VALUE, copyright)); - childrenList.add(new Property("extensible", "boolean", "Whether this is intended to be used with an extensible binding or not.", 0, java.lang.Integer.MAX_VALUE, extensible)); - childrenList.add(new Property("compose", "", "A set of criteria that provide the content logical definition of the value set by including or excluding codes from outside this value set.", 0, java.lang.Integer.MAX_VALUE, compose)); - childrenList.add(new Property("expansion", "", "A value set can also be \"expanded\", where the value set is turned into a simple collection of enumerated codes. This element holds the expansion, if it has been performed.", 0, java.lang.Integer.MAX_VALUE, expansion)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case 116079: /*url*/ return this.url == null ? new Base[0] : new Base[] {this.url}; // UriType - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier - case 351608024: /*version*/ return this.version == null ? new Base[0] : new Base[] {this.version}; // StringType - case 3373707: /*name*/ return this.name == null ? new Base[0] : new Base[] {this.name}; // StringType - case -892481550: /*status*/ return this.status == null ? new Base[0] : new Base[] {this.status}; // Enumeration - case -404562712: /*experimental*/ return this.experimental == null ? new Base[0] : new Base[] {this.experimental}; // BooleanType - case 1447404028: /*publisher*/ return this.publisher == null ? new Base[0] : new Base[] {this.publisher}; // StringType - case 951526432: /*contact*/ return this.contact == null ? new Base[0] : this.contact.toArray(new Base[this.contact.size()]); // ValueSetContactComponent - case 3076014: /*date*/ return this.date == null ? new Base[0] : new Base[] {this.date}; // DateTimeType - case 1391591896: /*lockedDate*/ return this.lockedDate == null ? new Base[0] : new Base[] {this.lockedDate}; // DateType - case -1724546052: /*description*/ return this.description == null ? new Base[0] : new Base[] {this.description}; // StringType - case -669707736: /*useContext*/ return this.useContext == null ? new Base[0] : this.useContext.toArray(new Base[this.useContext.size()]); // CodeableConcept - case 1596987778: /*immutable*/ return this.immutable == null ? new Base[0] : new Base[] {this.immutable}; // BooleanType - case -1619874672: /*requirements*/ return this.requirements == null ? new Base[0] : new Base[] {this.requirements}; // StringType - case 1522889671: /*copyright*/ return this.copyright == null ? new Base[0] : new Base[] {this.copyright}; // StringType - case -1809433861: /*extensible*/ return this.extensible == null ? new Base[0] : new Base[] {this.extensible}; // BooleanType - case 950497682: /*compose*/ return this.compose == null ? new Base[0] : new Base[] {this.compose}; // ValueSetComposeComponent - case 17878207: /*expansion*/ return this.expansion == null ? new Base[0] : new Base[] {this.expansion}; // ValueSetExpansionComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case 116079: // url - this.url = castToUri(value); // UriType - break; - case -1618432855: // identifier - this.identifier = castToIdentifier(value); // Identifier - break; - case 351608024: // version - this.version = castToString(value); // StringType - break; - case 3373707: // name - this.name = castToString(value); // StringType - break; - case -892481550: // status - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - break; - case -404562712: // experimental - this.experimental = castToBoolean(value); // BooleanType - break; - case 1447404028: // publisher - this.publisher = castToString(value); // StringType - break; - case 951526432: // contact - this.getContact().add((ValueSetContactComponent) value); // ValueSetContactComponent - break; - case 3076014: // date - this.date = castToDateTime(value); // DateTimeType - break; - case 1391591896: // lockedDate - this.lockedDate = castToDate(value); // DateType - break; - case -1724546052: // description - this.description = castToString(value); // StringType - break; - case -669707736: // useContext - this.getUseContext().add(castToCodeableConcept(value)); // CodeableConcept - break; - case 1596987778: // immutable - this.immutable = castToBoolean(value); // BooleanType - break; - case -1619874672: // requirements - this.requirements = castToString(value); // StringType - break; - case 1522889671: // copyright - this.copyright = castToString(value); // StringType - break; - case -1809433861: // extensible - this.extensible = castToBoolean(value); // BooleanType - break; - case 950497682: // compose - this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent - break; - case 17878207: // expansion - this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("url")) - this.url = castToUri(value); // UriType - else if (name.equals("identifier")) - this.identifier = castToIdentifier(value); // Identifier - else if (name.equals("version")) - this.version = castToString(value); // StringType - else if (name.equals("name")) - this.name = castToString(value); // StringType - else if (name.equals("status")) - this.status = new ConformanceResourceStatusEnumFactory().fromType(value); // Enumeration - else if (name.equals("experimental")) - this.experimental = castToBoolean(value); // BooleanType - else if (name.equals("publisher")) - this.publisher = castToString(value); // StringType - else if (name.equals("contact")) - this.getContact().add((ValueSetContactComponent) value); - else if (name.equals("date")) - this.date = castToDateTime(value); // DateTimeType - else if (name.equals("lockedDate")) - this.lockedDate = castToDate(value); // DateType - else if (name.equals("description")) - this.description = castToString(value); // StringType - else if (name.equals("useContext")) - this.getUseContext().add(castToCodeableConcept(value)); - else if (name.equals("immutable")) - this.immutable = castToBoolean(value); // BooleanType - else if (name.equals("requirements")) - this.requirements = castToString(value); // StringType - else if (name.equals("copyright")) - this.copyright = castToString(value); // StringType - else if (name.equals("extensible")) - this.extensible = castToBoolean(value); // BooleanType - else if (name.equals("compose")) - this.compose = (ValueSetComposeComponent) value; // ValueSetComposeComponent - else if (name.equals("expansion")) - this.expansion = (ValueSetExpansionComponent) value; // ValueSetExpansionComponent - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case 116079: throw new FHIRException("Cannot make property url as it is not a complex type"); // UriType - case -1618432855: return getIdentifier(); // Identifier - case 351608024: throw new FHIRException("Cannot make property version as it is not a complex type"); // StringType - case 3373707: throw new FHIRException("Cannot make property name as it is not a complex type"); // StringType - case -892481550: throw new FHIRException("Cannot make property status as it is not a complex type"); // Enumeration - case -404562712: throw new FHIRException("Cannot make property experimental as it is not a complex type"); // BooleanType - case 1447404028: throw new FHIRException("Cannot make property publisher as it is not a complex type"); // StringType - case 951526432: return addContact(); // ValueSetContactComponent - case 3076014: throw new FHIRException("Cannot make property date as it is not a complex type"); // DateTimeType - case 1391591896: throw new FHIRException("Cannot make property lockedDate as it is not a complex type"); // DateType - case -1724546052: throw new FHIRException("Cannot make property description as it is not a complex type"); // StringType - case -669707736: return addUseContext(); // CodeableConcept - case 1596987778: throw new FHIRException("Cannot make property immutable as it is not a complex type"); // BooleanType - case -1619874672: throw new FHIRException("Cannot make property requirements as it is not a complex type"); // StringType - case 1522889671: throw new FHIRException("Cannot make property copyright as it is not a complex type"); // StringType - case -1809433861: throw new FHIRException("Cannot make property extensible as it is not a complex type"); // BooleanType - case 950497682: return getCompose(); // ValueSetComposeComponent - case 17878207: return getExpansion(); // ValueSetExpansionComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("url")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.url"); - } - else if (name.equals("identifier")) { - this.identifier = new Identifier(); - return this.identifier; - } - else if (name.equals("version")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.version"); - } - else if (name.equals("name")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.name"); - } - else if (name.equals("status")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.status"); - } - else if (name.equals("experimental")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.experimental"); - } - else if (name.equals("publisher")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.publisher"); - } - else if (name.equals("contact")) { - return addContact(); - } - else if (name.equals("date")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.date"); - } - else if (name.equals("lockedDate")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.lockedDate"); - } - else if (name.equals("description")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.description"); - } - else if (name.equals("useContext")) { - return addUseContext(); - } - else if (name.equals("immutable")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.immutable"); - } - else if (name.equals("requirements")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.requirements"); - } - else if (name.equals("copyright")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.copyright"); - } - else if (name.equals("extensible")) { - throw new FHIRException("Cannot call addChild on a primitive type ValueSet.extensible"); - } - else if (name.equals("compose")) { - this.compose = new ValueSetComposeComponent(); - return this.compose; - } - else if (name.equals("expansion")) { - this.expansion = new ValueSetExpansionComponent(); - return this.expansion; - } - else - return super.addChild(name); - } - - public String fhirType() { - return "ValueSet"; - - } - - public ValueSet copy() { - ValueSet dst = new ValueSet(); - copyValues(dst); - dst.url = url == null ? null : url.copy(); - dst.identifier = identifier == null ? null : identifier.copy(); - dst.version = version == null ? null : version.copy(); - dst.name = name == null ? null : name.copy(); - dst.status = status == null ? null : status.copy(); - dst.experimental = experimental == null ? null : experimental.copy(); - dst.publisher = publisher == null ? null : publisher.copy(); - if (contact != null) { - dst.contact = new ArrayList(); - for (ValueSetContactComponent i : contact) - dst.contact.add(i.copy()); - }; - dst.date = date == null ? null : date.copy(); - dst.lockedDate = lockedDate == null ? null : lockedDate.copy(); - dst.description = description == null ? null : description.copy(); - if (useContext != null) { - dst.useContext = new ArrayList(); - for (CodeableConcept i : useContext) - dst.useContext.add(i.copy()); - }; - dst.immutable = immutable == null ? null : immutable.copy(); - dst.requirements = requirements == null ? null : requirements.copy(); - dst.copyright = copyright == null ? null : copyright.copy(); - dst.extensible = extensible == null ? null : extensible.copy(); - dst.compose = compose == null ? null : compose.copy(); - dst.expansion = expansion == null ? null : expansion.copy(); - return dst; - } - - protected ValueSet typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof ValueSet)) - return false; - ValueSet o = (ValueSet) other; - return compareDeep(url, o.url, true) && compareDeep(identifier, o.identifier, true) && compareDeep(version, o.version, true) - && compareDeep(name, o.name, true) && compareDeep(status, o.status, true) && compareDeep(experimental, o.experimental, true) - && compareDeep(publisher, o.publisher, true) && compareDeep(contact, o.contact, true) && compareDeep(date, o.date, true) - && compareDeep(lockedDate, o.lockedDate, true) && compareDeep(description, o.description, true) - && compareDeep(useContext, o.useContext, true) && compareDeep(immutable, o.immutable, true) && compareDeep(requirements, o.requirements, true) - && compareDeep(copyright, o.copyright, true) && compareDeep(extensible, o.extensible, true) && compareDeep(compose, o.compose, true) - && compareDeep(expansion, o.expansion, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof ValueSet)) - return false; - ValueSet o = (ValueSet) other; - return compareValues(url, o.url, true) && compareValues(version, o.version, true) && compareValues(name, o.name, true) - && compareValues(status, o.status, true) && compareValues(experimental, o.experimental, true) && compareValues(publisher, o.publisher, true) - && compareValues(date, o.date, true) && compareValues(lockedDate, o.lockedDate, true) && compareValues(description, o.description, true) - && compareValues(immutable, o.immutable, true) && compareValues(requirements, o.requirements, true) - && compareValues(copyright, o.copyright, true) && compareValues(extensible, o.extensible, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (url == null || url.isEmpty()) && (identifier == null || identifier.isEmpty()) - && (version == null || version.isEmpty()) && (name == null || name.isEmpty()) && (status == null || status.isEmpty()) - && (experimental == null || experimental.isEmpty()) && (publisher == null || publisher.isEmpty()) - && (contact == null || contact.isEmpty()) && (date == null || date.isEmpty()) && (lockedDate == null || lockedDate.isEmpty()) - && (description == null || description.isEmpty()) && (useContext == null || useContext.isEmpty()) - && (immutable == null || immutable.isEmpty()) && (requirements == null || requirements.isEmpty()) - && (copyright == null || copyright.isEmpty()) && (extensible == null || extensible.isEmpty()) - && (compose == null || compose.isEmpty()) && (expansion == null || expansion.isEmpty()); - } - - @Override - public ResourceType getResourceType() { - return ResourceType.ValueSet; - } - - /** - * Search parameter: expansion - *

- * Description: Uniquely identifies this expansion
- * Type: uri
- * Path: ValueSet.expansion.identifier
- *

- */ - @SearchParamDefinition(name="expansion", path="ValueSet.expansion.identifier", description="Uniquely identifies this expansion", type="uri" ) - public static final String SP_EXPANSION = "expansion"; - /** - * Fluent Client search parameter constant for expansion - *

- * Description: Uniquely identifies this expansion
- * Type: uri
- * Path: ValueSet.expansion.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam EXPANSION = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_EXPANSION); - - /** - * Search parameter: status - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam STATUS = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_STATUS); - - /** - * Search parameter: description - *

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

- */ - @SearchParamDefinition(name="description", path="ValueSet.description", description="Text search in the description of the value set", type="string" ) - public static final String SP_DESCRIPTION = "description"; - /** - * Fluent Client search parameter constant for description - *

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam DESCRIPTION = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_DESCRIPTION); - - /** - * Search parameter: name - *

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

- */ - @SearchParamDefinition(name="name", path="ValueSet.name", description="The name of the value set", type="string" ) - public static final String SP_NAME = "name"; - /** - * Fluent Client search parameter constant for name - *

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam NAME = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_NAME); - - /** - * Search parameter: context - *

- * Description: A use context assigned to the value set
- * Type: token
- * Path: ValueSet.useContext
- *

- */ - @SearchParamDefinition(name="context", path="ValueSet.useContext", description="A use context assigned to the value set", type="token" ) - public static final String SP_CONTEXT = "context"; - /** - * Fluent Client search parameter constant for context - *

- * Description: A use context assigned to the value set
- * Type: token
- * Path: ValueSet.useContext
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam CONTEXT = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_CONTEXT); - - /** - * Search parameter: date - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATE = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATE); - - /** - * Search parameter: identifier - *

- * Description: The identifier for the value set
- * Type: token
- * Path: ValueSet.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="ValueSet.identifier", description="The identifier for the value set", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: The identifier for the value set
- * Type: token
- * Path: ValueSet.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - /** - * Search parameter: reference - *

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

- */ - @SearchParamDefinition(name="reference", path="ValueSet.compose.include.system", description="A code system included or excluded in the value set or an imported value set", type="uri" ) - public static final String SP_REFERENCE = "reference"; - /** - * Fluent Client search parameter constant for reference - *

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

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam REFERENCE = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_REFERENCE); - - /** - * Search parameter: url - *

- * Description: The logical URL for the value set
- * Type: uri
- * Path: ValueSet.url
- *

- */ - @SearchParamDefinition(name="url", path="ValueSet.url", description="The logical URL for the value set", type="uri" ) - public static final String SP_URL = "url"; - /** - * Fluent Client search parameter constant for url - *

- * Description: The logical URL for the value set
- * Type: uri
- * Path: ValueSet.url
- *

- */ - public static final ca.uhn.fhir.rest.gclient.UriClientParam URL = new ca.uhn.fhir.rest.gclient.UriClientParam(SP_URL); - - /** - * Search parameter: publisher - *

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

- */ - @SearchParamDefinition(name="publisher", path="ValueSet.publisher", description="Name of the publisher of the value set", type="string" ) - public static final String SP_PUBLISHER = "publisher"; - /** - * Fluent Client search parameter constant for publisher - *

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

- */ - public static final ca.uhn.fhir.rest.gclient.StringClientParam PUBLISHER = new ca.uhn.fhir.rest.gclient.StringClientParam(SP_PUBLISHER); - - /** - * Search parameter: version - *

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

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

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

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam VERSION = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_VERSION); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/VisionPrescription.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/VisionPrescription.java deleted file mode 100644 index 2f130793678..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/model/VisionPrescription.java +++ /dev/null @@ -1,2152 +0,0 @@ -package org.hl7.fhir.dstu2016may.model; - -import java.math.BigDecimal; - -/* - Copyright (c) 2011+, HL7, Inc. - All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. - -*/ - -// Generated on Sun, May 8, 2016 03:05+1000 for FHIR v1.4.0 -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.instance.model.api.IBaseBackboneElement; -import org.hl7.fhir.utilities.Utilities; - -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; -/** - * An authorization for the supply of glasses and/or contact lenses to a patient. - */ -@ResourceDef(name="VisionPrescription", profile="http://hl7.org/fhir/Profile/VisionPrescription") -public class VisionPrescription extends DomainResource { - - public enum VisionEyes { - /** - * Right Eye - */ - RIGHT, - /** - * Left Eye - */ - LEFT, - /** - * added to help the parsers - */ - NULL; - public static VisionEyes fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return RIGHT; - if ("left".equals(codeString)) - return LEFT; - throw new FHIRException("Unknown VisionEyes code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case RIGHT: return "right"; - case LEFT: return "left"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case RIGHT: return "http://hl7.org/fhir/vision-eye-codes"; - case LEFT: return "http://hl7.org/fhir/vision-eye-codes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case RIGHT: return "Right Eye"; - case LEFT: return "Left Eye"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case RIGHT: return "Right Eye"; - case LEFT: return "Left Eye"; - default: return "?"; - } - } - } - - public static class VisionEyesEnumFactory implements EnumFactory { - public VisionEyes fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return VisionEyes.RIGHT; - if ("left".equals(codeString)) - return VisionEyes.LEFT; - throw new IllegalArgumentException("Unknown VisionEyes code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("right".equals(codeString)) - return new Enumeration(this, VisionEyes.RIGHT); - if ("left".equals(codeString)) - return new Enumeration(this, VisionEyes.LEFT); - throw new FHIRException("Unknown VisionEyes code '"+codeString+"'"); - } - public String toCode(VisionEyes code) { - if (code == VisionEyes.RIGHT) - return "right"; - if (code == VisionEyes.LEFT) - return "left"; - return "?"; - } - public String toSystem(VisionEyes code) { - return code.getSystem(); - } - } - - public enum VisionBase { - /** - * top - */ - UP, - /** - * bottom - */ - DOWN, - /** - * inner edge - */ - IN, - /** - * outer edge - */ - OUT, - /** - * added to help the parsers - */ - NULL; - public static VisionBase fromCode(String codeString) throws FHIRException { - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return UP; - if ("down".equals(codeString)) - return DOWN; - if ("in".equals(codeString)) - return IN; - if ("out".equals(codeString)) - return OUT; - throw new FHIRException("Unknown VisionBase code '"+codeString+"'"); - } - public String toCode() { - switch (this) { - case UP: return "up"; - case DOWN: return "down"; - case IN: return "in"; - case OUT: return "out"; - default: return "?"; - } - } - public String getSystem() { - switch (this) { - case UP: return "http://hl7.org/fhir/vision-base-codes"; - case DOWN: return "http://hl7.org/fhir/vision-base-codes"; - case IN: return "http://hl7.org/fhir/vision-base-codes"; - case OUT: return "http://hl7.org/fhir/vision-base-codes"; - default: return "?"; - } - } - public String getDefinition() { - switch (this) { - case UP: return "top"; - case DOWN: return "bottom"; - case IN: return "inner edge"; - case OUT: return "outer edge"; - default: return "?"; - } - } - public String getDisplay() { - switch (this) { - case UP: return "Up"; - case DOWN: return "Down"; - case IN: return "In"; - case OUT: return "Out"; - default: return "?"; - } - } - } - - public static class VisionBaseEnumFactory implements EnumFactory { - public VisionBase fromCode(String codeString) throws IllegalArgumentException { - if (codeString == null || "".equals(codeString)) - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return VisionBase.UP; - if ("down".equals(codeString)) - return VisionBase.DOWN; - if ("in".equals(codeString)) - return VisionBase.IN; - if ("out".equals(codeString)) - return VisionBase.OUT; - throw new IllegalArgumentException("Unknown VisionBase code '"+codeString+"'"); - } - public Enumeration fromType(Base code) throws FHIRException { - if (code == null || code.isEmpty()) - return null; - String codeString = ((PrimitiveType) code).asStringValue(); - if (codeString == null || "".equals(codeString)) - return null; - if ("up".equals(codeString)) - return new Enumeration(this, VisionBase.UP); - if ("down".equals(codeString)) - return new Enumeration(this, VisionBase.DOWN); - if ("in".equals(codeString)) - return new Enumeration(this, VisionBase.IN); - if ("out".equals(codeString)) - return new Enumeration(this, VisionBase.OUT); - throw new FHIRException("Unknown VisionBase code '"+codeString+"'"); - } - public String toCode(VisionBase code) { - if (code == VisionBase.UP) - return "up"; - if (code == VisionBase.DOWN) - return "down"; - if (code == VisionBase.IN) - return "in"; - if (code == VisionBase.OUT) - return "out"; - return "?"; - } - public String toSystem(VisionBase code) { - return code.getSystem(); - } - } - - @Block() - public static class VisionPrescriptionDispenseComponent extends BackboneElement implements IBaseBackboneElement { - /** - * Identifies the type of vision correction product which is required for the patient. - */ - @Child(name = "product", type = {Coding.class}, order=1, min=1, max=1, modifier=false, summary=true) - @Description(shortDefinition="Product to be supplied", formalDefinition="Identifies the type of vision correction product which is required for the patient." ) - protected Coding product; - - /** - * The eye for which the lens applies. - */ - @Child(name = "eye", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="right | left", formalDefinition="The eye for which the lens applies." ) - protected Enumeration eye; - - /** - * Lens power measured in diopters (0.25 units). - */ - @Child(name = "sphere", type = {DecimalType.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens sphere", formalDefinition="Lens power measured in diopters (0.25 units)." ) - protected DecimalType sphere; - - /** - * Power adjustment for astigmatism measured in diopters (0.25 units). - */ - @Child(name = "cylinder", type = {DecimalType.class}, order=4, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens cylinder", formalDefinition="Power adjustment for astigmatism measured in diopters (0.25 units)." ) - protected DecimalType cylinder; - - /** - * Adjustment for astigmatism measured in integer degrees. - */ - @Child(name = "axis", type = {IntegerType.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens axis", formalDefinition="Adjustment for astigmatism measured in integer degrees." ) - protected IntegerType axis; - - /** - * Amount of prism to compensate for eye alignment in fractional units. - */ - @Child(name = "prism", type = {DecimalType.class}, order=6, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens prism", formalDefinition="Amount of prism to compensate for eye alignment in fractional units." ) - protected DecimalType prism; - - /** - * The relative base, or reference lens edge, for the prism. - */ - @Child(name = "base", type = {CodeType.class}, order=7, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="up | down | in | out", formalDefinition="The relative base, or reference lens edge, for the prism." ) - protected Enumeration base; - - /** - * Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - @Child(name = "add", type = {DecimalType.class}, order=8, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens add", formalDefinition="Power adjustment for multifocal lenses measured in diopters (0.25 units)." ) - protected DecimalType add; - - /** - * Contact lens power measured in diopters (0.25 units). - */ - @Child(name = "power", type = {DecimalType.class}, order=9, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contact lens power", formalDefinition="Contact lens power measured in diopters (0.25 units)." ) - protected DecimalType power; - - /** - * Back curvature measured in millimeters. - */ - @Child(name = "backCurve", type = {DecimalType.class}, order=10, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contact lens back curvature", formalDefinition="Back curvature measured in millimeters." ) - protected DecimalType backCurve; - - /** - * Contact lens diameter measured in millimeters. - */ - @Child(name = "diameter", type = {DecimalType.class}, order=11, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Contact lens diameter", formalDefinition="Contact lens diameter measured in millimeters." ) - protected DecimalType diameter; - - /** - * The recommended maximum wear period for the lens. - */ - @Child(name = "duration", type = {SimpleQuantity.class}, order=12, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens wear duration", formalDefinition="The recommended maximum wear period for the lens." ) - protected SimpleQuantity duration; - - /** - * Special color or pattern. - */ - @Child(name = "color", type = {StringType.class}, order=13, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens add", formalDefinition="Special color or pattern." ) - protected StringType color; - - /** - * Brand recommendations or restrictions. - */ - @Child(name = "brand", type = {StringType.class}, order=14, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Lens add", formalDefinition="Brand recommendations or restrictions." ) - protected StringType brand; - - /** - * Notes for special requirements such as coatings and lens materials. - */ - @Child(name = "notes", type = {StringType.class}, order=15, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Notes for coatings", formalDefinition="Notes for special requirements such as coatings and lens materials." ) - protected StringType notes; - - private static final long serialVersionUID = -1586392610L; - - /** - * Constructor - */ - public VisionPrescriptionDispenseComponent() { - super(); - } - - /** - * Constructor - */ - public VisionPrescriptionDispenseComponent(Coding product) { - super(); - this.product = product; - } - - /** - * @return {@link #product} (Identifies the type of vision correction product which is required for the patient.) - */ - public Coding getProduct() { - if (this.product == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.product"); - else if (Configuration.doAutoCreate()) - this.product = new Coding(); // cc - return this.product; - } - - public boolean hasProduct() { - return this.product != null && !this.product.isEmpty(); - } - - /** - * @param value {@link #product} (Identifies the type of vision correction product which is required for the patient.) - */ - public VisionPrescriptionDispenseComponent setProduct(Coding value) { - this.product = value; - return this; - } - - /** - * @return {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value - */ - public Enumeration getEyeElement() { - if (this.eye == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.eye"); - else if (Configuration.doAutoCreate()) - this.eye = new Enumeration(new VisionEyesEnumFactory()); // bb - return this.eye; - } - - public boolean hasEyeElement() { - return this.eye != null && !this.eye.isEmpty(); - } - - public boolean hasEye() { - return this.eye != null && !this.eye.isEmpty(); - } - - /** - * @param value {@link #eye} (The eye for which the lens applies.). This is the underlying object with id, value and extensions. The accessor "getEye" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setEyeElement(Enumeration value) { - this.eye = value; - return this; - } - - /** - * @return The eye for which the lens applies. - */ - public VisionEyes getEye() { - return this.eye == null ? null : this.eye.getValue(); - } - - /** - * @param value The eye for which the lens applies. - */ - public VisionPrescriptionDispenseComponent setEye(VisionEyes value) { - if (value == null) - this.eye = null; - else { - if (this.eye == null) - this.eye = new Enumeration(new VisionEyesEnumFactory()); - this.eye.setValue(value); - } - return this; - } - - /** - * @return {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value - */ - public DecimalType getSphereElement() { - if (this.sphere == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.sphere"); - else if (Configuration.doAutoCreate()) - this.sphere = new DecimalType(); // bb - return this.sphere; - } - - public boolean hasSphereElement() { - return this.sphere != null && !this.sphere.isEmpty(); - } - - public boolean hasSphere() { - return this.sphere != null && !this.sphere.isEmpty(); - } - - /** - * @param value {@link #sphere} (Lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getSphere" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setSphereElement(DecimalType value) { - this.sphere = value; - return this; - } - - /** - * @return Lens power measured in diopters (0.25 units). - */ - public BigDecimal getSphere() { - return this.sphere == null ? null : this.sphere.getValue(); - } - - /** - * @param value Lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setSphere(BigDecimal value) { - if (value == null) - this.sphere = null; - else { - if (this.sphere == null) - this.sphere = new DecimalType(); - this.sphere.setValue(value); - } - return this; - } - - /** - * @param value Lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setSphere(long value) { - this.sphere = new DecimalType(); - this.sphere.setValue(value); - return this; - } - - /** - * @param value Lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setSphere(double value) { - this.sphere = new DecimalType(); - this.sphere.setValue(value); - return this; - } - - /** - * @return {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value - */ - public DecimalType getCylinderElement() { - if (this.cylinder == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.cylinder"); - else if (Configuration.doAutoCreate()) - this.cylinder = new DecimalType(); // bb - return this.cylinder; - } - - public boolean hasCylinderElement() { - return this.cylinder != null && !this.cylinder.isEmpty(); - } - - public boolean hasCylinder() { - return this.cylinder != null && !this.cylinder.isEmpty(); - } - - /** - * @param value {@link #cylinder} (Power adjustment for astigmatism measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getCylinder" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setCylinderElement(DecimalType value) { - this.cylinder = value; - return this; - } - - /** - * @return Power adjustment for astigmatism measured in diopters (0.25 units). - */ - public BigDecimal getCylinder() { - return this.cylinder == null ? null : this.cylinder.getValue(); - } - - /** - * @param value Power adjustment for astigmatism measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setCylinder(BigDecimal value) { - if (value == null) - this.cylinder = null; - else { - if (this.cylinder == null) - this.cylinder = new DecimalType(); - this.cylinder.setValue(value); - } - return this; - } - - /** - * @param value Power adjustment for astigmatism measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setCylinder(long value) { - this.cylinder = new DecimalType(); - this.cylinder.setValue(value); - return this; - } - - /** - * @param value Power adjustment for astigmatism measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setCylinder(double value) { - this.cylinder = new DecimalType(); - this.cylinder.setValue(value); - return this; - } - - /** - * @return {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value - */ - public IntegerType getAxisElement() { - if (this.axis == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.axis"); - else if (Configuration.doAutoCreate()) - this.axis = new IntegerType(); // bb - return this.axis; - } - - public boolean hasAxisElement() { - return this.axis != null && !this.axis.isEmpty(); - } - - public boolean hasAxis() { - return this.axis != null && !this.axis.isEmpty(); - } - - /** - * @param value {@link #axis} (Adjustment for astigmatism measured in integer degrees.). This is the underlying object with id, value and extensions. The accessor "getAxis" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setAxisElement(IntegerType value) { - this.axis = value; - return this; - } - - /** - * @return Adjustment for astigmatism measured in integer degrees. - */ - public int getAxis() { - return this.axis == null || this.axis.isEmpty() ? 0 : this.axis.getValue(); - } - - /** - * @param value Adjustment for astigmatism measured in integer degrees. - */ - public VisionPrescriptionDispenseComponent setAxis(int value) { - if (this.axis == null) - this.axis = new IntegerType(); - this.axis.setValue(value); - return this; - } - - /** - * @return {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value - */ - public DecimalType getPrismElement() { - if (this.prism == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.prism"); - else if (Configuration.doAutoCreate()) - this.prism = new DecimalType(); // bb - return this.prism; - } - - public boolean hasPrismElement() { - return this.prism != null && !this.prism.isEmpty(); - } - - public boolean hasPrism() { - return this.prism != null && !this.prism.isEmpty(); - } - - /** - * @param value {@link #prism} (Amount of prism to compensate for eye alignment in fractional units.). This is the underlying object with id, value and extensions. The accessor "getPrism" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setPrismElement(DecimalType value) { - this.prism = value; - return this; - } - - /** - * @return Amount of prism to compensate for eye alignment in fractional units. - */ - public BigDecimal getPrism() { - return this.prism == null ? null : this.prism.getValue(); - } - - /** - * @param value Amount of prism to compensate for eye alignment in fractional units. - */ - public VisionPrescriptionDispenseComponent setPrism(BigDecimal value) { - if (value == null) - this.prism = null; - else { - if (this.prism == null) - this.prism = new DecimalType(); - this.prism.setValue(value); - } - return this; - } - - /** - * @param value Amount of prism to compensate for eye alignment in fractional units. - */ - public VisionPrescriptionDispenseComponent setPrism(long value) { - this.prism = new DecimalType(); - this.prism.setValue(value); - return this; - } - - /** - * @param value Amount of prism to compensate for eye alignment in fractional units. - */ - public VisionPrescriptionDispenseComponent setPrism(double value) { - this.prism = new DecimalType(); - this.prism.setValue(value); - return this; - } - - /** - * @return {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public Enumeration getBaseElement() { - if (this.base == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.base"); - else if (Configuration.doAutoCreate()) - this.base = new Enumeration(new VisionBaseEnumFactory()); // bb - return this.base; - } - - public boolean hasBaseElement() { - return this.base != null && !this.base.isEmpty(); - } - - public boolean hasBase() { - return this.base != null && !this.base.isEmpty(); - } - - /** - * @param value {@link #base} (The relative base, or reference lens edge, for the prism.). This is the underlying object with id, value and extensions. The accessor "getBase" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setBaseElement(Enumeration value) { - this.base = value; - return this; - } - - /** - * @return The relative base, or reference lens edge, for the prism. - */ - public VisionBase getBase() { - return this.base == null ? null : this.base.getValue(); - } - - /** - * @param value The relative base, or reference lens edge, for the prism. - */ - public VisionPrescriptionDispenseComponent setBase(VisionBase value) { - if (value == null) - this.base = null; - else { - if (this.base == null) - this.base = new Enumeration(new VisionBaseEnumFactory()); - this.base.setValue(value); - } - return this; - } - - /** - * @return {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value - */ - public DecimalType getAddElement() { - if (this.add == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.add"); - else if (Configuration.doAutoCreate()) - this.add = new DecimalType(); // bb - return this.add; - } - - public boolean hasAddElement() { - return this.add != null && !this.add.isEmpty(); - } - - public boolean hasAdd() { - return this.add != null && !this.add.isEmpty(); - } - - /** - * @param value {@link #add} (Power adjustment for multifocal lenses measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getAdd" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setAddElement(DecimalType value) { - this.add = value; - return this; - } - - /** - * @return Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - public BigDecimal getAdd() { - return this.add == null ? null : this.add.getValue(); - } - - /** - * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setAdd(BigDecimal value) { - if (value == null) - this.add = null; - else { - if (this.add == null) - this.add = new DecimalType(); - this.add.setValue(value); - } - return this; - } - - /** - * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setAdd(long value) { - this.add = new DecimalType(); - this.add.setValue(value); - return this; - } - - /** - * @param value Power adjustment for multifocal lenses measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setAdd(double value) { - this.add = new DecimalType(); - this.add.setValue(value); - return this; - } - - /** - * @return {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value - */ - public DecimalType getPowerElement() { - if (this.power == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.power"); - else if (Configuration.doAutoCreate()) - this.power = new DecimalType(); // bb - return this.power; - } - - public boolean hasPowerElement() { - return this.power != null && !this.power.isEmpty(); - } - - public boolean hasPower() { - return this.power != null && !this.power.isEmpty(); - } - - /** - * @param value {@link #power} (Contact lens power measured in diopters (0.25 units).). This is the underlying object with id, value and extensions. The accessor "getPower" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setPowerElement(DecimalType value) { - this.power = value; - return this; - } - - /** - * @return Contact lens power measured in diopters (0.25 units). - */ - public BigDecimal getPower() { - return this.power == null ? null : this.power.getValue(); - } - - /** - * @param value Contact lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setPower(BigDecimal value) { - if (value == null) - this.power = null; - else { - if (this.power == null) - this.power = new DecimalType(); - this.power.setValue(value); - } - return this; - } - - /** - * @param value Contact lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setPower(long value) { - this.power = new DecimalType(); - this.power.setValue(value); - return this; - } - - /** - * @param value Contact lens power measured in diopters (0.25 units). - */ - public VisionPrescriptionDispenseComponent setPower(double value) { - this.power = new DecimalType(); - this.power.setValue(value); - return this; - } - - /** - * @return {@link #backCurve} (Back curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value - */ - public DecimalType getBackCurveElement() { - if (this.backCurve == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.backCurve"); - else if (Configuration.doAutoCreate()) - this.backCurve = new DecimalType(); // bb - return this.backCurve; - } - - public boolean hasBackCurveElement() { - return this.backCurve != null && !this.backCurve.isEmpty(); - } - - public boolean hasBackCurve() { - return this.backCurve != null && !this.backCurve.isEmpty(); - } - - /** - * @param value {@link #backCurve} (Back curvature measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getBackCurve" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setBackCurveElement(DecimalType value) { - this.backCurve = value; - return this; - } - - /** - * @return Back curvature measured in millimeters. - */ - public BigDecimal getBackCurve() { - return this.backCurve == null ? null : this.backCurve.getValue(); - } - - /** - * @param value Back curvature measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setBackCurve(BigDecimal value) { - if (value == null) - this.backCurve = null; - else { - if (this.backCurve == null) - this.backCurve = new DecimalType(); - this.backCurve.setValue(value); - } - return this; - } - - /** - * @param value Back curvature measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setBackCurve(long value) { - this.backCurve = new DecimalType(); - this.backCurve.setValue(value); - return this; - } - - /** - * @param value Back curvature measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setBackCurve(double value) { - this.backCurve = new DecimalType(); - this.backCurve.setValue(value); - return this; - } - - /** - * @return {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value - */ - public DecimalType getDiameterElement() { - if (this.diameter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.diameter"); - else if (Configuration.doAutoCreate()) - this.diameter = new DecimalType(); // bb - return this.diameter; - } - - public boolean hasDiameterElement() { - return this.diameter != null && !this.diameter.isEmpty(); - } - - public boolean hasDiameter() { - return this.diameter != null && !this.diameter.isEmpty(); - } - - /** - * @param value {@link #diameter} (Contact lens diameter measured in millimeters.). This is the underlying object with id, value and extensions. The accessor "getDiameter" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setDiameterElement(DecimalType value) { - this.diameter = value; - return this; - } - - /** - * @return Contact lens diameter measured in millimeters. - */ - public BigDecimal getDiameter() { - return this.diameter == null ? null : this.diameter.getValue(); - } - - /** - * @param value Contact lens diameter measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setDiameter(BigDecimal value) { - if (value == null) - this.diameter = null; - else { - if (this.diameter == null) - this.diameter = new DecimalType(); - this.diameter.setValue(value); - } - return this; - } - - /** - * @param value Contact lens diameter measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setDiameter(long value) { - this.diameter = new DecimalType(); - this.diameter.setValue(value); - return this; - } - - /** - * @param value Contact lens diameter measured in millimeters. - */ - public VisionPrescriptionDispenseComponent setDiameter(double value) { - this.diameter = new DecimalType(); - this.diameter.setValue(value); - return this; - } - - /** - * @return {@link #duration} (The recommended maximum wear period for the lens.) - */ - public SimpleQuantity getDuration() { - if (this.duration == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.duration"); - else if (Configuration.doAutoCreate()) - this.duration = new SimpleQuantity(); // cc - return this.duration; - } - - public boolean hasDuration() { - return this.duration != null && !this.duration.isEmpty(); - } - - /** - * @param value {@link #duration} (The recommended maximum wear period for the lens.) - */ - public VisionPrescriptionDispenseComponent setDuration(SimpleQuantity value) { - this.duration = value; - return this; - } - - /** - * @return {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public StringType getColorElement() { - if (this.color == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.color"); - else if (Configuration.doAutoCreate()) - this.color = new StringType(); // bb - return this.color; - } - - public boolean hasColorElement() { - return this.color != null && !this.color.isEmpty(); - } - - public boolean hasColor() { - return this.color != null && !this.color.isEmpty(); - } - - /** - * @param value {@link #color} (Special color or pattern.). This is the underlying object with id, value and extensions. The accessor "getColor" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setColorElement(StringType value) { - this.color = value; - return this; - } - - /** - * @return Special color or pattern. - */ - public String getColor() { - return this.color == null ? null : this.color.getValue(); - } - - /** - * @param value Special color or pattern. - */ - public VisionPrescriptionDispenseComponent setColor(String value) { - if (Utilities.noString(value)) - this.color = null; - else { - if (this.color == null) - this.color = new StringType(); - this.color.setValue(value); - } - return this; - } - - /** - * @return {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value - */ - public StringType getBrandElement() { - if (this.brand == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.brand"); - else if (Configuration.doAutoCreate()) - this.brand = new StringType(); // bb - return this.brand; - } - - public boolean hasBrandElement() { - return this.brand != null && !this.brand.isEmpty(); - } - - public boolean hasBrand() { - return this.brand != null && !this.brand.isEmpty(); - } - - /** - * @param value {@link #brand} (Brand recommendations or restrictions.). This is the underlying object with id, value and extensions. The accessor "getBrand" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setBrandElement(StringType value) { - this.brand = value; - return this; - } - - /** - * @return Brand recommendations or restrictions. - */ - public String getBrand() { - return this.brand == null ? null : this.brand.getValue(); - } - - /** - * @param value Brand recommendations or restrictions. - */ - public VisionPrescriptionDispenseComponent setBrand(String value) { - if (Utilities.noString(value)) - this.brand = null; - else { - if (this.brand == null) - this.brand = new StringType(); - this.brand.setValue(value); - } - return this; - } - - /** - * @return {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public StringType getNotesElement() { - if (this.notes == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescriptionDispenseComponent.notes"); - else if (Configuration.doAutoCreate()) - this.notes = new StringType(); // bb - return this.notes; - } - - public boolean hasNotesElement() { - return this.notes != null && !this.notes.isEmpty(); - } - - public boolean hasNotes() { - return this.notes != null && !this.notes.isEmpty(); - } - - /** - * @param value {@link #notes} (Notes for special requirements such as coatings and lens materials.). This is the underlying object with id, value and extensions. The accessor "getNotes" gives direct access to the value - */ - public VisionPrescriptionDispenseComponent setNotesElement(StringType value) { - this.notes = value; - return this; - } - - /** - * @return Notes for special requirements such as coatings and lens materials. - */ - public String getNotes() { - return this.notes == null ? null : this.notes.getValue(); - } - - /** - * @param value Notes for special requirements such as coatings and lens materials. - */ - public VisionPrescriptionDispenseComponent setNotes(String value) { - if (Utilities.noString(value)) - this.notes = null; - else { - if (this.notes == null) - this.notes = new StringType(); - this.notes.setValue(value); - } - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("product", "Coding", "Identifies the type of vision correction product which is required for the patient.", 0, java.lang.Integer.MAX_VALUE, product)); - childrenList.add(new Property("eye", "code", "The eye for which the lens applies.", 0, java.lang.Integer.MAX_VALUE, eye)); - childrenList.add(new Property("sphere", "decimal", "Lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, sphere)); - childrenList.add(new Property("cylinder", "decimal", "Power adjustment for astigmatism measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, cylinder)); - childrenList.add(new Property("axis", "integer", "Adjustment for astigmatism measured in integer degrees.", 0, java.lang.Integer.MAX_VALUE, axis)); - childrenList.add(new Property("prism", "decimal", "Amount of prism to compensate for eye alignment in fractional units.", 0, java.lang.Integer.MAX_VALUE, prism)); - childrenList.add(new Property("base", "code", "The relative base, or reference lens edge, for the prism.", 0, java.lang.Integer.MAX_VALUE, base)); - childrenList.add(new Property("add", "decimal", "Power adjustment for multifocal lenses measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, add)); - childrenList.add(new Property("power", "decimal", "Contact lens power measured in diopters (0.25 units).", 0, java.lang.Integer.MAX_VALUE, power)); - childrenList.add(new Property("backCurve", "decimal", "Back curvature measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, backCurve)); - childrenList.add(new Property("diameter", "decimal", "Contact lens diameter measured in millimeters.", 0, java.lang.Integer.MAX_VALUE, diameter)); - childrenList.add(new Property("duration", "SimpleQuantity", "The recommended maximum wear period for the lens.", 0, java.lang.Integer.MAX_VALUE, duration)); - childrenList.add(new Property("color", "string", "Special color or pattern.", 0, java.lang.Integer.MAX_VALUE, color)); - childrenList.add(new Property("brand", "string", "Brand recommendations or restrictions.", 0, java.lang.Integer.MAX_VALUE, brand)); - childrenList.add(new Property("notes", "string", "Notes for special requirements such as coatings and lens materials.", 0, java.lang.Integer.MAX_VALUE, notes)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -309474065: /*product*/ return this.product == null ? new Base[0] : new Base[] {this.product}; // Coding - case 100913: /*eye*/ return this.eye == null ? new Base[0] : new Base[] {this.eye}; // Enumeration - case -895981619: /*sphere*/ return this.sphere == null ? new Base[0] : new Base[] {this.sphere}; // DecimalType - case -349378602: /*cylinder*/ return this.cylinder == null ? new Base[0] : new Base[] {this.cylinder}; // DecimalType - case 3008417: /*axis*/ return this.axis == null ? new Base[0] : new Base[] {this.axis}; // IntegerType - case 106935105: /*prism*/ return this.prism == null ? new Base[0] : new Base[] {this.prism}; // DecimalType - case 3016401: /*base*/ return this.base == null ? new Base[0] : new Base[] {this.base}; // Enumeration - case 96417: /*add*/ return this.add == null ? new Base[0] : new Base[] {this.add}; // DecimalType - case 106858757: /*power*/ return this.power == null ? new Base[0] : new Base[] {this.power}; // DecimalType - case 1309344840: /*backCurve*/ return this.backCurve == null ? new Base[0] : new Base[] {this.backCurve}; // DecimalType - case -233204595: /*diameter*/ return this.diameter == null ? new Base[0] : new Base[] {this.diameter}; // DecimalType - case -1992012396: /*duration*/ return this.duration == null ? new Base[0] : new Base[] {this.duration}; // SimpleQuantity - case 94842723: /*color*/ return this.color == null ? new Base[0] : new Base[] {this.color}; // StringType - case 93997959: /*brand*/ return this.brand == null ? new Base[0] : new Base[] {this.brand}; // StringType - case 105008833: /*notes*/ return this.notes == null ? new Base[0] : new Base[] {this.notes}; // StringType - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -309474065: // product - this.product = castToCoding(value); // Coding - break; - case 100913: // eye - this.eye = new VisionEyesEnumFactory().fromType(value); // Enumeration - break; - case -895981619: // sphere - this.sphere = castToDecimal(value); // DecimalType - break; - case -349378602: // cylinder - this.cylinder = castToDecimal(value); // DecimalType - break; - case 3008417: // axis - this.axis = castToInteger(value); // IntegerType - break; - case 106935105: // prism - this.prism = castToDecimal(value); // DecimalType - break; - case 3016401: // base - this.base = new VisionBaseEnumFactory().fromType(value); // Enumeration - break; - case 96417: // add - this.add = castToDecimal(value); // DecimalType - break; - case 106858757: // power - this.power = castToDecimal(value); // DecimalType - break; - case 1309344840: // backCurve - this.backCurve = castToDecimal(value); // DecimalType - break; - case -233204595: // diameter - this.diameter = castToDecimal(value); // DecimalType - break; - case -1992012396: // duration - this.duration = castToSimpleQuantity(value); // SimpleQuantity - break; - case 94842723: // color - this.color = castToString(value); // StringType - break; - case 93997959: // brand - this.brand = castToString(value); // StringType - break; - case 105008833: // notes - this.notes = castToString(value); // StringType - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("product")) - this.product = castToCoding(value); // Coding - else if (name.equals("eye")) - this.eye = new VisionEyesEnumFactory().fromType(value); // Enumeration - else if (name.equals("sphere")) - this.sphere = castToDecimal(value); // DecimalType - else if (name.equals("cylinder")) - this.cylinder = castToDecimal(value); // DecimalType - else if (name.equals("axis")) - this.axis = castToInteger(value); // IntegerType - else if (name.equals("prism")) - this.prism = castToDecimal(value); // DecimalType - else if (name.equals("base")) - this.base = new VisionBaseEnumFactory().fromType(value); // Enumeration - else if (name.equals("add")) - this.add = castToDecimal(value); // DecimalType - else if (name.equals("power")) - this.power = castToDecimal(value); // DecimalType - else if (name.equals("backCurve")) - this.backCurve = castToDecimal(value); // DecimalType - else if (name.equals("diameter")) - this.diameter = castToDecimal(value); // DecimalType - else if (name.equals("duration")) - this.duration = castToSimpleQuantity(value); // SimpleQuantity - else if (name.equals("color")) - this.color = castToString(value); // StringType - else if (name.equals("brand")) - this.brand = castToString(value); // StringType - else if (name.equals("notes")) - this.notes = castToString(value); // StringType - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -309474065: return getProduct(); // Coding - case 100913: throw new FHIRException("Cannot make property eye as it is not a complex type"); // Enumeration - case -895981619: throw new FHIRException("Cannot make property sphere as it is not a complex type"); // DecimalType - case -349378602: throw new FHIRException("Cannot make property cylinder as it is not a complex type"); // DecimalType - case 3008417: throw new FHIRException("Cannot make property axis as it is not a complex type"); // IntegerType - case 106935105: throw new FHIRException("Cannot make property prism as it is not a complex type"); // DecimalType - case 3016401: throw new FHIRException("Cannot make property base as it is not a complex type"); // Enumeration - case 96417: throw new FHIRException("Cannot make property add as it is not a complex type"); // DecimalType - case 106858757: throw new FHIRException("Cannot make property power as it is not a complex type"); // DecimalType - case 1309344840: throw new FHIRException("Cannot make property backCurve as it is not a complex type"); // DecimalType - case -233204595: throw new FHIRException("Cannot make property diameter as it is not a complex type"); // DecimalType - case -1992012396: return getDuration(); // SimpleQuantity - case 94842723: throw new FHIRException("Cannot make property color as it is not a complex type"); // StringType - case 93997959: throw new FHIRException("Cannot make property brand as it is not a complex type"); // StringType - case 105008833: throw new FHIRException("Cannot make property notes as it is not a complex type"); // StringType - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("product")) { - this.product = new Coding(); - return this.product; - } - else if (name.equals("eye")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.eye"); - } - else if (name.equals("sphere")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.sphere"); - } - else if (name.equals("cylinder")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.cylinder"); - } - else if (name.equals("axis")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.axis"); - } - else if (name.equals("prism")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.prism"); - } - else if (name.equals("base")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.base"); - } - else if (name.equals("add")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.add"); - } - else if (name.equals("power")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.power"); - } - else if (name.equals("backCurve")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.backCurve"); - } - else if (name.equals("diameter")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.diameter"); - } - else if (name.equals("duration")) { - this.duration = new SimpleQuantity(); - return this.duration; - } - else if (name.equals("color")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.color"); - } - else if (name.equals("brand")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.brand"); - } - else if (name.equals("notes")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.notes"); - } - else - return super.addChild(name); - } - - public VisionPrescriptionDispenseComponent copy() { - VisionPrescriptionDispenseComponent dst = new VisionPrescriptionDispenseComponent(); - copyValues(dst); - dst.product = product == null ? null : product.copy(); - dst.eye = eye == null ? null : eye.copy(); - dst.sphere = sphere == null ? null : sphere.copy(); - dst.cylinder = cylinder == null ? null : cylinder.copy(); - dst.axis = axis == null ? null : axis.copy(); - dst.prism = prism == null ? null : prism.copy(); - dst.base = base == null ? null : base.copy(); - dst.add = add == null ? null : add.copy(); - dst.power = power == null ? null : power.copy(); - dst.backCurve = backCurve == null ? null : backCurve.copy(); - dst.diameter = diameter == null ? null : diameter.copy(); - dst.duration = duration == null ? null : duration.copy(); - dst.color = color == null ? null : color.copy(); - dst.brand = brand == null ? null : brand.copy(); - dst.notes = notes == null ? null : notes.copy(); - return dst; - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof VisionPrescriptionDispenseComponent)) - return false; - VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; - return compareDeep(product, o.product, true) && compareDeep(eye, o.eye, true) && compareDeep(sphere, o.sphere, true) - && compareDeep(cylinder, o.cylinder, true) && compareDeep(axis, o.axis, true) && compareDeep(prism, o.prism, true) - && compareDeep(base, o.base, true) && compareDeep(add, o.add, true) && compareDeep(power, o.power, true) - && compareDeep(backCurve, o.backCurve, true) && compareDeep(diameter, o.diameter, true) && compareDeep(duration, o.duration, true) - && compareDeep(color, o.color, true) && compareDeep(brand, o.brand, true) && compareDeep(notes, o.notes, true) - ; - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof VisionPrescriptionDispenseComponent)) - return false; - VisionPrescriptionDispenseComponent o = (VisionPrescriptionDispenseComponent) other; - return compareValues(eye, o.eye, true) && compareValues(sphere, o.sphere, true) && compareValues(cylinder, o.cylinder, true) - && compareValues(axis, o.axis, true) && compareValues(prism, o.prism, true) && compareValues(base, o.base, true) - && compareValues(add, o.add, true) && compareValues(power, o.power, true) && compareValues(backCurve, o.backCurve, true) - && compareValues(diameter, o.diameter, true) && compareValues(color, o.color, true) && compareValues(brand, o.brand, true) - && compareValues(notes, o.notes, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (product == null || product.isEmpty()) && (eye == null || eye.isEmpty()) - && (sphere == null || sphere.isEmpty()) && (cylinder == null || cylinder.isEmpty()) && (axis == null || axis.isEmpty()) - && (prism == null || prism.isEmpty()) && (base == null || base.isEmpty()) && (add == null || add.isEmpty()) - && (power == null || power.isEmpty()) && (backCurve == null || backCurve.isEmpty()) && (diameter == null || diameter.isEmpty()) - && (duration == null || duration.isEmpty()) && (color == null || color.isEmpty()) && (brand == null || brand.isEmpty()) - && (notes == null || notes.isEmpty()); - } - - public String fhirType() { - return "VisionPrescription.dispense"; - - } - - } - - /** - * Business identifier which may be used by other parties to reference or identify the prescription. - */ - @Child(name = "identifier", type = {Identifier.class}, order=0, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Business identifier", formalDefinition="Business identifier which may be used by other parties to reference or identify the prescription." ) - protected List identifier; - - /** - * The date (and perhaps time) when the prescription was written. - */ - @Child(name = "dateWritten", type = {DateTimeType.class}, order=1, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="When prescription was authorized", formalDefinition="The date (and perhaps time) when the prescription was written." ) - protected DateTimeType dateWritten; - - /** - * A link to a resource representing the person to whom the vision products will be supplied. - */ - @Child(name = "patient", type = {Patient.class}, order=2, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who prescription is for", formalDefinition="A link to a resource representing the person to whom the vision products will be supplied." ) - protected Reference patient; - - /** - * The actual object that is the target of the reference (A link to a resource representing the person to whom the vision products will be supplied.) - */ - protected Patient patientTarget; - - /** - * The healthcare professional responsible for authorizing the prescription. - */ - @Child(name = "prescriber", type = {Practitioner.class}, order=3, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Who authorizes the vision product", formalDefinition="The healthcare professional responsible for authorizing the prescription." ) - protected Reference prescriber; - - /** - * The actual object that is the target of the reference (The healthcare professional responsible for authorizing the prescription.) - */ - protected Practitioner prescriberTarget; - - /** - * A link to a resource that identifies the particular occurrence of contact between patient and health care provider. - */ - @Child(name = "encounter", type = {Encounter.class}, order=4, min=0, max=1, modifier=false, summary=true) - @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." ) - protected Reference encounter; - - /** - * The actual object that is the target of the reference (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - protected Encounter encounterTarget; - - /** - * Can be the reason or the indication for writing the prescription. - */ - @Child(name = "reason", type = {CodeableConcept.class, Condition.class}, order=5, min=0, max=1, modifier=false, summary=true) - @Description(shortDefinition="Reason or indication for writing the prescription", formalDefinition="Can be the reason or the indication for writing the prescription." ) - protected Type reason; - - /** - * Deals with details of the dispense part of the supply specification. - */ - @Child(name = "dispense", type = {}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true) - @Description(shortDefinition="Vision supply authorization", formalDefinition="Deals with details of the dispense part of the supply specification." ) - protected List dispense; - - private static final long serialVersionUID = -1108276057L; - - /** - * Constructor - */ - public VisionPrescription() { - super(); - } - - /** - * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) - */ - public List getIdentifier() { - if (this.identifier == null) - this.identifier = new ArrayList(); - return this.identifier; - } - - public boolean hasIdentifier() { - if (this.identifier == null) - return false; - for (Identifier item : this.identifier) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #identifier} (Business identifier which may be used by other parties to reference or identify the prescription.) - */ - // syntactic sugar - public Identifier addIdentifier() { //3 - Identifier t = new Identifier(); - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return t; - } - - // syntactic sugar - public VisionPrescription addIdentifier(Identifier t) { //3 - if (t == null) - return this; - if (this.identifier == null) - this.identifier = new ArrayList(); - this.identifier.add(t); - return this; - } - - /** - * @return {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public DateTimeType getDateWrittenElement() { - if (this.dateWritten == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.dateWritten"); - else if (Configuration.doAutoCreate()) - this.dateWritten = new DateTimeType(); // bb - return this.dateWritten; - } - - public boolean hasDateWrittenElement() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - public boolean hasDateWritten() { - return this.dateWritten != null && !this.dateWritten.isEmpty(); - } - - /** - * @param value {@link #dateWritten} (The date (and perhaps time) when the prescription was written.). This is the underlying object with id, value and extensions. The accessor "getDateWritten" gives direct access to the value - */ - public VisionPrescription setDateWrittenElement(DateTimeType value) { - this.dateWritten = value; - return this; - } - - /** - * @return The date (and perhaps time) when the prescription was written. - */ - public Date getDateWritten() { - return this.dateWritten == null ? null : this.dateWritten.getValue(); - } - - /** - * @param value The date (and perhaps time) when the prescription was written. - */ - public VisionPrescription setDateWritten(Date value) { - if (value == null) - this.dateWritten = null; - else { - if (this.dateWritten == null) - this.dateWritten = new DateTimeType(); - this.dateWritten.setValue(value); - } - return this; - } - - /** - * @return {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public Reference getPatient() { - if (this.patient == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patient = new Reference(); // cc - return this.patient; - } - - public boolean hasPatient() { - return this.patient != null && !this.patient.isEmpty(); - } - - /** - * @param value {@link #patient} (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public VisionPrescription setPatient(Reference value) { - this.patient = value; - return this; - } - - /** - * @return {@link #patient} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public Patient getPatientTarget() { - if (this.patientTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.patient"); - else if (Configuration.doAutoCreate()) - this.patientTarget = new Patient(); // aa - return this.patientTarget; - } - - /** - * @param value {@link #patient} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource representing the person to whom the vision products will be supplied.) - */ - public VisionPrescription setPatientTarget(Patient value) { - this.patientTarget = value; - return this; - } - - /** - * @return {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public Reference getPrescriber() { - if (this.prescriber == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriber = new Reference(); // cc - return this.prescriber; - } - - public boolean hasPrescriber() { - return this.prescriber != null && !this.prescriber.isEmpty(); - } - - /** - * @param value {@link #prescriber} (The healthcare professional responsible for authorizing the prescription.) - */ - public VisionPrescription setPrescriber(Reference value) { - this.prescriber = value; - return this; - } - - /** - * @return {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public Practitioner getPrescriberTarget() { - if (this.prescriberTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.prescriber"); - else if (Configuration.doAutoCreate()) - this.prescriberTarget = new Practitioner(); // aa - return this.prescriberTarget; - } - - /** - * @param value {@link #prescriber} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (The healthcare professional responsible for authorizing the prescription.) - */ - public VisionPrescription setPrescriberTarget(Practitioner value) { - this.prescriberTarget = value; - return this; - } - - /** - * @return {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Reference getEncounter() { - if (this.encounter == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounter = new Reference(); // cc - return this.encounter; - } - - public boolean hasEncounter() { - return this.encounter != null && !this.encounter.isEmpty(); - } - - /** - * @param value {@link #encounter} (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public VisionPrescription setEncounter(Reference value) { - this.encounter = value; - return this; - } - - /** - * @return {@link #encounter} The actual object that is the target of the reference. The reference library doesn't populate this, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public Encounter getEncounterTarget() { - if (this.encounterTarget == null) - if (Configuration.errorOnAutoCreate()) - throw new Error("Attempt to auto-create VisionPrescription.encounter"); - else if (Configuration.doAutoCreate()) - this.encounterTarget = new Encounter(); // aa - return this.encounterTarget; - } - - /** - * @param value {@link #encounter} The actual object that is the target of the reference. The reference library doesn't use these, but you can use it to hold the resource if you resolve it. (A link to a resource that identifies the particular occurrence of contact between patient and health care provider.) - */ - public VisionPrescription setEncounterTarget(Encounter value) { - this.encounterTarget = value; - return this; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Type getReason() { - return this.reason; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public CodeableConcept getReasonCodeableConcept() throws FHIRException { - if (!(this.reason instanceof CodeableConcept)) - throw new FHIRException("Type mismatch: the type CodeableConcept was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (CodeableConcept) this.reason; - } - - public boolean hasReasonCodeableConcept() { - return this.reason instanceof CodeableConcept; - } - - /** - * @return {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public Reference getReasonReference() throws FHIRException { - if (!(this.reason instanceof Reference)) - throw new FHIRException("Type mismatch: the type Reference was expected, but "+this.reason.getClass().getName()+" was encountered"); - return (Reference) this.reason; - } - - public boolean hasReasonReference() { - return this.reason instanceof Reference; - } - - public boolean hasReason() { - return this.reason != null && !this.reason.isEmpty(); - } - - /** - * @param value {@link #reason} (Can be the reason or the indication for writing the prescription.) - */ - public VisionPrescription setReason(Type value) { - this.reason = value; - return this; - } - - /** - * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) - */ - public List getDispense() { - if (this.dispense == null) - this.dispense = new ArrayList(); - return this.dispense; - } - - public boolean hasDispense() { - if (this.dispense == null) - return false; - for (VisionPrescriptionDispenseComponent item : this.dispense) - if (!item.isEmpty()) - return true; - return false; - } - - /** - * @return {@link #dispense} (Deals with details of the dispense part of the supply specification.) - */ - // syntactic sugar - public VisionPrescriptionDispenseComponent addDispense() { //3 - VisionPrescriptionDispenseComponent t = new VisionPrescriptionDispenseComponent(); - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return t; - } - - // syntactic sugar - public VisionPrescription addDispense(VisionPrescriptionDispenseComponent t) { //3 - if (t == null) - return this; - if (this.dispense == null) - this.dispense = new ArrayList(); - this.dispense.add(t); - return this; - } - - protected void listChildren(List childrenList) { - super.listChildren(childrenList); - childrenList.add(new Property("identifier", "Identifier", "Business identifier which may be used by other parties to reference or identify the prescription.", 0, java.lang.Integer.MAX_VALUE, identifier)); - childrenList.add(new Property("dateWritten", "dateTime", "The date (and perhaps time) when the prescription was written.", 0, java.lang.Integer.MAX_VALUE, dateWritten)); - childrenList.add(new Property("patient", "Reference(Patient)", "A link to a resource representing the person to whom the vision products will be supplied.", 0, java.lang.Integer.MAX_VALUE, patient)); - childrenList.add(new Property("prescriber", "Reference(Practitioner)", "The healthcare professional responsible for authorizing the prescription.", 0, java.lang.Integer.MAX_VALUE, prescriber)); - childrenList.add(new Property("encounter", "Reference(Encounter)", "A link to a resource that identifies the particular occurrence of contact between patient and health care provider.", 0, java.lang.Integer.MAX_VALUE, encounter)); - childrenList.add(new Property("reason[x]", "CodeableConcept|Reference(Condition)", "Can be the reason or the indication for writing the prescription.", 0, java.lang.Integer.MAX_VALUE, reason)); - childrenList.add(new Property("dispense", "", "Deals with details of the dispense part of the supply specification.", 0, java.lang.Integer.MAX_VALUE, dispense)); - } - - @Override - public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException { - switch (hash) { - case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : this.identifier.toArray(new Base[this.identifier.size()]); // Identifier - case -1496880759: /*dateWritten*/ return this.dateWritten == null ? new Base[0] : new Base[] {this.dateWritten}; // DateTimeType - case -791418107: /*patient*/ return this.patient == null ? new Base[0] : new Base[] {this.patient}; // Reference - case 1430631077: /*prescriber*/ return this.prescriber == null ? new Base[0] : new Base[] {this.prescriber}; // Reference - case 1524132147: /*encounter*/ return this.encounter == null ? new Base[0] : new Base[] {this.encounter}; // Reference - case -934964668: /*reason*/ return this.reason == null ? new Base[0] : new Base[] {this.reason}; // Type - case 284885341: /*dispense*/ return this.dispense == null ? new Base[0] : this.dispense.toArray(new Base[this.dispense.size()]); // VisionPrescriptionDispenseComponent - default: return super.getProperty(hash, name, checkValid); - } - - } - - @Override - public void setProperty(int hash, String name, Base value) throws FHIRException { - switch (hash) { - case -1618432855: // identifier - this.getIdentifier().add(castToIdentifier(value)); // Identifier - break; - case -1496880759: // dateWritten - this.dateWritten = castToDateTime(value); // DateTimeType - break; - case -791418107: // patient - this.patient = castToReference(value); // Reference - break; - case 1430631077: // prescriber - this.prescriber = castToReference(value); // Reference - break; - case 1524132147: // encounter - this.encounter = castToReference(value); // Reference - break; - case -934964668: // reason - this.reason = (Type) value; // Type - break; - case 284885341: // dispense - this.getDispense().add((VisionPrescriptionDispenseComponent) value); // VisionPrescriptionDispenseComponent - break; - default: super.setProperty(hash, name, value); - } - - } - - @Override - public void setProperty(String name, Base value) throws FHIRException { - if (name.equals("identifier")) - this.getIdentifier().add(castToIdentifier(value)); - else if (name.equals("dateWritten")) - this.dateWritten = castToDateTime(value); // DateTimeType - else if (name.equals("patient")) - this.patient = castToReference(value); // Reference - else if (name.equals("prescriber")) - this.prescriber = castToReference(value); // Reference - else if (name.equals("encounter")) - this.encounter = castToReference(value); // Reference - else if (name.equals("reason[x]")) - this.reason = (Type) value; // Type - else if (name.equals("dispense")) - this.getDispense().add((VisionPrescriptionDispenseComponent) value); - else - super.setProperty(name, value); - } - - @Override - public Base makeProperty(int hash, String name) throws FHIRException { - switch (hash) { - case -1618432855: return addIdentifier(); // Identifier - case -1496880759: throw new FHIRException("Cannot make property dateWritten as it is not a complex type"); // DateTimeType - case -791418107: return getPatient(); // Reference - case 1430631077: return getPrescriber(); // Reference - case 1524132147: return getEncounter(); // Reference - case -669418564: return getReason(); // Type - case 284885341: return addDispense(); // VisionPrescriptionDispenseComponent - default: return super.makeProperty(hash, name); - } - - } - - @Override - public Base addChild(String name) throws FHIRException { - if (name.equals("identifier")) { - return addIdentifier(); - } - else if (name.equals("dateWritten")) { - throw new FHIRException("Cannot call addChild on a primitive type VisionPrescription.dateWritten"); - } - else if (name.equals("patient")) { - this.patient = new Reference(); - return this.patient; - } - else if (name.equals("prescriber")) { - this.prescriber = new Reference(); - return this.prescriber; - } - else if (name.equals("encounter")) { - this.encounter = new Reference(); - return this.encounter; - } - else if (name.equals("reasonCodeableConcept")) { - this.reason = new CodeableConcept(); - return this.reason; - } - else if (name.equals("reasonReference")) { - this.reason = new Reference(); - return this.reason; - } - else if (name.equals("dispense")) { - return addDispense(); - } - else - return super.addChild(name); - } - - public String fhirType() { - return "VisionPrescription"; - - } - - public VisionPrescription copy() { - VisionPrescription dst = new VisionPrescription(); - copyValues(dst); - if (identifier != null) { - dst.identifier = new ArrayList(); - for (Identifier i : identifier) - dst.identifier.add(i.copy()); - }; - dst.dateWritten = dateWritten == null ? null : dateWritten.copy(); - dst.patient = patient == null ? null : patient.copy(); - dst.prescriber = prescriber == null ? null : prescriber.copy(); - dst.encounter = encounter == null ? null : encounter.copy(); - dst.reason = reason == null ? null : reason.copy(); - if (dispense != null) { - dst.dispense = new ArrayList(); - for (VisionPrescriptionDispenseComponent i : dispense) - dst.dispense.add(i.copy()); - }; - return dst; - } - - protected VisionPrescription typedCopy() { - return copy(); - } - - @Override - public boolean equalsDeep(Base other) { - if (!super.equalsDeep(other)) - return false; - if (!(other instanceof VisionPrescription)) - return false; - VisionPrescription o = (VisionPrescription) other; - return compareDeep(identifier, o.identifier, true) && compareDeep(dateWritten, o.dateWritten, true) - && compareDeep(patient, o.patient, true) && compareDeep(prescriber, o.prescriber, true) && compareDeep(encounter, o.encounter, true) - && compareDeep(reason, o.reason, true) && compareDeep(dispense, o.dispense, true); - } - - @Override - public boolean equalsShallow(Base other) { - if (!super.equalsShallow(other)) - return false; - if (!(other instanceof VisionPrescription)) - return false; - VisionPrescription o = (VisionPrescription) other; - return compareValues(dateWritten, o.dateWritten, true); - } - - public boolean isEmpty() { - return super.isEmpty() && (identifier == null || identifier.isEmpty()) && (dateWritten == null || dateWritten.isEmpty()) - && (patient == null || patient.isEmpty()) && (prescriber == null || prescriber.isEmpty()) - && (encounter == null || encounter.isEmpty()) && (reason == null || reason.isEmpty()) && (dispense == null || dispense.isEmpty()) - ; - } - - @Override - public ResourceType getResourceType() { - return ResourceType.VisionPrescription; - } - - /** - * Search parameter: datewritten - *

- * Description: Return prescriptions written on this date
- * Type: date
- * Path: VisionPrescription.dateWritten
- *

- */ - @SearchParamDefinition(name="datewritten", path="VisionPrescription.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: VisionPrescription.dateWritten
- *

- */ - public static final ca.uhn.fhir.rest.gclient.DateClientParam DATEWRITTEN = new ca.uhn.fhir.rest.gclient.DateClientParam(SP_DATEWRITTEN); - - /** - * Search parameter: patient - *

- * Description: The identity of a patient to list dispenses for
- * Type: reference
- * Path: VisionPrescription.patient
- *

- */ - @SearchParamDefinition(name="patient", path="VisionPrescription.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: VisionPrescription.patient
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PATIENT = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PATIENT); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "VisionPrescription:patient". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PATIENT = new ca.uhn.fhir.model.api.Include("VisionPrescription:patient").toLocked(); - - /** - * Search parameter: prescriber - *

- * Description: Who authorizes the vision product
- * Type: reference
- * Path: VisionPrescription.prescriber
- *

- */ - @SearchParamDefinition(name="prescriber", path="VisionPrescription.prescriber", description="Who authorizes the vision product", type="reference" ) - public static final String SP_PRESCRIBER = "prescriber"; - /** - * Fluent Client search parameter constant for prescriber - *

- * Description: Who authorizes the vision product
- * Type: reference
- * Path: VisionPrescription.prescriber
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam PRESCRIBER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_PRESCRIBER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "VisionPrescription:prescriber". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_PRESCRIBER = new ca.uhn.fhir.model.api.Include("VisionPrescription:prescriber").toLocked(); - - /** - * Search parameter: encounter - *

- * Description: Return prescriptions with this encounter identifier
- * Type: reference
- * Path: VisionPrescription.encounter
- *

- */ - @SearchParamDefinition(name="encounter", path="VisionPrescription.encounter", description="Return prescriptions with this encounter identifier", type="reference" ) - public static final String SP_ENCOUNTER = "encounter"; - /** - * Fluent Client search parameter constant for encounter - *

- * Description: Return prescriptions with this encounter identifier
- * Type: reference
- * Path: VisionPrescription.encounter
- *

- */ - public static final ca.uhn.fhir.rest.gclient.ReferenceClientParam ENCOUNTER = new ca.uhn.fhir.rest.gclient.ReferenceClientParam(SP_ENCOUNTER); - -/** - * Constant for fluent queries to be used to add include statements. Specifies - * the path value of "VisionPrescription:encounter". - */ - public static final ca.uhn.fhir.model.api.Include INCLUDE_ENCOUNTER = new ca.uhn.fhir.model.api.Include("VisionPrescription:encounter").toLocked(); - - /** - * Search parameter: identifier - *

- * Description: Return prescriptions with this external identifier
- * Type: token
- * Path: VisionPrescription.identifier
- *

- */ - @SearchParamDefinition(name="identifier", path="VisionPrescription.identifier", description="Return prescriptions with this external identifier", type="token" ) - public static final String SP_IDENTIFIER = "identifier"; - /** - * Fluent Client search parameter constant for identifier - *

- * Description: Return prescriptions with this external identifier
- * Type: token
- * Path: VisionPrescription.identifier
- *

- */ - public static final ca.uhn.fhir.rest.gclient.TokenClientParam IDENTIFIER = new ca.uhn.fhir.rest.gclient.TokenClientParam(SP_IDENTIFIER); - - -} - diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/CodeSystemUtilities.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/CodeSystemUtilities.java deleted file mode 100644 index b91cc2e23eb..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/CodeSystemUtilities.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.hl7.fhir.dstu2016may.terminologies; - -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.BooleanType; -import org.hl7.fhir.dstu2016may.model.CodeSystem; -import org.hl7.fhir.dstu2016may.model.CodeSystem.CodeSystemPropertyComponent; -import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent; -import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionPropertyComponent; -import org.hl7.fhir.dstu2016may.model.CodeSystem.PropertyType; - -public class CodeSystemUtilities { - - public static boolean isDeprecated(CodeSystem cs, ConceptDefinitionComponent def) { - for (ConceptDefinitionPropertyComponent p : def.getProperty()) { - if (p.getCode().equals("deprecated") && p.hasValue() && p.getValue() instanceof BooleanType) - return ((BooleanType) p.getValue()).getValue(); - } - return false; - } - - public static boolean isAbstract(CodeSystem cs, ConceptDefinitionComponent def) { - for (ConceptDefinitionPropertyComponent p : def.getProperty()) { - if (p.getCode().equals("abstract") && p.hasValue() && p.getValue() instanceof BooleanType) - return ((BooleanType) p.getValue()).getValue(); - } - return false; - } - - public static void setAbstract(CodeSystem cs, ConceptDefinitionComponent concept) { - defineAbstractProperty(cs); - concept.addProperty().setCode("abstract").setValue(new BooleanType(true)); - } - - public static void setDeprecated(CodeSystem cs, ConceptDefinitionComponent concept) { - defineAbstractProperty(cs); - concept.addProperty().setCode("deprecated").setValue(new BooleanType(true)); - } - - public static void defineAbstractProperty(CodeSystem cs) { - defineCodeSystemProperty(cs, "abstract", "Indicates that the code is abstract - only intended to be used as a selector for other concepts", PropertyType.BOOLEAN); - } - - public static void defineDeprecatedProperty(CodeSystem cs) { - defineCodeSystemProperty(cs, "deprecated", "Indicates that the code should not longer be used", PropertyType.BOOLEAN); - } - - public static void defineCodeSystemProperty(CodeSystem cs, String code, String description, PropertyType type) { - for (CodeSystemPropertyComponent p : cs.getProperty()) { - if (p.getCode().equals(code)) - return; - } - cs.addProperty().setCode(code).setDescription(description).setType(type); - } - - public static String getCodeDefinition(CodeSystem cs, String code) { - return getCodeDefinition(cs.getConcept(), code); - } - - private static String getCodeDefinition(List list, String code) { - for (ConceptDefinitionComponent c : list) { - if (c.getCode().equals(code)) - return c.getDefinition(); - String s = getCodeDefinition(c.getConcept(), code); - if (s != null) - return s; - } - return null; - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetChecker.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetChecker.java deleted file mode 100644 index b12381f3273..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetChecker.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.hl7.fhir.dstu2016may.terminologies; - -import org.hl7.fhir.dstu2016may.terminologies.ValueSetExpander.ETooCostly; -import org.hl7.fhir.dstu2016may.utils.EOperationOutcome; - -public interface ValueSetChecker { - - boolean codeInValueSet(String system, String code) throws ETooCostly, EOperationOutcome, Exception; - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetCheckerSimple.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetCheckerSimple.java deleted file mode 100644 index 95e0dd02269..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetCheckerSimple.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.hl7.fhir.dstu2016may.terminologies; - -import java.util.List; - -import org.hl7.fhir.dstu2016may.model.CodeSystem; -import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent; -import org.hl7.fhir.dstu2016may.model.UriType; -import org.hl7.fhir.dstu2016may.model.ValueSet; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent; -import org.hl7.fhir.dstu2016may.terminologies.ValueSetExpander.ValueSetExpansionOutcome; -import org.hl7.fhir.dstu2016may.utils.EOperationOutcome; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext.ValidationResult; - -public class ValueSetCheckerSimple implements ValueSetChecker { - - private ValueSet valueset; - private ValueSetExpanderFactory factory; - private IWorkerContext context; - - public ValueSetCheckerSimple(ValueSet source, ValueSetExpanderFactory factory, IWorkerContext context) { - this.valueset = source; - this.factory = factory; - this.context = context; - } - - @Override - public boolean codeInValueSet(String system, String code) throws EOperationOutcome, Exception { - - if (valueset.hasCompose()) { - boolean ok = false; - for (UriType uri : valueset.getCompose().getImport()) { - ok = ok || inImport(uri.getValue(), system, code); - } - for (ConceptSetComponent vsi : valueset.getCompose().getInclude()) { - ok = ok || inComponent(vsi, system, code); - } - for (ConceptSetComponent vsi : valueset.getCompose().getExclude()) { - ok = ok && !inComponent(vsi, system, code); - } - } - - return false; - } - - private boolean inImport(String uri, String system, String code) throws EOperationOutcome, Exception { - ValueSet vs = context.fetchResource(ValueSet.class, uri); - if (vs == null) - return false ; // we can't tell - return codeInExpansion(factory.getExpander().expand(vs), system, code); - } - - private boolean codeInExpansion(ValueSetExpansionOutcome vso, String system, String code) throws EOperationOutcome, Exception { - if (vso.getService() != null) { - return vso.getService().codeInValueSet(system, code); - } else { - for (ValueSetExpansionContainsComponent c : vso.getValueset().getExpansion().getContains()) { - if (code.equals(c.getCode()) && (system == null || system.equals(c.getSystem()))) - return true; - if (codeinExpansion(c, system, code)) - return true; - } - } - return false; - } - - private boolean codeinExpansion(ValueSetExpansionContainsComponent cnt, String system, String code) { - for (ValueSetExpansionContainsComponent c : cnt.getContains()) { - if (code.equals(c.getCode()) && system.equals(c.getSystem().toString())) - return true; - if (codeinExpansion(c, system, code)) - return true; - } - return false; - } - - - private boolean inComponent(ConceptSetComponent vsi, String system, String code) { - if (!vsi.getSystem().equals(system)) - return false; - // whether we know the system or not, we'll accept the stated codes at face value - for (ConceptReferenceComponent cc : vsi.getConcept()) - if (cc.getCode().equals(code)) { - return true; - } - - CodeSystem def = context.fetchCodeSystem(system); - if (def != null) { - if (!def.getCaseSensitive()) { - // well, ok, it's not case sensitive - we'll check that too now - for (ConceptReferenceComponent cc : vsi.getConcept()) - if (cc.getCode().equalsIgnoreCase(code)) { - return false; - } - } - if (vsi.getConcept().isEmpty() && vsi.getFilter().isEmpty()) { - return codeInDefine(def.getConcept(), code, def.getCaseSensitive()); - } - for (ConceptSetFilterComponent f: vsi.getFilter()) - throw new Error("not done yet: "+f.getValue()); - - return false; - } else if (context.supportsSystem(system)) { - ValidationResult vv = context.validateCode(system, code, null, vsi); - return vv.isOk(); - } else - // we don't know this system, and can't resolve it - return false; - } - - private boolean codeInDefine(List concepts, String code, boolean caseSensitive) { - for (ConceptDefinitionComponent c : concepts) { - if (caseSensitive && code.equals(c.getCode())) - return true; - if (!caseSensitive && code.equalsIgnoreCase(c.getCode())) - return true; - if (codeInDefine(c.getConcept(), code, caseSensitive)) - return true; - } - return false; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpander.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpander.java deleted file mode 100644 index 877e7e15aff..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpander.java +++ /dev/null @@ -1,64 +0,0 @@ -package org.hl7.fhir.dstu2016may.terminologies; - -import java.io.FileNotFoundException; -import java.io.IOException; - -import org.hl7.fhir.dstu2016may.model.ValueSet; - -public interface ValueSetExpander { - public class ETooCostly extends Exception { - - public ETooCostly(String msg) { - super(msg); - } - - } - - /** - * Some value sets are just too big to expand. Instead of an expanded value set, - * you get back an interface that can test membership - usually on a server somewhere - * - * @author Grahame - */ - public class ValueSetExpansionOutcome { - private ValueSet valueset; - private ValueSetChecker service; - private String error; - public ValueSetExpansionOutcome(ValueSet valueset) { - super(); - this.valueset = valueset; - this.service = null; - this.error = null; - } - public ValueSetExpansionOutcome(ValueSet valueset, String error) { - super(); - this.valueset = valueset; - this.service = null; - this.error = error; - } - public ValueSetExpansionOutcome(ValueSetChecker service, String error) { - super(); - this.valueset = null; - this.service = service; - this.error = error; - } - public ValueSetExpansionOutcome(String error) { - this.valueset = null; - this.service = null; - this.error = error; - } - public ValueSet getValueset() { - return valueset; - } - public ValueSetChecker getService() { - return service; - } - public String getError() { - return error; - } - - - } - - public ValueSetExpansionOutcome expand(ValueSet source) throws ETooCostly, FileNotFoundException, IOException; -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpanderFactory.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpanderFactory.java deleted file mode 100644 index 1d2e31897dc..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpanderFactory.java +++ /dev/null @@ -1,34 +0,0 @@ -package org.hl7.fhir.dstu2016may.terminologies; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -public interface ValueSetExpanderFactory { - public ValueSetExpander getExpander(); -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpanderSimple.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpanderSimple.java deleted file mode 100644 index 19e7f3c05e5..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/terminologies/ValueSetExpanderSimple.java +++ /dev/null @@ -1,270 +0,0 @@ -package org.hl7.fhir.dstu2016may.terminologies; - -import java.io.FileNotFoundException; -import java.io.IOException; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -*/ - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.lang3.NotImplementedException; -import org.hl7.fhir.dstu2016may.model.CodeSystem; -import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent; -import org.hl7.fhir.dstu2016may.model.DateTimeType; -import org.hl7.fhir.dstu2016may.model.Factory; -import org.hl7.fhir.dstu2016may.model.PrimitiveType; -import org.hl7.fhir.dstu2016may.model.Type; -import org.hl7.fhir.dstu2016may.model.UriType; -import org.hl7.fhir.dstu2016may.model.ValueSet; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptReferenceComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetFilterComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.FilterOperator; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetComposeComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionParameterComponent; -import org.hl7.fhir.dstu2016may.utils.IWorkerContext; -import org.hl7.fhir.exceptions.TerminologyServiceException; -import org.hl7.fhir.utilities.Utilities; - -public class ValueSetExpanderSimple implements ValueSetExpander { - - private IWorkerContext context; - private List codes = new ArrayList(); - private Map map = new HashMap(); - private ValueSet focus; - - private ValueSetExpanderFactory factory; - - public ValueSetExpanderSimple(IWorkerContext context, ValueSetExpanderFactory factory) { - super(); - this.context = context; - this.factory = factory; - } - - @Override - public ValueSetExpansionOutcome expand(ValueSet source) { - - try { - focus = source.copy(); - focus.setExpansion(new ValueSet.ValueSetExpansionComponent()); - focus.getExpansion().setTimestampElement(DateTimeType.now()); - focus.getExpansion().setIdentifier(Factory.createUUID()); - - if (source.hasCompose()) - handleCompose(source.getCompose(), focus.getExpansion().getParameter()); - - for (ValueSetExpansionContainsComponent c : codes) { - if (map.containsKey(key(c))) { - focus.getExpansion().getContains().add(c); - } - } - return new ValueSetExpansionOutcome(focus, null); - } catch (RuntimeException e) { - // TODO: we should put something more specific instead of just Exception below, since - // it swallows bugs.. what would be expected to be caught there? - throw e; - } catch (Exception e) { - // well, we couldn't expand, so we'll return an interface to a checker that can check membership of the set - // that might fail too, but it might not, later. - return new ValueSetExpansionOutcome(new ValueSetCheckerSimple(source, factory, context), e.getMessage()); - } - } - - private void handleCompose(ValueSetComposeComponent compose, List params) throws TerminologyServiceException, ETooCostly, FileNotFoundException, IOException { - for (UriType imp : compose.getImport()) - importValueSet(imp.getValue(), params); - for (ConceptSetComponent inc : compose.getInclude()) - includeCodes(inc, params); - for (ConceptSetComponent inc : compose.getExclude()) - excludeCodes(inc, params); - - } - - private void importValueSet(String value, List params) throws ETooCostly, TerminologyServiceException, FileNotFoundException, IOException { - if (value == null) - throw new TerminologyServiceException("unable to find value set with no identity"); - ValueSet vs = context.fetchResource(ValueSet.class, value); - if (vs == null) - throw new TerminologyServiceException("Unable to find imported value set "+value); - ValueSetExpansionOutcome vso = factory.getExpander().expand(vs); - if (vso.getService() != null) - throw new TerminologyServiceException("Unable to expand imported value set "+value); - if (vs.hasVersion()) - if (!existsInParams(params, "version", new UriType(vs.getUrl()+"?version="+vs.getVersion()))) - params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(vs.getUrl()+"?version="+vs.getVersion()))); - for (ValueSetExpansionParameterComponent p : vso.getValueset().getExpansion().getParameter()) { - if (!existsInParams(params, p.getName(), p.getValue())) - params.add(p); - } - - for (ValueSetExpansionContainsComponent c : vso.getValueset().getExpansion().getContains()) { - addCode(c.getSystem(), c.getCode(), c.getDisplay()); - } - } - - private boolean existsInParams(List params, String name, Type value) { - for (ValueSetExpansionParameterComponent p : params) { - if (p.getName().equals(name) && PrimitiveType.compareDeep(p.getValue(), value, false)) - return true; - } - return false; - } - - private void includeCodes(ConceptSetComponent inc, List params) throws TerminologyServiceException, ETooCostly { - if (context.supportsSystem(inc.getSystem())) { - try { - int i = codes.size(); - addCodes(context.expandVS(inc), params); - if (codes.size() > i) - return; - } catch (Exception e) { - // ok, we'll try locally - } - } - - CodeSystem cs = context.fetchCodeSystem(inc.getSystem()); - if (cs == null) - throw new TerminologyServiceException("unable to find code system "+inc.getSystem().toString()); - if (cs.hasVersion()) - if (!existsInParams(params, "version", new UriType(cs.getUrl()+"?version="+cs.getVersion()))) - params.add(new ValueSetExpansionParameterComponent().setName("version").setValue(new UriType(cs.getUrl()+"?version="+cs.getVersion()))); - if (inc.getConcept().size() == 0 && inc.getFilter().size() == 0) { - // special case - add all the code system - for (ConceptDefinitionComponent def : cs.getConcept()) { - addCodeAndDescendents(cs, inc.getSystem(), def); - } - } - - for (ConceptReferenceComponent c : inc.getConcept()) { - addCode(inc.getSystem(), c.getCode(), Utilities.noString(c.getDisplay()) ? getCodeDisplay(cs, c.getCode()) : c.getDisplay()); - } - if (inc.getFilter().size() > 1) - throw new TerminologyServiceException("Multiple filters not handled yet"); // need to and them, and this isn't done yet. But this shouldn't arise in non loinc and snomed value sets - if (inc.getFilter().size() == 1) { - ConceptSetFilterComponent fc = inc.getFilter().get(0); - if ("concept".equals(fc.getProperty()) && fc.getOp() == FilterOperator.ISA) { - // special: all non-abstract codes in the target code system under the value - ConceptDefinitionComponent def = getConceptForCode(cs.getConcept(), fc.getValue()); - if (def == null) - throw new TerminologyServiceException("Code '"+fc.getValue()+"' not found in system '"+inc.getSystem()+"'"); - addCodeAndDescendents(cs, inc.getSystem(), def); - } else - throw new NotImplementedException("not done yet"); - } - } - - private void addCodes(ValueSetExpansionComponent expand, List params) throws ETooCostly { - if (expand.getContains().size() > 500) - throw new ETooCostly("Too many codes to display (>"+Integer.toString(expand.getContains().size())+")"); - for (ValueSetExpansionParameterComponent p : expand.getParameter()) { - if (!existsInParams(params, p.getName(), p.getValue())) - params.add(p); - } - - for (ValueSetExpansionContainsComponent c : expand.getContains()) { - addCode(c.getSystem(), c.getCode(), c.getDisplay()); - } - } - - private void addCodeAndDescendents(CodeSystem cs, String system, ConceptDefinitionComponent def) { - if (!CodeSystemUtilities.isDeprecated(cs, def)) { - if (!CodeSystemUtilities.isAbstract(cs, def)) - addCode(system, def.getCode(), def.getDisplay()); - for (ConceptDefinitionComponent c : def.getConcept()) - addCodeAndDescendents(cs, system, c); - } - } - - private void excludeCodes(ConceptSetComponent inc, List params) throws TerminologyServiceException { - CodeSystem cs = context.fetchCodeSystem(inc.getSystem().toString()); - if (cs == null) - throw new TerminologyServiceException("unable to find value set "+inc.getSystem().toString()); - if (inc.getConcept().size() == 0 && inc.getFilter().size() == 0) { - // special case - add all the code system -// for (ConceptDefinitionComponent def : cs.getDefine().getConcept()) { -//!!!! addCodeAndDescendents(inc.getSystem(), def); -// } - } - - - for (ConceptReferenceComponent c : inc.getConcept()) { - // we don't need to check whether the codes are valid here- they can't have gotten into this list if they aren't valid - map.remove(key(inc.getSystem(), c.getCode())); - } - if (inc.getFilter().size() > 0) - throw new NotImplementedException("not done yet"); - } - - - private String getCodeDisplay(CodeSystem cs, String code) throws TerminologyServiceException { - ConceptDefinitionComponent def = getConceptForCode(cs.getConcept(), code); - if (def == null) - throw new TerminologyServiceException("Unable to find code '"+code+"' in code system "+cs.getUrl()); - return def.getDisplay(); - } - - private ConceptDefinitionComponent getConceptForCode(List clist, String code) { - for (ConceptDefinitionComponent c : clist) { - if (code.equals(c.getCode())) - return c; - ConceptDefinitionComponent v = getConceptForCode(c.getConcept(), code); - if (v != null) - return v; - } - return null; - } - - private String key(ValueSetExpansionContainsComponent c) { - return key(c.getSystem(), c.getCode()); - } - - private String key(String uri, String code) { - return "{"+uri+"}"+code; - } - - private void addCode(String system, String code, String display) { - ValueSetExpansionContainsComponent n = new ValueSet.ValueSetExpansionContainsComponent(); - n.setSystem(system); - n.setCode(code); - n.setDisplay(display); - String s = key(n); - if (!map.containsKey(s)) { - codes.add(n); - map.put(s, n); - } - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/EOperationOutcome.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/EOperationOutcome.java deleted file mode 100644 index 4c484a8b918..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/EOperationOutcome.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import org.hl7.fhir.dstu2016may.model.OperationOutcome; - -public class EOperationOutcome extends Exception { - - private static final long serialVersionUID = 8887222532359256131L; - - private OperationOutcome outcome; - - public EOperationOutcome(OperationOutcome outcome) { - super(); - this.outcome = outcome; - } - - public OperationOutcome getOutcome() { - return outcome; - } - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/FHIRLexer.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/FHIRLexer.java deleted file mode 100644 index 3b1e933af2e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/FHIRLexer.java +++ /dev/null @@ -1,318 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import org.hl7.fhir.dstu2016may.model.ExpressionNode; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.SourceLocation; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -// shared lexer for concrete syntaxes -// - FluentPath -// - Mapping language - -public class FHIRLexer { - public class FHIRLexerException extends FHIRException { - - public FHIRLexerException() { - super(); - } - - public FHIRLexerException(String message, Throwable cause) { - super(message, cause); - } - - public FHIRLexerException(String message) { - super(message); - } - - public FHIRLexerException(Throwable cause) { - super(cause); - } - - } - private String path; - private int cursor; - private int currentStart; - private String current; - private SourceLocation currentLocation; - private SourceLocation currentStartLocation; - private int id; - - public FHIRLexer(String source) throws FHIRLexerException { - this.path = source; - currentLocation = new SourceLocation(1, 1); - next(); - } - public String getCurrent() { - return current; - } - public SourceLocation getCurrentLocation() { - return currentLocation; - } - - public boolean isConstant(boolean incDoubleQuotes) { - return current.charAt(0) == '\'' || (incDoubleQuotes && current.charAt(0) == '"') || current.charAt(0) == '@' || current.charAt(0) == '%' || current.charAt(0) == '-' || (current.charAt(0) >= '0' && current.charAt(0) <= '9') || current.equals("true") || current.equals("false") || current.equals("{}"); - } - - public boolean isStringConstant() { - return current.charAt(0) == '\'' || current.charAt(0) == '"'; - } - - public String take() throws FHIRLexerException { - String s = current; - next(); - return s; - } - - public boolean isToken() { - if (Utilities.noString(current)) - return false; - - if (current.startsWith("$")) - return true; - - if (current.equals("*") || current.equals("**")) - return true; - - if ((current.charAt(0) >= 'A' && current.charAt(0) <= 'Z') || (current.charAt(0) >= 'a' && current.charAt(0) <= 'z')) { - for (int i = 1; i < current.length(); i++) - if (!( (current.charAt(1) >= 'A' && current.charAt(1) <= 'Z') || (current.charAt(1) >= 'a' && current.charAt(1) <= 'z') || - (current.charAt(1) >= '0' && current.charAt(1) <= '9'))) - return false; - return true; - } - return false; - } - - public FHIRLexerException error(String msg) { - return error(msg, currentLocation.toString()); - } - - public FHIRLexerException error(String msg, String location) { - return new FHIRLexerException("Error in "+path+" at "+location+": "+msg); - } - - public void next() throws FHIRLexerException { - current = null; - boolean last13 = false; - while (cursor < path.length() && Character.isWhitespace(path.charAt(cursor))) { - if (path.charAt(cursor) == '\r') { - currentLocation.setLine(currentLocation.getLine() + 1); - currentLocation.setColumn(1); - last13 = true; - } else if (!last13 && (path.charAt(cursor) == '\n')) { - currentLocation.setLine(currentLocation.getLine() + 1); - currentLocation.setColumn(1); - last13 = false; - } else { - last13 = false; - currentLocation.setColumn(currentLocation.getColumn() + 1); - } - cursor++; - } - currentStart = cursor; - currentStartLocation = currentLocation; - if (cursor < path.length()) { - char ch = path.charAt(cursor); - if (ch == '!' || ch == '>' || ch == '<' || ch == ':' || ch == '-' || ch == '=') { - cursor++; - if (cursor < path.length() && (path.charAt(cursor) == '=' || path.charAt(cursor) == '~' || path.charAt(cursor) == '-')) - cursor++; - current = path.substring(currentStart, cursor); - } else if (ch >= '0' && ch <= '9') { - cursor++; - boolean dotted = false; - while (cursor < path.length() && ((path.charAt(cursor) >= '0' && path.charAt(cursor) <= '9') || (path.charAt(cursor) == '.') && !dotted)) { - if (path.charAt(cursor) == '.') - dotted = true; - cursor++; - } - if (path.charAt(cursor-1) == '.') - cursor--; - current = path.substring(currentStart, cursor); - } else if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) { - while (cursor < path.length() && ((path.charAt(cursor) >= 'A' && path.charAt(cursor) <= 'Z') || (path.charAt(cursor) >= 'a' && path.charAt(cursor) <= 'z') || - (path.charAt(cursor) >= '0' && path.charAt(cursor) <= '9') || path.charAt(cursor) == '_')) - cursor++; - current = path.substring(currentStart, cursor); - } else if (ch == '%') { - cursor++; - if (cursor < path.length() && (path.charAt(cursor) == '"')) { - cursor++; - while (cursor < path.length() && (path.charAt(cursor) != '"')) - cursor++; - cursor++; - } else - while (cursor < path.length() && ((path.charAt(cursor) >= 'A' && path.charAt(cursor) <= 'Z') || (path.charAt(cursor) >= 'a' && path.charAt(cursor) <= 'z') || - (path.charAt(cursor) >= '0' && path.charAt(cursor) <= '9') || path.charAt(cursor) == ':' || path.charAt(cursor) == '-')) - cursor++; - current = path.substring(currentStart, cursor); - } else if (ch == '/') { - cursor++; - if (cursor < path.length() && (path.charAt(cursor) == '/')) { - cursor++; - while (cursor < path.length() && !((path.charAt(cursor) == '\r') || path.charAt(cursor) == '\n')) - cursor++; - } - current = path.substring(currentStart, cursor); - } else if (ch == '$') { - cursor++; - while (cursor < path.length() && (path.charAt(cursor) >= 'a' && path.charAt(cursor) <= 'z')) - cursor++; - current = path.substring(currentStart, cursor); - } else if (ch == '{') { - cursor++; - ch = path.charAt(cursor); - if (ch == '}') - cursor++; - current = path.substring(currentStart, cursor); - } else if (ch == '"'){ - cursor++; - boolean escape = false; - while (cursor < path.length() && (escape || path.charAt(cursor) != '"')) { - if (escape) - escape = false; - else - escape = (path.charAt(cursor) == '\\'); - cursor++; - } - if (cursor == path.length()) - throw error("Unterminated string"); - cursor++; - current = "\""+path.substring(currentStart+1, cursor-1)+"\""; - } else if (ch == '\''){ - cursor++; - char ech = ch; - boolean escape = false; - while (cursor < path.length() && (escape || path.charAt(cursor) != ech)) { - if (escape) - escape = false; - else - escape = (path.charAt(cursor) == '\\'); - cursor++; - } - if (cursor == path.length()) - throw error("Unterminated string"); - cursor++; - current = path.substring(currentStart, cursor); - if (ech == '\'') - current = "\'"+current.substring(1, current.length() - 1)+"\'"; - } else if (ch == '@'){ - cursor++; - while (cursor < path.length() && isDateChar(path.charAt(cursor))) - cursor++; - current = path.substring(currentStart, cursor); - } else { // if CharInSet(ch, ['.', ',', '(', ')', '=', '$']) then - cursor++; - current = path.substring(currentStart, cursor); - } - } - } - - - private boolean isDateChar(char ch) { - return ch == '-' || ch == ':' || ch == 'T' || ch == '+' || ch == 'Z' || Character.isDigit(ch); - } - public boolean isOp() { - return ExpressionNode.Operation.fromCode(current) != null; - } - public boolean done() { - return currentStart >= path.length(); - } - public int nextId() { - id++; - return id; - } - public SourceLocation getCurrentStartLocation() { - return currentStartLocation; - } - - // special case use - public void setCurrent(String current) { - this.current = current; - } - - public boolean hasComment() { - return !done() && current.startsWith("//"); - } - public boolean hasToken(String kw) { - return !done() && kw.equals(current); - } - public void token(String kw) throws FHIRLexerException { - if (!kw.equals(current)) - throw error("Found \""+current+"\" expecting \""+kw+"\""); - next(); - } - public String readConstant(String desc) throws FHIRLexerException { - if (!isStringConstant()) - throw error("Found "+current+" expecting \"["+desc+"]\""); - - return processConstant(take()); - } - - public String processConstant(String s) throws FHIRLexerException { - StringBuilder b = new StringBuilder(); - int i = 1; - while (i < s.length()-1) { - char ch = s.charAt(i); - if (ch == '\\') { - i++; - switch (s.charAt(i)) { - case 't': - b.append('\t'); - break; - case 'r': - b.append('\r'); - break; - case 'n': - b.append('\n'); - break; - case 'f': - b.append('\f'); - break; - case '\'': - b.append('\''); - break; - case '\\': - b.append('\\'); - break; - case '/': - b.append('\\'); - break; - case 'u': - i++; - int uc = Integer.parseInt(s.substring(i, i+4), 16); - b.append((char) uc); - i = i + 4; - break; - default: - throw new FHIRLexerException("Unknown character escape \\"+s.charAt(i)); - } - } else { - b.append(ch); - i++; - } - } - return b.toString(); - - } - public void skipToken(String token) throws FHIRLexerException { - if (getCurrent().equals(token)) - next(); - - } - public String takeDottedToken() throws FHIRLexerException { - StringBuilder b = new StringBuilder(); - b.append(take()); - while (!done() && getCurrent().equals(".")) { - b.append(take()); - b.append(take()); - } - return b.toString(); - } - - void skipComments() throws FHIRLexerException { - while (!done() && hasComment()) - next(); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/FHIRPathEngine.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/FHIRPathEngine.java deleted file mode 100644 index 63947d4927e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/FHIRPathEngine.java +++ /dev/null @@ -1,2637 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Date; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.hl7.fhir.dstu2016may.metamodel.ParserBase; -import org.hl7.fhir.dstu2016may.model.Base; -import org.hl7.fhir.dstu2016may.model.BooleanType; -import org.hl7.fhir.dstu2016may.model.DateTimeType; -import org.hl7.fhir.dstu2016may.model.DateType; -import org.hl7.fhir.dstu2016may.model.DecimalType; -import org.hl7.fhir.dstu2016may.model.ElementDefinition; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.PropertyRepresentation; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.TypeRefComponent; -import org.hl7.fhir.dstu2016may.model.ExpressionNode; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.CollectionStatus; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.Function; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.Kind; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.Operation; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.SourceLocation; -import org.hl7.fhir.dstu2016may.model.ExpressionNode.TypeDetails; -import org.hl7.fhir.dstu2016may.model.IntegerType; -import org.hl7.fhir.dstu2016may.model.Resource; -import org.hl7.fhir.dstu2016may.model.StringType; -import org.hl7.fhir.dstu2016may.model.StructureDefinition; -import org.hl7.fhir.dstu2016may.model.StructureDefinition.TypeDerivationRule; -import org.hl7.fhir.dstu2016may.model.TemporalPrecisionEnum; -import org.hl7.fhir.dstu2016may.model.TimeType; -import org.hl7.fhir.dstu2016may.model.Type; -import org.hl7.fhir.dstu2016may.utils.FHIRLexer.FHIRLexerException; -import org.hl7.fhir.dstu2016may.utils.FHIRPathEngine.IEvaluationContext.FunctionDetails; -import org.hl7.fhir.exceptions.DefinitionException; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.exceptions.PathEngineException; -import org.hl7.fhir.exceptions.UcumException; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.ucum.Decimal; - -/** - * - * @author Grahame Grieve - * - */ -public class FHIRPathEngine { - private IWorkerContext worker; - private IEvaluationContext hostServices; - private StringBuilder log = new StringBuilder(); - private Set primitiveTypes = new HashSet(); - private Map allTypes = new HashMap(); - - // if the fhir path expressions are allowed to use constants beyond those defined in the specification - // the application can implement them by providing a constant resolver - public interface IEvaluationContext { - public class FunctionDetails { - private String description; - private int minParameters; - private int maxParameters; - public FunctionDetails(String description, int minParameters, int maxParameters) { - super(); - this.description = description; - this.minParameters = minParameters; - this.maxParameters = maxParameters; - } - public String getDescription() { - return description; - } - public int getMinParameters() { - return minParameters; - } - public int getMaxParameters() { - return maxParameters; - } - - } - - public Type resolveConstant(Object appContext, String name); - public String resolveConstantType(Object appContext, String name); - public boolean Log(String argument, List focus); - - // extensibility for functions - /** - * - * @param functionName - * @return null if the function is not known - */ - public FunctionDetails resolveFunction(String functionName); - - /** - * Check the function parameters, and throw an error if they are incorrect, or return the type for the function - * @param functionName - * @param parameters - * @return - */ - public TypeDetails checkFunction(Object appContext, String functionName, List parameters) throws PathEngineException; - - /** - * @param appContext - * @param functionName - * @param parameters - * @return - */ - public List executeFunction(Object appContext, String functionName, List> parameters); - } - - - /** - * @param worker - used when validating paths (@check), and used doing value set membership when executing tests (once that's defined) - */ - public FHIRPathEngine(IWorkerContext worker) { - super(); - this.worker = worker; - for (StructureDefinition sd : worker.allStructures()) { - if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION) - allTypes.put(sd.getName(), sd); - if (sd.getDerivation() == TypeDerivationRule.SPECIALIZATION && isPrimitive(sd)) { - primitiveTypes.add(sd.getName()); - } - } - } - - - private boolean isPrimitive(StructureDefinition sd) { - for (ElementDefinition ed : sd.getSnapshot().getElement()) - if (ed.getPath().equals(sd.getName()+".value") && ed.hasRepresentation(PropertyRepresentation.XMLATTR)) - return true; - return false; - } - - - // --- 3 methods to override in children ------------------------------------------------------- - // if you don't override, it falls through to the using the base reference implementation - // HAPI overrides to these to support extensing the base model - - public IEvaluationContext getConstantResolver() { - return hostServices; - } - - - public void setConstantResolver(IEvaluationContext constantResolver) { - this.hostServices = constantResolver; - } - - - /** - * Given an item, return all the children that conform to the pattern described in name - * - * Possible patterns: - * - a simple name (which may be the base of a name with [] e.g. value[x]) - * - a name with a type replacement e.g. valueCodeableConcept - * - * which means all children - * - ** which means all descendents - * - * @param item - * @param name - * @param result - * @throws FHIRException - */ - protected void getChildrenByName(Base item, String name, List result) throws FHIRException { - Base[] list = item.listChildrenByName(name, false); - if (list != null) - for (Base v : list) - if (v != null) - result.add(v); - } - - // --- public API ------------------------------------------------------- - /** - * Parse a path for later use using execute - * - * @param path - * @return - * @throws PathEngineException - * @throws Exception - */ - public ExpressionNode parse(String path) throws FHIRLexerException { - FHIRLexer lexer = new FHIRLexer(path); - if (lexer.done()) - throw lexer.error("Path cannot be empty"); - ExpressionNode result = parseExpression(lexer, true); - if (!lexer.done()) - throw lexer.error("Premature ExpressionNode termination at unexpected token \""+lexer.getCurrent()+"\""); - result.check(); - return result; - } - - /** - * Parse a path that is part of some other syntax - * - * @param path - * @return - * @throws PathEngineException - * @throws Exception - */ - public ExpressionNode parse(FHIRLexer lexer) throws FHIRLexerException { - ExpressionNode result = parseExpression(lexer, true); - result.check(); - return result; - } - - /** - * check that paths referred to in the ExpressionNode are valid - * - * xPathStartsWithValueRef is a hack work around for the fact that FHIR Path sometimes needs a different starting point than the xpath - * - * returns a list of the possible types that might be returned by executing the ExpressionNode against a particular context - * - * @param context - the logical type against which this path is applied - * @param path - the FHIR Path statement to check - * @throws DefinitionException - * @throws PathEngineException - * @if the path is not valid - */ - public TypeDetails check(Object appContext, String resourceType, String context, ExpressionNode expr) throws FHIRLexerException, PathEngineException, DefinitionException { - // if context is a path that refers to a type, do that conversion now - TypeDetails types; - if (!context.contains(".")) - types = new TypeDetails(CollectionStatus.SINGLETON, context); - else { - StructureDefinition sd = worker.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+context.substring(0, context.indexOf('.'))); - if (sd == null) - throw new PathEngineException("Unknown context "+context); - ElementDefinitionMatch ed = getElementDefinition(sd, context, true); - if (ed == null) - throw new PathEngineException("Unknown context element "+context); - if (ed.fixedType != null) - types = new TypeDetails(CollectionStatus.SINGLETON, ed.fixedType); - else if (ed.getDefinition().getType().isEmpty() || isAbstractType(ed.getDefinition().getType())) - types = new TypeDetails(CollectionStatus.SINGLETON, context); - else { - types = new TypeDetails(CollectionStatus.SINGLETON); - for (TypeRefComponent t : ed.getDefinition().getType()) - types.addType(t.getCode()); - } - } - - return executeType(new ExecutionTypeContext(appContext, resourceType, types), types, expr, true); - } - - public TypeDetails check(Object appContext, String resourceType, String context, String expr) throws FHIRLexerException, PathEngineException, DefinitionException { - return check(appContext, resourceType, context, parse(expr)); - } - - - /** - * evaluate a path and return the matching elements - * - * @param base - the object against which the path is being evaluated - * @param ExpressionNode - the parsed ExpressionNode statement to use - * @return - * @throws FHIRException - * @ - */ - public List evaluate(Base base, ExpressionNode ExpressionNode) throws FHIRException { - List list = new ArrayList(); - if (base != null) - list.add(base); - log = new StringBuilder(); - return execute(new ExecutionContext(null, null, base), list, ExpressionNode, true); - } - - /** - * evaluate a path and return the matching elements - * - * @param base - the object against which the path is being evaluated - * @param path - the FHIR Path statement to use - * @return - * @throws FHIRException - * @ - */ - public List evaluate(Base base, String path) throws FHIRException { - ExpressionNode exp = parse(path); - List list = new ArrayList(); - if (base != null) - list.add(base); - log = new StringBuilder(); - return execute(new ExecutionContext(null, null, base), list, exp, true); - } - - /** - * evaluate a path and return the matching elements - * - * @param base - the object against which the path is being evaluated - * @param ExpressionNode - the parsed ExpressionNode statement to use - * @return - * @throws FHIRException - * @ - */ - public List evaluate(Object appContext, Resource resource, Base base, ExpressionNode ExpressionNode) throws FHIRException { - List list = new ArrayList(); - if (base != null) - list.add(base); - log = new StringBuilder(); - return execute(new ExecutionContext(appContext, resource, base), list, ExpressionNode, true); - } - - /** - * evaluate a path and return the matching elements - * - * @param base - the object against which the path is being evaluated - * @param ExpressionNode - the parsed ExpressionNode statement to use - * @return - * @throws FHIRException - * @ - */ - public List evaluate(Object appContext, Base resource, Base base, ExpressionNode ExpressionNode) throws FHIRException { - List list = new ArrayList(); - if (base != null) - list.add(base); - log = new StringBuilder(); - return execute(new ExecutionContext(appContext, resource, base), list, ExpressionNode, true); - } - - /** - * evaluate a path and return the matching elements - * - * @param base - the object against which the path is being evaluated - * @param path - the FHIR Path statement to use - * @return - * @throws FHIRException - * @ - */ - public List evaluate(Object appContext, Resource resource, Base base, String path) throws FHIRException { - ExpressionNode exp = parse(path); - List list = new ArrayList(); - if (base != null) - list.add(base); - log = new StringBuilder(); - return execute(new ExecutionContext(appContext, resource, base), list, exp, true); - } - - /** - * evaluate a path and return true or false (e.g. for an invariant) - * - * @param base - the object against which the path is being evaluated - * @param path - the FHIR Path statement to use - * @return - * @throws FHIRException - * @ - */ - public boolean evaluateToBoolean(Resource resource, Base base, String path) throws FHIRException { - return convertToBoolean(evaluate(null, resource, base, path)); - } - - /** - * evaluate a path and return true or false (e.g. for an invariant) - * - * @param base - the object against which the path is being evaluated - * @param path - the FHIR Path statement to use - * @return - * @throws FHIRException - * @ - */ - public boolean evaluateToBoolean(Resource resource, Base base, ExpressionNode node) throws FHIRException { - return convertToBoolean(evaluate(null, resource, base, node)); - } - - /** - * evaluate a path and return true or false (e.g. for an invariant) - * - * @param base - the object against which the path is being evaluated - * @param path - the FHIR Path statement to use - * @return - * @throws FHIRException - * @ - */ - public boolean evaluateToBoolean(Base resource, Base base, ExpressionNode node) throws FHIRException { - return convertToBoolean(evaluate(null, resource, base, node)); - } - - /** - * evaluate a path and a string containing the outcome (for display) - * - * @param base - the object against which the path is being evaluated - * @param path - the FHIR Path statement to use - * @return - * @throws FHIRException - * @ - */ - public String evaluateToString(Base base, String path) throws FHIRException { - return convertToString(evaluate(base, path)); - } - - /** - * worker routine for converting a set of objects to a string representation - * - * @param items - result from @evaluate - * @return - */ - public String convertToString(List items) { - StringBuilder b = new StringBuilder(); - boolean first = true; - for (Base item : items) { - if (first) - first = false; - else - b.append(','); - - b.append(convertToString(item)); - } - return b.toString(); - } - - private String convertToString(Base item) { - if (item.isPrimitive()) - return item.primitiveValue(); - else - return item.getClass().getName(); - } - - /** - * worker routine for converting a set of objects to a boolean representation (for invariants) - * - * @param items - result from @evaluate - * @return - */ - public boolean convertToBoolean(List items) { - if (items == null) - return false; - else if (items.size() == 1 && items.get(0) instanceof BooleanType) - return ((BooleanType) items.get(0)).getValue(); - else - return items.size() > 0; - } - - - private void log(String name, List contents) { - if (hostServices == null || !hostServices.Log(name, contents)) { - if (log.length() > 0) - log.append("; "); - log.append(name); - log.append(": "); - log.append(contents); - } - } - - public String forLog() { - if (log.length() > 0) - return " ("+log.toString()+")"; - else - return ""; - } - - private class ExecutionContext { - private Object appInfo; - private Base resource; - private Base thisItem; - public ExecutionContext(Object appInfo, Base resource, Base thisItem) { - this.appInfo = appInfo; - this.resource = resource; - this.thisItem = thisItem; - } - public Base getResource() { - return resource; - } - public Base getThisItem() { - return thisItem; - } - } - - private class ExecutionTypeContext { - private Object appInfo; - private String resource; - private TypeDetails context; - - - public ExecutionTypeContext(Object appInfo, String resource, TypeDetails context) { - super(); - this.appInfo = appInfo; - this.resource = resource; - this.context = context; - } - public String getResource() { - return resource; - } - public TypeDetails getContext() { - return context; - } - } - - private ExpressionNode parseExpression(FHIRLexer lexer, boolean proximal) throws FHIRLexerException { - ExpressionNode result = new ExpressionNode(lexer.nextId()); - SourceLocation c = lexer.getCurrentStartLocation(); - result.setStart(lexer.getCurrentLocation()); - // special: - if (lexer.getCurrent().equals("-")) { - lexer.take(); - lexer.setCurrent("-"+lexer.getCurrent()); - } - if (lexer.isConstant(false)) { - checkConstant(lexer.getCurrent(), lexer); - result.setConstant(lexer.take()); - result.setKind(Kind.Constant); - result.setEnd(lexer.getCurrentLocation()); - } else if ("(".equals(lexer.getCurrent())) { - lexer.next(); - result.setKind(Kind.Group); - result.setGroup(parseExpression(lexer, true)); - if (!")".equals(lexer.getCurrent())) - throw lexer.error("Found "+lexer.getCurrent()+" expecting a \")\""); - result.setEnd(lexer.getCurrentLocation()); - lexer.next(); - } else { - if (!lexer.isToken() && !lexer.getCurrent().startsWith("\"")) - throw lexer.error("Found "+lexer.getCurrent()+" expecting a token name"); - if (lexer.getCurrent().startsWith("\"")) - result.setName(lexer.readConstant("Path Name")); - else - result.setName(lexer.take()); - result.setEnd(lexer.getCurrentLocation()); - if (!result.checkName()) - throw lexer.error("Found "+result.getName()+" expecting a valid token name"); - if ("(".equals(lexer.getCurrent())) { - Function f = Function.fromCode(result.getName()); - FunctionDetails details = null; - if (f == null) { - details = hostServices.resolveFunction(result.getName()); - if (details == null) - throw lexer.error("The name "+result.getName()+" is not a valid function name"); - f = Function.Custom; - } - result.setKind(Kind.Function); - result.setFunction(f); - lexer.next(); - while (!")".equals(lexer.getCurrent())) { - result.getParameters().add(parseExpression(lexer, true)); - if (",".equals(lexer.getCurrent())) - lexer.next(); - else if (!")".equals(lexer.getCurrent())) - throw lexer.error("The token "+lexer.getCurrent()+" is not expected here - either a \",\" or a \")\" expected"); - } - result.setEnd(lexer.getCurrentLocation()); - lexer.next(); - checkParameters(lexer, c, result, details); - } else - result.setKind(Kind.Name); - } - ExpressionNode focus = result; - if ("[".equals(lexer.getCurrent())) { - lexer.next(); - ExpressionNode item = new ExpressionNode(lexer.nextId()); - item.setKind(Kind.Function); - item.setFunction(ExpressionNode.Function.Item); - item.getParameters().add(parseExpression(lexer, true)); - if (!lexer.getCurrent().equals("]")) - throw lexer.error("The token "+lexer.getCurrent()+" is not expected here - a \"]\" expected"); - lexer.next(); - result.setInner(item); - focus = item; - } - if (".".equals(lexer.getCurrent())) { - lexer.next(); - focus.setInner(parseExpression(lexer, false)); - } - result.setProximal(proximal); - if (proximal) { - while (lexer.isOp()) { - focus.setOperation(ExpressionNode.Operation.fromCode(lexer.getCurrent())); - focus.setOpStart(lexer.getCurrentStartLocation()); - focus.setOpEnd(lexer.getCurrentLocation()); - lexer.next(); - focus.setOpNext(parseExpression(lexer, false)); - focus = focus.getOpNext(); - } - result = organisePrecedence(lexer, result); - } - return result; - } - - private ExpressionNode organisePrecedence(FHIRLexer lexer, ExpressionNode node) { - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.Times, Operation.DivideBy, Operation.Div, Operation.Mod)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.Plus, Operation.Minus, Operation.Concatenate)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.Union)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.LessThen, Operation.Greater, Operation.LessOrEqual, Operation.GreaterOrEqual)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.Is)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.Equals, Operation.Equivalent, Operation.NotEquals, Operation.NotEquivalent)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.And)); - node = gatherPrecedence(lexer, node, EnumSet.of(Operation.Xor, Operation.Or)); - // last: implies - return node; - } - - private ExpressionNode gatherPrecedence(FHIRLexer lexer, ExpressionNode start, EnumSet ops) { - // work : boolean; - // focus, node, group : ExpressionNode; - - assert(start.isProximal()); - - // is there anything to do? - boolean work = false; - ExpressionNode focus = start.getOpNext(); - if (ops.contains(start.getOperation())) { - while (focus != null && focus.getOperation() != null) { - work = work || !ops.contains(focus.getOperation()); - focus = focus.getOpNext(); - } - } else { - while (focus != null && focus.getOperation() != null) { - work = work || ops.contains(focus.getOperation()); - focus = focus.getOpNext(); - } - } - if (!work) - return start; - - // entry point: tricky - ExpressionNode group; - if (ops.contains(start.getOperation())) { - group = newGroup(lexer, start); - group.setProximal(true); - focus = start; - start = group; - } else { - ExpressionNode node = start; - - focus = node.getOpNext(); - while (!ops.contains(focus.getOperation())) { - node = focus; - focus = focus.getOpNext(); - } - group = newGroup(lexer, focus); - node.setOpNext(group); - } - - // now, at this point: - // group is the group we are adding to, it already has a .group property filled out. - // focus points at the group.group - do { - // run until we find the end of the sequence - while (ops.contains(focus.getOperation())) - focus = focus.getOpNext(); - if (focus.getOperation() != null) { - group.setOperation(focus.getOperation()); - group.setOpNext(focus.getOpNext()); - focus.setOperation(null); - focus.setOpNext(null); - // now look for another sequence, and start it - ExpressionNode node = group; - focus = group.getOpNext(); - if (focus != null) { - while (focus == null && !ops.contains(focus.getOperation())) { - node = focus; - focus = focus.getOpNext(); - } - if (focus != null) { // && (focus.Operation in Ops) - must be true - group = newGroup(lexer, focus); - node.setOpNext(group); - } - } - } - } - while (focus != null && focus.getOperation() != null); - return start; - } - - - private ExpressionNode newGroup(FHIRLexer lexer, ExpressionNode next) { - ExpressionNode result = new ExpressionNode(lexer.nextId()); - result.setKind(Kind.Group); - result.setGroup(next); - result.getGroup().setProximal(true); - return result; - } - - private void checkConstant(String s, FHIRLexer lexer) throws FHIRLexerException { - if (s.startsWith("\'") && s.endsWith("\'")) { - int i = 1; - while (i < s.length()-1) { - char ch = s.charAt(i); - if (ch == '\\') { - switch (ch) { - case 't': - case 'r': - case 'n': - case 'f': - case '\'': - case '\\': - case '/': - i++; - break; - case 'u': - if (!Utilities.isHex("0x"+s.substring(i, i+4))) - throw lexer.error("Improper unicode escape \\u"+s.substring(i, i+4)); - break; - default: - throw lexer.error("Unknown character escape \\"+ch); - } - } else - i++; - } - } - } - - // procedure CheckParamCount(c : integer); - // begin - // if exp.Parameters.Count <> c then - // raise lexer.error('The function "'+exp.name+'" requires '+inttostr(c)+' parameters', offset); - // end; - - private boolean checkParamCount(FHIRLexer lexer, SourceLocation location, ExpressionNode exp, int count) throws FHIRLexerException { - if (exp.getParameters().size() != count) - throw lexer.error("The function \""+exp.getName()+"\" requires "+Integer.toString(count)+" parameters", location.toString()); - return true; - } - - private boolean checkParamCount(FHIRLexer lexer, SourceLocation location, ExpressionNode exp, int countMin, int countMax) throws FHIRLexerException { - if (exp.getParameters().size() < countMin || exp.getParameters().size() > countMax) - throw lexer.error("The function \""+exp.getName()+"\" requires between "+Integer.toString(countMin)+" and "+Integer.toString(countMax)+" parameters", location.toString()); - return true; - } - - private boolean checkParameters(FHIRLexer lexer, SourceLocation location, ExpressionNode exp, FunctionDetails details) throws FHIRLexerException { - switch (exp.getFunction()) { - case Empty: return checkParamCount(lexer, location, exp, 0); - case Not: return checkParamCount(lexer, location, exp, 0); - case Exists: return checkParamCount(lexer, location, exp, 0); - case SubsetOf: return checkParamCount(lexer, location, exp, 1); - case SupersetOf: return checkParamCount(lexer, location, exp, 1); - case IsDistinct: return checkParamCount(lexer, location, exp, 0); - case Distinct: return checkParamCount(lexer, location, exp, 0); - case Count: return checkParamCount(lexer, location, exp, 0); - case Where: return checkParamCount(lexer, location, exp, 1); - case Select: return checkParamCount(lexer, location, exp, 1); - case All: return checkParamCount(lexer, location, exp, 0, 1); - case Repeat: return checkParamCount(lexer, location, exp, 1); - case Item: return checkParamCount(lexer, location, exp, 1); - case As: return checkParamCount(lexer, location, exp, 1); - case Is: return checkParamCount(lexer, location, exp, 1); - case Single: return checkParamCount(lexer, location, exp, 0); - case First: return checkParamCount(lexer, location, exp, 0); - case Last: return checkParamCount(lexer, location, exp, 0); - case Tail: return checkParamCount(lexer, location, exp, 0); - case Skip: return checkParamCount(lexer, location, exp, 1); - case Take: return checkParamCount(lexer, location, exp, 1); - case Iif: return checkParamCount(lexer, location, exp, 2,3); - case ToInteger: return checkParamCount(lexer, location, exp, 0); - case ToDecimal: return checkParamCount(lexer, location, exp, 0); - case ToString: return checkParamCount(lexer, location, exp, 0); - case Substring: return checkParamCount(lexer, location, exp, 1, 2); - case StartsWith: return checkParamCount(lexer, location, exp, 1); - case EndsWith: return checkParamCount(lexer, location, exp, 1); - case Matches: return checkParamCount(lexer, location, exp, 1); - case ReplaceMatches: return checkParamCount(lexer, location, exp, 2); - case Contains: return checkParamCount(lexer, location, exp, 1); - case Replace: return checkParamCount(lexer, location, exp, 2); - case Length: return checkParamCount(lexer, location, exp, 0); - case Children: return checkParamCount(lexer, location, exp, 0); - case Descendents: return checkParamCount(lexer, location, exp, 0); - case MemberOf: return checkParamCount(lexer, location, exp, 1); - case Trace: return checkParamCount(lexer, location, exp, 1); - case Today: return checkParamCount(lexer, location, exp, 0); - case Now: return checkParamCount(lexer, location, exp, 0); - case Resolve: return checkParamCount(lexer, location, exp, 0); - case Extension: return checkParamCount(lexer, location, exp, 1); - case Custom: return checkParamCount(lexer, location, exp, details.getMinParameters(), details.getMaxParameters()); - } - return false; - } - - private List execute(ExecutionContext context, List focus, ExpressionNode exp, boolean atEntry) throws FHIRException { - List work = new ArrayList(); - switch (exp.getKind()) { - case Name: - if (atEntry && exp.getName().equals("$this")) - work.add(context.getThisItem()); - else - for (Base item : focus) { - List outcome = execute(context, item, exp, atEntry); - for (Base base : outcome) - if (base != null) - work.add(base); - } - break; - case Function: - List work2 = evaluateFunction(context, focus, exp); - work.addAll(work2); - break; - case Constant: - Base b = processConstant(context, exp.getConstant()); - if (b != null) - work.add(b); - break; - case Group: - work2 = execute(context, focus, exp.getGroup(), atEntry); - work.addAll(work2); - } - - if (exp.getInner() != null) - work = execute(context, work, exp.getInner(), false); - - if (exp.isProximal() && exp.getOperation() != null) { - ExpressionNode next = exp.getOpNext(); - ExpressionNode last = exp; - while (next != null) { - List work2 = preOperate(work, last.getOperation()); - if (work2 != null) - work = work2; - else if (last.getOperation() == Operation.Is || last.getOperation() == Operation.As) { - work2 = executeTypeName(context, focus, next, false); - work = operate(work, last.getOperation(), work2); - } else { - work2 = execute(context, focus, next, true); - work = operate(work, last.getOperation(), work2); - } - last = next; - next = next.getOpNext(); - } - } - return work; - } - - private List executeTypeName(ExecutionContext context, List focus, ExpressionNode next, boolean atEntry) { - List result = new ArrayList(); - result.add(new StringType(next.getName())); - return result; - } - - - private List preOperate(List left, Operation operation) { - switch (operation) { - case And: - return isBoolean(left, false) ? makeBoolean(false) : null; - case Or: - return isBoolean(left, true) ? makeBoolean(true) : null; - case Implies: - return convertToBoolean(left) ? null : makeBoolean(true); - default: - return null; - } - } - - private List makeBoolean(boolean b) { - List res = new ArrayList(); - res.add(new BooleanType(b)); - return res; - } - - private TypeDetails executeTypeName(ExecutionTypeContext context, TypeDetails focus, ExpressionNode exp, boolean atEntry) throws PathEngineException, DefinitionException { - return new TypeDetails(CollectionStatus.SINGLETON, exp.getName()); - } - - private TypeDetails executeType(ExecutionTypeContext context, TypeDetails focus, ExpressionNode exp, boolean atEntry) throws PathEngineException, DefinitionException { - TypeDetails result = new TypeDetails(null); - switch (exp.getKind()) { - case Name: - if (atEntry && exp.getName().equals("$this")) - result.update(context.getContext()); - else { - for (String s : focus.getTypes()) { - result.update(executeType(s, exp, atEntry)); - } - if (result.hasNoTypes()) - throw new PathEngineException("The name "+exp.getName()+" is not valid for any of the possible types: "+focus.describe()); - } - break; - case Function: - result.update(evaluateFunctionType(context, focus, exp)); - break; - case Constant: - result.addType(readConstantType(context, exp.getConstant())); - break; - case Group: - result.update(executeType(context, focus, exp.getGroup(), atEntry)); - } - exp.setTypes(result); - - if (exp.getInner() != null) { - result = executeType(context, result, exp.getInner(), false); - } - - if (exp.isProximal() && exp.getOperation() != null) { - ExpressionNode next = exp.getOpNext(); - ExpressionNode last = exp; - while (next != null) { - TypeDetails work; - if (last.getOperation() == Operation.Is || last.getOperation() == Operation.As) - work = executeTypeName(context, focus, next, atEntry); - else - work = executeType(context, focus, next, atEntry); - result = operateTypes(result, last.getOperation(), work); - last = next; - next = next.getOpNext(); - } - exp.setOpTypes(result); - } - return result; - } - - private Base processConstant(ExecutionContext context, String constant) throws PathEngineException { - if (constant.equals("true")) { - return new BooleanType(true); - } else if (constant.equals("false")) { - return new BooleanType(false); - } else if (constant.equals("{}")) { - return null; - } else if (Utilities.isInteger(constant)) { - return new IntegerType(constant); - } else if (Utilities.isDecimal(constant)) { - return new DecimalType(constant); - } else if (constant.startsWith("\'")) { - return new StringType(processConstantString(constant)); - } else if (constant.startsWith("%")) { - return resolveConstant(context, constant); - } else if (constant.startsWith("@")) { - return processDateConstant(context.appInfo, constant.substring(1)); - } else { - return new StringType(constant); - } - } - - private Base processDateConstant(Object appInfo, String value) throws PathEngineException { - if (value.startsWith("T")) - return new TimeType(value.substring(1)); - String v = value; - if (v.length() > 10) { - int i = v.substring(10).indexOf("-"); - if (i == -1) - i = v.substring(10).indexOf("+"); - if (i == -1) - i = v.substring(10).indexOf("Z"); - v = i == -1 ? value : v.substring(0, 10+i); - } - if (v.length() > 10) - return new DateTimeType(value); - else - return new DateType(value); - } - - - private Base resolveConstant(ExecutionContext context, String s) throws PathEngineException { - if (s.equals("%sct")) - return new StringType("http://snomed.info/sct"); - else if (s.equals("%loinc")) - return new StringType("http://loinc.org"); - else if (s.equals("%ucum")) - return new StringType("http://unitsofmeasure.org"); - else if (s.equals("%resource")) { - if (context.resource == null) - throw new PathEngineException("Cannot use %resource in this context"); - return context.resource; - } else if (s.equals("%us-zip")) - return new StringType("[0-9]{5}(-[0-9]{4}){0,1}"); - else if (s.startsWith("%\"vs-")) - return new StringType("http://hl7.org/fhir/ValueSet/"+s.substring(5, s.length()-1)+""); - else if (s.startsWith("%\"cs-")) - return new StringType("http://hl7.org/fhir/"+s.substring(5, s.length()-1)+""); - else if (s.startsWith("%\"ext-")) - return new StringType("http://hl7.org/fhir/StructureDefinition/"+s.substring(6, s.length()-1)); - else if (hostServices == null) - throw new PathEngineException("Unknown fixed constant '"+s+"'"); - else - return hostServices.resolveConstant(context.appInfo, s); - } - - - private String processConstantString(String s) throws PathEngineException { - StringBuilder b = new StringBuilder(); - int i = 1; - while (i < s.length()-1) { - char ch = s.charAt(i); - if (ch == '\\') { - i++; - switch (s.charAt(i)) { - case 't': - b.append('\t'); - break; - case 'r': - b.append('\r'); - break; - case 'n': - b.append('\n'); - break; - case 'f': - b.append('\f'); - break; - case '\'': - b.append('\''); - break; - case '\\': - b.append('\\'); - break; - case '/': - b.append('\\'); - break; - case 'u': - i++; - int uc = Integer.parseInt(s.substring(i, i+4), 16); - b.append((char) uc); - i = i + 4; - break; - default: - throw new PathEngineException("Unknown character escape \\"+s.charAt(i)); - } - } else { - b.append(ch); - i++; - } - } - return b.toString(); - } - - - private List operate(List left, Operation operation, List right) throws FHIRException { - switch (operation) { - case Equals: return opEquals(left, right); - case Equivalent: return opEquivalent(left, right); - case NotEquals: return opNotEquals(left, right); - case NotEquivalent: return opNotEquivalent(left, right); - case LessThen: return opLessThen(left, right); - case Greater: return opGreater(left, right); - case LessOrEqual: return opLessOrEqual(left, right); - case GreaterOrEqual: return opGreaterOrEqual(left, right); - case Union: return opUnion(left, right); - case In: return opIn(left, right); - case Contains: return opContains(left, right); - case Or: return opOr(left, right); - case And: return opAnd(left, right); - case Xor: return opXor(left, right); - case Implies: return opImplies(left, right); - case Plus: return opPlus(left, right); - case Times: return opTimes(left, right); - case Minus: return opMinus(left, right); - case Concatenate: return opConcatenate(left, right); - case DivideBy: return opDivideBy(left, right); - case Div: return opDiv(left, right); - case Mod: return opMod(left, right); - case Is: return opIs(left, right); - case As: return opAs(left, right); - default: - throw new Error("Not Done Yet: "+operation.toCode()); - } - } - - private List opAs(List left, List right) { - List result = new ArrayList(); - if (left.size() != 1 || right.size() != 1) - return result; - else { - String tn = convertToString(right); - if (tn.equals(left.get(0).fhirType())) - result.add(left.get(0)); - } - return result; - } - - - private List opIs(List left, List right) { - List result = new ArrayList(); - if (left.size() != 1 || right.size() != 1) - result.add(new BooleanType(false)); - else { - String tn = convertToString(right); - result.add(new BooleanType(left.get(0).hasType(tn))); - } - return result; - } - - - private TypeDetails operateTypes(TypeDetails left, Operation operation, TypeDetails right) { - switch (operation) { - case Equals: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Equivalent: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case NotEquals: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case NotEquivalent: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case LessThen: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Greater: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case LessOrEqual: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case GreaterOrEqual: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Is: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case As: return new TypeDetails(CollectionStatus.SINGLETON, right.getTypes()); - case Union: return left.union(right); - case Or: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case And: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Xor: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Implies : return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Times: - TypeDetails result = new TypeDetails(CollectionStatus.SINGLETON); - if (left.hasType("integer") && right.hasType("integer")) - result.addType("integer"); - else if (left.hasType("integer", "decimal") && right.hasType("integer", "decimal")) - result.addType("decimal"); - return result; - case DivideBy: - result = new TypeDetails(CollectionStatus.SINGLETON); - if (left.hasType("integer") && right.hasType("integer")) - result.addType("decimal"); - else if (left.hasType("integer", "decimal") && right.hasType("integer", "decimal")) - result.addType("decimal"); - return result; - case Concatenate: - result = new TypeDetails(CollectionStatus.SINGLETON, ""); - return result; - case Plus: - result = new TypeDetails(CollectionStatus.SINGLETON); - if (left.hasType("integer") && right.hasType("integer")) - result.addType("integer"); - else if (left.hasType("integer", "decimal") && right.hasType("integer", "decimal")) - result.addType("decimal"); - else if (left.hasType("string", "id", "code", "uri") && right.hasType("string", "id", "code", "uri")) - result.addType("string"); - return result; - case Minus: - result = new TypeDetails(CollectionStatus.SINGLETON); - if (left.hasType("integer") && right.hasType("integer")) - result.addType("integer"); - else if (left.hasType("integer", "decimal") && right.hasType("integer", "decimal")) - result.addType("decimal"); - return result; - case Div: - case Mod: - result = new TypeDetails(CollectionStatus.SINGLETON); - if (left.hasType("integer") && right.hasType("integer")) - result.addType("integer"); - else if (left.hasType("integer", "decimal") && right.hasType("integer", "decimal")) - result.addType("decimal"); - return result; - case In: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Contains: return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - default: - return null; - } - } - - - private List opEquals(List left, List right) { - if (left.size() != right.size()) - return makeBoolean(false); - - boolean res = true; - for (int i = 0; i < left.size(); i++) { - if (!doEquals(left.get(i), right.get(i))) { - res = false; - break; - } - } - return makeBoolean(res); - } - - private List opNotEquals(List left, List right) { - if (left.size() != right.size()) - return makeBoolean(true); - - boolean res = true; - for (int i = 0; i < left.size(); i++) { - if (!doEquals(left.get(i), right.get(i))) { - res = false; - break; - } - } - return makeBoolean(!res); - } - - private boolean doEquals(Base left, Base right) { - if (left.isPrimitive() && right.isPrimitive()) - return Base.equals(left.primitiveValue(), right.primitiveValue()); - else - return Base.compareDeep(left, right, false); - } - - private boolean doEquivalent(Base left, Base right) throws PathEngineException { - if (left.hasType("integer") && right.hasType("integer")) - return doEquals(left, right); - if (left.hasType("boolean") && right.hasType("boolean")) - return doEquals(left, right); - if (left.hasType("integer", "decimal") && right.hasType("integer", "decimal")) - return Utilities.equivalentNumber(left.primitiveValue(), right.primitiveValue()); - if (left.hasType("date", "dateTime", "time", "instant") && right.hasType("date", "dateTime", "time", "instant")) - return Utilities.equivalentNumber(left.primitiveValue(), right.primitiveValue()); - if (left.hasType("string", "id", "code", "uri") && right.hasType("string", "id", "code", "uri")) - return Utilities.equivalent(convertToString(left), convertToString(right)); - - throw new PathEngineException(String.format("Unable to determine equivalence between %s and %s", left.fhirType(), right.fhirType())); - } - - private List opEquivalent(List left, List right) throws PathEngineException { - if (left.size() != right.size()) - return makeBoolean(false); - - boolean res = true; - for (int i = 0; i < left.size(); i++) { - boolean found = false; - for (int j = 0; j < right.size(); j++) { - if (doEquivalent(left.get(i), right.get(j))) { - found = true; - break; - } - } - if (!found) { - res = false; - break; - } - } - return makeBoolean(res); - } - - private List opNotEquivalent(List left, List right) throws PathEngineException { - if (left.size() != right.size()) - return makeBoolean(true); - - boolean res = true; - for (int i = 0; i < left.size(); i++) { - boolean found = false; - for (int j = 0; j < right.size(); j++) { - if (doEquivalent(left.get(i), right.get(j))) { - found = true; - break; - } - } - if (!found) { - res = false; - break; - } - } - return makeBoolean(!res); - } - - private List opLessThen(List left, List right) throws FHIRException { - if (left.size() == 1 && right.size() == 1 && left.get(0).isPrimitive() && right.get(0).isPrimitive()) { - Base l = left.get(0); - Base r = right.get(0); - if (l.hasType("string") && r.hasType("string")) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) < 0); - else if ((l.hasType("integer") || l.hasType("decimal")) && (r.hasType("integer") || r.hasType("decimal"))) - return makeBoolean(new Double(l.primitiveValue()) < new Double(r.primitiveValue())); - else if ((l.hasType("date", "dateTime", "instant")) && (r.hasType("date", "dateTime", "instant"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) < 0); - else if ((l.hasType("time")) && (r.hasType("time"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) < 0); - } else if (left.size() == 1 && right.size() == 1 && left.get(0).fhirType().equals("Quantity") && right.get(0).fhirType().equals("Quantity") ) { - List lUnit = left.get(0).listChildrenByName("unit"); - List rUnit = right.get(0).listChildrenByName("unit"); - if (Base.compareDeep(lUnit, rUnit, true)) { - return opLessThen(left.get(0).listChildrenByName("value"), right.get(0).listChildrenByName("value")); - } else { - throw new Error("Canonical Comparison isn't done yet"); - } - } - return new ArrayList(); - } - - private List opGreater(List left, List right) throws FHIRException { - if (left.size() == 1 && right.size() == 1 && left.get(0).isPrimitive() && right.get(0).isPrimitive()) { - Base l = left.get(0); - Base r = right.get(0); - if (l.hasType("string") && r.hasType("string")) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) > 0); - else if ((l.hasType("integer", "decimal")) && (r.hasType("integer", "decimal"))) - return makeBoolean(new Double(l.primitiveValue()) > new Double(r.primitiveValue())); - else if ((l.hasType("date", "dateTime", "instant")) && (r.hasType("date", "dateTime", "instant"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) > 0); - else if ((l.hasType("time")) && (r.hasType("time"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) > 0); - } else if (left.size() == 1 && right.size() == 1 && left.get(0).fhirType().equals("Quantity") && right.get(0).fhirType().equals("Quantity") ) { - List lUnit = left.get(0).listChildrenByName("unit"); - List rUnit = right.get(0).listChildrenByName("unit"); - if (Base.compareDeep(lUnit, rUnit, true)) { - return opGreater(left.get(0).listChildrenByName("value"), right.get(0).listChildrenByName("value")); - } else { - throw new Error("Canonical Comparison isn't done yet"); - } - } - return new ArrayList(); - } - - private List opLessOrEqual(List left, List right) throws FHIRException { - if (left.size() == 1 && right.size() == 1 && left.get(0).isPrimitive() && right.get(0).isPrimitive()) { - Base l = left.get(0); - Base r = right.get(0); - if (l.hasType("string") && r.hasType("string")) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) <= 0); - else if ((l.hasType("integer", "decimal")) && (r.hasType("integer", "decimal"))) - return makeBoolean(new Double(l.primitiveValue()) <= new Double(r.primitiveValue())); - else if ((l.hasType("date", "dateTime", "instant")) && (r.hasType("date", "dateTime", "instant"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) <= 0); - else if ((l.hasType("time")) && (r.hasType("time"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) <= 0); - } else if (left.size() == 1 && right.size() == 1 && left.get(0).fhirType().equals("Quantity") && right.get(0).fhirType().equals("Quantity") ) { - List lUnits = left.get(0).listChildrenByName("unit"); - String lunit = lUnits.size() == 1 ? lUnits.get(0).primitiveValue() : null; - List rUnits = right.get(0).listChildrenByName("unit"); - String runit = rUnits.size() == 1 ? rUnits.get(0).primitiveValue() : null; - if ((lunit == null && runit == null) || lunit.equals(runit)) { - return opLessOrEqual(left.get(0).listChildrenByName("value"), right.get(0).listChildrenByName("value")); - } else { - throw new Error("Canonical Comparison isn't done yet"); - } - } - return new ArrayList(); - } - - private List opGreaterOrEqual(List left, List right) throws FHIRException { - if (left.size() == 1 && right.size() == 1 && left.get(0).isPrimitive() && right.get(0).isPrimitive()) { - Base l = left.get(0); - Base r = right.get(0); - if (l.hasType("string") && r.hasType("string")) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) >= 0); - else if ((l.hasType("integer", "decimal")) && (r.hasType("integer", "decimal"))) - return makeBoolean(new Double(l.primitiveValue()) >= new Double(r.primitiveValue())); - else if ((l.hasType("date", "dateTime", "instant")) && (r.hasType("date", "dateTime", "instant"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) >= 0); - else if ((l.hasType("time")) && (r.hasType("time"))) - return makeBoolean(l.primitiveValue().compareTo(r.primitiveValue()) >= 0); - } else if (left.size() == 1 && right.size() == 1 && left.get(0).fhirType().equals("Quantity") && right.get(0).fhirType().equals("Quantity") ) { - List lUnit = left.get(0).listChildrenByName("unit"); - List rUnit = right.get(0).listChildrenByName("unit"); - if (Base.compareDeep(lUnit, rUnit, true)) { - return opGreaterOrEqual(left.get(0).listChildrenByName("value"), right.get(0).listChildrenByName("value")); - } else { - throw new Error("Canonical Comparison isn't done yet"); - } - } - return new ArrayList(); - } - - private List opIn(List left, List right) { - boolean ans = true; - for (Base l : left) { - boolean f = false; - for (Base r : right) - if (doEquals(l, r)) { - f = true; - break; - } - if (!f) { - ans = false; - break; - } - } - return makeBoolean(ans); - } - - private List opContains(List left, List right) { - boolean ans = true; - for (Base r : right) { - boolean f = false; - for (Base l : left) - if (doEquals(l, r)) { - f = true; - break; - } - if (!f) { - ans = false; - break; - } - } - return makeBoolean(ans); - } - - private List opPlus(List left, List right) throws PathEngineException { - if (left.size() == 0) - throw new PathEngineException("Error performing +: left operand has no value"); - if (left.size() > 1) - throw new PathEngineException("Error performing +: left operand has more than one value"); - if (!left.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing +: left operand has the wrong type (%s)", left.get(0).fhirType())); - if (right.size() == 0) - throw new PathEngineException("Error performing +: right operand has no value"); - if (right.size() > 1) - throw new PathEngineException("Error performing +: right operand has more than one value"); - if (!right.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing +: right operand has the wrong type (%s)", right.get(0).fhirType())); - - List result = new ArrayList(); - Base l = left.get(0); - Base r = right.get(0); - if (l.hasType("string", "id", "code", "uri") && r.hasType("string", "id", "code", "uri")) - result.add(new StringType(l.primitiveValue() + r.primitiveValue())); - else if (l.hasType("integer") && r.hasType("integer")) - result.add(new IntegerType(Integer.parseInt(l.primitiveValue()) + Integer.parseInt(r.primitiveValue()))); - else if (l.hasType("decimal", "integer") && r.hasType("decimal", "integer")) - result.add(new DecimalType(new BigDecimal(l.primitiveValue()).add(new BigDecimal(r.primitiveValue())))); - else - throw new PathEngineException(String.format("Error performing +: left and right operand have incompatible or illegal types (%s, %s)", left.get(0).fhirType(), right.get(0).fhirType())); - return result; - } - - private List opTimes(List left, List right) throws PathEngineException { - if (left.size() == 0) - throw new PathEngineException("Error performing *: left operand has no value"); - if (left.size() > 1) - throw new PathEngineException("Error performing *: left operand has more than one value"); - if (!left.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing +: left operand has the wrong type (%s)", left.get(0).fhirType())); - if (right.size() == 0) - throw new PathEngineException("Error performing *: right operand has no value"); - if (right.size() > 1) - throw new PathEngineException("Error performing *: right operand has more than one value"); - if (!right.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing *: right operand has the wrong type (%s)", right.get(0).fhirType())); - - List result = new ArrayList(); - Base l = left.get(0); - Base r = right.get(0); - - if (l.hasType("integer") && r.hasType("integer")) - result.add(new IntegerType(Integer.parseInt(l.primitiveValue()) * Integer.parseInt(r.primitiveValue()))); - else if (l.hasType("decimal", "integer") && r.hasType("decimal", "integer")) - result.add(new DecimalType(new BigDecimal(l.primitiveValue()).multiply(new BigDecimal(r.primitiveValue())))); - else - throw new PathEngineException(String.format("Error performing *: left and right operand have incompatible or illegal types (%s, %s)", left.get(0).fhirType(), right.get(0).fhirType())); - return result; - } - - private List opConcatenate(List left, List right) { - List result = new ArrayList(); - result.add(new StringType(convertToString(left) + convertToString((right)))); - return result; - } - - private List opUnion(List left, List right) { - List result = new ArrayList(); - for (Base item : left) { - if (!doContains(result, item)) - result.add(item); - } - for (Base item : right) { - if (!doContains(result, item)) - result.add(item); - } - return result; - } - - private boolean doContains(List list, Base item) { - for (Base test : list) - if (doEquals(test, item)) - return true; - return false; - } - - - private List opAnd(List left, List right) { - if (left.isEmpty() && right.isEmpty()) - return new ArrayList(); - else if (isBoolean(left, false) || isBoolean(right, false)) - return makeBoolean(false); - else if (left.isEmpty() || right.isEmpty()) - return new ArrayList(); - else if (convertToBoolean(left) && convertToBoolean(right)) - return makeBoolean(true); - else - return makeBoolean(false); - } - - private boolean isBoolean(List list, boolean b) { - return list.size() == 1 && list.get(0) instanceof BooleanType && ((BooleanType) list.get(0)).booleanValue() == b; - } - - private List opOr(List left, List right) { - if (left.isEmpty() && right.isEmpty()) - return new ArrayList(); - else if (convertToBoolean(left) || convertToBoolean(right)) - return makeBoolean(true); - else if (left.isEmpty() || right.isEmpty()) - return new ArrayList(); - else - return makeBoolean(false); - } - - private List opXor(List left, List right) { - if (left.isEmpty() || right.isEmpty()) - return new ArrayList(); - else - return makeBoolean(convertToBoolean(left) ^ convertToBoolean(right)); - } - - private List opImplies(List left, List right) { - if (!convertToBoolean(left)) - return makeBoolean(true); - else if (right.size() == 0) - return new ArrayList(); - else - return makeBoolean(convertToBoolean(right)); - } - - - private List opMinus(List left, List right) throws PathEngineException { - if (left.size() == 0) - throw new PathEngineException("Error performing -: left operand has no value"); - if (left.size() > 1) - throw new PathEngineException("Error performing -: left operand has more than one value"); - if (!left.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing -: left operand has the wrong type (%s)", left.get(0).fhirType())); - if (right.size() == 0) - throw new PathEngineException("Error performing -: right operand has no value"); - if (right.size() > 1) - throw new PathEngineException("Error performing -: right operand has more than one value"); - if (!right.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing -: right operand has the wrong type (%s)", right.get(0).fhirType())); - - List result = new ArrayList(); - Base l = left.get(0); - Base r = right.get(0); - - if (l.hasType("integer") && r.hasType("integer")) - result.add(new IntegerType(Integer.parseInt(l.primitiveValue()) - Integer.parseInt(r.primitiveValue()))); - else if (l.hasType("decimal", "integer") && r.hasType("decimal", "integer")) - result.add(new DecimalType(new BigDecimal(l.primitiveValue()).subtract(new BigDecimal(r.primitiveValue())))); - else - throw new PathEngineException(String.format("Error performing -: left and right operand have incompatible or illegal types (%s, %s)", left.get(0).fhirType(), right.get(0).fhirType())); - return result; - } - - private List opDivideBy(List left, List right) throws PathEngineException { - if (left.size() == 0) - throw new PathEngineException("Error performing /: left operand has no value"); - if (left.size() > 1) - throw new PathEngineException("Error performing /: left operand has more than one value"); - if (!left.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing -: left operand has the wrong type (%s)", left.get(0).fhirType())); - if (right.size() == 0) - throw new PathEngineException("Error performing /: right operand has no value"); - if (right.size() > 1) - throw new PathEngineException("Error performing /: right operand has more than one value"); - if (!right.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing /: right operand has the wrong type (%s)", right.get(0).fhirType())); - - List result = new ArrayList(); - Base l = left.get(0); - Base r = right.get(0); - - if (l.hasType("integer", "decimal") && r.hasType("integer", "decimal")) { - Decimal d1; - try { - d1 = new Decimal(l.primitiveValue()); - Decimal d2 = new Decimal(r.primitiveValue()); - result.add(new DecimalType(d1.divide(d2).asDecimal())); - } catch (UcumException e) { - throw new PathEngineException(e); - } - } - else - throw new PathEngineException(String.format("Error performing /: left and right operand have incompatible or illegal types (%s, %s)", left.get(0).fhirType(), right.get(0).fhirType())); - return result; - } - - private List opDiv(List left, List right) throws PathEngineException { - if (left.size() == 0) - throw new PathEngineException("Error performing div: left operand has no value"); - if (left.size() > 1) - throw new PathEngineException("Error performing div: left operand has more than one value"); - if (!left.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing div: left operand has the wrong type (%s)", left.get(0).fhirType())); - if (right.size() == 0) - throw new PathEngineException("Error performing div: right operand has no value"); - if (right.size() > 1) - throw new PathEngineException("Error performing div: right operand has more than one value"); - if (!right.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing div: right operand has the wrong type (%s)", right.get(0).fhirType())); - - List result = new ArrayList(); - Base l = left.get(0); - Base r = right.get(0); - - if (l.hasType("integer") && r.hasType("integer")) - result.add(new IntegerType(Integer.parseInt(l.primitiveValue()) / Integer.parseInt(r.primitiveValue()))); - else if (l.hasType("decimal", "integer") && r.hasType("decimal", "integer")) { - Decimal d1; - try { - d1 = new Decimal(l.primitiveValue()); - Decimal d2 = new Decimal(r.primitiveValue()); - result.add(new IntegerType(d1.divInt(d2).asDecimal())); - } catch (UcumException e) { - throw new PathEngineException(e); - } - } - else - throw new PathEngineException(String.format("Error performing div: left and right operand have incompatible or illegal types (%s, %s)", left.get(0).fhirType(), right.get(0).fhirType())); - return result; - } - - private List opMod(List left, List right) throws PathEngineException { - if (left.size() == 0) - throw new PathEngineException("Error performing mod: left operand has no value"); - if (left.size() > 1) - throw new PathEngineException("Error performing mod: left operand has more than one value"); - if (!left.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing mod: left operand has the wrong type (%s)", left.get(0).fhirType())); - if (right.size() == 0) - throw new PathEngineException("Error performing mod: right operand has no value"); - if (right.size() > 1) - throw new PathEngineException("Error performing mod: right operand has more than one value"); - if (!right.get(0).isPrimitive()) - throw new PathEngineException(String.format("Error performing mod: right operand has the wrong type (%s)", right.get(0).fhirType())); - - List result = new ArrayList(); - Base l = left.get(0); - Base r = right.get(0); - - if (l.hasType("integer") && r.hasType("integer")) - result.add(new IntegerType(Integer.parseInt(l.primitiveValue()) % Integer.parseInt(r.primitiveValue()))); - else if (l.hasType("decimal", "integer") && r.hasType("decimal", "integer")) { - Decimal d1; - try { - d1 = new Decimal(l.primitiveValue()); - Decimal d2 = new Decimal(r.primitiveValue()); - result.add(new DecimalType(d1.modulo(d2).asDecimal())); - } catch (UcumException e) { - throw new PathEngineException(e); - } - } - else - throw new PathEngineException(String.format("Error performing mod: left and right operand have incompatible or illegal types (%s, %s)", left.get(0).fhirType(), right.get(0).fhirType())); - return result; - } - - - private String readConstantType(ExecutionTypeContext context, String constant) throws PathEngineException { - if (constant.equals("true")) - return "boolean"; - else if (constant.equals("false")) - return "boolean"; - else if (Utilities.isInteger(constant)) - return "integer"; - else if (Utilities.isDecimal(constant)) - return "decimal"; - else if (constant.startsWith("%")) - return resolveConstantType(context, constant); - else - return "string"; - } - - private String resolveConstantType(ExecutionTypeContext context, String s) throws PathEngineException { - if (s.equals("%sct")) - return "string"; - else if (s.equals("%loinc")) - return "string"; - else if (s.equals("%ucum")) - return "string"; - else if (s.equals("%resource")) { - if (context.resource == null) - throw new PathEngineException("%resource cannot be used in this context"); - return context.resource; - } else if (s.equals("%map-codes")) - return "string"; - else if (s.equals("%us-zip")) - return "string"; - else if (s.startsWith("%\"vs-")) - return "string"; - else if (s.startsWith("%\"cs-")) - return "string"; - else if (s.startsWith("%\"ext-")) - return "string"; - else if (hostServices == null) - throw new PathEngineException("Unknown fixed constant type for '"+s+"'"); - else - return hostServices.resolveConstantType(context.appInfo, s); - } - - private List execute(ExecutionContext context, Base item, ExpressionNode exp, boolean atEntry) throws FHIRException { - List result = new ArrayList(); - if (atEntry && Character.isUpperCase(exp.getName().charAt(0))) {// special case for start up - if (item instanceof Resource && ((Resource) item).getResourceType().toString().equals(exp.getName())) - result.add(item); - } else - getChildrenByName(item, exp.getName(), result); - return result; - } - - private TypeDetails executeType(String type, ExpressionNode exp, boolean atEntry) throws PathEngineException, DefinitionException { - if (atEntry && Character.isUpperCase(exp.getName().charAt(0)) && type.equals(exp.getName())) // special case for start up - return new TypeDetails(CollectionStatus.SINGLETON, type); - TypeDetails result = new TypeDetails(null); - getChildTypesByName(type, exp.getName(), result); - return result; - } - - - @SuppressWarnings("unchecked") - private TypeDetails evaluateFunctionType(ExecutionTypeContext context, TypeDetails focus, ExpressionNode exp) throws PathEngineException, DefinitionException { - List paramTypes = new ArrayList(); - if (exp.getFunction() == Function.Is || exp.getFunction() == Function.As) - paramTypes.add(new TypeDetails(CollectionStatus.SINGLETON, "string")); - else - for (ExpressionNode expr : exp.getParameters()) { - if (exp.getFunction() == Function.Where || exp.getFunction() == Function.Select || exp.getFunction() == Function.Repeat) - paramTypes.add(executeType(changeThis(context, focus), focus, expr, true)); - else - paramTypes.add(executeType(context, focus, expr, true)); - } - switch (exp.getFunction()) { - case Empty : - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Not : - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Exists : - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case SubsetOf : { - checkParamTypes(exp.getFunction().toCode(), paramTypes, focus); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case SupersetOf : { - checkParamTypes(exp.getFunction().toCode(), paramTypes, focus); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case IsDistinct : - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Distinct : - return focus; - case Count : - return new TypeDetails(CollectionStatus.SINGLETON, "integer"); - case Where : - return focus; - case Select : - return anything(focus.getCollectionStatus()); - case All : - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - case Repeat : - return anything(focus.getCollectionStatus()); - case Item : { - checkOrdered(focus, "item"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "integer")); - return focus; - } - case As : { - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, exp.getParameters().get(0).getName()); - } - case Is : { - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case Single : - return focus.toSingleton(); - case First : { - checkOrdered(focus, "first"); - return focus.toSingleton(); - } - case Last : { - checkOrdered(focus, "last"); - return focus.toSingleton(); - } - case Tail : { - checkOrdered(focus, "tail"); - return focus; - } - case Skip : { - checkOrdered(focus, "skip"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "integer")); - return focus; - } - case Take : { - checkOrdered(focus, "take"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "integer")); - return focus; - } - case Iif : { - TypeDetails types = new TypeDetails(null); - types.update(paramTypes.get(0)); - if (paramTypes.size() > 1) - types.update(paramTypes.get(1)); - return types; - } - case ToInteger : { - checkContextPrimitive(focus, "toInteger"); - return new TypeDetails(CollectionStatus.SINGLETON, "integer"); - } - case ToDecimal : { - checkContextPrimitive(focus, "toDecimal"); - return new TypeDetails(CollectionStatus.SINGLETON, "decimal"); - } - case ToString : { - checkContextPrimitive(focus, "toString"); - return new TypeDetails(CollectionStatus.SINGLETON, "string"); - } - case Substring : { - checkContextString(focus, "subString"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "integer"), new TypeDetails(CollectionStatus.SINGLETON, "integer")); - return new TypeDetails(CollectionStatus.SINGLETON, "string"); - } - case StartsWith : { - checkContextString(focus, "startsWith"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case EndsWith : { - checkContextString(focus, "endsWith"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case Matches : { - checkContextString(focus, "matches"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case ReplaceMatches : { - checkContextString(focus, "replaceMatches"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string"), new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "string"); - } - case Contains : { - checkContextString(focus, "contains"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case Replace : { - checkContextString(focus, "replace"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string"), new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "string"); - } - case Length : { - checkContextPrimitive(focus, "length"); - return new TypeDetails(CollectionStatus.SINGLETON, "integer"); - } - case Children : - return childTypes(focus, "*"); - case Descendents : - return childTypes(focus, "**"); - case MemberOf : { - checkContextCoded(focus, "memberOf"); - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "boolean"); - } - case Trace : { - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return focus; - } - case Today : - return new TypeDetails(CollectionStatus.SINGLETON, "date"); - case Now : - return new TypeDetails(CollectionStatus.SINGLETON, "dateTime"); - case Resolve : { - checkContextReference(focus, "resolve"); - return new TypeDetails(CollectionStatus.SINGLETON, "DomainResource"); - } - case Extension : { - checkParamTypes(exp.getFunction().toCode(), paramTypes, new TypeDetails(CollectionStatus.SINGLETON, "string")); - return new TypeDetails(CollectionStatus.SINGLETON, "Extension"); - } - case Custom : { - return hostServices.checkFunction(context.appInfo, exp.getName(), paramTypes); - } - default: - break; - } - throw new Error("not Implemented yet"); - } - - - private void checkParamTypes(String funcName, List paramTypes, TypeDetails... typeSet) throws PathEngineException { - int i = 0; - for (TypeDetails pt : typeSet) { - if (i == paramTypes.size()) - return; - TypeDetails actual = paramTypes.get(i); - i++; - for (String a : actual.getTypes()) { - if (!pt.hasType(a)) - throw new PathEngineException("The parameter type '"+a+"' is not legal for "+funcName+" parameter "+Integer.toString(i)+". expecting "+pt.toString()); - } - } - } - - private void checkOrdered(TypeDetails focus, String name) throws PathEngineException { - if (focus.getCollectionStatus() == CollectionStatus.UNORDERED) - throw new PathEngineException("The function '"+name+"'() can only be used on ordered collections"); - } - - private void checkContextReference(TypeDetails focus, String name) throws PathEngineException { - if (!focus.hasType("string") && !focus.hasType("uri") && !focus.hasType("Reference")) - throw new PathEngineException("The function '"+name+"'() can only be used on string, uri, Reference"); - } - - - private void checkContextCoded(TypeDetails focus, String name) throws PathEngineException { - if (!focus.hasType("string") && !focus.hasType("code") && !focus.hasType("uri") && !focus.hasType("Coding") && !focus.hasType("CodeableConcept")) - throw new PathEngineException("The function '"+name+"'() can only be used on string, code, uri, Coding, CodeableConcept"); - } - - - private void checkContextString(TypeDetails focus, String name) throws PathEngineException { - if (!focus.hasType("string") && !focus.hasType("code") && !focus.hasType("uri") && !focus.hasType("id")) - throw new PathEngineException("The function '"+name+"'() can only be used on string, uri, code, id, but found "+focus.describe()); - } - - - private void checkContextPrimitive(TypeDetails focus, String name) throws PathEngineException { - if (!focus.hasType(primitiveTypes)) - throw new PathEngineException("The function '"+name+"'() can only be used on "+primitiveTypes.toString()); - } - - - private TypeDetails childTypes(TypeDetails focus, String mask) throws PathEngineException, DefinitionException { - TypeDetails result = new TypeDetails(CollectionStatus.UNORDERED); - for (String f : focus.getTypes()) - getChildTypesByName(f, mask, result); - return result; - } - - private TypeDetails anything(CollectionStatus status) { - return new TypeDetails(status, allTypes.keySet()); - } - - // private boolean isPrimitiveType(String s) { - // return s.equals("boolean") || s.equals("integer") || s.equals("decimal") || s.equals("base64Binary") || s.equals("instant") || s.equals("string") || s.equals("uri") || s.equals("date") || s.equals("dateTime") || s.equals("time") || s.equals("code") || s.equals("oid") || s.equals("id") || s.equals("unsignedInt") || s.equals("positiveInt") || s.equals("markdown"); - // } - - private List evaluateFunction(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - switch (exp.getFunction()) { - case Empty : return funcEmpty(context, focus, exp); - case Not : return funcNot(context, focus, exp); - case Exists : return funcExists(context, focus, exp); - case SubsetOf : return funcSubsetOf(context, focus, exp); - case SupersetOf : return funcSupersetOf(context, focus, exp); - case IsDistinct : return funcIsDistinct(context, focus, exp); - case Distinct : return funcDistinct(context, focus, exp); - case Count : return funcCount(context, focus, exp); - case Where : return funcWhere(context, focus, exp); - case Select : return funcSelect(context, focus, exp); - case All : return funcAll(context, focus, exp); - case Repeat : return funcRepeat(context, focus, exp); - case Item : return funcItem(context, focus, exp); - case As : return funcAs(context, focus, exp); - case Is : return funcIs(context, focus, exp); - case Single : return funcSingle(context, focus, exp); - case First : return funcFirst(context, focus, exp); - case Last : return funcLast(context, focus, exp); - case Tail : return funcTail(context, focus, exp); - case Skip : return funcSkip(context, focus, exp); - case Take : return funcTake(context, focus, exp); - case Iif : return funcIif(context, focus, exp); - case ToInteger : return funcToInteger(context, focus, exp); - case ToDecimal : return funcToDecimal(context, focus, exp); - case ToString : return funcToString(context, focus, exp); - case Substring : return funcSubstring(context, focus, exp); - case StartsWith : return funcStartsWith(context, focus, exp); - case EndsWith : return funcEndsWith(context, focus, exp); - case Matches : return funcMatches(context, focus, exp); - case ReplaceMatches : return funcReplaceMatches(context, focus, exp); - case Contains : return funcContains(context, focus, exp); - case Replace : return funcReplace(context, focus, exp); - case Length : return funcLength(context, focus, exp); - case Children : return funcChildren(context, focus, exp); - case Descendents : return funcDescendents(context, focus, exp); - case MemberOf : return funcMemberOf(context, focus, exp); - case Trace : return funcTrace(context, focus, exp); - case Today : return funcToday(context, focus, exp); - case Now : return funcNow(context, focus, exp); - case Resolve : return funcResolve(context, focus, exp); - case Extension : return funcExtension(context, focus, exp); - case Custom: { - List> params = new ArrayList>(); - for (ExpressionNode p : exp.getParameters()) - params.add(execute(context, focus, p, true)); - return hostServices.executeFunction(context.appInfo, exp.getName(), params); - } - default: - throw new Error("not Implemented yet"); - } - } - - private List funcAll(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - if (exp.getParameters().size() == 1) { - List result = new ArrayList(); - List pc = new ArrayList(); - boolean all = true; - for (Base item : focus) { - pc.clear(); - pc.add(item); - if (!convertToBoolean(execute(changeThis(context, item), pc, exp.getParameters().get(0), false))) { - all = false; - break; - } - } - result.add(new BooleanType(all)); - return result; - } else {// (exp.getParameters().size() == 0) { - List result = new ArrayList(); - boolean all = true; - for (Base item : focus) { - boolean v = false; - if (item instanceof BooleanType) { - v = ((BooleanType) item).booleanValue(); - } else - v = item != null; - if (!v) { - all = false; - break; - } - } - result.add(new BooleanType(all)); - return result; - } - } - - - private ExecutionContext changeThis(ExecutionContext context, Base newThis) { - return new ExecutionContext(context.appInfo, context.resource, newThis); - } - - private ExecutionTypeContext changeThis(ExecutionTypeContext context, TypeDetails newThis) { - return new ExecutionTypeContext(context.appInfo, context.resource, newThis); - } - - - private List funcNow(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - result.add(DateTimeType.now()); - return result; - } - - - private List funcToday(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - result.add(new DateType(new Date(), TemporalPrecisionEnum.DAY)); - return result; - } - - - private List funcMemberOf(ExecutionContext context, List focus, ExpressionNode exp) { - throw new Error("not Implemented yet"); - } - - - private List funcDescendents(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - List current = new ArrayList(); - current.addAll(focus); - List added = new ArrayList(); - boolean more = true; - while (more) { - added.clear(); - for (Base item : current) { - getChildrenByName(item, "*", added); - } - more = !added.isEmpty(); - result.addAll(added); - current.clear(); - current.addAll(added); - } - return result; - } - - - private List funcChildren(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - for (Base b : focus) - getChildrenByName(b, "*", result); - return result; - } - - - private List funcReplace(ExecutionContext context, List focus, ExpressionNode exp) { - throw new Error("not Implemented yet"); - } - - - private List funcReplaceMatches(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); - - if (focus.size() == 1 && !Utilities.noString(sw)) - result.add(new BooleanType(convertToString(focus.get(0)).contains(sw))); - else - result.add(new BooleanType(false)); - return result; - } - - - private List funcEndsWith(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); - - if (focus.size() == 1 && !Utilities.noString(sw)) - result.add(new BooleanType(convertToString(focus.get(0)).endsWith(sw))); - else - result.add(new BooleanType(false)); - return result; - } - - - private List funcToString(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - result.add(new StringType(convertToString(focus))); - return result; - } - - - private List funcToDecimal(ExecutionContext context, List focus, ExpressionNode exp) { - String s = convertToString(focus); - List result = new ArrayList(); - if (Utilities.isDecimal(s)) - result.add(new DecimalType(s)); - return result; - } - - - private List funcIif(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List n1 = execute(context, focus, exp.getParameters().get(0), true); - Boolean v = convertToBoolean(n1); - - if (v) - return execute(context, focus, exp.getParameters().get(1), true); - else if (exp.getParameters().size() < 3) - return new ArrayList(); - else - return execute(context, focus, exp.getParameters().get(2), true); - } - - - private List funcTake(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List n1 = execute(context, focus, exp.getParameters().get(0), true); - int i1 = Integer.parseInt(n1.get(0).primitiveValue()); - - List result = new ArrayList(); - for (int i = 0; i < Math.min(focus.size(), i1); i++) - result.add(focus.get(i)); - return result; - } - - - private List funcSingle(ExecutionContext context, List focus, ExpressionNode exp) throws PathEngineException { - if (focus.size() == 1) - return focus; - throw new PathEngineException(String.format("Single() : checking for 1 item but found %d items", focus.size())); - } - - - private List funcIs(ExecutionContext context, List focus, ExpressionNode exp) throws PathEngineException { - List result = new ArrayList(); - if (focus.size() == 0 || focus.size() > 1) - result.add(new BooleanType(false)); - else { - String tn = exp.getParameters().get(0).getName(); - result.add(new BooleanType(focus.get(0).hasType(tn))); - } - return result; - } - - - private List funcAs(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - String tn = exp.getParameters().get(0).getName(); - for (Base b : focus) - if (b.hasType(tn)) - result.add(b); - return result; - } - - - private List funcRepeat(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - List current = new ArrayList(); - current.addAll(focus); - List added = new ArrayList(); - boolean more = true; - while (more) { - added.clear(); - List pc = new ArrayList(); - for (Base item : current) { - pc.clear(); - pc.add(item); - added.addAll(execute(changeThis(context, item), pc, exp.getParameters().get(0), false)); - } - more = !added.isEmpty(); - result.addAll(added); - current.clear(); - current.addAll(added); - } - return result; - } - - - - private List funcIsDistinct(ExecutionContext context, List focus, ExpressionNode exp) { - if (focus.size() <= 1) - return makeBoolean(true); - - boolean distinct = true; - for (int i = 0; i < focus.size(); i++) { - for (int j = i+1; j < focus.size(); j++) { - if (doEquals(focus.get(j), focus.get(i))) { - distinct = false; - break; - } - } - } - return makeBoolean(distinct); - } - - - private List funcSupersetOf(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List target = execute(context, focus, exp.getParameters().get(0), true); - - boolean valid = true; - for (Base item : target) { - boolean found = false; - for (Base t : focus) { - if (Base.compareDeep(item, t, false)) { - found = true; - break; - } - } - if (!found) { - valid = false; - break; - } - } - List result = new ArrayList(); - result.add(new BooleanType(valid)); - return result; - } - - - private List funcSubsetOf(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List target = execute(context, focus, exp.getParameters().get(0), true); - - boolean valid = true; - for (Base item : focus) { - boolean found = false; - for (Base t : target) { - if (Base.compareDeep(item, t, false)) { - found = true; - break; - } - } - if (!found) { - valid = false; - break; - } - } - List result = new ArrayList(); - result.add(new BooleanType(valid)); - return result; - } - - - private List funcExists(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - result.add(new BooleanType(!focus.isEmpty())); - return result; - } - - - private List funcResolve(ExecutionContext context, List focus, ExpressionNode exp) { - throw new Error("not Implemented yet"); - } - - private List funcExtension(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - List nl = execute(context, focus, exp.getParameters().get(0), true); - String url = nl.get(0).primitiveValue(); - - for (Base item : focus) { - List ext = new ArrayList(); - getChildrenByName(item, "extension", ext); - getChildrenByName(item, "modifierExtension", ext); - for (Base ex : ext) { - List vl = new ArrayList(); - getChildrenByName(ex, "url", vl); - if (convertToString(vl).equals(url)) - result.add(ex); - } - } - return result; - } - - private List funcTrace(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List nl = execute(context, focus, exp.getParameters().get(0), true); - String name = nl.get(0).primitiveValue(); - - log(name, focus); - return focus; - } - - private List funcDistinct(ExecutionContext context, List focus, ExpressionNode exp) { - if (focus.size() <= 1) - return focus; - - List result = new ArrayList(); - for (int i = 0; i < focus.size(); i++) { - boolean found = false; - for (int j = i+1; j < focus.size(); j++) { - if (doEquals(focus.get(j), focus.get(i))) { - found = true; - break; - } - } - if (!found) - result.add(focus.get(i)); - } - return result; - } - - private List funcMatches(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); - - if (focus.size() == 1 && !Utilities.noString(sw)) - result.add(new BooleanType(convertToString(focus.get(0)).matches(sw))); - else - result.add(new BooleanType(false)); - return result; - } - - private List funcContains(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); - - if (focus.size() == 1 && !Utilities.noString(sw)) - result.add(new BooleanType(convertToString(focus.get(0)).contains(sw))); - else - result.add(new BooleanType(false)); - return result; - } - - private List funcLength(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - if (focus.size() == 1) { - String s = convertToString(focus.get(0)); - result.add(new IntegerType(s.length())); - } - return result; - } - - private List funcStartsWith(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - String sw = convertToString(execute(context, focus, exp.getParameters().get(0), true)); - - if (focus.size() == 1 && !Utilities.noString(sw)) - result.add(new BooleanType(convertToString(focus.get(0)).startsWith(sw))); - else - result.add(new BooleanType(false)); - return result; - } - - private List funcSubstring(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - List n1 = execute(context, focus, exp.getParameters().get(0), true); - int i1 = Integer.parseInt(n1.get(0).primitiveValue()); - int i2 = -1; - if (exp.parameterCount() == 2) { - List n2 = execute(context, focus, exp.getParameters().get(1), true); - i2 = Integer.parseInt(n2.get(0).primitiveValue()); - } - - if (focus.size() == 1) { - String sw = convertToString(focus.get(0)); - String s; - if (i1 < 0 || i1 >= sw.length()) - return new ArrayList(); - if (exp.parameterCount() == 2) - s = sw.substring(i1, Math.min(sw.length(), i1+i2)); - else - s = sw.substring(i1); - if (!Utilities.noString(s)) - result.add(new StringType(s)); - } - return result; - } - - private List funcToInteger(ExecutionContext context, List focus, ExpressionNode exp) { - String s = convertToString(focus); - List result = new ArrayList(); - if (Utilities.isInteger(s)) - result.add(new IntegerType(s)); - return result; - } - - private List funcCount(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - result.add(new IntegerType(focus.size())); - return result; - } - - private List funcSkip(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List n1 = execute(context, focus, exp.getParameters().get(0), true); - int i1 = Integer.parseInt(n1.get(0).primitiveValue()); - - List result = new ArrayList(); - for (int i = i1; i < focus.size(); i++) - result.add(focus.get(i)); - return result; - } - - private List funcTail(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - for (int i = 1; i < focus.size(); i++) - result.add(focus.get(i)); - return result; - } - - private List funcLast(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - if (focus.size() > 0) - result.add(focus.get(focus.size()-1)); - return result; - } - - private List funcFirst(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - if (focus.size() > 0) - result.add(focus.get(0)); - return result; - } - - - private List funcWhere(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - List pc = new ArrayList(); - for (Base item : focus) { - pc.clear(); - pc.add(item); - if (convertToBoolean(execute(changeThis(context, item), pc, exp.getParameters().get(0), true))) - result.add(item); - } - return result; - } - - private List funcSelect(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - List pc = new ArrayList(); - for (Base item : focus) { - pc.clear(); - pc.add(item); - result.addAll(execute(changeThis(context, item), pc, exp.getParameters().get(0), true)); - } - return result; - } - - - private List funcItem(ExecutionContext context, List focus, ExpressionNode exp) throws FHIRException { - List result = new ArrayList(); - String s = convertToString(execute(context, focus, exp.getParameters().get(0), true)); - if (Utilities.isInteger(s) && Integer.parseInt(s) < focus.size()) - result.add(focus.get(Integer.parseInt(s))); - return result; - } - - private List funcEmpty(ExecutionContext context, List focus, ExpressionNode exp) { - List result = new ArrayList(); - result.add(new BooleanType(focus.isEmpty())); - return result; - } - - private List funcNot(ExecutionContext context, List focus, ExpressionNode exp) { - return makeBoolean(!convertToBoolean(focus)); - } - - public class ElementDefinitionMatch { - private ElementDefinition definition; - private String fixedType; - public ElementDefinitionMatch(ElementDefinition definition, String fixedType) { - super(); - this.definition = definition; - this.fixedType = fixedType; - } - public ElementDefinition getDefinition() { - return definition; - } - public String getFixedType() { - return fixedType; - } - - } - - private void getChildTypesByName(String type, String name, TypeDetails result) throws PathEngineException, DefinitionException { - if (Utilities.noString(type)) - throw new PathEngineException("No type provided in BuildToolPathEvaluator.getChildTypesByName"); - if (type.equals("xhtml")) - return; - String url = null; - if (type.contains(".")) { - url = "http://hl7.org/fhir/StructureDefinition/"+type.substring(0, type.indexOf(".")); - } else { - url = "http://hl7.org/fhir/StructureDefinition/"+type; - } - String tail = ""; - StructureDefinition sd = worker.fetchResource(StructureDefinition.class, url); - if (sd == null) - throw new DefinitionException("Unknown type "+type); // this really is an error, because we can only get to here if the internal infrastrucgture is wrong - List sdl = new ArrayList(); - ElementDefinitionMatch m = null; - if (type.contains(".")) - m = getElementDefinition(sd, type, false); - if (m != null && hasDataType(m.definition)) { - if (m.fixedType != null) - { - StructureDefinition dt = worker.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+m.fixedType); - if (dt == null) - throw new DefinitionException("unknown data type "+m.fixedType); - sdl.add(dt); - } else - for (TypeRefComponent t : m.definition.getType()) { - StructureDefinition dt = worker.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+t.getCode()); - if (dt == null) - throw new DefinitionException("unknown data type "+t.getCode()); - sdl.add(dt); - } - } else { - sdl.add(sd); - if (type.contains(".")) - tail = type.substring(type.indexOf(".")); - } - - for (StructureDefinition sdi : sdl) { - String path = sdi.getSnapshot().getElement().get(0).getPath()+tail+"."; - if (name.equals("**")) { - assert(result.getCollectionStatus() == CollectionStatus.UNORDERED); - for (ElementDefinition ed : sdi.getSnapshot().getElement()) { - if (ed.getPath().startsWith(path)) - for (TypeRefComponent t : ed.getType()) { - if (t.hasCode() && t.getCodeElement().hasValue()) { - String tn = null; - if (t.getCode().equals("Element") || t.getCode().equals("BackboneElement")) - tn = ed.getPath(); - else - tn = t.getCode(); - if (t.getCode().equals("Resource")) { - for (String rn : worker.getResourceNames()) { - if (!result.hasType(rn)) { - result.addType(rn); - getChildTypesByName(rn, "**", result); - } - } - } else if (!result.hasType(tn)) { - result.addType(tn); - getChildTypesByName(tn, "**", result); - } - } - } - } - } else if (name.equals("*")) { - assert(result.getCollectionStatus() == CollectionStatus.UNORDERED); - for (ElementDefinition ed : sdi.getSnapshot().getElement()) { - if (ed.getPath().startsWith(path) && !ed.getPath().substring(path.length()).contains(".")) - for (TypeRefComponent t : ed.getType()) { - if (t.getCode().equals("Element") || t.getCode().equals("BackboneElement")) - result.addType(ed.getPath()); - else if (t.getCode().equals("Resource")) - result.addTypes(worker.getResourceNames()); - else - result.addType(t.getCode()); - } - } - } else { - path = sdi.getSnapshot().getElement().get(0).getPath()+tail+"."+name; - - ElementDefinitionMatch ed = getElementDefinition(sdi, path, false); - if (ed != null) { - if (!Utilities.noString(ed.getFixedType())) - result.addType(ed.getFixedType()); - else - for (TypeRefComponent t : ed.getDefinition().getType()) { - if (Utilities.noString(t.getCode())) - break; // throw new PathEngineException("Illegal reference to primitive value attribute @ "+path); - - if (t.getCode().equals("Element") || t.getCode().equals("BackboneElement")) - result.addType(path); - else if (t.getCode().equals("Resource")) - result.addTypes(worker.getResourceNames()); - else - result.addType(t.getCode()); - } - } - } - } - } - - private ElementDefinitionMatch getElementDefinition(StructureDefinition sd, String path, boolean allowTypedName) throws PathEngineException { - for (ElementDefinition ed : sd.getSnapshot().getElement()) { - if (ed.getPath().equals(path)) { - if (ed.hasContentReference()) { - return getElementDefinitionById(sd, ed.getContentReference()); - } else - return new ElementDefinitionMatch(ed, null); - } - if (ed.getPath().endsWith("[x]") && path.startsWith(ed.getPath().substring(0, ed.getPath().length()-3)) && path.length() == ed.getPath().length()-3) - return new ElementDefinitionMatch(ed, null); - if (allowTypedName && ed.getPath().endsWith("[x]") && path.startsWith(ed.getPath().substring(0, ed.getPath().length()-3)) && path.length() > ed.getPath().length()-3) { - String s = Utilities.uncapitalize(path.substring(ed.getPath().length()-3)); - if (ParserBase.isPrimitive(s)) - return new ElementDefinitionMatch(ed, s); - else - return new ElementDefinitionMatch(ed, path.substring(ed.getPath().length()-3)); - } - if (ed.getPath().contains(".") && path.startsWith(ed.getPath()+".") && (ed.getType().size() > 0) && !isAbstractType(ed.getType())) { - // now we walk into the type. - if (ed.getType().size() > 1) // if there's more than one type, the test above would fail this - throw new PathEngineException("Internal typing issue...."); - StructureDefinition nsd = worker.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+ed.getType().get(0).getCode()); - if (nsd == null) - throw new PathEngineException("Unknown type "+ed.getType().get(0).getCode()); - return getElementDefinition(sd, sd.getId()+path.substring(ed.getPath().length()), allowTypedName); - } - if (ed.hasContentReference() && path.startsWith(ed.getPath()+".")) { - ElementDefinitionMatch m = getElementDefinitionById(sd, ed.getContentReference()); - return getElementDefinition(sd, m.definition.getPath()+path.substring(ed.getPath().length()), allowTypedName); - } - } - return null; - } - - private boolean isAbstractType(List list) { - return list.size() != 1 ? true : Utilities.existsInList(list.get(0).getCode(), "Element", "BackboneElement", "Resource", "DomainResource"); -} - - -private boolean hasType(ElementDefinition ed, String s) { - for (TypeRefComponent t : ed.getType()) - if (s.equalsIgnoreCase(t.getCode())) - return true; - return false; - } - - private boolean hasDataType(ElementDefinition ed) { - return ed.hasType() && !(ed.getType().get(0).getCode().equals("Element") || ed.getType().get(0).getCode().equals("BackboneElement")); - } - - private ElementDefinitionMatch getElementDefinitionById(StructureDefinition sd, String ref) { - for (ElementDefinition ed : sd.getSnapshot().getElement()) { - if (ref.equals("#"+ed.getId())) - return new ElementDefinitionMatch(ed, null); - } - return null; - } - - - public boolean hasLog() { - return log != null && log.length() > 0; - } - - - public String takeLog() { - if (!hasLog()) - return ""; - String s = log.toString(); - log = new StringBuilder(); - return s; - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/IWorkerContext.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/IWorkerContext.java deleted file mode 100644 index cd8399d3237..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/IWorkerContext.java +++ /dev/null @@ -1,286 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import org.hl7.fhir.dstu2016may.formats.IParser; -import org.hl7.fhir.dstu2016may.formats.ParserType; -import org.hl7.fhir.dstu2016may.model.*; -import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ConceptSetComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent; -import org.hl7.fhir.dstu2016may.terminologies.ValueSetExpander.ValueSetExpansionOutcome; -import org.hl7.fhir.dstu2016may.validation.IResourceValidator; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; - -import java.util.List; -import java.util.Set; - - -/** - * This is the standard interface used for access to underlying FHIR - * services through the tools and utilities provided by the reference - * implementation. - * - * The functionality it provides is - * - get access to parsers, validators, narrative builders etc - * (you can't create these directly because they need access - * to the right context for their information) - * - * - find resources that the tools need to carry out their tasks - * - * - provide access to terminology services they need. - * (typically, these terminology service requests are just - * passed through to the local implementation's terminology - * service) - * - * @author Grahame - */ -public interface IWorkerContext { - - // -- Parsers (read and write instances) ---------------------------------------- - - /** - * Get a parser to read/write instances. Use the defined type (will be extended - * as further types are added, though the only currently anticipate type is RDF) - * - * XML/JSON - the standard renderers - * XHTML - render the narrative only (generate it if necessary) - * - * @param type - * @return - */ - public IParser getParser(ParserType type); - - /** - * Get a parser to read/write instances. Determine the type - * from the stated type. Supported value for type: - * - the recommended MIME types - * - variants of application/xml and application/json - * - _format values xml, json - * - * @param type - * @return - */ - public IParser getParser(String type); - - /** - * Get a JSON parser - * - * @return - */ - public IParser newJsonParser(); - - /** - * Get an XML parser - * - * @return - */ - public IParser newXmlParser(); - - /** - * Get a validator that can check whether a resource is valid - * - * @return a prepared generator - * @ - */ - public IResourceValidator newValidator(); - - // -- resource fetchers --------------------------------------------------- - - /** - * Find an identified resource. The most common use of this is to access the the - * standard conformance resources that are part of the standard - structure - * definitions, value sets, concept maps, etc. - * - * Also, the narrative generator uses this, and may access any kind of resource - * - * The URI is called speculatively for things that might exist, so not finding - * a matching resouce, return null, not an error - * - * The URI can have one of 3 formats: - * - a full URL e.g. http://acme.org/fhir/ValueSet/[id] - * - a relative URL e.g. ValueSet/[id] - * - a logical id e.g. [id] - * - * It's an error if the second form doesn't agree with class_. It's an - * error if class_ is null for the last form - * - * @return - * @throws Exception - */ - public T fetchResource(Class class_, String uri); - - /** - * find whether a resource is available. - * - * Implementations of the interface can assume that if hasResource ruturns - * true, the resource will usually be fetched subsequently - * - * @param class_ - * @param uri - * @return - */ - public boolean hasResource(Class class_, String uri); - - // -- profile services --------------------------------------------------------- - - public List getResourceNames(); - public List allStructures(); - - // -- Terminology services ------------------------------------------------------ - - // these are the terminology services used internally by the tools - /** - * Find the code system definition for the nominated system uri. - * return null if there isn't one (then the tool might try - * supportsSystem) - * - * @param system - * @return - */ - public CodeSystem fetchCodeSystem(String system); - - /** - * True if the underlying terminology service provider will do - * expansion and code validation for the terminology. Corresponds - * to the extension - * - * http://hl7.org/fhir/StructureDefinition/conformance-supported-system - * - * in the Conformance resource - * - * @param system - * @return - */ - public boolean supportsSystem(String system); - - /** - * find concept maps for a source - * @param url - * @return - */ - public List findMapsForSource(String url); - - /** - * ValueSet Expansion - see $expand - * - * @param source - * @return - */ - public ValueSetExpansionOutcome expandVS(ValueSet source, boolean cacheOk); - - /** - * Value set expanion inside the internal expansion engine - used - * for references to supported system (see "supportsSystem") for - * which there is no value set. - * - * @param inc - * @return - */ - public ValueSetExpansionComponent expandVS(ConceptSetComponent inc); - - public class ValidationResult { - private ConceptDefinitionComponent definition; - private IssueSeverity severity; - private String message; - - public ValidationResult(IssueSeverity severity, String message) { - this.severity = severity; - this.message = message; - } - - public ValidationResult(ConceptDefinitionComponent definition) { - this.definition = definition; - } - - public ValidationResult(IssueSeverity severity, String message, ConceptDefinitionComponent definition) { - this.severity = severity; - this.message = message; - this.definition = definition; - } - - public boolean isOk() { - return definition != null; - } - - public String getDisplay() { - //Don't want question-marks as that stops something more useful from being displayed, such as the code - //return definition == null ? "??" : definition.getDisplay(); - return definition == null ? null : definition.getDisplay(); - } - - public ConceptDefinitionComponent asConceptDefinition() { - return definition; - } - - public IssueSeverity getSeverity() { - return severity; - } - - public String getMessage() { - return message; - } - } - - /** - * Validation of a code - consult the terminology service - * to see whether it is known. If known, return a description of it - * - * note: always return a result, with either an error or a code description - * - * corresponds to 2 terminology service calls: $validate-code and $lookup - * - * @param system - * @param code - * @param display - * @return - */ - public ValidationResult validateCode(String system, String code, String display); - - /** - * Validation of a code - consult the terminology service - * to see whether it is known. If known, return a description of it - * Also, check whether it's in the provided value set - * - * note: always return a result, with either an error or a code description, or both (e.g. known code, but not in the value set) - * - * corresponds to 2 terminology service calls: $validate-code and $lookup - * - * @param system - * @param code - * @param display - * @return - */ - public ValidationResult validateCode(String system, String code, String display, ValueSet vs); - public ValidationResult validateCode(Coding code, ValueSet vs); - public ValidationResult validateCode(CodeableConcept code, ValueSet vs); - - /** - * Validation of a code - consult the terminology service - * to see whether it is known. If known, return a description of it - * Also, check whether it's in the provided value set fragment (for supported systems with no value set definition) - * - * note: always return a result, with either an error or a code description, or both (e.g. known code, but not in the value set) - * - * corresponds to 2 terminology service calls: $validate-code and $lookup - * - * @param system - * @param code - * @param display - * @return - */ - public ValidationResult validateCode(String system, String code, String display, ConceptSetComponent vsi); - - /** - * returns the recommended tla for the type - * - * @param name - * @return - */ - public String getAbbreviation(String name); - - // return a set of types that have tails - public Set typeTails(); - - public String oid2Uri(String code); - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/JsonTrackingParser.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/JsonTrackingParser.java deleted file mode 100644 index 42a4449f3bf..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/JsonTrackingParser.java +++ /dev/null @@ -1,505 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import java.math.BigDecimal; -import java.util.Map; -import java.util.Stack; - -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.Utilities; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonNull; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - - -/** - * This is created to get a json parser that can track line numbers... grr... - * - * @author Grahame Grieve - * - */ -public class JsonTrackingParser { - - public enum TokenType { - Open, Close, String, Number, Colon, Comma, OpenArray, CloseArray, Eof, Null, Boolean; - } - - public class LocationData { - private int line; - private int col; - - protected LocationData(int line, int col) { - super(); - this.line = line; - this.col = col; - } - - public int getLine() { - return line; - } - - public int getCol() { - return col; - } - - public void newLine() { - line++; - col = 1; - } - - public LocationData copy() { - return new LocationData(line, col); - } - } - - private class State { - private String name; - private boolean isProp; - protected State(String name, boolean isProp) { - super(); - this.name = name; - this.isProp = isProp; - } - public String getName() { - return name; - } - public boolean isProp() { - return isProp; - } - } - - private class Lexer { - private String source; - private int cursor; - private String peek; - private String value; - private TokenType type; - private Stack states = new Stack(); - private LocationData lastLocationBWS; - private LocationData lastLocationAWS; - private LocationData location; - private StringBuilder b = new StringBuilder(); - - public Lexer(String source) throws FHIRException { - this.source = source; - cursor = -1; - location = new LocationData(1, 1); - start(); - } - - private boolean more() { - return peek != null || cursor < source.length(); - } - - private String getNext(int length) throws FHIRException { - String result = ""; - if (peek != null) { - if (peek.length() > length) { - result = peek.substring(0, length); - peek = peek.substring(length); - } else { - result = peek; - peek = null; - } - } - if (result.length() < length) { - int len = length - result.length(); - if (cursor > source.length() - len) - throw error("Attempt to read past end of source"); - result = result + source.substring(cursor+1, cursor+len+1); - cursor = cursor + len; - } - for (char ch : result.toCharArray()) - if (ch == '\n') - location.newLine(); - else - location.col++; - return result; - } - - private char getNextChar() throws FHIRException { - if (peek != null) { - char ch = peek.charAt(0); - peek = peek.length() == 1 ? null : peek.substring(1); - return ch; - } else { - cursor++; - if (cursor >= source.length()) - return (char) 0; - char ch = source.charAt(cursor); - if (ch == '\n') { - location.newLine(); - } else { - location.col++; - } - return ch; - } - } - - private void push(char ch){ - peek = peek == null ? String.valueOf(ch) : String.valueOf(ch)+peek; - } - - private void parseWord(String word, char ch, TokenType type) throws FHIRException { - this.type = type; - value = ""+ch+getNext(word.length()-1); - if (!value.equals(word)) - throw error("Syntax error in json reading special word "+word); - } - - private FHIRException error(String msg) { - return new FHIRException("Error parsing JSON source: "+msg+" at Line "+Integer.toString(location.line)+" (path=["+path()+"])"); - } - - private String path() { - if (states.empty()) - return value; - else { - String result = ""; - for (State s : states) - result = result + '/'+ s.getName(); - result = result + value; - return result; - } - } - - public void start() throws FHIRException { -// char ch = getNextChar(); -// if (ch = '\.uEF') -// begin -// // skip BOM -// getNextChar(); -// getNextChar(); -// end -// else -// push(ch); - next(); - } - - public TokenType getType() { - return type; - } - - public String getValue() { - return value; - } - - - public LocationData getLastLocationBWS() { - return lastLocationBWS; - } - - public LocationData getLastLocationAWS() { - return lastLocationAWS; - } - - public void next() throws FHIRException { - lastLocationBWS = location.copy(); - char ch; - do { - ch = getNextChar(); - } while (more() && Utilities.charInSet(ch, ' ', '\r', '\n', '\t')); - lastLocationAWS = location.copy(); - - if (!more()) { - type = TokenType.Eof; - } else { - switch (ch) { - case '{' : - type = TokenType.Open; - break; - case '}' : - type = TokenType.Close; - break; - case '"' : - type = TokenType.String; - b.setLength(0); - do { - ch = getNextChar(); - if (ch == '\\') { - ch = getNextChar(); - switch (ch) { - case '"': b.append('"'); break; - case '\\': b.append('\\'); break; - case '/': b.append('/'); break; - case 'n': b.append('\n'); break; - case 'r': b.append('\r'); break; - case 't': b.append('\t'); break; - case 'u': b.append((char) Integer.parseInt(getNext(4), 16)); break; - default : - throw error("unknown escape sequence: \\"+ch); - } - ch = ' '; - } else if (ch != '"') - b.append(ch); - } while (more() && (ch != '"')); - if (!more()) - throw error("premature termination of json stream during a string"); - value = b.toString(); - break; - case ':' : - type = TokenType.Colon; - break; - case ',' : - type = TokenType.Comma; - break; - case '[' : - type = TokenType.OpenArray; - break; - case ']' : - type = TokenType.CloseArray; - break; - case 't' : - parseWord("true", ch, TokenType.Boolean); - break; - case 'f' : - parseWord("false", ch, TokenType.Boolean); - break; - case 'n' : - parseWord("null", ch, TokenType.Null); - break; - default: - if ((ch >= '0' && ch <= '9') || ch == '-') { - type = TokenType.Number; - b.setLength(0); - while (more() && ((ch >= '0' && ch <= '9') || ch == '-' || ch == '.')) { - b.append(ch); - ch = getNextChar(); - } - value = b.toString(); - push(ch); - } else - throw error("Unexpected char '"+ch+"' in json stream"); - } - } - } - - public String consume(TokenType type) throws FHIRException { - if (this.type != type) - throw error("JSON syntax error - found "+type.toString()+" expecting "+type.toString()); - String result = value; - next(); - return result; - } - - } - - enum ItemType { - Object, String, Number, Boolean, Array, End, Eof, Null; - } - private Map map; - private Lexer lexer; - private ItemType itemType = ItemType.Object; - private String itemName; - private String itemValue; - - public static JsonObject parse(String source, Map map) throws FHIRException { - JsonTrackingParser self = new JsonTrackingParser(); - self.map = map; - return self.parse(source); - } - - private JsonObject parse(String source) throws FHIRException { - lexer = new Lexer(source); - JsonObject result = new JsonObject(); - LocationData loc = lexer.location.copy(); - if (lexer.getType() == TokenType.Open) { - lexer.next(); - lexer.states.push(new State("", false)); - } - else - throw lexer.error("Unexpected content at start of JSON: "+lexer.getType().toString()); - - parseProperty(); - readObject(result, true); - map.put(result, loc); - return result; - } - - private void readObject(JsonObject obj, boolean root) throws FHIRException { - map.put(obj, lexer.location.copy()); - - while (!(itemType == ItemType.End) || (root && (itemType == ItemType.Eof))) { - if (obj.has(itemName)) - throw lexer.error("Duplicated property name: "+itemName); - - switch (itemType) { - case Object: - JsonObject child = new JsonObject(); //(obj.path+'.'+ItemName); - LocationData loc = lexer.location.copy(); - obj.add(itemName, child); - next(); - readObject(child, false); - map.put(obj, loc); - break; - case Boolean : - JsonPrimitive v = new JsonPrimitive(Boolean.valueOf(itemValue)); - obj.add(itemName, v); - map.put(v, lexer.location.copy()); - break; - case String: - v = new JsonPrimitive(itemValue); - obj.add(itemName, v); - map.put(v, lexer.location.copy()); - break; - case Number: - v = new JsonPrimitive(new BigDecimal(itemValue)); - obj.add(itemName, v); - map.put(v, lexer.location.copy()); - break; - case Null: - JsonNull n = new JsonNull(); - obj.add(itemName, n); - map.put(n, lexer.location.copy()); - break; - case Array: - JsonArray arr = new JsonArray(); // (obj.path+'.'+ItemName); - loc = lexer.location.copy(); - obj.add(itemName, arr); - next(); - readArray(arr, false); - map.put(arr, loc); - break; - case Eof : - throw lexer.error("Unexpected End of File"); - case End: - default: - break; - } - next(); - } - } - - private void readArray(JsonArray arr, boolean root) throws FHIRException { - while (!((itemType == ItemType.End) || (root && (itemType == ItemType.Eof)))) { - switch (itemType) { - case Object: - JsonObject obj = new JsonObject(); // (arr.path+'['+inttostr(i)+']'); - LocationData loc = lexer.location.copy(); - arr.add(obj); - next(); - readObject(obj, false); - map.put(obj, loc); - break; - case String: - JsonPrimitive v = new JsonPrimitive(itemValue); - arr.add(v); - map.put(v, lexer.location.copy()); - break; - case Number: - v = new JsonPrimitive(new BigDecimal(itemValue)); - arr.add(v); - map.put(v, lexer.location.copy()); - break; - case Null : - JsonNull n = new JsonNull(); - arr.add(n); - map.put(n, lexer.location.copy()); - break; - case Array: - JsonArray child = new JsonArray(); // (arr.path+'['+inttostr(i)+']'); - loc = lexer.location.copy(); - arr.add(child); - next(); - readArray(child, false); - map.put(arr, loc); - break; - case Eof : - throw lexer.error("Unexpected End of File"); - case Boolean: - case End: - default: - break; - } - next(); - } - } - - private void next() throws FHIRException { - switch (itemType) { - case Object : - lexer.consume(TokenType.Open); - lexer.states.push(new State(itemName, false)); - if (lexer.getType() == TokenType.Close) { - itemType = ItemType.End; - lexer.next(); - } else - parseProperty(); - break; - case Null: - case String: - case Number: - case End: - case Boolean : - if (itemType == ItemType.End) - lexer.states.pop(); - if (lexer.getType() == TokenType.Comma) { - lexer.next(); - parseProperty(); - } else if (lexer.getType() == TokenType.Close) { - itemType = ItemType.End; - lexer.next(); - } else if (lexer.getType() == TokenType.CloseArray) { - itemType = ItemType.End; - lexer.next(); - } else if (lexer.getType() == TokenType.Eof) { - itemType = ItemType.Eof; - } else - throw lexer.error("Unexpected JSON syntax"); - break; - case Array : - lexer.next(); - lexer.states.push(new State(itemName+"[]", true)); - parseProperty(); - break; - case Eof : - throw lexer.error("JSON Syntax Error - attempt to read past end of json stream"); - default: - throw lexer.error("not done yet (a): "+itemType.toString()); - } - } - - private void parseProperty() throws FHIRException { - if (!lexer.states.peek().isProp) { - itemName = lexer.consume(TokenType.String); - itemValue = null; - lexer.consume(TokenType.Colon); - } - switch (lexer.getType()) { - case Null : - itemType = ItemType.Null; - itemValue = lexer.value; - lexer.next(); - break; - case String : - itemType = ItemType.String; - itemValue = lexer.value; - lexer.next(); - break; - case Boolean : - itemType = ItemType.Boolean; - itemValue = lexer.value; - lexer.next(); - break; - case Number : - itemType = ItemType.Number; - itemValue = lexer.value; - lexer.next(); - break; - case Open : - itemType = ItemType.Object; - break; - case OpenArray : - itemType = ItemType.Array; - break; - case CloseArray : - itemType = ItemType.End; - break; - // case Close, , case Colon, case Comma, case OpenArray, ! - default: - throw lexer.error("not done yet (b): "+lexer.getType().toString()); - } - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java deleted file mode 100644 index e7a616deb7d..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/ProfileUtilities.java +++ /dev/null @@ -1,1857 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import java.io.IOException; -import java.io.OutputStream; -import java.util.*; - -import org.hl7.fhir.dstu2016may.formats.IParser; -import org.hl7.fhir.dstu2016may.model.*; -import org.hl7.fhir.dstu2016may.model.ElementDefinition.*; -import org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength; -import org.hl7.fhir.dstu2016may.model.StructureDefinition.*; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionComponent; -import org.hl7.fhir.dstu2016may.model.ValueSet.ValueSetExpansionContainsComponent; -import org.hl7.fhir.dstu2016may.terminologies.ValueSetExpander.ValueSetExpansionOutcome; -import org.hl7.fhir.dstu2016may.utils.ProfileUtilities.ProfileKnowledgeProvider.BindingResolution; -import org.hl7.fhir.utilities.validation.ValidationMessage; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType; -import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity; -import org.hl7.fhir.utilities.validation.ValidationMessage.Source; -import org.hl7.fhir.exceptions.DefinitionException; -import org.hl7.fhir.exceptions.FHIRException; -import org.hl7.fhir.utilities.CommaSeparatedStringBuilder; -import org.hl7.fhir.utilities.Utilities; -import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator; -import org.hl7.fhir.utilities.xhtml.HierarchicalTableGenerator.*; -import org.hl7.fhir.utilities.xhtml.XhtmlNode; -import org.hl7.fhir.utilities.xml.SchematronWriter; -import org.hl7.fhir.utilities.xml.SchematronWriter.*; - -/** - * This class provides a set of utility operations for working with Profiles. - * Key functionality: - * * getChildMap --? - * * getChildList - * * generateSnapshot: Given a base (snapshot) profile structure, and a differential profile, generate a new snapshot profile - * * generateExtensionsTable: generate the HTML for a hierarchical table presentation of the extensions - * * generateTable: generate the HTML for a hierarchical table presentation of a structure - * * summarise: describe the contents of a profile - * @author Grahame - * - */ -public class ProfileUtilities { - - public static final int STATUS_OK = 0; - public static final int STATUS_HINT = 1; - public static final int STATUS_WARNING = 2; - public static final int STATUS_ERROR = 3; - public static final int STATUS_FATAL = 4; - public static final String DERIVATION_POINTER = "derived.pointer"; - public static final String IS_DERIVED = "derived.fact"; - public static final String UD_ERROR_STATUS = "error-status"; - private static final String ROW_COLOR_ERROR = "#ffcccc"; - private static final String ROW_COLOR_FATAL = "#ff9999"; - private static final String ROW_COLOR_WARNING = "#ffebcc"; - private static final String ROW_COLOR_HINT = "#ebf5ff"; - private static final String DERIVATION_EQUALS = "derivation.equals"; - private final boolean ADD_REFERENCE_TO_TABLE = true; - // note that ProfileUtilities are used re-entrantly internally, so nothing with process state can be here - private final IWorkerContext context; - private List messages; - private List snapshotStack = new ArrayList(); - private ProfileKnowledgeProvider pkp; - public ProfileUtilities(IWorkerContext context, List messages, ProfileKnowledgeProvider pkp) { - super(); - this.context = context; - this.messages = messages; - this.pkp = pkp; - } - - private boolean allTypesAre(List types, String name) { - for (TypeRefComponent t : types) { - if (!t.getCode().equals(name)) - return false; - } - return true; - } - - private String buildJson(Type value) throws IOException { - if (value instanceof PrimitiveType) - return ((PrimitiveType) value).asStringValue(); - - IParser json = context.newJsonParser(); - return json.composeString(value, null); - } - - private boolean checkExtensionDoco(ElementDefinition base) { - // see task 3970. For an extension, there's no point copying across all the underlying definitional stuff - boolean isExtension = base.getPath().equals("Extension") || base.getPath().endsWith(".extension") || base.getPath().endsWith(".modifierExtension"); - if (isExtension) { - base.setDefinition("An Extension"); - base.setShort("Extension"); - base.setCommentsElement(null); - base.setRequirementsElement(null); - base.getAlias().clear(); - base.getMapping().clear(); - } - return isExtension; - } - - private Piece checkForNoChange(Element source, Piece piece) { - if (source.hasUserData(DERIVATION_EQUALS)) { - piece.addStyle("opacity: 0.4"); - } - return piece; - } - - private Piece checkForNoChange(Element src1, Element src2, Piece piece) { - if (src1.hasUserData(DERIVATION_EQUALS) && src2.hasUserData(DERIVATION_EQUALS)) { - piece.addStyle("opacity: 0.5"); - } - return piece; - } - - private boolean codesInExpansion(List contains, ValueSetExpansionComponent expansion) { - for (ValueSetExpansionContainsComponent cc : contains) { - if (!inExpansion(cc, expansion.getContains())) - return false; - if (!codesInExpansion(cc.getContains(), expansion)) - return false; - } - return true; - } - - private String commas(List discriminator) { - CommaSeparatedStringBuilder c = new CommaSeparatedStringBuilder(); - for (StringType id : discriminator) - c.append(id.asStringValue()); - return c.toString(); - } - - private String describe(SlicingRules rules) { - switch (rules) { - case CLOSED : return "Closed"; - case OPEN : return "Open"; - case OPENATEND : return "Open At End"; - default: - return "??"; - } - } - - private String describeCardinality(ElementDefinition definition, ElementDefinition fallback, UnusedTracker tracker) { - IntegerType min = definition.hasMinElement() ? definition.getMinElement() : new IntegerType(); - StringType max = definition.hasMaxElement() ? definition.getMaxElement() : new StringType(); - if (min.isEmpty() && fallback != null) - min = fallback.getMinElement(); - if (max.isEmpty() && fallback != null) - max = fallback.getMaxElement(); - - tracker.used = !max.isEmpty() && !max.getValue().equals("0"); - - if (min.isEmpty() && max.isEmpty()) - return null; - else - return (!min.hasValue() ? "" : Integer.toString(min.getValue())) + ".." + (!max.hasValue() ? "" : max.getValue()); - } - - public String describeSlice(ElementDefinitionSlicingComponent slicing) { - return (slicing.getOrdered() ? "Ordered, " : "Unordered, ")+describe(slicing.getRules())+", by "+commas(slicing.getDiscriminator()); - } - - private boolean discriiminatorMatches(List diff, List base) { - if (diff.isEmpty() || base.isEmpty()) - return true; - if (diff.size() != base.size()) - return false; - for (int i = 0; i < diff.size(); i++) - if (!diff.get(i).getValue().equals(base.get(i).getValue())) - return false; - return true; - } - - private boolean extensionIsComplex(String value) { - if (value.contains("#")) { - StructureDefinition ext = context.fetchResource(StructureDefinition.class, value.substring(0, value.indexOf("#"))); - if (ext == null) - return false; - String tail = value.substring(value.indexOf("#")+1); - ElementDefinition ed = null; - for (ElementDefinition ted : ext.getSnapshot().getElement()) { - if (tail.equals(ted.getName())) { - ed = ted; - break; - } - } - if (ed == null) - return false; - int i = ext.getSnapshot().getElement().indexOf(ed); - int j = i+1; - while (j < ext.getSnapshot().getElement().size() && !ext.getSnapshot().getElement().get(j).getPath().equals(ed.getPath())) - j++; - return j - i > 5; - } else { - StructureDefinition ext = context.fetchResource(StructureDefinition.class, value); - return ext != null && ext.getSnapshot().getElement().size() > 5; - } - } - - private int findEndOfElement(StructureDefinitionDifferentialComponent context, int cursor) { - int result = cursor; - String path = context.getElement().get(cursor).getPath()+"."; - while (result < context.getElement().size()- 1 && context.getElement().get(result+1).getPath().startsWith(path)) - result++; - return result; - } - - private int findEndOfElement(StructureDefinitionSnapshotComponent context, int cursor) { - int result = cursor; - String path = context.getElement().get(cursor).getPath()+"."; - while (result < context.getElement().size()- 1 && context.getElement().get(result+1).getPath().startsWith(path)) - result++; - return result; - } - - private String fixedPath(String contextPath, String pathSimple) { - if (contextPath == null) - return pathSimple; - return contextPath+"."+pathSimple.substring(pathSimple.indexOf(".")+1); - } - - private void genCardinality(HierarchicalTableGenerator gen, ElementDefinition definition, Row row, boolean hasDef, UnusedTracker tracker, ElementDefinition fallback) { - IntegerType min = !hasDef ? new IntegerType() : definition.hasMinElement() ? definition.getMinElement() : new IntegerType(); - StringType max = !hasDef ? new StringType() : definition.hasMaxElement() ? definition.getMaxElement() : new StringType(); - if (min.isEmpty() && definition.getUserData(DERIVATION_POINTER) != null) { - ElementDefinition base = (ElementDefinition) definition.getUserData(DERIVATION_POINTER); - min = base.getMinElement().copy(); - min.setUserData(DERIVATION_EQUALS, true); - } - if (max.isEmpty() && definition.getUserData(DERIVATION_POINTER) != null) { - ElementDefinition base = (ElementDefinition) definition.getUserData(DERIVATION_POINTER); - max = base.getMaxElement().copy(); - max.setUserData(DERIVATION_EQUALS, true); - } - if (min.isEmpty() && fallback != null) - min = fallback.getMinElement(); - if (max.isEmpty() && fallback != null) - max = fallback.getMaxElement(); - - if (!max.isEmpty()) - tracker.used = !max.getValue().equals("0"); - - Cell cell = gen.new Cell(null, null, null, null, null); - row.getCells().add(cell); - if (!min.isEmpty() || !max.isEmpty()) { - cell.addPiece(checkForNoChange(min, gen.new Piece(null, !min.hasValue() ? "" : Integer.toString(min.getValue()), null))); - cell.addPiece(checkForNoChange(min, max, gen.new Piece(null, "..", null))); - cell.addPiece(checkForNoChange(min, gen.new Piece(null, !max.hasValue() ? "" : max.getValue(), null))); - } - } - - private Cell genTypes(HierarchicalTableGenerator gen, Row r, ElementDefinition e, String profileBaseFileName, StructureDefinition profile, String corePath) { - Cell c = gen.new Cell(); - r.getCells().add(c); - List types = e.getType(); - if (!e.hasType()) { - if (e.hasContentReference()) { - return c; - } else { - ElementDefinition d = (ElementDefinition) e.getUserData(DERIVATION_POINTER); - if (d != null && d.hasType()) { - types = new ArrayList(); - for (TypeRefComponent tr : d.getType()) { - TypeRefComponent tt = tr.copy(); - tt.setUserData(DERIVATION_EQUALS, true); - types.add(tt); - } - } else - return c; - } - } - - boolean first = true; - Element source = types.get(0); // either all types are the same, or we don't consider any of them the same - - boolean allReference = ADD_REFERENCE_TO_TABLE && !types.isEmpty(); - for (TypeRefComponent t : types) { - if (!(t.getCode().equals("Reference") && t.hasProfile())) - allReference = false; - } - if (allReference) { - c.getPieces().add(gen.new Piece(corePath+"references.html", "Reference", null)); - c.getPieces().add(gen.new Piece(null, "(", null)); - } - TypeRefComponent tl = null; - for (TypeRefComponent t : types) { - if (first) - first = false; - else if (allReference) - c.addPiece(checkForNoChange(tl, gen.new Piece(null," | ", null))); - else - c.addPiece(checkForNoChange(tl, gen.new Piece(null,", ", null))); - tl = t; - if (t.getCode().equals("Reference") || (t.getCode().equals("Resource") && t.hasProfile())) { - if (ADD_REFERENCE_TO_TABLE && !allReference) { - c.getPieces().add(gen.new Piece(corePath+"references.html", "Reference", null)); - c.getPieces().add(gen.new Piece(null, "(", null)); - } - if (t.hasProfile() && t.getProfile().get(0).getValue().startsWith("http://hl7.org/fhir/StructureDefinition/")) { - StructureDefinition sd = context.fetchResource(StructureDefinition.class, t.getProfile().get(0).getValue()); - if (sd != null) { - String disp = sd.hasDisplay() ? sd.getDisplay() : sd.getName(); - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+sd.getUserString("path"), disp, null))); - } else { - String rn = t.getProfile().get(0).getValue().substring(40); - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+pkp.getLinkFor(rn), rn, null))); - } - } else if (t.getProfile().size() == 0) { - c.addPiece(checkForNoChange(t, gen.new Piece(null, t.getCode(), null))); - } else if (t.getProfile().get(0).getValue().startsWith("#")) - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+profileBaseFileName+"."+t.getProfile().get(0).getValue().substring(1).toLowerCase()+".html", t.getProfile().get(0).getValue(), null))); - else - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+t.getProfile().get(0).getValue(), t.getProfile().get(0).getValue(), null))); - if (ADD_REFERENCE_TO_TABLE && !allReference) { - c.getPieces().add(gen.new Piece(null, ")", null)); - } - } else if (t.hasProfile()) { // a profiled type - String ref; - ref = pkp.getLinkForProfile(profile, t.getProfile().get(0).getValue()); - if (ref != null) { - String[] parts = ref.split("\\|"); - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+parts[0], parts[1], t.getCode()))); - } else - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+ref, t.getCode(), null))); - } else if (pkp.hasLinkFor(t.getCode())) { - c.addPiece(checkForNoChange(t, gen.new Piece(corePath+pkp.getLinkFor(t.getCode()), t.getCode(), null))); - } else - c.addPiece(checkForNoChange(t, gen.new Piece(null, t.getCode(), null))); - } - if (allReference) { - c.getPieces().add(gen.new Piece(null, ")", null)); - } - return c; - } - - private Cell generateDescription(HierarchicalTableGenerator gen, Row row, ElementDefinition definition, ElementDefinition fallback, boolean used, String baseURL, String url, StructureDefinition profile, String corePath, boolean root, boolean logicalModel) throws IOException { - Cell c = gen.new Cell(); - row.getCells().add(c); - - if (used) { - if (logicalModel && ToolingExtensions.hasExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace")) { - if (root) { - c.getPieces().add(gen.new Piece(null, "XML Namespace: ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"), null)); - } else if (!root && ToolingExtensions.hasExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace") && - !ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace").equals(ToolingExtensions.readStringExtension(profile, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))) { - c.getPieces().add(gen.new Piece(null, "XML Namespace: ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, ToolingExtensions.readStringExtension(definition, "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"), null)); - } - } - - if (definition.hasContentReference()) { - ElementDefinition ed = getElementByName(profile.getSnapshot().getElement(), definition.getContentReference()); - if (ed == null) - c.getPieces().add(gen.new Piece(null, "Unknown reference to "+definition.getContentReference(), null)); - else - c.getPieces().add(gen.new Piece("#"+ed.getPath(), "See "+ed.getPath(), null)); - } - if (definition.getPath().endsWith("url") && definition.hasFixed()) { - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "\""+buildJson(definition.getFixed())+"\"", null).addStyle("color: darkgreen"))); - } else { - if (definition != null && definition.hasShort()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.addPiece(checkForNoChange(definition.getShortElement(), gen.new Piece(null, definition.getShort(), null))); - } else if (fallback != null && fallback.hasShort()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.addPiece(checkForNoChange(fallback.getShortElement(), gen.new Piece(null, fallback.getShort(), null))); - } - if (url != null) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - String fullUrl = url.startsWith("#") ? baseURL+url : url; - StructureDefinition ed = context.fetchResource(StructureDefinition.class, url); - String ref = ed == null ? null : (String) corePath+ed.getUserData("path"); - c.getPieces().add(gen.new Piece(null, "URL: ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(ref, fullUrl, null)); - } - - if (definition.hasSlicing()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.getPieces().add(gen.new Piece(null, "Slice: ", null).addStyle("font-weight:bold")); - c.getPieces().add(gen.new Piece(null, describeSlice(definition.getSlicing()), null)); - } - if (definition != null) { - if (definition.hasBinding()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - BindingResolution br = pkp.resolveBinding(definition.getBinding()); - c.getPieces().add(checkForNoChange(definition.getBinding(), gen.new Piece(null, "Binding: ", null).addStyle("font-weight:bold"))); - c.getPieces().add(checkForNoChange(definition.getBinding(), gen.new Piece(br.url == null ? null : Utilities.isAbsoluteUrl(br.url)? br.url : corePath+br.url, br.display, null))); - if (definition.getBinding().hasStrength()) { - c.getPieces().add(checkForNoChange(definition.getBinding(), gen.new Piece(null, " (", null))); - c.getPieces().add(checkForNoChange(definition.getBinding(), gen.new Piece(corePath+"terminologies.html#"+definition.getBinding().getStrength().toCode(), definition.getBinding().getStrength().toCode(), definition.getBinding().getStrength().getDefinition()))); - c.getPieces().add(gen.new Piece(null, ")", null)); - } - } - for (ElementDefinitionConstraintComponent inv : definition.getConstraint()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.getPieces().add(checkForNoChange(inv, gen.new Piece(null, inv.getKey()+": ", null).addStyle("font-weight:bold"))); - c.getPieces().add(checkForNoChange(inv, gen.new Piece(null, inv.getHuman(), null))); - } - if (definition.hasFixed()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, "Fixed Value: ", null).addStyle("font-weight:bold"))); - c.getPieces().add(checkForNoChange(definition.getFixed(), gen.new Piece(null, buildJson(definition.getFixed()), null).addStyle("color: darkgreen"))); - } else if (definition.hasPattern()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, "Required Pattern: ", null).addStyle("font-weight:bold"))); - c.getPieces().add(checkForNoChange(definition.getPattern(), gen.new Piece(null, buildJson(definition.getPattern()), null).addStyle("color: darkgreen"))); - } else if (definition.hasExample()) { - if (!c.getPieces().isEmpty()) c.addPiece(gen.new Piece("br")); - c.getPieces().add(checkForNoChange(definition.getExample(), gen.new Piece(null, "Example: ", null).addStyle("font-weight:bold"))); - c.getPieces().add(checkForNoChange(definition.getExample(), gen.new Piece(null, buildJson(definition.getExample()), null).addStyle("color: darkgreen"))); - } - } - } - } - return c; - } - - private void generateForChildren(SchematronWriter sch, String xpath, ElementDefinition ed, StructureDefinition structure, StructureDefinition base) throws IOException { - // generateForChild(txt, structure, child); - List children = getChildList(structure, ed); - String sliceName = null; - ElementDefinitionSlicingComponent slicing = null; - for (ElementDefinition child : children) { - String name = tail(child.getPath()); - if (child.hasSlicing()) { - sliceName = name; - slicing = child.getSlicing(); - } else if (!name.equals(sliceName)) - slicing = null; - - ElementDefinition based = getByPath(base, child.getPath()); - boolean doMin = (child.getMin() > 0) && (based == null || (child.getMin() != based.getMin())); - boolean doMax = !child.getMax().equals("*") && (based == null || (!child.getMax().equals(based.getMax()))); - Slicer slicer = slicing == null ? new Slicer(true) : generateSlicer(child, slicing, structure); - if (slicer.check) { - if (doMin || doMax) { - Section s = sch.section(xpath); - Rule r = s.rule(xpath); - if (doMin) - r.assrt("count(f:"+name+slicer.criteria+") >= "+Integer.toString(child.getMin()), name+slicer.name+": minimum cardinality of '"+name+"' is "+Integer.toString(child.getMin())); - if (doMax) - r.assrt("count(f:"+name+slicer.criteria+") <= "+child.getMax(), name+slicer.name+": maximum cardinality of '"+name+"' is "+child.getMax()); - } - } - } - for (ElementDefinitionConstraintComponent inv : ed.getConstraint()) { - if (inv.hasXpath()) { - Section s = sch.section(ed.getPath()); - Rule r = s.rule(xpath); - r.assrt(inv.getXpath(), (inv.hasId() ? inv.getId()+": " : "")+inv.getHuman()+(inv.hasUserData(IS_DERIVED) ? " (inherited)" : "")); - } - } - for (ElementDefinition child : children) { - String name = tail(child.getPath()); - generateForChildren(sch, xpath+"/f:"+name, child, structure, base); - } - } - - public void generateSchematrons(OutputStream dest, StructureDefinition structure) throws IOException, DefinitionException { - if (structure.getDerivation() != TypeDerivationRule.CONSTRAINT) - throw new DefinitionException("not the right kind of structure to generate schematrons for"); - if (!structure.hasSnapshot()) - throw new DefinitionException("needs a snapshot"); - - StructureDefinition base = context.fetchResource(StructureDefinition.class, structure.getBaseDefinition()); - - SchematronWriter sch = new SchematronWriter(dest, SchematronType.PROFILE, base.getName()); - - ElementDefinition ed = structure.getSnapshot().getElement().get(0); - generateForChildren(sch, "f:"+ed.getPath(), ed, structure, base); - sch.dump(); - } - - private Slicer generateSlicer(ElementDefinition child, ElementDefinitionSlicingComponent slicing, StructureDefinition structure) { - // given a child in a structure, it's sliced. figure out the slicing xpath - if (child.getPath().endsWith(".extension")) { - ElementDefinition ued = getUrlFor(structure, child); - if ((ued == null || !ued.hasFixed()) && !(child.getType().get(0).hasProfile())) - return new Slicer(false); - else { - Slicer s = new Slicer(true); - String url = (ued == null || !ued.hasFixed()) ? child.getType().get(0).getProfile().get(0).asStringValue() : ((UriType) ued.getFixed()).asStringValue(); - s.name = " with URL = '"+url+"'"; - s.criteria = "[@url = '"+url+"']"; - return s; - } - } else - return new Slicer(false); - } - - public void generateSnapshot(StructureDefinition base, StructureDefinition derived, String url, String profileName) throws DefinitionException, FHIRException { - if (base == null) - throw new DefinitionException("no base profile provided"); - if (derived == null) - throw new DefinitionException("no derived structure provided"); - - if (snapshotStack.contains(derived.getUrl())) - throw new DefinitionException("Circular snapshot references detected; cannot generate snapshot (stack = "+snapshotStack.toString()+")"); - snapshotStack.add(derived.getUrl()); - -// System.out.println("Generate Snapshot for "+derived.getUrl()); - - derived.setSnapshot(new StructureDefinitionSnapshotComponent()); - - // so we have two lists - the base list, and the differential list - // the differential list is only allowed to include things that are in the base list, but - // is allowed to include them multiple times - thereby slicing them - - // our approach is to walk through the base list, and see whether the differential - // says anything about them. - int baseCursor = 0; - int diffCursor = 0; // we need a diff cursor because we can only look ahead, in the bound scoped by longer paths - - // we actually delegate the work to a subroutine so we can re-enter it with a different cursors - processPaths(derived.getSnapshot(), base.getSnapshot(), derived.getDifferential(), baseCursor, diffCursor, base.getSnapshot().getElement().size()-1, derived.getDifferential().getElement().size()-1, url, derived.getId(), null, false, base.getUrl(), null, false); - } - - private ElementDefinition getByPath(StructureDefinition base, String path) { - for (ElementDefinition ed : base.getSnapshot().getElement()) { - if (ed.getPath().equals(path)) - return ed; - if (ed.getPath().endsWith("[x]") && ed.getPath().length() <= path.length()-3 && ed.getPath().substring(0, ed.getPath().length()-3).equals(path.substring(0, ed.getPath().length()-3))) - return ed; - } - return null; - } - - private List getChildren(List all, ElementDefinition element) { - List result = new ArrayList(); - int i = all.indexOf(element)+1; - while (i < all.size() && all.get(i).getPath().length() > element.getPath().length()) { - if ((all.get(i).getPath().substring(0, element.getPath().length()+1).equals(element.getPath()+".")) && !all.get(i).getPath().substring(element.getPath().length()+1).contains(".")) - result.add(all.get(i)); - i++; - } - return result; - } - - private List getDiffMatches(StructureDefinitionDifferentialComponent context, String path, int start, int end, String profileName) { - List result = new ArrayList(); - for (int i = start; i <= end; i++) { - String statedPath = context.getElement().get(i).getPath(); - if (statedPath.equals(path) || (path.endsWith("[x]") && statedPath.length() > path.length() - 2 && statedPath.substring(0, path.length()-3).equals(path.substring(0, path.length()-3)) && !statedPath.substring(path.length()).contains("."))) { - result.add(context.getElement().get(i)); - } else if (result.isEmpty()) { -// System.out.println("ignoring "+statedPath+" in differential of "+profileName); - } - } - return result; - } - - private ElementDefinition getElementByName(List elements, String contentReference) { - for (ElementDefinition ed : elements) - if (ed.hasName() && ("#"+ed.getName()).equals(contentReference)) - return ed; - return null; - } - - public StructureDefinition getProfile(StructureDefinition source, String url) { - StructureDefinition profile; - String code; - if (url.startsWith("#")) { - profile = source; - code = url.substring(1); - } else { - String[] parts = url.split("\\#"); - profile = context.fetchResource(StructureDefinition.class, parts[0]); - code = parts.length == 1 ? null : parts[1]; - } - if (profile == null) - return null; - if (code == null) - return profile; - for (Resource r : profile.getContained()) { - if (r instanceof StructureDefinition && r.getId().equals(code)) - return (StructureDefinition) r; - } - return null; - } - - private StructureDefinition getProfileForDataType(TypeRefComponent type) { - StructureDefinition sd = null; - if (type.hasProfile()) - sd = context.fetchResource(StructureDefinition.class, type.getProfile().get(0).asStringValue()); - if (sd == null) - sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+type.getCode()); - if (sd == null) - System.out.println("XX: failed to find profle for type: " + type.getCode()); // debug GJM - return sd; - } - - private String getRowColor(ElementDefinition element) { - switch (element.getUserInt(UD_ERROR_STATUS)) { - case STATUS_OK: return null; - case STATUS_HINT: return ROW_COLOR_HINT; - case STATUS_WARNING: return ROW_COLOR_WARNING; - case STATUS_ERROR: return ROW_COLOR_ERROR; - case STATUS_FATAL: return ROW_COLOR_FATAL; - default: return null; - } - } - - private List getSiblings(List list, ElementDefinition current) { - List result = new ArrayList(); - String path = current.getPath(); - int cursor = list.indexOf(current)+1; - while (cursor < list.size() && list.get(cursor).getPath().length() >= path.length()) { - if (pathMatches(list.get(cursor).getPath(), path)) - result.add(list.get(cursor)); - cursor++; - } - return result; - } - - private ElementDefinition getUrlFor(StructureDefinition ed, ElementDefinition c) { - int i = ed.getSnapshot().getElement().indexOf(c) + 1; - while (i < ed.getSnapshot().getElement().size() && ed.getSnapshot().getElement().get(i).getPath().startsWith(c.getPath()+".")) { - if (ed.getSnapshot().getElement().get(i).getPath().equals(c.getPath()+".url")) - return ed.getSnapshot().getElement().get(i); - i++; - } - return null; - } - - private ElementDefinition getValueFor(StructureDefinition ed, ElementDefinition c) { - int i = ed.getSnapshot().getElement().indexOf(c) + 1; - while (i < ed.getSnapshot().getElement().size() && ed.getSnapshot().getElement().get(i).getPath().startsWith(c.getPath()+".")) { - if (ed.getSnapshot().getElement().get(i).getPath().startsWith(c.getPath()+".value")) - return ed.getSnapshot().getElement().get(i); - i++; - } - return null; - } - - private boolean inExpansion(ValueSetExpansionContainsComponent cc, List contains) { - for (ValueSetExpansionContainsComponent cc1 : contains) { - if (cc.getSystem().equals(cc1.getSystem()) && cc.getCode().equals(cc1.getCode())) - return true; - if (inExpansion(cc, cc1.getContains())) - return true; - } - return false; - } - - private boolean isAbstract(String code) { - return code.equals("Element") || code.equals("BackboneElement") || code.equals("Resource") || code.equals("DomainResource"); - } - - private boolean isDataType(List types) { - if (types.isEmpty()) - return false; - for (TypeRefComponent type : types) { - String t = type.getCode(); - if (!isDataType(t) && !t.equals("Reference") && !t.equals("Narrative") && !t.equals("Extension") && !t.equals("ElementDefinition") && !isPrimitive(t)) - return false; - } - return true; - } - - private boolean isDataType(String value) { - return Utilities.existsInList(value, "Identifier", "HumanName", "Address", "ContactPoint", "Timing", "SimpleQuantity", "Quantity", "Attachment", "Range", - "Period", "Ratio", "CodeableConcept", "Coding", "SampledData", "Age", "Distance", "Duration", "Count", "Money"); - } - - private boolean isExtension(ElementDefinition currentBase) { - return currentBase.getPath().endsWith(".extension") || currentBase.getPath().endsWith(".modifierExtension"); - } - - private boolean isLargerMax(String derived, String base) { - if ("*".equals(base)) - return false; - if ("*".equals(derived)) - return true; - return Integer.parseInt(derived) > Integer.parseInt(base); - } - - private boolean isReference(String value) { - return value.equals("Reference"); - } - - private boolean isSlicedToOneOnly(ElementDefinition e) { - return (e.hasSlicing() && e.hasMaxElement() && e.getMax().equals("1")); - } - - private boolean isSubset(ValueSet expBase, ValueSet expDerived) { - return codesInExpansion(expDerived.getExpansion().getContains(), expBase.getExpansion()); - } - - private ExtensionContext locateExtension(Class class1, String value) { - if (value.contains("#")) { - StructureDefinition ext = context.fetchResource(StructureDefinition.class, value.substring(0, value.indexOf("#"))); - if (ext == null) - return null; - String tail = value.substring(value.indexOf("#")+1); - ElementDefinition ed = null; - for (ElementDefinition ted : ext.getSnapshot().getElement()) { - if (tail.equals(ted.getName())) { - ed = ted; - return new ExtensionContext(ext, ed); - } - } - return null; - } else { - StructureDefinition ext = context.fetchResource(StructureDefinition.class, value); - if (ext == null) - return null; - else - return new ExtensionContext(ext, ext.getSnapshot().getElement().get(0)); - } - } - - private ElementDefinitionSlicingComponent makeExtensionSlicing() { - ElementDefinitionSlicingComponent slice = new ElementDefinitionSlicingComponent(); - slice.addDiscriminator("url"); - slice.setOrdered(false); - slice.setRules(SlicingRules.OPEN); - return slice; - } - - private String makePathLink(ElementDefinition element) { - if (!element.hasName()) - return element.getPath(); - if (!element.getPath().contains(".")) - return element.getName(); - return element.getPath().substring(0, element.getPath().lastIndexOf("."))+"."+element.getName(); - - } - - private void markDerived(ElementDefinition outcome) { - for (ElementDefinitionConstraintComponent inv : outcome.getConstraint()) - inv.setUserData(IS_DERIVED, true); - } - - private boolean onlyInformationIsMapping(List list, ElementDefinition e) { - return (!e.hasName() && !e.hasSlicing() && (onlyInformationIsMapping(e))) && - getChildren(list, e).isEmpty(); - } - - private boolean onlyInformationIsMapping(ElementDefinition d) { - return !d.hasShort() && !d.hasDefinition() && - !d.hasRequirements() && !d.getAlias().isEmpty() && !d.hasMinElement() && - !d.hasMax() && !d.getType().isEmpty() && !d.hasContentReference() && - !d.hasExample() && !d.hasFixed() && !d.hasMaxLengthElement() && - !d.getCondition().isEmpty() && !d.getConstraint().isEmpty() && !d.hasMustSupportElement() && - !d.hasBinding(); - } - - private boolean orderMatches(BooleanType diff, BooleanType base) { - return (diff == null) || (base == null) || (diff.getValue() == base.getValue()); - } - - private ElementDefinition overWriteWithCurrent(ElementDefinition profile, ElementDefinition usage) { - ElementDefinition res = profile.copy(); - if (usage.hasName()) - res.setName(usage.getName()); - if (usage.hasLabel()) - res.setLabel(usage.getLabel()); - for (Coding c : usage.getCode()) - res.addCode(c); - - if (usage.hasDefinition()) - res.setDefinition(usage.getDefinition()); - if (usage.hasShort()) - res.setShort(usage.getShort()); - if (usage.hasComments()) - res.setComments(usage.getComments()); - if (usage.hasRequirements()) - res.setRequirements(usage.getRequirements()); - for (StringType c : usage.getAlias()) - res.addAlias(c.getValue()); - if (usage.hasMin()) - res.setMin(usage.getMin()); - if (usage.hasMax()) - res.setMax(usage.getMax()); - - if (usage.hasFixed()) - res.setFixed(usage.getFixed()); - if (usage.hasPattern()) - res.setPattern(usage.getPattern()); - if (usage.hasExample()) - res.setExample(usage.getExample()); - if (usage.hasMinValue()) - res.setMinValue(usage.getMinValue()); - if (usage.hasMaxValue()) - res.setMaxValue(usage.getMaxValue()); - if (usage.hasMaxLength()) - res.setMaxLength(usage.getMaxLength()); - if (usage.hasMustSupport()) - res.setMustSupport(usage.getMustSupport()); - if (usage.hasBinding()) - res.setBinding(usage.getBinding().copy()); - for (ElementDefinitionConstraintComponent c : usage.getConstraint()) - res.addConstraint(c); - - return res; - } - - private boolean pathMatches(String p1, String p2) { - return p1.equals(p2) || (p2.endsWith("[x]") && p1.startsWith(p2.substring(0, p2.length()-3)) && !p1.substring(p2.length()-3).contains(".")); - } - - private boolean pathStartsWith(String p1, String p2) { - return p1.startsWith(p2); - } - - private String pathTail(List diffMatches, int i) { - - ElementDefinition d = diffMatches.get(i); - String s = d.getPath().contains(".") ? d.getPath().substring(d.getPath().lastIndexOf(".")+1) : d.getPath(); - return "."+s + (d.hasType() && d.getType().get(0).hasProfile() ? "["+d.getType().get(0).getProfile().get(0).asStringValue()+"]" : ""); - } - - private int processElementsIntoTree(ElementDefinitionHolder edh, int i, List list) { - String path = edh.getSelf().getPath(); - final String prefix = path + "."; - while (i < list.size() && list.get(i).getPath().startsWith(prefix)) { - ElementDefinitionHolder child = new ElementDefinitionHolder(list.get(i)); - edh.getChildren().add(child); - i = processElementsIntoTree(child, i+1, list); - } - return i; - } - - /** - * @param trimDifferential - * @throws DefinitionException, FHIRException - * @throws Exception - */ - private void processPaths(StructureDefinitionSnapshotComponent result, StructureDefinitionSnapshotComponent base, StructureDefinitionDifferentialComponent differential, int baseCursor, int diffCursor, int baseLimit, - int diffLimit, String url, String profileName, String contextPath, boolean trimDifferential, String contextName, String resultPathBase, boolean slicingDone) throws DefinitionException, FHIRException { - - // just repeat processing entries until we run out of our allowed scope (1st entry, the allowed scope is all the entries) - while (baseCursor <= baseLimit) { - // get the current focus of the base, and decide what to do - ElementDefinition currentBase = base.getElement().get(baseCursor); - String cpath = fixedPath(contextPath, currentBase.getPath()); - List diffMatches = getDiffMatches(differential, cpath, diffCursor, diffLimit, profileName); // get a list of matching elements in scope - - // in the simple case, source is not sliced. - if (!currentBase.hasSlicing()) { - if (diffMatches.isEmpty()) { // the differential doesn't say anything about this item - // so we just copy it in - ElementDefinition outcome = updateURLs(url, currentBase.copy()); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - updateFromBase(outcome, currentBase); - markDerived(outcome); - if (resultPathBase == null) - resultPathBase = outcome.getPath(); - else if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path"); - result.getElement().add(outcome); - baseCursor++; - } else if (diffMatches.size() == 1 && (slicingDone || (!diffMatches.get(0).hasSlicing() && !(isExtension(diffMatches.get(0)) && !diffMatches.get(0).hasName())))) {// one matching element in the differential - ElementDefinition template = null; - if (diffMatches.get(0).hasType() && diffMatches.get(0).getType().size() == 1 && diffMatches.get(0).getType().get(0).hasProfile() && !diffMatches.get(0).getType().get(0).getCode().equals("Reference")) { - String p = diffMatches.get(0).getType().get(0).getProfile().get(0).asStringValue(); - StructureDefinition sd = context.fetchResource(StructureDefinition.class, p); - if (sd != null) { - if (!sd.hasSnapshot()) { - StructureDefinition sdb = context.fetchResource(StructureDefinition.class, sd.getBaseDefinition()); - if (sdb == null) - throw new DefinitionException("no base for "+sd.getBaseDefinition()); - generateSnapshot(sdb, sd, sd.getUrl(), sd.getName()); - } - template = sd.getSnapshot().getElement().get(0).copy().setPath(currentBase.getPath()); - // temporary work around - if (!diffMatches.get(0).getType().get(0).getCode().equals("Extension")) { - template.setMin(currentBase.getMin()); - template.setMax(currentBase.getMax()); - } - } - } - if (template == null) - template = currentBase.copy(); - else - // some of what's in currentBase overrides template - template = overWriteWithCurrent(template, currentBase); - ElementDefinition outcome = updateURLs(url, template); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - updateFromBase(outcome, currentBase); - if (diffMatches.get(0).hasName()) - outcome.setName(diffMatches.get(0).getName()); - outcome.setSlicing(null); - updateFromDefinition(outcome, diffMatches.get(0), profileName, trimDifferential, url); - if (outcome.getPath().endsWith("[x]") && outcome.getType().size() == 1 && !outcome.getType().get(0).getCode().equals("*")) // if the base profile allows multiple types, but the profile only allows one, rename it - outcome.setPath(outcome.getPath().substring(0, outcome.getPath().length()-3)+Utilities.capitalize(outcome.getType().get(0).getCode())); - if (resultPathBase == null) - resultPathBase = outcome.getPath(); - else if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path"); - result.getElement().add(outcome); - baseCursor++; - diffCursor = differential.getElement().indexOf(diffMatches.get(0))+1; - if (differential.getElement().size() > diffCursor && outcome.getPath().contains(".") && isDataType(outcome.getType())) { // don't want to do this for the root, since that's base, and we're already processing it - if (pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath()+".")) { - if (outcome.getType().size() > 1) - throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") and multiple types ("+typeCode(outcome.getType())+") in profile "+profileName); - StructureDefinition dt = getProfileForDataType(outcome.getType().get(0)); - if (dt == null) - throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") for type "+typeCode(outcome.getType())+" in profile "+profileName+", but can't find type"); - contextName = dt.getUrl(); - int start = diffCursor; - while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath()+".")) - diffCursor++; - processPaths(result, dt.getSnapshot(), differential, 1 /* starting again on the data type, but skip the root */, start-1, dt.getSnapshot().getElement().size()-1, - diffCursor - 1, url, profileName+pathTail(diffMatches, 0), diffMatches.get(0).getPath(), trimDifferential, contextName, resultPathBase, false); - } - } - } else { - // ok, the differential slices the item. Let's check our pre-conditions to ensure that this is correct - if (!unbounded(currentBase) && !isSlicedToOneOnly(diffMatches.get(0))) - // you can only slice an element that doesn't repeat if the sum total of your slices is limited to 1 - // (but you might do that in order to split up constraints by type) - throw new DefinitionException("Attempt to a slice an element that does not repeat: "+currentBase.getPath()+"/"+currentBase.getName()+" from "+contextName); - if (!diffMatches.get(0).hasSlicing() && !isExtension(currentBase)) // well, the diff has set up a slice, but hasn't defined it. this is an error - throw new DefinitionException("differential does not have a slice: "+currentBase.getPath()); - - // well, if it passed those preconditions then we slice the dest. - // we're just going to accept the differential slicing at face value - ElementDefinition outcome = updateURLs(url, currentBase.copy()); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - updateFromBase(outcome, currentBase); - - if (!diffMatches.get(0).hasSlicing()) - outcome.setSlicing(makeExtensionSlicing()); - else - outcome.setSlicing(diffMatches.get(0).getSlicing().copy()); - if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path"); - result.getElement().add(outcome); - - // differential - if the first one in the list has a name, we'll process it. Else we'll treat it as the base definition of the slice. - int start = 0; - if (!diffMatches.get(0).hasName()) { - updateFromDefinition(outcome, diffMatches.get(0), profileName, trimDifferential, url); - if (!outcome.hasType()) { - throw new DefinitionException("not done yet"); - } - start = 1; - } else - checkExtensionDoco(outcome); - - // now, for each entry in the diff matches, we're going to process the base item - // our processing scope for base is all the children of the current path - int nbl = findEndOfElement(base, baseCursor); - int ndc = diffCursor; - int ndl = diffCursor; - for (int i = start; i < diffMatches.size(); i++) { - // our processing scope for the differential is the item in the list, and all the items before the next one in the list - ndc = differential.getElement().indexOf(diffMatches.get(i)); - ndl = findEndOfElement(differential, ndc); - // now we process the base scope repeatedly for each instance of the item in the differential list - processPaths(result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, i), contextPath, trimDifferential, contextName, resultPathBase, true); - } - // ok, done with that - next in the base list - baseCursor = nbl+1; - diffCursor = ndl+1; - } - } else { - // the item is already sliced in the base profile. - // here's the rules - // 1. irrespective of whether the slicing is ordered or not, the definition order must be maintained - // 2. slice element names have to match. - // 3. new slices must be introduced at the end - // corallory: you can't re-slice existing slices. is that ok? - - // we're going to need this: - String path = currentBase.getPath(); - ElementDefinition original = currentBase; - - if (diffMatches.isEmpty()) { // the differential doesn't say anything about this item - // copy across the currentbase, and all of it's children and siblings - while (baseCursor < base.getElement().size() && base.getElement().get(baseCursor).getPath().startsWith(path)) { - ElementDefinition outcome = updateURLs(url, base.getElement().get(baseCursor).copy()); - if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path: "+outcome.getPath()+" vs " + resultPathBase); - result.getElement().add(outcome); // so we just copy it in - baseCursor++; - } - } else { - // first - check that the slicing is ok - boolean closed = currentBase.getSlicing().getRules() == SlicingRules.CLOSED; - int diffpos = 0; - boolean isExtension = cpath.endsWith(".extension") || cpath.endsWith(".modifierExtension"); - if (diffMatches.get(0).hasSlicing()) { // it might be null if the differential doesn't want to say anything about slicing - if (!isExtension) - diffpos++; // if there's a slice on the first, we'll ignore any content it has - ElementDefinitionSlicingComponent dSlice = diffMatches.get(0).getSlicing(); - ElementDefinitionSlicingComponent bSlice = currentBase.getSlicing(); - if (!orderMatches(dSlice.getOrderedElement(), bSlice.getOrderedElement())) - throw new DefinitionException("Slicing rules on differential ("+summariseSlicing(dSlice)+") do not match those on base ("+summariseSlicing(bSlice)+") - order @ "+path+" ("+contextName+")"); - if (!discriiminatorMatches(dSlice.getDiscriminator(), bSlice.getDiscriminator())) - throw new DefinitionException("Slicing rules on differential ("+summariseSlicing(dSlice)+") do not match those on base ("+summariseSlicing(bSlice)+") - disciminator @ "+path+" ("+contextName+")"); - if (!ruleMatches(dSlice.getRules(), bSlice.getRules())) - throw new DefinitionException("Slicing rules on differential ("+summariseSlicing(dSlice)+") do not match those on base ("+summariseSlicing(bSlice)+") - rule @ "+path+" ("+contextName+")"); - } - ElementDefinition outcome = updateURLs(url, currentBase.copy()); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - updateFromBase(outcome, currentBase); - if (diffMatches.get(0).hasSlicing() && !isExtension) { - updateFromSlicing(outcome.getSlicing(), diffMatches.get(0).getSlicing()); - updateFromDefinition(outcome, diffMatches.get(0), profileName, closed, url); // if there's no slice, we don't want to update the unsliced description - } - if (diffMatches.get(0).hasSlicing() && !diffMatches.get(0).hasName()) - diffpos++; - - result.getElement().add(outcome); - - // now, we have two lists, base and diff. we're going to work through base, looking for matches in diff. - List baseMatches = getSiblings(base.getElement(), currentBase); - for (ElementDefinition baseItem : baseMatches) { - baseCursor = base.getElement().indexOf(baseItem); - outcome = updateURLs(url, baseItem.copy()); - updateFromBase(outcome, currentBase); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - outcome.setSlicing(null); - if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path"); - if (diffpos < diffMatches.size() && diffMatches.get(diffpos).getName().equals(outcome.getName())) { - // if there's a diff, we update the outcome with diff - // no? updateFromDefinition(outcome, diffMatches.get(diffpos), profileName, closed, url); - //then process any children - int nbl = findEndOfElement(base, baseCursor); - int ndc = differential.getElement().indexOf(diffMatches.get(diffpos)); - int ndl = findEndOfElement(differential, ndc); - // now we process the base scope repeatedly for each instance of the item in the differential list - processPaths(result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, diffpos), contextPath, closed, contextName, resultPathBase, true); - // ok, done with that - now set the cursors for if this is the end - baseCursor = nbl+1; - diffCursor = ndl+1; - diffpos++; - } else { - result.getElement().add(outcome); - baseCursor++; - // just copy any children on the base - while (baseCursor < base.getElement().size() && base.getElement().get(baseCursor).getPath().startsWith(path) && !base.getElement().get(baseCursor).getPath().equals(path)) { - outcome = updateURLs(url, currentBase.copy()); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path"); - result.getElement().add(outcome); - baseCursor++; - } - } - } - // finally, we process any remaining entries in diff, which are new (and which are only allowed if the base wasn't closed - if (closed && diffpos < diffMatches.size()) - throw new DefinitionException("The base snapshot marks a slicing as closed, but the differential tries to extend it in "+profileName+" at "+path+" ("+cpath+")"); - while (diffpos < diffMatches.size()) { - ElementDefinition diffItem = diffMatches.get(diffpos); - for (ElementDefinition baseItem : baseMatches) - if (baseItem.getName().equals(diffItem.getName())) - throw new DefinitionException("Named items are out of order in the slice"); - outcome = updateURLs(url, original.copy()); - outcome.setPath(fixedPath(contextPath, outcome.getPath())); - updateFromBase(outcome, currentBase); - outcome.setSlicing(null); - if (!outcome.getPath().startsWith(resultPathBase)) - throw new DefinitionException("Adding wrong path"); - result.getElement().add(outcome); - updateFromDefinition(outcome, diffItem, profileName, trimDifferential, url); - diffpos++; - } - } - } - } - } - - private boolean ruleMatches(SlicingRules diff, SlicingRules base) { - return (diff == null) || (base == null) || (diff == base) || (diff == SlicingRules.OPEN) || - ((diff == SlicingRules.OPENATEND && base == SlicingRules.CLOSED)); - } - - public void sortDifferential(StructureDefinition base, StructureDefinition diff, String name, List errors) { - - final List diffList = diff.getDifferential().getElement(); - // first, we move the differential elements into a tree - ElementDefinitionHolder edh = new ElementDefinitionHolder(diffList.get(0)); - - boolean hasSlicing = false; - List paths = new ArrayList(); // in a differential, slicing may not be stated explicitly - for(ElementDefinition elt : diffList) { - if (elt.hasSlicing() || paths.contains(elt.getPath())) { - hasSlicing = true; - break; - } - paths.add(elt.getPath()); - } - if(!hasSlicing) { - // if Differential does not have slicing then safe to pre-sort the list - // so elements and subcomponents are together - Collections.sort(diffList, new ElementNameCompare()); - } - - int i = 1; - processElementsIntoTree(edh, i, diff.getDifferential().getElement()); - - // now, we sort the siblings throughout the tree - ElementDefinitionComparer cmp = new ElementDefinitionComparer(true, base.getSnapshot().getElement(), "", 0, name); - sortElements(edh, cmp, errors); - - // now, we serialise them back to a list - diffList.clear(); - writeElements(edh, diffList); - } - - private void sortElements(ElementDefinitionHolder edh, ElementDefinitionComparer cmp, List errors) { - if (edh.getChildren().size() == 1) - // special case - sort needsto allocate base numbers, but there'll be no sort if there's only 1 child. So in that case, we just go ahead and allocated base number directly - edh.getChildren().get(0).baseIndex = cmp.find(edh.getChildren().get(0).getSelf().getPath()); - else - Collections.sort(edh.getChildren(), cmp); - cmp.checkForErrors(errors); - - for (ElementDefinitionHolder child : edh.getChildren()) { - if (child.getChildren().size() > 0) { - // what we have to check for here is running off the base profile into a data type profile - ElementDefinition ed = cmp.snapshot.get(child.getBaseIndex()); - ElementDefinitionComparer ccmp; - if (ed.getType().isEmpty() || isAbstract(ed.getType().get(0).getCode()) || ed.getType().get(0).getCode().equals(ed.getPath())) { - ccmp = new ElementDefinitionComparer(true, cmp.snapshot, cmp.base, cmp.prefixLength, cmp.name); - } else if (ed.getType().get(0).getCode().equals("Extension") && child.getSelf().getType().size() == 1 && child.getSelf().getType().get(0).hasProfile()) { - ccmp = new ElementDefinitionComparer(true, context.fetchResource(StructureDefinition.class, child.getSelf().getType().get(0).getProfile().get(0).getValue()).getSnapshot().getElement(), ed.getType().get(0).getCode(), child.getSelf().getPath().length(), cmp.name); - } else if (ed.getType().size() == 1 && !ed.getType().get(0).getCode().equals("*")) { - ccmp = new ElementDefinitionComparer(false, context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+ed.getType().get(0).getCode()).getSnapshot().getElement(), ed.getType().get(0).getCode(), child.getSelf().getPath().length(), cmp.name); - } else if (child.getSelf().getType().size() == 1) { - ccmp = new ElementDefinitionComparer(false, context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+child.getSelf().getType().get(0).getCode()).getSnapshot().getElement(), child.getSelf().getType().get(0).getCode(), child.getSelf().getPath().length(), cmp.name); - } else if (ed.getPath().endsWith("[x]") && !child.getSelf().getPath().endsWith("[x]")) { - String p = child.getSelf().getPath().substring(ed.getPath().length()-3); - StructureDefinition sd = context.fetchResource(StructureDefinition.class, "http://hl7.org/fhir/StructureDefinition/"+p); - if (sd == null) - throw new Error("Unable to find profile "+p); - ccmp = new ElementDefinitionComparer(false, sd.getSnapshot().getElement(), p, child.getSelf().getPath().length(), cmp.name); - } else { - throw new Error("Not handled yet (sortElements: "+ed.getPath()+":"+typeCode(ed.getType())+")"); - } - sortElements(child, ccmp, errors); - } - } - } - - private boolean standardExtensionSlicing(ElementDefinition element) { - String t = tail(element.getPath()); - return (t.equals("extension") || t.equals("modifierExtension")) - && element.getSlicing().getRules() != SlicingRules.CLOSED && element.getSlicing().getDiscriminator().size() == 1 && element.getSlicing().getDiscriminator().get(0).getValue().equals("url"); - } - - private String summariseSlicing(ElementDefinitionSlicingComponent slice) { - StringBuilder b = new StringBuilder(); - boolean first = true; - for (StringType d : slice.getDiscriminator()) { - if (first) - first = false; - else - b.append(", "); - b.append(d); - } - b.append("("); - if (slice.hasOrdered()) - b.append(slice.getOrderedElement().asStringValue()); - b.append("/"); - if (slice.hasRules()) - b.append(slice.getRules().toCode()); - b.append(")"); - if (slice.hasDescription()) { - b.append(" \""); - b.append(slice.getDescription()); - b.append("\""); - } - return b.toString(); - } - - private String tail(String path) { - if (path.contains(".")) - return path.substring(path.lastIndexOf('.')+1); - else - return path; - } - - private boolean unbounded(ElementDefinition definition) { - StringType max = definition.getMaxElement(); - if (max == null) - return false; // this is not valid - if (max.getValue().equals("1")) - return false; - if (max.getValue().equals("0")) - return false; - return true; - } - - private void updateFromBase(ElementDefinition derived, ElementDefinition base) { - if (base.hasBase()) { - derived.getBase().setPath(base.getBase().getPath()); - derived.getBase().setMin(base.getBase().getMin()); - derived.getBase().setMax(base.getBase().getMax()); - } else { - derived.getBase().setPath(base.getPath()); - derived.getBase().setMin(base.getMin()); - derived.getBase().setMax(base.getMax()); - } - } - - private void updateFromDefinition(ElementDefinition dest, ElementDefinition source, String pn, boolean trimDifferential, String purl) throws DefinitionException, FHIRException { - // we start with a clone of the base profile ('dest') and we copy from the profile ('source') - // over the top for anything the source has - ElementDefinition base = dest; - ElementDefinition derived = source; - derived.setUserData(DERIVATION_POINTER, base); - - if (derived != null) { - boolean isExtension = checkExtensionDoco(base); - - if (derived.hasShortElement()) { - if (!Base.compareDeep(derived.getShortElement(), base.getShortElement(), false)) - base.setShortElement(derived.getShortElement().copy()); - else if (trimDifferential) - derived.setShortElement(null); - else if (derived.hasShortElement()) - derived.getShortElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasDefinitionElement()) { - if (derived.getDefinition().startsWith("...")) - base.setDefinition(base.getDefinition()+"\r\n"+derived.getDefinition().substring(3)); - else if (!Base.compareDeep(derived.getDefinitionElement(), base.getDefinitionElement(), false)) - base.setDefinitionElement(derived.getDefinitionElement().copy()); - else if (trimDifferential) - derived.setDefinitionElement(null); - else if (derived.hasDefinitionElement()) - derived.getDefinitionElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasCommentsElement()) { - if (derived.getComments().startsWith("...")) - base.setComments(base.getComments()+"\r\n"+derived.getComments().substring(3)); - else if (!Base.compareDeep(derived.getCommentsElement(), base.getCommentsElement(), false)) - base.setCommentsElement(derived.getCommentsElement().copy()); - else if (trimDifferential) - base.setCommentsElement(derived.getCommentsElement().copy()); - else if (derived.hasCommentsElement()) - derived.getCommentsElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasLabelElement()) { - if (derived.getLabel().startsWith("...")) - base.setLabel(base.getLabel()+"\r\n"+derived.getLabel().substring(3)); - else if (!Base.compareDeep(derived.getLabelElement(), base.getLabelElement(), false)) - base.setLabelElement(derived.getLabelElement().copy()); - else if (trimDifferential) - base.setLabelElement(derived.getLabelElement().copy()); - else if (derived.hasLabelElement()) - derived.getLabelElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasRequirementsElement()) { - if (derived.getRequirements().startsWith("...")) - base.setRequirements(base.getRequirements()+"\r\n"+derived.getRequirements().substring(3)); - else if (!Base.compareDeep(derived.getRequirementsElement(), base.getRequirementsElement(), false)) - base.setRequirementsElement(derived.getRequirementsElement().copy()); - else if (trimDifferential) - base.setRequirementsElement(derived.getRequirementsElement().copy()); - else if (derived.hasRequirementsElement()) - derived.getRequirementsElement().setUserData(DERIVATION_EQUALS, true); - } - // sdf-9 - if (derived.hasRequirements() && !base.getPath().contains(".")) - derived.setRequirements(null); - if (base.hasRequirements() && !base.getPath().contains(".")) - base.setRequirements(null); - - if (derived.hasAlias()) { - if (!Base.compareDeep(derived.getAlias(), base.getAlias(), false)) - for (StringType s : derived.getAlias()) { - if (!base.hasAlias(s.getValue())) - base.getAlias().add(s.copy()); - } - else if (trimDifferential) - derived.getAlias().clear(); - else - for (StringType t : derived.getAlias()) - t.setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasMinElement()) { - if (!Base.compareDeep(derived.getMinElement(), base.getMinElement(), false)) { - if (derived.getMin() < base.getMin()) - messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+derived.getPath(), "Derived min ("+Integer.toString(derived.getMin())+") cannot be less than base min ("+Integer.toString(base.getMin())+")", IssueSeverity.ERROR)); - base.setMinElement(derived.getMinElement().copy()); - } else if (trimDifferential) - derived.setMinElement(null); - else - derived.getMinElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasMaxElement()) { - if (!Base.compareDeep(derived.getMaxElement(), base.getMaxElement(), false)) { - if (isLargerMax(derived.getMax(), base.getMax())) - messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+derived.getPath(), "Derived max ("+derived.getMax()+") cannot be greater than base max ("+base.getMax()+")", IssueSeverity.ERROR)); - base.setMaxElement(derived.getMaxElement().copy()); - } else if (trimDifferential) - derived.setMaxElement(null); - else - derived.getMaxElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasFixed()) { - if (!Base.compareDeep(derived.getFixed(), base.getFixed(), true)) { - base.setFixed(derived.getFixed().copy()); - } else if (trimDifferential) - derived.setFixed(null); - else - derived.getFixed().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasPattern()) { - if (!Base.compareDeep(derived.getPattern(), base.getPattern(), false)) { - base.setPattern(derived.getPattern().copy()); - } else - if (trimDifferential) - derived.setPattern(null); - else - derived.getPattern().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasExample()) { - if (!Base.compareDeep(derived.getExample(), base.getExample(), false)) - base.setExample(derived.getExample().copy()); - else if (trimDifferential) - derived.setExample(null); - else - derived.getExample().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasMaxLengthElement()) { - if (!Base.compareDeep(derived.getMaxLengthElement(), base.getMaxLengthElement(), false)) - base.setMaxLengthElement(derived.getMaxLengthElement().copy()); - else if (trimDifferential) - derived.setMaxLengthElement(null); - else - derived.getMaxLengthElement().setUserData(DERIVATION_EQUALS, true); - } - - // todo: what to do about conditions? - // condition : id 0..* - - if (derived.hasMustSupportElement()) { - if (!Base.compareDeep(derived.getMustSupportElement(), base.getMustSupportElement(), false)) - base.setMustSupportElement(derived.getMustSupportElement().copy()); - else if (trimDifferential) - derived.setMustSupportElement(null); - else - derived.getMustSupportElement().setUserData(DERIVATION_EQUALS, true); - } - - - // profiles cannot change : isModifier, defaultValue, meaningWhenMissing - // but extensions can change isModifier - if (isExtension) { - if (!Base.compareDeep(derived.getIsModifierElement(), base.getIsModifierElement(), false)) - base.setIsModifierElement(derived.getIsModifierElement().copy()); - else if (trimDifferential) - derived.setIsModifierElement(null); - else - derived.getIsModifierElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasBinding()) { - if (!Base.compareDeep(derived.getBinding(), base.getBinding(), false)) { - if (base.hasBinding() && base.getBinding().getStrength() == BindingStrength.REQUIRED && derived.getBinding().getStrength() != BindingStrength.REQUIRED) - messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+derived.getPath(), "illegal attempt to change a binding from "+base.getBinding().getStrength().toCode()+" to "+derived.getBinding().getStrength().toCode(), IssueSeverity.ERROR)); -// throw new DefinitionException("StructureDefinition "+pn+" at "+derived.getPath()+": illegal attempt to change a binding from "+base.getBinding().getStrength().toCode()+" to "+derived.getBinding().getStrength().toCode()); - else if (base.hasBinding() && derived.hasBinding() && base.getBinding().getStrength() == BindingStrength.REQUIRED && base.getBinding().hasValueSetReference() && derived.getBinding().hasValueSetReference()) { - ValueSetExpansionOutcome expBase = context.expandVS(context.fetchResource(ValueSet.class, base.getBinding().getValueSetReference().getReference()), true); - ValueSetExpansionOutcome expDerived = context.expandVS(context.fetchResource(ValueSet.class, derived.getBinding().getValueSetReference().getReference()), true); - if (expBase.getValueset() == null) - messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+base.getPath(), "Binding "+base.getBinding().getValueSetReference().getReference()+" could not be expanded", IssueSeverity.WARNING)); - else if (expDerived.getValueset() == null) - messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+derived.getPath(), "Binding "+derived.getBinding().getValueSetReference().getReference()+" could not be expanded", IssueSeverity.WARNING)); - else if (!isSubset(expBase.getValueset(), expDerived.getValueset())) - messages.add(new ValidationMessage(Source.ProfileValidator, IssueType.BUSINESSRULE, pn+"."+derived.getPath(), "Binding "+derived.getBinding().getValueSetReference().getReference()+" is not a subset of binding "+base.getBinding().getValueSetReference().getReference(), IssueSeverity.ERROR)); - } - base.setBinding(derived.getBinding().copy()); - } else if (trimDifferential) - derived.setBinding(null); - else - derived.getBinding().setUserData(DERIVATION_EQUALS, true); - } // else if (base.hasBinding() && doesn't have bindable type ) - // base - - if (derived.hasIsSummaryElement()) { - if (!Base.compareDeep(derived.getIsSummaryElement(), base.getIsSummaryElement(), false)) - base.setIsSummaryElement(derived.getIsSummaryElement().copy()); - else if (trimDifferential) - derived.setIsSummaryElement(null); - else - derived.getIsSummaryElement().setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasType()) { - if (!Base.compareDeep(derived.getType(), base.getType(), false)) { - if (base.hasType()) { - for (TypeRefComponent ts : derived.getType()) { - boolean ok = false; - CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); - for (TypeRefComponent td : base.getType()) { - b.append(td.getCode()); - if (td.hasCode() && (td.getCode().equals(ts.getCode()) || td.getCode().equals("Extension") || - td.getCode().equals("Element") || td.getCode().equals("*") || - ((td.getCode().equals("Resource") || (td.getCode().equals("DomainResource")) && pkp.isResource(ts.getCode()))))) - ok = true; - } - if (!ok) - throw new DefinitionException("StructureDefinition "+pn+" at "+derived.getPath()+": illegal constrained type "+ts.getCode()+" from "+b.toString()); - } - } - base.getType().clear(); - for (TypeRefComponent t : derived.getType()) { - TypeRefComponent tt = t.copy(); -// tt.setUserData(DERIVATION_EQUALS, true); - base.getType().add(tt); - } - } - else if (trimDifferential) - derived.getType().clear(); - else - for (TypeRefComponent t : derived.getType()) - t.setUserData(DERIVATION_EQUALS, true); - } - - if (derived.hasMapping()) { - // todo: mappings are not cumulative - one replaces another - if (!Base.compareDeep(derived.getMapping(), base.getMapping(), false)) { - for (ElementDefinitionMappingComponent s : derived.getMapping()) { - boolean found = false; - for (ElementDefinitionMappingComponent d : base.getMapping()) { - found = found || (d.getIdentity().equals(s.getIdentity()) && d.getMap().equals(s.getMap())); - } - if (!found) - base.getMapping().add(s); - } - } - else if (trimDifferential) - derived.getMapping().clear(); - else - for (ElementDefinitionMappingComponent t : derived.getMapping()) - t.setUserData(DERIVATION_EQUALS, true); - } - - // todo: constraints are cumulative. there is no replacing - for (ElementDefinitionConstraintComponent s : base.getConstraint()) - s.setUserData(IS_DERIVED, true); - if (derived.hasConstraint()) { - for (ElementDefinitionConstraintComponent s : derived.getConstraint()) { - base.getConstraint().add(s.copy()); - } - } - } - } - - private void updateFromSlicing(ElementDefinitionSlicingComponent dst, ElementDefinitionSlicingComponent src) { - if (src.hasOrderedElement()) - dst.setOrderedElement(src.getOrderedElement().copy()); - if (src.hasDiscriminator()) - dst.getDiscriminator().addAll(src.getDiscriminator()); - if (src.hasRulesElement()) - dst.setRulesElement(src.getRulesElement().copy()); - } - - /** - * Finds internal references in an Element's Binding and StructureDefinition references (in TypeRef) and bases them on the given url - * @param url - the base url to use to turn internal references into absolute references - * @param element - the Element to update - * @return - the updated Element - */ - private ElementDefinition updateURLs(String url, ElementDefinition element) { - if (element != null) { - ElementDefinition defn = element; - if (defn.hasBinding() && defn.getBinding().getValueSet() instanceof Reference && ((Reference)defn.getBinding().getValueSet()).getReference().startsWith("#")) - ((Reference)defn.getBinding().getValueSet()).setReference(url+((Reference)defn.getBinding().getValueSet()).getReference()); - for (TypeRefComponent t : defn.getType()) { - for (UriType tp : t.getProfile()) { - if (tp.getValue().startsWith("#")) - tp.setValue(url+t.getProfile()); - } - } - } - return element; - } - - private String urltail(String path) { - if (path.contains("#")) - return path.substring(path.lastIndexOf('#')+1); - if (path.contains("/")) - return path.substring(path.lastIndexOf('/')+1); - else - return path; - - } - - private void writeElements(ElementDefinitionHolder edh, List list) { - list.add(edh.getSelf()); - for (ElementDefinitionHolder child : edh.getChildren()) { - writeElements(child, list); - } - } - -// private static String listStructures(StructureDefinition p) { -// StringBuilder b = new StringBuilder(); -// boolean first = true; -// for (ProfileStructureComponent s : p.getStructure()) { -// if (first) -// first = false; -// else -// b.append(", "); -// if (pkp != null && pkp.hasLinkFor(s.getType())) -// b.append(""+s.getType()+""); -// else -// b.append(s.getType()); -// } -// return b.toString(); -// } - - public static String describeExtensionContext(StructureDefinition ext) { - CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); - for (StringType t : ext.getContext()) - b.append(t.getValue()); - if (!ext.hasContextType()) - throw new Error("no context type on "+ext.getUrl()); - switch (ext.getContextType()) { - case DATATYPE: return "Use on data type: "+b.toString(); - case EXTENSION: return "Use on extension: "+b.toString(); - case RESOURCE: return "Use on element: "+b.toString(); - default: - return "??"; - } - } - - public static List getChildList(StructureDefinition structure, ElementDefinition element) { - return getChildList(structure, element.getPath()); - } - - /** - * Given a Structure, navigate to the element given by the path and return the direct children of that element - * - * @param path The path of the element within the structure to get the children for - * @return A List containing the element children (all of them are Elements) - */ - public static List getChildList(StructureDefinition profile, String path) { - List res = new ArrayList(); - - for (ElementDefinition e : profile.getSnapshot().getElement()) - { - String p = e.getPath(); - - if (!Utilities.noString(e.getContentReference()) && path.startsWith(p)) - { - if (path.length() > p.length()) - return getChildList(profile, e.getContentReference()+"."+path.substring(p.length()+1)); - else - return getChildList(profile, e.getContentReference()); - } - else if (p.startsWith(path+".") && !p.equals(path)) - { - String tail = p.substring(path.length()+1); - if (!tail.contains(".")) { - res.add(e); - } - } - - } - - return res; - } - - public static List getChildMap(StructureDefinition profile, ElementDefinition element) throws DefinitionException { - return getChildMap(profile, element.getName(), element.getPath(), element.getContentReference()); - } - -/** - * Given a Structure, navigate to the element given by the path and return the direct children of that element - * - * @param path The path of the element within the structure to get the children for - * @return A Map containing the name of the element child (not the path) and the child itself (an Element) - * @throws DefinitionException - * @throws Exception - */ - public static List getChildMap(StructureDefinition profile, String name, String path, String contentReference) throws DefinitionException { - List res = new ArrayList(); - - // if we have a name reference, we have to find it, and iterate it's children - if (contentReference != null) { - boolean found = false; - for (ElementDefinition e : profile.getSnapshot().getElement()) { - if (contentReference.equals("#"+e.getId())) { - found = true; - path = e.getPath(); - } - } - if (!found) - throw new DefinitionException("Unable to resolve name reference "+contentReference+" at path "+path); - } - - for (ElementDefinition e : profile.getSnapshot().getElement()) - { - String p = e.getPath(); - - if (path != null && !Utilities.noString(e.getContentReference()) && path.startsWith(p)) - { - /* The path we are navigating to is on or below this element, but the element defers its definition to another named part of the - * structure. - */ - if (path.length() > p.length()) - { - // The path navigates further into the referenced element, so go ahead along the path over there - return getChildMap(profile, name, e.getContentReference()+"."+path.substring(p.length()+1), null); - } - else - { - // The path we are looking for is actually this element, but since it defers it definition, go get the referenced element - return getChildMap(profile, name, e.getContentReference(), null); - } - } - else if (p.startsWith(path+".")) - { - // The path of the element is a child of the path we're looking for (i.e. the parent), - // so add this element to the result. - String tail = p.substring(path.length()+1); - - // Only add direct children, not any deeper paths - if (!tail.contains(".")) { - res.add(e); - } - } - } - - return res; - } - - public static boolean isPrimitive(String value) { - return value == null || Utilities.existsInListNC(value, "boolean", "integer", "decimal", "base64Binary", "instant", "string", "date", "dateTime", "code", "oid", "uuid", "id", "uri"); - } - - public static String typeCode(List types) { - StringBuilder b = new StringBuilder(); - boolean first = true; - for (TypeRefComponent type : types) { - if (first) first = false; else b.append(", "); - b.append(type.getCode()); - if (type.hasProfile()) - b.append("{"+type.getProfile()+"}"); - } - return b.toString(); - } - - - public interface ProfileKnowledgeProvider { - String getLinkFor(String typeSimple); - - String getLinkForProfile(StructureDefinition profile, String url); - - boolean hasLinkFor(String typeSimple); - - boolean isDatatype(String typeSimple); - - boolean isResource(String typeSimple); - - BindingResolution resolveBinding(ElementDefinitionBindingComponent binding); - - public class BindingResolution { - public String display; - public String url; - } - } - - public class ExtensionContext { - - private ElementDefinition element; - private StructureDefinition defn; - - public ExtensionContext(StructureDefinition ext, ElementDefinition ed) { - this.defn = ext; - this.element = ed; - } - - public StructureDefinition getDefn() { - return defn; - } - - public ElementDefinition getElement() { - return element; - } - - public ElementDefinition getExtensionValueDefinition() { - int i = defn.getSnapshot().getElement().indexOf(element)+1; - while (i < defn.getSnapshot().getElement().size()) { - ElementDefinition ed = defn.getSnapshot().getElement().get(i); - if (ed.getPath().equals(element.getPath())) - return null; - if (ed.getPath().startsWith(element.getPath()+".value")) - return ed; - i++; - } - return null; - } - - public String getUrl() { - if (element == defn.getSnapshot().getElement().get(0)) - return defn.getUrl(); - else - return element.getName(); - } - - } - - // generate schematroins for the rules in a structure definition - - private class UnusedTracker { - private boolean used; - } - - private class Slicer extends ElementDefinitionSlicingComponent { - String criteria = ""; - String name = ""; - boolean check; - public Slicer(boolean cantCheck) { - super(); - this.check = cantCheck; - } - } - - public static class ElementDefinitionHolder { - private String name; - private ElementDefinition self; - private int baseIndex = 0; - private List children; - - public ElementDefinitionHolder(ElementDefinition self) { - super(); - this.self = self; - this.name = self.getPath(); - children = new ArrayList(); - } - - public int getBaseIndex() { - return baseIndex; - } - - public void setBaseIndex(int baseIndex) { - this.baseIndex = baseIndex; - } - - public List getChildren() { - return children; - } - - public ElementDefinition getSelf() { - return self; - } - - } - - public static class ElementDefinitionComparer implements Comparator { - - private boolean inExtension; - private List snapshot; - private int prefixLength; - private String base; - private String name; - private Set errors = new HashSet(); - - public ElementDefinitionComparer(boolean inExtension, List snapshot, String base, int prefixLength, String name) { - this.inExtension = inExtension; - this.snapshot = snapshot; - this.prefixLength = prefixLength; - this.base = base; - this.name = name; - } - - public void checkForErrors(List errorList) { - if (errors.size() > 0) { -// CommaSeparatedStringBuilder b = new CommaSeparatedStringBuilder(); -// for (String s : errors) -// b.append("StructureDefinition "+name+": "+s); -// throw new DefinitionException(b.toString()); - for (String s : errors) - if (s.startsWith("!")) - errorList.add("!StructureDefinition "+name+": "+s.substring(1)); - else - errorList.add("StructureDefinition "+name+": "+s); - } - } - - @Override - public int compare(ElementDefinitionHolder o1, ElementDefinitionHolder o2) { - if (o1.getBaseIndex() == 0) - o1.setBaseIndex(find(o1.getSelf().getPath())); - if (o2.getBaseIndex() == 0) - o2.setBaseIndex(find(o2.getSelf().getPath())); - return o1.getBaseIndex() - o2.getBaseIndex(); - } - - private int find(String path) { - String actual = base+path.substring(prefixLength); - for (int i = 0; i < snapshot.size(); i++) { - String p = snapshot.get(i).getPath(); - if (p.equals(actual)) - return i; - if (p.endsWith("[x]") && actual.startsWith(p.substring(0, p.length()-3)) && !(actual.endsWith("[x]")) && !actual.substring(p.length()-3).contains(".")) - return i; - } - if (prefixLength == 0) - errors.add("Differential contains path "+path+" which is not found in the base"); - else - errors.add("Differential contains path "+path+" which is actually "+actual+", which is not found in the base"); - return 0; - } - } - - /** - * First compare element by path then by name if same - */ - private static class ElementNameCompare implements Comparator { - - @Override - public int compare(ElementDefinition o1, ElementDefinition o2) { - String path1 = normalizePath(o1); - String path2 = normalizePath(o2); - int cmp = path1.compareTo(path2); - if (cmp == 0) { - String name1 = o1.hasName() ? o1.getName() : ""; - String name2 = o2.hasName() ? o2.getName() : ""; - cmp = name1.compareTo(name2); - } - return cmp; - } - - private static String normalizePath(ElementDefinition e) { - if (!e.hasPath()) return ""; - String path = e.getPath(); - // if sorting element names make sure onset[x] appears before onsetAge, onsetDate, etc. - // so strip off the [x] suffix when comparing the path names. - if (path.endsWith("[x]")) { - path = path.substring(0, path.length()-3); - } - return path; - } - - } - -// -//private void generateForChild(TextStreamWriter txt, -// StructureDefinition structure, ElementDefinition child) { -// // TODO Auto-generated method stub -// -//} - - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/ToolingExtensions.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/ToolingExtensions.java deleted file mode 100644 index 38030a4422e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/ToolingExtensions.java +++ /dev/null @@ -1,500 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import java.net.URISyntaxException; - -/* -Copyright (c) 2011+, HL7, Inc -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of HL7 nor the names of its contributors may be used to - endorse or promote products derived from this software without specific - prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - - */ - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.apache.commons.lang3.StringUtils; -import org.hl7.fhir.dstu2016may.model.BooleanType; -import org.hl7.fhir.dstu2016may.model.CodeSystem; -import org.hl7.fhir.dstu2016may.model.CodeSystem.ConceptDefinitionComponent; -import org.hl7.fhir.dstu2016may.model.CodeType; -import org.hl7.fhir.dstu2016may.model.CodeableConcept; -import org.hl7.fhir.dstu2016may.model.Coding; -import org.hl7.fhir.dstu2016may.model.DataElement; -import org.hl7.fhir.dstu2016may.model.DomainResource; -import org.hl7.fhir.dstu2016may.model.Element; -import org.hl7.fhir.dstu2016may.model.ElementDefinition; -import org.hl7.fhir.dstu2016may.model.Extension; -import org.hl7.fhir.dstu2016may.model.ExtensionHelper; -import org.hl7.fhir.dstu2016may.model.Factory; -import org.hl7.fhir.dstu2016may.model.Identifier; -import org.hl7.fhir.dstu2016may.model.IntegerType; -import org.hl7.fhir.dstu2016may.model.MarkdownType; -import org.hl7.fhir.dstu2016may.model.PrimitiveType; -import org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemComponent; -import org.hl7.fhir.dstu2016may.model.Questionnaire.QuestionnaireItemType; -import org.hl7.fhir.dstu2016may.model.StringType; -import org.hl7.fhir.dstu2016may.model.Type; -import org.hl7.fhir.dstu2016may.model.UriType; -import org.hl7.fhir.dstu2016may.model.ValueSet; -import org.hl7.fhir.exceptions.FHIRFormatError; -import org.hl7.fhir.utilities.validation.ValidationMessage.Source; - - -public class ToolingExtensions { - - // validated - public static final String EXT_SUBSUMES = "http://hl7.org/fhir/StructureDefinition/codesystem-subsumes"; - private static final String EXT_OID = "http://hl7.org/fhir/StructureDefinition/valueset-oid"; -// public static final String EXT_DEPRECATED = "http://hl7.org/fhir/StructureDefinition/codesystem-deprecated"; - public static final String EXT_DEFINITION = "http://hl7.org/fhir/StructureDefinition/valueset-definition"; - public static final String EXT_COMMENT = "http://hl7.org/fhir/StructureDefinition/valueset-comments"; - private static final String EXT_IDENTIFIER = "http://hl7.org/fhir/StructureDefinition/identifier"; - private static final String EXT_TRANSLATION = "http://hl7.org/fhir/StructureDefinition/translation"; - public static final String EXT_ISSUE_SOURCE = "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-source"; - public static final String EXT_DISPLAY_HINT = "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint"; - public static final String EXT_REPLACED_BY = "http://hl7.org/fhir/StructureDefinition/valueset-replacedby"; - public static final String EXT_JSON_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type"; - public static final String EXT_XML_TYPE = "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type"; - public static final String EXT_REGEX = "http://hl7.org/fhir/StructureDefinition/structuredefinition-regex"; - public static final String EXT_CONTROL = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"; - public static final String EXT_MINOCCURS = "http://hl7.org/fhir/StructureDefinition/questionnaire-minOccurs"; - public static final String EXT_MAXOCCURS = "http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs"; - public static final String EXT_ALLOWEDRESOURCE = "http://hl7.org/fhir/StructureDefinition/questionnaire-allowedResource"; - public static final String EXT_REFERENCEFILTER = "http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter"; - - // unregistered? - -// public static final String EXT_FLYOVER = "http://hl7.org/fhir/Profile/questionnaire-extensions#flyover"; -// private static final String EXT_QTYPE = "http://www.healthintersections.com.au/fhir/Profile/metadata#type"; -// private static final String EXT_QREF = "http://www.healthintersections.com.au/fhir/Profile/metadata#reference"; -// private static final String EXTENSION_FILTER_ONLY = "http://www.healthintersections.com.au/fhir/Profile/metadata#expandNeedsFilter"; -// private static final String EXT_TYPE = "http://www.healthintersections.com.au/fhir/Profile/metadata#type"; -// private static final String EXT_REFERENCE = "http://www.healthintersections.com.au/fhir/Profile/metadata#reference"; - private static final String EXT_FHIRTYPE = "http://hl7.org/fhir/StructureDefinition/questionnaire-fhirType"; - private static final String EXT_ALLOWABLE_UNITS = "http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits"; - public static final String EXT_CIMI_REFERENCE = "http://hl7.org/fhir/StructureDefinition/cimi-reference"; - public static final String EXT_UNCLOSED = "http://hl7.org/fhir/StructureDefinition/valueset-unclosed"; - public static final String EXT_FMM_LEVEL = "http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm"; - - - // specific extension helpers - - public static Extension makeIssueSource(Source source) { - Extension ex = new Extension(); - // todo: write this up and get it published with the pack (and handle the redirect?) - ex.setUrl(ToolingExtensions.EXT_ISSUE_SOURCE); - CodeType c = new CodeType(); - c.setValue(source.toString()); - ex.setValue(c); - return ex; - } - - public static boolean hasExtension(DomainResource de, String url) { - return getExtension(de, url) != null; - } - - public static boolean hasExtension(Element e, String url) { - return getExtension(e, url) != null; - } - - public static void addStringExtension(DomainResource dr, String url, String content) { - if (!StringUtils.isBlank(content)) { - Extension ex = getExtension(dr, url); - if (ex != null) - ex.setValue(new StringType(content)); - else - dr.getExtension().add(Factory.newExtension(url, new StringType(content), true)); - } - } - - public static void addMarkdownExtension(DomainResource dr, String url, String content) { - if (!StringUtils.isBlank(content)) { - Extension ex = getExtension(dr, url); - if (ex != null) - ex.setValue(new StringType(content)); - else - dr.getExtension().add(Factory.newExtension(url, new MarkdownType(content), true)); - } - } - - public static void addStringExtension(Element e, String url, String content) { - if (!StringUtils.isBlank(content)) { - Extension ex = getExtension(e, url); - if (ex != null) - ex.setValue(new StringType(content)); - else - e.getExtension().add(Factory.newExtension(url, new StringType(content), true)); - } - } - - public static void addIntegerExtension(DomainResource dr, String url, int value) { - Extension ex = getExtension(dr, url); - if (ex != null) - ex.setValue(new IntegerType(value)); - else - dr.getExtension().add(Factory.newExtension(url, new IntegerType(value), true)); - } - - public static void addComment(Element nc, String comment) { - if (!StringUtils.isBlank(comment)) - nc.getExtension().add(Factory.newExtension(EXT_COMMENT, Factory.newString_(comment), true)); - } - -// public static void markDeprecated(Element nc) { -// setDeprecated(nc); -// } -// - public static void addSubsumes(ConceptDefinitionComponent nc, String code) { - nc.getModifierExtension().add(Factory.newExtension(EXT_SUBSUMES, Factory.newCode(code), true)); - } - - public static void addDefinition(Element nc, String definition) { - if (!StringUtils.isBlank(definition)) - nc.getExtension().add(Factory.newExtension(EXT_DEFINITION, Factory.newString_(definition), true)); - } - - public static void addDisplayHint(Element def, String hint) { - if (!StringUtils.isBlank(hint)) - def.getExtension().add(Factory.newExtension(EXT_DISPLAY_HINT, Factory.newString_(hint), true)); - } - - public static String getDisplayHint(Element def) { - return readStringExtension(def, EXT_DISPLAY_HINT); - } - - public static String readStringExtension(Element c, String uri) { - Extension ex = ExtensionHelper.getExtension(c, uri); - if (ex == null) - return null; - if (ex.getValue() instanceof UriType) - return ((UriType) ex.getValue()).getValue(); - if (!(ex.getValue() instanceof StringType)) - return null; - return ((StringType) ex.getValue()).getValue(); - } - - public static String readStringExtension(DomainResource c, String uri) { - Extension ex = getExtension(c, uri); - if (ex == null) - return null; - if ((ex.getValue() instanceof StringType)) - return ((StringType) ex.getValue()).getValue(); - if ((ex.getValue() instanceof UriType)) - return ((UriType) ex.getValue()).getValue(); - if ((ex.getValue() instanceof MarkdownType)) - return ((MarkdownType) ex.getValue()).getValue(); - return null; - } - - @SuppressWarnings("unchecked") - public static PrimitiveType readPrimitiveExtension(DomainResource c, String uri) { - Extension ex = getExtension(c, uri); - if (ex == null) - return null; - return (PrimitiveType) ex.getValue(); - } - - public static boolean findStringExtension(Element c, String uri) { - Extension ex = ExtensionHelper.getExtension(c, uri); - if (ex == null) - return false; - if (!(ex.getValue() instanceof StringType)) - return false; - return !StringUtils.isBlank(((StringType) ex.getValue()).getValue()); - } - - public static Boolean readBooleanExtension(Element c, String uri) { - Extension ex = ExtensionHelper.getExtension(c, uri); - if (ex == null) - return null; - if (!(ex.getValue() instanceof BooleanType)) - return null; - return ((BooleanType) ex.getValue()).getValue(); - } - - public static boolean findBooleanExtension(Element c, String uri) { - Extension ex = ExtensionHelper.getExtension(c, uri); - if (ex == null) - return false; - if (!(ex.getValue() instanceof BooleanType)) - return false; - return true; - } - - public static String getComment(ConceptDefinitionComponent c) { - return readStringExtension(c, EXT_COMMENT); - } -// -// public static Boolean getDeprecated(Element c) { -// return readBooleanExtension(c, EXT_DEPRECATED); -// } - - public static boolean hasComment(ConceptDefinitionComponent c) { - return findStringExtension(c, EXT_COMMENT); - } - -// public static boolean hasDeprecated(Element c) { -// return findBooleanExtension(c, EXT_DEPRECATED); -// } - - public static List getSubsumes(ConceptDefinitionComponent c) { - List res = new ArrayList(); - - for (Extension e : c.getExtension()) { - if (EXT_SUBSUMES.equals(e.getUrl())) - res.add((CodeType) e.getValue()); - } - return res; - } - - public static void addFlyOver(QuestionnaireItemComponent item, String text){ - if (!StringUtils.isBlank(text)) { - QuestionnaireItemComponent display = item.addItem(); - display.setType(QuestionnaireItemType.DISPLAY); - display.setText(text); - display.getExtension().add(Factory.newExtension(EXT_CONTROL, Factory.newCodeableConcept("flyover", "http://hl7.org/fhir/questionnaire-item-control", "Fly-over"), true)); - } - } - - public static void addMin(QuestionnaireItemComponent item, int min) { - item.getExtension().add(Factory.newExtension(EXT_MINOCCURS, Factory.newInteger(min), true)); - } - - public static void addMax(QuestionnaireItemComponent item, int max) { - item.getExtension().add(Factory.newExtension(EXT_MAXOCCURS, Factory.newInteger(max), true)); - } - - public static void addFhirType(QuestionnaireItemComponent group, String value) { - group.getExtension().add(Factory.newExtension(EXT_FHIRTYPE, Factory.newString_(value), true)); - } - - public static void addControl(QuestionnaireItemComponent group, String value) { - group.getExtension().add(Factory.newExtension(EXT_CONTROL, Factory.newCodeableConcept(value, "http://hl7.org/fhir/questionnaire-item-control", value), true)); - } - - public static void addAllowedResource(QuestionnaireItemComponent group, String value) { - group.getExtension().add(Factory.newExtension(EXT_ALLOWEDRESOURCE, Factory.newCode(value), true)); - } - - public static void addReferenceFilter(QuestionnaireItemComponent group, String value) { - group.getExtension().add(Factory.newExtension(EXT_REFERENCEFILTER, Factory.newString_(value), true)); - } - - public static void addIdentifier(Element element, Identifier value) { - element.getExtension().add(Factory.newExtension(EXT_IDENTIFIER, value, true)); - } - - /** - * @param name the identity of the extension of interest - * @return The extension, if on this element, else null - */ - public static Extension getExtension(DomainResource resource, String name) { - if (name == null) - return null; - if (!resource.hasExtension()) - return null; - for (Extension e : resource.getExtension()) { - if (name.equals(e.getUrl())) - return e; - } - return null; - } - - public static Extension getExtension(Element el, String name) { - if (name == null) - return null; - if (!el.hasExtension()) - return null; - for (Extension e : el.getExtension()) { - if (name.equals(e.getUrl())) - return e; - } - return null; - } - - public static void setStringExtension(DomainResource resource, String uri, String value) { - Extension ext = getExtension(resource, uri); - if (ext != null) - ext.setValue(new StringType(value)); - else - resource.getExtension().add(new Extension(new UriType(uri)).setValue(new StringType(value))); - } - - public static String getOID(CodeSystem define) { - return readStringExtension(define, EXT_OID); - } - - public static String getOID(ValueSet vs) { - return readStringExtension(vs, EXT_OID); - } - - public static void setOID(CodeSystem define, String oid) throws FHIRFormatError, URISyntaxException { - if (!oid.startsWith("urn:oid:")) - throw new FHIRFormatError("Error in OID format"); - if (oid.startsWith("urn:oid:urn:oid:")) - throw new FHIRFormatError("Error in OID format"); - if (!hasExtension(define, EXT_OID)) - define.getExtension().add(Factory.newExtension(EXT_OID, Factory.newUri(oid), false)); - else if (!oid.equals(readStringExtension(define, EXT_OID))) - throw new Error("Attempt to assign multiple OIDs to a code system"); - } - public static void setOID(ValueSet vs, String oid) throws FHIRFormatError, URISyntaxException { - if (!oid.startsWith("urn:oid:")) - throw new FHIRFormatError("Error in OID format"); - if (oid.startsWith("urn:oid:urn:oid:")) - throw new FHIRFormatError("Error in OID format"); - if (!hasExtension(vs, EXT_OID)) - vs.getExtension().add(Factory.newExtension(EXT_OID, Factory.newUri(oid), false)); - else if (!oid.equals(readStringExtension(vs, EXT_OID))) - throw new Error("Attempt to assign multiple OIDs to value set "+vs.getName()+" ("+vs.getUrl()+"). Has "+readStringExtension(vs, EXT_OID)+", trying to add "+oid); - } - - public static boolean hasLanguageTranslation(Element element, String lang) { - for (Extension e : element.getExtension()) { - if (e.getUrl().equals(EXT_TRANSLATION)) { - Extension e1 = ExtensionHelper.getExtension(e, "lang"); - - if (e1 != null && e1.getValue() instanceof CodeType && ((CodeType) e.getValue()).getValue().equals(lang)) - return true; - } - } - return false; - } - - public static String getLanguageTranslation(Element element, String lang) { - for (Extension e : element.getExtension()) { - if (e.getUrl().equals(EXT_TRANSLATION)) { - Extension e1 = ExtensionHelper.getExtension(e, "lang"); - - if (e1 != null && e1.getValue() instanceof CodeType && ((CodeType) e.getValue()).getValue().equals(lang)) { - e1 = ExtensionHelper.getExtension(e, "content"); - return ((StringType) e.getValue()).getValue(); - } - } - } - return null; - } - - public static void addLanguageTranslation(Element element, String lang, String value) { - Extension extension = new Extension().setUrl(EXT_TRANSLATION); - extension.addExtension().setUrl("lang").setValue(new StringType(lang)); - extension.addExtension().setUrl("content").setValue(new StringType(value)); - element.getExtension().add(extension); - } - - public static Type getAllowedUnits(ElementDefinition eld) { - for (Extension e : eld.getExtension()) - if (e.getUrl().equals(EXT_ALLOWABLE_UNITS)) - return e.getValue(); - return null; - } - - public static void setAllowableUnits(ElementDefinition eld, CodeableConcept cc) { - for (Extension e : eld.getExtension()) - if (e.getUrl().equals(EXT_ALLOWABLE_UNITS)) { - e.setValue(cc); - return; - } - eld.getExtension().add(new Extension().setUrl(EXT_ALLOWABLE_UNITS).setValue(cc)); - } - - public static List getExtensions(Element element, String url) { - List results = new ArrayList(); - for (Extension ex : element.getExtension()) - if (ex.getUrl().equals(url)) - results.add(ex); - return results; - } - - public static List getExtensions(DomainResource resource, String url) { - List results = new ArrayList(); - for (Extension ex : resource.getExtension()) - if (ex.getUrl().equals(url)) - results.add(ex); - return results; - } - - public static void addDEReference(DataElement de, String value) { - for (Extension e : de.getExtension()) - if (e.getUrl().equals(EXT_CIMI_REFERENCE)) { - e.setValue(new UriType(value)); - return; - } - de.getExtension().add(new Extension().setUrl(EXT_CIMI_REFERENCE).setValue(new UriType(value))); - } - -// public static void setDeprecated(Element nc) { -// for (Extension e : nc.getExtension()) -// if (e.getUrl().equals(EXT_DEPRECATED)) { -// e.setValue(new BooleanType(true)); -// return; -// } -// nc.getExtension().add(new Extension().setUrl(EXT_DEPRECATED).setValue(new BooleanType(true))); -// } - - public static void setExtension(Element focus, String url, Coding c) { - for (Extension e : focus.getExtension()) - if (e.getUrl().equals(url)) { - e.setValue(c); - return; - } - focus.getExtension().add(new Extension().setUrl(url).setValue(c)); - } - - public static void removeExtension(DomainResource focus, String url) { - Iterator i = focus.getExtension().iterator(); - while (i.hasNext()) { - Extension e = i.next(); // must be called before you can call i.remove() - if (e.getUrl().equals(url)) { - i.remove(); - } - } - } - - public static void removeExtension(Element focus, String url) { - Iterator i = focus.getExtension().iterator(); - while (i.hasNext()) { - Extension e = i.next(); // must be called before you can call i.remove() - if (e.getUrl().equals(url)) { - i.remove(); - } - } - } - - public static boolean hasOID(ValueSet vs) { - return hasExtension(vs, EXT_OID); - } - - - public static void setStringExtension(Element element, String uri, String value) { - Extension ext = getExtension(element, uri); - if (ext != null) - ext.setValue(new StringType(value)); - else - element.getExtension().add(new Extension(new UriType(uri)).setValue(new StringType(value))); - } - -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/XmlLocationAnnotator.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/XmlLocationAnnotator.java deleted file mode 100644 index e8aa35b3217..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/XmlLocationAnnotator.java +++ /dev/null @@ -1,102 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -import java.util.Stack; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.UserDataHandler; -import org.w3c.dom.events.Event; -import org.w3c.dom.events.EventListener; -import org.w3c.dom.events.EventTarget; -import org.w3c.dom.events.MutationEvent; -import org.xml.sax.Attributes; -import org.xml.sax.Locator; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.LocatorImpl; -import org.xml.sax.helpers.XMLFilterImpl; - -// http://javacoalface.blogspot.com.au/2011/04/line-and-column-numbers-in-xml-dom.html - -public class XmlLocationAnnotator extends XMLFilterImpl { - - private Locator locator; - private Stack locatorStack = new Stack(); - private Stack elementStack = new Stack(); - private UserDataHandler dataHandler = new LocationDataHandler(); - - public XmlLocationAnnotator(XMLReader xmlReader, Document dom) { - super(xmlReader); - - // Add listener to DOM, so we know which node was added. - EventListener modListener = new EventListener() { - @Override - public void handleEvent(Event e) { - EventTarget target = ((MutationEvent) e).getTarget(); - elementStack.push((Element) target); - } - }; - ((EventTarget) dom).addEventListener("DOMNodeInserted", modListener, true); - } - - @Override - public void setDocumentLocator(Locator locator) { - super.setDocumentLocator(locator); - this.locator = locator; - } - - @Override - public void startElement(String uri, String localName, - String qName, Attributes atts) throws SAXException { - super.startElement(uri, localName, qName, atts); - - // Keep snapshot of start location, - // for later when end of element is found. - locatorStack.push(new LocatorImpl(locator)); - } - - @Override - public void endElement(String uri, String localName, String qName) - throws SAXException { - - // Mutation event fired by the adding of element end, - // and so lastAddedElement will be set. - super.endElement(uri, localName, qName); - - if (locatorStack.size() > 0) { - Locator startLocator = locatorStack.pop(); - - XmlLocationData location = new XmlLocationData( - startLocator.getSystemId(), - startLocator.getLineNumber(), - startLocator.getColumnNumber(), - locator.getLineNumber(), - locator.getColumnNumber()); - Element lastAddedElement = elementStack.pop(); - - lastAddedElement.setUserData( - XmlLocationData.LOCATION_DATA_KEY, location, - dataHandler); - } - } - - // Ensure location data copied to any new DOM node. - private class LocationDataHandler implements UserDataHandler { - - @Override - public void handle(short operation, String key, Object data, - Node src, Node dst) { - - if (src != null && dst != null) { - XmlLocationData locatonData = (XmlLocationData) - src.getUserData(XmlLocationData.LOCATION_DATA_KEY); - - if (locatonData != null) { - dst.setUserData(XmlLocationData.LOCATION_DATA_KEY, - locatonData, dataHandler); - } - } - } - } -} diff --git a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/XmlLocationData.java b/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/XmlLocationData.java deleted file mode 100644 index e8993ef819e..00000000000 --- a/hapi-fhir-structures-dstu2.1/src/main/oldjava/org/hl7/fhir/dstu2016may/utils/XmlLocationData.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.hl7.fhir.dstu2016may.utils; - -public class XmlLocationData { - - public static final String LOCATION_DATA_KEY = "locationDataKey"; - - private final String systemId; - private final int startLine; - private final int startColumn; - private final int endLine; - private final int endColumn; - - public XmlLocationData(String systemId, int startLine, - int startColumn, int endLine, int endColumn) { - super(); - this.systemId = systemId; - this.startLine = startLine; - this.startColumn = startColumn; - this.endLine = endLine; - this.endColumn = endColumn; - } - - public String getSystemId() { - return systemId; - } - - public int getStartLine() { - return startLine; - } - - public int getStartColumn() { - return startColumn; - } - - public int getEndLine() { - return endLine; - } - - public int getEndColumn() { - return endColumn; - } - - @Override - public String toString() { - return getSystemId() + "[line " + startLine + ":" - + startColumn + " to line " + endLine + ":" - + endColumn + "]"; - } -} diff --git a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/XmlUtilDstu3Test.java b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/XmlUtilDstu3Test.java index 562eb43e5af..7abc1d22e0b 100644 --- a/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/XmlUtilDstu3Test.java +++ b/hapi-fhir-structures-dstu3/src/test/java/ca/uhn/fhir/util/XmlUtilDstu3Test.java @@ -1,11 +1,14 @@ package ca.uhn.fhir.util; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.fail; +import javax.xml.parsers.ParserConfigurationException; import javax.xml.stream.FactoryConfigurationError; import javax.xml.stream.XMLStreamException; import org.hl7.fhir.dstu3.model.Patient; +import org.hl7.fhir.utilities.xml.XMLUtil; import org.junit.*; import ca.uhn.fhir.context.ConfigurationException; @@ -68,6 +71,14 @@ public class XmlUtilDstu3Test { } } + @Test + public void testApplyUnsupportedFeature() { + assertNotNull(XmlUtil.newDocumentBuilderFactory()); + + XmlUtil.setThrowExceptionForUnitTest(new ParserConfigurationException("AA")); + assertNotNull(XmlUtil.newDocumentBuilderFactory()); + } + @AfterClass public static void afterClassClearContext() { TestUtil.clearAllStaticFieldsForUnitTest(); diff --git a/hapi-fhir-structures-r4/src/test/java/org/hl7/fhir/r4/test/support/TestingUtilities.java b/hapi-fhir-structures-r4/src/test/java/org/hl7/fhir/r4/test/support/TestingUtilities.java index 1d9860f59a6..64644ebbb90 100644 --- a/hapi-fhir-structures-r4/src/test/java/org/hl7/fhir/r4/test/support/TestingUtilities.java +++ b/hapi-fhir-structures-r4/src/test/java/org/hl7/fhir/r4/test/support/TestingUtilities.java @@ -1,295 +1,273 @@ -package org.hl7.fhir.r4.test.support; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; - -import org.apache.commons.codec.binary.Base64; -import org.hl7.fhir.r4.context.IWorkerContext; -import org.hl7.fhir.utilities.CSFile; -import org.hl7.fhir.utilities.TextFile; -import org.hl7.fhir.utilities.Utilities; -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NamedNodeMap; -import org.w3c.dom.Node; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonNull; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import com.google.gson.JsonSyntaxException; - -public class TestingUtilities { - private static final boolean SHOW_DIFF = true; - - static public IWorkerContext context; - static public boolean silent; - - static public String fixedpath; - - public static String home() { - if (fixedpath != null) - return fixedpath; - String s = System.getenv("FHIR_HOME"); - if (!Utilities.noString(s)) - return s; - s = "C:\\work\\org.hl7.fhir\\build"; - if (new File(s).exists()) - return s; - throw new Error("FHIR Home directory not configured"); - } - - // diretory that contains all the US implementation guides - public static String us() { - if (fixedpath != null) - return fixedpath; - String s = System.getenv("FHIR_HOME"); - if (!Utilities.noString(s)) - return s; - s = "C:\\work\\org.hl7.fhir.us"; - if (new File(s).exists()) - return s; - throw new Error("FHIR US directory not configured"); - } - - public static String checkXMLIsSame(InputStream f1, InputStream f2) throws Exception { - String result = compareXml(f1, f2); - return result; - } - - public static String checkXMLIsSame(String f1, String f2) throws Exception { - String result = compareXml(f1, f2); - if (result != null && SHOW_DIFF) { - String diff = Utilities.path(System.getenv("ProgramFiles(X86)"), "WinMerge", "WinMergeU.exe"); - List command = new ArrayList(); - command.add("\"" + diff + "\" \"" + f1 + "\" \"" + f2 + "\""); - - ProcessBuilder builder = new ProcessBuilder(command); - builder.directory(new CSFile("c:\\temp")); - builder.start(); - - } - return result; - } - - private static String compareXml(InputStream f1, InputStream f2) throws Exception { - return compareElements("", loadXml(f1).getDocumentElement(), loadXml(f2).getDocumentElement()); - } - - private static String compareXml(String f1, String f2) throws Exception { - return compareElements("", loadXml(f1).getDocumentElement(), loadXml(f2).getDocumentElement()); - } - - private static String compareElements(String path, Element e1, Element e2) { - if (!e1.getNamespaceURI().equals(e2.getNamespaceURI())) - return "Namespaces differ at "+path+": "+e1.getNamespaceURI()+"/"+e2.getNamespaceURI(); - if (!e1.getLocalName().equals(e2.getLocalName())) - return "Names differ at "+path+": "+e1.getLocalName()+"/"+e2.getLocalName(); - path = path + "/"+e1.getLocalName(); - String s = compareAttributes(path, e1.getAttributes(), e2.getAttributes()); - if (!Utilities.noString(s)) - return s; - s = compareAttributes(path, e2.getAttributes(), e1.getAttributes()); - if (!Utilities.noString(s)) - return s; - - Node c1 = e1.getFirstChild(); - Node c2 = e2.getFirstChild(); - c1 = skipBlankText(c1); - c2 = skipBlankText(c2); - while (c1 != null && c2 != null) { - if (c1.getNodeType() != c2.getNodeType()) - return "node type mismatch in children of "+path+": "+Integer.toString(e1.getNodeType())+"/"+Integer.toString(e2.getNodeType()); - if (c1.getNodeType() == Node.TEXT_NODE) { - if (!normalise(c1.getTextContent()).equals(normalise(c2.getTextContent()))) - return "Text differs at "+path+": "+normalise(c1.getTextContent()) +"/"+ normalise(c2.getTextContent()); - } - else if (c1.getNodeType() == Node.ELEMENT_NODE) { - s = compareElements(path, (Element) c1, (Element) c2); - if (!Utilities.noString(s)) - return s; - } - - c1 = skipBlankText(c1.getNextSibling()); - c2 = skipBlankText(c2.getNextSibling()); - } - if (c1 != null) - return "node mismatch - more nodes in source in children of "+path; - if (c2 != null) - return "node mismatch - more nodes in target in children of "+path; - return null; - } - - private static Object normalise(String text) { - String result = text.trim().replace('\r', ' ').replace('\n', ' ').replace('\t', ' '); - while (result.contains(" ")) - result = result.replace(" ", " "); - return result; - } - - private static String compareAttributes(String path, NamedNodeMap src, NamedNodeMap tgt) { - for (int i = 0; i < src.getLength(); i++) { - - Node sa = src.item(i); - String sn = sa.getNodeName(); - if (! (sn.equals("xmlns") || sn.startsWith("xmlns:"))) { - Node ta = tgt.getNamedItem(sn); - if (ta == null) - return "Attributes differ at "+path+": missing attribute "+sn; - if (!normalise(sa.getTextContent()).equals(normalise(ta.getTextContent()))) { - byte[] b1 = unBase64(sa.getTextContent()); - byte[] b2 = unBase64(ta.getTextContent()); - if (!sameBytes(b1, b2)) - return "Attributes differ at "+path+": value "+normalise(sa.getTextContent()) +"/"+ normalise(ta.getTextContent()); - } - } - } - return null; - } - - private static boolean sameBytes(byte[] b1, byte[] b2) { - if (b1.length == 0 || b2.length == 0) - return false; - if (b1.length != b2.length) - return false; - for (int i = 0; i < b1.length; i++) - if (b1[i] != b2[i]) - return false; - return true; - } - - private static byte[] unBase64(String text) { - return Base64.decodeBase64(text); - } - - private static Node skipBlankText(Node node) { - while (node != null && (((node.getNodeType() == Node.TEXT_NODE) && Utilities.isWhitespace(node.getTextContent())) || (node.getNodeType() == Node.COMMENT_NODE))) - node = node.getNextSibling(); - return node; - } - - private static Document loadXml(String fn) throws Exception { - return loadXml(new FileInputStream(fn)); - } - - private static Document loadXml(InputStream fn) throws Exception { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - factory.setFeature("http://xml.org/sax/features/external-general-entities", false); - factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); - factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); - factory.setXIncludeAware(false); - factory.setExpandEntityReferences(false); - - factory.setNamespaceAware(true); - DocumentBuilder builder = factory.newDocumentBuilder(); - return builder.parse(fn); - } - - public static String checkJsonIsSame(String f1, String f2) throws JsonSyntaxException, FileNotFoundException, IOException { - String result = compareJson(f1, f2); - if (result != null && SHOW_DIFF) { - String diff = Utilities.path(System.getenv("ProgramFiles(X86)"), "WinMerge", "WinMergeU.exe"); - List command = new ArrayList(); - command.add("\"" + diff + "\" \"" + f1 + "\" \"" + f2 + "\""); - - ProcessBuilder builder = new ProcessBuilder(command); - builder.directory(new CSFile("c:\\temp")); - builder.start(); - - } - return result; - } - - private static String compareJson(String f1, String f2) throws JsonSyntaxException, FileNotFoundException, IOException { - JsonObject o1 = (JsonObject) new com.google.gson.JsonParser().parse(TextFile.fileToString(f1)); - JsonObject o2 = (JsonObject) new com.google.gson.JsonParser().parse(TextFile.fileToString(f2)); - return compareObjects("", o1, o2); - } - - private static String compareObjects(String path, JsonObject o1, JsonObject o2) { - for (Map.Entry en : o1.entrySet()) { - String n = en.getKey(); - if (!n.equals("fhir_comments")) { - if (o2.has(n)) { - String s = compareNodes(path+'.'+n, en.getValue(), o2.get(n)); - if (!Utilities.noString(s)) - return s; - } - else - return "properties differ at "+path+": missing property "+n; - } - } - for (Map.Entry en : o2.entrySet()) { - String n = en.getKey(); - if (!n.equals("fhir_comments")) { - if (!o1.has(n)) - return "properties differ at "+path+": missing property "+n; - } - } - return null; - } - - private static String compareNodes(String path, JsonElement n1, JsonElement n2) { - if (n1.getClass() != n2.getClass()) - return "properties differ at "+path+": type "+n1.getClass().getName()+"/"+n2.getClass().getName(); - else if (n1 instanceof JsonPrimitive) { - JsonPrimitive p1 = (JsonPrimitive) n1; - JsonPrimitive p2 = (JsonPrimitive) n2; - if (p1.isBoolean() && p2.isBoolean()) { - if (p1.getAsBoolean() != p2.getAsBoolean()) - return "boolean property values differ at "+path+": type "+p1.getAsString()+"/"+p2.getAsString(); - } else if (p1.isString() && p2.isString()) { - String s1 = p1.getAsString(); - String s2 = p2.getAsString(); - if (!(s1.contains(" command = new ArrayList(); + command.add("\"" + diff + "\" \"" + f1 + "\" \"" + f2 + "\""); + + ProcessBuilder builder = new ProcessBuilder(command); + builder.directory(new CSFile("c:\\temp")); + builder.start(); + + } + return result; + } + + private static String compareXml(InputStream f1, InputStream f2) throws Exception { + return compareElements("", loadXml(f1).getDocumentElement(), loadXml(f2).getDocumentElement()); + } + + private static String compareXml(String f1, String f2) throws Exception { + return compareElements("", loadXml(f1).getDocumentElement(), loadXml(f2).getDocumentElement()); + } + + private static String compareElements(String path, Element e1, Element e2) { + if (!e1.getNamespaceURI().equals(e2.getNamespaceURI())) + return "Namespaces differ at " + path + ": " + e1.getNamespaceURI() + "/" + e2.getNamespaceURI(); + if (!e1.getLocalName().equals(e2.getLocalName())) + return "Names differ at " + path + ": " + e1.getLocalName() + "/" + e2.getLocalName(); + path = path + "/" + e1.getLocalName(); + String s = compareAttributes(path, e1.getAttributes(), e2.getAttributes()); + if (!Utilities.noString(s)) + return s; + s = compareAttributes(path, e2.getAttributes(), e1.getAttributes()); + if (!Utilities.noString(s)) + return s; + + Node c1 = e1.getFirstChild(); + Node c2 = e2.getFirstChild(); + c1 = skipBlankText(c1); + c2 = skipBlankText(c2); + while (c1 != null && c2 != null) { + if (c1.getNodeType() != c2.getNodeType()) + return "node type mismatch in children of " + path + ": " + Integer.toString(e1.getNodeType()) + "/" + Integer.toString(e2.getNodeType()); + if (c1.getNodeType() == Node.TEXT_NODE) { + if (!normalise(c1.getTextContent()).equals(normalise(c2.getTextContent()))) + return "Text differs at " + path + ": " + normalise(c1.getTextContent()) + "/" + normalise(c2.getTextContent()); + } else if (c1.getNodeType() == Node.ELEMENT_NODE) { + s = compareElements(path, (Element) c1, (Element) c2); + if (!Utilities.noString(s)) + return s; + } + + c1 = skipBlankText(c1.getNextSibling()); + c2 = skipBlankText(c2.getNextSibling()); + } + if (c1 != null) + return "node mismatch - more nodes in source in children of " + path; + if (c2 != null) + return "node mismatch - more nodes in target in children of " + path; + return null; + } + + private static Object normalise(String text) { + String result = text.trim().replace('\r', ' ').replace('\n', ' ').replace('\t', ' '); + while (result.contains(" ")) + result = result.replace(" ", " "); + return result; + } + + private static String compareAttributes(String path, NamedNodeMap src, NamedNodeMap tgt) { + for (int i = 0; i < src.getLength(); i++) { + + Node sa = src.item(i); + String sn = sa.getNodeName(); + if (!(sn.equals("xmlns") || sn.startsWith("xmlns:"))) { + Node ta = tgt.getNamedItem(sn); + if (ta == null) + return "Attributes differ at " + path + ": missing attribute " + sn; + if (!normalise(sa.getTextContent()).equals(normalise(ta.getTextContent()))) { + byte[] b1 = unBase64(sa.getTextContent()); + byte[] b2 = unBase64(ta.getTextContent()); + if (!sameBytes(b1, b2)) + return "Attributes differ at " + path + ": value " + normalise(sa.getTextContent()) + "/" + normalise(ta.getTextContent()); + } + } + } + return null; + } + + private static boolean sameBytes(byte[] b1, byte[] b2) { + if (b1.length == 0 || b2.length == 0) + return false; + if (b1.length != b2.length) + return false; + for (int i = 0; i < b1.length; i++) + if (b1[i] != b2[i]) + return false; + return true; + } + + private static byte[] unBase64(String text) { + return Base64.decodeBase64(text); + } + + private static Node skipBlankText(Node node) { + while (node != null && (((node.getNodeType() == Node.TEXT_NODE) && Utilities.isWhitespace(node.getTextContent())) || (node.getNodeType() == Node.COMMENT_NODE))) + node = node.getNextSibling(); + return node; + } + + private static Document loadXml(String fn) throws Exception { + return loadXml(new FileInputStream(fn)); + } + + private static Document loadXml(InputStream fn) throws Exception { + DocumentBuilderFactory factory = XmlUtil.newDocumentBuilderFactory(); + DocumentBuilder builder = factory.newDocumentBuilder(); + return builder.parse(fn); + } + + public static String checkJsonIsSame(String f1, String f2) throws JsonSyntaxException, FileNotFoundException, IOException { + String result = compareJson(f1, f2); + if (result != null && SHOW_DIFF) { + String diff = Utilities.path(System.getenv("ProgramFiles(X86)"), "WinMerge", "WinMergeU.exe"); + List command = new ArrayList(); + command.add("\"" + diff + "\" \"" + f1 + "\" \"" + f2 + "\""); + + ProcessBuilder builder = new ProcessBuilder(command); + builder.directory(new CSFile("c:\\temp")); + builder.start(); + + } + return result; + } + + private static String compareJson(String f1, String f2) throws JsonSyntaxException, FileNotFoundException, IOException { + JsonObject o1 = (JsonObject) new com.google.gson.JsonParser().parse(TextFile.fileToString(f1)); + JsonObject o2 = (JsonObject) new com.google.gson.JsonParser().parse(TextFile.fileToString(f2)); + return compareObjects("", o1, o2); + } + + private static String compareObjects(String path, JsonObject o1, JsonObject o2) { + for (Map.Entry en : o1.entrySet()) { + String n = en.getKey(); + if (!n.equals("fhir_comments")) { + if (o2.has(n)) { + String s = compareNodes(path + '.' + n, en.getValue(), o2.get(n)); + if (!Utilities.noString(s)) + return s; + } else + return "properties differ at " + path + ": missing property " + n; + } + } + for (Map.Entry en : o2.entrySet()) { + String n = en.getKey(); + if (!n.equals("fhir_comments")) { + if (!o1.has(n)) + return "properties differ at " + path + ": missing property " + n; + } + } + return null; + } + + private static String compareNodes(String path, JsonElement n1, JsonElement n2) { + if (n1.getClass() != n2.getClass()) + return "properties differ at " + path + ": type " + n1.getClass().getName() + "/" + n2.getClass().getName(); + else if (n1 instanceof JsonPrimitive) { + JsonPrimitive p1 = (JsonPrimitive) n1; + JsonPrimitive p2 = (JsonPrimitive) n2; + if (p1.isBoolean() && p2.isBoolean()) { + if (p1.getAsBoolean() != p2.getAsBoolean()) + return "boolean property values differ at " + path + ": type " + p1.getAsString() + "/" + p2.getAsString(); + } else if (p1.isString() && p2.isString()) { + String s1 = p1.getAsString(); + String s2 = p2.getAsString(); + if (!(s1.contains("\n" + + "\n" + + "]>" + + "" + + "" + + "" + + "
TEXT &xxe; TEXT
\n" + + "
" + + "
" + + "" + + "
" + + "
"; + + HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); + httpPost.setEntity(new StringEntity(encoded, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); + + try (CloseableHttpResponse status = ourClient.execute(httpPost)) { + String responseContent = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8); + + ourLog.info("Response was:\n{}", status); + ourLog.info("Response was:\n{}", responseContent); + + assertEquals(422, status.getStatusLine().getStatusCode()); + assertThat(responseContent, containsString("DOCTYPE is disallowed")); + } + + } + + @Test public void testCreateXmlInvalidInstanceValidator() throws Exception { IValidatorModule module = new FhirInstanceValidator(); @@ -192,16 +230,15 @@ public class RequestValidatingInterceptorR4Test { HttpPost httpPost = new HttpPost("http://localhost:" + ourPort + "/Patient"); httpPost.setEntity(new StringEntity(encoded, ContentType.create(Constants.CT_FHIR_XML, "UTF-8"))); - HttpResponse status = ourClient.execute(httpPost); + try (CloseableHttpResponse status = ourClient.execute(httpPost)) { + String responseContent = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8); - String responseContent = IOUtils.toString(status.getEntity().getContent(), Charsets.UTF_8); - IOUtils.closeQuietly(status.getEntity().getContent()); + ourLog.info("Response was:\n{}", status); + ourLog.info("Response was:\n{}", responseContent); - ourLog.info("Response was:\n{}", status); - ourLog.info("Response was:\n{}", responseContent); - - assertEquals(422, status.getStatusLine().getStatusCode()); - assertThat(status.toString(), containsString("X-FHIR-Request-Validation")); + assertEquals(422, status.getStatusLine().getStatusCode()); + assertThat(status.toString(), containsString("X-FHIR-Request-Validation")); + } } @Test diff --git a/lgtm.yml b/lgtm.yml new file mode 100644 index 00000000000..eb93bde7b16 --- /dev/null +++ b/lgtm.yml @@ -0,0 +1,8 @@ +extraction: + javascript: + index: + filters: + - exclude: "**/jquery*.js" + - exclude: "**/bootstrap*.js" + - exclude: "**/webapp/fa/*.js" + diff --git a/src/changes/changes.xml b/src/changes/changes.xml index bad68af70cc..73cf5f8975d 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -340,6 +340,10 @@ it hasn't been permitted in the spec for a very long time. Hopefully this change will not impact anyone! + + A potential XXE vulnerability in the validator was corrected. The XML parser used for validating + XML payloads (i.e. FHIR resources) will no longer read from DTD declarations. +